diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk-0.3.14.dist-info/licenses/LICENSE b/python/user_packages/Python313/site-packages/langgraph_sdk-0.3.14.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..fc0602feecdd6748623c852ab534e1ca612673c7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk-0.3.14.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 LangChain, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/__init__.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..16bf0e4ffd13a100a8141ed0f050c10021380704 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/__init__.py @@ -0,0 +1,20 @@ +"""Async client exports.""" + +from langgraph_sdk._async.assistants import AssistantsClient +from langgraph_sdk._async.client import LangGraphClient, get_client +from langgraph_sdk._async.cron import CronClient +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk._async.runs import RunsClient +from langgraph_sdk._async.store import StoreClient +from langgraph_sdk._async.threads import ThreadsClient + +__all__ = [ + "AssistantsClient", + "CronClient", + "HttpClient", + "LangGraphClient", + "RunsClient", + "StoreClient", + "ThreadsClient", + "get_client", +] diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/assistants.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/assistants.py new file mode 100644 index 0000000000000000000000000000000000000000..3620401cb959fc5b0d48d77036497ab896dd5fd6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/assistants.py @@ -0,0 +1,733 @@ +"""Async client for managing assistants in LangGraph.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, cast, overload + +import httpx + +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk.schema import ( + Assistant, + AssistantSelectField, + AssistantSortBy, + AssistantsSearchResponse, + AssistantVersion, + Config, + Context, + GraphSchema, + Json, + OnConflictBehavior, + QueryParamTypes, + SortOrder, + Subgraphs, +) + + +class AssistantsClient: + """Client for managing assistants in LangGraph. + + This class provides methods to interact with assistants, + which are versioned configurations of your graph. + + ???+ example "Example" + + ```python + client = get_client(url="http://localhost:2024") + assistant = await client.assistants.get("assistant_id_123") + ``` + """ + + def __init__(self, http: HttpClient) -> None: + self.http = http + + async def get( + self, + assistant_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Get an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Assistant: Assistant Object. + + ???+ example "Example Usage" + + ```python + assistant = await client.assistants.get( + assistant_id="my_assistant_id" + ) + print(assistant) + ``` + + ```shell + ---------------------------------------------------- + + { + 'assistant_id': 'my_assistant_id', + 'graph_id': 'agent', + 'created_at': '2024-06-25T17:10:33.109781+00:00', + 'updated_at': '2024-06-25T17:10:33.109781+00:00', + 'config': {}, + 'metadata': {'created_by': 'system'}, + 'version': 1, + 'name': 'my_assistant' + } + ``` + """ + return await self.http.get( + f"/assistants/{assistant_id}", headers=headers, params=params + ) + + async def get_graph( + self, + assistant_id: str, + *, + xray: int | bool = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> dict[str, list[dict[str, Any]]]: + """Get the graph of an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get the graph of. + xray: Include graph representation of subgraphs. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Graph: The graph information for the assistant in JSON format. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + graph_info = await client.assistants.get_graph( + assistant_id="my_assistant_id" + ) + print(graph_info) + ``` + + ```shell + + -------------------------------------------------------------------------------------------------------------------------- + + { + 'nodes': + [ + {'id': '__start__', 'type': 'schema', 'data': '__start__'}, + {'id': '__end__', 'type': 'schema', 'data': '__end__'}, + {'id': 'agent','type': 'runnable','data': {'id': ['langgraph', 'utils', 'RunnableCallable'],'name': 'agent'}}, + ], + 'edges': + [ + {'source': '__start__', 'target': 'agent'}, + {'source': 'agent','target': '__end__'} + ] + } + ``` + + + """ + query_params = {"xray": xray} + if params: + query_params.update(params) + + return await self.http.get( + f"/assistants/{assistant_id}/graph", params=query_params, headers=headers + ) + + async def get_schemas( + self, + assistant_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> GraphSchema: + """Get the schemas of an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get the schema of. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + GraphSchema: The graph schema for the assistant. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + schema = await client.assistants.get_schemas( + assistant_id="my_assistant_id" + ) + print(schema) + ``` + + ```shell + + ---------------------------------------------------------------------------------------------------------------------------- + + { + 'graph_id': 'agent', + 'state_schema': + { + 'title': 'LangGraphInput', + '$ref': '#/definitions/AgentState', + 'definitions': + { + 'BaseMessage': + { + 'title': 'BaseMessage', + 'description': 'Base abstract Message class. Messages are the inputs and outputs of ChatModels.', + 'type': 'object', + 'properties': + { + 'content': + { + 'title': 'Content', + 'anyOf': [ + {'type': 'string'}, + {'type': 'array','items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}} + ] + }, + 'additional_kwargs': + { + 'title': 'Additional Kwargs', + 'type': 'object' + }, + 'response_metadata': + { + 'title': 'Response Metadata', + 'type': 'object' + }, + 'type': + { + 'title': 'Type', + 'type': 'string' + }, + 'name': + { + 'title': 'Name', + 'type': 'string' + }, + 'id': + { + 'title': 'Id', + 'type': 'string' + } + }, + 'required': ['content', 'type'] + }, + 'AgentState': + { + 'title': 'AgentState', + 'type': 'object', + 'properties': + { + 'messages': + { + 'title': 'Messages', + 'type': 'array', + 'items': {'$ref': '#/definitions/BaseMessage'} + } + }, + 'required': ['messages'] + } + } + }, + 'context_schema': + { + 'title': 'Context', + 'type': 'object', + 'properties': + { + 'model_name': + { + 'title': 'Model Name', + 'enum': ['anthropic', 'openai'], + 'type': 'string' + } + } + } + } + ``` + + """ + return await self.http.get( + f"/assistants/{assistant_id}/schemas", headers=headers, params=params + ) + + async def get_subgraphs( + self, + assistant_id: str, + namespace: str | None = None, + recurse: bool = False, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Subgraphs: + """Get the schemas of an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get the schema of. + namespace: Optional namespace to filter by. + recurse: Whether to recursively get subgraphs. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Subgraphs: The graph schema for the assistant. + + """ + get_params = {"recurse": recurse} + if params: + get_params = {**get_params, **dict(params)} + if namespace is not None: + return await self.http.get( + f"/assistants/{assistant_id}/subgraphs/{namespace}", + params=get_params, + headers=headers, + ) + else: + return await self.http.get( + f"/assistants/{assistant_id}/subgraphs", + params=get_params, + headers=headers, + ) + + async def create( + self, + graph_id: str | None, + config: Config | None = None, + *, + context: Context | None = None, + metadata: Json = None, + assistant_id: str | None = None, + if_exists: OnConflictBehavior | None = None, + name: str | None = None, + headers: Mapping[str, str] | None = None, + description: str | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Create a new assistant. + + Useful when graph is configurable and you want to create different assistants based on different configurations. + + Args: + graph_id: The ID of the graph the assistant should use. The graph ID is normally set in your langgraph.json configuration. + config: Configuration to use for the graph. + metadata: Metadata to add to assistant. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + assistant_id: Assistant ID to use, will default to a random UUID if not provided. + if_exists: How to handle duplicate creation. Defaults to 'raise' under the hood. + Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing assistant). + name: The name of the assistant. Defaults to 'Untitled' under the hood. + headers: Optional custom headers to include with the request. + description: Optional description of the assistant. + The description field is available for langgraph-api server version>=0.0.45 + params: Optional query parameters to include with the request. + + Returns: + Assistant: The created assistant. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + assistant = await client.assistants.create( + graph_id="agent", + context={"model_name": "openai"}, + metadata={"number":1}, + assistant_id="my-assistant-id", + if_exists="do_nothing", + name="my_name" + ) + ``` + """ + payload: dict[str, Any] = { + "graph_id": graph_id, + } + if config: + payload["config"] = config + if context: + payload["context"] = context + if metadata: + payload["metadata"] = metadata + if assistant_id: + payload["assistant_id"] = assistant_id + if if_exists: + payload["if_exists"] = if_exists + if name: + payload["name"] = name + if description: + payload["description"] = description + return await self.http.post( + "/assistants", json=payload, headers=headers, params=params + ) + + async def update( + self, + assistant_id: str, + *, + graph_id: str | None = None, + config: Config | None = None, + context: Context | None = None, + metadata: Json = None, + name: str | None = None, + headers: Mapping[str, str] | None = None, + description: str | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Update an assistant. + + Use this to point to a different graph, update the configuration, or change the metadata of an assistant. + + Args: + assistant_id: Assistant to update. + graph_id: The ID of the graph the assistant should use. + The graph ID is normally set in your langgraph.json configuration. If `None`, assistant will keep pointing to same graph. + config: Configuration to use for the graph. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + metadata: Metadata to merge with existing assistant metadata. + name: The new name for the assistant. + headers: Optional custom headers to include with the request. + description: Optional description of the assistant. + The description field is available for langgraph-api server version>=0.0.45 + params: Optional query parameters to include with the request. + + Returns: + The updated assistant. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + assistant = await client.assistants.update( + assistant_id='e280dad7-8618-443f-87f1-8e41841c180f', + graph_id="other-graph", + context={"model_name": "anthropic"}, + metadata={"number":2} + ) + ``` + + """ + payload: dict[str, Any] = {} + if graph_id: + payload["graph_id"] = graph_id + if config is not None: + payload["config"] = config + if context is not None: + payload["context"] = context + if metadata: + payload["metadata"] = metadata + if name: + payload["name"] = name + if description: + payload["description"] = description + return await self.http.patch( + f"/assistants/{assistant_id}", + json=payload, + headers=headers, + params=params, + ) + + async def delete( + self, + assistant_id: str, + *, + delete_threads: bool = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Delete an assistant. + + Args: + assistant_id: The assistant ID to delete. + delete_threads: If true, delete all threads with `metadata.assistant_id` + matching this assistant, along with runs and checkpoints belonging to + those threads. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.assistants.delete( + assistant_id="my_assistant_id" + ) + ``` + + """ + query_params: dict[str, Any] = {} + if delete_threads: + query_params["delete_threads"] = True + if params: + query_params.update(params) + await self.http.delete( + f"/assistants/{assistant_id}", + headers=headers, + params=query_params or None, + ) + + @overload + async def search( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + limit: int = 10, + offset: int = 0, + sort_by: AssistantSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[AssistantSelectField] | None = None, + response_format: Literal["object"], + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> AssistantsSearchResponse: ... + + @overload + async def search( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + limit: int = 10, + offset: int = 0, + sort_by: AssistantSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[AssistantSelectField] | None = None, + response_format: Literal["array"] = "array", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[Assistant]: ... + + async def search( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + limit: int = 10, + offset: int = 0, + sort_by: AssistantSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[AssistantSelectField] | None = None, + response_format: Literal["array", "object"] = "array", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> AssistantsSearchResponse | list[Assistant]: + """Search for assistants. + + Args: + metadata: Metadata to filter by. Exact match filter for each KV pair. + graph_id: The ID of the graph to filter by. + The graph ID is normally set in your langgraph.json configuration. + name: The name of the assistant to filter by. + The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name. + limit: The maximum number of results to return. + offset: The number of results to skip. + sort_by: The field to sort by. + sort_order: The order to sort by. + select: Specific assistant fields to include in the response. + response_format: Controls the response shape. Use `"array"` (default) + to return a bare list of assistants, or `"object"` to return + a mapping containing assistants plus pagination metadata. + Defaults to "array", though this default will be changed to "object" in a future release. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + A list of assistants (when `response_format="array"`) or a mapping + with the assistants and the next pagination cursor (when + `response_format="object"`). + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + response = await client.assistants.search( + metadata = {"name":"my_name"}, + graph_id="my_graph_id", + limit=5, + offset=5, + response_format="object" + ) + next_cursor = response["next"] + assistants = response["assistants"] + ``` + """ + if response_format not in ("array", "object"): + raise ValueError( + f"response_format must be 'array' or 'object', got {response_format!r}" + ) + payload: dict[str, Any] = { + "limit": limit, + "offset": offset, + } + if metadata: + payload["metadata"] = metadata + if graph_id: + payload["graph_id"] = graph_id + if name: + payload["name"] = name + if sort_by: + payload["sort_by"] = sort_by + if sort_order: + payload["sort_order"] = sort_order + if select: + payload["select"] = select + next_cursor: str | None = None + + def capture_pagination(response: httpx.Response) -> None: + nonlocal next_cursor + next_cursor = response.headers.get("X-Pagination-Next") + + assistants = cast( + list[Assistant], + await self.http.post( + "/assistants/search", + json=payload, + headers=headers, + params=params, + on_response=capture_pagination if response_format == "object" else None, + ), + ) + if response_format == "object": + return {"assistants": assistants, "next": next_cursor} + return assistants + + async def count( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> int: + """Count assistants matching filters. + + Args: + metadata: Metadata to filter by. Exact match for each key/value. + graph_id: Optional graph id to filter by. + name: Optional name to filter by. + The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + int: Number of assistants matching the criteria. + """ + payload: dict[str, Any] = {} + if metadata: + payload["metadata"] = metadata + if graph_id: + payload["graph_id"] = graph_id + if name: + payload["name"] = name + return await self.http.post( + "/assistants/count", json=payload, headers=headers, params=params + ) + + async def get_versions( + self, + assistant_id: str, + metadata: Json = None, + limit: int = 10, + offset: int = 0, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[AssistantVersion]: + """List all versions of an assistant. + + Args: + assistant_id: The assistant ID to get versions for. + metadata: Metadata to filter versions by. Exact match filter for each KV pair. + limit: The maximum number of versions to return. + offset: The number of versions to skip. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + A list of assistant versions. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + assistant_versions = await client.assistants.get_versions( + assistant_id="my_assistant_id" + ) + ``` + """ + + payload: dict[str, Any] = { + "limit": limit, + "offset": offset, + } + if metadata: + payload["metadata"] = metadata + return await self.http.post( + f"/assistants/{assistant_id}/versions", + json=payload, + headers=headers, + params=params, + ) + + async def set_latest( + self, + assistant_id: str, + version: int, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Change the version of an assistant. + + Args: + assistant_id: The assistant ID to delete. + version: The version to change to. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Assistant Object. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + new_version_assistant = await client.assistants.set_latest( + assistant_id="my_assistant_id", + version=3 + ) + ``` + + """ + + payload: dict[str, Any] = {"version": version} + + return await self.http.post( + f"/assistants/{assistant_id}/latest", + json=payload, + headers=headers, + params=params, + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/client.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/client.py new file mode 100644 index 0000000000000000000000000000000000000000..3087ead5c5f899c98c42d3f8878bd4d1039c98c1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/client.py @@ -0,0 +1,178 @@ +"""Async LangGraph client.""" + +from __future__ import annotations + +import logging +import os +from collections.abc import Mapping +from types import TracebackType + +import httpx + +from langgraph_sdk._async.assistants import AssistantsClient +from langgraph_sdk._async.cron import CronClient +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk._async.runs import RunsClient +from langgraph_sdk._async.store import StoreClient +from langgraph_sdk._async.threads import ThreadsClient +from langgraph_sdk._shared.types import TimeoutTypes +from langgraph_sdk._shared.utilities import ( + NOT_PROVIDED, + _get_headers, + _registered_transports, + get_asgi_transport, +) + +logger = logging.getLogger(__name__) + + +def get_client( + *, + url: str | None = None, + api_key: str | None = NOT_PROVIDED, + headers: Mapping[str, str] | None = None, + timeout: TimeoutTypes | None = None, +) -> LangGraphClient: + """Create and configure a LangGraphClient. + + The client provides programmatic access to LangSmith Deployment. It supports + both remote servers and local in-process connections (when running inside a LangGraph server). + + Args: + url: + Base URL of the LangGraph API. + - If `None`, the client first attempts an in-process connection via ASGI transport. + If that fails, it defers registration until after app initialization. This + only works if the client is used from within the Agent server. + api_key: + API key for authentication. Can be: + - A string: use this exact API key + - `None`: explicitly skip loading from environment variables + - Not provided (default): auto-load from environment in this order: + 1. `LANGGRAPH_API_KEY` + 2. `LANGSMITH_API_KEY` + 3. `LANGCHAIN_API_KEY` + headers: + Additional HTTP headers to include in requests. Merged with authentication headers. + timeout: + HTTP timeout configuration. May be: + - `httpx.Timeout` instance + - float (total seconds) + - tuple `(connect, read, write, pool)` in seconds + Defaults: connect=5, read=300, write=300, pool=5. + + Returns: + LangGraphClient: + A top-level client exposing sub-clients for assistants, threads, + runs, and cron operations. + + ???+ example "Connect to a remote server:" + + ```python + from langgraph_sdk import get_client + + # get top-level LangGraphClient + client = get_client(url="http://localhost:8123") + + # example usage: client..() + assistants = await client.assistants.get(assistant_id="some_uuid") + ``` + + ???+ example "Connect in-process to a running LangGraph server:" + + ```python + from langgraph_sdk import get_client + + client = get_client(url=None) + + async def my_node(...): + subagent_result = await client.runs.wait( + thread_id=None, + assistant_id="agent", + input={"messages": [{"role": "user", "content": "Foo"}]}, + ) + ``` + + ???+ example "Skip auto-loading API key from environment:" + + ```python + from langgraph_sdk import get_client + + # Don't load API key from environment variables + client = get_client( + url="http://localhost:8123", + api_key=None + ) + ``` + """ + + transport: httpx.AsyncBaseTransport | None = None + if url is None: + url = "http://api" + if os.environ.get("__LANGGRAPH_DEFER_LOOPBACK_TRANSPORT") == "true": + transport = get_asgi_transport()(app=None, root_path="/noauth") # type: ignore[invalid-argument-type] + _registered_transports.append(transport) + else: + try: + from langgraph_api.server import app # type: ignore + + transport = get_asgi_transport()(app, root_path="/noauth") + except Exception: + logger.debug( + "Failed to connect to in-process LangGraph server. Deferring configuration.", + exc_info=True, + ) + transport = get_asgi_transport()(app=None, root_path="/noauth") # type: ignore[invalid-argument-type] + _registered_transports.append(transport) + + if transport is None: + transport = httpx.AsyncHTTPTransport(retries=5) + client = httpx.AsyncClient( + base_url=url, + transport=transport, + timeout=( + httpx.Timeout(timeout) # type: ignore[arg-type] + if timeout is not None + else httpx.Timeout(connect=5, read=300, write=300, pool=5) + ), + headers=_get_headers(api_key, headers), + ) + return LangGraphClient(client) + + +class LangGraphClient: + """Top-level client for LangGraph API. + + Attributes: + assistants: Manages versioned configuration for your graphs. + threads: Handles (potentially) multi-turn interactions, such as conversational threads. + runs: Controls individual invocations of the graph. + crons: Manages scheduled operations. + store: Interfaces with persistent, shared data storage. + """ + + def __init__(self, client: httpx.AsyncClient) -> None: + self.http = HttpClient(client) + self.assistants = AssistantsClient(self.http) + self.threads = ThreadsClient(self.http) + self.runs = RunsClient(self.http) + self.crons = CronClient(self.http) + self.store = StoreClient(self.http) + + async def __aenter__(self) -> LangGraphClient: + """Enter the async context manager.""" + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + """Exit the async context manager.""" + await self.aclose() + + async def aclose(self) -> None: + """Close the underlying HTTP client.""" + if hasattr(self, "http"): + await self.http.client.aclose() diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/cron.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/cron.py new file mode 100644 index 0000000000000000000000000000000000000000..8ffd73a323934e15391cbc5b4837ff7353d4b44f --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/cron.py @@ -0,0 +1,521 @@ +"""Async client for managing recurrent runs (cron jobs) in LangGraph.""" + +from __future__ import annotations + +import warnings +from collections.abc import Mapping, Sequence +from datetime import datetime, tzinfo +from typing import Any + +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk._shared.utilities import _resolve_timezone +from langgraph_sdk.schema import ( + All, + Config, + Context, + Cron, + CronSelectField, + CronSortBy, + Durability, + Input, + OnCompletionBehavior, + QueryParamTypes, + Run, + SortOrder, + StreamMode, +) + + +class CronClient: + """Client for managing recurrent runs (cron jobs) in LangGraph. + + A run is a single invocation of an assistant with optional input, config, and context. + This client allows scheduling recurring runs to occur automatically. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024")) + cron_job = await client.crons.create_for_thread( + thread_id="thread_123", + assistant_id="asst_456", + schedule="0 9 * * *", + input={"message": "Daily update"} + ) + ``` + + !!! note "Feature Availability" + + The crons client functionality is not supported on all licenses. + Please check the relevant license documentation for the most up-to-date + details on feature availability. + """ + + def __init__(self, http_client: HttpClient) -> None: + self.http = http_client + + async def create_for_thread( + self, + thread_id: str, + assistant_id: str, + *, + schedule: str, + input: Input | None = None, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint_during: bool | None = None, # deprecated + interrupt_before: All | list[str] | None = None, + interrupt_after: All | list[str] | None = None, + webhook: str | None = None, + multitask_strategy: str | None = None, + end_time: datetime | None = None, + enabled: bool | None = None, + timezone: str | tzinfo | None = None, + stream_mode: StreamMode | Sequence[StreamMode] | None = None, + stream_subgraphs: bool | None = None, + stream_resumable: bool | None = None, + durability: Durability | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Run: + """Create a cron job for a thread. + + Args: + thread_id: the thread ID to run the cron job on. + assistant_id: The assistant ID or graph name to use for the cron job. + If using graph name, will default to first assistant created from that graph. + schedule: The cron schedule to execute this job on. + Schedules are interpreted in UTC unless a timezone is specified. + input: The input to the graph. + metadata: Metadata to assign to the cron job runs. + config: The configuration for the assistant. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + checkpoint_during: (deprecated) Whether to checkpoint during the run (or only at the end/interruption). + interrupt_before: Nodes to interrupt immediately before they get executed. + + interrupt_after: Nodes to Nodes to interrupt immediately after they get executed. + + webhook: Webhook to call after LangGraph API call is done. + multitask_strategy: Multitask strategy to use. + Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. + end_time: The time to stop running the cron job. If not provided, the cron job will run indefinitely. + enabled: Whether the cron job is enabled or not. + timezone: IANA timezone for the cron schedule. Accepts a string (e.g. 'America/New_York') or a ``datetime.tzinfo`` instance (e.g. ``ZoneInfo("America/New_York")``). + stream_mode: The stream mode(s) to use. + stream_subgraphs: Whether to stream output from subgraphs. + stream_resumable: Whether to persist the stream chunks in order to resume the stream later. + durability: Durability level for the run. Must be one of 'sync', 'async', or 'exit'. + "async" means checkpoints are persisted async while next graph step executes, replaces checkpoint_during=True + "sync" means checkpoints are persisted sync after graph step executes, replaces checkpoint_during=False + "exit" means checkpoints are only persisted when the run exits, does not save intermediate steps + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The cron run. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + cron_run = await client.crons.create_for_thread( + thread_id="my-thread-id", + assistant_id="agent", + schedule="27 15 * * *", + input={"messages": [{"role": "user", "content": "hello!"}]}, + metadata={"name":"my_run"}, + context={"model_name": "openai"}, + interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], + interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], + webhook="https://my.fake.webhook.com", + multitask_strategy="interrupt", + enabled=True, + ) + ``` + """ + if checkpoint_during is not None: + warnings.warn( + "`checkpoint_during` is deprecated and will be removed in a future version. Use `durability` instead.", + DeprecationWarning, + stacklevel=2, + ) + + payload = { + "schedule": schedule, + "input": input, + "config": config, + "metadata": metadata, + "context": context, + "assistant_id": assistant_id, + "checkpoint_during": checkpoint_during, + "interrupt_before": interrupt_before, + "interrupt_after": interrupt_after, + "webhook": webhook, + "end_time": end_time.isoformat() if end_time else None, + "enabled": enabled, + "timezone": _resolve_timezone(timezone), + "stream_mode": stream_mode, + "stream_subgraphs": stream_subgraphs, + "stream_resumable": stream_resumable, + "durability": durability, + } + if multitask_strategy: + payload["multitask_strategy"] = multitask_strategy + payload = {k: v for k, v in payload.items() if v is not None} + return await self.http.post( + f"/threads/{thread_id}/runs/crons", + json=payload, + headers=headers, + params=params, + ) + + async def create( + self, + assistant_id: str, + *, + schedule: str, + input: Input | None = None, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint_during: bool | None = None, # deprecated + interrupt_before: All | list[str] | None = None, + interrupt_after: All | list[str] | None = None, + webhook: str | None = None, + on_run_completed: OnCompletionBehavior | None = None, + multitask_strategy: str | None = None, + end_time: datetime | None = None, + enabled: bool | None = None, + timezone: str | tzinfo | None = None, + stream_mode: StreamMode | Sequence[StreamMode] | None = None, + stream_subgraphs: bool | None = None, + stream_resumable: bool | None = None, + durability: Durability | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Run: + """Create a cron run. + + Args: + assistant_id: The assistant ID or graph name to use for the cron job. + If using graph name, will default to first assistant created from that graph. + schedule: The cron schedule to execute this job on. + Schedules are interpreted in UTC unless a timezone is specified. + input: The input to the graph. + metadata: Metadata to assign to the cron job runs. + config: The configuration for the assistant. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + checkpoint_during: (deprecated) Whether to checkpoint during the run (or only at the end/interruption). + interrupt_before: Nodes to interrupt immediately before they get executed. + interrupt_after: Nodes to Nodes to interrupt immediately after they get executed. + webhook: Webhook to call after LangGraph API call is done. + on_run_completed: What to do with the thread after the run completes. + Must be one of 'delete' (default) or 'keep'. 'delete' removes the thread + after execution. 'keep' creates a new thread for each execution but does not + clean them up. Clients are responsible for cleaning up kept threads. + multitask_strategy: Multitask strategy to use. + Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. + end_time: The time to stop running the cron job. If not provided, the cron job will run indefinitely. + enabled: Whether the cron job is enabled or not. + timezone: IANA timezone for the cron schedule. Accepts a string (e.g. 'America/New_York') or a ``datetime.tzinfo`` instance (e.g. ``ZoneInfo("America/New_York")``). + stream_mode: The stream mode(s) to use. + stream_subgraphs: Whether to stream output from subgraphs. + stream_resumable: Whether to persist the stream chunks in order to resume the stream later. + durability: Durability level for the run. Must be one of 'sync', 'async', or 'exit'. + "async" means checkpoints are persisted async while next graph step executes, replaces checkpoint_during=True + "sync" means checkpoints are persisted sync after graph step executes, replaces checkpoint_during=False + "exit" means checkpoints are only persisted when the run exits, does not save intermediate steps + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The cron run. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + cron_run = client.crons.create( + assistant_id="agent", + schedule="27 15 * * *", + input={"messages": [{"role": "user", "content": "hello!"}]}, + metadata={"name":"my_run"}, + context={"model_name": "openai"}, + interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], + interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], + webhook="https://my.fake.webhook.com", + multitask_strategy="interrupt", + enabled=True, + ) + ``` + + """ + if checkpoint_during is not None: + warnings.warn( + "`checkpoint_during` is deprecated and will be removed in a future version. Use `durability` instead.", + DeprecationWarning, + stacklevel=2, + ) + + payload = { + "schedule": schedule, + "input": input, + "config": config, + "metadata": metadata, + "context": context, + "assistant_id": assistant_id, + "checkpoint_during": checkpoint_during, + "interrupt_before": interrupt_before, + "interrupt_after": interrupt_after, + "webhook": webhook, + "on_run_completed": on_run_completed, + "end_time": end_time.isoformat() if end_time else None, + "enabled": enabled, + "timezone": _resolve_timezone(timezone), + "stream_mode": stream_mode, + "stream_subgraphs": stream_subgraphs, + "stream_resumable": stream_resumable, + "durability": durability, + } + if multitask_strategy: + payload["multitask_strategy"] = multitask_strategy + payload = {k: v for k, v in payload.items() if v is not None} + return await self.http.post( + "/runs/crons", json=payload, headers=headers, params=params + ) + + async def delete( + self, + cron_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Delete a cron. + + Args: + cron_id: The cron ID to delete. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.crons.delete( + cron_id="cron_to_delete" + ) + ``` + + """ + await self.http.delete(f"/runs/crons/{cron_id}", headers=headers, params=params) + + async def update( + self, + cron_id: str, + *, + schedule: str | None = None, + end_time: datetime | None = None, + input: Input | None = None, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + webhook: str | None = None, + interrupt_before: All | list[str] | None = None, + interrupt_after: All | list[str] | None = None, + on_run_completed: OnCompletionBehavior | None = None, + enabled: bool | None = None, + timezone: str | tzinfo | None = None, + stream_mode: StreamMode | Sequence[StreamMode] | None = None, + stream_subgraphs: bool | None = None, + stream_resumable: bool | None = None, + durability: Durability | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Cron: + """Update a cron job by ID. + + Args: + cron_id: The cron ID to update. + schedule: The cron schedule to execute this job on. + Schedules are interpreted in UTC unless a timezone is specified. + end_time: The end date to stop running the cron. + input: The input to the graph. + metadata: Metadata to assign to the cron job runs. + config: The configuration for the assistant. + context: Static context added to the assistant. + webhook: Webhook to call after LangGraph API call is done. + interrupt_before: Nodes to interrupt immediately before they get executed. + interrupt_after: Nodes to interrupt immediately after they get executed. + on_run_completed: What to do with the thread after the run completes. + Must be one of 'delete' or 'keep'. 'delete' removes the thread + after execution. 'keep' creates a new thread for each execution but does not + clean them up. + enabled: Enable or disable the cron job. + timezone: IANA timezone for the cron schedule. Accepts a string (e.g. 'America/New_York') or a ``datetime.tzinfo`` instance (e.g. ``ZoneInfo("America/New_York")``). + stream_mode: The stream mode(s) to use. + stream_subgraphs: Whether to stream output from subgraphs. + stream_resumable: Whether to persist the stream chunks in order to resume the stream later. + durability: Durability level for the run. Must be one of 'sync', 'async', or 'exit'. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The updated cron job. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + updated_cron = await client.crons.update( + cron_id="1ef3cefa-4c09-6926-96d0-3dc97fd5e39b", + schedule="0 10 * * *", + enabled=False, + ) + ``` + + """ + payload = { + "schedule": schedule, + "end_time": end_time.isoformat() if end_time else None, + "input": input, + "metadata": metadata, + "config": config, + "context": context, + "webhook": webhook, + "interrupt_before": interrupt_before, + "interrupt_after": interrupt_after, + "on_run_completed": on_run_completed, + "enabled": enabled, + "timezone": _resolve_timezone(timezone), + "stream_mode": stream_mode, + "stream_subgraphs": stream_subgraphs, + "stream_resumable": stream_resumable, + "durability": durability, + } + payload = {k: v for k, v in payload.items() if v is not None} + return await self.http.patch( + f"/runs/crons/{cron_id}", + json=payload, + headers=headers, + params=params, + ) + + async def search( + self, + *, + assistant_id: str | None = None, + thread_id: str | None = None, + enabled: bool | None = None, + limit: int = 10, + offset: int = 0, + sort_by: CronSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[CronSelectField] | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[Cron]: + """Get a list of cron jobs. + + Args: + assistant_id: The assistant ID or graph name to search for. + thread_id: the thread ID to search for. + enabled: The enabled status to search for. + limit: The maximum number of results to return. + offset: The number of results to skip. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The list of cron jobs returned by the search, + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + cron_jobs = await client.crons.search( + assistant_id="my_assistant_id", + thread_id="my_thread_id", + enabled=True, + limit=5, + offset=5, + ) + print(cron_jobs) + ``` + ```shell + + ---------------------------------------------------------- + + [ + { + 'cron_id': '1ef3cefa-4c09-6926-96d0-3dc97fd5e39b', + 'assistant_id': 'my_assistant_id', + 'thread_id': 'my_thread_id', + 'user_id': None, + 'payload': + { + 'input': {'start_time': ''}, + 'schedule': '4 * * * *', + 'assistant_id': 'my_assistant_id' + }, + 'schedule': '4 * * * *', + 'next_run_date': '2024-07-25T17:04:00+00:00', + 'end_time': None, + 'created_at': '2024-07-08T06:02:23.073257+00:00', + 'updated_at': '2024-07-08T06:02:23.073257+00:00' + } + ] + ``` + + """ + payload: dict[str, Any] = { + "assistant_id": assistant_id, + "thread_id": thread_id, + "enabled": enabled, + "limit": limit, + "offset": offset, + } + if sort_by: + payload["sort_by"] = sort_by + if sort_order: + payload["sort_order"] = sort_order + if select: + payload["select"] = select + payload = {k: v for k, v in payload.items() if v is not None} + return await self.http.post( + "/runs/crons/search", json=payload, headers=headers, params=params + ) + + async def count( + self, + *, + assistant_id: str | None = None, + thread_id: str | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> int: + """Count cron jobs matching filters. + + Args: + assistant_id: Assistant ID to filter by. + thread_id: Thread ID to filter by. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + int: Number of crons matching the criteria. + """ + payload: dict[str, Any] = {} + if assistant_id: + payload["assistant_id"] = assistant_id + if thread_id: + payload["thread_id"] = thread_id + return await self.http.post( + "/runs/crons/count", json=payload, headers=headers, params=params + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/http.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/http.py new file mode 100644 index 0000000000000000000000000000000000000000..47c0f043fd0a8cb08ea92d438c299eb20c4c1282 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/http.py @@ -0,0 +1,312 @@ +"""HTTP client for async operations.""" + +from __future__ import annotations + +import asyncio +import logging +import sys +import warnings +from collections.abc import AsyncIterator, Callable, Mapping +from typing import Any, cast + +import httpx +import orjson + +from langgraph_sdk._shared.utilities import ( + _orjson_default, + _validate_reconnect_location, +) +from langgraph_sdk.errors import _araise_for_status_typed +from langgraph_sdk.schema import QueryParamTypes, StreamPart +from langgraph_sdk.sse import SSEDecoder, aiter_lines_raw + +logger = logging.getLogger(__name__) + + +class HttpClient: + """Handle async requests to the LangGraph API. + + Adds additional error messaging & content handling above the + provided httpx client. + + Attributes: + client (httpx.AsyncClient): Underlying HTTPX async client. + """ + + def __init__(self, client: httpx.AsyncClient) -> None: + self.client = client + + async def get( + self, + path: str, + *, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + ) -> Any: + """Send a `GET` request.""" + r = await self.client.get(path, params=params, headers=headers) + if on_response: + on_response(r) + await _araise_for_status_typed(r) + return await _adecode_json(r) + + async def post( + self, + path: str, + *, + json: dict[str, Any] | list | None, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + ) -> Any: + """Send a `POST` request.""" + if json is not None: + request_headers, content = await _aencode_json(json) + else: + request_headers, content = {}, b"" + # Merge headers, with runtime headers taking precedence + if headers: + request_headers.update(headers) + r = await self.client.post( + path, headers=request_headers, content=content, params=params + ) + if on_response: + on_response(r) + await _araise_for_status_typed(r) + return await _adecode_json(r) + + async def put( + self, + path: str, + *, + json: dict, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + ) -> Any: + """Send a `PUT` request.""" + request_headers, content = await _aencode_json(json) + if headers: + request_headers.update(headers) + r = await self.client.put( + path, headers=request_headers, content=content, params=params + ) + if on_response: + on_response(r) + await _araise_for_status_typed(r) + return await _adecode_json(r) + + async def patch( + self, + path: str, + *, + json: dict, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + ) -> Any: + """Send a `PATCH` request.""" + request_headers, content = await _aencode_json(json) + if headers: + request_headers.update(headers) + r = await self.client.patch( + path, headers=request_headers, content=content, params=params + ) + if on_response: + on_response(r) + await _araise_for_status_typed(r) + return await _adecode_json(r) + + async def delete( + self, + path: str, + *, + json: Any | None = None, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + ) -> None: + """Send a `DELETE` request.""" + r = await self.client.request( + "DELETE", path, json=json, params=params, headers=headers + ) + if on_response: + on_response(r) + await _araise_for_status_typed(r) + + async def request_reconnect( + self, + path: str, + method: str, + *, + json: dict[str, Any] | None = None, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + reconnect_limit: int = 5, + ) -> Any: + """Send a request that automatically reconnects to Location header.""" + request_headers, content = await _aencode_json(json) + if headers: + request_headers.update(headers) + async with self.client.stream( + method, path, headers=request_headers, content=content, params=params + ) as r: + if on_response: + on_response(r) + try: + r.raise_for_status() + except httpx.HTTPStatusError as e: + body = (await r.aread()).decode() + if sys.version_info >= (3, 11): + e.add_note(body) + else: + logger.error(f"Error from langgraph-api: {body}", exc_info=e) + raise e + loc = r.headers.get("location") + if reconnect_limit <= 0 or not loc: + return await _adecode_json(r) + _validate_reconnect_location(self.client.base_url, loc) + try: + return await _adecode_json(r) + except httpx.HTTPError: + warnings.warn( + f"Request failed, attempting reconnect to Location: {loc}", + stacklevel=2, + ) + await r.aclose() + return await self.request_reconnect( + loc, + "GET", + headers=request_headers, + # don't pass on_response so it's only called once + reconnect_limit=reconnect_limit - 1, + ) + + async def stream( + self, + path: str, + method: str, + *, + json: dict[str, Any] | None = None, + params: QueryParamTypes | None = None, + headers: Mapping[str, str] | None = None, + on_response: Callable[[httpx.Response], None] | None = None, + ) -> AsyncIterator[StreamPart]: + """Stream results using SSE.""" + request_headers, content = await _aencode_json(json) + request_headers["Accept"] = "text/event-stream" + request_headers["Cache-Control"] = "no-store" + # Add runtime headers with precedence + if headers: + request_headers.update(headers) + + reconnect_headers = { + key: value + for key, value in request_headers.items() + if key.lower() not in {"content-length", "content-type"} + } + + last_event_id: str | None = None + reconnect_path: str | None = None + reconnect_attempts = 0 + max_reconnect_attempts = 5 + + while True: + current_headers = dict( + request_headers if reconnect_path is None else reconnect_headers + ) + if last_event_id is not None: + current_headers["Last-Event-ID"] = last_event_id + + current_method = method if reconnect_path is None else "GET" + current_content = content if reconnect_path is None else None + current_params = params if reconnect_path is None else None + + retry = False + async with self.client.stream( + current_method, + reconnect_path or path, + headers=current_headers, + content=current_content, + params=current_params, + ) as res: + if reconnect_path is None and on_response: + on_response(res) + # check status + await _araise_for_status_typed(res) + # check content type + content_type = res.headers.get("content-type", "").partition(";")[0] + if "text/event-stream" not in content_type: + raise httpx.TransportError( + "Expected response header Content-Type to contain 'text/event-stream', " + f"got {content_type!r}" + ) + + reconnect_location = res.headers.get("location") + if reconnect_location: + _validate_reconnect_location( + self.client.base_url, reconnect_location + ) + reconnect_path = reconnect_location + + # parse SSE + decoder = SSEDecoder() + try: + async for line in aiter_lines_raw(res): + sse = decoder.decode(line=cast("bytes", line).rstrip(b"\n")) + if sse is not None: + if decoder.last_event_id is not None: + last_event_id = decoder.last_event_id + if sse.event or sse.data is not None: + yield sse + except httpx.HTTPError: + # httpx.TransportError inherits from HTTPError, so transient + # disconnects during streaming land here. + if reconnect_path is None: + raise + retry = True + else: + if sse := decoder.decode(b""): + if decoder.last_event_id is not None: + last_event_id = decoder.last_event_id + if sse.event or sse.data is not None: + # decoder.decode(b"") flushes the in-flight event and may + # return an empty placeholder when there is no pending + # message. Skip these no-op events so the stream doesn't + # emit a trailing blank item after reconnects. + yield sse + if retry: + reconnect_attempts += 1 + if reconnect_attempts > max_reconnect_attempts: + raise httpx.TransportError( + "Exceeded maximum SSE reconnection attempts" + ) + continue + break + + +async def _aencode_json(json: Any) -> tuple[dict[str, str], bytes | None]: + if json is None: + return {}, None + body = await asyncio.get_running_loop().run_in_executor( + None, + orjson.dumps, + json, + _orjson_default, + orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_NON_STR_KEYS, + ) + content_length = str(len(body)) + content_type = "application/json" + headers = {"Content-Length": content_length, "Content-Type": content_type} + return headers, body + + +async def _adecode_json(r: httpx.Response) -> Any: + body = await r.aread() + return ( + await asyncio.get_running_loop().run_in_executor(None, orjson.loads, body) + if body + else None + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/runs.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/runs.py new file mode 100644 index 0000000000000000000000000000000000000000..587d23e7d6d1ff2022fc18506089155537f73188 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/runs.py @@ -0,0 +1,1181 @@ +"""Async client for managing runs in LangGraph.""" + +from __future__ import annotations + +import builtins +import warnings +from collections.abc import AsyncIterator, Callable, Mapping, Sequence +from typing import Any, Literal, overload + +import httpx + +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk._shared.utilities import ( + _get_run_metadata_from_response, + _sse_to_v2_dict, +) +from langgraph_sdk.schema import ( + All, + BulkCancelRunsStatus, + CancelAction, + Checkpoint, + Command, + Config, + Context, + DisconnectMode, + Durability, + IfNotExists, + Input, + LangSmithTracing, + MultitaskStrategy, + OnCompletionBehavior, + QueryParamTypes, + Run, + RunCreate, + RunCreateMetadata, + RunSelectField, + RunStatus, + StreamMode, + StreamPart, + StreamPartV2, + StreamVersion, +) + + +async def _wrap_stream_v2( + raw: AsyncIterator[StreamPart], +) -> AsyncIterator[StreamPartV2]: + """Wrap a raw SSE stream, converting each event to a v2 dict.""" + async for part in raw: + v2 = _sse_to_v2_dict(part.event, part.data) + if v2 is not None: + yield v2 + + +class RunsClient: + """Client for managing runs in LangGraph. + + A run is a single assistant invocation with optional input, config, context, and metadata. + This client manages runs, which can be stateful (on threads) or stateless. + + ???+ example "Example" + + ```python + client = get_client(url="http://localhost:2024") + run = await client.runs.create(assistant_id="asst_123", thread_id="thread_456", input={"query": "Hello"}) + ``` + """ + + def __init__(self, http: HttpClient) -> None: + self.http = http + + @overload + def stream( + self, + thread_id: str, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + feedback_keys: Sequence[str] | None = None, + on_disconnect: DisconnectMode | None = None, + webhook: str | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + version: Literal["v1"] = "v1", + ) -> AsyncIterator[StreamPart]: ... + + @overload + def stream( + self, + thread_id: str, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + feedback_keys: Sequence[str] | None = None, + on_disconnect: DisconnectMode | None = None, + webhook: str | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + version: Literal["v2"], + ) -> AsyncIterator[StreamPartV2]: ... + + @overload + def stream( + self, + thread_id: None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + feedback_keys: Sequence[str] | None = None, + on_disconnect: DisconnectMode | None = None, + on_completion: OnCompletionBehavior | None = None, + if_not_exists: IfNotExists | None = None, + webhook: str | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + version: Literal["v1"] = "v1", + ) -> AsyncIterator[StreamPart]: ... + + @overload + def stream( + self, + thread_id: None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + feedback_keys: Sequence[str] | None = None, + on_disconnect: DisconnectMode | None = None, + on_completion: OnCompletionBehavior | None = None, + if_not_exists: IfNotExists | None = None, + webhook: str | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + version: Literal["v2"], + ) -> AsyncIterator[StreamPartV2]: ... + + def stream( + self, + thread_id: str | None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, # deprecated + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + feedback_keys: Sequence[str] | None = None, + on_disconnect: DisconnectMode | None = None, + on_completion: OnCompletionBehavior | None = None, + webhook: str | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + durability: Durability | None = None, + version: StreamVersion = "v1", + ) -> AsyncIterator[StreamPart | StreamPartV2]: + """Create a run and stream the results. + + Args: + thread_id: the thread ID to assign to the thread. + If `None` will create a stateless run. + assistant_id: The assistant ID or graph name to stream from. + If using graph name, will default to first assistant created from that graph. + input: The input to the graph. + command: A command to execute. Cannot be combined with input. + stream_mode: The stream mode(s) to use. + stream_subgraphs: Whether to stream output from subgraphs. + stream_resumable: Whether the stream is considered resumable. + If true, the stream can be resumed and replayed in its entirety even after disconnection. + metadata: Metadata to assign to the run. + config: The configuration for the assistant. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + checkpoint: The checkpoint to resume from. + checkpoint_during: (deprecated) Whether to checkpoint during the run (or only at the end/interruption). + interrupt_before: Nodes to interrupt immediately before they get executed. + interrupt_after: Nodes to Nodes to interrupt immediately after they get executed. + feedback_keys: Feedback keys to assign to run. + on_disconnect: The disconnect mode to use. + Must be one of 'cancel' or 'continue'. + on_completion: Whether to delete or keep the thread created for a stateless run. + Must be one of 'delete' or 'keep'. + webhook: Webhook to call after LangGraph API call is done. + multitask_strategy: Multitask strategy to use. + Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. + if_not_exists: How to handle missing thread. Defaults to 'reject'. + Must be either 'reject' (raise error if missing), or 'create' (create new thread). + after_seconds: The number of seconds to wait before starting the run. + Use to schedule future runs. + langsmith_tracing: LangSmith tracing configuration. Allows routing traces + to a specific project or associating with a dataset example. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + on_run_created: Callback when a run is created. + durability: The durability to use for the run. Values are "sync", "async", or "exit". + "async" means checkpoints are persisted async while next graph step executes, replaces checkpoint_during=True + "sync" means checkpoints are persisted sync after graph step executes, replaces checkpoint_during=False + "exit" means checkpoints are only persisted when the run exits, does not save intermediate steps + version: Stream format version. "v1" (default) returns raw SSE StreamPart + NamedTuples. "v2" returns typed dicts with `type`, `ns`, and `data` keys. + + Returns: + Asynchronous iterator of stream results. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024) + async for chunk in client.runs.stream( + thread_id=None, + assistant_id="agent", + input={"messages": [{"role": "user", "content": "how are you?"}]}, + stream_mode=["values","debug"], + metadata={"name":"my_run"}, + context={"model_name": "anthropic"}, + interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], + interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], + feedback_keys=["my_feedback_key_1","my_feedback_key_2"], + webhook="https://my.fake.webhook.com", + multitask_strategy="interrupt" + ): + print(chunk) + ``` + + ```shell + + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + StreamPart(event='metadata', data={'run_id': '1ef4a9b8-d7da-679a-a45a-872054341df2'}) + StreamPart(event='values', data={'messages': [{'content': 'how are you?', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'fe0a5778-cfe9-42ee-b807-0adaa1873c10', 'example': False}]}) + StreamPart(event='values', data={'messages': [{'content': 'how are you?', 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'human', 'name': None, 'id': 'fe0a5778-cfe9-42ee-b807-0adaa1873c10', 'example': False}, {'content': "I'm doing well, thanks for asking! I'm an AI assistant created by Anthropic to be helpful, honest, and harmless.", 'additional_kwargs': {}, 'response_metadata': {}, 'type': 'ai', 'name': None, 'id': 'run-159b782c-b679-4830-83c6-cef87798fe8b', 'example': False, 'tool_calls': [], 'invalid_tool_calls': [], 'usage_metadata': None}]}) + StreamPart(event='end', data=None) + ``` + + """ + if checkpoint_during is not None: + warnings.warn( + "`checkpoint_during` is deprecated and will be removed in a future version. Use `durability` instead.", + DeprecationWarning, + stacklevel=2, + ) + + payload: dict[str, Any] = { + "input": input, + "command": ( + {k: v for k, v in command.items() if v is not None} if command else None + ), + "config": config, + "context": context, + "metadata": metadata, + "stream_mode": stream_mode, + "stream_subgraphs": stream_subgraphs, + "stream_resumable": stream_resumable, + "assistant_id": assistant_id, + "interrupt_before": interrupt_before, + "interrupt_after": interrupt_after, + "feedback_keys": feedback_keys, + "webhook": webhook, + "checkpoint": checkpoint, + "checkpoint_id": checkpoint_id, + "checkpoint_during": checkpoint_during, + "multitask_strategy": multitask_strategy, + "if_not_exists": if_not_exists, + "on_disconnect": on_disconnect, + "on_completion": on_completion, + "after_seconds": after_seconds, + "durability": durability, + "langsmith_tracer": langsmith_tracing, + } + endpoint = ( + f"/threads/{thread_id}/runs/stream" + if thread_id is not None + else "/runs/stream" + ) + + def on_response(res: httpx.Response): + """Callback function to handle the response.""" + if on_run_created and (metadata := _get_run_metadata_from_response(res)): + on_run_created(metadata) + + raw = self.http.stream( + endpoint, + "POST", + json={k: v for k, v in payload.items() if v is not None}, + params=params, + headers=headers, + on_response=on_response if on_run_created else None, + ) + if version == "v2": + return _wrap_stream_v2(raw) + return raw + + @overload + async def create( + self, + thread_id: None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + checkpoint_during: bool | None = None, + config: Config | None = None, + context: Context | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + webhook: str | None = None, + on_completion: OnCompletionBehavior | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + ) -> Run: ... + + @overload + async def create( + self, + thread_id: str, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + webhook: str | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + ) -> Run: ... + + async def create( + self, + thread_id: str | None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + stream_mode: StreamMode | Sequence[StreamMode] = "values", + stream_subgraphs: bool = False, + stream_resumable: bool = False, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, # deprecated + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + webhook: str | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + on_completion: OnCompletionBehavior | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + durability: Durability | None = None, + ) -> Run: + """Create a background run. + + Args: + thread_id: the thread ID to assign to the thread. + If `None` will create a stateless run. + assistant_id: The assistant ID or graph name to stream from. + If using graph name, will default to first assistant created from that graph. + input: The input to the graph. + command: A command to execute. Cannot be combined with input. + stream_mode: The stream mode(s) to use. + stream_subgraphs: Whether to stream output from subgraphs. + stream_resumable: Whether the stream is considered resumable. + If true, the stream can be resumed and replayed in its entirety even after disconnection. + metadata: Metadata to assign to the run. + config: The configuration for the assistant. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + checkpoint: The checkpoint to resume from. + checkpoint_during: (deprecated) Whether to checkpoint during the run (or only at the end/interruption). + interrupt_before: Nodes to interrupt immediately before they get executed. + interrupt_after: Nodes to Nodes to interrupt immediately after they get executed. + webhook: Webhook to call after LangGraph API call is done. + multitask_strategy: Multitask strategy to use. + Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. + on_completion: Whether to delete or keep the thread created for a stateless run. + Must be one of 'delete' or 'keep'. + if_not_exists: How to handle missing thread. Defaults to 'reject'. + Must be either 'reject' (raise error if missing), or 'create' (create new thread). + after_seconds: The number of seconds to wait before starting the run. + Use to schedule future runs. + langsmith_tracing: LangSmith tracing configuration. Allows routing traces + to a specific project or associating with a dataset example. + headers: Optional custom headers to include with the request. + on_run_created: Optional callback to call when a run is created. + durability: The durability to use for the run. Values are "sync", "async", or "exit". + "async" means checkpoints are persisted async while next graph step executes, replaces checkpoint_during=True + "sync" means checkpoints are persisted sync after graph step executes, replaces checkpoint_during=False + "exit" means checkpoints are only persisted when the run exits, does not save intermediate steps + + Returns: + The created background run. + + ???+ example "Example Usage" + + ```python + + background_run = await client.runs.create( + thread_id="my_thread_id", + assistant_id="my_assistant_id", + input={"messages": [{"role": "user", "content": "hello!"}]}, + metadata={"name":"my_run"}, + context={"model_name": "openai"}, + interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], + interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], + webhook="https://my.fake.webhook.com", + multitask_strategy="interrupt" + ) + print(background_run) + ``` + + ```shell + -------------------------------------------------------------------------------- + + { + 'run_id': 'my_run_id', + 'thread_id': 'my_thread_id', + 'assistant_id': 'my_assistant_id', + 'created_at': '2024-07-25T15:35:42.598503+00:00', + 'updated_at': '2024-07-25T15:35:42.598503+00:00', + 'metadata': {}, + 'status': 'pending', + 'kwargs': + { + 'input': + { + 'messages': [ + { + 'role': 'user', + 'content': 'how are you?' + } + ] + }, + 'config': + { + 'metadata': + { + 'created_by': 'system' + }, + 'configurable': + { + 'run_id': 'my_run_id', + 'user_id': None, + 'graph_id': 'agent', + 'thread_id': 'my_thread_id', + 'checkpoint_id': None, + 'assistant_id': 'my_assistant_id' + }, + }, + 'context': + { + 'model_name': 'openai' + } + 'webhook': "https://my.fake.webhook.com", + 'temporary': False, + 'stream_mode': ['values'], + 'feedback_keys': None, + 'interrupt_after': ["node_to_stop_after_1","node_to_stop_after_2"], + 'interrupt_before': ["node_to_stop_before_1","node_to_stop_before_2"] + }, + 'multitask_strategy': 'interrupt' + } + ``` + """ + if checkpoint_during is not None: + warnings.warn( + "`checkpoint_during` is deprecated and will be removed in a future version. Use `durability` instead.", + DeprecationWarning, + stacklevel=2, + ) + payload = { + "input": input, + "command": ( + {k: v for k, v in command.items() if v is not None} if command else None + ), + "stream_mode": stream_mode, + "stream_subgraphs": stream_subgraphs, + "stream_resumable": stream_resumable, + "config": config, + "context": context, + "metadata": metadata, + "assistant_id": assistant_id, + "interrupt_before": interrupt_before, + "interrupt_after": interrupt_after, + "webhook": webhook, + "checkpoint": checkpoint, + "checkpoint_id": checkpoint_id, + "checkpoint_during": checkpoint_during, + "multitask_strategy": multitask_strategy, + "if_not_exists": if_not_exists, + "on_completion": on_completion, + "after_seconds": after_seconds, + "durability": durability, + "langsmith_tracer": langsmith_tracing, + } + payload = {k: v for k, v in payload.items() if v is not None} + + def on_response(res: httpx.Response): + """Callback function to handle the response.""" + if on_run_created and (metadata := _get_run_metadata_from_response(res)): + on_run_created(metadata) + + return await self.http.post( + f"/threads/{thread_id}/runs" if thread_id else "/runs", + json=payload, + params=params, + headers=headers, + on_response=on_response if on_run_created else None, + ) + + async def create_batch( + self, + payloads: builtins.list[RunCreate], + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> builtins.list[Run]: + """Create a batch of stateless background runs.""" + + def filter_payload(payload: RunCreate): + return {k: v for k, v in payload.items() if v is not None} + + filtered = [filter_payload(payload) for payload in payloads] + return await self.http.post( + "/runs/batch", json=filtered, headers=headers, params=params + ) + + @overload + async def wait( + self, + thread_id: str, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + webhook: str | None = None, + on_disconnect: DisconnectMode | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + raise_error: bool = True, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + ) -> builtins.list[dict] | dict[str, Any]: ... + + @overload + async def wait( + self, + thread_id: None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint_during: bool | None = None, + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + webhook: str | None = None, + on_disconnect: DisconnectMode | None = None, + on_completion: OnCompletionBehavior | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + raise_error: bool = True, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + ) -> builtins.list[dict] | dict[str, Any]: ... + + async def wait( + self, + thread_id: str | None, + assistant_id: str, + *, + input: Input | None = None, + command: Command | None = None, + metadata: Mapping[str, Any] | None = None, + config: Config | None = None, + context: Context | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, + checkpoint_during: bool | None = None, # deprecated + interrupt_before: All | Sequence[str] | None = None, + interrupt_after: All | Sequence[str] | None = None, + webhook: str | None = None, + on_disconnect: DisconnectMode | None = None, + on_completion: OnCompletionBehavior | None = None, + multitask_strategy: MultitaskStrategy | None = None, + if_not_exists: IfNotExists | None = None, + after_seconds: int | None = None, + langsmith_tracing: LangSmithTracing | None = None, + raise_error: bool = True, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + on_run_created: Callable[[RunCreateMetadata], None] | None = None, + durability: Durability | None = None, + ) -> builtins.list[dict] | dict[str, Any]: + """Create a run, wait until it finishes and return the final state. + + Args: + thread_id: the thread ID to create the run on. + If `None` will create a stateless run. + assistant_id: The assistant ID or graph name to run. + If using graph name, will default to first assistant created from that graph. + input: The input to the graph. + command: A command to execute. Cannot be combined with input. + metadata: Metadata to assign to the run. + config: The configuration for the assistant. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + checkpoint: The checkpoint to resume from. + checkpoint_during: (deprecated) Whether to checkpoint during the run (or only at the end/interruption). + interrupt_before: Nodes to interrupt immediately before they get executed. + interrupt_after: Nodes to Nodes to interrupt immediately after they get executed. + webhook: Webhook to call after LangGraph API call is done. + on_disconnect: The disconnect mode to use. + Must be one of 'cancel' or 'continue'. + on_completion: Whether to delete or keep the thread created for a stateless run. + Must be one of 'delete' or 'keep'. + multitask_strategy: Multitask strategy to use. + Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'. + if_not_exists: How to handle missing thread. Defaults to 'reject'. + Must be either 'reject' (raise error if missing), or 'create' (create new thread). + after_seconds: The number of seconds to wait before starting the run. + Use to schedule future runs. + langsmith_tracing: LangSmith tracing configuration. Allows routing traces + to a specific project or associating with a dataset example. + headers: Optional custom headers to include with the request. + on_run_created: Optional callback to call when a run is created. + durability: The durability to use for the run. Values are "sync", "async", or "exit". + "async" means checkpoints are persisted async while next graph step executes, replaces checkpoint_during=True + "sync" means checkpoints are persisted sync after graph step executes, replaces checkpoint_during=False + "exit" means checkpoints are only persisted when the run exits, does not save intermediate steps + + Returns: + The output of the run. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + final_state_of_run = await client.runs.wait( + thread_id=None, + assistant_id="agent", + input={"messages": [{"role": "user", "content": "how are you?"}]}, + metadata={"name":"my_run"}, + context={"model_name": "anthropic"}, + interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"], + interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"], + webhook="https://my.fake.webhook.com", + multitask_strategy="interrupt" + ) + print(final_state_of_run) + ``` + + ```shell + ------------------------------------------------------------------------------------------------------------------------------------------- + + { + 'messages': [ + { + 'content': 'how are you?', + 'additional_kwargs': {}, + 'response_metadata': {}, + 'type': 'human', + 'name': None, + 'id': 'f51a862c-62fe-4866-863b-b0863e8ad78a', + 'example': False + }, + { + 'content': "I'm doing well, thanks for asking! I'm an AI assistant created by Anthropic to be helpful, honest, and harmless.", + 'additional_kwargs': {}, + 'response_metadata': {}, + 'type': 'ai', + 'name': None, + 'id': 'run-bf1cd3c6-768f-4c16-b62d-ba6f17ad8b36', + 'example': False, + 'tool_calls': [], + 'invalid_tool_calls': [], + 'usage_metadata': None + } + ] + } + ``` + + """ + if checkpoint_during is not None: + warnings.warn( + "`checkpoint_during` is deprecated and will be removed in a future version. Use `durability` instead.", + DeprecationWarning, + stacklevel=2, + ) + payload = { + "input": input, + "command": ( + {k: v for k, v in command.items() if v is not None} if command else None + ), + "config": config, + "context": context, + "metadata": metadata, + "assistant_id": assistant_id, + "interrupt_before": interrupt_before, + "interrupt_after": interrupt_after, + "webhook": webhook, + "checkpoint": checkpoint, + "checkpoint_id": checkpoint_id, + "multitask_strategy": multitask_strategy, + "checkpoint_during": checkpoint_during, + "if_not_exists": if_not_exists, + "on_disconnect": on_disconnect, + "on_completion": on_completion, + "after_seconds": after_seconds, + "durability": durability, + "langsmith_tracer": langsmith_tracing, + } + endpoint = ( + f"/threads/{thread_id}/runs/wait" if thread_id is not None else "/runs/wait" + ) + + def on_response(res: httpx.Response): + """Callback function to handle the response.""" + if on_run_created and (metadata := _get_run_metadata_from_response(res)): + on_run_created(metadata) + + response = await self.http.request_reconnect( + endpoint, + "POST", + json={k: v for k, v in payload.items() if v is not None}, + params=params, + headers=headers, + on_response=on_response if on_run_created else None, + ) + if ( + raise_error + and isinstance(response, dict) + and "__error__" in response + and isinstance(response["__error__"], dict) + ): + raise Exception( + f"{response['__error__'].get('error')}: {response['__error__'].get('message')}" + ) + return response + + async def list( + self, + thread_id: str, + *, + limit: int = 10, + offset: int = 0, + status: RunStatus | None = None, + select: builtins.list[RunSelectField] | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> builtins.list[Run]: + """List runs. + + Args: + thread_id: The thread ID to list runs for. + limit: The maximum number of results to return. + offset: The number of results to skip. + status: The status of the run to filter by. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The runs for the thread. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.runs.list( + thread_id="thread_id", + limit=5, + offset=5, + ) + ``` + + """ + query_params: dict[str, Any] = { + "limit": limit, + "offset": offset, + } + if status is not None: + query_params["status"] = status + if select: + query_params["select"] = select + if params: + query_params.update(params) + return await self.http.get( + f"/threads/{thread_id}/runs", params=query_params, headers=headers + ) + + async def get( + self, + thread_id: str, + run_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Run: + """Get a run. + + Args: + thread_id: The thread ID to get. + run_id: The run ID to get. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `Run` object. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + run = await client.runs.get( + thread_id="thread_id_to_delete", + run_id="run_id_to_delete", + ) + ``` + + """ + + return await self.http.get( + f"/threads/{thread_id}/runs/{run_id}", headers=headers, params=params + ) + + async def cancel( + self, + thread_id: str, + run_id: str, + *, + wait: bool = False, + action: CancelAction = "interrupt", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Get a run. + + Args: + thread_id: The thread ID to cancel. + run_id: The run ID to cancel. + wait: Whether to wait until run has completed. + action: Action to take when cancelling the run. Possible values + are `interrupt` or `rollback`. Default is `interrupt`. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.runs.cancel( + thread_id="thread_id_to_cancel", + run_id="run_id_to_cancel", + wait=True, + action="interrupt" + ) + ``` + + """ + query_params = { + "wait": 1 if wait else 0, + "action": action, + } + if params: + query_params.update(params) + if wait: + return await self.http.request_reconnect( + f"/threads/{thread_id}/runs/{run_id}/cancel", + "POST", + params=query_params, + headers=headers, + ) + else: + return await self.http.post( + f"/threads/{thread_id}/runs/{run_id}/cancel", + json=None, + params=query_params, + headers=headers, + ) + + async def cancel_many( + self, + *, + thread_id: str | None = None, + run_ids: Sequence[str] | None = None, + status: BulkCancelRunsStatus | None = None, + action: CancelAction = "interrupt", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Cancel one or more runs. + + Can cancel runs by thread ID and run IDs, or by status filter. + + Args: + thread_id: The ID of the thread containing runs to cancel. + run_ids: List of run IDs to cancel. + status: Filter runs by status to cancel. Must be one of + `"pending"`, `"running"`, or `"all"`. + action: Action to take when cancelling the run. Possible values + are `"interrupt"` or `"rollback"`. Default is `"interrupt"`. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + # Cancel all pending runs + await client.runs.cancel_many(status="pending") + # Cancel specific runs on a thread + await client.runs.cancel_many( + thread_id="my_thread_id", + run_ids=["run_1", "run_2"], + action="rollback", + ) + ``` + + """ + payload: dict[str, Any] = {} + if thread_id: + payload["thread_id"] = thread_id + if run_ids: + payload["run_ids"] = run_ids + if status: + payload["status"] = status + query_params: dict[str, Any] = {"action": action} + if params: + query_params.update(params) + await self.http.post( + "/runs/cancel", + json=payload, + headers=headers, + params=query_params, + ) + + async def join( + self, + thread_id: str, + run_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> dict: + """Block until a run is done. Returns the final state of the thread. + + Args: + thread_id: The thread ID to join. + run_id: The run ID to join. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + result =await client.runs.join( + thread_id="thread_id_to_join", + run_id="run_id_to_join" + ) + ``` + + """ + return await self.http.request_reconnect( + f"/threads/{thread_id}/runs/{run_id}/join", + "GET", + headers=headers, + params=params, + ) + + def join_stream( + self, + thread_id: str, + run_id: str, + *, + cancel_on_disconnect: bool = False, + stream_mode: StreamMode | Sequence[StreamMode] | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + last_event_id: str | None = None, + ) -> AsyncIterator[StreamPart]: + """Stream output from a run in real-time, until the run is done. + Output is not buffered, so any output produced before this call will + not be received here. + + Args: + thread_id: The thread ID to join. + run_id: The run ID to join. + cancel_on_disconnect: Whether to cancel the run when the stream is disconnected. + stream_mode: The stream mode(s) to use. Must be a subset of the stream modes passed + when creating the run. Background runs default to having the union of all + stream modes. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + last_event_id: The last event ID to use for the stream. + + Returns: + The stream of parts. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + async for part in client.runs.join_stream( + thread_id="thread_id_to_join", + run_id="run_id_to_join", + stream_mode=["values", "debug"] + ): + print(part) + ``` + + """ + query_params = { + "cancel_on_disconnect": cancel_on_disconnect, + "stream_mode": stream_mode, + } + if params: + query_params.update(params) + return self.http.stream( + f"/threads/{thread_id}/runs/{run_id}/stream", + "GET", + params=query_params, + headers={ + **({"Last-Event-ID": last_event_id} if last_event_id else {}), + **(headers or {}), + } + or None, + ) + + async def delete( + self, + thread_id: str, + run_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Delete a run. + + Args: + thread_id: The thread ID to delete. + run_id: The run ID to delete. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.runs.delete( + thread_id="thread_id_to_delete", + run_id="run_id_to_delete" + ) + ``` + + """ + await self.http.delete( + f"/threads/{thread_id}/runs/{run_id}", headers=headers, params=params + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/store.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/store.py new file mode 100644 index 0000000000000000000000000000000000000000..9efb2758150d16c30a95a0c0e73f2b8a708be11d --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/store.py @@ -0,0 +1,313 @@ +"""Async Store client for LangGraph SDK.""" + +from __future__ import annotations + +from collections.abc import Mapping, Sequence +from typing import Any, Literal + +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk._shared.utilities import _provided_vals +from langgraph_sdk.schema import ( + Item, + ListNamespaceResponse, + QueryParamTypes, + SearchItemsResponse, +) + + +class StoreClient: + """Client for interacting with the graph's shared storage. + + The Store provides a key-value storage system for persisting data across graph executions, + allowing for stateful operations and data sharing across threads. + + ???+ example "Example" + + ```python + client = get_client(url="http://localhost:2024") + await client.store.put_item(["users", "user123"], "mem-123451342", {"name": "Alice", "score": 100}) + ``` + """ + + def __init__(self, http: HttpClient) -> None: + self.http = http + + async def put_item( + self, + namespace: Sequence[str], + /, + key: str, + value: Mapping[str, Any], + index: Literal[False] | list[str] | None = None, + ttl: int | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Store or update an item. + + Args: + namespace: A list of strings representing the namespace path. + key: The unique identifier for the item within the namespace. + value: A dictionary containing the item's data. + index: Controls search indexing - None (use defaults), False (disable), or list of field paths to index. + ttl: Optional time-to-live in minutes for the item, or None for no expiration. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.store.put_item( + ["documents", "user123"], + key="item456", + value={"title": "My Document", "content": "Hello World"} + ) + ``` + """ + for label in namespace: + if "." in label: + raise ValueError( + f"Invalid namespace label '{label}'. Namespace labels cannot contain periods ('.')." + ) + payload = { + "namespace": namespace, + "key": key, + "value": value, + "index": index, + "ttl": ttl, + } + await self.http.put( + "/store/items", json=_provided_vals(payload), headers=headers, params=params + ) + + async def get_item( + self, + namespace: Sequence[str], + /, + key: str, + *, + refresh_ttl: bool | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Item: + """Retrieve a single item. + + Args: + key: The unique identifier for the item. + namespace: Optional list of strings representing the namespace path. + refresh_ttl: Whether to refresh the TTL on this read operation. If `None`, uses the store's default behavior. + + Returns: + Item: The retrieved item. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + item = await client.store.get_item( + ["documents", "user123"], + key="item456", + ) + print(item) + ``` + ```shell + + ---------------------------------------------------------------- + + { + 'namespace': ['documents', 'user123'], + 'key': 'item456', + 'value': {'title': 'My Document', 'content': 'Hello World'}, + 'created_at': '2024-07-30T12:00:00Z', + 'updated_at': '2024-07-30T12:00:00Z' + } + ``` + """ + for label in namespace: + if "." in label: + raise ValueError( + f"Invalid namespace label '{label}'. Namespace labels cannot contain periods ('.')." + ) + get_params: dict[str, Any] = {"namespace": ".".join(namespace), "key": key} + if refresh_ttl is not None: + get_params["refresh_ttl"] = refresh_ttl + if params: + get_params = {**get_params, **dict(params)} + return await self.http.get("/store/items", params=get_params, headers=headers) + + async def delete_item( + self, + namespace: Sequence[str], + /, + key: str, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Delete an item. + + Args: + key: The unique identifier for the item. + namespace: Optional list of strings representing the namespace path. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + await client.store.delete_item( + ["documents", "user123"], + key="item456", + ) + ``` + """ + await self.http.delete( + "/store/items", + json={"namespace": namespace, "key": key}, + headers=headers, + params=params, + ) + + async def search_items( + self, + namespace_prefix: Sequence[str], + /, + filter: Mapping[str, Any] | None = None, + limit: int = 10, + offset: int = 0, + query: str | None = None, + refresh_ttl: bool | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> SearchItemsResponse: + """Search for items within a namespace prefix. + + Args: + namespace_prefix: List of strings representing the namespace prefix. + filter: Optional dictionary of key-value pairs to filter results. + limit: Maximum number of items to return (default is 10). + offset: Number of items to skip before returning results (default is 0). + query: Optional query for natural language search. + refresh_ttl: Whether to refresh the TTL on items returned by this search. If `None`, uses the store's default behavior. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + A list of items matching the search criteria. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + items = await client.store.search_items( + ["documents"], + filter={"author": "John Doe"}, + limit=5, + offset=0 + ) + print(items) + ``` + ```shell + + ---------------------------------------------------------------- + + { + "items": [ + { + "namespace": ["documents", "user123"], + "key": "item789", + "value": { + "title": "Another Document", + "author": "John Doe" + }, + "created_at": "2024-07-30T12:00:00Z", + "updated_at": "2024-07-30T12:00:00Z" + }, + # ... additional items ... + ] + } + ``` + """ + payload = { + "namespace_prefix": namespace_prefix, + "filter": filter, + "limit": limit, + "offset": offset, + "query": query, + "refresh_ttl": refresh_ttl, + } + + return await self.http.post( + "/store/items/search", + json=_provided_vals(payload), + headers=headers, + params=params, + ) + + async def list_namespaces( + self, + prefix: list[str] | None = None, + suffix: list[str] | None = None, + max_depth: int | None = None, + limit: int = 100, + offset: int = 0, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> ListNamespaceResponse: + """List namespaces with optional match conditions. + + Args: + prefix: Optional list of strings representing the prefix to filter namespaces. + suffix: Optional list of strings representing the suffix to filter namespaces. + max_depth: Optional integer specifying the maximum depth of namespaces to return. + limit: Maximum number of namespaces to return (default is 100). + offset: Number of namespaces to skip before returning results (default is 0). + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + A list of namespaces matching the criteria. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + namespaces = await client.store.list_namespaces( + prefix=["documents"], + max_depth=3, + limit=10, + offset=0 + ) + print(namespaces) + + ---------------------------------------------------------------- + + [ + ["documents", "user123", "reports"], + ["documents", "user456", "invoices"], + ... + ] + ``` + """ + payload = { + "prefix": prefix, + "suffix": suffix, + "max_depth": max_depth, + "limit": limit, + "offset": offset, + } + return await self.http.post( + "/store/namespaces", + json=_provided_vals(payload), + headers=headers, + params=params, + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_async/threads.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/threads.py new file mode 100644 index 0000000000000000000000000000000000000000..d43d352a48e74eaf4ef5f206679f4a46b5b375f3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_async/threads.py @@ -0,0 +1,773 @@ +"""Async client for managing threads in LangGraph.""" + +from __future__ import annotations + +from collections.abc import AsyncIterator, Mapping, Sequence +from typing import Any, Literal, overload + +from langgraph_sdk._async.http import HttpClient +from langgraph_sdk.schema import ( + Checkpoint, + Json, + OnConflictBehavior, + PruneStrategy, + QueryParamTypes, + SortOrder, + StreamPart, + Thread, + ThreadSelectField, + ThreadSortBy, + ThreadState, + ThreadStatus, + ThreadStreamMode, + ThreadUpdateStateResponse, +) + + +class ThreadsClient: + """Client for managing threads in LangGraph. + + A thread maintains the state of a graph across multiple interactions/invocations (aka runs). + It accumulates and persists the graph's state, allowing for continuity between separate + invocations of the graph. + + ???+ example "Example" + + ```python + client = get_client(url="http://localhost:2024")) + new_thread = await client.threads.create(metadata={"user_id": "123"}) + ``` + """ + + def __init__(self, http: HttpClient) -> None: + self.http = http + + async def get( + self, + thread_id: str, + *, + include: Sequence[str] | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Thread: + """Get a thread by ID. + + Args: + thread_id: The ID of the thread to get. + include: Additional fields to include in the response. + Supported values: `"ttl"`. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Thread object. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + thread = await client.threads.get( + thread_id="my_thread_id" + ) + print(thread) + ``` + + ```shell + ----------------------------------------------------- + + { + 'thread_id': 'my_thread_id', + 'created_at': '2024-07-18T18:35:15.540834+00:00', + 'updated_at': '2024-07-18T18:35:15.540834+00:00', + 'metadata': {'graph_id': 'agent'} + } + ``` + + """ + query_params: dict[str, Any] = {} + if include: + query_params["include"] = ",".join(include) + if params: + query_params.update(params) + return await self.http.get( + f"/threads/{thread_id}", + headers=headers, + params=query_params or None, + ) + + async def create( + self, + *, + metadata: Json = None, + thread_id: str | None = None, + if_exists: OnConflictBehavior | None = None, + supersteps: Sequence[dict[str, Sequence[dict[str, Any]]]] | None = None, + graph_id: str | None = None, + ttl: int | Mapping[str, Any] | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Thread: + """Create a new thread. + + Args: + metadata: Metadata to add to thread. + thread_id: ID of thread. + If `None`, ID will be a randomly generated UUID. + if_exists: How to handle duplicate creation. Defaults to 'raise' under the hood. + Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread). + supersteps: Apply a list of supersteps when creating a thread, each containing a sequence of updates. + Each update has `values` or `command` and `as_node`. Used for copying a thread between deployments. + graph_id: Optional graph ID to associate with the thread. + ttl: Optional time-to-live in minutes for the thread. You can pass an + integer (minutes) or a mapping with keys `ttl` and optional + `strategy` (defaults to "delete"). + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The created thread. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + thread = await client.threads.create( + metadata={"number":1}, + thread_id="my-thread-id", + if_exists="raise" + ) + ``` + """ + payload: dict[str, Any] = {} + if thread_id: + payload["thread_id"] = thread_id + if metadata or graph_id: + payload["metadata"] = { + **(metadata or {}), + **({"graph_id": graph_id} if graph_id else {}), + } + if if_exists: + payload["if_exists"] = if_exists + if supersteps: + payload["supersteps"] = [ + { + "updates": [ + { + "values": u["values"], + "command": u.get("command"), + "as_node": u["as_node"], + } + for u in s["updates"] + ] + } + for s in supersteps + ] + if ttl is not None: + if isinstance(ttl, (int, float)): + payload["ttl"] = {"ttl": ttl, "strategy": "delete"} + else: + payload["ttl"] = ttl + + return await self.http.post( + "/threads", json=payload, headers=headers, params=params + ) + + @overload + async def update( + self, + thread_id: str, + *, + metadata: Mapping[str, Any], + ttl: int | Mapping[str, Any] | None = None, + return_minimal: Literal[False] = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Thread: ... + + @overload + async def update( + self, + thread_id: str, + *, + metadata: Mapping[str, Any], + ttl: int | Mapping[str, Any] | None = None, + return_minimal: Literal[True], + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: ... + + @overload + async def update( + self, + thread_id: str, + *, + metadata: Mapping[str, Any], + ttl: int | Mapping[str, Any] | None = None, + return_minimal: bool, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Thread | None: ... + + async def update( + self, + thread_id: str, + *, + metadata: Mapping[str, Any], + ttl: int | Mapping[str, Any] | None = None, + return_minimal: bool = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Thread | None: + """Update a thread. + + Args: + thread_id: ID of thread to update. + metadata: Metadata to merge with existing thread metadata. + ttl: Optional time-to-live in minutes for the thread. You can pass an + integer (minutes) or a mapping with keys `ttl` and optional + `strategy` (defaults to "delete"). + return_minimal: If `True`, request a 204 response with no body. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The updated thread, or `None` when `return_minimal=True`. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + thread = await client.threads.update( + thread_id="my-thread-id", + metadata={"number":1}, + ttl=43_200, + ) + ``` + """ + payload: dict[str, Any] = {"metadata": metadata} + if ttl is not None: + if isinstance(ttl, (int, float)): + payload["ttl"] = {"ttl": ttl, "strategy": "delete"} + else: + payload["ttl"] = ttl + request_headers = dict(headers or {}) + if return_minimal: + request_headers["Prefer"] = "return=minimal" + return await self.http.patch( + f"/threads/{thread_id}", + json=payload, + headers=request_headers or None, + params=params, + ) + + async def delete( + self, + thread_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Delete a thread. + + Args: + thread_id: The ID of the thread to delete. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost2024) + await client.threads.delete( + thread_id="my_thread_id" + ) + ``` + + """ + await self.http.delete(f"/threads/{thread_id}", headers=headers, params=params) + + async def search( + self, + *, + metadata: Json = None, + values: Json = None, + ids: Sequence[str] | None = None, + status: ThreadStatus | None = None, + limit: int = 10, + offset: int = 0, + sort_by: ThreadSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[ThreadSelectField] | None = None, + extract: dict[str, str] | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[Thread]: + """Search for threads. + + Args: + metadata: Thread metadata to filter on. + values: State values to filter on. + ids: List of thread IDs to filter by. + status: Thread status to filter on. + Must be one of 'idle', 'busy', 'interrupted' or 'error'. + limit: Limit on number of threads to return. + offset: Offset in threads table to start search from. + sort_by: Sort by field. + sort_order: Sort order. + select: List of fields to include in the response. + extract: Dictionary mapping aliases to JSONB paths to extract + from thread data. Paths use dot notation for nested keys and + bracket notation for array indices (e.g., + `{"last_msg": "values.messages[-1]"}`). Extracted values are + returned in an `extracted` field on each thread. Maximum 10 + paths per request. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + List of the threads matching the search parameters. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + threads = await client.threads.search( + metadata={"number":1}, + status="interrupted", + limit=15, + offset=5 + ) + ``` + + """ + payload: dict[str, Any] = { + "limit": limit, + "offset": offset, + } + if metadata: + payload["metadata"] = metadata + if values: + payload["values"] = values + if ids: + payload["ids"] = ids + if status: + payload["status"] = status + if sort_by: + payload["sort_by"] = sort_by + if sort_order: + payload["sort_order"] = sort_order + if select: + payload["select"] = select + if extract: + payload["extract"] = extract + return await self.http.post( + "/threads/search", + json=payload, + headers=headers, + params=params, + ) + + async def count( + self, + *, + metadata: Json = None, + values: Json = None, + status: ThreadStatus | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> int: + """Count threads matching filters. + + Args: + metadata: Thread metadata to filter on. + values: State values to filter on. + status: Thread status to filter on. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + int: Number of threads matching the criteria. + """ + payload: dict[str, Any] = {} + if metadata: + payload["metadata"] = metadata + if values: + payload["values"] = values + if status: + payload["status"] = status + return await self.http.post( + "/threads/count", json=payload, headers=headers, params=params + ) + + async def copy( + self, + thread_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Copy a thread. + + Args: + thread_id: The ID of the thread to copy. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024) + await client.threads.copy( + thread_id="my_thread_id" + ) + ``` + + """ + return await self.http.post( + f"/threads/{thread_id}/copy", json=None, headers=headers, params=params + ) + + async def prune( + self, + thread_ids: Sequence[str], + *, + strategy: PruneStrategy = "delete", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> dict[str, Any]: + """Prune threads by ID. + + Args: + thread_ids: List of thread IDs to prune. + strategy: The prune strategy. `"delete"` removes threads entirely. + `"keep_latest"` prunes old checkpoints but keeps threads and their + latest state. Defaults to `"delete"`. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + A dict containing `pruned_count` (number of threads pruned). + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024") + result = await client.threads.prune( + thread_ids=["thread_1", "thread_2"], + ) + print(result) # {'pruned_count': 2} + ``` + + """ + payload: dict[str, Any] = { + "thread_ids": thread_ids, + } + if strategy != "delete": + payload["strategy"] = strategy + return await self.http.post( + "/threads/prune", json=payload, headers=headers, params=params + ) + + async def get_state( + self, + thread_id: str, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, # deprecated + *, + subgraphs: bool = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> ThreadState: + """Get the state of a thread. + + Args: + thread_id: The ID of the thread to get the state of. + checkpoint: The checkpoint to get the state of. + checkpoint_id: (deprecated) The checkpoint ID to get the state of. + subgraphs: Include subgraphs states. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The thread of the state. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024) + thread_state = await client.threads.get_state( + thread_id="my_thread_id", + checkpoint_id="my_checkpoint_id" + ) + print(thread_state) + ``` + + ```shell + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + 'values': { + 'messages': [ + { + 'content': 'how are you?', + 'additional_kwargs': {}, + 'response_metadata': {}, + 'type': 'human', + 'name': None, + 'id': 'fe0a5778-cfe9-42ee-b807-0adaa1873c10', + 'example': False + }, + { + 'content': "I'm doing well, thanks for asking! I'm an AI assistant created by Anthropic to be helpful, honest, and harmless.", + 'additional_kwargs': {}, + 'response_metadata': {}, + 'type': 'ai', + 'name': None, + 'id': 'run-159b782c-b679-4830-83c6-cef87798fe8b', + 'example': False, + 'tool_calls': [], + 'invalid_tool_calls': [], + 'usage_metadata': None + } + ] + }, + 'next': [], + 'checkpoint': + { + 'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2', + 'checkpoint_ns': '', + 'checkpoint_id': '1ef4a9b8-e6fb-67b1-8001-abd5184439d1' + } + 'metadata': + { + 'step': 1, + 'run_id': '1ef4a9b8-d7da-679a-a45a-872054341df2', + 'source': 'loop', + 'writes': + { + 'agent': + { + 'messages': [ + { + 'id': 'run-159b782c-b679-4830-83c6-cef87798fe8b', + 'name': None, + 'type': 'ai', + 'content': "I'm doing well, thanks for asking! I'm an AI assistant created by Anthropic to be helpful, honest, and harmless.", + 'example': False, + 'tool_calls': [], + 'usage_metadata': None, + 'additional_kwargs': {}, + 'response_metadata': {}, + 'invalid_tool_calls': [] + } + ] + } + }, + 'user_id': None, + 'graph_id': 'agent', + 'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2', + 'created_by': 'system', + 'assistant_id': 'fe096781-5601-53d2-b2f6-0d3403f7e9ca'}, + 'created_at': '2024-07-25T15:35:44.184703+00:00', + 'parent_config': + { + 'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2', + 'checkpoint_ns': '', + 'checkpoint_id': '1ef4a9b8-d80d-6fa7-8000-9300467fad0f' + } + } + ``` + """ + if checkpoint: + return await self.http.post( + f"/threads/{thread_id}/state/checkpoint", + json={"checkpoint": checkpoint, "subgraphs": subgraphs}, + headers=headers, + params=params, + ) + elif checkpoint_id: + get_params = {"subgraphs": subgraphs} + if params: + get_params = {**get_params, **dict(params)} + return await self.http.get( + f"/threads/{thread_id}/state/{checkpoint_id}", + params=get_params, + headers=headers, + ) + else: + get_params = {"subgraphs": subgraphs} + if params: + get_params = {**get_params, **dict(params)} + return await self.http.get( + f"/threads/{thread_id}/state", + params=get_params, + headers=headers, + ) + + async def update_state( + self, + thread_id: str, + values: dict[str, Any] | Sequence[dict] | None, + *, + as_node: str | None = None, + checkpoint: Checkpoint | None = None, + checkpoint_id: str | None = None, # deprecated + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> ThreadUpdateStateResponse: + """Update the state of a thread. + + Args: + thread_id: The ID of the thread to update. + values: The values to update the state with. + as_node: Update the state as if this node had just executed. + checkpoint: The checkpoint to update the state of. + checkpoint_id: (deprecated) The checkpoint ID to update the state of. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Response after updating a thread's state. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024) + response = await client.threads.update_state( + thread_id="my_thread_id", + values={"messages":[{"role": "user", "content": "hello!"}]}, + as_node="my_node", + ) + print(response) + ``` + ```shell + + ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + { + 'checkpoint': { + 'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2', + 'checkpoint_ns': '', + 'checkpoint_id': '1ef4a9b8-e6fb-67b1-8001-abd5184439d1', + 'checkpoint_map': {} + } + } + ``` + """ + payload: dict[str, Any] = { + "values": values, + } + if checkpoint_id: + payload["checkpoint_id"] = checkpoint_id + if checkpoint: + payload["checkpoint"] = checkpoint + if as_node: + payload["as_node"] = as_node + return await self.http.post( + f"/threads/{thread_id}/state", json=payload, headers=headers, params=params + ) + + async def get_history( + self, + thread_id: str, + *, + limit: int = 10, + before: str | Checkpoint | None = None, + metadata: Mapping[str, Any] | None = None, + checkpoint: Checkpoint | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[ThreadState]: + """Get the state history of a thread. + + Args: + thread_id: The ID of the thread to get the state history for. + checkpoint: Return states for this subgraph. If empty defaults to root. + limit: The maximum number of states to return. + before: Return states before this checkpoint. + metadata: Filter states by metadata key-value pairs. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The state history of the thread. + + ???+ example "Example Usage" + + ```python + client = get_client(url="http://localhost:2024) + thread_state = await client.threads.get_history( + thread_id="my_thread_id", + limit=5, + ) + ``` + + """ + payload: dict[str, Any] = { + "limit": limit, + } + if before: + payload["before"] = before + if metadata: + payload["metadata"] = metadata + if checkpoint: + payload["checkpoint"] = checkpoint + return await self.http.post( + f"/threads/{thread_id}/history", + json=payload, + headers=headers, + params=params, + ) + + async def join_stream( + self, + thread_id: str, + *, + last_event_id: str | None = None, + stream_mode: ThreadStreamMode | Sequence[ThreadStreamMode] = "run_modes", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> AsyncIterator[StreamPart]: + """Get a stream of events for a thread. + + Args: + thread_id: The ID of the thread to get the stream for. + last_event_id: The ID of the last event to get. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + An iterator of stream parts. + + ???+ example "Example Usage" + + ```python + + for chunk in client.threads.join_stream( + thread_id="my_thread_id", + last_event_id="my_event_id", + ): + print(chunk) + ``` + + """ + query_params = { + "stream_mode": stream_mode, + } + if params: + query_params.update(params) + return self.http.stream( + f"/threads/{thread_id}/stream", + "GET", + headers={ + **({"Last-Event-ID": last_event_id} if last_event_id else {}), + **(headers or {}), + }, + params=query_params, + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/__init__.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5783ce0c2365d7063cec3d2bf9fdfaefc557575b --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/__init__.py @@ -0,0 +1 @@ +"""Shared utilities for async and sync clients.""" diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/types.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/types.py new file mode 100644 index 0000000000000000000000000000000000000000..073b1380a249c620c5e788dda25bb321a484e60d --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/types.py @@ -0,0 +1,10 @@ +"""Type aliases and constants.""" + +from __future__ import annotations + +TimeoutTypes = ( + None + | float + | tuple[float | None, float | None] + | tuple[float | None, float | None, float | None, float | None] +) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/utilities.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/utilities.py new file mode 100644 index 0000000000000000000000000000000000000000..c7b2583e2c7449dfda134d93290b16e76b90fe29 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_shared/utilities.py @@ -0,0 +1,217 @@ +"""Shared utility functions for async and sync clients.""" + +from __future__ import annotations + +import functools +import os +import re +from collections.abc import Mapping +from datetime import tzinfo +from typing import TYPE_CHECKING, Any, cast +from urllib.parse import urlparse + +import httpx + +import langgraph_sdk +from langgraph_sdk.schema import RunCreateMetadata + +if TYPE_CHECKING: + from zoneinfo import ZoneInfo + +RESERVED_HEADERS = ("x-api-key",) + +NOT_PROVIDED = cast(None, object()) + + +def _get_api_key(api_key: str | None = NOT_PROVIDED) -> str | None: + """Get the API key from the environment. + Precedence: + 1. explicit string argument + 2. LANGGRAPH_API_KEY (if api_key not provided) + 3. LANGSMITH_API_KEY (if api_key not provided) + 4. LANGCHAIN_API_KEY (if api_key not provided) + + Args: + api_key: The API key to use. Can be: + - A string: use this exact API key + - None: explicitly skip loading from environment + - NOT_PROVIDED (default): auto-load from environment variables + """ + if isinstance(api_key, str): + return api_key + if api_key is NOT_PROVIDED: + # api_key is not explicitly provided, try to load from environment + for prefix in ["LANGGRAPH", "LANGSMITH", "LANGCHAIN"]: + if env := os.getenv(f"{prefix}_API_KEY"): + return env.strip().strip('"').strip("'") + # api_key is explicitly None, don't load from environment + return None + + +def _get_headers( + api_key: str | None, + custom_headers: Mapping[str, str] | None, +) -> dict[str, str]: + """Combine api_key and custom user-provided headers.""" + custom_headers = custom_headers or {} + for header in RESERVED_HEADERS: + if header in custom_headers: + raise ValueError(f"Cannot set reserved header '{header}'") + + headers = { + "User-Agent": f"langgraph-sdk-py/{langgraph_sdk.__version__}", + **custom_headers, + } + resolved_api_key = _get_api_key(api_key) + if resolved_api_key: + headers["x-api-key"] = resolved_api_key + + return headers + + +def _orjson_default(obj: Any) -> Any: + is_class = isinstance(obj, type) + if hasattr(obj, "model_dump") and callable(obj.model_dump): + if is_class: + raise TypeError( + f"Cannot JSON-serialize type object: {obj!r}. Did you mean to pass an instance of the object instead?" + f"\nReceived type: {obj!r}" + ) + return obj.model_dump() + elif hasattr(obj, "dict") and callable(obj.dict): + if is_class: + raise TypeError( + f"Cannot JSON-serialize type object: {obj!r}. Did you mean to pass an instance of the object instead?" + f"\nReceived type: {obj!r}" + ) + return obj.dict() + elif isinstance(obj, (set, frozenset)): + return list(obj) + else: + raise TypeError(f"Object of type {type(obj)} is not JSON serializable") + + +# Compiled regex pattern for extracting run metadata from Content-Location header +_RUN_METADATA_PATTERN = re.compile( + r"(\/threads\/(?P.+))?\/runs\/(?P.+)" +) + + +def _get_run_metadata_from_response( + response: httpx.Response, +) -> RunCreateMetadata | None: + """Extract run metadata from the response headers.""" + if (content_location := response.headers.get("Content-Location")) and ( + match := _RUN_METADATA_PATTERN.search(content_location) + ): + return RunCreateMetadata( + run_id=match.group("run_id"), + thread_id=match.group("thread_id") or None, + ) + + return None + + +def _sse_to_v2_dict(event: str, data: Any) -> dict[str, Any] | None: + """Convert an SSE event+data pair into a v2 stream part dict. + + Returns None for ``end`` events (signals end of stream). + """ + if event == "end": + return None + parts = event.split("|") + event_type = parts[0] + ns = parts[1:] if len(parts) > 1 else [] + result: dict[str, Any] = {"type": event_type, "ns": ns, "data": data} + if event_type == "values" and isinstance(data, dict): + result["interrupts"] = data.pop("__interrupt__", []) + else: + result["interrupts"] = [] + return result + + +def _resolve_timezone(tz: str | tzinfo | ZoneInfo | None) -> str | None: + """Convert a timezone argument to an IANA timezone string. + + Accepts: + - A string (returned as-is, assumed to be an IANA timezone name) + - A ``datetime.tzinfo`` instance (e.g. ``zoneinfo.ZoneInfo("America/New_York")``, + ``datetime.timezone.utc``). The ``key`` attribute is used if available, + otherwise ``tzname(None)`` is used. + - ``None`` (returned as ``None``) + """ + if tz is None or isinstance(tz, str): + return tz + if isinstance(tz, tzinfo): + # ZoneInfo objects have a .key attribute with the IANA name + if hasattr(tz, "key"): + return tz.key # type: ignore[union-attr] + # Fall back to tzname for fixed-offset timezones like datetime.timezone.utc + name = tz.tzname(None) + if name is not None: + return name + raise ValueError( + f"Cannot determine timezone name from {tz!r}. " + "Use a zoneinfo.ZoneInfo instance or pass a string like 'America/New_York'." + ) + raise TypeError( + f"Expected str, datetime.tzinfo, or None for timezone, got {type(tz).__name__}" + ) + + +def _default_port(scheme: str) -> int: + return 443 if scheme == "https" else 80 + + +def _validate_reconnect_location(base_url: httpx.URL, location: str) -> str: + """Validate that a reconnect Location URL is same-origin as the base URL. + + Raises ValueError if the Location header points to a different origin + (scheme + host + port), which would leak credentials to an external server. + """ + parsed = urlparse(location) + # Relative URLs are safe โ€” they resolve against the base + if not parsed.scheme and not parsed.netloc: + return location + # Compare origin components (normalize default ports to avoid mismatches) + base_scheme = str(base_url.scheme) + base_origin = ( + base_scheme, + str(base_url.host), + base_url.port or _default_port(base_scheme), + ) + loc_origin = ( + parsed.scheme, + parsed.hostname or "", + parsed.port or _default_port(parsed.scheme), + ) + if base_origin != loc_origin: + raise ValueError( + f"Refusing to follow cross-origin reconnect Location: {location!r} " + f"(origin {loc_origin}) does not match base URL origin {base_origin}" + ) + return location + + +def _provided_vals(d: Mapping[str, Any]) -> dict[str, Any]: + return {k: v for k, v in d.items() if v is not None} + + +_registered_transports: list[httpx.ASGITransport] = [] + + +# Do not move; this is used in the server. +def configure_loopback_transports(app: Any) -> None: + for transport in _registered_transports: + transport.app = app + + +@functools.lru_cache(maxsize=1) +def get_asgi_transport() -> type[httpx.ASGITransport]: + try: + from langgraph_api import asgi_transport # type: ignore[unresolved-import] + + return asgi_transport.ASGITransport + except ImportError: + # Older versions of the server + return httpx.ASGITransport diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/_sync/assistants.py b/python/user_packages/Python313/site-packages/langgraph_sdk/_sync/assistants.py new file mode 100644 index 0000000000000000000000000000000000000000..272fd306bcef0110fec773f34197bbb069293f8e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/_sync/assistants.py @@ -0,0 +1,731 @@ +"""Synchronous client for managing assistants in LangGraph.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, cast, overload + +import httpx + +from langgraph_sdk._sync.http import SyncHttpClient +from langgraph_sdk.schema import ( + Assistant, + AssistantSelectField, + AssistantSortBy, + AssistantsSearchResponse, + AssistantVersion, + Config, + Context, + GraphSchema, + Json, + OnConflictBehavior, + QueryParamTypes, + SortOrder, + Subgraphs, +) + + +class SyncAssistantsClient: + """Client for managing assistants in LangGraph synchronously. + + This class provides methods to interact with assistants, which are versioned configurations of your graph. + + ???+ example "Example" + + ```python + client = get_sync_client(url="http://localhost:2024") + assistant = client.assistants.get("assistant_id_123") + ``` + """ + + def __init__(self, http: SyncHttpClient) -> None: + self.http = http + + def get( + self, + assistant_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Get an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get OR the name of the graph (to use the default assistant). + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `Assistant` Object. + + ???+ example "Example Usage" + + ```python + assistant = client.assistants.get( + assistant_id="my_assistant_id" + ) + print(assistant) + ``` + + ```shell + ---------------------------------------------------- + + { + 'assistant_id': 'my_assistant_id', + 'graph_id': 'agent', + 'created_at': '2024-06-25T17:10:33.109781+00:00', + 'updated_at': '2024-06-25T17:10:33.109781+00:00', + 'config': {}, + 'context': {}, + 'metadata': {'created_by': 'system'} + } + ``` + + """ + return self.http.get( + f"/assistants/{assistant_id}", headers=headers, params=params + ) + + def get_graph( + self, + assistant_id: str, + *, + xray: int | bool = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> dict[str, list[dict[str, Any]]]: + """Get the graph of an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get the graph of. + xray: Include graph representation of subgraphs. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + The graph information for the assistant in JSON format. + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + graph_info = client.assistants.get_graph( + assistant_id="my_assistant_id" + ) + print(graph_info) + + -------------------------------------------------------------------------------------------------------------------------- + + { + 'nodes': + [ + {'id': '__start__', 'type': 'schema', 'data': '__start__'}, + {'id': '__end__', 'type': 'schema', 'data': '__end__'}, + {'id': 'agent','type': 'runnable','data': {'id': ['langgraph', 'utils', 'RunnableCallable'],'name': 'agent'}}, + ], + 'edges': + [ + {'source': '__start__', 'target': 'agent'}, + {'source': 'agent','target': '__end__'} + ] + } + ``` + + """ + query_params = {"xray": xray} + if params: + query_params.update(params) + return self.http.get( + f"/assistants/{assistant_id}/graph", params=query_params, headers=headers + ) + + def get_schemas( + self, + assistant_id: str, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> GraphSchema: + """Get the schemas of an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get the schema of. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + GraphSchema: The graph schema for the assistant. + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + schema = client.assistants.get_schemas( + assistant_id="my_assistant_id" + ) + print(schema) + ``` + ```shell + ---------------------------------------------------------------------------------------------------------------------------- + + { + 'graph_id': 'agent', + 'state_schema': + { + 'title': 'LangGraphInput', + '$ref': '#/definitions/AgentState', + 'definitions': + { + 'BaseMessage': + { + 'title': 'BaseMessage', + 'description': 'Base abstract Message class. Messages are the inputs and outputs of ChatModels.', + 'type': 'object', + 'properties': + { + 'content': + { + 'title': 'Content', + 'anyOf': [ + {'type': 'string'}, + {'type': 'array','items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}} + ] + }, + 'additional_kwargs': + { + 'title': 'Additional Kwargs', + 'type': 'object' + }, + 'response_metadata': + { + 'title': 'Response Metadata', + 'type': 'object' + }, + 'type': + { + 'title': 'Type', + 'type': 'string' + }, + 'name': + { + 'title': 'Name', + 'type': 'string' + }, + 'id': + { + 'title': 'Id', + 'type': 'string' + } + }, + 'required': ['content', 'type'] + }, + 'AgentState': + { + 'title': 'AgentState', + 'type': 'object', + 'properties': + { + 'messages': + { + 'title': 'Messages', + 'type': 'array', + 'items': {'$ref': '#/definitions/BaseMessage'} + } + }, + 'required': ['messages'] + } + } + }, + 'config_schema': + { + 'title': 'Configurable', + 'type': 'object', + 'properties': + { + 'model_name': + { + 'title': 'Model Name', + 'enum': ['anthropic', 'openai'], + 'type': 'string' + } + } + }, + 'context_schema': + { + 'title': 'Context', + 'type': 'object', + 'properties': + { + 'model_name': + { + 'title': 'Model Name', + 'enum': ['anthropic', 'openai'], + 'type': 'string' + } + } + } + } + ``` + + """ + return self.http.get( + f"/assistants/{assistant_id}/schemas", headers=headers, params=params + ) + + def get_subgraphs( + self, + assistant_id: str, + namespace: str | None = None, + recurse: bool = False, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Subgraphs: + """Get the schemas of an assistant by ID. + + Args: + assistant_id: The ID of the assistant to get the schema of. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + Subgraphs: The graph schema for the assistant. + + """ + get_params = {"recurse": recurse} + if params: + get_params = {**get_params, **dict(params)} + if namespace is not None: + return self.http.get( + f"/assistants/{assistant_id}/subgraphs/{namespace}", + params=get_params, + headers=headers, + ) + else: + return self.http.get( + f"/assistants/{assistant_id}/subgraphs", + params=get_params, + headers=headers, + ) + + def create( + self, + graph_id: str | None, + config: Config | None = None, + *, + context: Context | None = None, + metadata: Json = None, + assistant_id: str | None = None, + if_exists: OnConflictBehavior | None = None, + name: str | None = None, + headers: Mapping[str, str] | None = None, + description: str | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Create a new assistant. + + Useful when graph is configurable and you want to create different assistants based on different configurations. + + Args: + graph_id: The ID of the graph the assistant should use. The graph ID is normally set in your langgraph.json configuration. + config: Configuration to use for the graph. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + metadata: Metadata to add to assistant. + assistant_id: Assistant ID to use, will default to a random UUID if not provided. + if_exists: How to handle duplicate creation. Defaults to 'raise' under the hood. + Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing assistant). + name: The name of the assistant. Defaults to 'Untitled' under the hood. + headers: Optional custom headers to include with the request. + description: Optional description of the assistant. + The description field is available for langgraph-api server version>=0.0.45 + params: Optional query parameters to include with the request. + + Returns: + The created assistant. + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + assistant = client.assistants.create( + graph_id="agent", + context={"model_name": "openai"}, + metadata={"number":1}, + assistant_id="my-assistant-id", + if_exists="do_nothing", + name="my_name" + ) + ``` + """ + payload: dict[str, Any] = { + "graph_id": graph_id, + } + if config: + payload["config"] = config + if context: + payload["context"] = context + if metadata: + payload["metadata"] = metadata + if assistant_id: + payload["assistant_id"] = assistant_id + if if_exists: + payload["if_exists"] = if_exists + if name: + payload["name"] = name + if description: + payload["description"] = description + return self.http.post( + "/assistants", json=payload, headers=headers, params=params + ) + + def update( + self, + assistant_id: str, + *, + graph_id: str | None = None, + config: Config | None = None, + context: Context | None = None, + metadata: Json = None, + name: str | None = None, + headers: Mapping[str, str] | None = None, + description: str | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Update an assistant. + + Use this to point to a different graph, update the configuration, or change the metadata of an assistant. + + Args: + assistant_id: Assistant to update. + graph_id: The ID of the graph the assistant should use. + The graph ID is normally set in your langgraph.json configuration. If `None`, assistant will keep pointing to same graph. + config: Configuration to use for the graph. + context: Static context to add to the assistant. + !!! version-added "Added in version 0.6.0" + metadata: Metadata to merge with existing assistant metadata. + name: The new name for the assistant. + headers: Optional custom headers to include with the request. + description: Optional description of the assistant. + The description field is available for langgraph-api server version>=0.0.45 + + Returns: + The updated assistant. + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + assistant = client.assistants.update( + assistant_id='e280dad7-8618-443f-87f1-8e41841c180f', + graph_id="other-graph", + context={"model_name": "anthropic"}, + metadata={"number":2} + ) + ``` + """ + payload: dict[str, Any] = {} + if graph_id: + payload["graph_id"] = graph_id + if config is not None: + payload["config"] = config + if context is not None: + payload["context"] = context + if metadata: + payload["metadata"] = metadata + if name: + payload["name"] = name + if description: + payload["description"] = description + return self.http.patch( + f"/assistants/{assistant_id}", + json=payload, + headers=headers, + params=params, + ) + + def delete( + self, + assistant_id: str, + *, + delete_threads: bool = False, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> None: + """Delete an assistant. + + Args: + assistant_id: The assistant ID to delete. + delete_threads: If true, delete all threads with `metadata.assistant_id` + matching this assistant, along with runs and checkpoints belonging to + those threads. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + `None` + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + client.assistants.delete( + assistant_id="my_assistant_id" + ) + ``` + + """ + query_params: dict[str, Any] = {} + if delete_threads: + query_params["delete_threads"] = True + if params: + query_params.update(params) + self.http.delete( + f"/assistants/{assistant_id}", + headers=headers, + params=query_params or None, + ) + + @overload + def search( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + limit: int = 10, + offset: int = 0, + sort_by: AssistantSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[AssistantSelectField] | None = None, + response_format: Literal["object"], + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> AssistantsSearchResponse: ... + + @overload + def search( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + limit: int = 10, + offset: int = 0, + sort_by: AssistantSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[AssistantSelectField] | None = None, + response_format: Literal["array"] = "array", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[Assistant]: ... + + def search( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + limit: int = 10, + offset: int = 0, + sort_by: AssistantSortBy | None = None, + sort_order: SortOrder | None = None, + select: list[AssistantSelectField] | None = None, + response_format: Literal["array", "object"] = "array", + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> AssistantsSearchResponse | list[Assistant]: + """Search for assistants. + + Args: + metadata: Metadata to filter by. Exact match filter for each KV pair. + graph_id: The ID of the graph to filter by. + The graph ID is normally set in your langgraph.json configuration. + name: The name of the assistant to filter by. + The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name. + limit: The maximum number of results to return. + offset: The number of results to skip. + sort_by: The field to sort by. + sort_order: The order to sort by. + select: Specific assistant fields to include in the response. + response_format: Controls the response shape. Use `"array"` (default) + to return a bare list of assistants, or `"object"` to return + a mapping containing assistants plus pagination metadata. + Defaults to "array", though this default will be changed to "object" in a future release. + headers: Optional custom headers to include with the request. + + Returns: + A list of assistants (when `response_format="array"`) or a mapping + with the assistants and the next pagination cursor (when + `response_format="object"`). + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + response = client.assistants.search( + metadata = {"name":"my_name"}, + graph_id="my_graph_id", + limit=5, + offset=5, + response_format="object", + ) + assistants = response["assistants"] + next_cursor = response["next"] + ``` + """ + if response_format not in ("array", "object"): + raise ValueError("response_format must be 'array' or 'object'") + payload: dict[str, Any] = { + "limit": limit, + "offset": offset, + } + if metadata: + payload["metadata"] = metadata + if graph_id: + payload["graph_id"] = graph_id + if name: + payload["name"] = name + if sort_by: + payload["sort_by"] = sort_by + if sort_order: + payload["sort_order"] = sort_order + if select: + payload["select"] = select + next_cursor: str | None = None + + def capture_pagination(response: httpx.Response) -> None: + nonlocal next_cursor + next_cursor = response.headers.get("X-Pagination-Next") + + assistants = cast( + list[Assistant], + self.http.post( + "/assistants/search", + json=payload, + headers=headers, + params=params, + on_response=capture_pagination if response_format == "object" else None, + ), + ) + if response_format == "object": + return {"assistants": assistants, "next": next_cursor} + return assistants + + def count( + self, + *, + metadata: Json = None, + graph_id: str | None = None, + name: str | None = None, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> int: + """Count assistants matching filters. + + Args: + metadata: Metadata to filter by. Exact match for each key/value. + graph_id: Optional graph id to filter by. + name: Optional name to filter by. + The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name. + headers: Optional custom headers to include with the request. + params: Optional query parameters to include with the request. + + Returns: + int: Number of assistants matching the criteria. + """ + payload: dict[str, Any] = {} + if metadata: + payload["metadata"] = metadata + if graph_id: + payload["graph_id"] = graph_id + if name: + payload["name"] = name + return self.http.post( + "/assistants/count", json=payload, headers=headers, params=params + ) + + def get_versions( + self, + assistant_id: str, + metadata: Json = None, + limit: int = 10, + offset: int = 0, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> list[AssistantVersion]: + """List all versions of an assistant. + + Args: + assistant_id: The assistant ID to get versions for. + metadata: Metadata to filter versions by. Exact match filter for each KV pair. + limit: The maximum number of versions to return. + offset: The number of versions to skip. + headers: Optional custom headers to include with the request. + + Returns: + A list of assistants. + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + assistant_versions = client.assistants.get_versions( + assistant_id="my_assistant_id" + ) + ``` + + """ + + payload: dict[str, Any] = { + "limit": limit, + "offset": offset, + } + if metadata: + payload["metadata"] = metadata + return self.http.post( + f"/assistants/{assistant_id}/versions", + json=payload, + headers=headers, + params=params, + ) + + def set_latest( + self, + assistant_id: str, + version: int, + *, + headers: Mapping[str, str] | None = None, + params: QueryParamTypes | None = None, + ) -> Assistant: + """Change the version of an assistant. + + Args: + assistant_id: The assistant ID to delete. + version: The version to change to. + headers: Optional custom headers to include with the request. + + Returns: + `Assistant` Object. + + ???+ example "Example Usage" + + ```python + client = get_sync_client(url="http://localhost:2024") + new_version_assistant = client.assistants.set_latest( + assistant_id="my_assistant_id", + version=3 + ) + ``` + + """ + + payload: dict[str, Any] = {"version": version} + + return self.http.post( + f"/assistants/{assistant_id}/latest", + json=payload, + headers=headers, + params=params, + ) diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/auth/__init__.py b/python/user_packages/Python313/site-packages/langgraph_sdk/auth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d627c5f4d544d28c6abddd6a85d945258ac650e2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/auth/__init__.py @@ -0,0 +1,876 @@ +from __future__ import annotations + +import inspect +import typing +from collections.abc import Callable, Sequence + +from langgraph_sdk.auth import exceptions, types + +TH = typing.TypeVar("TH", bound=types.Handler) +AH = typing.TypeVar("AH", bound=types.Authenticator) + + +class Auth: + """Add custom authentication and authorization management to your LangGraph application. + + The Auth class provides a unified system for handling authentication and + authorization in LangGraph applications. It supports custom user authentication + protocols and fine-grained authorization rules for different resources and + actions. + + To use, create a separate python file and add the path to the file to your + LangGraph API configuration file (`langgraph.json`). Within that file, create + an instance of the Auth class and register authentication and authorization + handlers as needed. + + Example `langgraph.json` file: + + ```json + { + "dependencies": ["."], + "graphs": { + "agent": "./my_agent/agent.py:graph" + }, + "env": ".env", + "auth": { + "path": "./auth.py:my_auth" + } + ``` + + Then the LangGraph server will load your auth file and run it server-side whenever a request comes in. + + ???+ example "Basic Usage" + + ```python + from langgraph_sdk import Auth + + my_auth = Auth() + + @my_auth.authenticate + async def authenticate(authorization: str) -> Auth.types.MinimalUserDict: + user = await verify_token(authorization) # Your token verification logic + if not user: + raise Auth.exceptions.HTTPException( + status_code=401, detail="Unauthorized" + ) + return { + "identity": user["id"], + "permissions": user.get("permissions", []), + } + + # Default deny: reject all requests that don't have a specific handler + @my_auth.on + async def deny_all(ctx: Auth.types.AuthContext, value: Any) -> False: + return False + + # Allow users to create threads with their own identity as owner + @my_auth.on.threads.create + async def allow_thread_create( + ctx: Auth.types.AuthContext, value: Auth.types.on.threads.create.value + ): + metadata = value.setdefault("metadata", {}) + metadata["owner"] = ctx.user.identity + + # Allow users to read and search their own threads + @my_auth.on.threads.read + async def allow_thread_read( + ctx: Auth.types.AuthContext, value: Auth.types.on.threads.read.value + ) -> Auth.types.FilterType: + return {"owner": ctx.user.identity} + + @my_auth.on.threads.search + async def allow_thread_search( + ctx: Auth.types.AuthContext, value: Auth.types.on.threads.search.value + ) -> Auth.types.FilterType: + return {"owner": ctx.user.identity} + + # Scope all store operations to the user's namespace + @my_auth.on.store + async def scope_store(ctx: Auth.types.AuthContext, value: Auth.types.on.store.value): + namespace = tuple(value["namespace"]) if value.get("namespace") else () + if not namespace or namespace[0] != ctx.user.identity: + namespace = (ctx.user.identity, *namespace) + value["namespace"] = namespace + ``` + + ???+ note "Request Processing Flow" + + 1. Authentication (your `@auth.authenticate` handler) is performed first on **every request** + 2. For authorization, the most specific matching handler is called: + * If a handler exists for the exact resource and action, it is used (e.g., `@auth.on.threads.create`) + * Otherwise, if a handler exists for the resource with any action, it is used (e.g., `@auth.on.threads`) + * Finally, if no specific handlers match, the global handler is used (e.g., `@auth.on`) + * If no global handler is set, the request is accepted + + This allows you to set default behavior with a global handler while + overriding specific routes as needed. + """ + + __slots__ = ( + "_authenticate_handler", + "_global_handlers", + "_handler_cache", + "_handlers", + "on", + ) + types = types + """Reference to auth type definitions. + + Provides access to all type definitions used in the auth system, + like ThreadsCreate, AssistantsRead, etc.""" + + exceptions = exceptions + """Reference to auth exception definitions. + + Provides access to all exception definitions used in the auth system, + like HTTPException, etc. + """ + + def __init__(self) -> None: + self.on = _On(self) + """Entry point for authorization handlers that control access to specific resources. + + The on class provides a flexible way to define authorization rules for different + resources and actions in your application. It supports three main usage patterns: + + 1. Global handlers that run for all resources and actions + 2. Resource-specific handlers that run for all actions on a resource + 3. Resource and action specific handlers for fine-grained control + + Each handler must be an async function that accepts two parameters: + - ctx (AuthContext): Contains request context and authenticated user info + - value: The data being authorized (type varies by endpoint) + + The handler should return one of: + + - None or True: Accept the request + - False: Reject with 403 error + - FilterType: Apply filtering rules to the response + + ???+ example "Examples" + + Start by denying all requests by default, then add specific handlers + to allow access: + + ```python + # Default deny: reject all unhandled requests + @auth.on + async def deny_all(ctx: AuthContext, value: Any) -> False: + return False + ``` + + Resource-specific handler. This takes precedence over the global handler + for all actions on the `threads` resource: + + ```python + @auth.on.threads + async def allow_thread_access(ctx: AuthContext, value: Any) -> Auth.types.FilterType: + # Only allow access to threads owned by the user + return {"owner": ctx.user.identity} + ``` + + Resource and action specific handler: + + ```python + @auth.on.threads.delete + async def allow_admin_thread_deletion(ctx: AuthContext, value: Any) -> bool: + # Only admins can delete threads + return "admin" in ctx.user.permissions + ``` + + Multiple resources or actions: + + ```python + @auth.on(resources=["threads", "assistants"], actions=["read", "search"]) + async def allow_reads(ctx: AuthContext, value: Any) -> Auth.types.FilterType: + # Allow read/search access to resources owned by the user + return {"owner": ctx.user.identity} + ``` + + Auth for the `store` resource is a bit different since its structure is developer defined. + You typically want to scope store operations by rewriting the namespace to include the user's identity. + The `value` dict is mutable โ€” changes to `value["namespace"]` are used by the server for the actual operation. + + ```python + @auth.on.store + async def scope_store(ctx: AuthContext, value: Auth.types.on.store.value): + # Allow store access but scope to user's namespace + namespace = tuple(value["namespace"]) if value.get("namespace") else () + if not namespace or namespace[0] != ctx.user.identity: + namespace = (ctx.user.identity, *namespace) + value["namespace"] = namespace + ``` + + You can also register handlers for specific store actions: + + ```python + @auth.on.store.put + async def allow_put(ctx: AuthContext, value: Auth.types.on.store.put.value): + # Allow puts, scoped to user's namespace + value["namespace"] = (ctx.user.identity, *value["namespace"]) + + @auth.on.store.get + async def allow_get(ctx: AuthContext, value: Auth.types.on.store.get.value): + # Allow gets, scoped to user's namespace + value["namespace"] = (ctx.user.identity, *value["namespace"]) + ``` + """ + # These are accessed by the API. Changes to their names or types is + # will be considered a breaking change. + self._handlers: dict[tuple[str, str], list[types.Handler]] = {} + self._global_handlers: list[types.Handler] = [] + self._authenticate_handler: types.Authenticator | None = None + self._handler_cache: dict[tuple[str, str], types.Handler] = {} + + def authenticate(self, fn: AH) -> AH: + """Register an authentication handler function. + + The authentication handler is responsible for verifying credentials + and returning user scopes. It can accept any of the following parameters + by name: + + - request (Request): The raw ASGI request object + - path (str): The request path, e.g., "/threads/abcd-1234-abcd-1234/runs/abcd-1234-abcd-1234/stream" + - method (str): The HTTP method, e.g., "GET" + - path_params (dict[str, str]): URL path parameters, e.g., {"thread_id": "abcd-1234-abcd-1234", "run_id": "abcd-1234-abcd-1234"} + - query_params (dict[str, str]): URL query parameters, e.g., {"stream": "true"} + - headers (dict[bytes, bytes]): Request headers + - authorization (str | None): The Authorization header value (e.g., "Bearer ") + + Args: + fn: The authentication handler function to register. + Must return a representation of the user. This could be a: + - string (the user id) + - dict containing {"identity": str, "permissions": list[str]} + - or an object with identity and permissions properties + Permissions can be optionally used by your handlers downstream. + + Returns: + The registered handler function. + + Raises: + ValueError: If an authentication handler is already registered. + + ???+ example "Examples" + + Basic token authentication: + + ```python + @auth.authenticate + async def authenticate(authorization: str) -> str: + user_id = verify_token(authorization) + return user_id + ``` + + Accept the full request context: + + ```python + @auth.authenticate + async def authenticate( + method: str, + path: str, + headers: dict[str, bytes] + ) -> str: + user = await verify_request(method, path, headers) + return user + ``` + + Return user name and permissions: + + ```python + @auth.authenticate + async def authenticate( + method: str, + path: str, + headers: dict[str, bytes] + ) -> Auth.types.MinimalUserDict: + permissions, user = await verify_request(method, path, headers) + # Permissions could be things like ["runs:read", "runs:write", "threads:read", "threads:write"] + return { + "identity": user["id"], + "permissions": permissions, + "display_name": user["name"], + } + ``` + """ + if self._authenticate_handler is not None: + raise ValueError( + f"Authentication handler already set as {self._authenticate_handler}." + ) + self._authenticate_handler = fn + return fn + + +## Helper types & utilities + +V = typing.TypeVar("V", contravariant=True) + + +class _ActionHandler(typing.Protocol[V]): + async def __call__( + self, *, ctx: types.AuthContext, value: V + ) -> types.HandlerResult: ... + + +T = typing.TypeVar("T", covariant=True) + + +class _ResourceActionOn(typing.Generic[T]): + def __init__( + self, + auth: Auth, + resource: typing.Literal["threads", "crons", "assistants"], + action: typing.Literal[ + "create", "read", "update", "delete", "search", "create_run" + ], + value: type[T], + ) -> None: + self.auth = auth + self.resource = resource + self.action = action + self.value = value + + def __call__(self, fn: _ActionHandler[T]) -> _ActionHandler[T]: + _validate_handler(fn) + _register_handler(self.auth, self.resource, self.action, fn) + return fn + + +VCreate = typing.TypeVar("VCreate", covariant=True) +VUpdate = typing.TypeVar("VUpdate", covariant=True) +VRead = typing.TypeVar("VRead", covariant=True) +VDelete = typing.TypeVar("VDelete", covariant=True) +VSearch = typing.TypeVar("VSearch", covariant=True) + + +class _ResourceOn(typing.Generic[VCreate, VRead, VUpdate, VDelete, VSearch]): + """ + Generic base class for resource-specific handlers. + """ + + value: type[VCreate | VUpdate | VRead | VDelete | VSearch] + + Create: type[VCreate] + Read: type[VRead] + Update: type[VUpdate] + Delete: type[VDelete] + Search: type[VSearch] + + def __init__( + self, + auth: Auth, + resource: typing.Literal["threads", "crons", "assistants"], + ) -> None: + self.auth = auth + self.resource = resource + self.create: _ResourceActionOn[VCreate] = _ResourceActionOn( + auth, resource, "create", self.Create + ) + self.read: _ResourceActionOn[VRead] = _ResourceActionOn( + auth, resource, "read", self.Read + ) + self.update: _ResourceActionOn[VUpdate] = _ResourceActionOn( + auth, resource, "update", self.Update + ) + self.delete: _ResourceActionOn[VDelete] = _ResourceActionOn( + auth, resource, "delete", self.Delete + ) + self.search: _ResourceActionOn[VSearch] = _ResourceActionOn( + auth, resource, "search", self.Search + ) + + @typing.overload + def __call__( + self, + fn: ( + _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch] + | _ActionHandler[dict[str, typing.Any]] + ), + ) -> _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch]: ... + + @typing.overload + def __call__( + self, + *, + resources: str | Sequence[str], + actions: str | Sequence[str] | None = None, + ) -> Callable[ + [_ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch]], + _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch], + ]: ... + + def __call__( + self, + fn: ( + _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch] + | _ActionHandler[dict[str, typing.Any]] + | None + ) = None, + *, + resources: str | Sequence[str] | None = None, + actions: str | Sequence[str] | None = None, + ) -> ( + _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch] + | Callable[ + [_ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch]], + _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch], + ] + ): + if fn is not None: + _validate_handler(fn) + return typing.cast( + "_ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch]", + _register_handler(self.auth, self.resource, "*", fn), + ) + + def decorator( + handler: _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch], + ) -> _ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch]: + _validate_handler(handler) + return typing.cast( + "_ActionHandler[VCreate | VUpdate | VRead | VDelete | VSearch]", + _register_handler(self.auth, self.resource, "*", handler), + ) + + # Accept keyword-only parameters for future filtering behavior; referenced to satisfy linters. + _ = resources, actions + return decorator + + +class _AssistantsOn( + _ResourceOn[ + types.AssistantsCreate, + types.AssistantsRead, + types.AssistantsUpdate, + types.AssistantsDelete, + types.AssistantsSearch, + ] +): + value = ( + types.AssistantsCreate + | types.AssistantsRead + | types.AssistantsUpdate + | types.AssistantsDelete + | types.AssistantsSearch + ) + Create = types.AssistantsCreate + Read = types.AssistantsRead + Update = types.AssistantsUpdate + Delete = types.AssistantsDelete + Search = types.AssistantsSearch + + +class _ThreadsOn( + _ResourceOn[ + types.ThreadsCreate, + types.ThreadsRead, + types.ThreadsUpdate, + types.ThreadsDelete, + types.ThreadsSearch, + ] +): + value = ( + types.ThreadsCreate + | types.ThreadsRead + | types.ThreadsUpdate + | types.ThreadsDelete + | types.ThreadsSearch + | types.RunsCreate + ) + Create = types.ThreadsCreate + Read = types.ThreadsRead + Update = types.ThreadsUpdate + Delete = types.ThreadsDelete + Search = types.ThreadsSearch + CreateRun = types.RunsCreate + + def __init__( + self, + auth: Auth, + resource: typing.Literal["threads", "crons", "assistants"], + ) -> None: + super().__init__(auth, resource) + self.create_run: _ResourceActionOn[types.RunsCreate] = _ResourceActionOn( + auth, resource, "create_run", self.CreateRun + ) + + +class _CronsOn( + _ResourceOn[ + types.CronsCreate, + types.CronsRead, + types.CronsUpdate, + types.CronsDelete, + types.CronsSearch, + ] +): + value = type[ + types.CronsCreate + | types.CronsRead + | types.CronsUpdate + | types.CronsDelete + | types.CronsSearch + ] + + Create = types.CronsCreate + Read = types.CronsRead + Update = types.CronsUpdate + Delete = types.CronsDelete + Search = types.CronsSearch + + +class _StoreActionOn(typing.Generic[T]): + """Decorator for registering a handler for a specific store action.""" + + def __init__( + self, + auth: Auth, + action: typing.Literal["put", "get", "search", "delete", "list_namespaces"], + value: type[T], + ) -> None: + self.auth = auth + self.action = action + self.value = value + + def __call__(self, fn: _ActionHandler[T]) -> _ActionHandler[T]: + _validate_handler(fn) + _register_handler(self.auth, "store", self.action, fn) + return fn + + +class _StoreOn: + def __init__(self, auth: Auth) -> None: + self._auth = auth + self.put = _StoreActionOn(auth, "put", types.StorePut) + """Register a handler for store put operations. + + ???+ example "Example" + If using `@auth.on` to deny by default, register this handler to allow + put operations (scoped to the user's namespace): + + ```python + @auth.on.store.put + async def allow_store_put(ctx: Auth.types.AuthContext, value: Auth.types.on.store.put.value): + # Allow puts, scoped to user's namespace + value["namespace"] = (ctx.user.identity, *value["namespace"]) + ``` + """ + self.get = _StoreActionOn(auth, "get", types.StoreGet) + """Register a handler for store get operations. + + ???+ example "Example" + If using `@auth.on` to deny by default, register this handler to allow + get operations (scoped to the user's namespace): + + ```python + @auth.on.store.get + async def allow_store_get(ctx: Auth.types.AuthContext, value: Auth.types.on.store.get.value): + # Allow gets, scoped to user's namespace + value["namespace"] = (ctx.user.identity, *value["namespace"]) + ``` + """ + self.search = _StoreActionOn(auth, "search", types.StoreSearch) + """Register a handler for store search operations. + + ???+ example "Example" + If using `@auth.on` to deny by default, register this handler to allow + search operations (scoped to the user's namespace): + + ```python + @auth.on.store.search + async def allow_store_search(ctx: Auth.types.AuthContext, value: Auth.types.on.store.search.value): + # Allow searches, scoped to user's namespace + value["namespace"] = (ctx.user.identity, *value["namespace"]) + ``` + """ + self.delete = _StoreActionOn(auth, "delete", types.StoreDelete) + """Register a handler for store delete operations. + + ???+ example "Example" + If using `@auth.on` to deny by default, register this handler to allow + delete operations (scoped to the user's namespace): + + ```python + @auth.on.store.delete + async def allow_store_delete(ctx: Auth.types.AuthContext, value: Auth.types.on.store.delete.value): + # Allow deletes, scoped to user's namespace + value["namespace"] = (ctx.user.identity, *value["namespace"]) + ``` + """ + self.list_namespaces = _StoreActionOn( + auth, "list_namespaces", types.StoreListNamespaces + ) + """Register a handler for store list_namespaces operations. + + ???+ example "Example" + If using `@auth.on` to deny by default, register this handler to allow + namespace listing (scoped to the user's prefix): + + ```python + @auth.on.store.list_namespaces + async def allow_list_ns(ctx: Auth.types.AuthContext, value: Auth.types.on.store.list_namespaces.value): + # Allow listing, scoped to user's namespace prefix + value["namespace"] = (ctx.user.identity,) + ``` + """ + + @typing.overload + def __call__( + self, + *, + actions: ( + typing.Literal["put", "get", "search", "list_namespaces", "delete"] + | Sequence[ + typing.Literal["put", "get", "search", "list_namespaces", "delete"] + ] + | None + ) = None, + ) -> Callable[[AHO], AHO]: ... + + @typing.overload + def __call__(self, fn: AHO) -> AHO: ... + + def __call__( + self, + fn: AHO | None = None, + *, + actions: ( + typing.Literal["put", "get", "search", "list_namespaces", "delete"] + | Sequence[ + typing.Literal["put", "get", "search", "list_namespaces", "delete"] + ] + | None + ) = None, + ) -> AHO | Callable[[AHO], AHO]: + """Register a handler for specific resources and actions. + + Can be used as a decorator or with explicit resource/action parameters: + + @auth.on.store + async def handler(): ... # Handle all store ops + + @auth.on.store(actions=("put", "get", "search", "delete")) + async def handler(): ... # Handle specific store ops + + @auth.on.store.put + async def handler(): ... # Handle store.put ops + """ + if fn is not None: + # Used as a plain decorator + _register_handler(self._auth, "store", None, fn) + return fn + + # Used with parameters, return a decorator + def decorator( + handler: AHO, + ) -> AHO: + if isinstance(actions, str): + action_list = [actions] + else: + action_list = list(actions) if actions is not None else ["*"] + for action in action_list: + _register_handler(self._auth, "store", action, handler) + return handler + + return decorator + + +AHO = typing.TypeVar("AHO", bound=_ActionHandler[dict[str, typing.Any]]) + + +class _On: + """Entry point for authorization handlers that control access to specific resources. + + The _On class provides a flexible way to define authorization rules for different resources + and actions in your application. It supports three main usage patterns: + + 1. Global handlers that run for all resources and actions + 2. Resource-specific handlers that run for all actions on a resource + 3. Resource and action specific handlers for fine-grained control + + Each handler must be an async function that accepts two parameters: + - ctx (AuthContext): Contains request context and authenticated user info + - value: The data being authorized (type varies by endpoint) + + The handler should return one of: + - None or True: Accept the request + - False: Reject with 403 error + - FilterType: Apply filtering rules to the response + + ???+ example "Examples" + + Start by denying all requests by default with a global handler, + then add specific handlers to allow access: + + ```python + # Default deny: reject all requests without a specific handler + @auth.on + async def deny_all(ctx: AuthContext, value: Any) -> False: + return False + ``` + + Resource-specific handler to allow access (takes precedence + over the global deny handler): + + ```python + @auth.on.threads + async def allow_thread_access(ctx: AuthContext, value: Any) -> Auth.types.FilterType: + # Allow access only to threads owned by the user + return {"owner": ctx.user.identity} + ``` + + Resource and action specific handler: + + ```python + @auth.on.threads.create + async def allow_thread_create(ctx: AuthContext, value: Any) -> None: + # Allow thread creation, stamping the owner + value.setdefault("metadata", {})["owner"] = ctx.user.identity + ``` + + Multiple resources or actions: + + ```python + @auth.on(resources=["threads", "assistants"], actions=["read", "search"]) + async def allow_reads(ctx: AuthContext, value: Any) -> Auth.types.FilterType: + # Allow read/search, scoped to user's resources + return {"owner": ctx.user.identity} + ``` + """ + + __slots__ = ( + "_auth", + "assistants", + "crons", + "runs", + "store", + "threads", + "value", + ) + + def __init__(self, auth: Auth) -> None: + self._auth = auth + self.assistants = _AssistantsOn(auth, "assistants") + self.threads = _ThreadsOn(auth, "threads") + self.crons = _CronsOn(auth, "crons") + self.store = _StoreOn(auth) + self.value = dict[str, typing.Any] + + @typing.overload + def __call__( + self, + *, + resources: str | Sequence[str], + actions: str | Sequence[str] | None = None, + ) -> Callable[[AHO], AHO]: ... + + @typing.overload + def __call__(self, fn: AHO) -> AHO: ... + + def __call__( + self, + fn: AHO | None = None, + *, + resources: str | Sequence[str] | None = None, + actions: str | Sequence[str] | None = None, + ) -> AHO | Callable[[AHO], AHO]: + """Register a handler for specific resources and actions. + + Can be used as a decorator or with explicit resource/action parameters: + + @auth.on + async def handler(): ... # Global handler + + @auth.on(resources="threads") + async def handler(): ... # types.Handler for all thread actions + + @auth.on(resources="threads", actions="create") + async def handler(): ... # types.Handler for thread creation + """ + if fn is not None: + # Used as a plain decorator + _register_handler(self._auth, None, None, fn) + return fn + + # Used with parameters, return a decorator + def decorator( + handler: AHO, + ) -> AHO: + if isinstance(resources, str): + resource_list = [resources] + else: + resource_list = list(resources) if resources is not None else ["*"] + + if isinstance(actions, str): + action_list = [actions] + else: + action_list = list(actions) if actions is not None else ["*"] + for resource in resource_list: + for action in action_list: + _register_handler(self._auth, resource, action, handler) + return handler + + return decorator + + +def _register_handler( + auth: Auth, + resource: str | None, + action: str | None, + fn: types.Handler, +) -> types.Handler: + _validate_handler(fn) + resource = resource or "*" + action = action or "*" + if resource == "*" and action == "*": + if auth._global_handlers: + raise ValueError("Global handler already set.") + auth._global_handlers.append(fn) + else: + r = resource if resource is not None else "*" + a = action if action is not None else "*" + if (r, a) in auth._handlers: + raise ValueError(f"types.Handler already set for {r}, {a}.") + auth._handlers[(r, a)] = [fn] + return fn + + +def _validate_handler(fn: Callable[..., typing.Any]) -> None: + """Validates that an auth handler function meets the required signature. + + Auth handlers must: + 1. Be async functions + 2. Accept a ctx parameter of type AuthContext + 3. Accept a value parameter for the data being authorized + """ + if not inspect.iscoroutinefunction(fn): + raise ValueError( + f"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. " + "Add 'async' before 'def' to make it asynchronous and ensure" + " any IO operations are non-blocking." + ) + + sig = inspect.signature(fn) + if "ctx" not in sig.parameters: + raise ValueError( + f"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. " + "Update the function signature to include this required parameter." + ) + if "value" not in sig.parameters: + raise ValueError( + f"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'value' parameter. " + " The value contains the mutable data being sent to the endpoint." + "Update the function signature to include this required parameter." + ) + + +def is_studio_user( + user: types.MinimalUser | types.BaseUser | types.MinimalUserDict, +) -> bool: + return ( + isinstance(user, types.StudioUser) + or (isinstance(user, dict) and user.get("kind") == "StudioUser") # ty: ignore[invalid-argument-type] + ) + + +__all__ = ["Auth", "exceptions", "types"] diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/auth/exceptions.py b/python/user_packages/Python313/site-packages/langgraph_sdk/auth/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..594939e752d1c3d218cf7284d5eda55600a84891 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/auth/exceptions.py @@ -0,0 +1,59 @@ +"""Exceptions used in the auth system.""" + +from __future__ import annotations + +import http +from collections.abc import Mapping + + +class HTTPException(Exception): + """HTTP exception that you can raise to return a specific HTTP error response. + + Since this is defined in the auth module, we default to a 401 status code. + + Args: + status_code: HTTP status code for the error. Defaults to 401 "Unauthorized". + detail: Detailed error message. If `None`, uses a default + message based on the status code. + headers: Additional HTTP headers to include in the error response. + + Example: + Default: + ```python + raise HTTPException() + # HTTPException(status_code=401, detail='Unauthorized') + ``` + + Add headers: + ```python + raise HTTPException(headers={"X-Custom-Header": "Custom Value"}) + # HTTPException(status_code=401, detail='Unauthorized', headers={"WWW-Authenticate": "Bearer"}) + ``` + + Custom error: + ```python + raise HTTPException(status_code=404, detail="Not found") + ``` + """ + + def __init__( + self, + status_code: int = 401, + detail: str | None = None, + headers: Mapping[str, str] | None = None, + ) -> None: + if detail is None: + detail = http.HTTPStatus(status_code).phrase + self.status_code = status_code + self.detail = detail + self.headers = headers + + def __str__(self) -> str: + return f"{self.status_code}: {self.detail}" + + def __repr__(self) -> str: + class_name = self.__class__.__name__ + return f"{class_name}(status_code={self.status_code!r}, detail={self.detail!r})" + + +__all__ = ["HTTPException"] diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/auth/types.py b/python/user_packages/Python313/site-packages/langgraph_sdk/auth/types.py new file mode 100644 index 0000000000000000000000000000000000000000..84211878d919fdc3bfd62a472f123ca32f0735fe --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/auth/types.py @@ -0,0 +1,1162 @@ +"""Authentication and authorization types for LangGraph. + +This module defines the core types used for authentication, authorization, and +request handling in LangGraph. It includes user protocols, authentication contexts, +and typed dictionaries for various API operations. + +Note: + All typing.TypedDict classes use total=False to make all fields typing.Optional by default. +""" + +from __future__ import annotations + +import typing +from collections.abc import Awaitable, Callable, Sequence +from dataclasses import dataclass +from datetime import datetime +from uuid import UUID + +import typing_extensions + +RunStatus = typing.Literal["pending", "error", "success", "timeout", "interrupted"] +"""Status of a run execution. + +Values: + - pending: Run is queued or in progress + - error: Run failed with an error + - success: Run completed successfully + - timeout: Run exceeded time limit + - interrupted: Run was manually interrupted +""" + +MultitaskStrategy = typing.Literal["reject", "rollback", "interrupt", "enqueue"] +"""Strategy for handling multiple concurrent tasks. + +Values: + - reject: Reject new tasks while one is in progress + - rollback: Cancel current task and start new one + - interrupt: Interrupt current task and start new one + - enqueue: Queue new tasks to run after current one +""" + +OnConflictBehavior = typing.Literal["raise", "do_nothing"] +"""Behavior when encountering conflicts. + +Values: + - raise: Raise an exception on conflict + - do_nothing: Silently ignore conflicts +""" + +IfNotExists = typing.Literal["create", "reject"] +"""Behavior when an entity doesn't exist. + +Values: + - create: Create the entity + - reject: Reject the operation +""" + +FilterType = ( + dict[ + str, + str + | dict[typing.Literal["$eq", "$contains"], str] + | dict[typing.Literal["$contains"], list[str]], + ] + | dict[str, str] +) +"""Response type for authorization handlers. + +Supports exact matches and operators: + - Exact match shorthand: {"field": "value"} + - Exact match: {"field": {"$eq": "value"}} + - Contains (membership): {"field": {"$contains": "value"}} + - Contains (subset containment): {"field": {"$contains": ["value1", "value2"]}} + +Subset containment is only supported by newer versions of the LangGraph dev server; +install langgraph-runtime-inmem >= 0.14.1 to use this filter variant. + +???+ example "Examples" + + Simple exact match filter for the resource owner: + + ```python + filter = {"owner": "user-abcd123"} + ``` + + Explicit version of the exact match filter: + + ```python + filter = {"owner": {"$eq": "user-abcd123"}} + ``` + + Containment (membership of a single element): + + ```python + filter = {"participants": {"$contains": "user-abcd123"}} + ``` + + Containment (subset containment; all values must be present, but order doesn't matter): + + ```python + filter = {"participants": {"$contains": ["user-abcd123", "user-efgh456"]}} + ``` + + Combining filters (treated as a logical `AND`): + + ```python + filter = {"owner": "user-abcd123", "participants": {"$contains": "user-efgh456"}} + ``` +""" + +ThreadStatus = typing.Literal["idle", "busy", "interrupted", "error"] +"""Status of a thread. + +Values: + - idle: Thread is available for work + - busy: Thread is currently processing + - interrupted: Thread was interrupted + - error: Thread encountered an error +""" + +MetadataInput = dict[str, typing.Any] +"""Type for arbitrary metadata attached to entities. + +Allows storing custom key-value pairs with any entity. +Keys must be strings, values can be any JSON-serializable type. + +???+ example "Examples" + + ```python + metadata = { + "created_by": "user123", + "priority": 1, + "tags": ["important", "urgent"] + } + ``` +""" + +HandlerResult = None | bool | FilterType +"""The result of a handler can be: + * None | True: accept the request. + * False: reject the request with a 403 error + * FilterType: filter to apply +""" + +Handler = Callable[..., Awaitable[HandlerResult]] + +T = typing.TypeVar("T") + + +@typing.runtime_checkable +class MinimalUser(typing.Protocol): + """User objects must at least expose the identity property.""" + + @property + def identity(self) -> str: + """The unique identifier for the user. + + This could be a username, email, or any other unique identifier used + to distinguish between different users in the system. + """ + ... + + +class MinimalUserDict(typing.TypedDict, total=False): + """The dictionary representation of a user.""" + + identity: typing_extensions.Required[str] + """The required unique identifier for the user.""" + display_name: str + """The typing.Optional display name for the user.""" + is_authenticated: bool + """Whether the user is authenticated. Defaults to True.""" + permissions: Sequence[str] + """A list of permissions associated with the user. + + You can use these in your `@auth.on` authorization logic to determine + access permissions to different resources. + """ + + +@typing.runtime_checkable +class BaseUser(typing.Protocol): + """The base ASGI user protocol""" + + @property + def is_authenticated(self) -> bool: + """Whether the user is authenticated.""" + ... + + @property + def display_name(self) -> str: + """The display name of the user.""" + ... + + @property + def identity(self) -> str: + """The unique identifier for the user.""" + ... + + @property + def permissions(self) -> Sequence[str]: + """The permissions associated with the user.""" + ... + + def __getitem__(self, key): + """Get a key from your minimal user dict.""" + ... + + def __contains__(self, key): + """Check if a property exists.""" + ... + + def __iter__(self): + """Iterate over the keys of the user.""" + ... + + +class StudioUser: + """A user object that's populated from authenticated requests from the LangGraph studio. + + Note: Studio auth can be disabled in your `langgraph.json` config. + + ```json + { + "auth": { + "disable_studio_auth": true + } + } + ``` + + You can use `isinstance` checks in your authorization handlers (`@auth.on`) to control access specifically + for developers accessing the instance from the LangGraph Studio UI. + + ???+ example "Examples" + + Use `@auth.on` to deny by default, but allow Studio users through: + + ```python + @auth.on + async def deny_all_except_studio(ctx: Auth.types.AuthContext, value: Any) -> bool: + # Allow Studio users, deny everyone else by default + if isinstance(ctx.user, Auth.types.StudioUser): + return True + return False + + # Then add specific handlers to allow access for non-Studio users + @auth.on.threads + async def allow_thread_access(ctx: Auth.types.AuthContext, value: Any) -> Auth.types.FilterType: + return {"owner": ctx.user.identity} + ``` + """ + + __slots__ = ("_is_authenticated", "_permissions", "username") + + def __init__(self, username: str, is_authenticated: bool = False) -> None: + self.username = username + self._is_authenticated = is_authenticated + self._permissions = ["authenticated"] if is_authenticated else [] + + @property + def is_authenticated(self) -> bool: + return self._is_authenticated + + @property + def display_name(self) -> str: + return self.username + + @property + def identity(self) -> str: + return self.username + + @property + def permissions(self) -> Sequence[str]: + return self._permissions + + +Authenticator = Callable[ + ..., + Awaitable[ + MinimalUser + | str + | BaseUser + | MinimalUserDict + | typing.Mapping[str, typing.Any], + ], +] +"""Type for authentication functions. + +An authenticator can return either: +1. A string (user_id) +2. A dict containing {"identity": str, "permissions": list[str]} +3. An object with identity and permissions properties + +Permissions can be used downstream by your authorization logic to determine +access permissions to different resources. + +The authenticate decorator will automatically inject any of the following parameters +by name if they are included in your function signature: + +Parameters: + request (Request): The raw ASGI request object + body (dict): The parsed request body + path (str): The request path + method (str): The HTTP method (GET, POST, etc.) + path_params (dict[str, str] | None): URL path parameters + query_params (dict[str, str] | None): URL query parameters + headers (dict[str, bytes] | None): Request headers + authorization (str | None): The Authorization header value (e.g. "Bearer ") + +???+ example "Examples" + + Basic authentication with token: + + ```python + from langgraph_sdk import Auth + + auth = Auth() + + @auth.authenticate + async def authenticate1(authorization: str) -> Auth.types.MinimalUserDict: + return await get_user(authorization) + ``` + + Authentication with multiple parameters: + + ``` + @auth.authenticate + async def authenticate2( + method: str, + path: str, + headers: dict[str, bytes] + ) -> Auth.types.MinimalUserDict: + # Custom auth logic using method, path and headers + user = verify_request(method, path, headers) + return user + ``` + + Accepting the raw ASGI request: + + ```python + MY_SECRET = "my-secret-key" + @auth.authenticate + async def get_current_user(request: Request) -> Auth.types.MinimalUserDict: + try: + token = (request.headers.get("authorization") or "").split(" ", 1)[1] + payload = jwt.decode(token, MY_SECRET, algorithms=["HS256"]) + except (IndexError, InvalidTokenError): + raise HTTPException( + status_code=401, + detail="Invalid token", + headers={"WWW-Authenticate": "Bearer"}, + ) + + async with httpx.AsyncClient() as client: + response = await client.get( + f"https://api.myauth-provider.com/auth/v1/user", + headers={"Authorization": f"Bearer {MY_SECRET}"} + ) + if response.status_code != 200: + raise HTTPException(status_code=401, detail="User not found") + + user_data = response.json() + return { + "identity": user_data["id"], + "display_name": user_data.get("name"), + "permissions": user_data.get("permissions", []), + "is_authenticated": True, + } + ``` +""" + + +@dataclass(slots=True) +class BaseAuthContext: + """Base class for authentication context. + + Provides the fundamental authentication information needed for + authorization decisions. + """ + + permissions: Sequence[str] + """The permissions granted to the authenticated user.""" + + user: BaseUser + """The authenticated user.""" + + +@typing.final +@dataclass(slots=True) +class AuthContext(BaseAuthContext): + """Complete authentication context with resource and action information. + + Extends BaseAuthContext with specific resource and action being accessed, + allowing for fine-grained access control decisions. + """ + + resource: typing.Literal["runs", "threads", "crons", "assistants", "store"] + """The resource being accessed.""" + + action: typing.Literal[ + "create", + "read", + "update", + "delete", + "search", + "create_run", + "put", + "get", + "list_namespaces", + ] + """The action being performed on the resource. + + Most resources support the following actions: + - create: Create a new resource + - read: Read information about a resource + - update: Update an existing resource + - delete: Delete a resource + - search: Search for resources + + The store supports the following actions: + - put: Add or update an item in the store + - get: Get an item from the store + - search: Search for items within a namespace prefix + - delete: Delete an item from the store + - list_namespaces: List the namespaces in the store + """ + + +class ThreadTTL(typing.TypedDict, total=False): + """Time-to-live configuration for a thread. + + Matches the OpenAPI schema where TTL is represented as an object with + an optional strategy and a time value in minutes. + """ + + strategy: typing.Literal["delete"] + """TTL strategy. Currently only 'delete' is supported.""" + + ttl: int + """Time-to-live in minutes from now until the thread should be swept.""" + + +class ThreadsCreate(typing.TypedDict, total=False): + """Parameters for creating a new thread. + + ???+ example "Examples" + + ```python + create_params = { + "thread_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "metadata": {"owner": "user123"}, + "if_exists": "do_nothing" + } + ``` + """ + + thread_id: UUID + """Unique identifier for the thread.""" + + metadata: MetadataInput + """typing.Optional metadata to attach to the thread.""" + + if_exists: OnConflictBehavior + """Behavior when a thread with the same ID already exists.""" + + ttl: ThreadTTL + """Optional TTL configuration for the thread.""" + + +class ThreadsRead(typing.TypedDict, total=False): + """Parameters for reading thread state or run information. + + This type is used in three contexts: + 1. Reading thread, thread version, or thread state information: Only thread_id is provided + 2. Reading run information: Both thread_id and run_id are provided + """ + + thread_id: UUID + """Unique identifier for the thread.""" + + run_id: UUID | None + """Run ID to filter by. Only used when reading run information within a thread.""" + + +class ThreadsUpdate(typing.TypedDict, total=False): + """Parameters for updating a thread or run. + + Called for updates to a thread, thread version, or run + cancellation. + """ + + thread_id: UUID + """Unique identifier for the thread.""" + + metadata: MetadataInput + """typing.Optional metadata to update.""" + + action: typing.Literal["interrupt", "rollback"] | None + """typing.Optional action to perform on the thread.""" + + +class ThreadsDelete(typing.TypedDict, total=False): + """Parameters for deleting a thread. + + Called for deletes to a thread, thread version, or run + """ + + thread_id: UUID + """Unique identifier for the thread.""" + + run_id: UUID | None + """typing.Optional run ID to filter by.""" + + +class ThreadsSearch(typing.TypedDict, total=False): + """Parameters for searching threads. + + Called for searches to threads or runs. + """ + + metadata: MetadataInput + """typing.Optional metadata to filter by.""" + + values: MetadataInput + """typing.Optional values to filter by.""" + + status: ThreadStatus | None + """typing.Optional status to filter by.""" + + limit: int + """Maximum number of results to return.""" + + offset: int + """Offset for pagination.""" + + ids: Sequence[UUID] | None + """typing.Optional list of thread IDs to filter by.""" + + thread_id: UUID | None + """typing.Optional thread ID to filter by.""" + + +class RunsCreate(typing.TypedDict, total=False): + """Payload for creating a run. + + ???+ example "Examples" + + ```python + create_params = { + "assistant_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "thread_id": UUID("123e4567-e89b-12d3-a456-426614174001"), + "run_id": UUID("123e4567-e89b-12d3-a456-426614174002"), + "status": "pending", + "metadata": {"owner": "user123"}, + "prevent_insert_if_inflight": True, + "multitask_strategy": "reject", + "if_not_exists": "create", + "after_seconds": 10, + "kwargs": {"key": "value"}, + "action": "interrupt" + } + ``` + """ + + assistant_id: UUID | None + """typing.Optional assistant ID to use for this run.""" + + thread_id: UUID | None + """typing.Optional thread ID to use for this run.""" + + run_id: UUID | None + """typing.Optional run ID to use for this run.""" + + status: RunStatus | None + """typing.Optional status for this run.""" + + metadata: MetadataInput + """typing.Optional metadata for the run.""" + + prevent_insert_if_inflight: bool + """Prevent inserting a new run if one is already in flight.""" + + multitask_strategy: MultitaskStrategy + """Multitask strategy for this run.""" + + if_not_exists: IfNotExists + """IfNotExists for this run.""" + + after_seconds: int + """Number of seconds to wait before creating the run.""" + + kwargs: dict[str, typing.Any] + """Keyword arguments to pass to the run.""" + + action: typing.Literal["interrupt", "rollback"] | None + """Action to take if updating an existing run.""" + + +class AssistantsCreate(typing.TypedDict, total=False): + """Payload for creating an assistant. + + ???+ example "Examples" + + ```python + create_params = { + "assistant_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "graph_id": "graph123", + "config": {"tags": ["tag1", "tag2"]}, + "context": {"key": "value"}, + "metadata": {"owner": "user123"}, + "if_exists": "do_nothing", + "name": "Assistant 1" + } + ``` + """ + + assistant_id: UUID + """Unique identifier for the assistant.""" + + graph_id: str + """Graph ID to use for this assistant.""" + + config: dict[str, typing.Any] + """typing.Optional configuration for the assistant.""" + + context: dict[str, typing.Any] + + metadata: MetadataInput + """typing.Optional metadata to attach to the assistant.""" + + if_exists: OnConflictBehavior + """Behavior when an assistant with the same ID already exists.""" + + name: str + """Name of the assistant.""" + + +class AssistantsRead(typing.TypedDict, total=False): + """Payload for reading an assistant. + + ???+ example "Examples" + + ```python + read_params = { + "assistant_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "metadata": {"owner": "user123"} + } + ``` + """ + + assistant_id: UUID + """Unique identifier for the assistant.""" + + metadata: MetadataInput + """typing.Optional metadata to filter by.""" + + +class AssistantsUpdate(typing.TypedDict, total=False): + """Payload for updating an assistant. + + ???+ example "Examples" + + ```python + update_params = { + "assistant_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "graph_id": "graph123", + "config": {"tags": ["tag1", "tag2"]}, + "context": {"key": "value"}, + "metadata": {"owner": "user123"}, + "name": "Assistant 1", + "version": 1 + } + ``` + """ + + assistant_id: UUID + """Unique identifier for the assistant.""" + + graph_id: str | None + """typing.Optional graph ID to update.""" + + config: dict[str, typing.Any] + """typing.Optional configuration to update.""" + + context: dict[str, typing.Any] + """The static context of the assistant.""" + + metadata: MetadataInput + """typing.Optional metadata to update.""" + + name: str | None + """typing.Optional name to update.""" + + version: int | None + """typing.Optional version to update.""" + + +class AssistantsDelete(typing.TypedDict): + """Payload for deleting an assistant. + + ???+ example "Examples" + + ```python + delete_params = { + "assistant_id": UUID("123e4567-e89b-12d3-a456-426614174000") + } + ``` + """ + + assistant_id: UUID + """Unique identifier for the assistant.""" + + +class AssistantsSearch(typing.TypedDict): + """Payload for searching assistants. + + ???+ example "Examples" + + ```python + search_params = { + "graph_id": "graph123", + "metadata": {"owner": "user123"}, + "limit": 10, + "offset": 0 + } + ``` + """ + + graph_id: str | None + """typing.Optional graph ID to filter by.""" + + metadata: MetadataInput + """typing.Optional metadata to filter by.""" + + limit: int + """Maximum number of results to return.""" + + offset: int + """Offset for pagination.""" + + +class CronsCreate(typing.TypedDict, total=False): + """Payload for creating a cron job. + + ???+ example "Examples" + + ```python + create_params = { + "payload": {"key": "value"}, + "schedule": "0 0 * * *", + "cron_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "thread_id": UUID("123e4567-e89b-12d3-a456-426614174001"), + "user_id": "user123", + "end_time": datetime(2024, 3, 16, 10, 0, 0) + } + ``` + """ + + payload: dict[str, typing.Any] + """Payload for the cron job.""" + + schedule: str + """Schedule for the cron job.""" + + cron_id: UUID | None + """typing.Optional unique identifier for the cron job.""" + + thread_id: UUID | None + """typing.Optional thread ID to use for this cron job.""" + + user_id: str | None + """typing.Optional user ID to use for this cron job.""" + + end_time: datetime | None + """typing.Optional end time for the cron job.""" + + +class CronsDelete(typing.TypedDict): + """Payload for deleting a cron job. + + ???+ example "Examples" + + ```python + delete_params = { + "cron_id": UUID("123e4567-e89b-12d3-a456-426614174000") + } + ``` + """ + + cron_id: UUID + """Unique identifier for the cron job.""" + + +class CronsRead(typing.TypedDict): + """Payload for reading a cron job. + + ???+ example "Examples" + + ```python + read_params = { + "cron_id": UUID("123e4567-e89b-12d3-a456-426614174000") + } + ``` + """ + + cron_id: UUID + """Unique identifier for the cron job.""" + + +class CronsUpdate(typing.TypedDict, total=False): + """Payload for updating a cron job. + + ???+ example "Examples" + + ```python + update_params = { + "cron_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "payload": {"key": "value"}, + "schedule": "0 0 * * *" + } + ``` + """ + + cron_id: UUID + """Unique identifier for the cron job.""" + + payload: dict[str, typing.Any] | None + """typing.Optional payload to update.""" + + schedule: str | None + """typing.Optional schedule to update.""" + + +class CronsSearch(typing.TypedDict, total=False): + """Payload for searching cron jobs. + + ???+ example "Examples" + + ```python + search_params = { + "assistant_id": UUID("123e4567-e89b-12d3-a456-426614174000"), + "thread_id": UUID("123e4567-e89b-12d3-a456-426614174001"), + "limit": 10, + "offset": 0 + } + ``` + """ + + assistant_id: UUID | None + """typing.Optional assistant ID to filter by.""" + + thread_id: UUID | None + """typing.Optional thread ID to filter by.""" + + limit: int + """Maximum number of results to return.""" + + offset: int + """Offset for pagination.""" + + +class StoreGet(typing.TypedDict): + """Operation to retrieve a specific item by its namespace and key. + + This dict is mutable โ€” auth handlers can modify `namespace` to enforce + access scoping (e.g., prepending the user's identity). + """ + + namespace: tuple[str, ...] + """Hierarchical path that uniquely identifies the item's location. + + Auth handlers can modify this to enforce per-user scoping. + """ + + key: str + """Unique identifier for the item within its specific namespace.""" + + +class StoreSearch(typing.TypedDict): + """Operation to search for items within a specified namespace hierarchy. + + This dict is mutable โ€” auth handlers can modify `namespace` to enforce + access scoping (e.g., prepending the user's identity). + """ + + namespace: tuple[str, ...] + """Prefix filter for defining the search scope. + + Auth handlers can modify this to enforce per-user scoping. + """ + + filter: dict[str, typing.Any] | None + """Key-value pairs for filtering results based on exact matches or comparison operators.""" + + limit: int + """Maximum number of items to return in the search results.""" + + offset: int + """Number of matching items to skip for pagination.""" + + query: str | None + """Natural language search query for semantic search capabilities.""" + + +class StoreListNamespaces(typing.TypedDict): + """Operation to list and filter namespaces in the store. + + This dict is mutable โ€” auth handlers can modify `namespace` (the prefix) + to enforce access scoping (e.g., prepending the user's identity). + """ + + namespace: tuple[str, ...] | None + """Prefix filter for namespaces. Can be `None` if no prefix was provided. + + Auth handlers can modify this to enforce per-user scoping. When `None`, + handlers should set it to `(user_id,)` to scope listing to the user's namespaces. + """ + + suffix: tuple[str, ...] | None + """Optional conditions for filtering namespaces.""" + + max_depth: int | None + """Maximum depth of namespace hierarchy to return. + + Note: + Namespaces deeper than this level will be truncated. + """ + + limit: int + """Maximum number of namespaces to return.""" + + offset: int + """Number of namespaces to skip for pagination.""" + + +class StorePut(typing.TypedDict): + """Operation to store, update, or delete an item in the store. + + This dict is mutable โ€” auth handlers can modify `namespace` to enforce + access scoping (e.g., prepending the user's identity). + """ + + namespace: tuple[str, ...] + """Hierarchical path that identifies the location of the item. + + Auth handlers can modify this to enforce per-user scoping. + """ + + key: str + """Unique identifier for the item within its namespace.""" + + value: dict[str, typing.Any] | None + """The data to store, or `None` to mark the item for deletion.""" + + index: typing.Literal[False] | list[str] | None + """Optional index configuration for full-text search.""" + + +class StoreDelete(typing.TypedDict): + """Operation to delete an item from the store. + + This dict is mutable โ€” auth handlers can modify `namespace` to enforce + access scoping (e.g., prepending the user's identity). + """ + + namespace: tuple[str, ...] + """Hierarchical path that uniquely identifies the item's location. + + Auth handlers can modify this to enforce per-user scoping. + """ + + key: str + """Unique identifier for the item within its specific namespace.""" + + +class on: + """Namespace for type definitions of different API operations. + + This class organizes type definitions for create, read, update, delete, + and search operations across different resources (threads, assistants, crons). + + ???+ note "Usage" + Start by denying all requests by default, then add handlers to allow access: + + ```python + from langgraph_sdk import Auth + + auth = Auth() + + # Default deny: reject all requests without a specific handler + @auth.on + async def deny_all(ctx: Auth.types.AuthContext, value: Auth.on.value): + return False + + # Allow thread creation, stamping the owner + @auth.on.threads.create + async def allow_thread_create(ctx: Auth.types.AuthContext, value: Auth.on.threads.create.value): + value.setdefault("metadata", {})["owner"] = ctx.user.identity + + # Allow assistant search, scoped to user's resources + @auth.on.assistants.search + async def allow_assistant_search(ctx: Auth.types.AuthContext, value: Auth.on.assistants.search.value): + return {"owner": ctx.user.identity} + ``` + """ + + value = dict[str, typing.Any] + + class threads: + """Types for thread-related operations.""" + + value = ( + ThreadsCreate | ThreadsRead | ThreadsUpdate | ThreadsDelete | ThreadsSearch + ) + + class create: + """Type for thread creation parameters.""" + + value = ThreadsCreate + + class create_run: + """Type for creating or streaming a run.""" + + value = RunsCreate + + class read: + """Type for thread read parameters.""" + + value = ThreadsRead + + class update: + """Type for thread update parameters.""" + + value = ThreadsUpdate + + class delete: + """Type for thread deletion parameters.""" + + value = ThreadsDelete + + class search: + """Type for thread search parameters.""" + + value = ThreadsSearch + + class assistants: + """Types for assistant-related operations.""" + + value = ( + AssistantsCreate + | AssistantsRead + | AssistantsUpdate + | AssistantsDelete + | AssistantsSearch + ) + + class create: + """Type for assistant creation parameters.""" + + value = AssistantsCreate + + class read: + """Type for assistant read parameters.""" + + value = AssistantsRead + + class update: + """Type for assistant update parameters.""" + + value = AssistantsUpdate + + class delete: + """Type for assistant deletion parameters.""" + + value = AssistantsDelete + + class search: + """Type for assistant search parameters.""" + + value = AssistantsSearch + + class crons: + """Types for cron-related operations.""" + + value = CronsCreate | CronsRead | CronsUpdate | CronsDelete | CronsSearch + + class create: + """Type for cron creation parameters.""" + + value = CronsCreate + + class read: + """Type for cron read parameters.""" + + value = CronsRead + + class update: + """Type for cron update parameters.""" + + value = CronsUpdate + + class delete: + """Type for cron deletion parameters.""" + + value = CronsDelete + + class search: + """Type for cron search parameters.""" + + value = CronsSearch + + class store: + """Types for store-related operations.""" + + value = StoreGet | StoreSearch | StoreListNamespaces | StorePut | StoreDelete + + class put: + """Type for store put parameters.""" + + value = StorePut + + class get: + """Type for store get parameters.""" + + value = StoreGet + + class search: + """Type for store search parameters.""" + + value = StoreSearch + + class delete: + """Type for store delete parameters.""" + + value = StoreDelete + + class list_namespaces: + """Type for store list namespaces parameters.""" + + value = StoreListNamespaces + + +__all__ = [ + "AssistantsCreate", + "AssistantsDelete", + "AssistantsRead", + "AssistantsSearch", + "AssistantsUpdate", + "MetadataInput", + "RunsCreate", + "StoreDelete", + "StoreGet", + "StoreListNamespaces", + "StorePut", + "StoreSearch", + "ThreadsCreate", + "ThreadsDelete", + "ThreadsRead", + "ThreadsSearch", + "ThreadsUpdate", + "on", +] diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/encryption/__init__.py b/python/user_packages/Python313/site-packages/langgraph_sdk/encryption/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..79611de059d28126b7a2c18d113443f1330347ca --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/encryption/__init__.py @@ -0,0 +1,466 @@ +"""Custom encryption support for LangGraph. + +.. warning:: + This API is in beta and may change in future versions. + +This module provides a framework for implementing custom at-rest encryption +in LangGraph applications. Similar to the Auth system, it allows developers +to define custom encryption and decryption handlers that are executed +server-side. +""" + +from __future__ import annotations + +import functools +import inspect +import typing +import warnings + +from langgraph_sdk.encryption import types + + +class LangGraphBetaWarning(UserWarning): + """Warning for beta features in LangGraph SDK.""" + + +@functools.lru_cache(maxsize=1) +def _warn_encryption_beta() -> None: + warnings.warn( + "The Encryption API is in beta and may change in future versions.", + LangGraphBetaWarning, + stacklevel=4, + ) + + +class DuplicateHandlerError(Exception): + """Raised when attempting to register a duplicate encryption/decryption handler.""" + + pass + + +def _validate_handler(fn: typing.Callable, handler_type: str) -> None: + """Validate that a handler function has the correct signature. + + Args: + fn: The handler function to validate + handler_type: Description of the handler for error messages + + Raises: + TypeError: If the handler is not an async function or has wrong parameter count + """ + if not inspect.iscoroutinefunction(fn): + raise TypeError(f"{handler_type} must be an async function, got {type(fn)}") + + sig = inspect.signature(fn) + params = [ + p + for p in sig.parameters.values() + if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) + ] + if len(params) != 2: + raise TypeError( + f"{handler_type} must accept exactly 2 parameters " + f"(ctx, data), got {len(params)}" + ) + + +class _EncryptDecorators: + """Decorators for encryption handlers. + + Provides @encryption.encrypt.blob and @encryption.encrypt.json decorators for + registering encryption functions. + """ + + def __init__(self, parent: Encryption): + self._parent = parent + + def blob(self, fn: types.BlobEncryptor) -> types.BlobEncryptor: + """Register a blob encryption handler. + + The handler will be called to encrypt opaque data like checkpoint blobs. + + Example: + ```python + @encryption.encrypt.blob + async def encrypt_blob(ctx: EncryptionContext, blob: bytes) -> bytes: + # Encrypt the blob using your encryption service + return encrypted_blob + ``` + + Args: + fn: The encryption handler function + + Returns: + The registered handler function + + Raises: + DuplicateHandlerError: If blob encryptor already registered + TypeError: If handler has invalid signature + """ + if self._parent._blob_encryptor is not None: + raise DuplicateHandlerError("Blob encryptor already registered") + _validate_handler(fn, "Blob encryptor") + self._parent._blob_encryptor = fn + return fn + + def json(self, fn: types.JsonEncryptor) -> types.JsonEncryptor: + """Register the JSON encryption handler. + + Example: + ```python + @encryption.encrypt.json + async def encrypt_json(ctx: EncryptionContext, data: dict) -> dict: + # Encrypt the data + return encrypt_data(data) + ``` + + Args: + fn: The encryption handler function + + Returns: + The registered handler function + + Raises: + DuplicateHandlerError: If JSON encryptor already registered + TypeError: If handler has invalid signature + """ + if self._parent._json_encryptor is not None: + raise DuplicateHandlerError("JSON encryptor already registered") + _validate_handler(fn, "JSON encryptor") + self._parent._json_encryptor = fn + return fn + + +class _DecryptDecorators: + """Decorators for decryption handlers. + + Provides @encryption.decrypt.blob and @encryption.decrypt.json decorators for + registering decryption functions. + """ + + def __init__(self, parent: Encryption): + self._parent = parent + + def blob(self, fn: types.BlobDecryptor) -> types.BlobDecryptor: + """Register a blob decryption handler. + + The handler will be called to decrypt opaque data like checkpoint blobs. + + Example: + ```python + @encryption.decrypt.blob + async def decrypt_blob(ctx: EncryptionContext, blob: bytes) -> bytes: + # Decrypt the blob using your encryption service + return decrypted_blob + ``` + + Args: + fn: The decryption handler function + + Returns: + The registered handler function + + Raises: + DuplicateHandlerError: If blob decryptor already registered + TypeError: If handler has invalid signature + """ + if self._parent._blob_decryptor is not None: + raise DuplicateHandlerError("Blob decryptor already registered") + _validate_handler(fn, "Blob decryptor") + self._parent._blob_decryptor = fn + return fn + + def json(self, fn: types.JsonDecryptor) -> types.JsonDecryptor: + """Register the JSON decryption handler. + + Example: + ```python + @encryption.decrypt.json + async def decrypt_json(ctx: EncryptionContext, data: dict) -> dict: + # Decrypt the data + return decrypt_data(data) + ``` + + Args: + fn: The decryption handler function + + Returns: + The registered handler function + + Raises: + DuplicateHandlerError: If JSON decryptor already registered + TypeError: If handler has invalid signature + """ + if self._parent._json_decryptor is not None: + raise DuplicateHandlerError("JSON decryptor already registered") + _validate_handler(fn, "JSON decryptor") + self._parent._json_decryptor = fn + return fn + + +class Encryption: + """Add custom at-rest encryption to your LangGraph application. + + .. warning:: + This API is in beta and may change in future versions. + + The Encryption class provides a system for implementing custom encryption + of data at rest in LangGraph applications. It supports encryption of + both opaque blobs (like checkpoints) and structured JSON data (like + metadata, context, kwargs, values, etc.). + + To use, create a separate Python file and add the path to the file to your + LangGraph API configuration file (`langgraph.json`). Within that file, create + an instance of the Encryption class and register encryption and decryption + handlers as needed. + + Example `langgraph.json` file: + + ```json + { + "dependencies": ["."], + "graphs": { + "agent": "./my_agent/agent.py:graph" + }, + "env": ".env", + "encryption": { + "path": "./encryption.py:my_encryption" + } + } + ``` + + Then the LangGraph server will load your encryption file and use it to + encrypt/decrypt data at rest. + + !!! warning "JSON Encryptors Must Preserve Keys" + + JSON encryptors **must not add or remove keys** from the input dict. + Only values may be transformed. This constraint is **enforced at runtime + by the server** and exists because SQL JSONB merge operations (used for + partial updates) work at the key level. + + **Correct (per-key encryption):** + ```python + # Input: {"secret": "value", "plain": "x"} + # Output: {"secret": "", "plain": "x"} โœ“ Keys preserved + ``` + + **Incorrect (key consolidation):** + ```python + # Input: {"secret": "value", "plain": "x"} + # Output: {"__encrypted__": "", "plain": "x"} โœ— Key changed + ``` + + If your encryptor needs to store auxiliary data (DEK, IV, etc.), embed it + within the encrypted value itself, not as separate keys. + + ???+ example "Basic Usage" + + ```python + from langgraph_sdk import Encryption, EncryptionContext + + my_encryption = Encryption() + + SKIP_FIELDS = {"tenant_id", "owner", "thread_id", "assistant_id"} + ENCRYPTED_PREFIX = "encrypted:" + + @my_encryption.encrypt.blob + async def encrypt_blob(ctx: EncryptionContext, blob: bytes) -> bytes: + return your_encrypt_bytes(blob) + + @my_encryption.decrypt.blob + async def decrypt_blob(ctx: EncryptionContext, blob: bytes) -> bytes: + return your_decrypt_bytes(blob) + + @my_encryption.encrypt.json + async def encrypt_json(ctx: EncryptionContext, data: dict) -> dict: + result = {} + for k, v in data.items(): + if k in SKIP_FIELDS or v is None: + result[k] = v + else: + result[k] = ENCRYPTED_PREFIX + your_encrypt_string(v) + return result + + @my_encryption.decrypt.json + async def decrypt_json(ctx: EncryptionContext, data: dict) -> dict: + result = {} + for k, v in data.items(): + if isinstance(v, str) and v.startswith(ENCRYPTED_PREFIX): + result[k] = your_decrypt_string(v[len(ENCRYPTED_PREFIX):]) + else: + result[k] = v + return result + ``` + + ???+ example "Field-Specific Logic" + + The `ctx.model` and `ctx.field` attributes tell you which model type and + specific field is being encrypted, allowing different logic: + + ```python + @my_encryption.encrypt.json + async def encrypt_json(ctx: EncryptionContext, data: dict) -> dict: + if ctx.field == "metadata": + # Metadata - standard encryption + return encrypt_standard(data) + elif ctx.field == "values": + # Thread values - more sensitive, use stronger encryption + return encrypt_sensitive(data) + else: + return encrypt_standard(data) + ``` + + !!! warning "Model/Field May Differ Between Encrypt and Decrypt" + + Data encrypted with one `(model, field)` pair is **not guaranteed** + to be decrypted with the same pair. The server performs SQL JSONB + merges that can move encrypted values between models (e.g., cron + metadata โ†’ run metadata). Your decryption logic must handle data + regardless of the `ctx.model` or `ctx.field` values at decrypt time. + + **Safe:** Use `ctx.model`/`ctx.field` for logging or metrics only. + + **Safe:** Encrypt different keys based on `ctx.field`, but use a + single decrypt handler that decrypts any value with the encrypted + prefix (and passes through plaintext unchanged): + + ```python + ENCRYPTED_PREFIX = "enc:" + + @my_encryption.encrypt.json + async def encrypt_json(ctx: EncryptionContext, data: dict) -> dict: + # Encrypt different keys depending on the field + if ctx.field == "context": + keys_to_encrypt = {"api_key", "secret_token"} + else: + keys_to_encrypt = {"email", "ssn"} + return { + k: ENCRYPTED_PREFIX + encrypt(v) if k in keys_to_encrypt else v + for k, v in data.items() + } + + @my_encryption.decrypt.json + async def decrypt_json(ctx: EncryptionContext, data: dict) -> dict: + # Decrypt ANY value with the prefix, regardless of model/field + return { + k: decrypt(v[len(ENCRYPTED_PREFIX):]) + if isinstance(v, str) and v.startswith(ENCRYPTED_PREFIX) + else v + for k, v in data.items() + } + ``` + + **Unsafe:** Using different encryption keys or algorithms based on + `ctx.model`/`ctx.field` will cause decryption failures. + """ + + __slots__ = ( + "_blob_decryptor", + "_blob_encryptor", + "_context_handler", + "_json_decryptor", + "_json_encryptor", + "decrypt", + "encrypt", + ) + + types = types + """Reference to encryption type definitions. + + Provides access to all type definitions used in the encryption system, + including EncryptionContext, BlobEncryptor, BlobDecryptor, + JsonEncryptor, and JsonDecryptor. + """ + + def __init__(self) -> None: + """Initialize the Encryption instance.""" + _warn_encryption_beta() + self.encrypt = _EncryptDecorators(self) + self.decrypt = _DecryptDecorators(self) + self._blob_encryptor: types.BlobEncryptor | None = None + self._blob_decryptor: types.BlobDecryptor | None = None + self._json_encryptor: types.JsonEncryptor | None = None + self._json_decryptor: types.JsonDecryptor | None = None + self._context_handler: types.ContextHandler | None = None + + def context(self, fn: types.ContextHandler) -> types.ContextHandler: + """Register a context handler to derive encryption context from auth. + + The handler receives the authenticated user and current EncryptionContext, + and returns a dict that becomes ctx.metadata for encrypt/decrypt handlers. + + This allows encryption context to be derived from JWT claims or other + auth-derived data instead of requiring a separate X-Encryption-Context header. + + Note: The context handler is called once per request in middleware, + so ctx.model and ctx.field will be None in the handler. + + Example: + ```python + from langgraph_sdk import Encryption, EncryptionContext + from starlette.authentication import BaseUser + + encryption = Encryption() + + @encryption.context + async def get_context(user: BaseUser, ctx: EncryptionContext) -> dict: + # Derive encryption context from authenticated user + return { + **ctx.metadata, # preserve X-Encryption-Context header if present + "tenant_id": user.tenant_id, + } + ``` + + Args: + fn: The context handler function + + Returns: + The registered handler function + """ + self._context_handler = fn + return fn + + def get_json_encryptor( + self, + _model: str | None = None, # kept for langgraph-api compat + ) -> types.JsonEncryptor | None: + """Get the JSON encryptor. + + Args: + _model: Ignored. Kept for backwards compatibility with langgraph-api + which passes model_type to this method. + + Returns: + The JSON encryptor, or None if not registered. + """ + return self._json_encryptor + + def get_json_decryptor( + self, + _model: str | None = None, # kept for langgraph-api compat + ) -> types.JsonDecryptor | None: + """Get the JSON decryptor. + + Args: + _model: Ignored. Kept for backwards compatibility with langgraph-api + which passes model_type to this method. + + Returns: + The JSON decryptor, or None if not registered. + """ + return self._json_decryptor + + def __repr__(self) -> str: + handlers = [] + if self._blob_encryptor: + handlers.append("blob_encryptor") + if self._blob_decryptor: + handlers.append("blob_decryptor") + if self._json_encryptor: + handlers.append("json_encryptor") + if self._json_decryptor: + handlers.append("json_decryptor") + if self._context_handler: + handlers.append("context_handler") + return f"Encryption(handlers=[{', '.join(handlers)}])" diff --git a/python/user_packages/Python313/site-packages/langgraph_sdk/encryption/types.py b/python/user_packages/Python313/site-packages/langgraph_sdk/encryption/types.py new file mode 100644 index 0000000000000000000000000000000000000000..92e65a8c60f6908d58fe8efceb7b0f1d784a2cc9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langgraph_sdk/encryption/types.py @@ -0,0 +1,147 @@ +"""Encryption and decryption types for LangGraph. + +This module defines the core types used for custom at-rest encryption +in LangGraph. It includes context types and typed dictionaries for +encryption operations. +""" + +from __future__ import annotations + +import typing +from collections.abc import Awaitable, Callable + +Json = dict[str, typing.Any] +"""JSON-serializable dictionary type for structured data encryption.""" + + +class EncryptionContext: + """Context passed to encryption/decryption handlers. + + Contains arbitrary non-secret key-values that will be stored on encrypt. + These key-values are intended to be sent to an external service that + manages keys and handles the actual encryption and decryption of data. + + Attributes: + model: The model type being encrypted (e.g., "assistant", "thread", "run", "checkpoint") + field: The specific field being encrypted (e.g., "metadata", "context", "kwargs", "values") + metadata: Additional context metadata that can be used for encryption decisions + """ + + __slots__ = ("field", "metadata", "model") + + def __init__( + self, + model: str | None = None, + metadata: dict[str, typing.Any] | None = None, + field: str | None = None, + ): + self.model = model + self.field = field + self.metadata = metadata or {} + + def __repr__(self) -> str: + return f"EncryptionContext(model={self.model!r}, field={self.field!r}, metadata={self.metadata!r})" + + +BlobEncryptor = Callable[[EncryptionContext, bytes], Awaitable[bytes]] +"""Handler for encrypting opaque blob data like checkpoints. + +Note: Must be an async function. Encryption typically involves I/O operations +(calling external KMS services), which should be async. + +Args: + ctx: Encryption context with model type and metadata + blob: The raw bytes to encrypt + +Returns: + Awaitable that resolves to encrypted bytes +""" + +BlobDecryptor = Callable[[EncryptionContext, bytes], Awaitable[bytes]] +"""Handler for decrypting opaque blob data like checkpoints. + +Note: Must be an async function. Decryption typically involves I/O operations +(calling external KMS services), which should be async. + +Args: + ctx: Encryption context with model type and metadata + blob: The encrypted bytes to decrypt + +Returns: + Awaitable that resolves to decrypted bytes +""" + +JsonEncryptor = Callable[[EncryptionContext, Json], Awaitable[Json]] +"""Handler for encrypting structured JSON data. + +Note: Must be an async function. Encryption typically involves I/O operations +(calling external KMS services), which should be async. + +Used for encrypting structured data like metadata, context, kwargs, values, +and other JSON-serializable fields across different model types. + +Maps plaintext fields to encrypted fields. A practical approach: +- Keep "owner" field unencrypted for search/filtering +- Encrypt VALUES (not keys) for fields with specific prefix (e.g., "my.customer.org/") +- Pass through all other fields unencrypted + +Example: + Input: {"owner": "user123", "my.customer.org/email": "john@example.com", "tenant_id": "t-456"} + Output: {"owner": "user123", "my.customer.org/email": "ENCRYPTED", "tenant_id": "t-456"} + +Note: Encrypted field VALUES cannot be reliably searched, as most real-world +encryption implementations use nonces (non-deterministic encryption). +Only unencrypted fields can be used in search queries. + +Args: + ctx: Encryption context with model type, field name, and metadata + data: The plaintext JSON dictionary + +Returns: + Awaitable that resolves to encrypted JSON dictionary +""" + +JsonDecryptor = Callable[[EncryptionContext, Json], Awaitable[Json]] +"""Handler for decrypting structured JSON data. + +Note: Must be an async function. Decryption typically involves I/O operations +(calling external KMS services), which should be async. + +Inverse of JsonEncryptor. Must be able to decrypt data that +was encrypted by the corresponding encryptor. + +Args: + ctx: Encryption context with model type, field name, and metadata + data: The encrypted JSON dictionary + +Returns: + Awaitable that resolves to decrypted JSON dictionary +""" + +if typing.TYPE_CHECKING: + from starlette.authentication import BaseUser + +ContextHandler = Callable[ + ["BaseUser", EncryptionContext], Awaitable[dict[str, typing.Any]] +] +"""Handler for deriving encryption context from authenticated user info. + +Note: Must be an async function as it may involve I/O operations. + +The context handler is called once per request in middleware (after auth), +allowing encryption context to be derived from JWT claims, user properties, +or other auth-derived data instead of requiring a separate X-Encryption-Context header. + +The return value becomes ctx.metadata for subsequent encrypt/decrypt operations +and is persisted with encrypted data for later decryption. + +Note: ctx.model and ctx.field will be None in context handlers since +the handler runs once per request before any specific model/field is known. + +Args: + user: The authenticated user (from Starlette's AuthenticationMiddleware) + ctx: Current encryption context with metadata from X-Encryption-Context header + +Returns: + Awaitable that resolves to dict that becomes the new ctx.metadata +""" diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66c67b026c7149e7dffc96a09226138c5af75689 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/_expect.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/_expect.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12d2ded5c3dd3fbc33b8bfbfac94df7c326f8bb2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/_expect.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/_runtime_overrides.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/_runtime_overrides.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40d159bb70133c9fa7eb449d0908bb8ad801e8f0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/_runtime_overrides.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/anonymizer.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/anonymizer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..926cd8b103402859609e0545df6de7f89dfad431 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/anonymizer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/middleware.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/middleware.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a3d7aa8cc1286923fc9deeb51e17a1524c451d9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/middleware.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/prompt_cache.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/prompt_cache.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88691c825eb3cb4df09d8dd8846a1cf6245711b5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/prompt_cache.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/pytest_plugin.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/pytest_plugin.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f4724576df6cf4a807bbb694073bb61e36ab063a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/pytest_plugin.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/run_helpers.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/run_helpers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6bdc4ff96bc829c9c7efd9711ac32fa0a5d85f58 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/run_helpers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/run_trees.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/run_trees.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3fd52e133189d9d32afaee1ddc7a0e85df2241a9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/run_trees.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/schemas.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/schemas.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..597dd83eb65693d35e7ee46cba2fa7075c55bcb8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/schemas.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e63086892f6ae41256d6d2ad0c0393d6a5936f4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/__pycache__/uuid.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/__pycache__/uuid.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..628a83e351394da5f975e138be492adabf7b8f71 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/__pycache__/uuid.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__init__.py b/python/user_packages/Python313/site-packages/langsmith/_internal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7a191d9690fe2eaafc77e9ebea9e98ee65f1082 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_aiter.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_aiter.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52c296bd301dcc3a1a747aed7a30b06b2eaf919c Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_aiter.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_background_thread.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_background_thread.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9b2c569b7f76d38e9b27a0d870e199267ee664a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_background_thread.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_beta_decorator.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_beta_decorator.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e93d74c246d10a9ce9a78ff701331a22f25d180 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_beta_decorator.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_compressed_traces.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_compressed_traces.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd8a0319295fcbe4876d21aa7726611cc601466a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_compressed_traces.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_constants.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_constants.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e8d231f1fe5214b7b7ffd04265d21a95aedb791 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_constants.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_context.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_context.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a082b8cc4b695a67de48a303d81dd6ede8c3706 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_context.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_edit_distance.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_edit_distance.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9ad1fa09a92424ca6187e524d407638d0f03b11 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_edit_distance.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_embedding_distance.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_embedding_distance.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2a35cc3668255df5eb7d4d7eee725052c333bf4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_embedding_distance.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_hub.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_hub.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a6bb208f43ead48c4971555533b071fa1e75543 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_hub.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_multipart.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_multipart.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..802b00598485a8b5b9b31b1833044d7efaa79ade Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_multipart.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_operations.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_operations.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43507eb446ce7a9664262738bf8b7efaca49f405 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_operations.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_orjson.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_orjson.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fcbf9eaf366ea6c0d11ee96db18726739c6b3dbf Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_orjson.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_otel_utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_otel_utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..481b1189c69b424f3d49c23ac675354deeb439af Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_otel_utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_patch.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_patch.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..410e679b5f52c2414bca9cc52edba1b71574919a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_patch.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_profiles.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_profiles.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33c0ea7fee075a51e2d9516e85f63399a4e82ceb Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_profiles.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_serde.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_serde.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af3cdb36877b8b0d7d5c0d2ca9ebbe23b76dbe3d Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_serde.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_uuid.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_uuid.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a8b2bc2b548fc3bb35b09e7516fc8dff25dc49f Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/__pycache__/_uuid.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_aiter.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_aiter.py new file mode 100644 index 0000000000000000000000000000000000000000..9a984c7201f4a3e81ae3f623eb903e66ffccf999 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_aiter.py @@ -0,0 +1,382 @@ +"""Adapted. + +Original source: +https://github.com/maxfischer2781/asyncstdlib/blob/master/asyncstdlib/itertools.py +MIT License +""" + +from __future__ import annotations + +import asyncio +import contextvars +import functools +import inspect +from collections import deque +from collections.abc import ( + AsyncGenerator, + AsyncIterable, + AsyncIterator, + Awaitable, + Coroutine, + Iterable, + Iterator, +) +from contextlib import AbstractAsyncContextManager +from typing import ( + Any, + Callable, + Generic, + Optional, + TypeVar, + Union, + cast, + overload, +) + +from langsmith._runtime_overrides import get_runtime_overrides + +T = TypeVar("T") + +_no_default = object() + + +# https://github.com/python/cpython/blob/main/Lib/test/test_asyncgen.py#L54 +# before 3.10, the builtin anext() was not available +def py_anext( + iterator: AsyncIterator[T], default: Union[T, Any] = _no_default +) -> Awaitable[Union[T, None, Any]]: + """Pure-Python implementation of anext() for testing purposes. + + Closely matches the builtin anext() C implementation. + Can be used to compare the built-in implementation of the inner + coroutines machinery to C-implementation of __anext__() and send() + or throw() on the returned generator. + """ + try: + __anext__ = cast( + Callable[[AsyncIterator[T]], Awaitable[T]], type(iterator).__anext__ + ) + except AttributeError: + raise TypeError(f"{iterator!r} is not an async iterator") + + if default is _no_default: + return __anext__(iterator) + + async def anext_impl() -> Union[T, Any]: + try: + # The C code is way more low-level than this, as it implements + # all methods of the iterator protocol. In this implementation + # we're relying on higher-level coroutine concepts, but that's + # exactly what we want -- crosstest pure-Python high-level + # implementation and low-level C anext() iterators. + return await __anext__(iterator) + except StopAsyncIteration: + return default + + return anext_impl() + + +class NoLock: + """Dummy lock that provides the proper interface but no protection.""" + + async def __aenter__(self) -> None: + pass + + async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: + return False + + +async def tee_peer( + iterator: AsyncIterator[T], + # the buffer specific to this peer + buffer: deque[T], + # the buffers of all peers, including our own + peers: list[deque[T]], + lock: AbstractAsyncContextManager[Any], +) -> AsyncGenerator[T, None]: + """Iterate over :py:func:`~.tee`.""" + try: + while True: + if not buffer: + async with lock: + # Another peer produced an item while we were waiting for the lock. + # Proceed with the next loop iteration to yield the item. + if buffer: + continue + try: + item = await iterator.__anext__() + except StopAsyncIteration: + break + else: + # Append to all buffers, including our own. We'll fetch our + # item from the buffer again, instead of yielding it directly. + # This ensures the proper item ordering if any of our peers + # are fetching items concurrently. They may have buffered their + # item already. + for peer_buffer in peers: + peer_buffer.append(item) + yield buffer.popleft() + finally: + async with lock: + # this peer is done โ€“ remove its buffer + for idx, peer_buffer in enumerate(peers): # pragma: no branch + if peer_buffer is buffer: + peers.pop(idx) + break + # if we are the last peer, try and close the iterator + if not peers and hasattr(iterator, "aclose"): + await iterator.aclose() + + +class Tee(Generic[T]): + """Create ``n`` separate asynchronous iterators over ``iterable``. + + This splits a single ``iterable`` into multiple iterators, each providing + the same items in the same order. + All child iterators may advance separately but pare the same items + from ``iterable`` -- when the most advanced iterator retrieves an item, + it is buffered until the least advanced iterator has yielded it as well. + A ``tee`` works lazily and can handle an infinite ``iterable``, provided + that all iterators advance. + + ```python + async def derivative(sensor_data): + previous, current = a.tee(sensor_data, n=2) + await a.anext(previous) # advance one iterator + return a.map(operator.sub, previous, current) + ``` + + Unlike :py:func:`itertools.tee`, :py:func:`~.tee` returns a custom type instead + of a :py:class:`tuple`. Like a tuple, it can be indexed, iterated and unpacked + to get the child iterators. In addition, its :py:meth:`~.tee.aclose` method + immediately closes all children, and it can be used in an ``async with`` context + for the same effect. + + If ``iterable`` is an iterator and read elsewhere, ``tee`` will *not* + provide these items. Also, ``tee`` must internally buffer each item until the + last iterator has yielded it; if the most and least advanced iterator differ + by most data, using a :py:class:`list` is more efficient (but not lazy). + + If the underlying iterable is concurrency safe (``anext`` may be awaited + concurrently) the resulting iterators are concurrency safe as well. Otherwise, + the iterators are safe if there is only ever one single "most advanced" iterator. + To enforce sequential use of ``anext``, provide a ``lock`` + - e.g. an :py:class:`asyncio.Lock` instance in an :py:mod:`asyncio` application - + and access is automatically synchronised. + """ + + def __init__( + self, + iterable: AsyncIterator[T], + n: int = 2, + *, + lock: Optional[AbstractAsyncContextManager[Any]] = None, + ): + self._iterator = iterable.__aiter__() # before 3.10 aiter() doesn't exist + self._buffers: list[deque[T]] = [deque() for _ in range(n)] + self._children = tuple( + tee_peer( + iterator=self._iterator, + buffer=buffer, + peers=self._buffers, + lock=lock if lock is not None else NoLock(), + ) + for buffer in self._buffers + ) + + def __len__(self) -> int: + return len(self._children) + + @overload + def __getitem__(self, item: int) -> AsyncIterator[T]: ... + + @overload + def __getitem__(self, item: slice) -> tuple[AsyncIterator[T], ...]: ... + + def __getitem__( + self, item: Union[int, slice] + ) -> Union[AsyncIterator[T], tuple[AsyncIterator[T], ...]]: + return self._children[item] + + def __iter__(self) -> Iterator[AsyncIterator[T]]: + yield from self._children + + async def __aenter__(self) -> Tee[T]: + return self + + async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: + await self.aclose() + return False + + async def aclose(self) -> None: + for child in self._children: + await child.aclose() + + +atee = Tee + + +async def async_zip(*async_iterables): + """Async version of zip.""" + # Before Python 3.10, aiter() was not available + iterators = [iterable.__aiter__() for iterable in async_iterables] + while True: + try: + items = await asyncio.gather( + *(py_anext(iterator) for iterator in iterators) + ) + yield tuple(items) + except StopAsyncIteration: + break + + +def ensure_async_iterator( + iterable: Union[Iterable, AsyncIterable], +) -> AsyncIterator: + if hasattr(iterable, "__anext__"): + return cast(AsyncIterator, iterable) + elif hasattr(iterable, "__aiter__"): + return cast(AsyncIterator, iterable.__aiter__()) + else: + + class AsyncIteratorWrapper: + def __init__(self, iterable: Iterable): + self._iterator = iter(iterable) + + async def __anext__(self): + try: + return next(self._iterator) + except StopIteration: + raise StopAsyncIteration + + def __aiter__(self): + return self + + return AsyncIteratorWrapper(iterable) + + +def aiter_with_concurrency( + n: Optional[int], + generator: AsyncIterator[Coroutine[None, None, T]], + *, + _eager_consumption_timeout: float = 0, +) -> AsyncGenerator[T, None]: + """Process async generator with max parallelism. + + Args: + n: The number of tasks to run concurrently. + generator: The async generator to process. + _eager_consumption_timeout: If set, check for completed tasks after + each iteration and yield their results. This can be used to + consume the generator eagerly while still respecting the concurrency + limit. + + Yields: + The processed items yielded by the async generator. + """ + if n == 0: + + async def consume(): + async for item in generator: + yield await item + + return consume() + semaphore = cast( + asyncio.Semaphore, asyncio.Semaphore(n) if n is not None else NoLock() + ) + + async def process_item(ix: int, item): + async with semaphore: + res = await item + return (ix, res) + + async def process_generator(): + tasks = {} + accepts_context = asyncio_accepts_context() + ix = 0 + async for item in generator: + if accepts_context: + context = contextvars.copy_context() + task = asyncio.create_task(process_item(ix, item), context=context) + else: + task = asyncio.create_task(process_item(ix, item)) + tasks[ix] = task + ix += 1 + if _eager_consumption_timeout > 0: + try: + for _fut in asyncio.as_completed( + tasks.values(), + timeout=_eager_consumption_timeout, + ): + task_idx, res = await _fut + yield res + del tasks[task_idx] + except asyncio.TimeoutError: + pass + if n is not None and len(tasks) >= n: + done, _ = await asyncio.wait( + tasks.values(), return_when=asyncio.FIRST_COMPLETED + ) + for task in done: + task_idx, res = task.result() + yield res + del tasks[task_idx] + + for task in asyncio.as_completed(tasks.values()): + _, res = await task + yield res + + return process_generator() + + +def accepts_context(callable: Callable[..., Any]) -> bool: + """Check if a callable accepts a context argument.""" + try: + return inspect.signature(callable).parameters.get("context") is not None + except ValueError: + return False + + +# Ported from Python 3.9+ to support Python 3.8 +async def aio_to_thread( + ctx: contextvars.Context, + func, + /, + *args, + **kwargs, +): + """Run ``func`` in a separate thread, inside ``ctx``. + + ``ctx`` is the :class:`~contextvars.Context` in which ``func`` is invoked. + Callers that want default isolation should pass + ``contextvars.copy_context()``; callers with a specific Context + (e.g. :func:`trace`) pass it directly so subsequent reads from that + Context see the mutations. + + Return a coroutine that can be awaited to get the eventual result of ``func``. + """ + overrides = get_runtime_overrides() + if overrides.aio_to_thread is not None: + return await overrides.aio_to_thread( + _default_aio_to_thread, ctx, func, *args, **kwargs + ) + return await _default_aio_to_thread(ctx, func, *args, **kwargs) + + +async def _default_aio_to_thread( + ctx: contextvars.Context, + func, + /, + *args, + **kwargs, +): + """Default implementation of aio_to_thread using run_in_executor.""" + loop = asyncio.get_running_loop() + func_call = functools.partial(ctx.run, func, *args, **kwargs) + return await loop.run_in_executor(None, func_call) + + +@functools.lru_cache(maxsize=1) +def asyncio_accepts_context(): + """Check if the current asyncio event loop accepts a context argument.""" + return accepts_context(asyncio.create_task) diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_background_thread.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_background_thread.py new file mode 100644 index 0000000000000000000000000000000000000000..eb17c813eb5ee5c651a6b50208c1eb60eff37a30 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_background_thread.py @@ -0,0 +1,968 @@ +from __future__ import annotations + +import concurrent.futures as cf +import copy +import functools +import io +import logging +import sys +import threading +import time +import weakref +from multiprocessing import cpu_count +from queue import Empty, Queue +from typing import TYPE_CHECKING, Any, Optional, Union, cast + +from langsmith import schemas as ls_schemas +from langsmith import utils as ls_utils +from langsmith._internal._compressed_traces import ZSTD_AVAILABLE, CompressedTraces +from langsmith._internal._constants import ( + _AUTO_SCALE_DOWN_NEMPTY_TRIGGER, + _AUTO_SCALE_UP_NTHREADS_LIMIT, + _AUTO_SCALE_UP_QSIZE_TRIGGER, + _BOUNDARY, +) +from langsmith._internal._operations import ( + SerializedFeedbackOperation, + SerializedRunOperation, + combine_serialized_queue_operations, +) + +if TYPE_CHECKING: + from opentelemetry.context.context import Context # type: ignore[import] + + from langsmith.client import Client + +logger = logging.getLogger("langsmith.client") + +LANGSMITH_CLIENT_THREAD_POOL = cf.ThreadPoolExecutor(max_workers=cpu_count()) + + +def _group_batch_by_api_endpoint( + batch: list[TracingQueueItem], +) -> dict[ + tuple[ + Optional[str], + Optional[str], + Optional[str], + Optional[str], + Optional[str], + Optional[str], + ], + list[TracingQueueItem], +]: + """Group batch items by endpoint and auth combination.""" + from collections import defaultdict + + grouped = defaultdict(list) + for item in batch: + key = ( + item.api_url, + item.api_key, + item.service_key, + item.tenant_id, + item.authorization, + item.cookie, + ) + grouped[key].append(item) + return grouped + + +@functools.total_ordering +class TracingQueueItem: + """An item in the tracing queue. + + Attributes: + priority (str): The priority of the item. + item (Any): The item itself. + otel_context (Optional[Context]): The OTEL context of the item. + """ + + priority: str + item: Union[SerializedRunOperation, SerializedFeedbackOperation] + api_url: Optional[str] + api_key: Optional[str] + service_key: Optional[str] + tenant_id: Optional[str] + authorization: Optional[str] + cookie: Optional[str] + otel_context: Optional[Context] + + __slots__ = ( + "priority", + "item", + "api_key", + "api_url", + "service_key", + "tenant_id", + "authorization", + "cookie", + "otel_context", + ) + + def __init__( + self, + priority: str, + item: Union[SerializedRunOperation, SerializedFeedbackOperation], + api_key: Optional[str] = None, + api_url: Optional[str] = None, + service_key: Optional[str] = None, + tenant_id: Optional[str] = None, + authorization: Optional[str] = None, + cookie: Optional[str] = None, + otel_context: Optional[Context] = None, + ) -> None: + self.priority = priority + self.item = item + self.api_key = api_key + self.api_url = api_url + self.service_key = service_key + self.tenant_id = tenant_id + self.authorization = authorization + self.cookie = cookie + self.otel_context = otel_context + + def __lt__(self, other: TracingQueueItem) -> bool: + return (self.priority, self.item.__class__) < ( + other.priority, + other.item.__class__, + ) + + def __eq__(self, other: object) -> bool: + return isinstance(other, TracingQueueItem) and ( + self.priority, + self.item.__class__, + ) == (other.priority, other.item.__class__) + + +def _tracing_thread_drain_queue( + tracing_queue: Queue, limit: int = 100, block: bool = True, max_size_bytes: int = 0 +) -> list[TracingQueueItem]: + next_batch: list[TracingQueueItem] = [] + current_size = 0 + + try: + # wait 250ms for the first item, then + # - drain the queue with a 50ms block timeout + # - stop draining if we hit either count or size limit + # shorter drain timeout is used instead of non-blocking calls to + # avoid creating too many small batches + if item := tracing_queue.get(block=block, timeout=0.25): + next_batch.append(item) + if max_size_bytes > 0: + current_size += item.item.calculate_serialized_size() + # If first item already exceeds limit, return just this item + if current_size > max_size_bytes: + return next_batch + + # Continue draining until we hit count limit OR size limit + while True: + try: + item = tracing_queue.get(block=block, timeout=0.05) + except Empty: + break + + # Add the item first + next_batch.append(item) + + # Then check size limit AFTER adding the item + if max_size_bytes > 0: + current_size += item.item.calculate_serialized_size() + # If we've exceeded size limit, stop here + # (item is included in this batch) + if current_size > max_size_bytes: + break + + # Check count limit AFTER adding the item + if limit and len(next_batch) >= limit: + break + except Empty: + pass + return next_batch + + +def _tracing_thread_drain_compressed_buffer( + client: Client, size_limit: int = 100, size_limit_bytes: int | None = 20_971_520 +) -> tuple[Optional[io.BytesIO], Optional[tuple[int, int]]]: + try: + if client.compressed_traces is None: + return None, None + with client.compressed_traces.lock: + pre_compressed_size = client.compressed_traces.uncompressed_size + + size_limit_bytes = client._max_batch_size_bytes or size_limit_bytes + + if size_limit is not None and size_limit <= 0: + raise ValueError(f"size_limit must be positive; got {size_limit}") + if size_limit_bytes is not None and size_limit_bytes < 0: + raise ValueError( + f"size_limit_bytes must be nonnegative; got {size_limit_bytes}" + ) + + if ( + size_limit_bytes is None or pre_compressed_size < size_limit_bytes + ) and ( + size_limit is None or client.compressed_traces.trace_count < size_limit + ): + return None, None + + # Write final boundary and close compression stream + client.compressed_traces.compressor_writer.write( + f"--{_BOUNDARY}--\r\n".encode() + ) + client.compressed_traces.compressor_writer.close() + current_size = client.compressed_traces.buffer.tell() + + filled_buffer = client.compressed_traces.buffer + setattr( + cast(Any, filled_buffer), + "context", + client.compressed_traces._context, + ) + + compressed_traces_info = (pre_compressed_size, current_size) + + client.compressed_traces.reset() + + filled_buffer.seek(0) + return (filled_buffer, compressed_traces_info) + except Exception: + logger.error( + "LangSmith tracing error: Failed to submit trace data.\n" + "This does not affect your application's runtime.\n" + "Error details:", + exc_info=True, + ) + # exceptions are logged elsewhere, but we need to make sure the + # background thread continues to run + return None, None + + +def _process_buffered_run_ops_batch( + client: Client, + batch_to_process: list[tuple[str, dict, dict[str, Optional[str]]]], +) -> None: + """Process a batch of run operations asynchronously.""" + try: + # Extract just the run dictionaries for process_buffered_run_ops + run_dicts = [run_data for _, run_data, _ in batch_to_process] + original_ids = [run.get("id") for run in run_dicts] + + # Apply process_buffered_run_ops transformation + if client._process_buffered_run_ops is None: + raise RuntimeError( + "process_buffered_run_ops should not be None when processing batch" + ) + processed_runs = list(client._process_buffered_run_ops(run_dicts)) + + # Validate that the transformation preserves run count and IDs + if len(processed_runs) != len(run_dicts): + raise ValueError( + f"process_buffered_run_ops must return the same number of runs. " + f"Expected {len(run_dicts)}, got {len(processed_runs)}" + ) + + processed_ids = [run.get("id") for run in processed_runs] + if processed_ids != original_ids: + raise ValueError( + f"process_buffered_run_ops must preserve run IDs in the same order. " + f"Expected {original_ids}, got {processed_ids}" + ) + + # Process each run and add to compressed traces + for (operation, _, write_ctx), processed_run in zip( + batch_to_process, processed_runs + ): + if operation == "post": + client._create_run(processed_run, **write_ctx) + elif operation == "patch": + client._update_run(processed_run, **write_ctx) + + # Trigger data available event + if client._data_available_event: + client._data_available_event.set() + except Exception: + # Log errors but don't crash the background thread + logger.error( + "LangSmith buffered run ops processing error: Failed to process batch.\n" + "This does not affect your application's runtime.\n" + "Error details:", + exc_info=True, + ) + + +def _tracing_thread_handle_batch( + client: Client, + tracing_queue: Queue, + batch: list[TracingQueueItem], + use_multipart: bool, + mark_task_done: bool = True, + ops: Optional[ + list[Union[SerializedRunOperation, SerializedFeedbackOperation]] + ] = None, +) -> None: + """Handle a batch of tracing queue items by sending them to LangSmith. + + Args: + client: The LangSmith client to use for sending data. + tracing_queue: The queue containing tracing items (used for task_done calls). + batch: List of tracing queue items to process. + use_multipart: Whether to use multipart endpoint for sending data. + mark_task_done: Whether to mark queue tasks as done after processing. + Set to False when called from parallel execution to avoid double counting. + ops: Pre-combined serialized operations to use instead of combining from batch. + If None, operations will be combined from the batch items. + """ + try: + # Group batch items by (api_url, auth) combination + grouped_batches = _group_batch_by_api_endpoint(batch) + + for ( + api_url, + api_key, + service_key, + tenant_id, + authorization, + cookie, + ), group_batch in grouped_batches.items(): + if not ops: + group_ops = combine_serialized_queue_operations( + [item.item for item in group_batch] + ) + else: + group_ids = {item.item.id for item in group_batch} + group_ops = [op for op in ops if op.id in group_ids] + + if use_multipart: + client._multipart_ingest_ops( + group_ops, + api_url=api_url, + api_key=api_key, + service_key=service_key, + tenant_id=tenant_id, + authorization=authorization, + cookie=cookie, + ) + else: + if any(isinstance(op, SerializedFeedbackOperation) for op in group_ops): + logger.warning( + "Feedback operations are not supported in non-multipart mode" + ) + group_ops = [ + op + for op in group_ops + if not isinstance(op, SerializedFeedbackOperation) + ] + client._batch_ingest_run_ops( + cast(list[SerializedRunOperation], group_ops), + api_url=api_url, + api_key=api_key, + service_key=service_key, + tenant_id=tenant_id, + authorization=authorization, + cookie=cookie, + ) + + except Exception as e: + logger.error( + "LangSmith tracing error: Failed to submit trace data.\n" + "This does not affect your application's runtime.\n" + "Error details:", + exc_info=True, + ) + client._invoke_tracing_error_callback(e) + finally: + if mark_task_done and tracing_queue is not None: + for _ in batch: + try: + tracing_queue.task_done() + except ValueError as e: + if "task_done() called too many times" in str(e): + # This can happen during shutdown when multiple threads + # process the same queue items. It's harmless. + logger.debug( + f"Ignoring harmless task_done error during shutdown: {e}" + ) + else: + raise + + +def _otel_tracing_thread_handle_batch( + client: Client, + tracing_queue: Queue, + batch: list[TracingQueueItem], + mark_task_done: bool = True, + ops: Optional[ + list[Union[SerializedRunOperation, SerializedFeedbackOperation]] + ] = None, +) -> None: + """Handle a batch of tracing queue items by exporting them to OTEL. + + Args: + client: The LangSmith client containing the OTEL exporter. + tracing_queue: The queue containing tracing items (used for task_done calls). + batch: List of tracing queue items to process. + mark_task_done: Whether to mark queue tasks as done after processing. + Set to False when called from parallel execution to avoid double counting. + ops: Pre-combined serialized operations to use instead of combining from batch. + If None, operations will be combined from the batch items. + """ + try: + if ops is None: + ops = combine_serialized_queue_operations([item.item for item in batch]) + + run_ops = [op for op in ops if isinstance(op, SerializedRunOperation)] + otel_context_map = { + item.item.id: item.otel_context + for item in batch + if isinstance(item.item, SerializedRunOperation) + } + if run_ops: + if client.otel_exporter is not None: + client.otel_exporter.export_batch(run_ops, otel_context_map) + else: + logger.error( + "LangSmith tracing error: Failed to submit OTEL trace data.\n" + "This does not affect your application's runtime.\n" + "Error details: client.otel_exporter is None" + ) + + except Exception as e: + logger.error( + "OTEL tracing error: Failed to submit trace data.\n" + "This does not affect your application's runtime.\n" + "Error details:", + exc_info=True, + ) + client._invoke_tracing_error_callback(e) + finally: + if mark_task_done and tracing_queue is not None: + for _ in batch: + try: + tracing_queue.task_done() + except ValueError as e: + if "task_done() called too many times" in str(e): + # This can happen during shutdown when multiple threads + # process the same queue items. It's harmless. + logger.debug( + f"Ignoring harmless task_done error during shutdown: {e}" + ) + else: + raise + + +def _hybrid_tracing_thread_handle_batch( + client: Client, + tracing_queue: Queue, + batch: list[TracingQueueItem], + use_multipart: bool, + mark_task_done: bool = True, +) -> None: + """Handle a batch of tracing queue items by sending to both both LangSmith and OTEL. + + Args: + client: The LangSmith client to use for sending data. + tracing_queue: The queue containing tracing items (used for task_done calls). + batch: List of tracing queue items to process. + use_multipart: Whether to use multipart endpoint for LangSmith. + mark_task_done: Whether to mark queue tasks as done after processing. + Set to False primarily for testing when items weren't actually queued. + """ + # Combine operations once to avoid race conditions + ops = combine_serialized_queue_operations([item.item for item in batch]) + + # Create copies for each thread to avoid shared mutation + langsmith_ops = copy.deepcopy(ops) + otel_ops = copy.deepcopy(ops) + + try: + # Use ThreadPoolExecutor for parallel execution + with cf.ThreadPoolExecutor(max_workers=2) as executor: + # Submit both tasks + future_langsmith = executor.submit( + _tracing_thread_handle_batch, + client, + tracing_queue, + batch, + use_multipart, + False, # Don't mark tasks done - we'll do it once at the end + langsmith_ops, + ) + future_otel = executor.submit( + _otel_tracing_thread_handle_batch, + client, + tracing_queue, + batch, + False, # Don't mark tasks done - we'll do it once at the end + otel_ops, + ) + + # Wait for both to complete + future_langsmith.result() + future_otel.result() + except RuntimeError as e: + if "cannot schedule new futures after interpreter shutdown" in str(e): + # During interpreter shutdown, ThreadPoolExecutor is blocked, + # fall back to sequential processing + logger.debug( + "Interpreter shutting down, falling back to sequential processing" + ) + _tracing_thread_handle_batch( + client, tracing_queue, batch, use_multipart, False, langsmith_ops + ) + _otel_tracing_thread_handle_batch( + client, tracing_queue, batch, False, otel_ops + ) + else: + raise + + # Mark all tasks as done once, only if requested + if mark_task_done and tracing_queue is not None: + for _ in batch: + try: + tracing_queue.task_done() + except ValueError as e: + if "task_done() called too many times" in str(e): + # This can happen during shutdown when multiple threads + # process the same queue items. It's harmless. + logger.debug( + f"Ignoring harmless task_done error during shutdown: {e}" + ) + else: + raise + + +def get_size_limit_from_env() -> Optional[int]: + size_limit_str = ls_utils.get_env_var( + "BATCH_INGEST_SIZE_LIMIT", + ) + if size_limit_str is not None: + try: + return int(size_limit_str) + except ValueError: + logger.warning( + f"Invalid value for BATCH_INGEST_SIZE_LIMIT: {size_limit_str}, " + "continuing with default" + ) + return None + + +def _ensure_ingest_config( + info: ls_schemas.LangSmithInfo, +) -> ls_schemas.BatchIngestConfig: + default_config = ls_schemas.BatchIngestConfig( + use_multipart_endpoint=True, + size_limit_bytes=None, # Note this field is not used here + size_limit=100, + scale_up_nthreads_limit=_AUTO_SCALE_UP_NTHREADS_LIMIT, + scale_up_qsize_trigger=_AUTO_SCALE_UP_QSIZE_TRIGGER, + scale_down_nempty_trigger=_AUTO_SCALE_DOWN_NEMPTY_TRIGGER, + ) + if not info: + return default_config + try: + if not info.batch_ingest_config: + return default_config + env_size_limit = get_size_limit_from_env() + if env_size_limit is not None: + info.batch_ingest_config["size_limit"] = env_size_limit + return info.batch_ingest_config + except BaseException: + return default_config + + +def tracing_control_thread_func(client_ref: weakref.ref[Client]) -> None: + client = client_ref() + if client is None: + return + tracing_queue = client.tracing_queue + assert tracing_queue is not None + batch_ingest_config = _ensure_ingest_config(client.info) + size_limit: int = batch_ingest_config["size_limit"] + scale_up_nthreads_limit: int = batch_ingest_config["scale_up_nthreads_limit"] + scale_up_qsize_trigger: int = batch_ingest_config["scale_up_qsize_trigger"] + use_multipart = not client._multipart_disabled and batch_ingest_config.get( + "use_multipart_endpoint", True + ) + + sub_threads: list[threading.Thread] = [] + # 1 for this func, 1 for getrefcount, 1 for _get_data_type_cached + num_known_refs = 3 + + # Disable compression if explicitly set, using OpenTelemetry, or zstd unavailable + if not ZSTD_AVAILABLE: + logger.debug( + "zstandard package is not installed. " + "Falling back to uncompressed multipart ingestion." + ) + disable_compression = ( + ls_utils.is_env_var_truish("DISABLE_RUN_COMPRESSION") + or client._tracing_mode in ("otel", "hybrid") + or not ZSTD_AVAILABLE + ) + if not disable_compression and use_multipart: + if not (client.info.instance_flags or {}).get( + "zstd_compression_enabled", False + ): + logger.warning( + "Run compression is not enabled. Please update to the latest " + "version of LangSmith. Falling back to regular multipart ingestion." + ) + else: + client._futures = weakref.WeakSet() + client.compressed_traces = CompressedTraces() + client._data_available_event = threading.Event() + threading.Thread( + target=tracing_control_thread_func_compress_parallel, + args=(weakref.ref(client),), + daemon=client._use_daemon_threads, + ).start() + + num_known_refs += 1 + + def keep_thread_active() -> bool: + # if `client.cleanup()` was called, stop thread + if not client or ( + hasattr(client, "_manual_cleanup") and client._manual_cleanup + ): + logger.debug("Client is being cleaned up, stopping tracing thread") + return False + if not threading.main_thread().is_alive(): + # main thread is dead. should not be active + logger.debug("Main thread is dead, stopping tracing thread") + return False + + if hasattr(sys, "getrefcount"): + # check if client refs count indicates we're the only remaining + # reference to the client + refcount = sys.getrefcount(client) + threshold = num_known_refs + len(sub_threads) + should_keep_thread = refcount > threshold + if not should_keep_thread: + logger.debug( + "Client refs count indicates we're the only remaining reference " + "to the client, stopping tracing thread " + "(refcount=%d, threshold=%d)", + refcount, + threshold, + ) + return should_keep_thread + else: + # in PyPy, there is no sys.getrefcount attribute + # for now, keep thread alive + return True + + # loop until + while keep_thread_active(): + for thread in sub_threads: + if not thread.is_alive(): + sub_threads.remove(thread) + if ( + len(sub_threads) < scale_up_nthreads_limit + and tracing_queue.qsize() > scale_up_qsize_trigger + ): + new_thread = threading.Thread( + target=_tracing_sub_thread_func, + args=(weakref.ref(client), use_multipart), + daemon=client._use_daemon_threads, + ) + sub_threads.append(new_thread) + new_thread.start() + + mode = client._tracing_mode + max_batch_size = ( + client._max_batch_size_bytes + or batch_ingest_config.get("size_limit_bytes") + or 0 + ) + if next_batch := _tracing_thread_drain_queue( + tracing_queue, limit=size_limit, max_size_bytes=max_batch_size + ): + if mode == "hybrid": + logger.debug("Handling batch in hybrid mode") + _hybrid_tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + elif mode == "otel": + logger.debug("Handling batch in otel mode") + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + logger.debug("Handling batch in langsmith mode") + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + + # drain the queue on exit + logger.debug( + "Tracing thread draining queue on exit: qsize=%d", + tracing_queue.qsize(), + ) + mode = client._tracing_mode + max_batch_size = ( + client._max_batch_size_bytes or batch_ingest_config.get("size_limit_bytes") or 0 + ) + while next_batch := _tracing_thread_drain_queue( + tracing_queue, limit=size_limit, block=False, max_size_bytes=max_batch_size + ): + if mode == "hybrid": + logger.debug("Draining batch in hybrid mode") + _hybrid_tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + elif mode == "otel": + logger.debug("Draining batch in otel mode") + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + logger.debug("Draining batch in langsmith mode") + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + logger.debug("Tracing control thread is shutting down") + + +def tracing_control_thread_func_compress_parallel( + client_ref: weakref.ref[Client], flush_interval: float = 0.5 +) -> None: + client = client_ref() + if client is None: + return + logger.debug("Tracing control thread func compress parallel called") + if ( + client.compressed_traces is None + or client._data_available_event is None + or client._futures is None + ): + logger.error( + "LangSmith tracing error: Required compression attributes not " + "initialized.\nThis may affect trace submission but does not " + "impact your application's runtime." + ) + return + + batch_ingest_config = _ensure_ingest_config(client.info) + size_limit: int = batch_ingest_config["size_limit"] + size_limit_bytes = client._max_batch_size_bytes or batch_ingest_config.get( + "size_limit_bytes", 20_971_520 + ) + # One for this func, one for the parent thread, one for getrefcount, + # one for _get_data_type_cached + num_known_refs = 4 + + def keep_thread_active() -> bool: + # if `client.cleanup()` was called, stop thread + if not client or ( + hasattr(client, "_manual_cleanup") and client._manual_cleanup + ): + logger.debug("Client is being cleaned up, stopping compression thread") + return False + if not threading.main_thread().is_alive(): + # main thread is dead. should not be active + logger.debug("Main thread is dead, stopping compression thread") + return False + if hasattr(sys, "getrefcount"): + # check if client refs count indicates we're the only remaining + # reference to the client + refcount = sys.getrefcount(client) + should_keep_thread = refcount > num_known_refs + if not should_keep_thread: + logger.debug( + "Client refs count indicates we're the only remaining reference " + "to the client, stopping compression thread " + "(refcount=%d, threshold=%d)", + refcount, + num_known_refs, + ) + return should_keep_thread + else: + # in PyPy, there is no sys.getrefcount attribute + # for now, keep thread alive + return True + + last_flush_time = time.monotonic() + + while True: + triggered = client._data_available_event.wait(timeout=0.05) + if not keep_thread_active(): + break + + # If data arrived, clear the event and attempt a drain + if triggered: + client._data_available_event.clear() + + data_stream, compressed_traces_info = ( + _tracing_thread_drain_compressed_buffer + )(client, size_limit, size_limit_bytes) + # If we have data, submit the send request + if data_stream is not None: + try: + future = LANGSMITH_CLIENT_THREAD_POOL.submit( + client._send_compressed_multipart_req, + data_stream, + compressed_traces_info, + ) + client._futures.add(future) + except RuntimeError: + client._send_compressed_multipart_req( + data_stream, + compressed_traces_info, + ) + last_flush_time = time.monotonic() + + else: + if (time.monotonic() - last_flush_time) >= flush_interval: + ( + data_stream, + compressed_traces_info, + ) = _tracing_thread_drain_compressed_buffer( + client, size_limit=1, size_limit_bytes=1 + ) + if data_stream is not None: + try: + cf.wait( + [ + LANGSMITH_CLIENT_THREAD_POOL.submit( + client._send_compressed_multipart_req, + data_stream, + compressed_traces_info, + ) + ] + ) + except RuntimeError: + client._send_compressed_multipart_req( + data_stream, + compressed_traces_info, + ) + last_flush_time = time.monotonic() + + # Drain the buffer on exit (final flush) + try: + trace_count = ( + client.compressed_traces.trace_count + if client.compressed_traces is not None + else 0 + ) + logger.debug( + "Compression thread final flush: trace_count=%d", + trace_count, + ) + ( + final_data_stream, + compressed_traces_info, + ) = _tracing_thread_drain_compressed_buffer( + client, size_limit=1, size_limit_bytes=1 + ) + if final_data_stream is not None: + logger.debug( + "Compression thread final flush: sending %d bytes", + final_data_stream.getbuffer().nbytes, + ) + try: + cf.wait( + [ + LANGSMITH_CLIENT_THREAD_POOL.submit( + client._send_compressed_multipart_req, + final_data_stream, + compressed_traces_info, + ) + ] + ) + logger.debug("Compression thread final flush: send completed") + except RuntimeError: + logger.debug( + "Compression thread final flush: thread pool shutdown, " + "sending synchronously" + ) + client._send_compressed_multipart_req( + final_data_stream, + compressed_traces_info, + ) + logger.debug("Compression thread final flush: sync send completed") + else: + logger.debug("Compression thread final flush: no data to send") + + except Exception: + logger.error( + "LangSmith tracing error: Failed during final cleanup.\n" + "This does not affect your application's runtime.\n" + "Error details:", + exc_info=True, + ) + logger.debug("Compressed traces control thread is shutting down") + + +def _tracing_sub_thread_func( + client_ref: weakref.ref[Client], + use_multipart: bool, +) -> None: + client = client_ref() + if client is None: + return + try: + if not client.info: + return + except BaseException as e: + logger.debug("Error in tracing control thread: %s", e) + return + tracing_queue = client.tracing_queue + assert tracing_queue is not None + batch_ingest_config = _ensure_ingest_config(client.info) + size_limit = batch_ingest_config.get("size_limit", 100) + seen_successive_empty_queues = 0 + + # loop until + while ( + # the main thread dies + threading.main_thread().is_alive() + # or we've seen the queue empty 4 times in a row + and seen_successive_empty_queues + <= batch_ingest_config["scale_down_nempty_trigger"] + ): + max_batch_size = ( + client._max_batch_size_bytes + or batch_ingest_config.get("size_limit_bytes") + or 0 + ) + if next_batch := _tracing_thread_drain_queue( + tracing_queue, limit=size_limit, max_size_bytes=max_batch_size + ): + seen_successive_empty_queues = 0 + + mode = client._tracing_mode + if mode == "hybrid": + logger.debug("Sub-thread handling batch in hybrid mode") + _hybrid_tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + elif mode == "otel": + logger.debug("Sub-thread handling batch in otel mode") + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + logger.debug("Sub-thread handling batch in langsmith mode") + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + else: + seen_successive_empty_queues += 1 + + # drain the queue on exit + mode = client._tracing_mode + max_batch_size = ( + client._max_batch_size_bytes or batch_ingest_config.get("size_limit_bytes") or 0 + ) + while next_batch := _tracing_thread_drain_queue( + tracing_queue, limit=size_limit, block=False, max_size_bytes=max_batch_size + ): + if mode == "hybrid": + logger.debug("Sub-thread draining batch in hybrid mode") + _hybrid_tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + elif mode == "otel": + logger.debug("Sub-thread draining batch in otel mode") + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + logger.debug("Sub-thread draining batch in langsmith mode") + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) + logger.debug("Tracing control sub-thread is shutting down") diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_beta_decorator.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_beta_decorator.py new file mode 100644 index 0000000000000000000000000000000000000000..edbcaee86d87faa122c1b635c24d3b743e57fa24 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_beta_decorator.py @@ -0,0 +1,21 @@ +import functools +import warnings +from typing import Callable + + +class LangSmithBetaWarning(UserWarning): + """This is a warning specific to the LangSmithBeta module.""" + + +@functools.lru_cache(maxsize=100) +def _warn_once(message: str, stacklevel: int = 2) -> None: + warnings.warn(message, LangSmithBetaWarning, stacklevel=stacklevel) + + +def warn_beta(func: Callable) -> Callable: + @functools.wraps(func) + def wrapper(*args, **kwargs): + _warn_once(f"Function {func.__name__} is in beta.", stacklevel=3) + return func(*args, **kwargs) + + return wrapper diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_compressed_traces.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_compressed_traces.py new file mode 100644 index 0000000000000000000000000000000000000000..731e455cff2ed20296519f079e34f0e392e0ef02 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_compressed_traces.py @@ -0,0 +1,56 @@ +import io +import threading +from typing import Optional + +from langsmith import utils as ls_utils + +try: + from zstandard import ZstdCompressor # type: ignore[import] + + ZSTD_AVAILABLE = True +except ImportError: + ZSTD_AVAILABLE = False + +compression_level = int(ls_utils.get_env_var("RUN_COMPRESSION_LEVEL") or 1) +compression_threads = int(ls_utils.get_env_var("RUN_COMPRESSION_THREADS") or -1) + +DEFAULT_MAX_UNCOMPRESSED_QUEUE_BYTES = 1024 * 1024 * 1024 # 1GB + + +class CompressedTraces: + def __init__(self, max_uncompressed_size_bytes: Optional[int] = None) -> None: + if not ZSTD_AVAILABLE: + raise ImportError( + "zstandard is required for compressed trace ingestion. " + "Install it with `pip install zstandard` or set the environment " + "variable LANGSMITH_DISABLE_RUN_COMPRESSION=true to disable " + "compression." + ) + # Configure the maximum total uncompressed size for the in-memory queue. + if max_uncompressed_size_bytes is None: + max_bytes_str = ls_utils.get_env_var("MAX_INGEST_MEMORY_BYTES") + if max_bytes_str is not None: + max_uncompressed_size_bytes = int(max_bytes_str) + else: + max_uncompressed_size_bytes = DEFAULT_MAX_UNCOMPRESSED_QUEUE_BYTES + + self.max_uncompressed_size_bytes = max_uncompressed_size_bytes + + self.buffer: io.BytesIO = io.BytesIO() + self.trace_count: int = 0 + self.lock = threading.Lock() + self.uncompressed_size: int = 0 + self._context: list[str] = [] + + self.compressor_writer = ZstdCompressor( + level=compression_level, threads=compression_threads + ).stream_writer(self.buffer, closefd=False) + + def reset(self) -> None: + self.buffer = io.BytesIO() + self.trace_count = 0 + self.uncompressed_size = 0 + self._context = [] + self.compressor_writer = ZstdCompressor( + level=compression_level, threads=-1 + ).stream_writer(self.buffer, closefd=False) diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_constants.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_constants.py new file mode 100644 index 0000000000000000000000000000000000000000..575e8dead4fd509d9e1e7cda74d5a28d9426d90d --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_constants.py @@ -0,0 +1,9 @@ +import uuid + +_SIZE_LIMIT_BYTES = 20_971_520 # 20MB by default +_AUTO_SCALE_UP_QSIZE_TRIGGER = 200 +_AUTO_SCALE_UP_NTHREADS_LIMIT = 32 +_AUTO_SCALE_DOWN_NEMPTY_TRIGGER = 4 +_BLOCKSIZE_BYTES = 1024 * 1024 # 1MB +_BOUNDARY = uuid.uuid4().hex +_TRACING_QUEUE_MAX_SIZE = 10_000 diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_context.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_context.py new file mode 100644 index 0000000000000000000000000000000000000000..93ba5fe68ec7fddc9d85fc0d66c891a3b8d64ae4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_context.py @@ -0,0 +1,46 @@ +"""Shared context (ContextVars and global defaults) that configure tracing.""" + +import contextvars +import weakref +from typing import TYPE_CHECKING, Any, Literal, Optional, Union + +if TYPE_CHECKING: + from langsmith.client import Client + from langsmith.run_trees import RunTree +else: + Client = Any # type: ignore[assignment] + RunTree = Any # type: ignore[assignment] + +_PROJECT_NAME = contextvars.ContextVar[Optional[str]]("_PROJECT_NAME", default=None) +_TAGS = contextvars.ContextVar[Optional[list[str]]]("_TAGS", default=None) +_METADATA = contextvars.ContextVar[Optional[dict[str, Any]]]("_METADATA", default=None) + +_TRACING_ENABLED = contextvars.ContextVar[Optional[Union[bool, Literal["local"]]]]( + "_TRACING_ENABLED", default=None +) +_CLIENT = contextvars.ContextVar[Optional["Client"]]("_CLIENT", default=None) + +# Store a weak reference to the RunTree in the context. +# This prevents memory leaks when contexts are captured by asyncio operations +# (call_later, create_task, etc.) โ€” the captured context holds only a weakref, +# and the RunTree can be GC'd once no strong references remain. +_PARENT_RUN_TREE_REF = contextvars.ContextVar[Optional[weakref.ref["RunTree"]]]( + "_PARENT_RUN_TREE_REF", default=None +) + + +def get_current_run_tree() -> Optional["RunTree"]: + """Get the current RunTree from the context. + + Returns the RunTree if it's still alive, otherwise None. + """ + ref = _PARENT_RUN_TREE_REF.get() + return ref() if ref is not None else None + + +# Not thread-local, so you can set this process-wide (before asyncio.run, etc.) +_GLOBAL_PROJECT_NAME: Optional[str] = None +_GLOBAL_TAGS: Optional[list[str]] = None +_GLOBAL_METADATA: Optional[dict[str, Any]] = None +_GLOBAL_TRACING_ENABLED: Optional[Union[bool, Literal["local"]]] = None +_GLOBAL_CLIENT: Optional["Client"] = None diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_edit_distance.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_edit_distance.py new file mode 100644 index 0000000000000000000000000000000000000000..ef544cd281aeaa8231ee87417929dc7132ecaaff --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_edit_distance.py @@ -0,0 +1,67 @@ +from typing import Any, Callable, Literal, Optional + +from typing_extensions import TypedDict + +METRICS = Literal[ + "damerau_levenshtein", + "levenshtein", + "jaro", + "jaro_winkler", + "hamming", + "indel", +] + + +class EditDistanceConfig(TypedDict, total=False): + metric: METRICS + normalize_score: bool + + +class EditDistance: + def __init__( + self, + config: Optional[EditDistanceConfig] = None, + ): + config = config or {} + metric = config.get("metric") or "damerau_levenshtein" + self.metric = self._get_metric( + metric, normalize_score=config.get("normalize_score", True) + ) + + def evaluate( + self, + prediction: str, + reference: Optional[str] = None, + ) -> float: + return self.metric(prediction, reference) + + @staticmethod + def _get_metric(distance: str, normalize_score: bool = True) -> Callable: + try: + from rapidfuzz import ( # type: ignore[import-not-found] + distance as rf_distance, + ) + except ImportError: + raise ImportError( + "This operation requires the rapidfuzz library to use." + "Please install it with `pip install -U rapidfuzz`." + ) + + module_map: dict[str, Any] = { + "damerau_levenshtein": rf_distance.DamerauLevenshtein, + "levenshtein": rf_distance.Levenshtein, + "jaro": rf_distance.Jaro, + "jaro_winkler": rf_distance.JaroWinkler, + "hamming": rf_distance.Hamming, + "indel": rf_distance.Indel, + } + if distance not in module_map: + raise ValueError( + f"Invalid distance metric: {distance}" + f"\nMust be one of: {list(module_map)}" + ) + module = module_map[distance] + if normalize_score: + return module.normalized_distance + else: + return module.distance diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_embedding_distance.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_embedding_distance.py new file mode 100644 index 0000000000000000000000000000000000000000..1daac60d8d84cc0d5038d280314d9895997f18c6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_embedding_distance.py @@ -0,0 +1,190 @@ +from __future__ import annotations + +import logging +from collections.abc import Sequence +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Literal, + Optional, + Union, +) + +from typing_extensions import TypedDict + +if TYPE_CHECKING: + import numpy as np # type: ignore + + +logger = logging.getLogger(__name__) + +Matrix = Union[list[list[float]], list[Any], Any] + + +def cosine_similarity(X: Matrix, Y: Matrix) -> np.ndarray: + """Row-wise cosine similarity between two equal-width matrices.""" + import numpy as np + + if len(X) == 0 or len(Y) == 0: + return np.array([]) + + X = np.array(X) + Y = np.array(Y) + if X.shape[1] != Y.shape[1]: + raise ValueError( + f"Number of columns in X and Y must be the same. X has shape {X.shape} " + f"and Y has shape {Y.shape}." + ) + try: + import simsimd as simd # type: ignore + + X = np.array(X, dtype=np.float32) + Y = np.array(Y, dtype=np.float32) + Z = 1 - simd.cdist(X, Y, metric="cosine") + if isinstance(Z, float): + return np.array([Z]) + return np.array(Z) + except ImportError: + logger.debug( + "Unable to import simsimd, defaulting to NumPy implementation. If you want " + "to use simsimd please install with `pip install simsimd`." + ) + X_norm = np.linalg.norm(X, axis=1) + Y_norm = np.linalg.norm(Y, axis=1) + # Ignore divide by zero errors run time warnings as those are handled below. + with np.errstate(divide="ignore", invalid="ignore"): + similarity = np.dot(X, Y.T) / np.outer(X_norm, Y_norm) + similarity[np.isnan(similarity) | np.isinf(similarity)] = 0.0 + return similarity + + +def _get_openai_encoder() -> Callable[[Sequence[str]], Sequence[Sequence[float]]]: + """Get the OpenAI GPT-3 encoder.""" + try: + from openai import Client as OpenAIClient + except ImportError: + raise ImportError( + "THe default encoder for the EmbeddingDistance class uses the OpenAI API. " + "Please either install the openai library with `pip install openai` or " + "provide a custom encoder function (Callable[[str], Sequence[float]])." + ) + + def encode_text(texts: Sequence[str]) -> Sequence[Sequence[float]]: + client = OpenAIClient() + response = client.embeddings.create( + input=list(texts), model="text-embedding-3-small" + ) + return [d.embedding for d in response.data] + + return encode_text + + +class EmbeddingConfig(TypedDict, total=False): + encoder: Callable[[list[str]], Sequence[Sequence[float]]] + metric: Literal["cosine", "euclidean", "manhattan", "chebyshev", "hamming"] + + +class EmbeddingDistance: + def __init__( + self, + config: Optional[EmbeddingConfig] = None, + ): + config = config or {} + self.distance = config.get("metric") or "cosine" + self.encoder = config.get("encoder") or _get_openai_encoder() + + def evaluate( + self, + prediction: str, + reference: str, + ) -> float: + try: + import numpy as np + except ImportError: + raise ImportError( + "The EmbeddingDistance class requires NumPy. Please install it with " + "`pip install numpy`." + ) + embeddings = self.encoder([prediction, reference]) + vector = np.array(embeddings) + return self._compute_distance(vector[0], vector[1]).item() + + def _compute_distance(self, a: np.ndarray, b: np.ndarray) -> np.floating: + if self.distance == "cosine": + return self._cosine_distance(a, b) # type: ignore + elif self.distance == "euclidean": + return self._euclidean_distance(a, b) + elif self.distance == "manhattan": + return self._manhattan_distance(a, b) + elif self.distance == "chebyshev": + return self._chebyshev_distance(a, b) + elif self.distance == "hamming": + return self._hamming_distance(a, b) + else: + raise ValueError(f"Invalid distance metric: {self.distance}") + + @staticmethod + def _cosine_distance(a: np.ndarray, b: np.ndarray) -> np.ndarray: + """Compute the cosine distance between two vectors. + + Args: + a (np.ndarray): The first vector. + b (np.ndarray): The second vector. + + Returns: + np.ndarray: The cosine distance. + """ + return 1.0 - cosine_similarity([a], [b]) + + @staticmethod + def _euclidean_distance(a: np.ndarray, b: np.ndarray) -> np.floating: + """Compute the Euclidean distance between two vectors. + + Args: + a (np.ndarray): The first vector. + b (np.ndarray): The second vector. + + Returns: + np.floating: The Euclidean distance. + """ + return np.linalg.norm(a - b) + + @staticmethod + def _manhattan_distance(a: np.ndarray, b: np.ndarray) -> np.floating: + """Compute the Manhattan distance between two vectors. + + Args: + a (np.ndarray): The first vector. + b (np.ndarray): The second vector. + + Returns: + np.floating: The Manhattan distance. + """ + return np.sum(np.abs(a - b)) + + @staticmethod + def _chebyshev_distance(a: np.ndarray, b: np.ndarray) -> np.floating: + """Compute the Chebyshev distance between two vectors. + + Args: + a (np.ndarray): The first vector. + b (np.ndarray): The second vector. + + Returns: + np.floating: The Chebyshev distance. + """ + return np.max(np.abs(a - b)) + + @staticmethod + def _hamming_distance(a: np.ndarray, b: np.ndarray) -> np.floating: + """Compute the Hamming distance between two vectors. + + Args: + a (np.ndarray): The first vector. + b (np.ndarray): The second vector. + + Returns: + np.floating: The Hamming distance. + """ + return np.mean(a != b) diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_hub.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_hub.py new file mode 100644 index 0000000000000000000000000000000000000000..8e0873322970160b3cfa1e54ff3c6a6253674b49 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_hub.py @@ -0,0 +1,30 @@ +"""Shared constants and helpers for hub (agent/skill) methods.""" + +from __future__ import annotations + +import re +from typing import Optional + +from langsmith import utils as ls_utils + +REPO_HANDLE_PATTERN = re.compile(r"^[a-z][a-z0-9-_]*$") +PLATFORM_HUB = "/v1/platform/hub/repos" +HUB = "/repos" + + +def build_commit_url(host: str, owner: str, name: str, commit_hash: str) -> str: + """Build the URL for a hub directory commit.""" + return f"{host}/hub/{owner}/{name}:{commit_hash[:8]}" + + +def resolve_owner_for_url(owner: str, tenant_handle: Optional[str]) -> str: + """Resolve internal owner sentinel to a user-visible owner in URLs.""" + if owner == "-" and tenant_handle: + return tenant_handle + return owner + + +def validate_parent_commit(parent_commit: Optional[str]) -> None: + """Raise ``LangSmithUserError`` if ``parent_commit`` is set but malformed.""" + if parent_commit is not None and not (8 <= len(parent_commit) <= 64): + raise ls_utils.LangSmithUserError("parent_commit must be 8-64 characters.") diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_multipart.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_multipart.py new file mode 100644 index 0000000000000000000000000000000000000000..e5ecf9caebd039ed7af89c476af17ff30aebbe78 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_multipart.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from collections.abc import Iterable +from io import BufferedReader +from typing import Union + +MultipartPart = tuple[ + str, tuple[None, Union[bytes, BufferedReader], str, dict[str, str]] +] + + +class MultipartPartsAndContext: + parts: list[MultipartPart] + context: str + + __slots__ = ("parts", "context") + + def __init__(self, parts: list[MultipartPart], context: str) -> None: + self.parts = parts + self.context = context + + +def join_multipart_parts_and_context( + parts_and_contexts: Iterable[MultipartPartsAndContext], +) -> MultipartPartsAndContext: + acc_parts: list[MultipartPart] = [] + acc_context: list[str] = [] + for parts_and_context in parts_and_contexts: + acc_parts.extend(parts_and_context.parts) + acc_context.append(parts_and_context.context) + return MultipartPartsAndContext(acc_parts, "; ".join(acc_context)) diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_operations.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_operations.py new file mode 100644 index 0000000000000000000000000000000000000000..0940b2d7484d753266a5822157e78c2a42d6cd77 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_operations.py @@ -0,0 +1,446 @@ +from __future__ import annotations + +import itertools +import logging +import os +import uuid +from collections.abc import Iterable +from io import BufferedReader +from typing import Literal, Optional, Union, cast + +from langsmith import schemas as ls_schemas +from langsmith._internal import _orjson +from langsmith._internal._compressed_traces import CompressedTraces +from langsmith._internal._multipart import MultipartPart, MultipartPartsAndContext +from langsmith._internal._serde import dumps_json as _dumps_json + +logger = logging.getLogger(__name__) + + +class SerializedRunOperation: + operation: Literal["post", "patch"] + id: uuid.UUID + trace_id: uuid.UUID + + # this is the whole object, minus the other fields which + # are popped (inputs/outputs/events/attachments) + _none: bytes + + inputs: Optional[bytes] + outputs: Optional[bytes] + events: Optional[bytes] + extra: Optional[bytes] + error: Optional[bytes] + serialized: Optional[bytes] + attachments: Optional[ls_schemas.Attachments] + + __slots__ = ( + "operation", + "id", + "trace_id", + "_none", + "inputs", + "outputs", + "events", + "extra", + "error", + "serialized", + "attachments", + ) + + def __init__( + self, + operation: Literal["post", "patch"], + id: uuid.UUID, + trace_id: uuid.UUID, + _none: bytes, + inputs: Optional[bytes] = None, + outputs: Optional[bytes] = None, + events: Optional[bytes] = None, + extra: Optional[bytes] = None, + error: Optional[bytes] = None, + serialized: Optional[bytes] = None, + attachments: Optional[ls_schemas.Attachments] = None, + ) -> None: + self.operation = operation + self.id = id + self.trace_id = trace_id + self._none = _none + self.inputs = inputs + self.outputs = outputs + self.events = events + self.extra = extra + self.error = error + self.serialized = serialized + self.attachments = attachments + + def calculate_serialized_size(self) -> int: + """Calculate actual serialized size of this operation.""" + size = 0 + if self._none: + size += len(self._none) + if self.inputs: + size += len(self.inputs) + if self.outputs: + size += len(self.outputs) + if self.events: + size += len(self.events) + if self.extra: + size += len(self.extra) + if self.error: + size += len(self.error) + if self.serialized: + size += len(self.serialized) + if self.attachments: + for content_type, data_or_path in self.attachments.values(): + if isinstance(data_or_path, bytes): + size += len(data_or_path) + return size + + def deserialize_run_info(self) -> dict: + """Deserialize the main run info (_none and extra, error and serialized).""" + run_info = _orjson.loads(self._none) + if self.extra is not None: + run_info["extra"] = _orjson.loads(self.extra) + + if self.error is not None: + run_info["error"] = _orjson.loads(self.error) + + if self.serialized is not None: + run_info["serialized"] = _orjson.loads(self.serialized) + + return run_info + + def __eq__(self, other: object) -> bool: + return isinstance(other, SerializedRunOperation) and ( + self.operation, + self.id, + self.trace_id, + self._none, + self.inputs, + self.outputs, + self.events, + self.extra, + self.error, + self.serialized, + self.attachments, + ) == ( + other.operation, + other.id, + other.trace_id, + other._none, + other.inputs, + other.outputs, + other.events, + other.extra, + other.error, + other.serialized, + other.attachments, + ) + + +class SerializedFeedbackOperation: + id: uuid.UUID + trace_id: uuid.UUID + feedback: bytes + + __slots__ = ("id", "trace_id", "feedback") + + def __init__(self, id: uuid.UUID, trace_id: uuid.UUID, feedback: bytes) -> None: + self.id = id + self.trace_id = trace_id + self.feedback = feedback + + def calculate_serialized_size(self) -> int: + """Calculate actual serialized size of this operation.""" + return len(self.feedback) + + def __eq__(self, other: object) -> bool: + return isinstance(other, SerializedFeedbackOperation) and ( + self.id, + self.trace_id, + self.feedback, + ) == (other.id, other.trace_id, other.feedback) + + +def serialize_feedback_dict( + feedback: Union[ls_schemas.FeedbackCreate, dict], +) -> SerializedFeedbackOperation: + if hasattr(feedback, "model_dump") and callable(getattr(feedback, "model_dump")): + feedback_create: dict = feedback.model_dump() # type: ignore + else: + feedback_create = cast(dict, feedback) + if "id" not in feedback_create: + feedback_create["id"] = uuid.uuid4() + elif isinstance(feedback_create["id"], str): + feedback_create["id"] = uuid.UUID(feedback_create["id"]) + if "trace_id" not in feedback_create: + feedback_create["trace_id"] = uuid.uuid4() + elif isinstance(feedback_create["trace_id"], str): + feedback_create["trace_id"] = uuid.UUID(feedback_create["trace_id"]) + + return SerializedFeedbackOperation( + id=feedback_create["id"], + trace_id=feedback_create["trace_id"], + feedback=_dumps_json(feedback_create), + ) + + +def serialize_run_dict( + operation: Literal["post", "patch"], payload: dict +) -> SerializedRunOperation: + inputs = payload.pop("inputs", None) + outputs = payload.pop("outputs", None) + events = payload.pop("events", None) + extra = payload.pop("extra", None) + error = payload.pop("error", None) + serialized = payload.pop("serialized", None) + attachments = payload.pop("attachments", None) + return SerializedRunOperation( + operation=operation, + id=payload["id"], + trace_id=payload["trace_id"], + _none=_dumps_json(payload), + inputs=_dumps_json(inputs) if inputs is not None else None, + outputs=_dumps_json(outputs) if outputs is not None else None, + events=_dumps_json(events) if events is not None else None, + extra=_dumps_json(extra) if extra is not None else None, + error=_dumps_json(error) if error is not None else None, + serialized=_dumps_json(serialized) if serialized is not None else None, + attachments=attachments if attachments is not None else None, + ) + + +def combine_serialized_queue_operations( + ops: list[Union[SerializedRunOperation, SerializedFeedbackOperation]], +) -> list[Union[SerializedRunOperation, SerializedFeedbackOperation]]: + create_ops_by_id = { + op.id: op + for op in ops + if isinstance(op, SerializedRunOperation) and op.operation == "post" + } + passthrough_ops: list[ + Union[SerializedRunOperation, SerializedFeedbackOperation] + ] = [] + for op in ops: + if isinstance(op, SerializedRunOperation): + if op.operation == "post": + continue + + # must be patch + + create_op = create_ops_by_id.get(op.id) + if create_op is None: + passthrough_ops.append(op) + continue + + if op._none is not None and op._none != create_op._none: + # TODO optimize this more - this would currently be slowest + # for large payloads + create_op_dict = _orjson.loads(create_op._none) + op_dict = { + k: v for k, v in _orjson.loads(op._none).items() if v is not None + } + create_op_dict.update(op_dict) + create_op._none = _orjson.dumps(create_op_dict) + + if op.inputs is not None: + create_op.inputs = op.inputs + if op.outputs is not None: + create_op.outputs = op.outputs + if op.events is not None: + create_op.events = op.events + if op.extra is not None: + create_op.extra = op.extra + if op.error is not None: + create_op.error = op.error + if op.serialized is not None: + create_op.serialized = op.serialized + if op.attachments is not None: + if create_op.attachments is None: + create_op.attachments = {} + create_op.attachments.update(op.attachments) + else: + passthrough_ops.append(op) + return list(itertools.chain(create_ops_by_id.values(), passthrough_ops)) + + +def serialized_feedback_operation_to_multipart_parts_and_context( + op: SerializedFeedbackOperation, +) -> MultipartPartsAndContext: + return MultipartPartsAndContext( + [ + ( + f"feedback.{op.id}", + ( + None, + op.feedback, + "application/json", + {"Content-Length": str(len(op.feedback))}, + ), + ) + ], + f"trace={op.trace_id},id={op.id}", + ) + + +def serialized_run_operation_to_multipart_parts_and_context( + op: SerializedRunOperation, +) -> tuple[MultipartPartsAndContext, dict[str, BufferedReader]]: + acc_parts: list[MultipartPart] = [] + opened_files_dict: dict[str, BufferedReader] = {} + # this is main object, minus inputs/outputs/events/attachments + acc_parts.append( + ( + f"{op.operation}.{op.id}", + ( + None, + op._none, + "application/json", + {"Content-Length": str(len(op._none))}, + ), + ) + ) + for key, value in ( + ("inputs", op.inputs), + ("outputs", op.outputs), + ("events", op.events), + ("extra", op.extra), + ("error", op.error), + ("serialized", op.serialized), + ): + if value is None: + continue + valb = value + acc_parts.append( + ( + f"{op.operation}.{op.id}.{key}", + ( + None, + valb, + "application/json", + {"Content-Length": str(len(valb))}, + ), + ), + ) + if op.attachments: + for n, (content_type, data_or_path) in op.attachments.items(): + if "." in n: + logger.warning( + f"Skipping logging of attachment '{n}' " + f"for run {op.id}:" + " Invalid attachment name. Attachment names must not contain" + " periods ('.'). Please rename the attachment and try again." + ) + continue + + if isinstance(data_or_path, bytes): + acc_parts.append( + ( + f"attachment.{op.id}.{n}", + ( + None, + data_or_path, + content_type, + {"Content-Length": str(len(data_or_path))}, + ), + ) + ) + else: + try: + file_size = os.path.getsize(data_or_path) + file = open(data_or_path, "rb") + except FileNotFoundError: + logger.warning( + "Attachment file not found for run %s: %s", op.id, data_or_path + ) + continue + opened_files_dict[str(data_or_path) + str(uuid.uuid4())] = file + acc_parts.append( + ( + f"attachment.{op.id}.{n}", + ( + None, + file, + f"{content_type}; length={file_size}", + {}, + ), + ) + ) + return ( + MultipartPartsAndContext(acc_parts, f"trace={op.trace_id},id={op.id}"), + opened_files_dict, + ) + + +def encode_multipart_parts_and_context( + parts_and_context: MultipartPartsAndContext, + boundary: str, +) -> Iterable[tuple[bytes, Union[bytes, BufferedReader]]]: + for part_name, (filename, data, content_type, headers) in parts_and_context.parts: + header_parts = [ + f"--{boundary}\r\n", + f'Content-Disposition: form-data; name="{part_name}"', + ] + + if filename: + header_parts.append(f'; filename="{filename}"') + + header_parts.extend( + [ + f"\r\nContent-Type: {content_type}\r\n", + *[f"{k}: {v}\r\n" for k, v in headers.items()], + "\r\n", + ] + ) + + yield ("".join(header_parts).encode(), data) + + +def compress_multipart_parts_and_context( + parts_and_context: MultipartPartsAndContext, + compressed_traces: CompressedTraces, + boundary: str, +) -> bool: + """Compress multipart parts into the shared compressed buffer. + + Returns True if the parts were enqueued into the compressed buffer, or False + if they were rejected because the configured in-memory size limit would be + exceeded. + """ + write = compressed_traces.compressor_writer.write + + parts: list[tuple[bytes, bytes]] = [] + op_uncompressed_size = 0 + + for headers, data in encode_multipart_parts_and_context( + parts_and_context, boundary + ): + # Normalise to bytes + if not isinstance(data, (bytes, bytearray)): + data = ( + data.read() if isinstance(data, BufferedReader) else str(data).encode() + ) + + parts.append((headers, data)) + op_uncompressed_size += len(data) + + max_bytes = getattr(compressed_traces, "max_uncompressed_size_bytes", None) + if max_bytes is not None and max_bytes > 0: + current_size = compressed_traces.uncompressed_size + if current_size > 0 and current_size + op_uncompressed_size > max_bytes: + from langsmith.client import _log_tracing_drop + + _log_tracing_drop( + f"compressed traces buffer full ({current_size}/{max_bytes} bytes)" + ) + return False + + for headers, data in parts: + write(headers) + compressed_traces.uncompressed_size += len(data) + write(data) + write(b"\r\n") # part terminator + + compressed_traces._context.append(parts_and_context.context) + return True diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_orjson.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_orjson.py new file mode 100644 index 0000000000000000000000000000000000000000..9d32fd1f2d34d8e40cfe655ebdf20ee23f01816b --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_orjson.py @@ -0,0 +1,88 @@ +"""Stubs for orjson operations, compatible with PyPy via a json fallback.""" + +try: + from orjson import ( + OPT_NON_STR_KEYS, + OPT_SERIALIZE_DATACLASS, + OPT_SERIALIZE_NUMPY, + OPT_SERIALIZE_UUID, + Fragment, + JSONDecodeError, + dumps, + loads, + ) + +except ImportError: + import dataclasses + import json + import uuid + from typing import Any, Callable, Optional, Union + + DefaultFunc = Optional[Callable[[Any], Any]] + + OPT_NON_STR_KEYS = 1 + OPT_SERIALIZE_DATACLASS = 2 + OPT_SERIALIZE_NUMPY = 4 + OPT_SERIALIZE_UUID = 8 + + class Fragment: # type: ignore + def __init__(self, payloadb: bytes): + self.payloadb = payloadb + + from json import JSONDecodeError # type: ignore + + def dumps( + obj: Any, + /, + default: DefaultFunc = None, + option: Optional[int] = None, + ) -> bytes: + # for now, don't do anything for this case because `json.dumps` + # automatically encodes non-str keys as str by default, unlike orjson + # enable_non_str_keys = bool(option & OPT_NON_STR_KEYS) + if option is None: + option = 0 + + enable_serialize_numpy = bool(option & OPT_SERIALIZE_NUMPY) + enable_serialize_dataclass = bool(option & OPT_SERIALIZE_DATACLASS) + enable_serialize_uuid = bool(option & OPT_SERIALIZE_UUID) + + class CustomEncoder(json.JSONEncoder): # type: ignore + def encode(self, o: Any) -> str: + if isinstance(o, Fragment): + return o.payloadb.decode("utf-8") # type: ignore + return super().encode(o) + + def default(self, o: Any) -> Any: + if enable_serialize_uuid and isinstance(o, uuid.UUID): + return str(o) + if enable_serialize_numpy and hasattr(o, "tolist"): + # even objects like np.uint16(15) have a .tolist() function + return o.tolist() + if ( + enable_serialize_dataclass + and dataclasses.is_dataclass(o) + and not isinstance(o, type) + ): + return dataclasses.asdict(o) + if default is not None: + return default(o) + + return super().default(o) + + return json.dumps(obj, cls=CustomEncoder).encode("utf-8") + + def loads(payload: Union[bytes, bytearray, memoryview, str], /) -> Any: + return json.loads(payload) + + +__all__ = [ + "loads", + "dumps", + "Fragment", + "JSONDecodeError", + "OPT_SERIALIZE_NUMPY", + "OPT_SERIALIZE_DATACLASS", + "OPT_SERIALIZE_UUID", + "OPT_NON_STR_KEYS", +] diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_otel_utils.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_otel_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..c59b6aacbafc6c0daa52c89df353f47d1e9f9c62 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_otel_utils.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from uuid import UUID + + +def get_otel_trace_id_from_uuid(uuid_val: UUID) -> int: + """Get OpenTelemetry trace ID as integer from UUID. + + Args: + uuid_val: The UUID to convert. + + Returns: + Integer representation of the trace ID. + """ + trace_id_hex = uuid_val.hex + return int(trace_id_hex, 16) + + +def get_otel_span_id_from_uuid(uuid_val: UUID) -> int: + """Get OpenTelemetry span ID as integer from UUID. + + Args: + uuid_val: The UUID to convert. + + Returns: + Integer representation of the span ID. + """ + uuid_bytes = uuid_val.bytes + span_id_bytes = uuid_bytes[:8] + span_id_hex = span_id_bytes.hex() + return int(span_id_hex, 16) diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_patch.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_patch.py new file mode 100644 index 0000000000000000000000000000000000000000..e7bf88bdf750572bc290ae1df931d567f225bbda --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_patch.py @@ -0,0 +1,93 @@ +import functools + +from urllib3 import __version__ as urllib3version # type: ignore[import-untyped] +from urllib3 import connection # type: ignore[import-untyped] + + +def _ensure_str(s, encoding="utf-8", errors="strict") -> str: + if isinstance(s, str): + return s + + if isinstance(s, bytes): + return s.decode(encoding, errors) + return str(s) + + +# Copied from https://github.com/urllib3/urllib3/blob/1c994dfc8c5d5ecaee8ed3eb585d4785f5febf6e/src/urllib3/connection.py#L231 +def request(self, method, url, body=None, headers=None): + """Make the request. + + This function is based on the urllib3 request method, with modifications + to handle potential issues when using vcrpy in concurrent workloads. + + Args: + self: The HTTPConnection instance. + method (str): The HTTP method (e.g., 'GET', 'POST'). + url (str): The URL for the request. + body (Optional[Any]): The body of the request. + headers (Optional[dict]): Headers to send with the request. + + Returns: + The result of calling the parent request method. + """ + # Update the inner socket's timeout value to send the request. + # This only triggers if the connection is re-used. + if getattr(self, "sock", None) is not None: + self.sock.settimeout(self.timeout) + + if headers is None: + headers = {} + else: + # Avoid modifying the headers passed into .request() + headers = headers.copy() + if "user-agent" not in (_ensure_str(k.lower()) for k in headers): + headers["User-Agent"] = connection._get_default_user_agent() + # The above is all the same ^^^ + # The following is different: + return self._parent_request(method, url, body=body, headers=headers) + + +_PATCHED = False + + +def patch_urllib3(): + """Patch the request method of urllib3 to avoid type errors when using vcrpy. + + In concurrent workloads (such as the tracing background queue), the + connection pool can get in a state where an HTTPConnection is created + before vcrpy patches the HTTPConnection class. In urllib3 >= 2.0 this isn't + a problem since they use the proper super().request(...) syntax, but in older + versions, super(HTTPConnection, self).request is used, resulting in a TypeError + since self is no longer a subclass of "HTTPConnection" (which at this point + is vcr.stubs.VCRConnection). + + This method patches the class to fix the super() syntax to avoid mixed inheritance. + In the case of the LangSmith tracing logic, it doesn't really matter since we always + exclude cache checks for calls to LangSmith. + + The patch is only applied for urllib3 versions older than 2.0. + """ + global _PATCHED + if _PATCHED: + return + from packaging import version + + if version.parse(urllib3version) >= version.parse("2.0"): + _PATCHED = True + return + + # Lookup the parent class and its request method + parent_class = connection.HTTPConnection.__bases__[0] + parent_request = parent_class.request + + def new_request(self, *args, **kwargs): + """Handle parent request. + + This method binds the parent's request method to self and then + calls our modified request function. + """ + self._parent_request = functools.partial(parent_request, self) + return request(self, *args, **kwargs) + + connection.HTTPConnection.request = new_request + _PATCHED = True diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_profiles.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_profiles.py new file mode 100644 index 0000000000000000000000000000000000000000..9ccc0e02142edc47a6d79670ecf5b3a6d96496e3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_profiles.py @@ -0,0 +1,338 @@ +"""LangSmith profile configuration and auth helpers.""" + +from __future__ import annotations + +import datetime +import json +import os +import threading +from collections.abc import Mapping +from pathlib import Path +from typing import Any, NamedTuple, Optional, TypedDict, cast + +import requests + +_OAUTH_CLIENT_ID = "langsmith-cli" +_TOKEN_REFRESH_LEEWAY = datetime.timedelta(minutes=1) +_TOKEN_REFRESH_TIMEOUT = 10 + + +class ProfileOAuth(TypedDict, total=False): + access_token: str + refresh_token: str + expires_at: str + + +class ProfileConfig(TypedDict, total=False): + api_key: str + api_url: str + workspace_id: str + oauth: ProfileOAuth + + +class ProfileConfigFile(TypedDict, total=False): + current_profile: str + profiles: dict[str, ProfileConfig] + + +class ProfileState(NamedTuple): + path: Path + config: ProfileConfigFile + profile_name: str + + +class ProfileClientConfig(NamedTuple): + api_url: Optional[str] = None + api_key: Optional[str] = None + workspace_id: Optional[str] = None + oauth_access_token: Optional[str] = None + oauth_refresh_token: Optional[str] = None + oauth_expires_at: Optional[str] = None + profile_state: Optional[ProfileState] = None + + @property + def has_oauth(self) -> bool: + return bool(self.oauth_access_token or self.oauth_refresh_token) + + +def trim_auth_value(value: Optional[str]) -> Optional[str]: + if not value: + return None + trimmed = value.strip().strip('"').strip("'") + return trimmed or None + + +def _profile_config_path() -> Optional[Path]: + if config_file := os.environ.get("LANGSMITH_CONFIG_FILE"): + return Path(config_file) + try: + return Path.home() / ".langsmith" / "config.json" + except RuntimeError: + return None + + +def _load_profile_state() -> Optional[ProfileState]: + path = _profile_config_path() + if path is None or not path.exists(): + return None + try: + raw = json.loads(path.read_text(encoding="utf-8")) + except (OSError, json.JSONDecodeError): + return None + if not isinstance(raw, dict): + return None + profiles = raw.get("profiles") + if not isinstance(profiles, dict): + return None + profile_name = os.environ.get("LANGSMITH_PROFILE") + if not profile_name: + current_profile = raw.get("current_profile") + if isinstance(current_profile, str) and current_profile: + profile_name = current_profile + elif "default" in profiles: + profile_name = "default" + if not profile_name or not isinstance(profiles.get(profile_name), dict): + return None + return ProfileState(path, cast(ProfileConfigFile, raw), profile_name) + + +def _profile_from_state(state: ProfileState) -> Optional[ProfileConfig]: + profiles = state.config.get("profiles") or {} + profile = profiles.get(state.profile_name) + if not isinstance(profile, dict): + return None + return cast(ProfileConfig, profile) + + +def load_profile_client_config() -> ProfileClientConfig: + state = _load_profile_state() + if state is None: + return ProfileClientConfig() + profile = _profile_from_state(state) + if profile is None: + return ProfileClientConfig() + oauth = profile.get("oauth") or {} + return ProfileClientConfig( + api_url=profile.get("api_url"), + api_key=trim_auth_value(profile.get("api_key")), + workspace_id=profile.get("workspace_id"), + oauth_access_token=trim_auth_value(oauth.get("access_token")), + oauth_refresh_token=trim_auth_value(oauth.get("refresh_token")), + oauth_expires_at=oauth.get("expires_at"), + profile_state=state, + ) + + +def _normalize_profile_api_url(api_url: str) -> str: + while api_url.endswith("/"): + api_url = api_url[:-1] + suffix = "/api/v1" + if api_url.endswith(suffix): + return api_url[: -len(suffix)] + return api_url + + +def _parse_profile_expires_at(expires_at: str) -> Optional[datetime.datetime]: + try: + parsed = datetime.datetime.fromisoformat(expires_at.replace("Z", "+00:00")) + except ValueError: + return None + if parsed.tzinfo is None: + parsed = parsed.replace(tzinfo=datetime.timezone.utc) + return parsed + + +def should_refresh_profile_token(profile: ProfileConfig) -> bool: + oauth = profile.get("oauth") or {} + if not oauth.get("refresh_token"): + return False + if not oauth.get("access_token"): + return True + expires_at = oauth.get("expires_at") + if not expires_at: + return False + parsed = _parse_profile_expires_at(expires_at) + if parsed is None: + return False + return ( + parsed <= datetime.datetime.now(datetime.timezone.utc) + _TOKEN_REFRESH_LEEWAY + ) + + +def _refresh_profile_oauth_token( + api_url: Optional[str], refresh_token: str +) -> Optional[dict[str, Any]]: + refresh_url = _normalize_profile_api_url( + api_url or "https://api.smith.langchain.com" + ) + try: + response = requests.post( + f"{refresh_url}/oauth/token", + data={ + "grant_type": "refresh_token", + "client_id": _OAUTH_CLIENT_ID, + "refresh_token": refresh_token, + }, + headers={"Content-Type": "application/x-www-form-urlencoded"}, + timeout=_TOKEN_REFRESH_TIMEOUT, + ) + except requests.RequestException: + return None + if response.status_code < 200 or response.status_code >= 300: + return None + try: + token = response.json() + except ValueError: + return None + if not isinstance(token, dict) or not token.get("access_token"): + return None + return token + + +def _apply_profile_token_response( + profile: ProfileConfig, token: Mapping[str, Any] +) -> None: + oauth = profile.setdefault("oauth", {}) + access_token = token.get("access_token") + if isinstance(access_token, str) and access_token: + oauth["access_token"] = access_token + refresh_token = token.get("refresh_token") + if isinstance(refresh_token, str) and refresh_token: + oauth["refresh_token"] = refresh_token + expires_in = token.get("expires_in") + if isinstance(expires_in, (int, float)) and expires_in > 0: + expires_at = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta( + seconds=expires_in + ) + oauth["expires_at"] = expires_at.isoformat().replace("+00:00", "Z") + + +def _save_profile_config(path: Path, config: ProfileConfigFile) -> None: + try: + path.parent.mkdir(mode=0o700, parents=True, exist_ok=True) + temp_path = path.with_name(f"{path.name}.tmp") + temp_path.write_text(json.dumps(config, indent=2) + "\n", encoding="utf-8") + os.chmod(temp_path, 0o600) + os.replace(temp_path, path) + os.chmod(path, 0o600) + except OSError: + return + + +class ProfileAuth: + def __init__( + self, + config: ProfileClientConfig, + *, + api_key_header: str, + ) -> None: + self._state = config.profile_state + self._api_key_header = api_key_header + self._lock = threading.Lock() + self._managed_auth_headers: set[tuple[str, str]] = set() + self._remember_auth_headers(self._auth_headers(refresh=False)) + + @property + def has_auth(self) -> bool: + profile = self._profile() + if profile is None: + return False + oauth = profile.get("oauth") or {} + return bool( + trim_auth_value(oauth.get("access_token")) + or trim_auth_value(oauth.get("refresh_token")) + or trim_auth_value(profile.get("api_key")) + ) + + @property + def oauth_access_token(self) -> Optional[str]: + profile = self._profile() + if profile is None: + return None + return trim_auth_value((profile.get("oauth") or {}).get("access_token")) + + def needs_refresh(self) -> bool: + profile = self._profile() + return profile is not None and should_refresh_profile_token(profile) + + def current_auth_headers(self) -> dict[str, str]: + headers = self._auth_headers(refresh=False) + self._remember_auth_headers(headers) + return headers + + def get_auth_headers(self) -> dict[str, str]: + headers = self._auth_headers(refresh=True) + self._remember_auth_headers(headers) + return headers + + def prepare_request_headers(self, headers: Mapping[str, str]) -> dict[str, str]: + """Replace stale profile-managed auth while preserving explicit auth.""" + request_headers = dict(headers) + for key, value in list(request_headers.items()): + if self._is_profile_auth_header(key, value): + del request_headers[key] + if not self._has_auth_header(request_headers): + request_headers.update(self.current_auth_headers()) + return request_headers + + def _profile(self) -> Optional[ProfileConfig]: + if self._state is None: + return None + return _profile_from_state(self._state) + + def _auth_headers(self, *, refresh: bool) -> dict[str, str]: + profile = self._profile() + if profile is None: + return {} + if refresh and should_refresh_profile_token(profile): + with self._lock: + profile = self._profile() + if profile is not None and should_refresh_profile_token(profile): + self._refresh(profile) + return self._headers_from_profile(profile) + + def _refresh(self, profile: ProfileConfig) -> None: + refresh_token = trim_auth_value( + (profile.get("oauth") or {}).get("refresh_token") + ) + if refresh_token is None or self._state is None: + return + api_url = profile.get("api_url") + token = _refresh_profile_oauth_token(api_url, refresh_token) + if token is None: + return + _apply_profile_token_response(profile, token) + profiles = self._state.config.get("profiles") or {} + profiles[self._state.profile_name] = profile + self._state.config["profiles"] = profiles + _save_profile_config(self._state.path, self._state.config) + + def _headers_from_profile(self, profile: Optional[ProfileConfig]) -> dict[str, str]: + if profile is None: + return {} + oauth_access_token = trim_auth_value( + (profile.get("oauth") or {}).get("access_token") + ) + if oauth_access_token: + return {"Authorization": f"Bearer {oauth_access_token}"} + api_key = trim_auth_value(profile.get("api_key")) + if api_key: + return {self._api_key_header: api_key} + return {} + + def _remember_auth_headers(self, headers: Mapping[str, str]) -> None: + for name, value in headers.items(): + if self._is_auth_header_name(name) and value: + self._managed_auth_headers.add((name.lower(), value)) + + def _is_profile_auth_header(self, name: str, value: str) -> bool: + return (name.lower(), value) in self._managed_auth_headers + + def _has_auth_header(self, headers: Mapping[str, str]) -> bool: + return any( + self._is_auth_header_name(name) and bool(value) + for name, value in headers.items() + ) + + def _is_auth_header_name(self, name: str) -> bool: + return name.lower() in {"authorization", self._api_key_header.lower()} diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_serde.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_serde.py new file mode 100644 index 0000000000000000000000000000000000000000..586822f2fe52514ee953eae40dc215cd3015d5d0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_serde.py @@ -0,0 +1,164 @@ +from __future__ import annotations + +import base64 +import collections +import datetime +import decimal +import ipaddress +import json +import logging +import pathlib +import re +import uuid +from typing import Any + +from langsmith._internal import _orjson + +try: + from zoneinfo import ZoneInfo # type: ignore[import-not-found] +except ImportError: + + class ZoneInfo: # type: ignore[no-redef] + """Introduced in python 3.9.""" + + +logger = logging.getLogger(__name__) + + +def _simple_default(obj): + try: + # Only need to handle types that orjson doesn't serialize by default + # https://github.com/ijl/orjson#serialize + if isinstance(obj, datetime.datetime): + return obj.isoformat() + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, BaseException): + return {"error": type(obj).__name__, "message": str(obj)} + elif isinstance(obj, (set, frozenset, collections.deque)): + return list(obj) + elif isinstance(obj, (datetime.timezone, ZoneInfo)): + return obj.tzname(None) + elif isinstance(obj, datetime.timedelta): + return obj.total_seconds() + elif isinstance(obj, decimal.Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + else: + return float(obj) + elif isinstance( + obj, + ( + ipaddress.IPv4Address, + ipaddress.IPv4Interface, + ipaddress.IPv4Network, + ipaddress.IPv6Address, + ipaddress.IPv6Interface, + ipaddress.IPv6Network, + pathlib.Path, + ), + ): + return str(obj) + elif isinstance(obj, re.Pattern): + return obj.pattern + elif isinstance(obj, (bytes, bytearray)): + return base64.b64encode(obj).decode() + return str(obj) + except BaseException as e: + logger.debug(f"Failed to serialize {type(obj)} to JSON: {e}") + return str(obj) + + +_serialization_methods: list[tuple[str, dict[str, Any]]] = [ + ( + "model_dump", + {"exclude_none": True, "mode": "json"}, + ), # Pydantic V2 with non-serializable fields + ("model_dump", {"exclude_none": True}), # Pydantic V2 without json mode + ("dict", {}), # Pydantic V1 with non-serializable field + ("to_dict", {}), # dataclasses-json +] + + +# IMPORTANT: This function is used from Rust code in `langsmith-pyo3` serialization, +# in order to handle serializing these tricky Python types *from Rust*. +# Do not cause this function to become inaccessible (e.g. by deleting +# or renaming it) without also fixing the corresponding Rust code found in: +# rust/crates/langsmith-pyo3/src/serialization/mod.rs +def _serialize_json(obj: Any) -> Any: + try: + if isinstance(obj, (set, tuple)): + if hasattr(obj, "_asdict") and callable(obj._asdict): + # NamedTuple + return obj._asdict() + return list(obj) + + for attr, kwargs in _serialization_methods: + if ( + hasattr(obj, attr) + and callable(getattr(obj, attr)) + and not isinstance(obj, type) + ): + try: + method = getattr(obj, attr) + response = method(**kwargs) + if not isinstance(response, dict): + return str(response) + return response + except Exception as e: + logger.debug( + f"Failed to use {attr} to serialize {type(obj)} to" + f" JSON: {repr(e)}" + ) + pass + return _simple_default(obj) + except BaseException as e: + logger.debug(f"Failed to serialize {type(obj)} to JSON: {e}") + return str(obj) + + +def _elide_surrogates(s: bytes) -> bytes: + pattern = re.compile(rb"\\ud[89a-f][0-9a-f]{2}", re.IGNORECASE) + result = pattern.sub(b"", s) + return result + + +def dumps_json(obj: Any) -> bytes: + """Serialize an object to a JSON formatted string. + + Parameters + ---------- + obj : Any + The object to serialize. + default : Callable[[Any], Any] or None, default=None + The default function to use for serialization. + + Returns: + ------- + str + The JSON formatted string. + """ + try: + return _orjson.dumps( + obj, + default=_serialize_json, + option=_orjson.OPT_SERIALIZE_NUMPY + | _orjson.OPT_SERIALIZE_DATACLASS + | _orjson.OPT_SERIALIZE_UUID + | _orjson.OPT_NON_STR_KEYS, + ) + except TypeError as e: + # Usually caused by UTF surrogate characters + logger.debug(f"Orjson serialization failed: {repr(e)}. Falling back to json.") + result = json.dumps( + obj, + default=_serialize_json, + ensure_ascii=True, + ).encode("utf-8") + try: + result = _orjson.dumps( + _orjson.loads(result.decode("utf-8", errors="surrogateescape")) + ) + except _orjson.JSONDecodeError: + result = _elide_surrogates(result) + return result diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/_uuid.py b/python/user_packages/Python313/site-packages/langsmith/_internal/_uuid.py new file mode 100644 index 0000000000000000000000000000000000000000..7f5cc205764cb82ee692c5d8bf3bcbe15bc5b90f --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/_uuid.py @@ -0,0 +1,155 @@ +"""UUID helpers backed by uuid-utils.""" + +from __future__ import annotations + +import time +import uuid +import warnings +from typing import Final + +import xxhash +from uuid_utils.compat import uuid7 as _uuid_utils_uuid7 + +_NANOS_PER_SECOND: Final = 1_000_000_000 + + +def _to_timestamp_and_nanos(nanoseconds: int) -> tuple[int, int]: + """Split a nanosecond timestamp into seconds and remaining nanoseconds.""" + seconds, nanos = divmod(nanoseconds, _NANOS_PER_SECOND) + return seconds, nanos + + +def uuid7(nanoseconds: int | None = None) -> uuid.UUID: + """Generate a UUID from a Unix timestamp in nanoseconds and random bits. + + UUIDv7 objects feature monotonicity within a millisecond. + + Args: + nanoseconds: Optional ns timestamp. If not provided, uses current time. + """ + # --- 48 --- -- 4 -- --- 12 --- -- 2 -- --- 30 --- - 32 - + # unix_ts_ms | version | counter_hi | variant | counter_lo | random + # + # 'counter = counter_hi | counter_lo' is a 42-bit counter constructed + # with Method 1 of RFC 9562, ยง6.2, and its MSB is set to 0. + # + # 'random' is a 32-bit random value regenerated for every new UUID. + # + # If multiple UUIDs are generated within the same millisecond, the LSB + # of 'counter' is incremented by 1. When overflowing, the timestamp is + # advanced and the counter is reset to a random 42-bit integer with MSB + # set to 0. + + # For now, just delegate to the uuid_utils implementation + if nanoseconds is None: + return _uuid_utils_uuid7() + seconds, nanos = _to_timestamp_and_nanos(nanoseconds) + return _uuid_utils_uuid7(timestamp=seconds, nanos=nanos) + + +def is_uuid_v7(uuid_obj: uuid.UUID) -> bool: + """Check if a UUID is version 7. + + Args: + uuid_obj: The UUID to check. + + Returns: + True if the UUID is version 7, False otherwise. + """ + return uuid_obj.version == 7 + + +_UUID_V7_WARNING_EMITTED = False + + +def warn_if_not_uuid_v7(uuid_obj: uuid.UUID, id_type: str) -> None: + """Warn if a UUID is not version 7. + + Args: + uuid_obj: The UUID to check. + id_type: The type of ID (e.g., "run_id", "trace_id") for the warning message. + """ + global _UUID_V7_WARNING_EMITTED + if not is_uuid_v7(uuid_obj) and not _UUID_V7_WARNING_EMITTED: + _UUID_V7_WARNING_EMITTED = True + warnings.warn( + ( + "LangSmith now uses UUID v7 for run and trace identifiers. " + "This warning appears when passing custom IDs. " + "Please use: from langsmith import uuid7\n" + " id = uuid7()\n" + "Future versions will require UUID v7." + ), + UserWarning, + stacklevel=3, + ) + + +def uuid7_deterministic(original_id: uuid.UUID, key: str) -> uuid.UUID: + """Generate a deterministic UUID7 derived from an original UUID and a key. + + This function creates a new UUID that: + - Preserves the timestamp from the original UUID if it's UUID v7 + - Uses current time if the original is not UUID v7 + - Uses deterministic bits derived from hashing the original + key with XXH3-128 + - Is valid UUID v7 format + + This is used for creating replica IDs that maintain time-ordering properties + while being deterministic across distributed systems. + + Args: + original_id: The source UUID (ideally UUID v7 to preserve timestamp). + key: A string key used for deterministic derivation (e.g., project name). + + Returns: + A new UUID v7 with preserved timestamp (if original is v7) and + deterministic random bits. + + Example: + >>> original = uuid7() + >>> replica_id = uuid7_deterministic(original, "replica-project") + >>> # Same inputs always produce same output + >>> assert uuid7_deterministic(original, "replica-project") == replica_id + """ + # Generate deterministic bytes from XXH3-128 hash of original + key + hash_input = f"{original_id}:{key}".encode() + h = xxhash.xxh3_128(hash_input).digest() + + # Build new UUID7: + # UUID7 structure (RFC 9562): + # [0-5] 48 bits: unix_ts_ms (timestamp in milliseconds) + # [6] 4 bits: version (0111 = 7) + 4 bits rand_a + # [7] 8 bits: rand_a (continued) + # [8] 2 bits: variant (10) + 6 bits rand_b + # [9-15] 56 bits: rand_b (continued) + + b = bytearray(16) + + # Check if original is UUID v7 - if so, preserve its timestamp + # If not, use current time to ensure the derived UUID has a valid timestamp + if is_uuid_v7(original_id): + # Preserve timestamp from original UUID7 (bytes 0-5) + b[0:6] = original_id.bytes[0:6] + else: + # Generate fresh timestamp for non-UUID7 inputs + # This matches CPython 3.14's uuid7() implementation: + # timestamp_ms = time.time_ns() // 1_000_000 + # Then convert to big-endian bytes + timestamp_ms = time.time_ns() // 1_000_000 + # Mask to 48 bits and convert to big-endian bytes + unix_ts_ms = timestamp_ms & 0xFFFF_FFFF_FFFF + b[0:6] = unix_ts_ms.to_bytes(6, "big") + + # Set version 7 (0111) in high nibble + 4 bits from hash + b[6] = 0x70 | (h[0] & 0x0F) + + # rand_a continued (8 bits from hash) + b[7] = h[1] + + # Set variant (10) in high 2 bits + 6 bits from hash + b[8] = 0x80 | (h[2] & 0x3F) + + # rand_b (56 bits = 7 bytes from hash) + b[9:16] = h[3:10] + + return uuid.UUID(bytes=bytes(b)) diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/otel/__pycache__/_otel_client.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/__pycache__/_otel_client.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3928e9e5f799abb6f98bdd3c1f574cf29a203720 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/__pycache__/_otel_client.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/otel/__pycache__/_otel_exporter.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/__pycache__/_otel_exporter.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc043a768f1dab928ea46d2a843a1524f9dbf427 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/__pycache__/_otel_exporter.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/otel/_otel_client.py b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/_otel_client.py new file mode 100644 index 0000000000000000000000000000000000000000..0ec67b1a8f45cae2000cb2d5f5825d4a3de742e0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/_otel_client.py @@ -0,0 +1,115 @@ +"""Client configuration for OpenTelemetry integration with LangSmith.""" + +import os +import warnings +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + try: + from opentelemetry.sdk.trace import TracerProvider # type: ignore[import] + except ImportError: + TracerProvider = object # type: ignore[assignment, misc] + +from langsmith import utils as ls_utils + + +def _import_otel_client(): + """Dynamically import OTEL client modules when needed.""" + try: + from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( # type: ignore[import] + OTLPSpanExporter, + ) + from opentelemetry.sdk.resources import ( # type: ignore[import] + SERVICE_NAME, + Resource, + ) + from opentelemetry.sdk.trace import TracerProvider # type: ignore[import] + from opentelemetry.sdk.trace.export import ( # type: ignore[import] + BatchSpanProcessor, + ) + + return ( + OTLPSpanExporter, + SERVICE_NAME, + Resource, + TracerProvider, + BatchSpanProcessor, + ) + except ImportError as e: + warnings.warn( + f"OTEL_ENABLED is set but OpenTelemetry packages are not installed: {e}" + ) + return None + + +def get_otlp_tracer_provider() -> "TracerProvider": + """Get the OTLP tracer provider for LangSmith. + + This function creates a tracer provider that exports spans using the OTLP protocol + with LangSmith-specific defaults: + + - OTEL_EXPORTER_OTLP_ENDPOINT: https://api.smith.langchain.com/otel + - OTEL_EXPORTER_OTLP_HEADERS: Contains x-api-key from LangSmith API key and + Langsmith-Project header if project is configured + + These defaults can be overridden by setting the environment variables before + calling this function. Values are passed directly to the exporter constructor + rather than written to os.environ. + + Returns: + TracerProvider: The OTLP tracer provider. + """ + # Import OTEL modules dynamically + otel_imports = _import_otel_client() + if otel_imports is None: + raise ImportError( + "OpenTelemetry packages are required to use this function. " + "Please install with `pip install langsmith[otel]`" + ) + ( + OTLPSpanExporter, + SERVICE_NAME, + Resource, + TracerProvider, + BatchSpanProcessor, + ) = otel_imports + + endpoint = os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT") + if not endpoint: + ls_endpoint = ls_utils.get_api_url(None) + endpoint = f"{ls_endpoint}/otel" + + # Configure headers with API key and project if available. + # Build a dict because OTLPSpanExporter expects a mapping, not a string. + headers_env = os.environ.get("OTEL_EXPORTER_OTLP_HEADERS") + if headers_env: + headers = { + k.strip(): v.strip() + for k, v in ( + pair.split("=", 1) for pair in headers_env.split(",") if "=" in pair + ) + } + else: + api_key = ls_utils.get_api_key(None) or "" + headers = {"x-api-key": api_key} + + project = ls_utils.get_tracer_project() + if project: + headers["Langsmith-Project"] = project + + service_name = os.environ.get("OTEL_SERVICE_NAME", "langsmith") + resource = Resource( + attributes={ + SERVICE_NAME: service_name, + # Marker to identify LangSmith's internal provider + "langsmith.internal_provider": True, + } + ) + + tracer_provider = TracerProvider(resource=resource) + + otlp_exporter = OTLPSpanExporter(endpoint=endpoint, headers=headers) + span_processor = BatchSpanProcessor(otlp_exporter) + tracer_provider.add_span_processor(span_processor) + + return tracer_provider diff --git a/python/user_packages/Python313/site-packages/langsmith/_internal/otel/_otel_exporter.py b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/_otel_exporter.py new file mode 100644 index 0000000000000000000000000000000000000000..ac836c5270b9fdff4ca823aa4f9c2026e53231b4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/_internal/otel/_otel_exporter.py @@ -0,0 +1,866 @@ +"""OpenTelemetry exporter for LangSmith runs.""" + +from __future__ import annotations + +import datetime +import logging +import time +import uuid +import warnings +from typing import TYPE_CHECKING, Any, Optional + +if TYPE_CHECKING: + try: + from opentelemetry.context.context import Context # type: ignore[import] + from opentelemetry.trace import Span # type: ignore[import] + except ImportError: + Context = Any # type: ignore[assignment, misc] + Span = Any # type: ignore[assignment, misc] + +from langsmith import utils as ls_utils +from langsmith._internal import _orjson +from langsmith._internal._operations import ( + SerializedRunOperation, +) +from langsmith._internal._otel_utils import ( + get_otel_span_id_from_uuid, + get_otel_trace_id_from_uuid, +) + + +def _import_otel_exporter(): + """Dynamically import OTEL exporter modules when needed.""" + try: + from opentelemetry import trace # type: ignore[import] + from opentelemetry.context.context import Context # type: ignore[import] + from opentelemetry.trace import ( # type: ignore[import] + NonRecordingSpan, + Span, + SpanContext, + TraceFlags, + TraceState, + set_span_in_context, + ) + + return ( + trace, + Context, + NonRecordingSpan, + Span, + SpanContext, + TraceFlags, + TraceState, + set_span_in_context, + ) + except ImportError as e: + warnings.warn( + f"OTEL_ENABLED is set but OpenTelemetry packages are not installed: {e}" + ) + return None + + +logger = logging.getLogger(__name__) + +# OpenTelemetry GenAI semconv attribute names +GEN_AI_OPERATION_NAME = "gen_ai.operation.name" +GEN_AI_SYSTEM = "gen_ai.system" +GEN_AI_REQUEST_MODEL = "gen_ai.request.model" +GEN_AI_RESPONSE_MODEL = "gen_ai.response.model" +GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens" +GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens" +GEN_AI_USAGE_TOTAL_TOKENS = "gen_ai.usage.total_tokens" +GEN_AI_REQUEST_MAX_TOKENS = "gen_ai.request.max_tokens" +GEN_AI_REQUEST_TEMPERATURE = "gen_ai.request.temperature" +GEN_AI_REQUEST_TOP_P = "gen_ai.request.top_p" +GEN_AI_REQUEST_FREQUENCY_PENALTY = "gen_ai.request.frequency_penalty" +GEN_AI_REQUEST_PRESENCE_PENALTY = "gen_ai.request.presence_penalty" +GEN_AI_RESPONSE_FINISH_REASONS = "gen_ai.response.finish_reasons" +GENAI_PROMPT = "gen_ai.prompt" +GENAI_COMPLETION = "gen_ai.completion" + +GEN_AI_REQUEST_EXTRA_QUERY = "gen_ai.request.extra_query" +GEN_AI_REQUEST_EXTRA_BODY = "gen_ai.request.extra_body" +GEN_AI_SERIALIZED_NAME = "gen_ai.serialized.name" +GEN_AI_SERIALIZED_SIGNATURE = "gen_ai.serialized.signature" +GEN_AI_SERIALIZED_DOC = "gen_ai.serialized.doc" +GEN_AI_RESPONSE_ID = "gen_ai.response.id" +GEN_AI_RESPONSE_SERVICE_TIER = "gen_ai.response.service_tier" +GEN_AI_RESPONSE_SYSTEM_FINGERPRINT = "gen_ai.response.system_fingerprint" +GEN_AI_USAGE_INPUT_TOKEN_DETAILS = "gen_ai.usage.input_token_details" +GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS = "gen_ai.usage.output_token_details" + + +def _otel_safe_attribute_value(value: Any) -> Optional[Any]: + """Convert a value to an OTel-valid attribute type. + + OTel only accepts bool, str, bytes, int, float, or sequences of those. + Dicts and lists are JSON-serialized to a string. + """ + if value is None: + return None + if isinstance(value, (bool, bytes, int, float, str)): + return value + if isinstance(value, (dict, list)): + try: + return _orjson.dumps(value).decode("utf-8") + except (TypeError, ValueError): + return str(value) + return str(value) + + +# LangSmith custom attributes +LANGSMITH_SESSION_ID = "langsmith.trace.session_id" +LANGSMITH_SESSION_NAME = "langsmith.trace.session_name" +LANGSMITH_RUN_TYPE = "langsmith.span.kind" +LANGSMITH_NAME = "langsmith.trace.name" +LANGSMITH_METADATA = "langsmith.metadata" +LANGSMITH_TAGS = "langsmith.span.tags" +LANGSMITH_RUNTIME = "langsmith.span.runtime" +LANGSMITH_REQUEST_STREAMING = "langsmith.request.streaming" +LANGSMITH_REQUEST_HEADERS = "langsmith.request.headers" + +# GenAI event names +GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message" +GEN_AI_USER_MESSAGE = "gen_ai.user.message" +GEN_AI_ASSISTANT_MESSAGE = "gen_ai.assistant.message" +GEN_AI_CHOICE = "gen_ai.choice" + +WELL_KNOWN_OPERATION_NAMES = { + "llm": "chat", + "tool": "execute_tool", + "retriever": "embeddings", + "embedding": "embeddings", + "prompt": "chat", +} + + +def _get_operation_name(run_type: str) -> str: + return WELL_KNOWN_OPERATION_NAMES.get(run_type, run_type) + + +class OTELExporter: + __slots__ = [ + "_tracer", + "_span_info", + "_otel_available", + "_trace", + "_span_ttl_seconds", + "_last_cleanup", + ] + """OpenTelemetry exporter for LangSmith runs.""" + + def __init__(self, tracer_provider=None, span_ttl_seconds=None): + """Initialize the OTEL exporter. + + Args: + tracer_provider: Optional tracer provider to use. If not provided, + the global tracer provider will be used. + span_ttl_seconds: TTL for incomplete traces in seconds. If None, + uses LANGSMITH_OTEL_SPAN_TTL_SECONDS env var (default: 3600s) + """ + # Set defaults from environment variables if not provided + if span_ttl_seconds is None: + span_ttl_seconds = int( + ls_utils.get_env_var("OTEL_SPAN_TTL_SECONDS", default="3600") + ) + otel_imports = _import_otel_exporter() + if otel_imports is None: + self._tracer = None + self._span_info = {} + self._otel_available = False + self._trace = None + self._span_ttl_seconds = span_ttl_seconds + self._last_cleanup = 0.0 + else: + ( + trace, + Context, + NonRecordingSpan, + Span, + SpanContext, + TraceFlags, + TraceState, + set_span_in_context, + ) = otel_imports + + self._tracer = trace.get_tracer( + "langsmith", tracer_provider=tracer_provider + ) + self._span_info = {} + self._otel_available = True + self._trace = trace + self._span_ttl_seconds = span_ttl_seconds + self._last_cleanup = 0.0 + + def export_batch( + self, + operations: list[SerializedRunOperation], + otel_context_map: dict[uuid.UUID, Optional[Context]], + ) -> None: + """Export a batch of serialized run operations to OTEL. + + Args: + operations: List of serialized run operations to export. + """ + # Proactive cleanup of expired and excess spans before new operations + self._cleanup_stale_spans() + + for op in operations: + try: + run_info = self._deserialize_run_info(op) + if not run_info: + continue + if op.operation == "post": + span = self._create_span_for_run( + op, run_info, otel_context_map.get(op.id) + ) + if span: + self._span_info[op.id] = { + "span": span, + "created_at": time.time(), + } + else: + self._update_span_for_run(op, run_info) + except Exception as e: + logger.exception(f"Error processing operation {op.id}: {e}") + + def _deserialize_run_info(self, op: SerializedRunOperation) -> Optional[dict]: + """Deserialize the run info from the operation. + + Args: + op: The serialized run operation. + + Returns: + The deserialized run info as a dictionary, or None if deserialization + failed. + """ + try: + return op.deserialize_run_info() + except Exception as e: + logger.exception(f"Failed to deserialize run info for {op.id}: {e}") + return None + + def _create_span_for_run( + self, + op: SerializedRunOperation, + run_info: dict, + otel_context: Optional[Context] = None, + ) -> Optional[Span]: + """Create an OpenTelemetry span for a run operation. + + Args: + op: The serialized run operation. + run_info: The deserialized run info. + parent_span: Optional parent span. + + Returns: + The created span, or None if creation failed. + """ + try: + start_time = run_info.get("start_time") + start_time_utc_nano = self._as_utc_nano(start_time) + + end_time = run_info.get("end_time") + end_time_utc_nano = self._as_utc_nano(end_time) + + # Create deterministic trace and span IDs to match user OpenTelemetry spans + trace_id_int = get_otel_trace_id_from_uuid(op.trace_id) + span_id_int = get_otel_span_id_from_uuid(op.id) + + # Get OTEL imports for this operation + otel_imports = _import_otel_exporter() + if otel_imports is None: + return None + ( + trace, + Context, + NonRecordingSpan, + Span, + SpanContext, + TraceFlags, + TraceState, + set_span_in_context, + ) = otel_imports + + # Create SpanContext with deterministic IDs + span_context = SpanContext( + trace_id=trace_id_int, + span_id=span_id_int, + is_remote=False, + trace_flags=TraceFlags(TraceFlags.SAMPLED), + trace_state=TraceState(), + ) + + # Create NonRecordingSpan for context setting + non_recording_span = NonRecordingSpan(span_context) + deterministic_context = set_span_in_context(non_recording_span) + + # Start the span with appropriate context + parent_run_id = run_info.get("parent_run_id") + if ( + parent_run_id is not None + and uuid.UUID(parent_run_id) in self._span_info + ): + # Use the parent span context + parent_span = self._span_info[uuid.UUID(parent_run_id)]["span"] + span = self._tracer.start_span( + run_info.get("name"), + context=set_span_in_context(parent_span), + start_time=start_time_utc_nano, + ) + else: + # For root spans, check if there's an existing OpenTelemetry context + # If so, inherit from it; otherwise use our deterministic context + current_context = ( + otel_context if otel_context else deterministic_context + ) + span = self._tracer.start_span( + run_info.get("name"), + context=current_context, + start_time=start_time_utc_nano, + ) + + # Set all attributes + self._set_span_attributes(span, run_info, op) + + # Set status based on error + if run_info.get("error"): + span.set_status(trace.StatusCode.ERROR) + span.record_exception(Exception(run_info.get("error"))) + else: + span.set_status(trace.StatusCode.OK) + + # End the span if end_time is present + end_time = run_info.get("end_time") + if end_time: + end_time_utc_nano = self._as_utc_nano(end_time) + if end_time_utc_nano: + span.end(end_time=end_time_utc_nano) + else: + span.end() + + return span + except Exception as e: + logger.exception(f"Failed to create span for run {op.id}: {e}") + return None + + def _update_span_for_run(self, op: SerializedRunOperation, run_info: dict) -> None: + """Update an OpenTelemetry span for a run operation. + + Args: + op: The serialized run operation. + run_info: The deserialized run info. + """ + try: + # Get the span for this run + if op.id not in self._span_info: + logger.debug(f"No span found for run {op.id} during update") + return + + span = self._span_info[op.id]["span"] + + # Update attributes + self._set_span_attributes(span, run_info, op) + # Update status based on error + if run_info.get("error"): + span.set_status(self._trace.StatusCode.ERROR) + span.record_exception(Exception(run_info.get("error"))) + else: + span.set_status(self._trace.StatusCode.OK) + + # End the span if end_time is present + end_time = run_info.get("end_time") + if end_time: + end_time_utc_nano = self._as_utc_nano(end_time) + if end_time_utc_nano: + span.end(end_time=end_time_utc_nano) + else: + span.end() + # Remove the span info from our dictionary + del self._span_info[op.id] + logger.debug(f"Completed span, remaining spans: {len(self._span_info)}") + else: + # Span exists but no end_time - this is normal for ongoing operations + logger.debug("Updated span (no end_time yet)") + + except Exception as e: + logger.exception(f"Failed to update span for run {op.id}: {e}") + + def _cleanup_stale_spans(self) -> None: + """Clean up spans older than TTL threshold.""" + if not self._span_info: + return + + current_time = time.time() + + # Only run cleanup every 10 seconds to reduce overhead + if current_time - self._last_cleanup < 10.0: + return + + self._last_cleanup = current_time + cutoff_time = current_time - self._span_ttl_seconds + + # Remove spans older than TTL in one pass + stale_span_ids = [ + span_id + for span_id, info in self._span_info.items() + if info["created_at"] < cutoff_time + ] + + if stale_span_ids: + logger.info( + f" LangSmith OTEL Cleanup: Removing {len(stale_span_ids)} stale spans" + ) + + for span_id in stale_span_ids: + self._remove_span(span_id) + + def _remove_span(self, span_id: uuid.UUID) -> None: + """Remove a single span and clean up resources. + + Note: + We call `span.end()` here because spans in `_span_info` are orphaned - + they never received their patch operation and will never naturally complete. + + Ending them gracefully is better than leaving them open indefinitely. + """ + if span_id not in self._span_info: + return + + try: + # End the orphaned span gracefully + span = self._span_info[span_id]["span"] + + # Check if span is still active before ending it + if ( + hasattr(span, "end") + and hasattr(span, "is_recording") + and span.is_recording() + ): + span.end() + logger.debug(f"Ended orphaned span {span_id}") + elif hasattr(span, "end"): + # Span already ended, just log it + logger.debug(f"Span {span_id} already ended, skipping end() call") + + # Remove from tracking regardless + del self._span_info[span_id] + + except Exception as e: + logger.debug(f"Error removing span {span_id}: {e}") + # Still try to remove from tracking even if ending failed + try: + del self._span_info[span_id] + except KeyError: + pass + + def _extract_model_name(self, run_info: dict) -> Optional[str]: + """Extract model name from run info. + + Args: + run_info: The run info. + + Returns: + The model name, or None if not found. + """ + # Try to get model name from metadata + if run_info.get("extra") and run_info["extra"].get("metadata"): + metadata = run_info["extra"]["metadata"] + + # First check for ls_model_name in metadata + if metadata.get("ls_model_name"): + return metadata["ls_model_name"] + + # Then check invocation_params for model info + if "invocation_params" in metadata: + invocation_params = metadata["invocation_params"] + # Check model first, then model_name + if invocation_params.get("model"): + return invocation_params["model"] + elif invocation_params.get("model_name"): + return invocation_params["model_name"] + + return None + + def _set_span_attributes( + self, + span: Span, + run_info: dict, + op: SerializedRunOperation, + ) -> None: + """Set attributes on the span. + + Args: + span: The span to set attributes on. + run_info: The deserialized run info. + op: The serialized run operation. + """ + # Set LangSmith-specific attributes + if run_info.get("run_type"): + span.set_attribute(LANGSMITH_RUN_TYPE, str(run_info.get("run_type"))) + + if run_info.get("name"): + span.set_attribute(LANGSMITH_NAME, str(run_info.get("name"))) + + if run_info.get("session_id"): + span.set_attribute(LANGSMITH_SESSION_ID, str(run_info.get("session_id"))) + if run_info.get("session_name"): + span.set_attribute( + LANGSMITH_SESSION_NAME, str(run_info.get("session_name")) + ) + + # Set GenAI attributes according to OTEL semantic conventions + # Set gen_ai.operation.name + if op.operation == "post": + operation_name = _get_operation_name(run_info.get("run_type", "chain")) + span.set_attribute(GEN_AI_OPERATION_NAME, operation_name) + + # Set gen_ai.system + self._set_gen_ai_system(span, run_info) + + # Set model name if available + model_name = self._extract_model_name(run_info) + if model_name: + span.set_attribute(GEN_AI_REQUEST_MODEL, model_name) + + # Set token usage information + if run_info.get("prompt_tokens") is not None: + prompt_tokens = run_info["prompt_tokens"] + span.set_attribute(GEN_AI_USAGE_INPUT_TOKENS, int(prompt_tokens)) + + if run_info.get("completion_tokens") is not None: + completion_tokens = run_info["completion_tokens"] + span.set_attribute(GEN_AI_USAGE_OUTPUT_TOKENS, int(completion_tokens)) + + if run_info.get("total_tokens") is not None: + total_tokens = run_info["total_tokens"] + span.set_attribute(GEN_AI_USAGE_TOTAL_TOKENS, int(total_tokens)) + + # Set other parameters from invocation_params + self._set_invocation_parameters(span, run_info) + + # Set metadata and tags if available + extra = run_info.get("extra", {}) + metadata = extra.get("metadata", {}) + for key, value in metadata.items(): + if value is not None: + safe = _otel_safe_attribute_value(value) + if safe is not None: + span.set_attribute(f"{LANGSMITH_METADATA}.{key}", safe) + + tags = run_info.get("tags") + if tags: + if isinstance(tags, list): + span.set_attribute(LANGSMITH_TAGS, ", ".join(tags)) + else: + span.set_attribute(LANGSMITH_TAGS, tags) + + # Support additional serialized attributes, if present + if run_info.get("serialized") and isinstance(run_info["serialized"], dict): + serialized = run_info["serialized"] + if "name" in serialized and serialized["name"] is not None: + span.set_attribute(GEN_AI_SERIALIZED_NAME, serialized["name"]) + if "signature" in serialized and serialized["signature"] is not None: + span.set_attribute(GEN_AI_SERIALIZED_SIGNATURE, serialized["signature"]) + if "doc" in serialized and serialized["doc"] is not None: + span.set_attribute(GEN_AI_SERIALIZED_DOC, serialized["doc"]) + + # Set inputs/outputs if available + self._set_io_attributes(span, op) + + def _set_gen_ai_system(self, span: Span, run_info: dict) -> None: + """Set the gen_ai.system attribute on the span based on the model provider. + + Args: + span: The span to set attributes on. + run_info: The deserialized run info. + """ + # Default to "langchain" if we can't determine the system + system = "langchain" + + # Extract model name to determine the system + model_name = self._extract_model_name(run_info) + if model_name: + model_lower = model_name.lower() + if "anthropic" in model_lower or model_lower.startswith("claude"): + system = "anthropic" + elif "bedrock" in model_lower: + system = "aws.bedrock" + elif "azure" in model_lower and "openai" in model_lower: + system = "az.ai.openai" + elif "azure" in model_lower and "inference" in model_lower: + system = "az.ai.inference" + elif "cohere" in model_lower: + system = "cohere" + elif "deepseek" in model_lower: + system = "deepseek" + elif "gemini" in model_lower: + system = "gemini" + elif "groq" in model_lower: + system = "groq" + elif "watson" in model_lower or "ibm" in model_lower: + system = "ibm.watsonx.ai" + elif "mistral" in model_lower: + system = "mistral_ai" + elif "gpt" in model_lower or "openai" in model_lower: + system = "openai" + elif "perplexity" in model_lower or "sonar" in model_lower: + system = "perplexity" + elif "vertex" in model_lower: + system = "vertex_ai" + elif "xai" in model_lower or "grok" in model_lower: + system = "xai" + elif "qwen" in model_lower: + system = "qwen" + + span.set_attribute(GEN_AI_SYSTEM, system) + setattr(span, "_gen_ai_system", system) + + def _set_invocation_parameters(self, span: Span, run_info: dict) -> None: + """Set invocation parameters on the span. + + Args: + span: The span to set attributes on. + run_info: The deserialized run info. + """ + if not (run_info.get("extra") and run_info["extra"].get("metadata")): + return + + metadata = run_info["extra"]["metadata"] + if "invocation_params" not in metadata: + return + + invocation_params = metadata["invocation_params"] + + # Set relevant invocation parameters + if "max_tokens" in invocation_params: + span.set_attribute( + GEN_AI_REQUEST_MAX_TOKENS, invocation_params["max_tokens"] + ) + + if "temperature" in invocation_params: + span.set_attribute( + GEN_AI_REQUEST_TEMPERATURE, invocation_params["temperature"] + ) + + if "top_p" in invocation_params: + span.set_attribute(GEN_AI_REQUEST_TOP_P, invocation_params["top_p"]) + + if "frequency_penalty" in invocation_params: + span.set_attribute( + GEN_AI_REQUEST_FREQUENCY_PENALTY, invocation_params["frequency_penalty"] + ) + + if "presence_penalty" in invocation_params: + span.set_attribute( + GEN_AI_REQUEST_PRESENCE_PENALTY, invocation_params["presence_penalty"] + ) + + def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: + """Set input/output attributes on the span. + + Args: + span: The span to set attributes on. + op: The serialized run operation. + """ + if op.inputs: + try: + inputs = _orjson.loads(op.inputs) + + if isinstance(inputs, dict): + if ( + "model" in inputs + and isinstance(inputs.get("messages"), list) + and inputs["model"] is not None + ): + span.set_attribute(GEN_AI_REQUEST_MODEL, inputs["model"]) + + # Set additional request attributes if available. + if "stream" in inputs and inputs["stream"] is not None: + span.set_attribute( + LANGSMITH_REQUEST_STREAMING, inputs["stream"] + ) + if ( + "extra_headers" in inputs + and inputs["extra_headers"] is not None + ): + span.set_attribute( + LANGSMITH_REQUEST_HEADERS, inputs["extra_headers"] + ) + if "extra_query" in inputs and inputs["extra_query"] is not None: + span.set_attribute( + GEN_AI_REQUEST_EXTRA_QUERY, inputs["extra_query"] + ) + if "extra_body" in inputs and inputs["extra_body"] is not None: + span.set_attribute( + GEN_AI_REQUEST_EXTRA_BODY, inputs["extra_body"] + ) + + span.set_attribute(GENAI_PROMPT, op.inputs) + + except Exception: + logger.debug( + "Failed to process inputs for run %s", op.id, exc_info=True + ) + + if op.outputs: + try: + outputs = _orjson.loads(op.outputs) + + # Extract token usage from outputs (for LLM runs) + token_usage = self.get_unified_run_tokens(outputs) + if token_usage: + span.set_attribute(GEN_AI_USAGE_INPUT_TOKENS, token_usage[0]) + span.set_attribute(GEN_AI_USAGE_OUTPUT_TOKENS, token_usage[1]) + span.set_attribute( + GEN_AI_USAGE_TOTAL_TOKENS, token_usage[0] + token_usage[1] + ) + + if "model" in outputs: + span.set_attribute(GEN_AI_RESPONSE_MODEL, str(outputs["model"])) + # Extract additional response attributes. + if isinstance(outputs, dict): + if "id" in outputs and outputs["id"] is not None: + span.set_attribute(GEN_AI_RESPONSE_ID, outputs["id"]) + if "choices" in outputs and isinstance(outputs["choices"], list): + finish_reasons = [] + for choice in outputs["choices"]: + if ( + "finish_reason" in choice + and choice["finish_reason"] is not None + ): + finish_reasons.append(str(choice["finish_reason"])) + if finish_reasons: + span.set_attribute( + GEN_AI_RESPONSE_FINISH_REASONS, + ", ".join(finish_reasons), + ) + if ( + "service_tier" in outputs + and outputs["service_tier"] is not None + ): + span.set_attribute( + GEN_AI_RESPONSE_SERVICE_TIER, outputs["service_tier"] + ) + if ( + "system_fingerprint" in outputs + and outputs["system_fingerprint"] is not None + ): + span.set_attribute( + GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, + outputs["system_fingerprint"], + ) + if "usage_metadata" in outputs and isinstance( + outputs["usage_metadata"], dict + ): + usage_metadata = outputs["usage_metadata"] + if ( + "input_token_details" in usage_metadata + and usage_metadata["input_token_details"] is not None + ): + input_token_details = str( + usage_metadata["input_token_details"] + ) + span.set_attribute( + GEN_AI_USAGE_INPUT_TOKEN_DETAILS, input_token_details + ) + if ( + "output_token_details" in usage_metadata + and usage_metadata["output_token_details"] is not None + ): + output_token_details = str( + usage_metadata["output_token_details"] + ) + span.set_attribute( + GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, output_token_details + ) + + span.set_attribute(GENAI_COMPLETION, op.outputs) + + except Exception: + logger.debug( + "Failed to process outputs for run %s", op.id, exc_info=True + ) + + def _as_utc_nano(self, timestamp: Optional[str]) -> Optional[int]: + if not timestamp: + return None + try: + dt = datetime.datetime.fromisoformat(timestamp) + return int(dt.astimezone(datetime.timezone.utc).timestamp() * 1_000_000_000) + except ValueError: + logger.exception(f"Failed to parse timestamp {timestamp}") + return None + + def get_unified_run_tokens( + self, outputs: Optional[dict] + ) -> Optional[tuple[int, int]]: + if not outputs: + return None + + # search in non-generations lists + if output := self._extract_unified_run_tokens(outputs.get("usage_metadata")): + return output + + # find if direct kwarg in outputs + keys = outputs.keys() + for key in keys: + haystack = outputs[key] + if not haystack or not isinstance(haystack, dict): + continue + + if output := self._extract_unified_run_tokens( + haystack.get("usage_metadata") + ): + return output + + if ( + haystack.get("lc") == 1 + and "kwargs" in haystack + and isinstance(haystack["kwargs"], dict) + and ( + output := self._extract_unified_run_tokens( + haystack["kwargs"].get("usage_metadata") + ) + ) + ): + return output + + # find in generations + generations = outputs.get("generations") or [] + if not isinstance(generations, list): + return None + if generations and not isinstance(generations[0], list): + generations = [generations] + + for generation in [x for xs in generations for x in xs]: + if ( + isinstance(generation, dict) + and "message" in generation + and isinstance(generation["message"], dict) + and "kwargs" in generation["message"] + and isinstance(generation["message"]["kwargs"], dict) + and ( + output := self._extract_unified_run_tokens( + generation["message"]["kwargs"].get("usage_metadata") + ) + ) + ): + return output + return None + + def _extract_unified_run_tokens( + self, outputs: Optional[Any] + ) -> Optional[tuple[int, int]]: + if not outputs or not isinstance(outputs, dict): + return None + + if "input_tokens" not in outputs or "output_tokens" not in outputs: + return None + + if not isinstance(outputs["input_tokens"], int) or not isinstance( + outputs["output_tokens"], int + ): + return None + + return outputs["input_tokens"], outputs["output_tokens"] diff --git a/python/user_packages/Python313/site-packages/langsmith/beta/__init__.py b/python/user_packages/Python313/site-packages/langsmith/beta/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f712c1adb3a25d5d6b1e951e82d93d4c1381002e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/beta/__init__.py @@ -0,0 +1,6 @@ +"""Beta functionality prone to change.""" + +from langsmith._internal._beta_decorator import warn_beta +from langsmith.beta._evals import compute_test_metrics, convert_runs_to_test + +__all__ = ["convert_runs_to_test", "compute_test_metrics", "warn_beta"] diff --git a/python/user_packages/Python313/site-packages/langsmith/beta/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/beta/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb8b222b00f52497752b26f27750e83192136d44 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/beta/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/beta/__pycache__/_evals.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/beta/__pycache__/_evals.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbad5fe0b4a12351aa97cc98d684b14b27cc4b83 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/beta/__pycache__/_evals.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/beta/_evals.py b/python/user_packages/Python313/site-packages/langsmith/beta/_evals.py new file mode 100644 index 0000000000000000000000000000000000000000..e26348026de9498d48786a4bd387b84d99fcefb7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/beta/_evals.py @@ -0,0 +1,243 @@ +"""Beta utility functions to assist in common eval workflows. + +These functions may change in the future. +""" + +import collections +import datetime +import itertools +import uuid +from collections.abc import Sequence +from typing import Optional, TypeVar + +import langsmith.run_trees as rt +import langsmith.schemas as ls_schemas +from langsmith import evaluation as ls_eval +from langsmith._internal._beta_decorator import warn_beta +from langsmith.client import Client + + +def _convert_ids(run_dict: dict, id_map: dict) -> dict: + """Convert the IDs in the run dictionary using the provided ID map. + + Parameters: + - run_dict: The dictionary representing a run. + - id_map: The dictionary mapping old IDs to new IDs. + + Returns: + - dict: The updated run dictionary. + """ + do = run_dict["dotted_order"] + for k, v in id_map.items(): + do = do.replace(str(k), str(v)) + run_dict["dotted_order"] = do + + if run_dict.get("parent_run_id"): + run_dict["parent_run_id"] = id_map[run_dict["parent_run_id"]] + if not run_dict.get("extra"): + run_dict["extra"] = {} + return run_dict + + +def _convert_root_run(root: ls_schemas.Run, run_to_example_map: dict) -> list[dict]: + """Convert the root run and its child runs to a list of dictionaries. + + Parameters: + - root: The root run to convert. + - run_to_example_map: The dictionary mapping run IDs to example IDs. + + Returns: + - The list of converted run dictionaries. + """ + runs_ = [root] + trace_id = uuid.uuid4() + id_map = {root.trace_id: trace_id} + results = [] + while runs_: + src = runs_.pop() + src_dict = src.dict(exclude={"parent_run_ids", "child_run_ids", "session_id"}) + id_map[src_dict["id"]] = id_map.get(src_dict["id"], uuid.uuid4()) + src_dict["id"] = id_map[src_dict["id"]] + src_dict["trace_id"] = id_map[src_dict["trace_id"]] + if src.child_runs: + runs_.extend(src.child_runs) + results.append(src_dict) + result = [_convert_ids(r, id_map) for r in results] + result[0]["reference_example_id"] = run_to_example_map[root.id] + return result + + +@warn_beta +def convert_runs_to_test( + runs: Sequence[ls_schemas.Run], + *, + dataset_name: str, + test_project_name: Optional[str] = None, + client: Optional[Client] = None, + load_child_runs: bool = False, + include_outputs: bool = False, +) -> ls_schemas.TracerSession: + """Convert the following runs to a dataset + test. + + This makes it easy to sample prod runs into a new regression testing + workflow and compare against a candidate system. + + Internally, this function does the following: + 1. Create a dataset from the provided production run inputs. + 2. Create a new test project. + 3. Clone the production runs and re-upload against the dataset. + + Parameters: + - runs: A sequence of runs to be executed as a test. + - dataset_name: The name of the dataset to associate with the test runs. + - client: An optional LangSmith client instance. If not provided, a new client will + be created. + - load_child_runs: Whether to load child runs when copying runs. + + Returns: + - The project containing the cloned runs. + + Example: + -------- + ```python + import langsmith + import random + + client = langsmith.Client() + + # Randomly sample 100 runs from a prod project + runs = list(client.list_runs(project_name="My Project", execution_order=1)) + sampled_runs = random.sample(runs, min(len(runs), 100)) + + runs_as_test(runs, dataset_name="Random Runs") + + # Select runs named "extractor" whose root traces received good feedback + runs = client.list_runs( + project_name="", + filter='eq(name, "extractor")', + trace_filter='and(eq(feedback_key, "user_score"), eq(feedback_score, 1))', + ) + runs_as_test(runs, dataset_name="Extraction Good") + ``` + """ + if not runs: + raise ValueError(f"""Expected a non-empty sequence of runs. Received: {runs}""") + client = client or rt.get_cached_client() + ds = client.create_dataset(dataset_name=dataset_name) + outputs = [r.outputs for r in runs] if include_outputs else None + client.create_examples( + inputs=[r.inputs for r in runs], + outputs=outputs, + source_run_ids=[r.id for r in runs], + dataset_id=ds.id, + ) + + if not load_child_runs: + runs_to_copy = runs + else: + runs_to_copy = [ + client.read_run(r.id, load_child_runs=load_child_runs) for r in runs + ] + + test_project_name = test_project_name or f"prod-baseline-{uuid.uuid4().hex[:6]}" + + examples = list(client.list_examples(dataset_name=dataset_name)) + run_to_example_map = {e.source_run_id: e.id for e in examples} + dataset_version = ( + examples[0].modified_at if examples[0].modified_at else examples[0].created_at + ) + + to_create = [ + run_dict + for root_run in runs_to_copy + for run_dict in _convert_root_run(root_run, run_to_example_map) + ] + + project = client.create_project( + project_name=test_project_name, + reference_dataset_id=ds.id, + metadata={ + "which": "prod-baseline", + "dataset_version": dataset_version.isoformat(), + }, + ) + + for new_run in to_create: + latency = new_run["end_time"] - new_run["start_time"] + new_run["start_time"] = datetime.datetime.now(tz=datetime.timezone.utc) + new_run["end_time"] = new_run["start_time"] + latency + client.create_run(**new_run, project_name=test_project_name) + + _ = client.update_project( + project.id, + ) + return project + + +def _load_nested_traces(project_name: str, client: Client) -> list[ls_schemas.Run]: + runs = client.list_runs(project_name=project_name) + treemap: collections.defaultdict[uuid.UUID, list[ls_schemas.Run]] = ( + collections.defaultdict(list) + ) + results = [] + all_runs = {} + for run in runs: + if run.parent_run_id is not None: + treemap[run.parent_run_id].append(run) + else: + results.append(run) + all_runs[run.id] = run + for run_id, child_runs in treemap.items(): + all_runs[run_id].child_runs = sorted(child_runs, key=lambda r: r.dotted_order) + return results + + +T = TypeVar("T") +U = TypeVar("U") + + +def _outer_product(list1: list[T], list2: list[U]) -> list[tuple[T, U]]: + return list(itertools.product(list1, list2)) + + +@warn_beta +def compute_test_metrics( + project_name: str, + *, + evaluators: list, + max_concurrency: Optional[int] = 10, + client: Optional[Client] = None, +) -> None: + """Compute test metrics for a given test name using a list of evaluators. + + Args: + project_name (str): The name of the test project to evaluate. + evaluators (list): A list of evaluators to compute metrics with. + max_concurrency (Optional[int], optional): The maximum number of concurrent + evaluations. Defaults to 10. + client (Optional[Client], optional): The client to use for evaluations. + Defaults to None. + + Returns: + None: This function does not return any value. + """ + from langsmith import ContextThreadPoolExecutor + + evaluators_: list[ls_eval.RunEvaluator] = [] + for func in evaluators: + if isinstance(func, ls_eval.RunEvaluator): + evaluators_.append(func) + elif callable(func): + evaluators_.append(ls_eval.run_evaluator(func)) + else: + raise NotImplementedError( + f"Evaluation not yet implemented for evaluator of type {type(func)}" + ) + client = client or rt.get_cached_client() + traces = _load_nested_traces(project_name, client) + with ContextThreadPoolExecutor(max_workers=max_concurrency) as executor: + results = executor.map( + client.evaluate_run, *zip(*_outer_product(traces, evaluators_)) + ) + for _ in results: + pass diff --git a/python/user_packages/Python313/site-packages/langsmith/cli/README.md b/python/user_packages/Python313/site-packages/langsmith/cli/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8a0f9ad98e3327061ff35c8fc77d54cf000feb3c --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/cli/README.md @@ -0,0 +1,3 @@ +# DOCKER-COMPOSE MOVED + +All documentation for `docker-compose` has been moved to the [helm repository](https://github.com/langchain-ai/helm/tree/main/charts/langsmith). diff --git a/python/user_packages/Python313/site-packages/langsmith/env/__init__.py b/python/user_packages/Python313/site-packages/langsmith/env/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..542342ecbe867f7bea1e1d38ccbb06b96338d019 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/env/__init__.py @@ -0,0 +1,30 @@ +"""Utilities to get information about the runtime environment.""" +from langsmith.env._git import get_git_info +from langsmith.env._runtime_env import ( + get_docker_compose_command, + get_docker_compose_version, + get_docker_environment, + get_docker_version, + get_langchain_env_var_metadata, + get_langchain_env_vars, + get_langchain_environment, + get_release_shas, + get_runtime_and_metrics, + get_runtime_environment, + get_system_metrics, +) + +__all__ = [ + "get_docker_compose_command", + "get_docker_compose_version", + "get_docker_environment", + "get_docker_version", + "get_langchain_env_var_metadata", + "get_langchain_env_vars", + "get_langchain_environment", + "get_release_shas", + "get_runtime_and_metrics", + "get_runtime_environment", + "get_system_metrics", + "get_git_info", +] diff --git a/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1286460e1dfa6aad569ed9631a79272624397852 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/_git.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/_git.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09fa4f5f3a9c8ccf3373fd092a866dd838c978d2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/_git.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/_runtime_env.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/_runtime_env.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b159291896d9d0ba27344e852c8756dc6d3a4ea Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/env/__pycache__/_runtime_env.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/env/_git.py b/python/user_packages/Python313/site-packages/langsmith/env/_git.py new file mode 100644 index 0000000000000000000000000000000000000000..ce598285fae940870dbdf7389b17572ccef413b8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/env/_git.py @@ -0,0 +1,64 @@ +"""Fetch information about any current git repo.""" + +import functools +import logging +import subprocess +from typing import List, Optional, TypeVar + +from typing_extensions import TypedDict + +logger = logging.getLogger(__name__) + +T = TypeVar("T") + + +def exec_git(command: List[str]) -> Optional[str]: + try: + return subprocess.check_output( + ["git"] + command, encoding="utf-8", stderr=subprocess.DEVNULL + ).strip() + except BaseException: + return None + + +class GitInfo(TypedDict, total=False): + repo_name: Optional[str] + remote_url: Optional[str] + commit: Optional[str] + branch: Optional[str] + author_name: Optional[str] + author_email: Optional[str] + commit_time: Optional[str] + dirty: Optional[bool] + tags: Optional[str] + + +@functools.lru_cache(maxsize=1) +def get_git_info(remote: str = "origin") -> GitInfo: + """Get information about the git repository.""" + if not exec_git(["rev-parse", "--is-inside-work-tree"]): + return GitInfo( + remote_url=None, + commit=None, + branch=None, + author_name=None, + author_email=None, + commit_time=None, + dirty=None, + tags=None, + repo_name=None, + ) + + return { + "remote_url": exec_git(["remote", "get-url", remote]), + "commit": exec_git(["rev-parse", "HEAD"]), + "commit_time": exec_git(["log", "-1", "--format=%ct"]), + "branch": exec_git(["rev-parse", "--abbrev-ref", "HEAD"]), + "tags": exec_git( + ["describe", "--tags", "--exact-match", "--always", "--dirty"] + ), + "dirty": exec_git(["status", "--porcelain"]) != "", + "author_name": exec_git(["log", "-1", "--format=%an"]), + "author_email": exec_git(["log", "-1", "--format=%ae"]), + "repo_name": (exec_git(["rev-parse", "--show-toplevel"]) or "").split("/")[-1], + } diff --git a/python/user_packages/Python313/site-packages/langsmith/env/_runtime_env.py b/python/user_packages/Python313/site-packages/langsmith/env/_runtime_env.py new file mode 100644 index 0000000000000000000000000000000000000000..354f0eca1cbbc2b53bbfe61696fe46092a335ff5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/env/_runtime_env.py @@ -0,0 +1,236 @@ +"""Environment information.""" + +import functools +import logging +import os +import platform +import subprocess +from typing import Dict, List, Optional, Union + +from langsmith.utils import get_docker_compose_command +from langsmith.env._git import exec_git + +try: + # psutil is an optional dependency + import psutil + + _PSUTIL_AVAILABLE = True +except ImportError: + _PSUTIL_AVAILABLE = False +logger = logging.getLogger(__name__) + + +def get_runtime_and_metrics() -> dict: + """Get the runtime information as well as metrics.""" + return {**get_runtime_environment(), **get_system_metrics()} + + +def get_system_metrics() -> Dict[str, Union[float, dict]]: + """Get CPU and other performance metrics.""" + global _PSUTIL_AVAILABLE + if not _PSUTIL_AVAILABLE: + return {} + try: + process = psutil.Process(os.getpid()) + metrics: Dict[str, Union[float, dict]] = {} + + with process.oneshot(): + mem_info = process.memory_info() + metrics["thread_count"] = float(process.num_threads()) + metrics["mem"] = { + "rss": float(mem_info.rss), + } + ctx_switches = process.num_ctx_switches() + cpu_times = process.cpu_times() + metrics["cpu"] = { + "time": { + "sys": cpu_times.system, + "user": cpu_times.user, + }, + "ctx_switches": { + "voluntary": float(ctx_switches.voluntary), + "involuntary": float(ctx_switches.involuntary), + }, + "percent": process.cpu_percent(), + } + return metrics + except Exception as e: + # If psutil is installed but not compatible with the build, + # we'll just cease further attempts to use it. + _PSUTIL_AVAILABLE = False + logger.debug("Failed to get system metrics: %s", e) + return {} + + +@functools.lru_cache(maxsize=1) +def get_runtime_environment() -> dict: + """Get information about the environment.""" + # Lazy import to avoid circular imports + from langsmith import __version__ + + shas = get_release_shas() + return { + "sdk": "langsmith-py", + "sdk_version": __version__, + "library": "langsmith", + "platform": platform.platform(), + "runtime": "python", + "py_implementation": platform.python_implementation(), + "runtime_version": platform.python_version(), + "langchain_version": get_langchain_environment(), + "langchain_core_version": get_langchain_core_version(), + **shas, + } + + +@functools.lru_cache(maxsize=1) +def get_langchain_environment() -> Optional[str]: + try: + import langchain # type: ignore + + return langchain.__version__ + except: # noqa + return None + + +@functools.lru_cache(maxsize=1) +def get_langchain_core_version() -> Optional[str]: + try: + import langchain_core # type: ignore + + return langchain_core.__version__ + except ImportError: + return None + + +@functools.lru_cache(maxsize=1) +def get_docker_version() -> Optional[str]: + import subprocess + + try: + docker_version = ( + subprocess.check_output(["docker", "--version"]).decode("utf-8").strip() + ) + except FileNotFoundError: + docker_version = "unknown" + except: # noqa + return None + return docker_version + + +@functools.lru_cache(maxsize=1) +def get_docker_compose_version() -> Optional[str]: + try: + docker_compose_version = ( + subprocess.check_output(["docker-compose", "--version"]) + .decode("utf-8") + .strip() + ) + except FileNotFoundError: + docker_compose_version = "unknown" + except: # noqa + return None + return docker_compose_version + + +@functools.lru_cache(maxsize=1) +def _get_compose_command() -> Optional[List[str]]: + try: + compose_command = get_docker_compose_command() + except ValueError as e: + compose_command = [f"NOT INSTALLED: {e}"] + except: # noqa + return None + return compose_command + + +@functools.lru_cache(maxsize=1) +def get_docker_environment() -> dict: + """Get information about the environment.""" + compose_command = _get_compose_command() + return { + "docker_version": get_docker_version(), + "docker_compose_command": ( + " ".join(compose_command) if compose_command is not None else None + ), + "docker_compose_version": get_docker_compose_version(), + } + + +def get_langchain_env_vars() -> dict: + """Retrieve the langchain environment variables.""" + env_vars = {k: v for k, v in os.environ.items() if k.startswith("LANGCHAIN_")} + for key in list(env_vars): + if "key" in key.lower(): + v = env_vars[key] + env_vars[key] = v[:2] + "*" * (len(v) - 4) + v[-2:] + return env_vars + + +@functools.lru_cache(maxsize=1) +def get_langchain_env_var_metadata() -> dict: + """Retrieve the langchain environment variables.""" + excluded = { + "LANGCHAIN_API_KEY", + "LANGCHAIN_ENDPOINT", + "LANGCHAIN_TRACING_V2", + "LANGCHAIN_PROJECT", + "LANGCHAIN_SESSION", + "LANGSMITH_RUNS_ENDPOINTS", + } + langchain_metadata = { + k: v + for k, v in os.environ.items() + if (k.startswith("LANGCHAIN_") or k.startswith("LANGSMITH_")) + and k not in excluded + and "key" not in k.lower() + and "secret" not in k.lower() + and "token" not in k.lower() + } + env_revision_id = langchain_metadata.pop("LANGCHAIN_REVISION_ID", None) + if env_revision_id: + langchain_metadata["revision_id"] = env_revision_id + elif default_revision_id := _get_default_revision_id(): + langchain_metadata["revision_id"] = default_revision_id + + return langchain_metadata + + +@functools.lru_cache(maxsize=1) +def _get_default_revision_id() -> Optional[str]: + """Get the default revision ID based on `git describe`.""" + try: + return exec_git(["describe", "--tags", "--always", "--dirty"]) + except BaseException: + return None + + +@functools.lru_cache(maxsize=1) +def get_release_shas() -> Dict[str, str]: + common_release_envs = [ + "VERCEL_GIT_COMMIT_SHA", + "NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA", + "COMMIT_REF", + "RENDER_GIT_COMMIT", + "CI_COMMIT_SHA", + "CIRCLE_SHA1", + "CF_PAGES_COMMIT_SHA", + "REACT_APP_GIT_SHA", + "SOURCE_VERSION", + "GITHUB_SHA", + "TRAVIS_COMMIT", + "GIT_COMMIT", + "BUILD_VCS_NUMBER", + "bamboo_planRepository_revision", + "Build.SourceVersion", + "BITBUCKET_COMMIT", + "DRONE_COMMIT_SHA", + "SEMAPHORE_GIT_SHA", + "BUILDKITE_COMMIT", + ] + shas = {} + for env in common_release_envs: + env_var = os.environ.get(env) + if env_var is not None: + shas[env] = env_var + return shas diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__init__.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..244697df282795e0ef9c1dcd6d50bfe5ebf9653e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/__init__.py @@ -0,0 +1,89 @@ +"""Evaluation Helpers.""" + +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from langsmith.evaluation._arunner import ( + aevaluate, + aevaluate_existing, + ) + from langsmith.evaluation._runner import ( + evaluate, + evaluate_comparative, + evaluate_existing, + ) + from langsmith.evaluation.evaluator import ( + EvaluationResult, + EvaluationResults, + RunEvaluator, + run_evaluator, + ) + + +def __getattr__( + name: str, +) -> Any: + """.. deprecated:: 0.5.0. + + Importing from langsmith.evaluation is deprecated. Use client.evaluate() instead. + """ + if name == "evaluate": + from langsmith.evaluation._runner import evaluate + + return evaluate + elif name == "evaluate_existing": + from langsmith.evaluation._runner import evaluate_existing + + return evaluate_existing + elif name == "aevaluate": + from langsmith.evaluation._arunner import aevaluate + + return aevaluate + elif name == "aevaluate_existing": + from langsmith.evaluation._arunner import aevaluate_existing + + return aevaluate_existing + elif name == "evaluate_comparative": + from langsmith.evaluation._runner import evaluate_comparative + + return evaluate_comparative + elif name == "EvaluationResult": + from langsmith.evaluation.evaluator import EvaluationResult + + return EvaluationResult + elif name == "EvaluationResults": + from langsmith.evaluation.evaluator import EvaluationResults + + return EvaluationResults + elif name == "RunEvaluator": + from langsmith.evaluation.evaluator import RunEvaluator + + return RunEvaluator + elif name == "run_evaluator": + from langsmith.evaluation.evaluator import run_evaluator + + return run_evaluator + elif name == "StringEvaluator": + from langsmith.evaluation.string_evaluator import StringEvaluator + + return StringEvaluator + + raise AttributeError(f"module {__name__} has no attribute {name}") + + +__all__ = [ + "run_evaluator", + "EvaluationResult", + "EvaluationResults", + "RunEvaluator", + "StringEvaluator", + "aevaluate", + "aevaluate_existing", + "evaluate", + "evaluate_existing", + "evaluate_comparative", +] + + +def __dir__() -> list[str]: + return __all__ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e8fbe4efa258bd1f798e16cac35360083876949 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/_arunner.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/_arunner.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bccf714fee51ca71592774dcd06ebe33240d96ec Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/_arunner.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/_name_generation.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/_name_generation.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1634fb5fd1be0f80f7b5192fcd378d7aebb54ab Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/_name_generation.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/evaluator.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/evaluator.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e56edad0c0e7f01a646bc35de81580e557b1f37a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/evaluator.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/llm_evaluator.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/llm_evaluator.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03cac9859a070229a483ac64ad37f6f313e6d157 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/llm_evaluator.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/string_evaluator.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/string_evaluator.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..750cb3f0941e91988fc151c229e52d52a7ca005f Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/evaluation/__pycache__/string_evaluator.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/_arunner.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/_arunner.py new file mode 100644 index 0000000000000000000000000000000000000000..eaba3480549e00c00368abd0c63e002ed612e9a6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/_arunner.py @@ -0,0 +1,1395 @@ +"""V2 Evaluation Interface.""" + +from __future__ import annotations + +import asyncio +import concurrent.futures as cf +import contextvars +import io +import logging +import pathlib +import uuid +from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Iterable, Sequence +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Literal, + Optional, + TypeVar, + Union, + cast, +) + +import langsmith +from langsmith import run_helpers as rh +from langsmith import run_trees, schemas +from langsmith import run_trees as rt +from langsmith import utils as ls_utils +from langsmith._internal import _aiter as aitertools +from langsmith._internal._beta_decorator import _warn_once +from langsmith.evaluation._runner import ( + AEVALUATOR_T, + DATA_T, + EVALUATOR_T, + ExperimentResultRow, + _evaluators_include_attachments, + _ExperimentManagerMixin, + _extract_feedback_keys, + _ForwardResults, + _get_target_args, + _is_langchain_runnable, + _load_examples_map, + _load_experiment, + _load_tqdm, + _load_traces, + _resolve_data, + _resolve_evaluators, + _resolve_experiment, + _target_include_attachments, + _to_pandas, + _wrap_summary_evaluators, +) +from langsmith.evaluation.evaluator import ( + SUMMARY_EVALUATOR_T, + EvaluationResult, + EvaluationResults, + RunEvaluator, +) + +if TYPE_CHECKING: + import pandas as pd + from langchain_core.runnables import Runnable + + DataFrame = pd.DataFrame +else: + DataFrame = Any + +logger = logging.getLogger(__name__) + +ATARGET_T = Union[ + Callable[[dict], Awaitable[dict]], Callable[[dict, dict], Awaitable[dict]] +] + + +async def aevaluate( + target: Union[ + ATARGET_T, AsyncIterable[dict], Runnable, str, uuid.UUID, schemas.TracerSession + ], + /, + data: Union[ + DATA_T, AsyncIterable[schemas.Example], Iterable[schemas.Example], None + ] = None, + evaluators: Optional[Sequence[Union[EVALUATOR_T, AEVALUATOR_T]]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: Optional[int] = 0, + num_repetitions: int = 1, + client: Optional[langsmith.Client] = None, + blocking: bool = True, + experiment: Optional[Union[schemas.TracerSession, str, uuid.UUID]] = None, + upload_results: bool = True, + error_handling: Literal["log", "ignore"] = "log", + **kwargs: Any, +) -> AsyncExperimentResults: + r"""Evaluate an async target system on a given dataset. + + Args: + target (AsyncCallable[[dict], dict] | AsyncIterable[dict] | Runnable | EXPERIMENT_T | Tuple[EXPERIMENT_T, EXPERIMENT_T]): + The target system or experiment(s) to evaluate. + + Can be an async function that takes a `dict` and returns a `dict`, a + langchain `Runnable`, an existing experiment ID, or a two-tuple of experiment IDs. + data (Union[DATA_T, AsyncIterable[schemas.Example]]): The dataset to evaluate on. + + Can be a dataset name, a list of examples, an async generator of examples, or an async iterable of examples. + evaluators (Optional[Sequence[EVALUATOR_T]]): A list of evaluators to run + on each example. + summary_evaluators (Optional[Sequence[SUMMARY_EVALUATOR_T]]): A list of summary + evaluators to run on the entire dataset. + metadata (Optional[dict]): Metadata to attach to the experiment. + experiment_prefix (Optional[str]): A prefix to provide for your experiment name. + description (Optional[str]): A description of the experiment. + max_concurrency (int | None): The maximum number of concurrent + evaluations to run. + + If `None` then no limit is set. If `0` then no concurrency. + num_repetitions (int): The number of times to run the evaluation. + Each item in the dataset will be run and evaluated this many times. + client (Optional[langsmith.Client]): The LangSmith client to use. + blocking (bool): Whether to block until the evaluation is complete. + experiment (Optional[schemas.TracerSession]): An existing experiment to + extend. + + If provided, `experiment_prefix` is ignored. For advanced usage only. + error_handling (str, default="log"): How to handle individual run errors. + + `'log'` will trace the runs with the error message as part of the + experiment, `'ignore'` will not count the run as part of the experiment at + all. + + Returns: + An async iterator over the experiment results. + + Environment: + - `LANGSMITH_TEST_CACHE`: If set, API calls will be cached to disk to save time and + cost during testing. + + Recommended to commit the cache files to your repository for faster CI/CD runs. + + Requires the `'langsmith[vcr]'` package to be installed. + + Examples: + >>> from typing import Sequence + >>> from langsmith import Client, aevaluate + >>> from langsmith.schemas import Example, Run + >>> client = Client() + >>> dataset = client.clone_public_dataset( + ... "https://smith.langchain.com/public/419dcab2-1d66-4b94-8901-0357ead390df/d" + ... ) + >>> dataset_name = "Evaluate Examples" + + Basic usage: + + >>> def accuracy(run: Run, example: Example): + ... # Row-level evaluator for accuracy. + ... pred = run.outputs["output"] + ... expected = example.outputs["answer"] + ... return {"score": expected.lower() == pred.lower()} + + >>> def precision(runs: Sequence[Run], examples: Sequence[Example]): + ... # Experiment-level evaluator for precision. + ... # TP / (TP + FP) + ... predictions = [run.outputs["output"].lower() for run in runs] + ... expected = [example.outputs["answer"].lower() for example in examples] + ... # yes and no are the only possible answers + ... tp = sum([p == e for p, e in zip(predictions, expected) if p == "yes"]) + ... fp = sum([p == "yes" and e == "no" for p, e in zip(predictions, expected)]) + ... return {"score": tp / (tp + fp)} + + >>> import asyncio + >>> async def apredict(inputs: dict) -> dict: + ... # This can be any async function or just an API call to your app. + ... await asyncio.sleep(0.1) + ... return {"output": "Yes"} + >>> results = asyncio.run( + ... aevaluate( + ... apredict, + ... data=dataset_name, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... experiment_prefix="My Experiment", + ... description="Evaluate the accuracy of the model asynchronously.", + ... metadata={ + ... "my-prompt-version": "abcd-1234", + ... }, + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + Evaluating over only a subset of the examples using an async generator: + + >>> async def example_generator(): + ... examples = client.list_examples(dataset_name=dataset_name, limit=5) + ... for example in examples: + ... yield example + >>> results = asyncio.run( + ... aevaluate( + ... apredict, + ... data=example_generator(), + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... experiment_prefix="My Subset Experiment", + ... description="Evaluate a subset of examples asynchronously.", + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + Streaming each prediction to more easily + eagerly debug. + + >>> results = asyncio.run( + ... aevaluate( + ... apredict, + ... data=dataset_name, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... experiment_prefix="My Streaming Experiment", + ... description="Streaming predictions for debugging.", + ... blocking=False, + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + >>> async def aenumerate(iterable): + ... async for elem in iterable: + ... print(elem) + >>> asyncio.run(aenumerate(results)) + + Running without concurrency: + + >>> results = asyncio.run( + ... aevaluate( + ... apredict, + ... data=dataset_name, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... experiment_prefix="My Experiment Without Concurrency", + ... description="This was run without concurrency.", + ... max_concurrency=0, + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + Using Async evaluators: + + >>> async def helpfulness(run: Run, example: Example): + ... # Row-level evaluator for helpfulness. + ... await asyncio.sleep(5) # Replace with your LLM API call + ... return {"score": run.outputs["output"] == "Yes"} + + >>> results = asyncio.run( + ... aevaluate( + ... apredict, + ... data=dataset_name, + ... evaluators=[helpfulness], + ... summary_evaluators=[precision], + ... experiment_prefix="My Helpful Experiment", + ... description="Applying async evaluators example.", + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + + !!! warning "Behavior changed in `langsmith` 0.2.0" + + 'max_concurrency' default updated from None (no limit on concurrency) + to 0 (no concurrency at all). + """ # noqa: E501 + if isinstance(target, (str, uuid.UUID, schemas.TracerSession)): + invalid_args = { + "num_repetitions": num_repetitions > 1, + "experiment": bool(experiment), + "upload_results": not upload_results, + "experiment_prefix": bool(experiment_prefix), + "data": bool(data), + } + if any(invalid_args.values()): + msg = ( + f"Received invalid arguments. " + f"{tuple(k for k, v in invalid_args.items() if v)} should not be " + f"specified when target is an existing experiment." + ) + raise ValueError(msg) + target_id = target if isinstance(target, (str, uuid.UUID)) else target.id + logger.debug(f"Running evaluation over existing experiment {target_id}...") + return await aevaluate_existing( + target, + evaluators=evaluators, + summary_evaluators=summary_evaluators, + metadata=metadata, + max_concurrency=max_concurrency, + client=client, + blocking=blocking, + **kwargs, + ) + elif isinstance(target, (list, tuple)): + msg = ( + "Running a comparison of two existing experiments asynchronously is not " + "currently supported. Please use the `evaluate()` method instead and make " + "sure that your evaluators are defined as synchronous functions." + ) + raise ValueError(msg) + elif kwargs: + msg = ( + f"Received unsupported arguments {kwargs}. These arguments are not " + f"supported when creating a new experiment." + ) + raise ValueError(msg) + elif not data: + msg = "Must specify 'data' when running evaluations over a target function." + raise ValueError(msg) + elif experiment and experiment_prefix: + msg = ( + "Expected at most one of 'experiment' or 'experiment_prefix'," + " but both were provided. " + f"Got: experiment={experiment}, experiment_prefix={experiment_prefix}" + ) + raise ValueError(msg) + else: + if not upload_results: + _warn_once("'upload_results' parameter is in beta.") + logger.debug(f"Running evaluation over target system {target}...") + return await _aevaluate( + target, + data=data, + evaluators=evaluators, + summary_evaluators=summary_evaluators, + metadata=metadata, + experiment_prefix=experiment_prefix, + description=description, + max_concurrency=max_concurrency, + num_repetitions=num_repetitions, + client=client, + blocking=blocking, + experiment=experiment, + upload_results=upload_results, + error_handling=error_handling, + ) + + +async def aevaluate_existing( + experiment: Union[str, uuid.UUID, schemas.TracerSession], + /, + evaluators: Optional[Sequence[Union[EVALUATOR_T, AEVALUATOR_T]]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + max_concurrency: Optional[int] = 0, + client: Optional[langsmith.Client] = None, + load_nested: bool = False, + blocking: bool = True, +) -> AsyncExperimentResults: + r"""Evaluate existing experiment runs asynchronously. + + Args: + experiment (Union[str, uuid.UUID]): The identifier of the experiment to evaluate. + evaluators (Optional[Sequence[EVALUATOR_T]]): Optional sequence of evaluators to use for individual run evaluation. + summary_evaluators (Optional[Sequence[SUMMARY_EVALUATOR_T]]): Optional sequence of evaluators + to apply over the entire dataset. + metadata (Optional[dict]): Optional metadata to include in the evaluation results. + max_concurrency (int | None): The maximum number of concurrent + evaluations to run. + + If `None` then no limit is set. If `0` then no concurrency. + client (Optional[langsmith.Client]): Optional Langsmith client to use for evaluation. + load_nested: Whether to load all child runs for the experiment. + + Default is to only load the top-level root runs. + blocking (bool): Whether to block until evaluation is complete. + + Returns: + An async iterator over the experiment results. + + Examples: + Define your evaluators + + >>> from typing import Sequence + >>> from langsmith.schemas import Example, Run + >>> def accuracy(run: Run, example: Example): + ... # Row-level evaluator for accuracy. + ... pred = run.outputs["output"] + ... expected = example.outputs["answer"] + ... return {"score": expected.lower() == pred.lower()} + >>> def precision(runs: Sequence[Run], examples: Sequence[Example]): + ... # Experiment-level evaluator for precision. + ... # TP / (TP + FP) + ... predictions = [run.outputs["output"].lower() for run in runs] + ... expected = [example.outputs["answer"].lower() for example in examples] + ... # yes and no are the only possible answers + ... tp = sum([p == e for p, e in zip(predictions, expected) if p == "yes"]) + ... fp = sum([p == "yes" and e == "no" for p, e in zip(predictions, expected)]) + ... return {"score": tp / (tp + fp)} + + Load the experiment and run the evaluation. + + >>> import asyncio + >>> import uuid + >>> from langsmith import Client, aevaluate, aevaluate_existing + >>> client = Client() + >>> dataset_name = "__doctest_aevaluate_existing_" + uuid.uuid4().hex[:8] + >>> dataset = client.create_dataset(dataset_name) + >>> example = client.create_example( + ... inputs={"question": "What is 2+2?"}, + ... outputs={"answer": "4"}, + ... dataset_id=dataset.id, + ... ) + >>> async def apredict(inputs: dict) -> dict: + ... await asyncio.sleep(0.001) + ... return {"output": "4"} + >>> results = asyncio.run( + ... aevaluate( + ... apredict, data=dataset_name, experiment_prefix="doctest_experiment" + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> experiment_id = results.experiment_name + >>> # Consume all results to ensure evaluation is complete + >>> async def consume_results(): + ... result_list = [r async for r in results] + ... return len(result_list) > 0 + >>> asyncio.run(consume_results()) + True + >>> import time + >>> time.sleep(3) + >>> results = asyncio.run( + ... aevaluate_existing( + ... experiment_id, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... ) + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> client.delete_dataset(dataset_id=dataset.id) + + + """ # noqa: E501 + client = client or run_trees.get_cached_client() + project = ( + experiment + if isinstance(experiment, schemas.TracerSession) + else ( + await aitertools.aio_to_thread( + contextvars.copy_context(), _load_experiment, experiment, client + ) + ) + ) + runs = await aitertools.aio_to_thread( + contextvars.copy_context(), + _load_traces, + experiment, + client, + load_nested=load_nested, + ) + data_map = await aitertools.aio_to_thread( + contextvars.copy_context(), _load_examples_map, client, project + ) + data = [data_map[run.reference_example_id] for run in runs] + return await _aevaluate( + runs, + data=data, + evaluators=evaluators, + summary_evaluators=summary_evaluators, + metadata=metadata, + max_concurrency=max_concurrency, + client=client, + blocking=blocking, + experiment=project, + ) + + +async def _aevaluate( + target: Union[ATARGET_T, AsyncIterable[dict], Iterable[schemas.Run], Runnable], + /, + data: Union[DATA_T, AsyncIterable[schemas.Example]], + evaluators: Optional[Sequence[Union[EVALUATOR_T, AEVALUATOR_T]]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: Optional[int] = None, + num_repetitions: int = 1, + client: Optional[langsmith.Client] = None, + blocking: bool = True, + experiment: Optional[Union[schemas.TracerSession, str, uuid.UUID]] = None, + upload_results: bool = True, + error_handling: Literal["log", "ignore"] = "log", +) -> AsyncExperimentResults: + is_async_target = ( + asyncio.iscoroutinefunction(target) + or (hasattr(target, "__aiter__") and asyncio.iscoroutine(target.__aiter__())) + or _is_langchain_runnable(target) + ) + client = client or rt.get_cached_client() + runs = None if is_async_target else cast(Iterable[schemas.Run], target) + experiment_, runs = await aitertools.aio_to_thread( + contextvars.copy_context(), + _resolve_experiment, + experiment, + runs, + client, + ) + num_include_attachments = int( + _target_include_attachments(target) + ) + _evaluators_include_attachments(evaluators) + manager = await _AsyncExperimentManager( + data, + client=client, + metadata=metadata, + experiment=experiment_ or experiment_prefix, + description=description, + num_repetitions=num_repetitions, + runs=runs, + include_attachments=num_include_attachments > 0, + reuse_attachments=num_repetitions * num_include_attachments > 1, + upload_results=upload_results, + error_handling=error_handling, + ).astart() + cache_dir = ls_utils.get_cache_dir(None) + if cache_dir is not None: + dsid = await manager.get_dataset_id() + cache_path = pathlib.Path(cache_dir) / f"{dsid}.yaml" + else: + cache_path = None + with ls_utils.with_optional_cache(cache_path, ignore_hosts=[client.api_url]): + if is_async_target: + if evaluators: + # Run predictions and evaluations in a single pipeline + manager = await manager.awith_predictions_and_evaluators( + cast(ATARGET_T, target), evaluators, max_concurrency=max_concurrency + ) + else: + manager = await manager.awith_predictions( + cast(ATARGET_T, target), max_concurrency=max_concurrency + ) + if summary_evaluators: + manager = await manager.awith_summary_evaluators(summary_evaluators) + else: + if evaluators: + manager = await manager.awith_evaluators( + evaluators, max_concurrency=max_concurrency + ) + if summary_evaluators: + manager = await manager.awith_summary_evaluators(summary_evaluators) + results = AsyncExperimentResults(manager) + if blocking: + await results.wait() + return results + + +class _AsyncExperimentManager(_ExperimentManagerMixin): + """Manage the execution of experiments asynchronously. + + Supports lazily running predictions and evaluations in parallel to facilitate + result streaming and early debugging. + + Args: + data (DATA_T): The data used for the experiment. Can be a dataset name or ID OR + a generator of examples. + runs (Optional[Iterable[schemas.Run]]): The runs associated with the experiment + predictions. + experiment (Optional[schemas.TracerSession]): The tracer session + associated with the experiment. + experiment_prefix (Optional[str]): The prefix for the experiment name. + description (Optional[str]): The description for the experiment. + metadata (Optional[dict]): Additional metadata for the experiment. + client (Optional[langsmith.Client]): The Langsmith client used for + the experiment. + evaluation_results (Optional[Iterable[EvaluationResults]]): The evaluation + sresults for the experiment. + summary_results (Optional[Iterable[EvaluationResults]]): The aggregate results + for the experiment. + num_repetitions (Optional[int], default=1): The number of repetitions for + the experiment. + include_attachments (Optional[bool], default=False): Whether to include + attachments. This is used for when we pull the examples for the experiment. + reuse_attachments (Optional[bool], default=False): Whether to reuse attachments + from examples. This is True if we need to reuse attachments across multiple + target/evaluator functions. + upload_results (Optional[bool], default=True): Whether to upload results + to Langsmith. + attachment_raw_data_dict (Optional[dict]): A dictionary to store raw data + for attachments. Only used if we reuse attachments across multiple + target/evaluator functions. + error_handling (str, default="log"): How to handle individual run errors. + + `'log'` will trace the runs with the error message as part of the + experiment, `'ignore'` will not count the run as part of the experiment at + all. + """ + + def __init__( + self, + data: Union[DATA_T, AsyncIterable[schemas.Example]], + /, + experiment: Optional[Union[schemas.TracerSession, str]] = None, + metadata: Optional[dict] = None, + runs: Optional[Union[Iterable[schemas.Run], AsyncIterable[schemas.Run]]] = None, + client: Optional[langsmith.Client] = None, + evaluation_results: Optional[AsyncIterable[EvaluationResults]] = None, + summary_results: Optional[AsyncIterable[EvaluationResults]] = None, + description: Optional[str] = None, + num_repetitions: int = 1, + include_attachments: bool = False, + reuse_attachments: bool = False, + upload_results: bool = True, + attachment_raw_data_dict: Optional[dict] = None, + error_handling: Literal["log", "ignore"] = "log", + ): + super().__init__( + experiment=experiment, + metadata=metadata, + client=client, + description=description, + ) + self._data = data + self._examples: Optional[AsyncIterable[schemas.Example]] = None + self._runs = ( + aitertools.ensure_async_iterator(runs) if runs is not None else None + ) + self._evaluation_results = evaluation_results + self._summary_results = summary_results + self._num_repetitions = num_repetitions + self._include_attachments = include_attachments + self._reuse_attachments = reuse_attachments + self._upload_results = upload_results + self._attachment_raw_data_dict = attachment_raw_data_dict + self._error_handling = error_handling + + def _reset_example_attachments(self, example: schemas.Example) -> schemas.Example: + """Reset attachment readers for an example. + + This is only in the case that an attachment is going to be used by more + than 1 callable (target + evaluators). In that case we keep a single copy + of the attachment data in self._attachment_raw_data_dict, and create + readers from that data. This makes it so that we don't have to keep + copies of the same data in memory, instead we can just create readers + from the same data. + """ + if not hasattr(example, "attachments") or not example.attachments: + return example + + new_attachments: dict[str, schemas.AttachmentInfo] = {} + for name, attachment in example.attachments.items(): + if ( + self._attachment_raw_data_dict is not None + and str(example.id) + name in self._attachment_raw_data_dict + ): + new_attachments[name] = { + "presigned_url": attachment["presigned_url"], + "reader": io.BytesIO( + self._attachment_raw_data_dict[str(example.id) + name] + ), + "mime_type": attachment["mime_type"], + } + else: + new_attachments[name] = attachment + + # Create a new Example instance with the updated attachments + return schemas.Example( + id=example.id, + created_at=example.created_at, + dataset_id=example.dataset_id, + inputs=example.inputs, + outputs=example.outputs, + metadata=example.metadata, + modified_at=example.modified_at, + source_run_id=example.source_run_id, + attachments=new_attachments, + _host_url=example._host_url, + _tenant_id=example._tenant_id, + ) + + async def aget_examples(self) -> AsyncIterator[schemas.Example]: + if self._examples is None: + self._examples = _aresolve_data( + self._data, + client=self.client, + include_attachments=self._include_attachments, + ) + if self._reuse_attachments and self._attachment_raw_data_dict is None: + examples_copy, self._examples = aitertools.atee(self._examples) + self._attachment_raw_data_dict = { + str(e.id) + name: value["reader"].read() + async for e in examples_copy + for name, value in (e.attachments or {}).items() + } + if self._num_repetitions > 1: + examples_list = [example async for example in self._examples] + self._examples = async_chain_from_iterable( + [ + async_iter_from_list( + [ + self._reset_example_attachments(example) + for example in examples_list + ] + ) + for _ in range(self._num_repetitions) + ] + ) + + self._examples, examples_iter = aitertools.atee( + aitertools.ensure_async_iterator(self._examples), 2, lock=asyncio.Lock() + ) + return examples_iter + + async def get_dataset_id(self) -> str: + if self._experiment is None or not getattr( + self._experiment, "reference_dataset_id", None + ): + example = await aitertools.py_anext(await self.aget_examples()) + if example is None: + raise ValueError("No examples found in the dataset.") + return str(example.dataset_id) + return str(self._experiment.reference_dataset_id) + + async def aget_runs(self) -> AsyncIterator[schemas.Run]: + if self._runs is None: + raise ValueError("Runs not loaded yet.") + self._runs, runs = aitertools.atee( + aitertools.ensure_async_iterator(self._runs), 2, lock=asyncio.Lock() + ) + async for run in runs: + yield run + + async def aget_evaluation_results(self) -> AsyncIterator[EvaluationResults]: + if self._evaluation_results is None: + async for _ in await self.aget_examples(): + yield {"results": []} + else: + self._evaluation_results, evaluation_results = aitertools.atee( + aitertools.ensure_async_iterator(self._evaluation_results), + 2, + lock=asyncio.Lock(), + ) + async for result in evaluation_results: + yield result + + async def astart(self) -> _AsyncExperimentManager: + try: + first_example = await aitertools.py_anext(await self.aget_examples()) + except StopAsyncIteration: + raise ValueError( + "No examples found in the dataset. " + "Please ensure the data provided to aevaluate is not empty." + ) + if not first_example: + raise ValueError( + "No examples found in the dataset." + "Please ensure the data provided to aevaluate is not empty." + ) + project = self._get_project(first_example) if self._upload_results else None + self._print_experiment_start(project, first_example) + self._metadata["num_repetitions"] = self._num_repetitions + return self._copy( + await self.aget_examples(), + experiment=project, + ) + + def _get_example_with_readers(self, example: schemas.Example) -> schemas.Example: + new_attachments: dict[str, schemas.AttachmentInfo] = {} + for name, attachment in (example.attachments or {}).items(): + if ( + self._attachment_raw_data_dict is not None + and str(example.id) + name in self._attachment_raw_data_dict + ): + reader = io.BytesIO( + self._attachment_raw_data_dict[str(example.id) + name] + ) + new_attachments[name] = { + "presigned_url": attachment["presigned_url"], + "reader": reader, + "mime_type": attachment["mime_type"], + } + else: + new_attachments[name] = attachment + + return schemas.Example( + id=example.id, + created_at=example.created_at, + dataset_id=example.dataset_id, + inputs=example.inputs, + outputs=example.outputs, + metadata=example.metadata, + modified_at=example.modified_at, + source_run_id=example.source_run_id, + attachments=new_attachments, + _host_url=example._host_url, + _tenant_id=example._tenant_id, + ) + + async def awith_predictions_and_evaluators( + self, + target: ATARGET_T, + evaluators: Sequence[Union[EVALUATOR_T, AEVALUATOR_T]], + /, + max_concurrency: Optional[int] = None, + ) -> _AsyncExperimentManager: + """Run predictions and evaluations in a single pipeline. + + This allows evaluators to process results as soon as they're available from + the target function, rather than waiting for all predictions to complete first. + """ + evaluators = _resolve_evaluators(evaluators) + + if not hasattr(self, "_evaluation_feedback_executor"): + self._evaluation_feedback_executor = cf.ThreadPoolExecutor(max_workers=4) + + traceable_target = _ensure_async_traceable(target) + + async def process_example(example: schemas.Example): + # Yield the coroutine to be awaited later + pred = await _aforward( + traceable_target, + self._get_example_with_readers(example), + self.experiment_name, + self._metadata, + self.client, + _target_include_attachments(target), + self._error_handling, + ) + example, run = pred["example"], pred["run"] + result = await self._arun_evaluators( + evaluators, + { + "run": run, + "example": example, + "evaluation_results": {"results": []}, + }, + feedback_executor=self._evaluation_feedback_executor, + ) + return result + + async def process_examples(): + """Create a single task per example. + + That task is to run the target function and all the evaluators + sequentially. + """ + async for example in await self.aget_examples(): + yield process_example(example) + + await self._aend() + + # Run the per-example tasks with max-concurrency + # This guarantees that max_concurrency is the upper limit + # for the number of target/evaluators that can be run in parallel + experiment_results = aitertools.aiter_with_concurrency( + max_concurrency, + process_examples(), + _eager_consumption_timeout=0.001, + ) + + r1, r2, r3 = aitertools.atee(experiment_results, 3, lock=asyncio.Lock()) + + return self._copy( + (result["example"] async for result in r1), + runs=(result["run"] async for result in r2), + evaluation_results=(result["evaluation_results"] async for result in r3), + ) + + async def awith_predictions( + self, + target: ATARGET_T, + /, + max_concurrency: Optional[int] = None, + ) -> _AsyncExperimentManager: + _experiment_results = self._apredict( + target, + max_concurrency=max_concurrency, + include_attachments=_target_include_attachments(target), + ) + r1, r2 = aitertools.atee(_experiment_results, 2, lock=asyncio.Lock()) + return self._copy( + (pred["example"] async for pred in r1), + runs=(pred["run"] async for pred in r2), + ) + + async def awith_evaluators( + self, + evaluators: Sequence[Union[EVALUATOR_T, AEVALUATOR_T]], + *, + max_concurrency: Optional[int] = None, + ) -> _AsyncExperimentManager: + evaluators = _resolve_evaluators(evaluators) + experiment_results = self._ascore(evaluators, max_concurrency=max_concurrency) + r1, r2, r3 = aitertools.atee(experiment_results, 3, lock=asyncio.Lock()) + return self._copy( + (result["example"] async for result in r1), + runs=(result["run"] async for result in r2), + evaluation_results=(result["evaluation_results"] async for result in r3), + ) + + async def awith_summary_evaluators( + self, + summary_evaluators: Sequence[SUMMARY_EVALUATOR_T], + ) -> _AsyncExperimentManager: + wrapped_evaluators = _wrap_summary_evaluators(summary_evaluators) + aggregate_feedback_gen = self._aapply_summary_evaluators(wrapped_evaluators) + return self._copy( + await self.aget_examples(), + runs=self.aget_runs(), + summary_results=aggregate_feedback_gen, + ) + + async def aget_results(self) -> AsyncIterator[ExperimentResultRow]: + async for run, example, evaluation_results in aitertools.async_zip( + self.aget_runs(), await self.aget_examples(), self.aget_evaluation_results() + ): + yield ExperimentResultRow( + run=run, + example=example, + evaluation_results=evaluation_results, + ) + + async def aget_summary_scores(self) -> dict[str, list[dict]]: + if self._summary_results is None: + return {"results": []} + return { + "results": [ + res # type: ignore[misc] + async for results in self._summary_results + for res in results["results"] + ] + } + + ## Private methods + + async def _apredict( + self, + target: ATARGET_T, + /, + max_concurrency: Optional[int] = None, + include_attachments: bool = False, + ) -> AsyncIterator[_ForwardResults]: + fn = _ensure_async_traceable(target) + + async def predict_all(): + async for example in await self.aget_examples(): + # Yield the coroutine to be awaited later + yield _aforward( + fn, + self._get_example_with_readers(example), + self.experiment_name, + self._metadata, + self.client, + include_attachments, + self._error_handling, + ) + + async for result in aitertools.aiter_with_concurrency( + max_concurrency, predict_all(), _eager_consumption_timeout=0.001 + ): + yield result + + await self._aend() + + async def _ascore( + self, + evaluators: Sequence[RunEvaluator], + max_concurrency: Optional[int] = None, + ) -> AsyncIterator[ExperimentResultRow]: + with cf.ThreadPoolExecutor(max_workers=4) as feedback_executor: + + async def score_all(): + async for current_results in self.aget_results(): + # Yield the coroutine to be awaited later in aiter_with_concurrency + yield self._arun_evaluators( + evaluators, current_results, feedback_executor=feedback_executor + ) + + async for result in aitertools.aiter_with_concurrency( + max_concurrency, score_all(), _eager_consumption_timeout=0.001 + ): + yield result + + async def _arun_evaluators( + self, + evaluators: Sequence[RunEvaluator], + current_results: ExperimentResultRow, + feedback_executor: cf.ThreadPoolExecutor, + ) -> ExperimentResultRow: + current_context = rh.get_tracing_context() + metadata = { + **(current_context["metadata"] or {}), + **{"experiment": self.experiment_name}, + } + with rh.tracing_context( + **{ + **current_context, + "project_name": "evaluators", + "metadata": metadata, + "enabled": "local" if not self._upload_results else True, + "client": self.client, + } + ): + run = current_results["run"] + example = current_results["example"] + eval_results = current_results["evaluation_results"] + + async def _run_single_evaluator(evaluator: RunEvaluator): + evaluator_run_id = uuid.uuid4() + try: + evaluator_response = await evaluator.aevaluate_run( # type: ignore[call-arg] + run=run, + example=self._get_example_with_readers(example), + evaluator_run_id=evaluator_run_id, + ) + selected_results = self.client._select_eval_results( + evaluator_response + ) + + if self._upload_results: + self.client._log_evaluation_feedback( + evaluator_response, run=run, _executor=feedback_executor + ) + return selected_results + except Exception as e: + try: + feedback_keys = _extract_feedback_keys(evaluator) + + error_response = EvaluationResults( + results=[ + EvaluationResult( + key=key, + source_run_id=evaluator_run_id, + comment=repr(e), + extra={"error": True}, + ) + for key in feedback_keys + ] + ) + selected_results = self.client._select_eval_results( + error_response + ) + if self._upload_results: + self.client._log_evaluation_feedback( + error_response, run=run, _executor=feedback_executor + ) + return selected_results + except Exception as e2: + logger.debug(f"Error parsing feedback keys: {e2}") + pass + logger.error( + f"Error running evaluator {repr(evaluator)} on" + f" run {run.id}: {repr(e)}", + exc_info=True, + ) + + all_results = [] + for evaluator in evaluators: + all_results.append(await _run_single_evaluator(evaluator)) + + for result in all_results: + if result is not None: + eval_results["results"].extend(result) + return ExperimentResultRow( + run=run, + example=example, + evaluation_results=eval_results, + ) + + async def _aapply_summary_evaluators( + self, summary_evaluators: Sequence[SUMMARY_EVALUATOR_T] + ) -> AsyncIterator[EvaluationResults]: + runs, examples = [], [] + async_examples = aitertools.ensure_async_iterator(await self.aget_examples()) + async for run, example in aitertools.async_zip( + self.aget_runs(), async_examples + ): + runs.append(run) + examples.append(example) + aggregate_feedback = [] + project_id = self._get_experiment().id if self._upload_results else None + current_context = rh.get_tracing_context() + metadata = { + **(current_context["metadata"] or {}), + **{ + "experiment": self.experiment_name, + "experiment_id": project_id, + }, + } + with rh.tracing_context( + **{ + **current_context, + "project_name": "evaluators", + "metadata": metadata, + "enabled": "local" if not self._upload_results else True, + "client": self.client, + } + ): + for evaluator in summary_evaluators: + try: + summary_eval_result = evaluator(runs, examples) + flattened_results = self.client._select_eval_results( + summary_eval_result, + fn_name=evaluator.__name__, + ) + aggregate_feedback.extend(flattened_results) + if self._upload_results: + for result in flattened_results: + feedback = result.model_dump(exclude={"target_run_id"}) + evaluator_info = feedback.pop("evaluator_info", None) + await aitertools.aio_to_thread( + contextvars.copy_context(), + self.client.create_feedback, + **feedback, + run_id=None, + project_id=project_id, + source_info=evaluator_info, + ) + except Exception as e: + logger.error( + f"Error running summary evaluator {repr(evaluator)}: {e}", + exc_info=True, + ) + yield {"results": aggregate_feedback} + + async def _get_dataset_version(self) -> Optional[str]: + modified_at = [] + async for example in await self.aget_examples(): + if example.modified_at: + # Should always be defined in practice when fetched, + # but the typing permits None + modified_at.append(example.modified_at) + + max_modified_at = max(modified_at) if modified_at else None + return max_modified_at.isoformat() if max_modified_at else None + + async def _get_dataset_splits(self) -> Optional[list[str]]: + splits = set() + async for example in await self.aget_examples(): + if ( + example.metadata + and example.metadata.get("dataset_split") + and isinstance(example.metadata["dataset_split"], list) + ): + for split in example.metadata["dataset_split"]: + if isinstance(split, str): + splits.add(split) + else: + splits.add("base") + + return list(splits) + + async def _aend(self) -> None: + if not self._upload_results: + return + experiment = self._experiment + if experiment is None: + raise ValueError("Experiment not started yet.") + + project_metadata = self._get_experiment_metadata() + project_metadata["dataset_version"] = await self._get_dataset_version() + project_metadata["dataset_splits"] = await self._get_dataset_splits() + self.client.update_project( + experiment.id, + metadata={ + **experiment.metadata, + **project_metadata, + }, + ) + + def _copy(self, *args: Any, **kwargs: Any) -> _AsyncExperimentManager: + default_args = (self._data,) + default_kwargs = { + "experiment": self._experiment, + "metadata": self._metadata, + "runs": self._runs, + "client": self.client, + "evaluation_results": self._evaluation_results, + "summary_results": self._summary_results, + "include_attachments": self._include_attachments, + "reuse_attachments": self._reuse_attachments, + "upload_results": self._upload_results, + "attachment_raw_data_dict": self._attachment_raw_data_dict, + "error_handling": self._error_handling, + } + full_args = list(args) + list(default_args[len(args) :]) + full_kwargs = {**default_kwargs, **kwargs} + return self.__class__(*full_args, **full_kwargs) + + +class AsyncExperimentResults: + def __init__( + self, + experiment_manager: _AsyncExperimentManager, + ): + self._manager = experiment_manager + self._results: list[ExperimentResultRow] = [] + self._condition = asyncio.Condition() + self._task = asyncio.create_task(self._process_data(self._manager)) + self._processed_count = 0 + self._comparison_url: Optional[str] = None + + @property + def experiment_name(self) -> str: + return self._manager.experiment_name + + @property + def experiment_id(self) -> uuid.UUID: + """The ID of the experiment.""" + return self._manager._get_experiment().id + + @property + def url(self) -> Optional[str]: + """The URL of the experiment in the LangSmith UI.""" + return self._manager._get_experiment().url + + async def get_dataset_id(self) -> str: + """Get the ID of the dataset associated with this experiment.""" + return await self._manager.get_dataset_id() + + async def get_comparison_url(self) -> Optional[str]: + """Get the URL to the comparison view for this experiment.""" + experiment = self._manager._get_experiment() + if not self._comparison_url and experiment.url: + dataset_id = await self._manager.get_dataset_id() + project_url = experiment.url.split("?")[0] + base_url = project_url.split("/projects/p/")[0] + self._comparison_url = ( + f"{base_url}/datasets/{dataset_id}/compare?" + f"selectedSessions={experiment.id}" + ) + return self._comparison_url + + def __aiter__(self) -> AsyncIterator[ExperimentResultRow]: + return self + + async def __anext__(self) -> ExperimentResultRow: + async with self._condition: + while True: + if self._processed_count < len(self._results): + result = self._results[self._processed_count] + self._processed_count += 1 + return result + elif self._task.done(): + exc = self._task.exception() + if exc is not None: + raise exc + raise StopAsyncIteration + await self._condition.wait() + + async def _process_data(self, manager: _AsyncExperimentManager) -> None: + tqdm = _load_tqdm() + async for item in tqdm(manager.aget_results()): + async with self._condition: + self._results.append(item) + self._condition.notify() + summary_scores = await manager.aget_summary_scores() + async with self._condition: + self._summary_results = summary_scores + self._condition.notify_all() + + def to_pandas( + self, start: Optional[int] = 0, end: Optional[int] = None + ) -> DataFrame: + return _to_pandas(self._results, start=start, end=end) + + def _repr_html_(self) -> str: + import importlib.util + + if self._results and importlib.util.find_spec("pandas"): + df = self.to_pandas(0, 5) + return df._repr_html_() # type: ignore[operator] + else: + return self.__repr__() + + def __len__(self) -> int: + return len(self._results) + + def __repr__(self) -> str: + return f"" + + async def wait(self) -> None: + await self._task + + +async def _aforward( + fn: rh.SupportsLangsmithExtra[[dict], Awaitable], + example: schemas.Example, + experiment_name: str, + metadata: dict, + client: langsmith.Client, + include_attachments: bool = False, + error_handling: Literal["log", "ignore"] = "log", +) -> _ForwardResults: + run: Optional[schemas.RunBase] = None + + def _get_run(r: run_trees.RunTree) -> None: + nonlocal run + run = r + + def _set_reference_example_id(r: rt.RunTree) -> None: + r.reference_example_id = example.id + + langsmith_extra = rh.LangSmithExtra( + on_end=_get_run, + project_name=experiment_name, + metadata={ + **metadata, + "example_version": (example.modified_at or example.created_at).isoformat(), + }, + client=client, + ) + if error_handling == "log": + langsmith_extra["reference_example_id"] = example.id + elif error_handling == "ignore": + langsmith_extra["_on_success"] = _set_reference_example_id + else: + raise ValueError(f"Unrecognized error_handling value: {error_handling=}") + + with rh.tracing_context(enabled=True): + try: + arg_names = _get_target_args(fn) + args = [getattr(example, argn) for argn in arg_names] + await fn(*args, langsmith_extra=langsmith_extra) + except Exception as e: + logger.error( + f"Error running target function: {e}", exc_info=True, stacklevel=1 + ) + return _ForwardResults( + run=cast(schemas.Run, run), + example=example, + ) + + +def _default_process_inputs(inputs: dict) -> dict: + return inputs["inputs"] if "inputs" in inputs else inputs + + +def _ensure_async_traceable( + target: ATARGET_T, +) -> rh.SupportsLangsmithExtra[[dict], Awaitable]: + if not asyncio.iscoroutinefunction(target) and not _is_langchain_runnable(target): + if callable(target): + raise ValueError( + "Target must be an async function. For sync functions, use evaluate." + " Example usage:\n\n" + "async def predict(inputs: dict) -> dict:\n" + " # do work, like chain.invoke(inputs)\n" + " return {...}\n" + "await aevaluate(predict, ...)" + ) + else: + raise ValueError( + "Target must be a callable async function. " + "Received a non-callable object. Example usage:\n\n" + "async def predict(inputs: dict) -> dict:\n" + " # do work, like chain.invoke(inputs)\n" + " return {...}\n" + "await aevaluate(predict, ...)" + ) + if rh.is_traceable_function(target): + return target # type: ignore + else: + if _is_langchain_runnable(target): + target = target.ainvoke # type: ignore[union-attr] + return rh.traceable( + name="AsyncTarget", + process_inputs=_default_process_inputs, + )(target) # type: ignore[arg-type] + + +def _aresolve_data( + data: Union[DATA_T, AsyncIterable[schemas.Example]], + *, + client: langsmith.Client, + include_attachments: bool = False, +) -> AsyncIterator[schemas.Example]: + """Return the examples for the given dataset.""" + if isinstance(data, AsyncIterable): + return aitertools.ensure_async_iterator(data) + return aitertools.ensure_async_iterator( + _resolve_data(data, client=client, include_attachments=include_attachments) + ) + + +T = TypeVar("T") + + +async def async_chain_from_iterable( + iterable: Iterable[AsyncIterable[T]], +) -> AsyncIterator[T]: + """Chain multiple async iterables.""" + for sub_iterable in iterable: + async for item in sub_iterable: + yield item + + +async def async_iter_from_list( + examples: list[schemas.Example], +) -> AsyncIterable[schemas.Example]: + """Convert a list of examples to an async iterable.""" + for example in examples: + yield example diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/_name_generation.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/_name_generation.py new file mode 100644 index 0000000000000000000000000000000000000000..191c74632fef95b02c05acb639b13eabc39c6648 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/_name_generation.py @@ -0,0 +1,727 @@ +import random + +adjectives = [ + "abandoned", + "aching", + "advanced", + "ample", + "artistic", + "back", + "best", + "bold", + "brief", + "clear", + "cold", + "complicated", + "cooked", + "crazy", + "crushing", + "damp", + "dear", + "definite", + "dependable", + "diligent", + "drab", + "earnest", + "elderly", + "enchanted", + "essential", + "excellent", + "extraneous", + "fixed", + "flowery", + "formal", + "fresh", + "frosty", + "giving", + "glossy", + "healthy", + "helpful", + "impressionable", + "kind", + "large", + "left", + "long", + "loyal", + "mealy", + "memorable", + "monthly", + "new", + "notable", + "only", + "ordinary", + "passionate", + "perfect", + "pertinent", + "proper", + "puzzled", + "reflecting", + "respectful", + "roasted", + "scholarly", + "shiny", + "slight", + "sparkling", + "spotless", + "stupendous", + "sunny", + "tart", + "terrific", + "timely", + "unique", + "upbeat", + "vacant", + "virtual", + "warm", + "weary", + "whispered", + "worthwhile", + "yellow", +] + +nouns = [ + "account", + "acknowledgment", + "address", + "advertising", + "airplane", + "animal", + "appointment", + "arrival", + "artist", + "attachment", + "attitude", + "availability", + "backpack", + "bag", + "balance", + "bass", + "bean", + "beauty", + "bibliography", + "bill", + "bite", + "blossom", + "boat", + "book", + "box", + "boy", + "bread", + "bridge", + "broccoli", + "building", + "butter", + "button", + "cabbage", + "cake", + "camera", + "camp", + "candle", + "candy", + "canvas", + "car", + "card", + "carrot", + "cart", + "case", + "cat", + "chain", + "chair", + "chalk", + "chance", + "change", + "channel", + "character", + "charge", + "charm", + "chart", + "check", + "cheek", + "cheese", + "chef", + "cherry", + "chicken", + "child", + "church", + "circle", + "class", + "clay", + "click", + "clock", + "cloth", + "cloud", + "clove", + "club", + "coach", + "coal", + "coast", + "coat", + "cod", + "coffee", + "collar", + "color", + "comb", + "comfort", + "comic", + "committee", + "community", + "company", + "comparison", + "competition", + "condition", + "connection", + "control", + "cook", + "copper", + "copy", + "corn", + "cough", + "country", + "cover", + "crate", + "crayon", + "cream", + "creator", + "crew", + "crown", + "current", + "curtain", + "curve", + "cushion", + "dad", + "daughter", + "day", + "death", + "debt", + "decision", + "deer", + "degree", + "design", + "desire", + "desk", + "detail", + "development", + "digestion", + "dime", + "dinner", + "direction", + "dirt", + "discovery", + "discussion", + "disease", + "disgust", + "distance", + "distribution", + "division", + "doctor", + "dog", + "door", + "drain", + "drawer", + "dress", + "drink", + "driving", + "dust", + "ear", + "earth", + "edge", + "education", + "effect", + "egg", + "end", + "energy", + "engine", + "error", + "event", + "example", + "exchange", + "existence", + "expansion", + "experience", + "expert", + "eye", + "face", + "fact", + "fall", + "family", + "farm", + "father", + "fear", + "feeling", + "field", + "finger", + "fire", + "fish", + "flag", + "flight", + "floor", + "flower", + "fold", + "food", + "football", + "force", + "form", + "frame", + "friend", + "frog", + "fruit", + "fuel", + "furniture", + "game", + "garden", + "gate", + "girl", + "glass", + "glove", + "goat", + "gold", + "government", + "grade", + "grain", + "grass", + "green", + "grip", + "group", + "growth", + "guide", + "guitar", + "hair", + "hall", + "hand", + "harbor", + "harmony", + "hat", + "head", + "health", + "heart", + "heat", + "hill", + "history", + "hobbies", + "hole", + "hope", + "horn", + "horse", + "hospital", + "hour", + "house", + "humor", + "idea", + "impulse", + "income", + "increase", + "industry", + "ink", + "insect", + "instrument", + "insurance", + "interest", + "invention", + "iron", + "island", + "jelly", + "jet", + "jewel", + "join", + "judge", + "juice", + "jump", + "kettle", + "key", + "kick", + "kiss", + "kitten", + "knee", + "knife", + "knowledge", + "land", + "language", + "laugh", + "law", + "lead", + "learning", + "leather", + "leg", + "lettuce", + "level", + "library", + "lift", + "light", + "limit", + "line", + "linen", + "lip", + "liquid", + "list", + "look", + "loss", + "love", + "lunch", + "machine", + "man", + "manager", + "map", + "marble", + "mark", + "market", + "mass", + "match", + "meal", + "measure", + "meat", + "meeting", + "memory", + "metal", + "middle", + "milk", + "mind", + "mine", + "minute", + "mist", + "mitten", + "mom", + "money", + "monkey", + "month", + "moon", + "morning", + "mother", + "motion", + "mountain", + "mouth", + "muscle", + "music", + "nail", + "name", + "nation", + "neck", + "need", + "news", + "night", + "noise", + "note", + "number", + "nut", + "observation", + "offer", + "oil", + "operation", + "opinion", + "orange", + "order", + "organization", + "ornament", + "oven", + "page", + "pail", + "pain", + "paint", + "pan", + "pancake", + "paper", + "parcel", + "parent", + "part", + "passenger", + "paste", + "payment", + "peace", + "pear", + "pen", + "pencil", + "person", + "pest", + "pet", + "picture", + "pie", + "pin", + "pipe", + "pizza", + "place", + "plane", + "plant", + "plastic", + "plate", + "play", + "pleasure", + "plot", + "plough", + "pocket", + "point", + "poison", + "police", + "pollution", + "popcorn", + "porter", + "position", + "pot", + "potato", + "powder", + "power", + "price", + "print", + "process", + "produce", + "product", + "profit", + "property", + "prose", + "protest", + "pull", + "pump", + "punishment", + "purpose", + "push", + "quarter", + "question", + "quiet", + "quill", + "quilt", + "quince", + "rabbit", + "rail", + "rain", + "range", + "rat", + "rate", + "ray", + "reaction", + "reading", + "reason", + "record", + "regret", + "relation", + "religion", + "representative", + "request", + "respect", + "rest", + "reward", + "rhythm", + "rice", + "river", + "road", + "roll", + "room", + "root", + "rose", + "route", + "rub", + "rule", + "run", + "sack", + "sail", + "salt", + "sand", + "scale", + "scarecrow", + "scarf", + "scene", + "scent", + "school", + "science", + "scissors", + "screw", + "sea", + "seat", + "secretary", + "seed", + "selection", + "self", + "sense", + "servant", + "shade", + "shake", + "shame", + "shape", + "sheep", + "sheet", + "shelf", + "ship", + "shirt", + "shock", + "shoe", + "shop", + "show", + "side", + "sign", + "silk", + "sink", + "sister", + "size", + "sky", + "sleep", + "smash", + "smell", + "smile", + "smoke", + "snail", + "snake", + "sneeze", + "snow", + "soap", + "society", + "sock", + "soda", + "sofa", + "son", + "song", + "sort", + "sound", + "soup", + "space", + "spark", + "speed", + "sponge", + "spoon", + "spray", + "spring", + "spy", + "square", + "stamp", + "star", + "start", + "statement", + "station", + "steam", + "steel", + "stem", + "step", + "stew", + "stick", + "stitch", + "stocking", + "stomach", + "stone", + "stop", + "store", + "story", + "stove", + "stranger", + "straw", + "stream", + "street", + "stretch", + "string", + "structure", + "substance", + "sugar", + "suggestion", + "suit", + "summer", + "sun", + "support", + "surprise", + "sweater", + "swim", + "system", + "table", + "tail", + "talk", + "tank", + "taste", + "tax", + "tea", + "teaching", + "team", + "tendency", + "test", + "texture", + "theory", + "thing", + "thought", + "thread", + "throat", + "thumb", + "thunder", + "ticket", + "time", + "tin", + "title", + "toad", + "toe", + "tooth", + "toothpaste", + "touch", + "town", + "toy", + "trade", + "train", + "transport", + "tray", + "treatment", + "tree", + "trick", + "trip", + "trouble", + "trousers", + "truck", + "tub", + "turkey", + "turn", + "twist", + "umbrella", + "uncle", + "underwear", + "unit", + "use", + "vacation", + "value", + "van", + "vase", + "vegetable", + "veil", + "vein", + "verse", + "vessel", + "view", + "visitor", + "voice", + "volcano", + "walk", + "wall", + "war", + "wash", + "waste", + "watch", + "water", + "wave", + "wax", + "way", + "wealth", + "weather", + "week", + "weight", + "wheel", + "whip", + "whistle", + "window", + "wine", + "wing", + "winter", + "wire", + "wish", + "woman", + "wood", + "wool", + "word", + "work", + "worm", + "wound", + "wrist", + "writer", + "yard", + "yoke", + "zebra", + "zinc", + "zipper", + "zone", +] + + +def random_name() -> str: + """Generate a random name.""" + adjective = random.choice(adjectives) + noun = random.choice(nouns) + number = random.randint(1, 100) + return f"{adjective}-{noun}-{number}" diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/_runner.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/_runner.py new file mode 100644 index 0000000000000000000000000000000000000000..d5c6e8a5cf4f9d09c46e6b9c86a051d98de9b485 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/_runner.py @@ -0,0 +1,2314 @@ +"""V2 Evaluation Interface.""" + +from __future__ import annotations + +import ast +import collections +import concurrent.futures as cf +import functools +import inspect +import io +import itertools +import logging +import pathlib +import queue +import random +import textwrap +import threading +import uuid +from collections.abc import Awaitable, Generator, Iterable, Iterator, Sequence +from contextvars import copy_context +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Literal, + Optional, + TypeVar, + Union, + cast, +) + +from typing_extensions import TypedDict, overload + +import langsmith +from langsmith import env as ls_env +from langsmith import run_helpers as rh +from langsmith import run_trees as rt +from langsmith import schemas +from langsmith import utils as ls_utils +from langsmith._internal._beta_decorator import _warn_once +from langsmith.evaluation.evaluator import ( + SUMMARY_EVALUATOR_T, + ComparisonEvaluationResult, + DynamicComparisonRunEvaluator, + DynamicRunEvaluator, + EvaluationResult, + EvaluationResults, + RunEvaluator, + _normalize_summary_evaluator, + comparison_evaluator, + run_evaluator, +) + +# Python 3.14+ removes ast.Str in favor of ast.Constant +_AST_STR_TYPES: tuple = ( + (ast.Str, ast.Constant) if hasattr(ast, "Str") else (ast.Constant,) +) + + +def _get_str_value(node: ast.expr) -> str: + """Get string value from ast.Str or ast.Constant.""" + return node.value if isinstance(node, ast.Constant) else node.s # type: ignore[return-value,union-attr,attr-defined] + + +if TYPE_CHECKING: + import pandas as pd + from langchain_core.runnables import Runnable + + DataFrame = pd.DataFrame +else: + DataFrame = Any +logger = logging.getLogger(__name__) + +TARGET_T = Union[Callable[[dict], dict], Callable[[dict, dict], dict]] +# Data format: dataset-name, dataset_id, or examples +DATA_T = Union[str, uuid.UUID, Iterable[schemas.Example], schemas.Dataset] +# Summary evaluator runs over the whole dataset +# and reports aggregate metric(s) +# Row-level evaluator +EVALUATOR_T = Union[ + RunEvaluator, + Callable[ + [schemas.Run, Optional[schemas.Example]], + Union[EvaluationResult, EvaluationResults], + ], + Callable[..., Union[dict, EvaluationResults, EvaluationResult]], +] +AEVALUATOR_T = Union[ + Callable[ + [schemas.Run, Optional[schemas.Example]], + Awaitable[Union[EvaluationResult, EvaluationResults]], + ], +] +EXPERIMENT_T = Union[str, uuid.UUID, schemas.TracerSession] + + +@overload +def evaluate( + target: Union[TARGET_T, Runnable, EXPERIMENT_T], + /, + data: Optional[DATA_T] = None, + evaluators: Optional[Sequence[EVALUATOR_T]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: Optional[int] = 0, + num_repetitions: int = 1, + client: Optional[langsmith.Client] = None, + blocking: bool = True, + experiment: Optional[EXPERIMENT_T] = None, + upload_results: bool = True, + **kwargs: Any, +) -> ExperimentResults: ... + + +@overload +def evaluate( + target: Union[tuple[EXPERIMENT_T, EXPERIMENT_T]], + /, + data: Optional[DATA_T] = None, + evaluators: Optional[Sequence[COMPARATIVE_EVALUATOR_T]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: Optional[int] = 0, + num_repetitions: int = 1, + client: Optional[langsmith.Client] = None, + blocking: bool = True, + experiment: Optional[EXPERIMENT_T] = None, + upload_results: bool = True, + **kwargs: Any, +) -> ComparativeExperimentResults: ... + + +def evaluate( + target: Union[TARGET_T, Runnable, EXPERIMENT_T, tuple[EXPERIMENT_T, EXPERIMENT_T]], + /, + data: Optional[DATA_T] = None, + evaluators: Optional[ + Union[Sequence[EVALUATOR_T], Sequence[COMPARATIVE_EVALUATOR_T]] + ] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: Optional[int] = 0, + num_repetitions: int = 1, + client: Optional[langsmith.Client] = None, + blocking: bool = True, + experiment: Optional[EXPERIMENT_T] = None, + upload_results: bool = True, + error_handling: Literal["log", "ignore"] = "log", + **kwargs: Any, +) -> Union[ExperimentResults, ComparativeExperimentResults]: + r"""Evaluate a target system on a given dataset. + + Args: + target (TARGET_T | Runnable | EXPERIMENT_T | Tuple[EXPERIMENT_T, EXPERIMENT_T]): + The target system or experiment(s) to evaluate. + + Can be a function that takes a dict and returns a `dict`, a langchain `Runnable`, an + existing experiment ID, or a two-tuple of experiment IDs. + data (DATA_T): The dataset to evaluate on. + + Can be a dataset name, a list of examples, or a generator of examples. + evaluators (Sequence[EVALUATOR_T] | Sequence[COMPARATIVE_EVALUATOR_T] | None): + A list of evaluators to run on each example. The evaluator signature + depends on the target type. + summary_evaluators (Sequence[SUMMARY_EVALUATOR_T] | None): A list of summary + evaluators to run on the entire dataset. + + Should not be specified if comparing two existing experiments. + metadata (dict | None): Metadata to attach to the experiment. + experiment_prefix (str | None): A prefix to provide for your experiment name. + description (str | None): A free-form text description for the experiment. + max_concurrency (int | None): The maximum number of concurrent + evaluations to run. + + If `None` then no limit is set. If `0` then no concurrency. + client (langsmith.Client | None): The LangSmith client to use. + blocking (bool): Whether to block until the evaluation is complete. + num_repetitions (int): The number of times to run the evaluation. + Each item in the dataset will be run and evaluated this many times. + experiment (schemas.TracerSession | None): An existing experiment to + extend. + + If provided, `experiment_prefix` is ignored. + + For advanced usage only. Should not be specified if target is an existing + experiment or two-tuple fo experiments. + error_handling (str, default="log"): How to handle individual run errors. + + `'log'` will trace the runs with the error message as part of the + experiment, `'ignore'` will not count the run as part of the experiment at + all. + + Returns: + ExperimentResults: If target is a function, `Runnable`, or existing experiment. + ComparativeExperimentResults: If target is a two-tuple of existing experiments. + + Examples: + Prepare the dataset: + + >>> from typing import Sequence + >>> from langsmith import Client + >>> from langsmith.evaluation import evaluate + >>> from langsmith.schemas import Example, Run + >>> client = Client() + >>> dataset = client.clone_public_dataset( + ... "https://smith.langchain.com/public/419dcab2-1d66-4b94-8901-0357ead390df/d" + ... ) + >>> dataset_name = "Evaluate Examples" + + Basic usage: + + >>> def accuracy(run: Run, example: Example): + ... # Row-level evaluator for accuracy. + ... pred = run.outputs["output"] + ... expected = example.outputs["answer"] + ... return {"score": expected.lower() == pred.lower()} + >>> def precision(runs: Sequence[Run], examples: Sequence[Example]): + ... # Experiment-level evaluator for precision. + ... # TP / (TP + FP) + ... predictions = [run.outputs["output"].lower() for run in runs] + ... expected = [example.outputs["answer"].lower() for example in examples] + ... # yes and no are the only possible answers + ... tp = sum([p == e for p, e in zip(predictions, expected) if p == "yes"]) + ... fp = sum([p == "yes" and e == "no" for p, e in zip(predictions, expected)]) + ... return {"score": tp / (tp + fp)} + >>> def predict(inputs: dict) -> dict: + ... # This can be any function or just an API call to your app. + ... return {"output": "Yes"} + >>> results = evaluate( + ... predict, + ... data=dataset_name, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... experiment_prefix="My Experiment", + ... description="Evaluating the accuracy of a simple prediction model.", + ... metadata={ + ... "my-prompt-version": "abcd-1234", + ... }, + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + Evaluating over only a subset of the examples + + >>> experiment_name = results.experiment_name + >>> examples = client.list_examples(dataset_name=dataset_name, limit=5) + >>> results = evaluate( + ... predict, + ... data=examples, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... experiment_prefix="My Experiment", + ... description="Just testing a subset synchronously.", + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + Streaming each prediction to more easily + eagerly debug. + + >>> results = evaluate( + ... predict, + ... data=dataset_name, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... description="I don't even have to block!", + ... blocking=False, + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> for i, result in enumerate(results): # doctest: +ELLIPSIS + ... pass + + + + Evaluating a LangChain object: + + >>> from langchain_core.runnables import chain as as_runnable + >>> @as_runnable + ... def nested_predict(inputs): + ... return {"output": "Yes"} + >>> @as_runnable + ... def lc_predict(inputs): + ... return nested_predict.invoke(inputs) + >>> results = evaluate( + ... lc_predict.invoke, + ... data=dataset_name, + ... evaluators=[accuracy], + ... description="This time we're evaluating a LangChain object.", + ... summary_evaluators=[precision], + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + + !!! warning "Behavior changed in `langsmith` 0.2.0" + + 'max_concurrency' default updated from None (no limit on concurrency) + to 0 (no concurrency at all). + """ # noqa: E501 + if isinstance(target, (str, uuid.UUID, schemas.TracerSession)): + invalid_args = { + "num_repetitions": num_repetitions > 1, + "experiment": bool(experiment), + "upload_results": not upload_results, + "experiment_prefix": bool(experiment_prefix), + "data": bool(data), + } + if any(invalid_args.values()): + msg = ( + f"Received invalid arguments. " + f"{tuple(k for k, v in invalid_args.items() if v)} should not be " + f"specified when target is an existing experiment." + ) + raise ValueError(msg) + target_id = target if isinstance(target, (str, uuid.UUID)) else target.id + logger.debug(f"Running evaluation over existing experiment {target_id}...") + return evaluate_existing( + target, + evaluators=cast(Optional[Sequence[EVALUATOR_T]], evaluators), + summary_evaluators=summary_evaluators, + metadata=metadata, + max_concurrency=max_concurrency, + client=client, + blocking=blocking, + **kwargs, + ) + elif isinstance(target, (list, tuple)): + invalid_args = { + "num_repetitions": num_repetitions > 1, + "experiment": bool(experiment), + "upload_results": not upload_results, + "summary_evaluators": bool(summary_evaluators), + "data": bool(data), + } + if len(target) != 2 or not all( + isinstance(t, (str, uuid.UUID, schemas.TracerSession)) for t in target + ): + msg = ( + "Received invalid target. If a tuple is specified it must have length " + "2 and each element should by the ID or schemas.TracerSession of an " + f"existing experiment. Received {target=}" + ) + raise ValueError(msg) + elif any(invalid_args.values()): + msg = ( + f"Received invalid arguments. " + f"{tuple(k for k, v in invalid_args.items() if v)} should not be " + f"specified when target is two existing experiments." + ) + raise ValueError(msg) + if max_concurrency is not None: + kwargs["max_concurrency"] = max_concurrency + target_ids = [t if isinstance(t, (str, uuid.UUID)) else t.id for t in target] + logger.debug( + f"Running pairwise evaluation over existing experiments {target_ids}..." + ) + return evaluate_comparative( + target, + evaluators=cast(Sequence[COMPARATIVE_EVALUATOR_T], evaluators or ()), + experiment_prefix=experiment_prefix, + description=description, + client=client, + metadata=metadata, + **kwargs, + ) + elif kwargs: + msg = ( + f"Received unsupported arguments {kwargs}. These arguments are not " + f"supported when creating a new experiment." + ) + raise ValueError(msg) + elif not data: + msg = "Must specify 'data' when running evaluations over a target function." + raise ValueError(msg) + elif callable(target) and rh.is_async(target): + msg = ( + "Async functions are not supported by `evaluate`. " + "Please use `aevaluate` instead:\n\n" + "from langsmith import aevaluate\n\n" + "await aevaluate(\n" + " async_target_function,\n" + " data=data,\n" + " evaluators=evaluators,\n" + " # ... other parameters\n" + ")" + ) + raise ValueError(msg) + elif experiment and experiment_prefix: + msg = ( + "Expected at most one of 'experiment' or 'experiment_prefix'," + " but both were provided. " + f"Got: experiment={experiment}, experiment_prefix={experiment_prefix}" + ) + raise ValueError(msg) + else: + if not upload_results: + _warn_once("'upload_results' parameter is in beta.") + logger.debug(f"Running evaluation over target system {target}...") + return _evaluate( + target, + data=data, + evaluators=cast(Optional[Sequence[EVALUATOR_T]], evaluators), + summary_evaluators=summary_evaluators, + metadata=metadata, + experiment_prefix=experiment_prefix, + description=description, + max_concurrency=max_concurrency, + num_repetitions=num_repetitions, + client=client, + blocking=blocking, + experiment=experiment, + upload_results=upload_results, + error_handling=error_handling, + ) + + +def evaluate_existing( + experiment: Union[str, uuid.UUID, schemas.TracerSession], + /, + evaluators: Optional[Sequence[EVALUATOR_T]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + max_concurrency: Optional[int] = 0, + client: Optional[langsmith.Client] = None, + load_nested: bool = False, + blocking: bool = True, +) -> ExperimentResults: + r"""Evaluate existing experiment runs. + + Args: + experiment (Union[str, uuid.UUID]): The identifier of the experiment to evaluate. + evaluators (Optional[Sequence[EVALUATOR_T]]): Optional sequence of evaluators to use for individual run evaluation. + summary_evaluators (Optional[Sequence[SUMMARY_EVALUATOR_T]]): Optional sequence of evaluators + to apply over the entire dataset. + metadata (Optional[dict]): Optional metadata to include in the evaluation results. + max_concurrency (int | None): The maximum number of concurrent + evaluations to run. + + If `None` then no limit is set. If `0` then no concurrency. + client (Optional[langsmith.Client]): Optional Langsmith client to use for evaluation. + load_nested: Whether to load all child runs for the experiment. + + Default is to only load the top-level root runs. + blocking (bool): Whether to block until evaluation is complete. + + Returns: + The evaluation results. + + Environment: + - `LANGSMITH_TEST_CACHE`: If set, API calls will be cached to disk to save time and + cost during testing. + + Recommended to commit the cache files to your repository for faster CI/CD runs. + + Requires the `'langsmith[vcr]'` package to be installed. + + Examples: + Define your evaluators + + >>> from typing import Sequence + >>> from langsmith.schemas import Example, Run + >>> def accuracy(run: Run, example: Example): + ... # Row-level evaluator for accuracy. + ... pred = run.outputs["output"] + ... expected = example.outputs["answer"] + ... return {"score": expected.lower() == pred.lower()} + >>> def precision(runs: Sequence[Run], examples: Sequence[Example]): + ... # Experiment-level evaluator for precision. + ... # TP / (TP + FP) + ... predictions = [run.outputs["output"].lower() for run in runs] + ... expected = [example.outputs["answer"].lower() for example in examples] + ... # yes and no are the only possible answers + ... tp = sum([p == e for p, e in zip(predictions, expected) if p == "yes"]) + ... fp = sum([p == "yes" and e == "no" for p, e in zip(predictions, expected)]) + ... return {"score": tp / (tp + fp)} + + Load the experiment and run the evaluation. + + >>> import uuid + >>> from langsmith import Client + >>> from langsmith.evaluation import evaluate, evaluate_existing + >>> client = Client() + >>> dataset_name = "__doctest_evaluate_existing_" + uuid.uuid4().hex[:8] + >>> dataset = client.create_dataset(dataset_name) + >>> example = client.create_example( + ... inputs={"question": "What is 2+2?"}, + ... outputs={"answer": "4"}, + ... dataset_id=dataset.id, + ... ) + >>> def predict(inputs: dict) -> dict: + ... return {"output": "4"} + >>> # First run inference on the dataset + ... results = evaluate( + ... predict, data=dataset_name, experiment_prefix="doctest_experiment" + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> experiment_id = results.experiment_name + >>> # Wait for the experiment to be fully processed and check if we have results + >>> len(results) > 0 + True + >>> import time + >>> time.sleep(5) # Wait longer for runs to be indexed + >>> results = evaluate_existing( + ... experiment_id, + ... evaluators=[accuracy], + ... summary_evaluators=[precision], + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> client.delete_dataset(dataset_id=dataset.id) + """ # noqa: E501 + client = client or rt.get_cached_client(timeout_ms=(20_000, 90_001)) + project = _load_experiment(experiment, client) + runs = _load_traces(experiment, client, load_nested=load_nested) + data_map = _load_examples_map(client, project) + data = [data_map[cast(uuid.UUID, run.reference_example_id)] for run in runs] + return _evaluate( + runs, + data=data, + evaluators=evaluators, + summary_evaluators=summary_evaluators, + metadata=metadata, + max_concurrency=max_concurrency, + client=client, + blocking=blocking, + experiment=project, + ) + + +class ExperimentResultRow(TypedDict): + run: schemas.Run + example: schemas.Example + evaluation_results: EvaluationResults + + +class ExperimentResults: + """Represents the results of an evaluate() call. + + This class provides an iterator interface to iterate over the experiment results + as they become available. It also provides methods to access the experiment name, + the number of results, and to wait for the results to be processed. + + Methods: + experiment_name() -> str: Returns the name of the experiment. + wait() -> None: Waits for the experiment data to be processed. + """ + + def __init__(self, experiment_manager: _ExperimentManager, blocking: bool = True): + self._manager = experiment_manager + self._results: list[ExperimentResultRow] = [] + self._queue: queue.Queue[ExperimentResultRow] = queue.Queue() + self._processing_complete = threading.Event() + self._processing_error: Optional[BaseException] = None + if not blocking: + self._thread: Optional[threading.Thread] = threading.Thread( + target=self._process_data + ) + self._thread.start() + else: + self._thread = None + self._process_data() + + @property + def experiment_name(self) -> str: + return self._manager.experiment_name + + @property + def experiment_id(self) -> uuid.UUID: + """The ID of the experiment.""" + return self._manager._get_experiment().id + + @property + def url(self) -> Optional[str]: + """The URL of the experiment in the LangSmith UI.""" + experiment = self._manager._get_experiment() + if experiment.url: + project_url = experiment.url.split("?")[0] + base_url = project_url.split("/projects/p/")[0] + return ( + f"{base_url}/datasets/{self._manager.dataset_id}/compare?" + f"selectedSessions={experiment.id}" + ) + return None + + def get_dataset_id(self) -> str: + """Get the ID of the dataset associated with this experiment.""" + return self._manager.dataset_id + + @property + def comparison_url(self) -> Optional[str]: + """The URL to the comparison view for this experiment.""" + return self.url + + def __iter__(self) -> Iterator[ExperimentResultRow]: + ix = 0 + while ( + not self._processing_complete.is_set() + or not self._queue.empty() + or ix < len(self._results) + ): + try: + if ix < len(self._results): + yield self._results[ix] + ix += 1 + else: + self._queue.get(block=True, timeout=0.1) + except queue.Empty: + if self._processing_error is not None: + raise self._processing_error + continue + if self._processing_error is not None: + raise self._processing_error + + def _process_data(self) -> None: + tqdm = _load_tqdm() + try: + results = self._manager.get_results() + for item in tqdm(results): + self._queue.put(item) + self._results.append(item) + + summary_scores = self._manager.get_summary_scores() + self._summary_results = summary_scores + except BaseException as e: + self._processing_error = e + finally: + self._processing_complete.set() + + def __len__(self) -> int: + return len(self._results) + + def to_pandas( + self, start: Optional[int] = 0, end: Optional[int] = None + ) -> DataFrame: + return _to_pandas(self._results, start=start, end=end) + + def _repr_html_(self) -> str: + import importlib.util + + if self._results and importlib.util.find_spec("pandas"): + df = self.to_pandas() + return df._repr_html_() # type: ignore[operator] + else: + return self.__repr__() + + def __repr__(self) -> str: + return f"" + + def wait(self) -> None: + """Wait for the evaluation runner to complete. + + This method blocks the current thread until the evaluation runner has + finished its execution. + """ + if self._thread: + self._thread.join() + if self._processing_error is not None: + raise self._processing_error + + +## Public API for Comparison Experiments + +# Row-level evaluator +COMPARATIVE_EVALUATOR_T = Callable[ + [Sequence[schemas.Run], Optional[schemas.Example]], + Union[ + Union[ComparisonEvaluationResult, dict], + Awaitable[Union[ComparisonEvaluationResult, dict]], + ], +] + + +def evaluate_comparative( + experiments: tuple[EXPERIMENT_T, EXPERIMENT_T], + /, + evaluators: Sequence[COMPARATIVE_EVALUATOR_T], + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: int = 5, + client: Optional[langsmith.Client] = None, + metadata: Optional[dict] = None, + load_nested: bool = False, + randomize_order: bool = False, +) -> ComparativeExperimentResults: + r"""Evaluate existing experiment runs against each other. + + This lets you use pairwise preference scoring to generate more + reliable feedback in your experiments. + + Args: + experiments (Tuple[Union[str, uuid.UUID], Union[str, uuid.UUID]]): + The identifiers of the experiments to compare. + evaluators (Sequence[COMPARATIVE_EVALUATOR_T]): + A list of evaluators to run on each example. + experiment_prefix (Optional[str]): A prefix to provide for your experiment name. + description (Optional[str]): A free-form text description for the experiment. + max_concurrency (int): The maximum number of concurrent evaluations to run. + client (Optional[langsmith.Client]): The LangSmith client to use. + metadata (Optional[dict]): Metadata to attach to the experiment. + load_nested (bool): Whether to load all child runs for the experiment. + + Default is to only load the top-level root runs. + randomize_order (bool): Whether to randomize the order of the outputs for each evaluation. + + Returns: + The results of the comparative evaluation. + + Examples: + Suppose you want to compare two prompts to see which one is more effective. + You would first prepare your dataset: + + >>> from typing import Sequence + >>> from langsmith import Client + >>> from langsmith.evaluation import evaluate + >>> from langsmith.schemas import Example, Run + >>> client = Client() + >>> dataset = client.clone_public_dataset( + ... "https://smith.langchain.com/public/419dcab2-1d66-4b94-8901-0357ead390df/d" + ... ) + >>> dataset_name = "Evaluate Examples" + + Then you would run your different prompts: + >>> import functools + >>> import openai + >>> from langsmith.evaluation import evaluate + >>> from langsmith.wrappers import wrap_openai + >>> oai_client = openai.Client() + >>> wrapped_client = wrap_openai(oai_client) + >>> prompt_1 = "You are a helpful assistant." + >>> prompt_2 = "You are an exceedingly helpful assistant." + >>> def predict(inputs: dict, prompt: str) -> dict: + ... completion = wrapped_client.chat.completions.create( + ... model="gpt-4o-mini", + ... messages=[ + ... {"role": "system", "content": prompt}, + ... { + ... "role": "user", + ... "content": f"Context: {inputs['context']}" + ... f"\n\ninputs['question']", + ... }, + ... ], + ... ) + ... return {"output": completion.choices[0].message.content} + >>> results_1 = evaluate( + ... functools.partial(predict, prompt=prompt_1), + ... data=dataset_name, + ... description="Evaluating our basic system prompt.", + ... blocking=False, # Run these experiments in parallel + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> results_2 = evaluate( + ... functools.partial(predict, prompt=prompt_2), + ... data=dataset_name, + ... description="Evaluating our advanced system prompt.", + ... blocking=False, + ... ) # doctest: +ELLIPSIS + View the evaluation results for experiment:... + >>> results_1.wait() + >>> results_2.wait() + + Finally, you would compare the two prompts directly: + >>> import json + >>> from langsmith.evaluation import evaluate_comparative + >>> from langsmith import schemas + >>> def score_preferences(runs: list, example: schemas.Example): + ... assert len(runs) == 2 # Comparing 2 systems + ... assert isinstance(example, schemas.Example) + ... assert all(run.reference_example_id == example.id for run in runs) + ... pred_a = runs[0].outputs["output"] if runs[0].outputs else "" + ... pred_b = runs[1].outputs["output"] if runs[1].outputs else "" + ... ground_truth = example.outputs["answer"] if example.outputs else "" + ... tools = [ + ... { + ... "type": "function", + ... "function": { + ... "name": "rank_preferences", + ... "description": "Saves the prefered response ('A' or 'B')", + ... "parameters": { + ... "type": "object", + ... "properties": { + ... "reasoning": { + ... "type": "string", + ... "description": "The reasoning behind the choice.", + ... }, + ... "preferred_option": { + ... "type": "string", + ... "enum": ["A", "B"], + ... "description": "The preferred option, either 'A' or 'B'", + ... }, + ... }, + ... "required": ["preferred_option"], + ... }, + ... }, + ... } + ... ] + ... completion = openai.Client().chat.completions.create( + ... model="gpt-4o-mini", + ... messages=[ + ... {"role": "system", "content": "Select the better response."}, + ... { + ... "role": "user", + ... "content": f"Option A: {pred_a}" + ... f"\n\nOption B: {pred_b}" + ... f"\n\nGround Truth: {ground_truth}", + ... }, + ... ], + ... tools=tools, + ... tool_choice={ + ... "type": "function", + ... "function": {"name": "rank_preferences"}, + ... }, + ... ) + ... tool_args = completion.choices[0].message.tool_calls[0].function.arguments + ... loaded_args = json.loads(tool_args) + ... preference = loaded_args["preferred_option"] + ... comment = loaded_args["reasoning"] + ... if preference == "A": + ... return { + ... "key": "ranked_preference", + ... "scores": {runs[0].id: 1, runs[1].id: 0}, + ... "comment": comment, + ... } + ... else: + ... return { + ... "key": "ranked_preference", + ... "scores": {runs[0].id: 0, runs[1].id: 1}, + ... "comment": comment, + ... } + >>> def score_length_difference(runs: list, example: schemas.Example): + ... # Just return whichever response is longer. + ... # Just an example, not actually useful in real life. + ... assert len(runs) == 2 # Comparing 2 systems + ... assert isinstance(example, schemas.Example) + ... assert all(run.reference_example_id == example.id for run in runs) + ... pred_a = runs[0].outputs["output"] if runs[0].outputs else "" + ... pred_b = runs[1].outputs["output"] if runs[1].outputs else "" + ... if len(pred_a) > len(pred_b): + ... return { + ... "key": "length_difference", + ... "scores": {runs[0].id: 1, runs[1].id: 0}, + ... } + ... else: + ... return { + ... "key": "length_difference", + ... "scores": {runs[0].id: 0, runs[1].id: 1}, + ... } + >>> results = evaluate_comparative( + ... [results_1.experiment_name, results_2.experiment_name], + ... evaluators=[score_preferences, score_length_difference], + ... client=client, + ... ) # doctest: +ELLIPSIS + View the pairwise evaluation results at:... + >>> eval_results = list(results) + >>> assert len(eval_results) >= 10 # doctest: +SKIP + >>> assert all( + ... "feedback.ranked_preference" in r["evaluation_results"] + ... for r in eval_results + ... ) # doctest: +SKIP + >>> assert all( + ... "feedback.length_difference" in r["evaluation_results"] + ... for r in eval_results + ... ) # doctest: +SKIP + """ # noqa: E501 + if len(experiments) < 2: + raise ValueError("Comparative evaluation requires at least 2 experiments.") + if not evaluators: + raise ValueError( + "At least one evaluator is required for comparative evaluation." + ) + if max_concurrency < 0: + raise ValueError("max_concurrency must be a positive integer.") + client = client or rt.get_cached_client() + + # TODO: Add information about comparison experiments + projects = [_load_experiment(experiment, client) for experiment in experiments] + ref_datasets_ = [str(p.reference_dataset_id) for p in projects] + if not len(set(ref_datasets_)) == 1: + raise ValueError("All experiments must have the same reference dataset.") + experiment_ids = [p.id for p in projects] + if experiment_prefix is None: + experiment_names = [p.name for p in projects if p.name is not None] + experiment_name = ( + " vs. ".join(experiment_names) + "-" + str(uuid.uuid4().hex[:4]) + ) + else: + experiment_name = experiment_prefix + "-" + str(uuid.uuid4().hex[:8]) + comparative_experiment_id = uuid.uuid4() + comparative_experiment = client.create_comparative_experiment( + experiment_name, + experiments=experiment_ids, + description=description, + metadata=metadata, + id=comparative_experiment_id, + ) + _print_comparative_experiment_start( + cast( + tuple[schemas.TracerSessionResult, schemas.TracerSessionResult], + tuple(projects), + ), + comparative_experiment, + ) + runs = [ + _load_traces(experiment, client, load_nested=load_nested) + for experiment in experiments + ] + # Only check intersections for the experiments + examples_intersection = None + for runs_list in runs: + example_ids_set = {run.reference_example_id for run in runs_list} + if examples_intersection is None: + examples_intersection = example_ids_set + else: + examples_intersection &= example_ids_set + example_ids_nullable = ( + list(examples_intersection) if examples_intersection is not None else [] + ) + example_ids = [eid for eid in example_ids_nullable if eid is not None] + # TODO: Warn if different dataset versions, etc. are used in the different + # experiments. We aren't providing any training wheels here. + batch_size = 99 + data = {} + for i in range(0, len(example_ids), batch_size): + example_ids_batch = example_ids[i : i + batch_size] + for e in client.list_examples( + dataset_id=projects[0].reference_dataset_id, + as_of=projects[0].metadata.get("dataset_version"), + example_ids=example_ids_batch, + ): + data[e.id] = e + runs_dict: dict[uuid.UUID, list[schemas.Run]] = collections.defaultdict(list) + for runs_list in runs: + for run in runs_list: + if run.reference_example_id in data: + runs_dict[cast(uuid.UUID, run.reference_example_id)].append(run) + + comparators = [comparison_evaluator(evaluator) for evaluator in evaluators or []] + results: dict = {} + + def evaluate_and_submit_feedback( + runs_list: list[schemas.Run], + example: schemas.Example, + comparator: DynamicComparisonRunEvaluator, + executor: cf.Executor, + ) -> tuple[uuid.UUID, ComparisonEvaluationResult]: + feedback_group_id = uuid.uuid4() + if randomize_order: + random.shuffle(runs_list) + with rh.tracing_context(project_name="evaluators", client=client): + result = comparator.compare_runs(runs_list, example) + if client is None: + raise ValueError("Client is required to submit feedback.") + comments = ( + {str(rid): result.comment for rid in result.scores} + if isinstance(result.comment, str) + else (result.comment or {}) + ) + # Build a lookup for run metadata + runs_by_id = {str(run.id): run for run in runs_list} + for run_id, score in result.scores.items(): + run = runs_by_id.get(str(run_id)) + executor.submit( + client.create_feedback, + run_id=run_id, + key=result.key, + score=score, + comment=comments.get(str(run_id)), + comparative_experiment_id=comparative_experiment.id, + source_run_id=result.source_run_id, + feedback_group_id=feedback_group_id, + session_id=run.session_id if run else None, + start_time=run.start_time if run else None, + ) + return example.id, result + + tqdm = _load_tqdm() + with ls_utils.ContextThreadPoolExecutor( + max_workers=max_concurrency or 1 + ) as executor: + futures = [] + for example_id, runs_list in tqdm(runs_dict.items()): + results[example_id] = {"runs": runs_list} + for comparator in comparators: + if max_concurrency > 1: + future = executor.submit( + evaluate_and_submit_feedback, + runs_list, + data[example_id], + comparator, + executor, + ) + futures.append(future) + else: + _, result = evaluate_and_submit_feedback( + runs_list, data[example_id], comparator, executor + ) + results[example_id][f"feedback.{result.key}"] = result + if futures: + cf.wait(futures) + for future in futures: + example_id, result = future.result() + results[example_id][f"feedback.{result.key}"] = result + + return ComparativeExperimentResults(results, data) + + +class ComparativeExperimentResults: + """Represents the results of an evaluate_comparative() call. + + This class provides an iterator interface to iterate over the experiment results + as they become available. It also provides methods to access the experiment name, + the number of results, and to wait for the results to be processed. + + Methods: + experiment_name() -> str: Returns the name of the experiment. + wait() -> None: Waits for the experiment data to be processed. + """ + + def __init__( + self, + results: dict, + examples: Optional[dict[uuid.UUID, schemas.Example]] = None, + ): + self._results = results + self._examples = examples + + def __getitem__(self, key): + """Return the result associated with the given key.""" + return self._results[key] + + def __iter__(self): + for key, value in self._results.items(): + yield { + "example": self._examples[key] if self._examples else None, + "evaluation_results": value, + } + + +## Private API + + +def _print_comparative_experiment_start( + experiments: tuple[schemas.TracerSession, schemas.TracerSession], + comparative_experiment: schemas.ComparativeExperiment, +) -> None: + url = experiments[0].url or experiments[1].url + if url: + project_url = url.split("?")[0] + dataset_id = comparative_experiment.reference_dataset_id + base_url = project_url.split("/projects/p/")[0] + comparison_url = ( + f"{base_url}/datasets/{dataset_id}/compare?" + f"selectedSessions={'%2C'.join([str(e.id) for e in experiments])}" + f"&comparativeExperiment={comparative_experiment.id}" + ) + print( # noqa: T201 + f"View the pairwise evaluation results at:\n{comparison_url}\n\n" + ) + + +def _is_callable(target: Union[TARGET_T, Iterable[schemas.Run], Runnable]) -> bool: + return callable(target) or _is_langchain_runnable(target) + + +def _evaluate( + target: Union[TARGET_T, Iterable[schemas.Run], Runnable], + /, + data: DATA_T, + evaluators: Optional[Sequence[EVALUATOR_T]] = None, + summary_evaluators: Optional[Sequence[SUMMARY_EVALUATOR_T]] = None, + metadata: Optional[dict] = None, + experiment_prefix: Optional[str] = None, + description: Optional[str] = None, + max_concurrency: Optional[int] = None, + num_repetitions: int = 1, + client: Optional[langsmith.Client] = None, + blocking: bool = True, + experiment: Optional[Union[schemas.TracerSession, str, uuid.UUID]] = None, + upload_results: bool = True, + error_handling: Literal["log", "ignore"] = "log", +) -> ExperimentResults: + # Initialize the experiment manager. + client = client or rt.get_cached_client() + runs = None if _is_callable(target) else cast(Iterable[schemas.Run], target) + experiment_, runs = _resolve_experiment(experiment, runs, client) + + manager = _ExperimentManager( + data, + client=client, + metadata=metadata, + experiment=experiment_ or experiment_prefix, + description=description, + num_repetitions=num_repetitions, + # If provided, we don't need to create a new experiment. + runs=runs, + # Create or resolve the experiment. + include_attachments=_include_attachments(target, evaluators), + upload_results=upload_results, + error_handling=error_handling, + ).start() + if cache_dir := ls_utils.get_cache_dir(None): + cache_path = pathlib.Path(cache_dir) / f"{manager.dataset_id}.yaml" + else: + cache_path = None + with ls_utils.with_optional_cache(cache_path, ignore_hosts=[client.api_url]): + if _is_callable(target): + # Add predictions to the experiment. + manager = manager.with_predictions( + cast(TARGET_T, target), max_concurrency=max_concurrency + ) + if evaluators: + # Apply evaluators to the predictions. + manager = manager.with_evaluators( + evaluators, max_concurrency=max_concurrency + ) + if summary_evaluators: + # Apply the experiment-level summary evaluators. + manager = manager.with_summary_evaluators(summary_evaluators) + # Start consuming the results. + results = ExperimentResults(manager, blocking=blocking) + return results + + +def _is_uuid(value: str) -> bool: + try: + uuid.UUID(value) + return True + except ValueError: + return False + + +def _load_experiment( + project: EXPERIMENT_T, client: langsmith.Client +) -> schemas.TracerSession: + if isinstance(project, schemas.TracerSession): + return project + elif isinstance(project, uuid.UUID) or _is_uuid(project): + return client.read_project(project_id=project) + else: + return client.read_project(project_name=project) + + +def _load_traces( + project: Union[str, uuid.UUID, schemas.TracerSession], + client: langsmith.Client, + load_nested: bool = False, +) -> list[schemas.Run]: + """Load nested traces for a given project.""" + is_root = None if load_nested else True + if isinstance(project, schemas.TracerSession): + runs = client.list_runs(project_id=project.id, is_root=is_root) + elif isinstance(project, uuid.UUID) or _is_uuid(project): + runs = client.list_runs(project_id=project, is_root=is_root) + else: + runs = client.list_runs(project_name=project, is_root=is_root) + if not load_nested: + return list(runs) + + treemap: collections.defaultdict[uuid.UUID, list[schemas.Run]] = ( + collections.defaultdict(list) + ) + results = [] + all_runs = {} + for run in runs: + if run.parent_run_id is not None: + treemap[run.parent_run_id].append(run) + else: + results.append(run) + all_runs[run.id] = run + for run_id, child_runs in treemap.items(): + all_runs[run_id].child_runs = sorted(child_runs, key=lambda r: r.dotted_order) + return results + + +def _load_examples_map( + client: langsmith.Client, project: schemas.TracerSession +) -> dict[uuid.UUID, schemas.Example]: + return { + e.id: e + for e in client.list_examples( + dataset_id=project.reference_dataset_id, + as_of=project.metadata.get("dataset_version"), + ) + } + + +IT = TypeVar("IT") + + +def _load_tqdm() -> Callable[[IT], IT]: + try: + from tqdm.auto import tqdm + except ImportError: + return lambda x: x + return tqdm # type: ignore[return-value] + + +ET = TypeVar("ET", bound="_ExperimentManagerMixin") + + +class _ExperimentManagerMixin: + def __init__( + self, + /, + experiment: Optional[Union[schemas.TracerSession, str]], + metadata: Optional[dict] = None, + client: Optional[langsmith.Client] = None, + description: Optional[str] = None, + ): + self.client = client or rt.get_cached_client() + self._experiment: Optional[schemas.TracerSession] = None + if experiment is None: + self._experiment_name = _get_random_name() + elif isinstance(experiment, str): + self._experiment_name = experiment + "-" + str(uuid.uuid4().hex[:8]) + else: + self._experiment_name = cast(str, experiment.name) + self._experiment = experiment + + metadata = metadata or {} + if not metadata.get("revision_id"): + metadata = { + "revision_id": ls_env.get_langchain_env_var_metadata().get( + "revision_id" + ), + **metadata, + } + self._metadata = metadata or {} + self._description = description + + @property + def experiment_name(self) -> str: + if self._experiment_name is not None: + return self._experiment_name + raise ValueError( + "Experiment name not provided, and experiment not yet started." + ) + + def _get_experiment(self) -> schemas.TracerSession: + if self._experiment is None: + raise ValueError("Experiment not started yet.") + return self._experiment + + def _get_experiment_metadata(self): + project_metadata = self._metadata or {} + project_metadata["__ls_runner"] = "py_sdk_evaluate" + git_info = ls_env.get_git_info() + if git_info: + project_metadata = { + **project_metadata, + "git": git_info, + } + if self._experiment: + project_metadata = { + **self._experiment.metadata, + **project_metadata, + } + return project_metadata + + def _create_experiment( + self, dataset_id: uuid.UUID, metadata: dict + ) -> schemas.TracerSession: + # There is a chance of name collision, so we'll retry + starting_name = self._experiment_name + num_attempts = 10 + for _ in range(num_attempts): + try: + return self.client.create_project( + self._experiment_name, + description=self._description, + reference_dataset_id=dataset_id, + metadata=metadata, + ) + except ls_utils.LangSmithConflictError: + self._experiment_name = f"{starting_name}-{str(uuid.uuid4().hex[:6])}" + raise ValueError( + f"Could not find a unique experiment name in {num_attempts} attempts." + " Please try again with a different experiment name." + ) + + def _get_project(self, first_example: schemas.Example) -> schemas.TracerSession: + if self._experiment is None: + project_metadata = self._get_experiment_metadata() + project = self._create_experiment( + first_example.dataset_id, project_metadata + ) + else: + project = self._experiment + return project + + def _print_experiment_start( + self, project: Optional[schemas.TracerSession], first_example: schemas.Example + ) -> None: + if project and project.url: + project_url = project.url.split("?")[0] + dataset_id = first_example.dataset_id + base_url = project_url.split("/projects/p/")[0] + comparison_url = ( + f"{base_url}/datasets/{dataset_id}/compare?" + f"selectedSessions={project.id}" + ) + print( # noqa: T201 + f"View the evaluation results for experiment: '{self.experiment_name}'" + f" at:\n{comparison_url}\n\n" + ) + else: + # HACKHACK + print( # noqa: T201 + "Starting evaluation of experiment: %s", self.experiment_name + ) + + +class _ExperimentManager(_ExperimentManagerMixin): + """Manage the execution of experiments. + + Supports lazily running predictions and evaluations in parallel to facilitate + result streaming and early debugging. + + Args: + data (DATA_T): The data used for the experiment. Can be a dataset name or ID OR + a generator of examples. + num_repetitions (int): The number of times to run over the data. + runs (Optional[Iterable[schemas.Run]]): The runs associated with the experiment + predictions. + experiment (Optional[schemas.TracerSession]): The tracer session + associated with the experiment. + experiment_prefix (Optional[str]): The prefix for the experiment name. + metadata (Optional[dict]): Additional metadata for the experiment. + client (Optional[langsmith.Client]): The Langsmith client used for + the experiment. + evaluation_results (Optional[Iterable[EvaluationResults]]): The evaluation + sresults for the experiment. + summary_results (Optional[Iterable[EvaluationResults]]): The aggregate results + for the experiment. + """ + + def __init__( + self, + data: DATA_T, + /, + experiment: Optional[Union[schemas.TracerSession, str]], + metadata: Optional[dict] = None, + client: Optional[langsmith.Client] = None, + runs: Optional[Iterable[schemas.Run]] = None, + evaluation_results: Optional[Iterable[EvaluationResults]] = None, + summary_results: Optional[Iterable[EvaluationResults]] = None, + description: Optional[str] = None, + num_repetitions: int = 1, + include_attachments: bool = False, + reuse_attachments: bool = False, + upload_results: bool = True, + attachment_raw_data_dict: Optional[dict] = None, + error_handling: Literal["log", "ignore"] = "log", + ): + super().__init__( + experiment=experiment, + metadata=metadata, + client=client, + description=description, + ) + self._data = data + self._examples: Optional[Iterable[schemas.Example]] = None + self._runs = runs + self._evaluation_results = evaluation_results + self._summary_results = summary_results + self._num_repetitions = num_repetitions + self._include_attachments = include_attachments + self._reuse_attachments = reuse_attachments + self._upload_results = upload_results + self._attachment_raw_data_dict = attachment_raw_data_dict + self._error_handling = error_handling + + def _reset_example_attachment_readers( + self, example: schemas.Example + ) -> schemas.Example: + """Reset attachment readers for an example. + + This is only in the case that an attachment is going to be used by more + than 1 callable (target + evaluators). In that case we keep a single copy + of the attachment data in `self._attachment_raw_data_dict`, and create + readers from that data. This makes it so that we don't have to keep + copies of the same data in memory, instead we can just create readers + from the same data. + """ + if not hasattr(example, "attachments") or not example.attachments: + return example + + new_attachments: dict[str, schemas.AttachmentInfo] = {} + for name, attachment in example.attachments.items(): + if ( + self._attachment_raw_data_dict is not None + and str(example.id) + name in self._attachment_raw_data_dict + ): + new_attachments[name] = { + "presigned_url": attachment["presigned_url"], + "reader": io.BytesIO( + self._attachment_raw_data_dict[str(example.id) + name] + ), + "mime_type": attachment["mime_type"], + } + else: + new_attachments[name] = attachment + + # Create a new Example instance with the updated attachments + return schemas.Example( + id=example.id, + created_at=example.created_at, + dataset_id=example.dataset_id, + inputs=example.inputs, + outputs=example.outputs, + metadata=example.metadata, + modified_at=example.modified_at, + source_run_id=example.source_run_id, + attachments=new_attachments, + _host_url=example._host_url, + _tenant_id=example._tenant_id, + ) + + @property + def examples(self) -> Iterable[schemas.Example]: + if self._examples is None: + self._examples = _resolve_data( + self._data, + client=self.client, + include_attachments=self._include_attachments, + ) + if self._reuse_attachments and self._attachment_raw_data_dict is None: + examples_copy, self._examples = itertools.tee(self._examples) + self._attachment_raw_data_dict = { + str(e.id) + name: value["reader"].read() + for e in examples_copy + for name, value in (e.attachments or {}).items() + } + if self._num_repetitions > 1: + examples_list = list(self._examples) + self._examples = itertools.chain.from_iterable( + [ + self._reset_example_attachment_readers(example) + for example in examples_list + ] + for _ in range(self._num_repetitions) + ) + self._examples, examples_iter = itertools.tee(self._examples) + return examples_iter + + @property + def dataset_id(self) -> str: + if self._experiment is None or not getattr( + self._experiment, "reference_dataset_id", None + ): + example = next(iter(self.examples)) + return str(example.dataset_id) + return str( + cast(schemas.TracerSessionResult, self._experiment).reference_dataset_id + ) + + @property + def evaluation_results(self) -> Iterable[EvaluationResults]: + if self._evaluation_results is None: + return ({"results": []} for _ in self.examples) + return self._evaluation_results + + @property + def runs(self) -> Iterable[schemas.Run]: + if self._runs is None: + raise ValueError( + "Runs not provided in this experiment. Please predict first." + ) + self._runs, runs_iter = itertools.tee(self._runs) + return runs_iter + + def start(self) -> _ExperimentManager: + first_example = next(itertools.islice(self.examples, 1)) + project = self._get_project(first_example) if self._upload_results else None + self._print_experiment_start(project, first_example) + self._metadata["num_repetitions"] = self._num_repetitions + return self._copy(self.examples, experiment=project) + + def with_predictions( + self, + target: TARGET_T, + /, + max_concurrency: Optional[int] = None, + ) -> _ExperimentManager: + """Lazily apply the target function to the experiment.""" + context = copy_context() + _experiment_results = context.run( + self._predict, + target, + max_concurrency=max_concurrency, + include_attachments=_target_include_attachments(target), + ) + r1, r2 = itertools.tee(_experiment_results, 2) + return self._copy( + (pred["example"] for pred in r1), runs=(pred["run"] for pred in r2) + ) + + def with_evaluators( + self, + evaluators: Sequence[ + Union[ + EVALUATOR_T, + RunEvaluator, + ] + ], + *, + max_concurrency: Optional[int] = None, + ) -> _ExperimentManager: + """Lazily apply the provided evaluators to the experiment.""" + evaluators = _resolve_evaluators(evaluators) + context = copy_context() + experiment_results = context.run( + self._score, evaluators, max_concurrency=max_concurrency + ) + # Split the generator into three so the manager + # can consume each value individually. + r1, r2, r3 = itertools.tee(experiment_results, 3) + return self._copy( + (result["example"] for result in r1), + runs=(result["run"] for result in r2), + evaluation_results=(result["evaluation_results"] for result in r3), + ) + + def with_summary_evaluators( + self, + summary_evaluators: Sequence[SUMMARY_EVALUATOR_T], + ) -> _ExperimentManager: + """Lazily apply the provided summary evaluators to the experiment.""" + wrapped_evaluators = _wrap_summary_evaluators(summary_evaluators) + context = copy_context() + aggregate_feedback_gen = context.run( + self._apply_summary_evaluators, wrapped_evaluators + ) + return self._copy( + self.examples, runs=self.runs, summary_results=aggregate_feedback_gen + ) + + def get_results(self) -> Iterable[ExperimentResultRow]: + """Return the traces, evaluation results, and associated examples.""" + for run, example, evaluation_results in zip( + self.runs, self.examples, self.evaluation_results + ): + yield ExperimentResultRow( + run=run, + example=example, + evaluation_results=evaluation_results, + ) + + def get_summary_scores(self) -> dict[str, list[dict]]: + """If `summary_evaluators` were applied, consume and return the results.""" + if self._summary_results is None: + return {"results": []} + # Consume the generator + return { + "results": [ + res # type: ignore[misc] + for results in self._summary_results + for res in results["results"] + ] + } + + # Private methods + + def _predict( + self, + target: TARGET_T, + /, + max_concurrency: Optional[int] = None, + include_attachments: bool = False, + ) -> Generator[_ForwardResults, None, None]: + """Run the target function on the examples.""" + fn = _ensure_traceable(target) + + if max_concurrency == 0: + for example in self.examples: + yield _forward( + fn, + example, + self.experiment_name, + self._metadata, + self.client, + self._upload_results, + include_attachments, + self._error_handling, + ) + + else: + with ls_utils.ContextThreadPoolExecutor(max_concurrency) as executor: + futures = [ + executor.submit( + _forward, + fn, + example, + self.experiment_name, + self._metadata, + self.client, + self._upload_results, + include_attachments, + self._error_handling, + ) + for example in self.examples + ] + for future in cf.as_completed(futures): + yield future.result() + # Close out the project. + self._end() + + def _run_evaluators( + self, + evaluators: Sequence[RunEvaluator], + current_results: ExperimentResultRow, + executor: cf.ThreadPoolExecutor, + ) -> ExperimentResultRow: + current_context = rh.get_tracing_context() + metadata = { + **(current_context["metadata"] or {}), + **{ + "experiment": self.experiment_name, + "reference_example_id": current_results["example"].id, + "reference_run_id": current_results["run"].id, + }, + } + with rh.tracing_context( + **{ + **current_context, + "project_name": "evaluators", + "metadata": metadata, + "enabled": "local" if not self._upload_results else True, + "client": self.client, + } + ): + run = current_results["run"] + example = current_results["example"] + eval_results = current_results["evaluation_results"] + for evaluator in evaluators: + evaluator_run_id = uuid.uuid4() + try: + evaluator_response = evaluator.evaluate_run( # type: ignore[call-arg] + run=run, + example=example, + evaluator_run_id=evaluator_run_id, + ) + + eval_results["results"].extend( + self.client._select_eval_results(evaluator_response) + ) + if self._upload_results: + # TODO: This is a hack + self.client._log_evaluation_feedback( + evaluator_response, run=run, _executor=executor + ) + except Exception as e: + try: + feedback_keys = _extract_feedback_keys(evaluator) + + error_response = EvaluationResults( + results=[ + EvaluationResult( + key=key, + source_run_id=evaluator_run_id, + comment=repr(e), + extra={"error": True}, + ) + for key in feedback_keys + ] + ) + eval_results["results"].extend( + self.client._select_eval_results(error_response) + ) + if self._upload_results: + # TODO: This is a hack + self.client._log_evaluation_feedback( + error_response, run=run, _executor=executor + ) + except Exception as e2: + logger.debug(f"Error parsing feedback keys: {e2}") + pass + logger.error( + f"Error running evaluator {repr(evaluator)} on" + f" run {run.id if run else ''}: {repr(e)}", + exc_info=True, + ) + if example.attachments is not None: + for attachment in example.attachments: + reader = example.attachments[attachment]["reader"] + reader.seek(0) + + return ExperimentResultRow( + run=run, + example=example, + evaluation_results=eval_results, + ) + + def _score( + self, + evaluators: Sequence[RunEvaluator], + max_concurrency: Optional[int] = None, + ) -> Iterable[ExperimentResultRow]: + """Run the evaluators on the prediction stream. + + Expects runs to be available in the manager. + (e.g. from a previous prediction step) + """ + with ls_utils.ContextThreadPoolExecutor( + max_workers=max_concurrency or 1 + ) as executor: + if max_concurrency == 0: + context = copy_context() + for current_results in self.get_results(): + yield context.run( + self._run_evaluators, + evaluators, + current_results, + executor, + ) + else: + futures = set() + for current_results in self.get_results(): + futures.add( + executor.submit( + self._run_evaluators, + evaluators, + current_results, + executor, + ) + ) + try: + # Since prediction may be slow, yield (with a timeout) to + # allow for early results to be emitted. + for future in cf.as_completed(futures, timeout=0.001): + yield future.result() + futures.remove(future) + except (cf.TimeoutError, TimeoutError): + pass + for future in cf.as_completed(futures): + result = future.result() + yield result + + def _apply_summary_evaluators( + self, summary_evaluators: Sequence[SUMMARY_EVALUATOR_T] + ) -> Generator[EvaluationResults, None, None]: + runs, examples = [], [] + for run, example in zip(self.runs, self.examples): + runs.append(run) + examples.append(example) + aggregate_feedback = [] + with ls_utils.ContextThreadPoolExecutor() as executor: + project_id = self._get_experiment().id if self._upload_results else None + current_context = rh.get_tracing_context() + metadata = { + **(current_context["metadata"] or {}), + **{ + "experiment": self.experiment_name, + "experiment_id": project_id, + }, + } + with rh.tracing_context( + **{ + **current_context, + "project_name": "evaluators", + "metadata": metadata, + "client": self.client, + "enabled": "local" if not self._upload_results else True, + } + ): + for evaluator in summary_evaluators: + try: + summary_eval_result = evaluator(runs, examples) + # TODO: Expose public API for this. + flattened_results = self.client._select_eval_results( + summary_eval_result, + fn_name=evaluator.__name__, + ) + aggregate_feedback.extend(flattened_results) + if self._upload_results: + for result in flattened_results: + feedback = result.model_dump(exclude={"target_run_id"}) + evaluator_info = feedback.pop("evaluator_info", None) + executor.submit( + self.client.create_feedback, + **feedback, + run_id=None, + project_id=project_id, + source_info=evaluator_info, + ) + except Exception as e: + logger.error( + f"Error running summary evaluator {repr(evaluator)}: {e}", + exc_info=True, + ) + yield {"results": aggregate_feedback} + + def _get_dataset_version(self) -> Optional[str]: + examples = list(self.examples) + modified_at = [ex.modified_at for ex in examples if ex.modified_at] + # Should always be defined in practice when fetched, + # but the typing permits None + max_modified_at = max(modified_at) if modified_at else None + return max_modified_at.isoformat() if max_modified_at else None + + def _get_dataset_splits(self) -> Optional[list[str]]: + examples = list(self.examples) + splits = set() + for example in examples: + if ( + example.metadata + and example.metadata.get("dataset_split") + and isinstance(example.metadata["dataset_split"], list) + ): + for split in example.metadata["dataset_split"]: + if isinstance(split, str): + splits.add(split) + else: + splits.add("base") + + return list(splits) + + def _end(self) -> None: + if not self._upload_results: + return + experiment = self._experiment + if experiment is None: + raise ValueError("Experiment not started yet.") + + project_metadata = self._get_experiment_metadata() + project_metadata["dataset_version"] = self._get_dataset_version() + project_metadata["dataset_splits"] = self._get_dataset_splits() + self.client.update_project( + experiment.id, + metadata={ + **experiment.metadata, + **project_metadata, + }, + ) + + def _copy(self, *args: Any, **kwargs: Any) -> _ExperimentManager: + default_args = (self._data,) + default_kwargs = { + "experiment": self._experiment, + "metadata": self._metadata, + "runs": self._runs, + "client": self.client, + "evaluation_results": self._evaluation_results, + "summary_results": self._summary_results, + "include_attachments": self._include_attachments, + "reuse_attachments": self._reuse_attachments, + "upload_results": self._upload_results, + "attachment_raw_data_dict": self._attachment_raw_data_dict, + "error_handling": self._error_handling, + } + full_args = list(args) + list(default_args[len(args) :]) + full_kwargs = {**default_kwargs, **kwargs} + return self.__class__(*full_args, **full_kwargs) + + +def _resolve_evaluators( + evaluators: Sequence[Union[EVALUATOR_T, RunEvaluator, AEVALUATOR_T]], +) -> Sequence[RunEvaluator]: + results = [] + for evaluator in evaluators: + if isinstance(evaluator, RunEvaluator): + results.append(evaluator) + else: + results.append(run_evaluator(evaluator)) + return results + + +def _wrap_summary_evaluators( + evaluators: Sequence[SUMMARY_EVALUATOR_T], +) -> list[SUMMARY_EVALUATOR_T]: + def _wrap(evaluator: SUMMARY_EVALUATOR_T) -> SUMMARY_EVALUATOR_T: + eval_name = getattr(evaluator, "__name__", "BatchEvaluator") + evaluator = _normalize_summary_evaluator(evaluator) + + @functools.wraps(evaluator) + def _wrapper_inner( + runs: Sequence[schemas.Run], examples: Sequence[schemas.Example] + ) -> Union[EvaluationResult, EvaluationResults]: + @rh.traceable(name=eval_name) + def _wrapper_super_inner( + runs_: str, examples_: str + ) -> Union[EvaluationResult, EvaluationResults]: + return evaluator(list(runs), list(examples)) + + return _wrapper_super_inner( + f"Runs[] (Length={len(runs)})", f"Examples[] (Length={len(examples)})" + ) + + return _wrapper_inner + + results = [] + for evaluator in evaluators: + results.append(_wrap(evaluator)) + return results + + +class _ForwardResults(TypedDict): + run: schemas.Run + example: schemas.Example + + +def _forward( + fn: rh.SupportsLangsmithExtra, + example: schemas.Example, + experiment_name: str, + metadata: dict, + client: langsmith.Client, + upload_results: bool, + include_attachments: bool = False, + error_handling: Literal["log", "ignore"] = "log", +) -> _ForwardResults: + run: Optional[schemas.RunBase] = None + + def _get_run(r: rt.RunTree) -> None: + nonlocal run + run = r + + def _set_reference_example_id(r: rt.RunTree) -> None: + r.reference_example_id = example.id + + example_version = (example.modified_at or example.created_at).isoformat() + langsmith_extra = rh.LangSmithExtra( + on_end=_get_run, + project_name=experiment_name, + metadata={**metadata, "example_version": example_version}, + client=client, + ) + if error_handling == "log": + langsmith_extra["reference_example_id"] = example.id + elif error_handling == "ignore": + # Only set the reference_example_id if the run succeeds. + langsmith_extra["_on_success"] = _set_reference_example_id + else: + raise ValueError(f"Unrecognized error_handling value: {error_handling=}") + + with rh.tracing_context(enabled="local" if not upload_results else True): + try: + arg_names = _get_target_args(fn) + args = [getattr(example, argn) for argn in arg_names] + fn(*args, langsmith_extra=langsmith_extra) + # Reset attachment readers if attachments were used. + if include_attachments and example.attachments is not None: + for attachment in example.attachments: + reader = example.attachments[attachment]["reader"] + reader.seek(0) + except Exception as e: + logger.error( + f"Error running target function: {e}", exc_info=True, stacklevel=1 + ) + return _ForwardResults(run=cast(schemas.Run, run), example=example) + + +def _is_valid_uuid(value: str) -> bool: + try: + uuid.UUID(value) + return True + except ValueError: + return False + + +def _resolve_data( + data: DATA_T, + *, + client: langsmith.Client, + include_attachments: bool = False, +) -> Iterable[schemas.Example]: + """Return the examples for the given dataset.""" + if isinstance(data, uuid.UUID): + return client.list_examples( + dataset_id=data, include_attachments=include_attachments + ) + elif isinstance(data, str) and _is_valid_uuid(data): + return client.list_examples( + dataset_id=uuid.UUID(data), include_attachments=include_attachments + ) + elif isinstance(data, str): + return client.list_examples( + dataset_name=data, include_attachments=include_attachments + ) + elif isinstance(data, schemas.Dataset): + return client.list_examples( + dataset_id=data.id, include_attachments=include_attachments + ) + return data + + +def _default_process_inputs(inputs: dict) -> dict: + return inputs["inputs"] if "inputs" in inputs else inputs + + +def _ensure_traceable( + target: TARGET_T | rh.SupportsLangsmithExtra[[dict], dict] | Runnable, +) -> rh.SupportsLangsmithExtra[[dict], dict]: + """Ensure the target function is traceable.""" + if not _is_callable(target): + raise ValueError( + "Target must be a callable function or a langchain/langgraph object. For " + "example:\n\n" + "def predict(inputs: dict) -> dict:\n" + " # do work, like chain.invoke(inputs)\n" + " return {...}\n\n" + "evaluate(\n" + " predict,\n" + " ...\n" + ")" + ) + + if rh.is_traceable_function(target): + fn: rh.SupportsLangsmithExtra[[dict], dict] = target + else: + if _is_langchain_runnable(target): + target = target.invoke # type: ignore[union-attr] + fn = rh.traceable(name="Target", process_inputs=_default_process_inputs)( + cast(Callable, target) + ) + return fn + + +def _include_attachments(target: Any, evaluators: Optional[Sequence]) -> bool: + return _target_include_attachments(target) or bool( + _evaluators_include_attachments(evaluators) + ) + + +def _evaluators_include_attachments(evaluators: Optional[Sequence]) -> int: + if evaluators is None: + return 0 + + return sum(_evaluator_uses_attachments(e) for e in evaluators) + + +def _evaluator_uses_attachments(evaluator: Any) -> bool: + if not callable(evaluator): + return False + sig = inspect.signature(evaluator) + params = list(sig.parameters.values()) + positional_params = [ + p for p in params if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) + ] + return any(p.name == "attachments" for p in positional_params) + + +def _target_include_attachments(target: Any) -> bool: + """Whether the target function accepts attachments.""" + return "attachments" in _get_target_args(target) + + +def _get_target_args(target: Any) -> list[str]: + """Whether the target function accepts attachments.""" + if not callable(target): + return [] + if _is_langchain_runnable(target): + return ["inputs"] + # Check function signature + sig = inspect.signature(target) + params = list(sig.parameters.values()) + positional_params = [ + p for p in params if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) + ] + positional_no_default = [p for p in positional_params if p.default is p.empty] + + if len(positional_params) == 0: + raise ValueError( + "Target function must accept at least one positional argument (inputs)." + ) + elif len(positional_no_default) > 3: + raise ValueError( + "Target function must accept at most three " + "arguments without default values: (inputs, attachments, metadata)." + ) + elif len(positional_no_default) > 1 and { + p.name for p in positional_no_default + }.difference(["inputs", "attachments", "metadata"]): + raise ValueError( + "When passing multiple positional arguments without default values, they " + "must be named 'inputs', 'attachments', or 'metadata'. Received: " + f"{[p.name for p in positional_no_default]}" + ) + else: + args = [] + for p in positional_params[:3]: + if p.name in {"inputs", "attachments", "metadata"}: + args.append(p.name) + else: + break + return args or ["inputs"] + + +def _resolve_experiment( + experiment: Optional[Union[schemas.TracerSession, str, uuid.UUID]], + runs: Optional[Iterable[schemas.Run]], + client: langsmith.Client, +) -> tuple[ + Optional[Union[schemas.TracerSession, str]], Optional[Iterable[schemas.Run]] +]: + # TODO: Remove this, handle outside the manager + if experiment is not None: + if isinstance(experiment, schemas.TracerSession): + experiment_ = experiment + else: + experiment_ = _load_experiment(experiment, client) + + if not experiment_.name: + raise ValueError("Experiment name must be defined if provided.") + if not experiment_.reference_dataset_id: + raise ValueError( + "Experiment must have an associated reference_dataset_id, " + "but none was provided." + ) + return experiment_, runs + # If we have runs, that means the experiment was already started. + if runs is not None: + runs_, runs = itertools.tee(runs) + first_run = next(runs_) + experiment_ = client.read_project(project_id=first_run.session_id) + if not experiment_.name: + raise ValueError("Experiment name not found for provided runs.") + return experiment_, runs + return None, None + + +def _get_random_name() -> str: + from langsmith.evaluation._name_generation import random_name # noqa: F401 + + return random_name() + + +def _extract_feedback_keys(evaluator: RunEvaluator): + if isinstance(evaluator, DynamicRunEvaluator): + if getattr(evaluator, "func", None): + return _extract_code_evaluator_feedback_keys(evaluator.func) + elif getattr(evaluator, "afunc", None): + return _extract_code_evaluator_feedback_keys(evaluator.afunc) + # TODO: Support for DynamicComparisonRunEvaluator + if hasattr(evaluator, "evaluator"): + # LangChainStringEvaluator + if getattr(getattr(evaluator, "evaluator"), "evaluation_name", None): + return [evaluator.evaluator.evaluation_name] + return [] + + +def _extract_code_evaluator_feedback_keys(func: Callable) -> list[str]: + python_code = inspect.getsource(func) + + def extract_dict_keys(node): + if isinstance(node, ast.Dict): + keys = [] + key_value = None + for key, value in zip(node.keys, node.values): + if isinstance(key, _AST_STR_TYPES): + key_str = _get_str_value(key) + if key_str == "key" and isinstance(value, _AST_STR_TYPES): + key_value = _get_str_value(value) + return [key_value] if key_value else keys + elif ( + isinstance(node, ast.Call) + and isinstance(node.func, ast.Name) + and node.func.id == "dict" + ): + for keyword in node.keywords: + if keyword.arg == "key" and isinstance(keyword.value, _AST_STR_TYPES): + return [_get_str_value(keyword.value)] + return [] + + def extract_evaluation_result_key(node): + if ( + isinstance(node, ast.Call) + and isinstance(node.func, ast.Name) + and node.func.id == "EvaluationResult" + ): + for keyword in node.keywords: + if keyword.arg == "key" and isinstance(keyword.value, _AST_STR_TYPES): + return [_get_str_value(keyword.value)] + return [] + + def extract_evaluation_results_keys(node, variables): + if ( + isinstance(node, ast.Call) + and isinstance(node.func, ast.Name) + and node.func.id == "EvaluationResults" + ): + for keyword in node.keywords: + if keyword.arg == "results": + if isinstance(keyword.value, ast.Name): + return variables.get(keyword.value.id, []) + elif isinstance(keyword.value, ast.List): + keys = [] + for elt in keyword.value.elts: + keys.extend(extract_evaluation_result_key(elt)) + return keys + elif isinstance(node, ast.Dict): + for key, value in zip(node.keys, node.values): + if isinstance(key, _AST_STR_TYPES) and _get_str_value(key) == "results": + if isinstance(value, ast.List): + keys = [] + for elt in value.elts: + if isinstance(elt, ast.Dict): + for elt_key, elt_value in zip(elt.keys, elt.values): + if ( + isinstance(elt_key, _AST_STR_TYPES) + and _get_str_value(elt_key) == "key" + ): + if isinstance(elt_value, _AST_STR_TYPES): + keys.append(_get_str_value(elt_value)) + elif ( + isinstance(elt, ast.Call) + and isinstance(elt.func, ast.Name) + and elt.func.id in ("EvaluationResult", "dict") + ): + for keyword in elt.keywords: + if keyword.arg == "key" and isinstance( + keyword.value, _AST_STR_TYPES + ): + keys.append(_get_str_value(keyword.value)) + + return keys + return [] + + python_code = textwrap.dedent(python_code) + + try: + tree = ast.parse(python_code) + function_def = tree.body[0] + if not isinstance(function_def, (ast.FunctionDef, ast.AsyncFunctionDef)): + return [] + + variables = {} + keys = [] + + for node in ast.walk(function_def): + if isinstance(node, ast.Assign): + if isinstance(node.value, ast.List): + list_keys = [] + for elt in node.value.elts: + list_keys.extend(extract_evaluation_result_key(elt)) + if isinstance(node.targets[0], ast.Name): + variables[node.targets[0].id] = list_keys + elif isinstance(node, ast.Return) and node.value is not None: + dict_keys = extract_dict_keys(node.value) + eval_result_key = extract_evaluation_result_key(node.value) + eval_results_keys = extract_evaluation_results_keys( + node.value, variables + ) + + keys.extend(dict_keys) + keys.extend(eval_result_key) + keys.extend(eval_results_keys) + + # If no keys found, return the function name + return keys if keys else [function_def.name] + + except SyntaxError: + return [] + + +def _to_pandas( + results: list[ExperimentResultRow], + start: Optional[int] = 0, + end: Optional[int] = None, +): + try: + import pandas as pd + except ImportError as e: + raise ImportError( + "The 'pandas' library is required to use the 'to_pandas' function. " + "Please install it using 'pip install pandas' or " + "'conda install pandas' before calling this method." + ) from e + + return pd.DataFrame(_flatten_experiment_results(results, start=start, end=end)) + + +def _flatten_experiment_results( + results: list[ExperimentResultRow], + start: Optional[int] = 0, + end: Optional[int] = None, +): + return [ + { + **{f"inputs.{k}": v for k, v in (x["example"].inputs or {}).items()}, + **{f"outputs.{k}": v for k, v in (x["run"].outputs or {}).items()}, + "error": x["run"].error, + **( + {f"reference.{k}": v for k, v in x["example"].outputs.items()} + if x["example"].outputs is not None + else {} + ), + **{ + f"feedback.{r.key}": r.score if r.score is not None else r.value + for r in x["evaluation_results"]["results"] + }, + "execution_time": ( + (x["run"].end_time - x["run"].start_time).total_seconds() + if x["run"].end_time + else None + ), + "example_id": x["run"].reference_example_id, + "id": x["run"].id, + } + for x in results[start:end] + ] + + +@functools.lru_cache(maxsize=1) +def _import_langchain_runnable() -> Optional[type]: + try: + from langchain_core.runnables import Runnable + + return Runnable + except ImportError: + return None + + +def _is_langchain_runnable(o: Any) -> bool: + return bool((Runnable := _import_langchain_runnable()) and isinstance(o, Runnable)) diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/evaluator.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..5c2e75d2d217e2bbd5eb2579931fa3075be423c5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/evaluator.py @@ -0,0 +1,1001 @@ +"""This module contains the evaluator classes for evaluating runs.""" + +from __future__ import annotations + +import asyncio +import inspect +import logging +import uuid +from abc import abstractmethod +from collections.abc import Awaitable, Sequence +from functools import wraps +from typing import ( + Any, + Callable, + Literal, + Optional, + Union, + cast, +) + +from pydantic import BaseModel, ConfigDict, Field, ValidationError, model_validator +from typing_extensions import TypedDict + +from langsmith import run_helpers as rh +from langsmith import schemas +from langsmith.schemas import SCORE_TYPE, VALUE_TYPE, Example, Run + +logger = logging.getLogger(__name__) + + +class Category(TypedDict): + """A category for categorical feedback.""" + + value: Optional[Union[float, int]] + """The numeric score/ordinal corresponding to this category.""" + label: str + """The label for this category.""" + + +class FeedbackConfig(TypedDict, total=False): + """Configuration to define a type of feedback. + + Applied on on the first creation of a `feedback_key`. + """ + + type: Literal["continuous", "categorical", "freeform"] + """The type of feedback.""" + min: Optional[Union[float, int]] + """The minimum permitted value (if continuous type).""" + max: Optional[Union[float, int]] + """The maximum value permitted value (if continuous type).""" + categories: Optional[list[Union[Category, dict]]] + + +class EvaluationResult(BaseModel): + """Evaluation result.""" + + key: str + """The aspect, metric name, or label for this evaluation.""" + score: SCORE_TYPE = None + """The numeric score for this evaluation.""" + value: VALUE_TYPE = None + """The value for this evaluation, if not numeric.""" + metadata: Optional[dict] = None + """Arbitrary metadata attached to the evaluation.""" + comment: Optional[str] = None + """An explanation regarding the evaluation.""" + correction: Optional[dict] = None + """What the correct value should be, if applicable.""" + evaluator_info: dict = Field(default_factory=dict) + """Additional information about the evaluator.""" + feedback_config: Optional[Union[FeedbackConfig, dict]] = None + """The configuration used to generate this feedback.""" + source_run_id: Optional[Union[uuid.UUID, str]] = None + """The ID of the trace of the evaluator itself.""" + target_run_id: Optional[Union[uuid.UUID, str]] = None + """The ID of the trace this evaluation is applied to. + + If none provided, the evaluation feedback is applied to the + root trace being.""" + extra: Optional[dict] = None + """Metadata for the evaluator run.""" + + model_config = ConfigDict(extra="forbid") + + @model_validator(mode="after") + def check_value_non_numeric(self) -> EvaluationResult: + """Warn when numeric values are passed via the `value` field.""" + if self.score is None and isinstance(self.value, (int, float)): + logger.warning( + "Numeric values should be provided in the 'score' field, not 'value'." + f" Got: {self.value}" + ) + return self + + +class EvaluationResults(TypedDict, total=False): + """Batch evaluation results. + + This makes it easy for your evaluator to return multiple + metrics at once. + """ + + results: list[EvaluationResult] + """The evaluation results.""" + + +class RunEvaluator: + """Evaluator interface class.""" + + @abstractmethod + def evaluate_run( + self, + run: Run, + example: Optional[Example] = None, + evaluator_run_id: Optional[uuid.UUID] = None, + ) -> Union[EvaluationResult, EvaluationResults]: + """Evaluate an example.""" + + async def aevaluate_run( + self, + run: Run, + example: Optional[Example] = None, + evaluator_run_id: Optional[uuid.UUID] = None, + ) -> Union[EvaluationResult, EvaluationResults]: + """Evaluate an example asynchronously.""" + current_context = rh.get_tracing_context() + + def _run_with_context(): + with rh.tracing_context(**current_context): + return self.evaluate_run(run, example, evaluator_run_id) + + return await asyncio.get_running_loop().run_in_executor(None, _run_with_context) + + +_RUNNABLE_OUTPUT = Union[EvaluationResult, EvaluationResults, dict] + + +class ComparisonEvaluationResult(BaseModel): + """Feedback scores for the results of comparative evaluations. + + These are generated by functions that compare two or more runs, + returning a ranking or other feedback. + """ + + key: str + """The aspect, metric name, or label for this evaluation.""" + scores: dict[Union[uuid.UUID, str], SCORE_TYPE] + """The scores for each run in the comparison.""" + source_run_id: Optional[Union[uuid.UUID, str]] = None + """The ID of the trace of the evaluator itself.""" + comment: Optional[Union[str, dict[Union[uuid.UUID, str], str]]] = None + """Comment for the scores. If a string, it's shared across all target runs. + + If a `dict`, it maps run IDs to individual comments. + """ + + +_COMPARISON_OUTPUT = Union[ComparisonEvaluationResult, dict] + + +class DynamicRunEvaluator(RunEvaluator): + """A dynamic evaluator that wraps a function and transforms it into a `RunEvaluator`. + + This class is designed to be used with the `@run_evaluator` decorator, allowing + functions that take a `Run` and an optional `Example` as arguments, and return + an `EvaluationResult` or `EvaluationResults`, to be used as instances of `RunEvaluator`. + + Attributes: + func (Callable): The function that is wrapped by this evaluator. + """ # noqa: E501 + + def __init__( + self, + func: Callable[ + [Run, Optional[Example]], + Union[_RUNNABLE_OUTPUT, Awaitable[_RUNNABLE_OUTPUT]], + ], + # Async function to be used for async evaluation. Optional + afunc: Optional[ + Callable[ + [Run, Optional[Example]], + Awaitable[_RUNNABLE_OUTPUT], + ] + ] = None, + ): + """Initialize the `DynamicRunEvaluator` with a given function. + + Args: + func (Callable): A function that takes a `Run` and an optional `Example` as + arguments, and returns a dict or `ComparisonEvaluationResult`. + """ + (func, prepare_inputs) = _normalize_evaluator_func(func) + if afunc: + (afunc, prepare_inputs) = _normalize_evaluator_func(afunc) # type: ignore[assignment] + + def process_inputs(inputs: dict) -> dict: + if prepare_inputs is None: + return inputs + (_, _, traced_inputs) = prepare_inputs( + inputs.get("run"), inputs.get("example") + ) + return traced_inputs + + wraps(func)(self) + from langsmith import run_helpers # type: ignore + + if afunc is not None: + self.afunc = run_helpers.ensure_traceable( + afunc, process_inputs=process_inputs + ) + self._name = getattr(afunc, "__name__", "DynamicRunEvaluator") + if inspect.iscoroutinefunction(func): + if afunc is not None: + raise TypeError( + "Func was provided as a coroutine function, but afunc was " + "also provided. If providing both, func should be a regular " + "function to avoid ambiguity." + ) + self.afunc = run_helpers.ensure_traceable( + func, process_inputs=process_inputs + ) + self._name = getattr(func, "__name__", "DynamicRunEvaluator") + else: + self.func = run_helpers.ensure_traceable( + cast(Callable[[Run, Optional[Example]], _RUNNABLE_OUTPUT], func), + process_inputs=process_inputs, + ) + self._name = getattr(func, "__name__", "DynamicRunEvaluator") + + def _coerce_evaluation_result( + self, + result: Union[EvaluationResult, dict], + source_run_id: uuid.UUID, + allow_no_key: bool = False, + ) -> EvaluationResult: + if isinstance(result, EvaluationResult): + if not result.source_run_id: + result.source_run_id = source_run_id + return result + try: + if not result: + raise ValueError( + "Expected an EvaluationResult object, or dict with a metric" + f" 'key' and optional 'score'; got empty result: {result}" + ) + if "key" not in result and allow_no_key: + result["key"] = self._name + if all(k not in result for k in ("score", "value", "comment")): + raise ValueError( + "Expected an EvaluationResult object, or dict with a metric" + f" 'key' and optional 'score' or categorical 'value'; got {result}" + ) + return EvaluationResult(**{"source_run_id": source_run_id, **result}) + except ValidationError as e: + raise ValueError( + "Expected an EvaluationResult object, or dict with a metric" + f" 'key' and optional 'score'; got {result}" + ) from e + + def _coerce_evaluation_results( + self, + results: Union[dict, EvaluationResults], + source_run_id: uuid.UUID, + ) -> Union[EvaluationResult, EvaluationResults]: + if "results" in results: + cp = results.copy() + cp["results"] = [ + self._coerce_evaluation_result(r, source_run_id=source_run_id) + for r in results["results"] + ] + return EvaluationResults(**cp) + + return self._coerce_evaluation_result( + cast(dict, results), source_run_id=source_run_id, allow_no_key=True + ) + + def _format_result( + self, + result: Union[ + EvaluationResult, EvaluationResults, dict, str, int, bool, float, list + ], + source_run_id: uuid.UUID, + ) -> Union[EvaluationResult, EvaluationResults]: + if isinstance(result, EvaluationResult): + if not result.source_run_id: + result.source_run_id = source_run_id + return result + result = _format_evaluator_result(result) + return self._coerce_evaluation_results(result, source_run_id) + + @property + def is_async(self) -> bool: + """Check if the evaluator function is asynchronous. + + Returns: + bool: `True` if the evaluator function is asynchronous, `False` otherwise. + """ + return hasattr(self, "afunc") + + def evaluate_run( + self, + run: Run, + example: Optional[Example] = None, + evaluator_run_id: Optional[uuid.UUID] = None, + ) -> Union[EvaluationResult, EvaluationResults]: + """Evaluate a run using the wrapped function. + + This method directly invokes the wrapped function with the provided arguments. + + Args: + run (Run): The run to be evaluated. + example (Optional[Example]): An optional example to be used in the evaluation. + + Returns: + Union[EvaluationResult, EvaluationResults]: The result of the evaluation. + """ # noqa: E501 + if not hasattr(self, "func"): + running_loop = asyncio.get_event_loop() + if running_loop.is_running(): + raise RuntimeError( + "Cannot call `evaluate_run` on an async run evaluator from" + " within an running event loop. Use `aevaluate_run` instead." + ) + else: + return running_loop.run_until_complete(self.aevaluate_run(run, example)) + if evaluator_run_id is None: + evaluator_run_id = uuid.uuid4() + metadata: dict[str, Any] = {"target_run_id": run.id} + if getattr(run, "session_id", None): + metadata["experiment"] = str(run.session_id) + result = self.func( + run, + example, + langsmith_extra={"run_id": evaluator_run_id, "metadata": metadata}, + ) + return self._format_result(result, evaluator_run_id) + + async def aevaluate_run( + self, + run: Run, + example: Optional[Example] = None, + evaluator_run_id: Optional[uuid.UUID] = None, + ): + """Evaluate a run asynchronously using the wrapped async function. + + This method directly invokes the wrapped async function with the + provided arguments. + + Args: + run (Run): The run to be evaluated. + example (Optional[Example]): An optional example to be used + in the evaluation. + + Returns: + Union[EvaluationResult, EvaluationResults]: The result of the evaluation. + """ + if not hasattr(self, "afunc"): + return await super().aevaluate_run(run, example) + if evaluator_run_id is None: + evaluator_run_id = uuid.uuid4() + metadata: dict[str, Any] = {"target_run_id": run.id} + if getattr(run, "session_id", None): + metadata["experiment"] = str(run.session_id) + result = await self.afunc( + run, + example, + langsmith_extra={"run_id": evaluator_run_id, "metadata": metadata}, + ) + return self._format_result(result, evaluator_run_id) + + def __call__( + self, run: Run, example: Optional[Example] = None + ) -> Union[EvaluationResult, EvaluationResults]: + """Make the evaluator callable, allowing it to be used like a function. + + This method enables the evaluator instance to be called directly, forwarding the + call to `evaluate_run`. + + Args: + run (Run): The run to be evaluated. + example (Optional[Example]): An optional example to be used in the evaluation. + + Returns: + Union[EvaluationResult, EvaluationResults]: The result of the evaluation. + """ # noqa: E501 + return self.evaluate_run(run, example) + + def __repr__(self) -> str: + """Represent the DynamicRunEvaluator object.""" + return f"" + + +def run_evaluator( + func: Callable[ + [Run, Optional[Example]], Union[_RUNNABLE_OUTPUT, Awaitable[_RUNNABLE_OUTPUT]] + ], +): + """Create a run evaluator from a function. + + Decorator that transforms a function into a `RunEvaluator`. + """ + return DynamicRunEvaluator(func) + + +_MAXSIZE = 10_000 + + +def _maxsize_repr(obj: Any): + s = repr(obj) + if len(s) > _MAXSIZE: + s = s[: _MAXSIZE - 4] + "...)" + return s + + +class DynamicComparisonRunEvaluator: + """Compare predictions (as traces) from 2 or more runs.""" + + def __init__( + self, + func: Callable[ + [Sequence[Run], Optional[Example]], + Union[_COMPARISON_OUTPUT, Awaitable[_COMPARISON_OUTPUT]], + ], + # Async function to be used for async evaluation. Optional + afunc: Optional[ + Callable[ + [Sequence[Run], Optional[Example]], + Awaitable[_COMPARISON_OUTPUT], + ] + ] = None, + ): + """Initialize the `DynamicRunEvaluator` with a given function. + + Args: + func (Callable): A function that takes a `Run` and an optional `Example` as + arguments, and returns an `EvaluationResult` or `EvaluationResults`. + """ + (func, prepare_inputs) = _normalize_comparison_evaluator_func(func) + if afunc: + (afunc, prepare_inputs) = _normalize_comparison_evaluator_func(afunc) # type: ignore[assignment] + + def process_inputs(inputs: dict) -> dict: + if prepare_inputs is None: + return inputs + (_, _, traced_inputs) = prepare_inputs( + inputs.get("runs"), inputs.get("example") + ) + return traced_inputs + + wraps(func)(self) + from langsmith import run_helpers # type: ignore + + if afunc is not None: + self.afunc = run_helpers.ensure_traceable( + afunc, process_inputs=process_inputs + ) + self._name = getattr(afunc, "__name__", "DynamicRunEvaluator") + if inspect.iscoroutinefunction(func): + if afunc is not None: + raise TypeError( + "Func was provided as a coroutine function, but afunc was " + "also provided. If providing both, func should be a regular " + "function to avoid ambiguity." + ) + self.afunc = run_helpers.ensure_traceable( + func, process_inputs=process_inputs + ) + self._name = getattr(func, "__name__", "DynamicRunEvaluator") + else: + self.func = run_helpers.ensure_traceable( + cast( + Callable[ + [Sequence[Run], Optional[Example]], + _COMPARISON_OUTPUT, + ], + func, + ), + process_inputs=process_inputs, + ) + self._name = getattr(func, "__name__", "DynamicRunEvaluator") + + @property + def is_async(self) -> bool: + """Check if the evaluator function is asynchronous. + + Returns: + bool: `True` if the evaluator function is asynchronous, `False` otherwise. + """ + return hasattr(self, "afunc") + + def compare_runs( + self, runs: Sequence[Run], example: Optional[Example] = None + ) -> ComparisonEvaluationResult: + """Compare runs to score preferences. + + Args: + runs: A list of runs to compare. + example: An optional example to be used in the evaluation. + + """ # noqa: E501 + if not hasattr(self, "func"): + running_loop = asyncio.get_event_loop() + if running_loop.is_running(): + raise RuntimeError( + "Cannot call `evaluate_run` on an async run evaluator from" + " within an running event loop. Use `aevaluate_run` instead." + ) + else: + return running_loop.run_until_complete( + self.acompare_runs(runs, example) + ) + source_run_id = uuid.uuid4() + tags = self._get_tags(runs) + # TODO: Add metadata for the "comparison experiment" here + result = self.func( + runs, + example, + langsmith_extra={"run_id": source_run_id, "tags": tags}, + ) + return self._format_results(result, source_run_id, runs) + + async def acompare_runs( + self, runs: Sequence[Run], example: Optional[Example] = None + ) -> ComparisonEvaluationResult: + """Evaluate a run asynchronously using the wrapped async function. + + This method directly invokes the wrapped async function with the + provided arguments. + + Args: + runs (Run): The runs to be evaluated. + example (Optional[Example]): An optional example to be used + in the evaluation. + + Returns: + ComparisonEvaluationResult: The result of the evaluation. + """ + if not hasattr(self, "afunc"): + return self.compare_runs(runs, example) + source_run_id = uuid.uuid4() + tags = self._get_tags(runs) + # TODO: Add metadata for the "comparison experiment" here + result = await self.afunc( + runs, + example, + langsmith_extra={"run_id": source_run_id, "tags": tags}, + ) + return self._format_results(result, source_run_id, runs) + + def __call__( + self, runs: Sequence[Run], example: Optional[Example] = None + ) -> ComparisonEvaluationResult: + """Make the evaluator callable, allowing it to be used like a function. + + This method enables the evaluator instance to be called directly, forwarding the + call to `evaluate_run`. + + Args: + run (Run): The run to be evaluated. + example (Optional[Example]): An optional example to be used in the evaluation. + + Returns: + ComparisonEvaluationResult: The result of the evaluation. + """ # noqa: E501 + return self.compare_runs(runs, example) + + def __repr__(self) -> str: + """Represent the DynamicRunEvaluator object.""" + return f"" + + @staticmethod + def _get_tags(runs: Sequence[Run]) -> list[str]: + """Extract tags from runs.""" + # Add tags to support filtering + tags = [] + for run in runs: + tags.append("run:" + str(run.id)) + if getattr(run, "session_id", None): + tags.append("experiment:" + str(run.session_id)) + return tags + + def _format_results( + self, + result: Union[dict, list, ComparisonEvaluationResult], + source_run_id: uuid.UUID, + runs: Sequence[Run], + ) -> ComparisonEvaluationResult: + if isinstance(result, ComparisonEvaluationResult): + if not result.source_run_id: + result.source_run_id = source_run_id + return result + elif isinstance(result, list): + result = { + "scores": {run.id: score for run, score in zip(runs, result)}, + "key": self._name, + "source_run_id": source_run_id, + } + elif isinstance(result, dict): + if "key" not in result: + result["key"] = self._name + else: + msg = ( + "Expected 'dict', 'list' or 'ComparisonEvaluationResult' result " + f"object. Received: {result=}" + ) + raise ValueError(msg) + try: + return ComparisonEvaluationResult( + **{"source_run_id": source_run_id, **result} + ) + except ValidationError as e: + raise ValueError( + f"Expected a dictionary with a 'key' and dictionary of scores mapping" + "run IDs to numeric scores, or ComparisonEvaluationResult object," + f" got {result}" + ) from e + + +def comparison_evaluator( + func: Callable[ + [Sequence[Run], Optional[Example]], + Union[_COMPARISON_OUTPUT, Awaitable[_COMPARISON_OUTPUT]], + ], +) -> DynamicComparisonRunEvaluator: + """Create a comaprison evaluator from a function.""" + return DynamicComparisonRunEvaluator(func) + + +def _normalize_evaluator_func( + func: Callable, +) -> tuple[ + Union[ + Callable[[Run, Optional[Example]], _RUNNABLE_OUTPUT], + Callable[[Run, Optional[Example]], Awaitable[_RUNNABLE_OUTPUT]], + ], + Optional[Callable[..., dict]], +]: + supported_args = ( + "run", + "example", + "inputs", + "outputs", + "reference_outputs", + "attachments", + ) + sig = inspect.signature(func) + all_args = [pname for pname, p in sig.parameters.items() if p.kind != p.VAR_KEYWORD] + args_with_defaults = [ + pname + for pname, p in sig.parameters.items() + if p.default is not inspect.Parameter.empty + ] + if not all_args or ( + not all( + pname in supported_args or pname in args_with_defaults for pname in all_args + ) + and len([a for a in all_args if a not in args_with_defaults]) != 2 + ): + msg = ( + f"Invalid evaluator function. Must have at least one " + f"argument. Supported arguments are {supported_args}. Please " + f"see https://docs.smith.langchain.com/evaluation/how_to_guides/evaluation/evaluate_llm_application#use-custom-evaluators" + # noqa: E501 + ) + raise ValueError(msg) + # For backwards compatibility we assume custom arg names are Run and Example + # types, respectively. + elif not all( + pname in supported_args or pname in args_with_defaults for pname in all_args + ) or all_args == [ + "run", + "example", + ]: + return func, None + else: + if inspect.iscoroutinefunction(func): + + def _prepare_inputs( + run: Run, example: Optional[Example] + ) -> tuple[list, dict, dict]: + arg_map = { + "run": run, + "example": example, + "inputs": example.inputs if example else {}, + "outputs": run.outputs or {}, + "attachments": example.attachments or {} if example else {}, + "reference_outputs": example.outputs or {} if example else {}, + } + kwargs = {} + args = [] + traced_inputs = {} + for param_name, param in sig.parameters.items(): + # Could have params with defaults that are not in the arg map + if param_name in arg_map: + if param.kind in ( + param.POSITIONAL_OR_KEYWORD, + param.POSITIONAL_ONLY, + ): + args.append(arg_map[param_name]) + else: + kwargs[param_name] = arg_map[param_name] + traced_inputs[param_name] = ( + _maxsize_repr(arg_map[param_name]) + if param_name in ("run", "example") + else arg_map[param_name] + ) + return args, kwargs, traced_inputs + + async def awrapper( + run: Run, example: Optional[Example] + ) -> _RUNNABLE_OUTPUT: + (args, kwargs, _) = _prepare_inputs(run, example) + return await func(*args, **kwargs) + + awrapper.__name__ = ( + getattr(func, "__name__") + if hasattr(func, "__name__") + else awrapper.__name__ + ) + return (awrapper, _prepare_inputs) # type: ignore[return-value] + + else: + + def _prepare_inputs( + run: Run, example: Optional[Example] + ) -> tuple[list, dict, dict]: + arg_map = { + "run": run, + "example": example, + "inputs": example.inputs if example else {}, + "outputs": run.outputs or {}, + "attachments": example.attachments or {} if example else {}, + "reference_outputs": example.outputs or {} if example else {}, + } + kwargs = {} + args = [] + traced_inputs = {} + for param_name, param in sig.parameters.items(): + # Could have params with defaults that are not in the arg map + if param_name in arg_map: + if param.kind in ( + param.POSITIONAL_OR_KEYWORD, + param.POSITIONAL_ONLY, + ): + args.append(arg_map[param_name]) + else: + kwargs[param_name] = arg_map[param_name] + traced_inputs[param_name] = ( + _maxsize_repr(arg_map[param_name]) + if param_name in ("run", "example") + else arg_map[param_name] + ) + return args, kwargs, traced_inputs + + def wrapper(run: Run, example: Optional[Example]) -> _RUNNABLE_OUTPUT: + (args, kwargs, _) = _prepare_inputs(run, example) + return func(*args, **kwargs) + + wrapper.__name__ = ( + getattr(func, "__name__") + if hasattr(func, "__name__") + else wrapper.__name__ + ) + return (wrapper, _prepare_inputs) # type: ignore[return-value] + + +def _normalize_comparison_evaluator_func( + func: Callable, +) -> tuple[ + Union[ + Callable[[Sequence[Run], Optional[Example]], _COMPARISON_OUTPUT], + Callable[[Sequence[Run], Optional[Example]], Awaitable[_COMPARISON_OUTPUT]], + ], + Optional[Callable[..., dict]], +]: + supported_args = ("runs", "example", "inputs", "outputs", "reference_outputs") + sig = inspect.signature(func) + all_args = [pname for pname, p in sig.parameters.items() if p.kind != p.VAR_KEYWORD] + args_with_defaults = [ + pname + for pname, p in sig.parameters.items() + if p.default is not inspect.Parameter.empty + ] + if not all_args or ( + not all( + pname in supported_args or pname in args_with_defaults for pname in all_args + ) + and len([a for a in all_args if a not in args_with_defaults]) != 2 + ): + msg = ( + f"Invalid evaluator function. Must have at least one " + f"argument. Supported arguments are {supported_args}. Please " + f"see https://docs.smith.langchain.com/evaluation/how_to_guides/evaluation/evaluate_llm_application#use-custom-evaluators" + # noqa: E501 + ) + raise ValueError(msg) + # For backwards compatibility we assume custom arg names are List[Run] and + # List[Example] types, respectively. + elif not all( + pname in supported_args or pname in args_with_defaults for pname in all_args + ) or all_args == [ + "runs", + "example", + ]: + return func, None + else: + if inspect.iscoroutinefunction(func): + + def _prepare_inputs( + runs: Sequence[Run], example: Optional[Example] + ) -> tuple[list, dict, dict]: + arg_map = { + "runs": runs, + "example": example, + "inputs": example.inputs if example else {}, + "outputs": [run.outputs or {} for run in runs], + "reference_outputs": example.outputs or {} if example else {}, + } + kwargs = {} + args = [] + traced_inputs = {} + for param_name, param in sig.parameters.items(): + # Could have params with defaults that are not in the arg map + if param_name in arg_map: + if param.kind in ( + param.POSITIONAL_OR_KEYWORD, + param.POSITIONAL_ONLY, + ): + args.append(arg_map[param_name]) + else: + kwargs[param_name] = arg_map[param_name] + traced_inputs[param_name] = ( + _maxsize_repr(arg_map[param_name]) + if param_name in ("runs", "example") + else arg_map[param_name] + ) + return args, kwargs, traced_inputs + + async def awrapper( + runs: Sequence[Run], example: Optional[Example] + ) -> _COMPARISON_OUTPUT: + (args, kwargs, _) = _prepare_inputs(runs, example) + return await func(*args, **kwargs) + + awrapper.__name__ = ( + getattr(func, "__name__") + if hasattr(func, "__name__") + else awrapper.__name__ + ) + return awrapper, _prepare_inputs # type: ignore[return-value] + + else: + + def _prepare_inputs( + runs: Sequence[Run], example: Optional[Example] + ) -> tuple[list, dict, dict]: + arg_map = { + "runs": runs, + "example": example, + "inputs": example.inputs if example else {}, + "outputs": [run.outputs or {} for run in runs], + "reference_outputs": example.outputs or {} if example else {}, + } + kwargs = {} + args = [] + traced_inputs = {} + for param_name, param in sig.parameters.items(): + # Could have params with defaults that are not in the arg map + if param_name in arg_map: + if param.kind in ( + param.POSITIONAL_OR_KEYWORD, + param.POSITIONAL_ONLY, + ): + args.append(arg_map[param_name]) + else: + kwargs[param_name] = arg_map[param_name] + traced_inputs[param_name] = ( + _maxsize_repr(arg_map[param_name]) + if param_name in ("runs", "example") + else arg_map[param_name] + ) + return args, kwargs, traced_inputs + + def wrapper( + runs: Sequence[Run], example: Optional[Example] + ) -> _COMPARISON_OUTPUT: + (args, kwargs, _) = _prepare_inputs(runs, example) + return func(*args, **kwargs) + + wrapper.__name__ = ( + getattr(func, "__name__") + if hasattr(func, "__name__") + else wrapper.__name__ + ) + return wrapper, _prepare_inputs # type: ignore[return-value] + + +def _format_evaluator_result( + result: Union[EvaluationResults, dict, str, int, bool, float, list], +) -> Union[EvaluationResults, dict]: + if isinstance(result, (bool, float, int)): + result = {"score": result} + elif not result: + raise ValueError( + f"Expected a non-empty dict, str, bool, int, float, list, " + f"EvaluationResult, or EvaluationResults. Got {result}" + ) + elif isinstance(result, list): + if not all(isinstance(x, dict) for x in result): + raise ValueError( + f"Expected a list of dicts or EvaluationResults. Received {result}." + ) + result = {"results": result} # type: ignore[misc] + elif isinstance(result, str): + result = {"value": result} + elif isinstance(result, dict): + pass + else: + raise ValueError( + f"Expected a dict, str, bool, int, float, list, EvaluationResult, or " + f"EvaluationResults. Got {result}" + ) + return result + + +SUMMARY_EVALUATOR_T = Union[ + Callable[ + [Sequence[schemas.Run], Sequence[schemas.Example]], + Union[EvaluationResult, EvaluationResults], + ], + Callable[ + [list[schemas.Run], list[schemas.Example]], + Union[EvaluationResult, EvaluationResults], + ], +] + + +def _normalize_summary_evaluator(func: Callable) -> SUMMARY_EVALUATOR_T: + supported_args = ("runs", "examples", "inputs", "outputs", "reference_outputs") + sig = inspect.signature(func) + all_args = [pname for pname, p in sig.parameters.items()] + args_with_defaults = [ + pname + for pname, p in sig.parameters.items() + if p.default is not inspect.Parameter.empty + ] + if not all_args or ( + not all( + pname in supported_args or pname in args_with_defaults for pname in all_args + ) + and len([a for a in all_args if a not in args_with_defaults]) != 2 + ): + msg = ( + f"Invalid evaluator function. Must have at least one " + f"argument. Supported arguments are {supported_args}." + ) + if all_args: + msg += f" Received arguments {all_args}." + raise ValueError(msg) + # For backwards compatibility we assume custom arg names are Sequence[Run] and + # Sequence[Example] types, respectively. + elif not all(pname in supported_args for pname in all_args) or all_args == [ + "runs", + "examples", + ]: + return func + else: + + def wrapper( + runs: Sequence[schemas.Run], examples: Sequence[schemas.Example] + ) -> Union[EvaluationResult, EvaluationResults]: + arg_map = { + "runs": runs, + "examples": examples, + "inputs": [example.inputs for example in examples], + "outputs": [run.outputs or {} for run in runs], + "reference_outputs": [example.outputs or {} for example in examples], + } + kwargs = {} + args = [] + for param_name, param in sig.parameters.items(): + # Could have params with defaults that are not in the arg map + if param_name in arg_map: + if param.kind in ( + param.POSITIONAL_OR_KEYWORD, + param.POSITIONAL_ONLY, + ): + args.append(arg_map[param_name]) + else: + kwargs[param_name] = arg_map[param_name] + + result = func(*args, **kwargs) + if isinstance(result, EvaluationResult): + return result + return _format_evaluator_result(result) # type: ignore + + wrapper.__name__ = ( + getattr(func, "__name__") if hasattr(func, "__name__") else wrapper.__name__ + ) + return wrapper # type: ignore[return-value] diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/llm_evaluator.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/llm_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..b8e73fc14cefa801acf892a27512fcecd2798593 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/llm_evaluator.py @@ -0,0 +1,302 @@ +"""Contains the `LLMEvaluator` class for building LLM-as-a-judge evaluators.""" + +from typing import Any, Callable, Optional, Union, cast + +from pydantic import BaseModel + +from langsmith._internal._beta_decorator import warn_beta +from langsmith.evaluation import EvaluationResult, EvaluationResults, RunEvaluator +from langsmith.schemas import Example, Run + + +class CategoricalScoreConfig(BaseModel): + """Configuration for a categorical score.""" + + key: str + choices: list[str] + description: str + include_explanation: bool = False + explanation_description: Optional[str] = None + + +class ContinuousScoreConfig(BaseModel): + """Configuration for a continuous score.""" + + key: str + min: float = 0 + max: float = 1 + description: str + include_explanation: bool = False + explanation_description: Optional[str] = None + + +def _create_score_json_schema( + score_config: Union[CategoricalScoreConfig, ContinuousScoreConfig], +) -> dict: + properties: dict[str, Any] = {} + if isinstance(score_config, CategoricalScoreConfig): + properties["score"] = { + "type": "string", + "enum": score_config.choices, + "description": f"The score for the evaluation, one of " + f"{', '.join(score_config.choices)}.", + } + elif isinstance(score_config, ContinuousScoreConfig): + properties["score"] = { + "type": "number", + "minimum": score_config.min, + "maximum": score_config.max, + "description": f"The score for the evaluation, between " + f"{score_config.min} and {score_config.max}, inclusive.", + } + else: + raise ValueError("Invalid score type. Must be 'categorical' or 'continuous'") + + if score_config.include_explanation: + properties["explanation"] = { + "type": "string", + "description": ( + "The explanation for the score." + if score_config.explanation_description is None + else score_config.explanation_description + ), + } + + return { + "title": score_config.key, + "description": score_config.description, + "type": "object", + "properties": properties, + "required": ( + ["score", "explanation"] if score_config.include_explanation else ["score"] + ), + } + + +class LLMEvaluator(RunEvaluator): + """A class for building LLM-as-a-judge evaluators. + + .. deprecated:: 0.5.0 + + LLMEvaluator is deprecated. Use openevals instead: https://github.com/langchain-ai/openevals + """ + + def __init__( + self, + *, + prompt_template: Union[str, list[tuple[str, str]]], + score_config: Union[CategoricalScoreConfig, ContinuousScoreConfig], + map_variables: Optional[Callable[[Run, Optional[Example]], dict]] = None, + model_name: str = "gpt-4o", + model_provider: str = "openai", + **kwargs, + ): + """Initialize the `LLMEvaluator`. + + Args: + prompt_template (Union[str, List[Tuple[str, str]]): The prompt + template to use for the evaluation. If a string is provided, it is + assumed to be a human / user message. + score_config (Union[CategoricalScoreConfig, ContinuousScoreConfig]): + The configuration for the score, either categorical or continuous. + map_variables (Optional[Callable[[Run, Example], dict]], optional): + A function that maps the run and example to the variables in the + prompt. + + If `None`, it is assumed that the prompt only requires 'input', + 'output', and 'expected'. + model_name (Optional[str], optional): The model to use for the evaluation. + model_provider (Optional[str], optional): The model provider to use + for the evaluation. + """ + try: + from langchain.chat_models import ( # type: ignore[import-not-found] + init_chat_model, + ) + except ImportError as e: + raise ImportError( + "LLMEvaluator requires langchain to be installed. " + "Please install langchain by running `pip install langchain`." + ) from e + + chat_model = init_chat_model( + model=model_name, model_provider=model_provider, **kwargs + ) + + self._initialize(prompt_template, score_config, map_variables, chat_model) + + @classmethod + def from_model( + cls, + model: Any, + *, + prompt_template: Union[str, list[tuple[str, str]]], + score_config: Union[CategoricalScoreConfig, ContinuousScoreConfig], + map_variables: Optional[Callable[[Run, Optional[Example]], dict]] = None, + ): + """Create an `LLMEvaluator` instance from a `BaseChatModel` instance. + + Args: + model (BaseChatModel): The chat model instance to use for the evaluation. + prompt_template (Union[str, List[Tuple[str, str]]): The prompt + template to use for the evaluation. If a string is provided, it is + assumed to be a system message. + score_config (Union[CategoricalScoreConfig, ContinuousScoreConfig]): + The configuration for the score, either categorical or continuous. + map_variables (Optional[Callable[[Run, Example]], dict]], optional): + A function that maps the run and example to the variables in the + prompt. + + If `None`, it is assumed that the prompt only requires 'input', + 'output', and 'expected'. + + Returns: + LLMEvaluator: An instance of `LLMEvaluator`. + """ + instance = cls.__new__(cls) + instance._initialize(prompt_template, score_config, map_variables, model) + return instance + + def _initialize( + self, + prompt_template: Union[str, list[tuple[str, str]]], + score_config: Union[CategoricalScoreConfig, ContinuousScoreConfig], + map_variables: Optional[Callable[[Run, Optional[Example]], dict]], + chat_model: Any, + ): + """Shared initialization code for `__init__` and `from_model`. + + Args: + prompt_template (Union[str, List[Tuple[str, str]]): The prompt template. + score_config (Union[CategoricalScoreConfig, ContinuousScoreConfig]): + The score configuration. + map_variables (Optional[Callable[[Run, Example]], dict]]): + Function to map variables. + chat_model (BaseChatModel): The chat model instance. + """ + try: + from langchain_core.language_models.chat_models import BaseChatModel + from langchain_core.prompts import ChatPromptTemplate + except ImportError as e: + raise ImportError( + "LLMEvaluator requires langchain-core to be installed. " + "Please install langchain-core by running `pip install langchain-core`." + ) from e + + if not ( + isinstance(chat_model, BaseChatModel) + and hasattr(chat_model, "with_structured_output") + ): + raise ValueError( + "chat_model must be an instance of " + "BaseLanguageModel and support structured output." + ) + + if isinstance(prompt_template, str): + self.prompt = ChatPromptTemplate.from_messages([("human", prompt_template)]) + else: + self.prompt = ChatPromptTemplate.from_messages(prompt_template) + + if set(self.prompt.input_variables) - {"input", "output", "expected"}: + if not map_variables: + raise ValueError( + "map_inputs must be provided if the prompt template contains " + "variables other than 'input', 'output', and 'expected'" + ) + self.map_variables = map_variables + + self.score_config = score_config + self.score_schema = _create_score_json_schema(self.score_config) + + chat_model = chat_model.with_structured_output(self.score_schema) + self.runnable = self.prompt | chat_model + + @warn_beta + def evaluate_run( + self, run: Run, example: Optional[Example] = None + ) -> Union[EvaluationResult, EvaluationResults]: + """Evaluate a run.""" + variables = self._prepare_variables(run, example) + output: dict = cast(dict, self.runnable.invoke(variables)) + return self._parse_output(output) + + @warn_beta + async def aevaluate_run( + self, run: Run, example: Optional[Example] = None + ) -> Union[EvaluationResult, EvaluationResults]: + """Asynchronously evaluate a run.""" + variables = self._prepare_variables(run, example) + output: dict = cast(dict, await self.runnable.ainvoke(variables)) + return self._parse_output(output) + + def _prepare_variables(self, run: Run, example: Optional[Example]) -> dict: + """Prepare variables for model invocation.""" + if self.map_variables: + return self.map_variables(run, example) + + variables = {} + if "input" in self.prompt.input_variables: + if len(run.inputs) == 0: + raise ValueError( + "No input keys are present in run.inputs but the prompt " + "requires 'input'." + ) + if len(run.inputs) != 1: + raise ValueError( + "Multiple input keys are present in run.inputs. Please provide " + "a map_variables function." + ) + variables["input"] = list(run.inputs.values())[0] + + if "output" in self.prompt.input_variables: + if not run.outputs: + raise ValueError( + "No output keys are present in run.outputs but the prompt " + "requires 'output'." + ) + if len(run.outputs) == 0: + raise ValueError( + "No output keys are present in run.outputs but the prompt " + "requires 'output'." + ) + if len(run.outputs) != 1: + raise ValueError( + "Multiple output keys are present in run.outputs. Please " + "provide a map_variables function." + ) + variables["output"] = list(run.outputs.values())[0] + + if "expected" in self.prompt.input_variables: + if not example or not example.outputs: + raise ValueError( + "No example or example outputs is provided but the prompt " + "requires 'expected'." + ) + if len(example.outputs) == 0: + raise ValueError( + "No output keys are present in example.outputs but the prompt " + "requires 'expected'." + ) + if len(example.outputs) != 1: + raise ValueError( + "Multiple output keys are present in example.outputs. Please " + "provide a map_variables function." + ) + variables["expected"] = list(example.outputs.values())[0] + + return variables + + def _parse_output(self, output: dict) -> Union[EvaluationResult, EvaluationResults]: + """Parse the model output into an evaluation result.""" + if isinstance(self.score_config, CategoricalScoreConfig): + value = output["score"] + explanation = output.get("explanation", None) + return EvaluationResult( + key=self.score_config.key, value=value, comment=explanation + ) + elif isinstance(self.score_config, ContinuousScoreConfig): + score = output["score"] + explanation = output.get("explanation", None) + return EvaluationResult( + key=self.score_config.key, score=score, comment=explanation + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/evaluation/string_evaluator.py b/python/user_packages/Python313/site-packages/langsmith/evaluation/string_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..bfe5430ca2af30ae6b41b5c6be8e0272fdd0a0e8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/evaluation/string_evaluator.py @@ -0,0 +1,47 @@ +"""This module contains the StringEvaluator class.""" + +import uuid +from typing import Callable, Optional + +from pydantic import BaseModel + +from langsmith.evaluation.evaluator import EvaluationResult, RunEvaluator +from langsmith.schemas import Example, Run + + +class StringEvaluator(RunEvaluator, BaseModel): + """Grades the run's string input, output, and optional answer. + + .. deprecated:: 0.5.0 + + StringEvaluator is deprecated. Use openevals instead: https://github.com/langchain-ai/openevals + """ + + evaluation_name: Optional[str] = None + """The name evaluation, such as `'Accuracy'` or `'Salience'`.""" + input_key: str = "input" + """The key in the run inputs to extract the input string.""" + prediction_key: str = "output" + """The key in the run outputs to extra the prediction string.""" + answer_key: Optional[str] = "output" + """The key in the example outputs the answer string.""" + grading_function: Callable[[str, str, Optional[str]], dict] + """Function that grades the run output against the example output.""" + + def evaluate_run( + self, + run: Run, + example: Optional[Example] = None, + evaluator_run_id: Optional[uuid.UUID] = None, + ) -> EvaluationResult: + """Evaluate a single run.""" + if run.outputs is None: + raise ValueError("Run outputs cannot be None.") + if not example or example.outputs is None or self.answer_key is None: + answer = None + else: + answer = example.outputs.get(self.answer_key) + run_input = run.inputs[self.input_key] + run_output = run.outputs[self.prediction_key] + grading_results = self.grading_function(run_input, run_output, answer) + return EvaluationResult(**{"key": self.evaluation_name, **grading_results}) diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__init__.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4fa7eafc49cc5c15d7a093d4861e13032df28ca1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__init__.py @@ -0,0 +1,84 @@ +"""LangSmith integration for Claude Agent SDK. + +This module provides automatic tracing for the Claude Agent SDK by instrumenting +`ClaudeSDKClient` and injecting hooks to trace all tool calls. + +Instrumentation is applied **in place** on the original ``ClaudeSDKClient`` class +so that callers who imported the class *before* ``configure_claude_agent_sdk()`` +was called still get traced. +""" + +import logging +from typing import Optional + +from ._client import instrument_claude_client, instrument_sdk_mcp_tool +from ._config import set_tracing_config + +logger = logging.getLogger(__name__) + +__all__ = ["configure_claude_agent_sdk"] + + +def configure_claude_agent_sdk( + name: Optional[str] = None, + project_name: Optional[str] = None, + metadata: Optional[dict] = None, + tags: Optional[list[str]] = None, +) -> bool: + """Enable LangSmith tracing for the Claude Agent SDK by patching entry points. + + This function instruments the Claude Agent SDK to automatically trace: + - Chain runs for each conversation stream (via `ClaudeSDKClient`) + - Model runs for each assistant turn + - All tool calls including built-in tools, external MCP tools, and SDK MCP tools + + Tool tracing is implemented via `PreToolUse` and `PostToolUse` hooks. + + The class is patched **in place**, so references obtained via + ``from claude_agent_sdk import ClaudeSDKClient`` before this call + will still be instrumented. + + Args: + name: Name of the root trace. + project_name: LangSmith project to trace to. + metadata: Metadata to associate with all traces. + tags: Tags to associate with all traces. + + Returns: + `True` if configuration was successful, `False` otherwise. + + Example: + >>> from langsmith.integrations.claude_agent_sdk import ( + ... configure_claude_agent_sdk, + ... ) + >>> configure_claude_agent_sdk( + ... project_name="my-project", tags=["production"] + ... ) # doctest: +SKIP + >>> # Now use claude_agent_sdk as normal - tracing is automatic + """ + try: + import claude_agent_sdk # type: ignore[import-not-found] + except ImportError: + logger.warning("Claude Agent SDK not installed.") + return False + + if not hasattr(claude_agent_sdk, "ClaudeSDKClient"): + logger.warning("Claude Agent SDK missing ClaudeSDKClient.") + return False + + set_tracing_config( + name=name, + project_name=project_name, + metadata=metadata, + tags=tags, + ) + + instrument_claude_client(claude_agent_sdk.ClaudeSDKClient) + + # Patch SdkMcpTool so that tool handlers are lazily wrapped with + # run-context propagation, regardless of import order. + sdk_mcp_tool_cls = getattr(claude_agent_sdk, "SdkMcpTool", None) + if sdk_mcp_tool_cls: + instrument_sdk_mcp_tool(sdk_mcp_tool_cls) + + return True diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dae64c8186f3b7d71e818027d4271021a4ed9f43 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_client.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_client.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa2f60e054fe1a9bdb62d64bcef7f885e0283abc Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_client.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_config.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_config.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1115443f7af41dfd70b1ec602f7d72be8b9488d Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_config.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_hooks.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_hooks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b91668fddeb31e0f1752d2f7a79811d328bb17d3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_hooks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_messages.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_messages.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3190240956795402028473c49833339f35cebcde Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_messages.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_tools.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_tools.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db60979074fc6bd326412a2264652ee20203c0e8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_tools.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_transcripts.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_transcripts.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..613eaa968ff7c78c5eaa4fe9878ea0aca6dccbed Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_transcripts.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_usage.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_usage.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9bbc02b0b6f7a071f46735176245c748af7b2ac8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/__pycache__/_usage.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_client.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_client.py new file mode 100644 index 0000000000000000000000000000000000000000..4f9f28c02fb902294ff746695c58ef3ce227d6eb --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_client.py @@ -0,0 +1,709 @@ +"""Client instrumentation for Claude Agent SDK.""" + +import logging +import time +import weakref +from collections.abc import AsyncGenerator, AsyncIterable +from datetime import datetime, timezone +from functools import cache +from typing import Any, Optional + +from langsmith._internal import _context +from langsmith.run_helpers import get_current_run_tree, trace + +from ._config import get_tracing_config +from ._hooks import ( + SessionState, + _current_session, + _register_session, + _set_session_root, + _unregister_session, + clear_active_tool_runs, + get_subagent_run_by_tool_id, + post_tool_use_failure_hook, + post_tool_use_hook, + pre_tool_use_hook, + subagent_start_hook, + subagent_stop_hook, +) +from ._messages import ( + build_llm_input, + flatten_content_blocks, + unwrap_message_dicts, +) +from ._tools import ( + clear_parent_run_tree, + get_parent_run_tree, + set_parent_run_tree, +) +from ._transcripts import LLM_RUN_NAME, reconcile_from_transcripts +from ._usage import extract_usage_metadata + +logger = logging.getLogger(__name__) + +TRACE_CHAIN_NAME = "claude.conversation" + + +@cache +def _get_package_version(package_name: str) -> str | None: + try: + from importlib.metadata import version + + return version(package_name) + except Exception: + return None + + +class TurnLifecycle: + """Track ongoing model runs so consecutive messages are recorded correctly. + + The Claude Agent SDK may deliver a single assistant turn as multiple + ``AssistantMessage`` events (e.g. one with ``ThinkingBlock``, another + with ``TextBlock``/``ToolUseBlock``). Messages that share the same + ``message_id`` are accumulated into a single LLM run. + """ + + def __init__(self, query_start_time: Optional[float] = None): + self.current_run: Optional[Any] = None + self.current_message_id: Optional[str] = None + self.next_start_time: Optional[float] = query_start_time + # message_id โ†’ RunTree for all LLM runs created this conversation. + # Used to retroactively set usage from transcripts. + self.llm_runs_by_message_id: dict[str, Any] = {} + # Runs that have been end()ed but not yet patch()ed. + # Deferred so transcript usage can be set before the single patch(). + self._pending_patch: list[Any] = [] + + def start_llm_run( + self, + message: Any, + prompt: Any, + history: list[dict[str, Any]], + parent: Optional[Any] = None, + ) -> Optional[dict[str, Any]]: + """Begin or continue a model run for *message*. + + If *message* has the same ``message_id`` as the current run the + output is appended; otherwise a new run is started (ending any + previous one first). + """ + message_id = getattr(message, "message_id", None) + start = self.next_start_time or time.time() + + # Same turn โ€“ just accumulate the output blocks and update usage. + # Return None so the caller does NOT append a duplicate history + # entry; the original entry in ``history`` is updated in place. + if message_id and message_id == self.current_message_id and self.current_run: + content = flatten_content_blocks(getattr(message, "content", None)) + if content and self.current_run.outputs: + prev = self.current_run.outputs.get("content", []) + if isinstance(prev, list) and isinstance(content, list): + merged = prev + content + self.current_run.outputs["content"] = merged + # Update the existing history entry in place so + # subsequent LLM runs see a single merged message. + for entry in reversed(history): + if entry.get("role") == "assistant": + entry["content"] = merged + break + elif isinstance(content, list): + self.current_run.outputs["content"] = content + self._set_usage_from_message(message, self.current_run) + return None + + # Different turn โ€“ end previous but defer patch() until + # transcript usage is available. + if self.current_run: + self.current_run.end() + self._pending_patch.append(self.current_run) + + final_output, run = begin_llm_run_from_assistant_messages( + [message], prompt, history, start_time=start, parent=parent + ) + self.current_run = run + self.current_message_id = message_id + self.next_start_time = None + + if run: + if message_id: + self.llm_runs_by_message_id[message_id] = run + self._set_usage_from_message(message, run) + + return final_output + + @staticmethod + def _set_usage_from_message(message: Any, run: Any) -> None: + """Set usage metadata on a run from a live AssistantMessage. + + Always overwrites โ€” later chunks in the same turn have more + accurate counts. Transcript-based usage will overwrite again + if available. + """ + raw_usage = getattr(message, "usage", None) + if not raw_usage: + return + usage_meta = extract_usage_metadata(raw_usage) + if usage_meta: + meta = run.extra.setdefault("metadata", {}) + meta["usage_metadata"] = usage_meta + + def mark_next_start(self) -> None: + """Mark when the next assistant message will start.""" + self.next_start_time = time.time() + + def close(self) -> None: + """End any open run and add to pending patch list.""" + if self.current_run: + self.current_run.end() + self._pending_patch.append(self.current_run) + self.current_run = None + + def flush(self) -> None: + """Patch all deferred LLM runs. Call after usage has been set.""" + for run in self._pending_patch: + try: + run.patch() + except Exception as e: + logger.warning(f"Failed to patch LLM run: {e}") + self._pending_patch.clear() + + +def begin_llm_run_from_assistant_messages( + messages: list[Any], + prompt: Any, + history: list[dict[str, Any]], + start_time: Optional[float] = None, + parent: Optional[Any] = None, +) -> tuple[Optional[dict[str, Any]], Optional[Any]]: + """Create a traced model run from assistant messages.""" + if not messages or type(messages[-1]).__name__ != "AssistantMessage": + return None, None + + last_msg = messages[-1] + model = getattr(last_msg, "model", None) + if parent is None: + parent = get_parent_run_tree() or get_current_run_tree() + if not parent: + return None, None + + inputs = build_llm_input(prompt, history) + outputs = [ + {"content": flatten_content_blocks(m.content), "role": "assistant"} + for m in messages + if hasattr(m, "content") + ] + + llm_metadata: dict[str, Any] = {"ls_provider": "anthropic"} + if model: + llm_metadata["ls_model_name"] = model + + llm_run = parent.create_child( + name=LLM_RUN_NAME, + run_type="llm", + inputs={"messages": inputs} if inputs else {}, + extra={"metadata": llm_metadata}, + start_time=datetime.fromtimestamp(start_time, tz=timezone.utc) + if start_time + else None, + ) + + try: + llm_run.post() + except Exception as e: + logger.warning(f"Failed to post LLM run: {e}") + + # Set outputs after posting so they are sent with end_time on the patch. + llm_run.outputs = outputs[-1] if len(outputs) == 1 else {"content": outputs} + + final_content = ( + {"content": flatten_content_blocks(last_msg.content), "role": "assistant"} + if hasattr(last_msg, "content") + else None + ) + return final_content, llm_run + + +def _bind_hook_to_session(hook: Any, session: Optional[SessionState]) -> Any: + """Return a hook callable that runs with *session* bound, if provided.""" + if session is None: + return hook + + async def _bound(input_data: Any, tool_use_id: Any, context: Any) -> Any: + token = _current_session.set(session) + try: + return await hook(input_data, tool_use_id, context) + finally: + _current_session.reset(token) + + return _bound + + +def _inject_tracing_hooks(options: Any, session: Optional[SessionState] = None) -> None: + """Inject LangSmith tracing hooks into ClaudeAgentOptions. + + If *session* is provided, injected hook callables bind that session around + each hook invocation. This is important because the Claude SDK may execute + hooks in async contexts that do not inherit the ``receive_response`` + ContextVar; binding at hook injection time keeps each client isolated. + """ + if not hasattr(options, "hooks"): + return + + # Initialize hooks dict if not present + if options.hooks is None: + options.hooks = {} + + for event in ( + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "SubagentStart", + "SubagentStop", + ): + if event not in options.hooks: + options.hooks[event] = [] + + try: + from claude_agent_sdk import HookMatcher # type: ignore[import-not-found] + + langsmith_pre_matcher = HookMatcher( + matcher=None, hooks=[_bind_hook_to_session(pre_tool_use_hook, session)] + ) + langsmith_post_matcher = HookMatcher( + matcher=None, hooks=[_bind_hook_to_session(post_tool_use_hook, session)] + ) + langsmith_failure_matcher = HookMatcher( + matcher=None, + hooks=[_bind_hook_to_session(post_tool_use_failure_hook, session)], + ) + langsmith_subagent_start_matcher = HookMatcher( + matcher=None, hooks=[_bind_hook_to_session(subagent_start_hook, session)] + ) + langsmith_subagent_stop_matcher = HookMatcher( + matcher=None, hooks=[_bind_hook_to_session(subagent_stop_hook, session)] + ) + + options.hooks["PreToolUse"].insert(0, langsmith_pre_matcher) + options.hooks["PostToolUse"].insert(0, langsmith_post_matcher) + options.hooks["PostToolUseFailure"].insert(0, langsmith_failure_matcher) + options.hooks["SubagentStart"].insert(0, langsmith_subagent_start_matcher) + options.hooks["SubagentStop"].insert(0, langsmith_subagent_stop_matcher) + + logger.debug("Injected LangSmith tracing hooks into ClaudeAgentOptions") + except ImportError: + logger.warning("Failed to import HookMatcher from claude_agent_sdk") + except Exception as e: + logger.warning(f"Failed to inject tracing hooks: {e}") + + +def _wrap_tool_handler( + original_handler: Any, + session: Optional[SessionState] = None, + tool_name: Optional[str] = None, +) -> Any: + """Wrap an MCP tool handler to propagate LangSmith run context. + + The Claude SDK runs hooks and tool handlers in different async task + contexts, so contextvars set in ``PreToolUse`` are invisible to the + handler. This wrapper copies the active tool run into the contextvar before + calling the original handler, so ``@traceable`` calls inside the handler + nest correctly. + """ + + async def _wrapped(args: Any) -> Any: + # The most recently added active tool run is the one PreToolUse just + # created for this invocation. Prefer an explicitly bound client + # session because tool handlers may run in an async context that did + # not inherit _current_session. + tool_run = _get_last_active_tool_run(session, args=args, tool_name=tool_name) + if tool_run: + token = _context._PARENT_RUN_TREE_REF.set(weakref.ref(tool_run)) + session_token = ( + _current_session.set(session) if session is not None else None + ) + try: + return await original_handler(args) + finally: + if session_token is not None: + _current_session.reset(session_token) + _context._PARENT_RUN_TREE_REF.reset(token) + return await original_handler(args) + + _wrapped._langsmith_wrapped = True # type: ignore[attr-defined] + _wrapped._langsmith_original_handler = original_handler # type: ignore[attr-defined] + _wrapped._langsmith_session = session # type: ignore[attr-defined] + _wrapped._langsmith_tool_name = tool_name # type: ignore[attr-defined] + return _wrapped + + +def _tool_run_matches(run: Any, args: Any, tool_name: Optional[str]) -> bool: + """Return whether *run* appears to be for this SDK MCP handler call. + + Matching is intentionally strict: we require both the tool name and the + handler args to line up with what the ``PreToolUse`` hook recorded. This + avoids cross-attributing a handler invocation to the wrong client's active + tool run under concurrency. + """ + if not tool_name: + return False + run_name = str(getattr(run, "name", "")) + # SDK MCP tools show up in hook data as e.g. ``mcp__weather__get_weather`` + # while the handler only knows its short name ``get_weather``. + name_matches = ( + tool_name == run_name or tool_name in run_name or run_name in tool_name + ) + if not name_matches: + return False + inputs = getattr(run, "inputs", None) + if not isinstance(inputs, dict): + return False + # PreToolUse stores {} when the tool had no inputs, otherwise + # {"input": }. Normalise both sides before comparing. + recorded = inputs.get("input", {}) if inputs else {} + return recorded == (args or {}) + + +def _newest_matching_tool_run( + sessions: list[SessionState], args: Any, tool_name: Optional[str] +) -> Any: + """Return the most recently created active tool run that matches.""" + candidates: list[tuple[float, Any]] = [] + for candidate_session in sessions: + for run, start_time in candidate_session.active_tool_runs.values(): + if _tool_run_matches(run, args, tool_name): + candidates.append((start_time, run)) + if not candidates: + return None + return max(candidates, key=lambda item: item[0])[1] + + +def _get_last_active_tool_run( + session: Optional[SessionState] = None, + *, + args: Any = None, + tool_name: Optional[str] = None, +) -> Any: + """Return the active tool run for an SDK MCP handler, or None. + + Lookup order: + + 1. The session explicitly bound to the handler (if any). + 2. The session bound to the current ContextVar. + 3. The module-level default session (unit tests / unbound callers). + 4. Any live client session โ€” only used when the handler is unbound and the + SDK invoked it in a detached async context. Requires an exact tool + name + args match to avoid cross-attribution across clients. + """ + from ._hooks import ( + _current_session, + _current_session_or_default, + _registered_sessions, + ) + + # If we have a specific session (explicitly bound, current-context, or the + # test default), just return its newest active tool run. There is no + # cross-client ambiguity at that point. + def _newest_in(s: SessionState) -> Any: + if not s.active_tool_runs: + return None + latest_id = max( + s.active_tool_runs, + key=lambda tid: s.active_tool_runs[tid][1], + ) + return s.active_tool_runs[latest_id][0] + + if session is not None: + return _newest_in(session) + + current_session = _current_session.get() + if current_session is not None: + run = _newest_in(current_session) + if run is not None: + return run + + default_session = _current_session_or_default() + if default_session is not current_session: + run = _newest_in(default_session) + if run is not None: + return run + + # Last resort: the SDK invoked this handler in a detached async context and + # the handler object wasn't bound to a session. Require strict tool-name + + # args match so concurrent clients can't steal each other's attribution. + return _newest_matching_tool_run(_registered_sessions(), args, tool_name) + + +def instrument_claude_client(original_class: Any) -> None: + """Patch ``ClaudeSDKClient`` **in place** to trace calls. + + In-place patching (rather than subclassing + reference replacement) + ensures that callers who imported ``ClaudeSDKClient`` *before* + ``configure_claude_agent_sdk()`` was called still get instrumented. + """ + if getattr(original_class, "_langsmith_instrumented", False): + return # Already wrapped, avoid double-tracing + + # โ”€โ”€ stash originals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + _orig_init = original_class.__init__ + _orig_query = original_class.query + _orig_receive_response = original_class.receive_response + + # โ”€โ”€ patched __init__ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + def _traced_init(self: Any, *args: Any, **kwargs: Any) -> None: + options = kwargs.get("options") or (args[0] if args else None) + self._ls_session = SessionState() + if options: + _inject_tracing_hooks(options, self._ls_session) + _orig_init(self, *args, **kwargs) + self._ls_prompt = None + self._ls_start_time = None + self._ls_streamed_input = None + + # โ”€โ”€ patched query โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + async def _traced_query(self: Any, *args: Any, **kwargs: Any) -> Any: + self._ls_start_time = time.time() + self._ls_streamed_input = None + prompt = args[0] if args else kwargs.get("prompt") + + if prompt is None: + pass + elif isinstance(prompt, str): + self._ls_prompt = prompt + elif isinstance(prompt, AsyncIterable): + collector: list[dict[str, Any]] = [] + self._ls_streamed_input = collector + self._ls_prompt = None + + async def _gen_wrapper() -> AsyncGenerator[dict[str, Any], None]: + async for msg in prompt: + collector.append(msg) + yield msg + + if args: + args = (_gen_wrapper(),) + args[1:] + else: + kwargs["prompt"] = _gen_wrapper() + else: + self._ls_prompt = str(prompt) + + return await _orig_query(self, *args, **kwargs) + + # โ”€โ”€ patched receive_response โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + async def _traced_receive_response(self: Any) -> AsyncGenerator[Any, None]: + messages = _orig_receive_response(self) + + trace_inputs: dict[str, Any] = {} + trace_metadata: dict[str, Any] = { + "ls_integration": "claude-agent-sdk", + "ls_integration_version": _get_package_version("claude_agent_sdk"), + } + + awaiting_streamed_input = self._ls_streamed_input is not None + + if self._ls_prompt: + trace_inputs["prompt"] = self._ls_prompt + + if hasattr(self, "options") and self.options: + if hasattr(self.options, "system_prompt") and self.options.system_prompt: + system_prompt = self.options.system_prompt + if isinstance(system_prompt, str): + trace_inputs["system"] = system_prompt + elif isinstance(system_prompt, dict): + if system_prompt.get("type") == "preset": + preset_text = ( + f"preset: {system_prompt.get('preset', 'claude_code')}" + ) + if "append" in system_prompt: + preset_text += f"\nappend: {system_prompt['append']}" + trace_inputs["system"] = preset_text + else: + trace_inputs["system"] = system_prompt + + for attr in ["model", "permission_mode", "max_turns"]: + if hasattr(self.options, attr): + val = getattr(self.options, attr) + if val is not None: + trace_metadata[attr] = val + + config = get_tracing_config() + user_metadata = config.get("metadata") or {} + + trace_kwargs: dict[str, Any] = { + "name": config.get("name") or TRACE_CHAIN_NAME, + "run_type": "chain", + "inputs": trace_inputs, + "metadata": { + **trace_metadata, + **user_metadata, + "ls_agent_type": "root", + }, + } + if config.get("project_name"): + trace_kwargs["project_name"] = config["project_name"] + if config.get("tags"): + trace_kwargs["tags"] = config["tags"] + + async with trace(**trace_kwargs) as run: + # Bind this client's state container to the ContextVar so stream + # helpers on this SDK event loop pick it up (see + # _hooks.SessionState). This keeps concurrent ClaudeSDKClient + # instances โ€” eval runs, FastAPI handlers, Celery workers, + # asyncio.gather โ€” from corrupting each other's correlation state. + session = getattr(self, "_ls_session", None) + if session is None: + session = self._ls_session = SessionState() + session_token = _register_session(session) + _set_session_root(session, run) + parent_token = set_parent_run_tree(run) + tracker = TurnLifecycle(self._ls_start_time) + collected_by_ctx: dict[Optional[str], list[dict[str, Any]]] = {None: []} + + prompt_for_llm: Any = self._ls_prompt + + try: + async for msg in messages: + if awaiting_streamed_input and self._ls_streamed_input: + unwrapped_messages = unwrap_message_dicts( + self._ls_streamed_input + ) + if unwrapped_messages: + run.inputs["messages"] = unwrapped_messages + prompt_for_llm = self._ls_streamed_input + awaiting_streamed_input = False + + msg_type = type(msg).__name__ + + if msg_type == "AssistantMessage": + parent_tool_use_id = getattr(msg, "parent_tool_use_id", None) + llm_parent = ( + get_subagent_run_by_tool_id(parent_tool_use_id) + if parent_tool_use_id + else None + ) + + ctx_key = parent_tool_use_id + ctx_history = collected_by_ctx.setdefault(ctx_key, []) + + content = tracker.start_llm_run( + msg, + prompt_for_llm if parent_tool_use_id is None else None, + ctx_history, + parent=llm_parent, + ) + if content: + ctx_history.append(content) + + elif msg_type == "UserMessage": + parent_tool_use_id = getattr(msg, "parent_tool_use_id", None) + ctx_key = parent_tool_use_id + ctx_history = collected_by_ctx.setdefault(ctx_key, []) + + if hasattr(msg, "content"): + flattened = flatten_content_blocks(msg.content) + if ( + isinstance(flattened, list) + and flattened + and isinstance(flattened[0], dict) + and flattened[0].get("type") == "tool_result" + ): + for block in flattened: + tool_use_id = block.get("tool_use_id") + ctx_history.append( + { + "role": "tool", + "content": block.get("content", ""), + "tool_call_id": tool_use_id, + } + ) + if ( + tool_use_id + and tool_use_id in session.active_tool_runs + ): + tool_run, _ = session.active_tool_runs.pop( + tool_use_id + ) + result_content = block.get("content", "") + is_error = block.get("is_error", False) + tool_run.end( + outputs={"output": result_content}, + error=str(result_content) + if is_error + else None, + ) + try: + tool_run.patch() + except Exception as e: + logger.warning( + "Failed to patch" + f" orphaned tool run: {e}" + ) + else: + ctx_history.append( + { + "content": flattened, + "role": "user", + } + ) + tracker.mark_next_start() + elif msg_type == "ResultMessage": + meta = { + k: v + for k, v in { + "num_turns": getattr(msg, "num_turns", None), + "session_id": getattr(msg, "session_id", None), + "duration_ms": getattr(msg, "duration_ms", None), + "duration_api_ms": getattr( + msg, "duration_api_ms", None + ), + "is_error": getattr(msg, "is_error", None), + }.items() + if v is not None + } + if meta: + run.metadata.update(meta) + + yield msg + main_collected = collected_by_ctx.get(None, []) + run.end(outputs=main_collected[-1] if main_collected else None) + except Exception: + logger.exception("Error while tracing Claude Agent stream") + finally: + tracker.close() + reconcile_from_transcripts(tracker, session=session) + tracker.flush() + clear_parent_run_tree(parent_token) + try: + clear_active_tool_runs(session) + finally: + _unregister_session(session, session_token) + + # โ”€โ”€ apply patches to the class itself โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + original_class.__init__ = _traced_init + original_class.query = _traced_query + original_class.receive_response = _traced_receive_response + original_class._langsmith_instrumented = True + + +def instrument_sdk_mcp_tool(tool_class: Any) -> None: + """Patch ``SdkMcpTool.__init__`` to auto-wrap handlers. + + Wrapping happens at construction time so that any tool created + *after* ``configure_claude_agent_sdk()`` automatically gets + run-context propagation, regardless of how ``tool`` or + ``create_sdk_mcp_server`` were imported. + """ + if getattr(tool_class, "_langsmith_handler_patched", False): + return + + _orig_init = tool_class.__init__ + + def _patched_init(self: Any, *args: Any, **kwargs: Any) -> None: + _orig_init(self, *args, **kwargs) + handler = self.handler + if callable(handler) and not getattr(handler, "_langsmith_wrapped", False): + self.handler = _wrap_tool_handler( + handler, tool_name=getattr(self, "name", None) + ) + + tool_class.__init__ = _patched_init + tool_class._langsmith_handler_patched = True diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_config.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_config.py new file mode 100644 index 0000000000000000000000000000000000000000..125d3003072cc5c7a7a64456e5e2da102fb7ff23 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_config.py @@ -0,0 +1,39 @@ +"""Configuration management for Claude Agent SDK tracing.""" + +from typing import Any, Optional + +# Global configuration for tracing +_tracing_config: dict[str, Any] = { + "name": None, + "project_name": None, + "metadata": None, + "tags": None, +} + + +def set_tracing_config( + name: Optional[str] = None, + project_name: Optional[str] = None, + metadata: Optional[dict] = None, + tags: Optional[list[str]] = None, +) -> None: + """Set the global tracing configuration for Claude Agent SDK. + + Args: + name: Name of the root trace. + project_name: LangSmith project to trace to. + metadata: Metadata to associate with all traces. + tags: Tags to associate with all traces. + """ + global _tracing_config + _tracing_config = { + "name": name, + "project_name": project_name, + "metadata": metadata, + "tags": tags, + } + + +def get_tracing_config() -> dict[str, Any]: + """Get the current tracing configuration.""" + return _tracing_config.copy() diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_hooks.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..2a98d27b97437e8436a4f5085a0c2b8ed1b518de --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_hooks.py @@ -0,0 +1,564 @@ +"""Hook-based tool tracing for Claude Agent SDK. + +Correlation state is scoped **per client session** via a +:class:`contextvars.ContextVar`. Each instrumented ``ClaudeSDKClient`` owns a +:class:`SessionState`; ``receive_response()`` binds it while processing the +stream so helper functions can look up the right state regardless of how many +clients are concurrently active in the process. + +Hooks injected by ``_client.py`` are also bound to their owning +``SessionState`` so hook callbacks use the correct state even if the SDK runs +them in an async context that did not inherit ``receive_response``'s +ContextVar. + +When no ContextVar is active, hooks use a module-level default session. This is +primarily for direct unit tests; real traffic under ``receive_response`` uses a +client-bound session. +""" + +import logging +import threading +import time +import weakref +from contextvars import ContextVar +from dataclasses import dataclass, field +from datetime import datetime, timezone +from typing import TYPE_CHECKING, Any, Optional + +from langsmith.run_helpers import get_current_run_tree +from langsmith.run_trees import RunTree + +from ._tools import get_parent_run_tree + +if TYPE_CHECKING: + from claude_agent_sdk import ( + HookContext, + HookInput, + HookJSONOutput, + ) + +logger = logging.getLogger(__name__) + + +# โ”€โ”€ Per-session state โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +@dataclass +class SessionState: + """All mutable correlation state for a single conversation. + + One instance is created per instrumented ``ClaudeSDKClient`` and bound to + the ``_current_session`` ContextVar while that client is active. + """ + + # Key: tool_use_id โ†’ (run_tree, start_time) + active_tool_runs: dict[str, tuple[Any, float]] = field(default_factory=dict) + + # Key: agent_id โ†’ RunTree for the subagent chain. + # Populated by SubagentStart, consumed by SubagentStop. + subagent_runs: dict[str, RunTree] = field(default_factory=dict) + + # Key: tool_use_id โ†’ tool_input dict. + # When PreToolUse fires for an "Agent" tool, it stashes here. + # SubagentStart pops it to find the matching Agent tool run. + pending_agent_tools: dict[str, dict[str, Any]] = field(default_factory=dict) + + # Key: agent_id โ†’ Agent tool_use_id. + # Maps a subagent back to the Agent tool that spawned it. + agent_to_tool_mapping: dict[str, str] = field(default_factory=dict) + + # Key: Agent tool_use_id โ†’ RunTree. + # SubagentStop moves the run here; PostToolUse sets outputs on it; + # clear_active_tool_runs() ends + patches it. + ended_subagent_runs: dict[str, RunTree] = field(default_factory=dict) + + # (transcript_path, subagent_RunTree) captured from SubagentStop. + # Used for usage extraction and creating missing LLM runs. + subagent_transcript_paths: list[tuple[str, RunTree]] = field(default_factory=list) + + # Main session transcript path, captured from BaseHookInput.transcript_path + # on the first hook that fires (every hook inherits this field). + main_transcript_path: Optional[str] = None + + # Root LangSmith run used for parenting root-level hook spans. + root_run: Optional[RunTree] = None + + +# Module-level *default* session. Used when no ContextVar is set (e.g. tests +# that poke hooks directly, or hooks firing outside a traced conversation). +_default_session: SessionState = SessionState() + +# ContextVar holding the active session for a conversation. Injected hook +# callables bind this explicitly before calling the shared hook function. +_current_session: ContextVar[Optional[SessionState]] = ContextVar( + "langsmith_claude_agent_session", default=None +) + +# Live sessions are only used by SDK MCP tool handlers when the SDK invokes the +# handler in a detached async context that did not inherit _current_session. +# Store weak values so this fallback registry never owns session lifetime. +_live_sessions_lock = threading.Lock() +_live_sessions: weakref.WeakValueDictionary[int, SessionState] = ( + weakref.WeakValueDictionary() +) + + +def _current_session_or_default() -> SessionState: + """Return the session bound to the current context, or the default.""" + session = _current_session.get() + if session is not None: + return session + return _default_session + + +def _session_for_hook() -> SessionState: + """Resolve the session that owns the current hook invocation. + + Real Claude SDK hook invocations are wrapped by ``_bind_hook_to_session`` + in ``_client.py``, so the ContextVar should be set. The default session is + only for tests or direct, unbound hook calls. + """ + return _current_session_or_default() + + +def _register_session(session: SessionState) -> object: + """Bind *session* to the ContextVar and return a reset token. + + The caller must pass the returned token to ``_unregister_session`` when + the conversation ends. + """ + with _live_sessions_lock: + _live_sessions[id(session)] = session + return _current_session.set(session) + + +def _set_session_root(session: SessionState, run_tree: RunTree) -> None: + """Store the root LangSmith run for *session*.""" + session.root_run = run_tree + + +def _unregister_session(session: SessionState, token: Any) -> None: + """Reset the ContextVar for the current session and drop the live entry.""" + try: + _current_session.reset(token) + except ValueError: + # Token was created in a different context. Don't clobber an unrelated + # current value โ€” just log and continue. The live-sessions registry + # below is still cleaned up so matching won't find a stale session. + logger.debug("Could not reset _current_session with token from another context") + finally: + with _live_sessions_lock: + _live_sessions.pop(id(session), None) + + +def _registered_sessions() -> list[SessionState]: + """Return currently active client sessions.""" + with _live_sessions_lock: + return list(_live_sessions.values()) + + +# โ”€โ”€ Public helpers (used by _client.py) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +def get_subagent_run_by_tool_id(tool_use_id: str) -> Optional[RunTree]: + """Get a subagent run by the Agent tool's tool_use_id. + + Checks both active subagent runs and ended-but-not-finalised runs, + because the SDK fires ``SubagentStop`` before the subagent's messages + reach the client. + """ + session = _current_session_or_default() + # Check active subagents first + for aid, tid in session.agent_to_tool_mapping.items(): + if tid == tool_use_id: + return session.subagent_runs.get(aid) + # Fall back to ended-but-not-finalised subagents + return session.ended_subagent_runs.get(tool_use_id) + + +# โ”€โ”€ Hook functions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +async def pre_tool_use_hook( + input_data: "HookInput", + tool_use_id: Optional[str], + context: "HookContext", +) -> "HookJSONOutput": + """Trace tool execution before it starts. + + Args: + input_data: Contains `tool_name`, `tool_input`, `session_id`, `agent_id` + tool_use_id: Unique identifier for this tool invocation + context: Hook context (currently contains only signal) + + Returns: + Hook output (empty dict allows execution to proceed) + """ + if not tool_use_id: + return {} + + data: dict[str, Any] = dict(input_data) # flatten TypedDict union + tool_name: str = str(data.get("tool_name", "unknown_tool")) + tool_input: dict[str, Any] = dict(data.get("tool_input") or {}) + agent_id: Optional[str] = str(data["agent_id"]) if data.get("agent_id") else None + session = _session_for_hook() + + # Capture main session transcript path from BaseHookInput + if session.main_transcript_path is None and data.get("transcript_path"): + session.main_transcript_path = str(data["transcript_path"]) + + # If this is an Agent tool call, record it so SubagentStart can find it + if tool_name == "Agent": + session.pending_agent_tools[tool_use_id] = tool_input + + try: + # Determine parent: subagent chain > root chain. + # Tool runs are siblings of LLM runs, not children. + parent: Optional[RunTree] = None + if agent_id and agent_id in session.subagent_runs: + parent = session.subagent_runs[agent_id] + else: + parent = ( + session.root_run + if session is not _default_session + else get_parent_run_tree() + ) or get_current_run_tree() + + if not parent: + return {} + + start_time = time.time() + tool_run = parent.create_child( + name=tool_name, + run_type="tool", + inputs={"input": tool_input} if tool_input else {}, + start_time=datetime.fromtimestamp(start_time, tz=timezone.utc), + ) + + try: + tool_run.post() + except Exception as e: + logger.warning(f"Failed to post tool run for {tool_name}: {e}") + + session.active_tool_runs[tool_use_id] = (tool_run, start_time) + + except Exception as e: + logger.warning(f"Error in PreToolUse hook for {tool_name}: {e}", exc_info=True) + + return {} + + +async def post_tool_use_hook( + input_data: "HookInput", + tool_use_id: Optional[str], + context: "HookContext", +) -> "HookJSONOutput": + """Trace tool execution after it completes. + + Args: + input_data: Contains `tool_name`, `tool_input`, `tool_response`, + `session_id`, etc. + tool_use_id: Unique identifier for this tool invocation + context: Hook context (currently contains only signal) + + Returns: + Hook output (empty `dict` by default) + """ + if not tool_use_id: + return {} + + tool_name: str = str(input_data.get("tool_name", "unknown_tool")) + tool_response = input_data.get("tool_response") + session = _session_for_hook() + + try: + run_info = session.active_tool_runs.pop(tool_use_id, None) + if not run_info: + return {} + + tool_run, _ = run_info + + if isinstance(tool_response, dict): + outputs = tool_response + elif isinstance(tool_response, list): + outputs = {"content": tool_response} + else: + outputs = {"output": str(tool_response)} if tool_response else {} + + # Check if the tool execution was an error + is_error = False + if isinstance(tool_response, dict): + is_error = tool_response.get("is_error", False) + + tool_run.end( + outputs=outputs, + error=outputs.get("output") if is_error else None, + ) + + try: + tool_run.patch() + except Exception as e: + logger.warning(f"Failed to patch tool run for {tool_name}: {e}") + + # If this is an Agent tool, also set outputs on the stashed + # subagent run. We don't end/patch the subagent here because + # its AssistantMessages may not have been yielded to + # receive_response() yet. clear_active_tool_runs() will + # finalise it at the end of the conversation. + subagent_run = session.ended_subagent_runs.get(tool_use_id) + if subagent_run: + try: + subagent_run.outputs = outputs + except Exception as e: + logger.warning(f"Failed to set subagent run outputs: {e}") + + except Exception as e: + logger.warning( + f"Error in PostToolUse hook for {tool_name}: {e}", + exc_info=True, + ) + + return {} + + +async def post_tool_use_failure_hook( + input_data: "HookInput", + tool_use_id: Optional[str], + context: "HookContext", +) -> "HookJSONOutput": + """Trace tool execution when it fails. + + This hook fires for built-in tool failures (Bash, Read, Write, etc.) + and is mutually exclusive with :func:`post_tool_use_hook` โ€” when a + built-in tool fails, only ``PostToolUseFailure`` fires. + + Args: + input_data: Contains ``tool_name``, ``tool_input``, ``error``, + and optionally ``is_interrupt``. + tool_use_id: Unique identifier for this tool invocation + context: Hook context (currently contains only signal) + + Returns: + Hook output (empty dict) + """ + if not tool_use_id: + return {} + + tool_name: str = str(input_data.get("tool_name", "unknown_tool")) + error: str = str(input_data.get("error", "Unknown error")) + session = _session_for_hook() + + try: + run_info = session.active_tool_runs.pop(tool_use_id, None) + if not run_info: + return {} + + tool_run, _ = run_info + + tool_run.end( + outputs={"error": error}, + error=error, + ) + + try: + tool_run.patch() + except Exception as e: + logger.warning(f"Failed to patch failed tool run for {tool_name}: {e}") + + except Exception as e: + logger.warning( + f"Error in PostToolUseFailure hook for {tool_name}: {e}", + exc_info=True, + ) + + return {} + + +async def subagent_start_hook( + input_data: "HookInput", + tool_use_id: Optional[str], + context: "HookContext", +) -> "HookJSONOutput": + """Create a chain run when a subagent starts. + + The subagent chain is nested under the Agent tool run that spawned it. + Since the SDK passes a different ``tool_use_id`` to this hook than the + one from ``PreToolUse`` for the Agent tool, we match them via the + ``_pending_agent_tools`` queue. + + Args: + input_data: Contains ``agent_id``, ``agent_type``, ``session_id`` + tool_use_id: SDK-internal session id (not the Agent tool's + tool_use_id) + context: Hook context + + Returns: + Hook output (empty dict) + """ + data: dict[str, Any] = dict(input_data) + agent_id: Optional[str] = str(data["agent_id"]) if data.get("agent_id") else None + agent_type: str = str(data.get("agent_type") or "subagent") + session = _session_for_hook() + + if not agent_id: + return {} + + try: + # Find the Agent tool run that triggered this subagent. + # pending_agent_tools is populated by pre_tool_use_hook when + # tool_name == "Agent". Pop the most recent one. + agent_tool_use_id: Optional[str] = None + agent_tool_input: dict[str, Any] = {} + parent: Optional[RunTree] = None + + if session.pending_agent_tools: + agent_tool_use_id, agent_tool_input = session.pending_agent_tools.popitem() + + if agent_tool_use_id in session.active_tool_runs: + agent_tool_run, _ = session.active_tool_runs[agent_tool_use_id] + parent = agent_tool_run + + if parent is None: + parent = ( + session.root_run + if session is not _default_session + else get_parent_run_tree() + ) or get_current_run_tree() + + if not parent: + return {} + + start_time = time.time() + subagent_run = parent.create_child( + name=agent_type, + run_type="chain", + inputs=agent_tool_input if agent_tool_input else {}, + start_time=datetime.fromtimestamp(start_time, tz=timezone.utc), + ) + subagent_run.extra["metadata"] = { + **subagent_run.extra.get("metadata", {}), + "ls_agent_type": "subagent", + } + + try: + subagent_run.post() + except Exception as e: + logger.warning(f"Failed to post subagent run: {e}") + + # Store by agent_id so tool hooks and LLM run lookup can find it + session.subagent_runs[agent_id] = subagent_run + + # Remember which Agent tool_use_id spawned this agent_id + if agent_tool_use_id: + session.agent_to_tool_mapping[agent_id] = agent_tool_use_id + + except Exception as e: + logger.warning(f"Error in SubagentStart hook: {e}", exc_info=True) + + return {} + + +async def subagent_stop_hook( + input_data: "HookInput", + tool_use_id: Optional[str], + context: "HookContext", +) -> "HookJSONOutput": + """Move the subagent run to ended state when it finishes. + + Does NOT end/patch the run โ€” ``PostToolUse`` for the Agent tool will + set outputs, and ``clear_active_tool_runs()`` will finalise it at the + end of the conversation. + + Args: + input_data: Contains ``agent_id``, ``agent_type``, ``session_id``, + ``agent_transcript_path`` + tool_use_id: SDK-internal session id + context: Hook context + + Returns: + Hook output (empty dict) + """ + data: dict[str, Any] = dict(input_data) + agent_id: Optional[str] = str(data["agent_id"]) if data.get("agent_id") else None + transcript_path: Optional[str] = ( + str(data["agent_transcript_path"]) + if data.get("agent_transcript_path") + else None + ) + session = _session_for_hook() + + if not agent_id: + return {} + + try: + subagent_run = session.subagent_runs.pop(agent_id, None) + if not subagent_run: + return {} + + if transcript_path: + session.subagent_transcript_paths.append((transcript_path, subagent_run)) + + # Move to ended state so PostToolUse can set outputs. + agent_tool_id = session.agent_to_tool_mapping.pop(agent_id, None) + if agent_tool_id: + session.ended_subagent_runs[agent_tool_id] = subagent_run + else: + # No matching Agent tool โ€” just end it now + subagent_run.end() + try: + subagent_run.patch() + except Exception as e: + logger.warning(f"Failed to patch subagent run: {e}") + + except Exception as e: + logger.warning(f"Error in SubagentStop hook: {e}", exc_info=True) + + return {} + + +# โ”€โ”€ Cleanup โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +def clear_active_tool_runs(session: Optional[SessionState] = None) -> None: + """Finalise all runs and clear state for *session*. + + If *session* is omitted the current ContextVar-bound session is used + (falling back to the module-level default session). ``receive_response`` + passes the per-call session explicitly. + """ + if session is None: + session = _current_session_or_default() + + # 1. End orphaned subagent runs (SubagentStop never fired) + for agent_id, subagent_run in session.subagent_runs.items(): + try: + subagent_run.end(error="Subagent run not completed (conversation ended)") + subagent_run.patch() + except Exception as e: + logger.debug(f"Failed to clean up orphaned subagent run {agent_id}: {e}") + + # 2. Finalise ended subagent runs (outputs already set by PostToolUse) + for tool_use_id, subagent_run in session.ended_subagent_runs.items(): + try: + subagent_run.end() + subagent_run.patch() + except Exception as e: + logger.debug(f"Failed to finalise ended subagent run {tool_use_id}: {e}") + + # 3. End orphaned tool runs + for tool_use_id, (tool_run, _) in session.active_tool_runs.items(): + try: + tool_run.end(error="Tool run not completed (conversation ended)") + tool_run.patch() + except Exception as e: + logger.debug(f"Failed to clean up orphaned tool run {tool_use_id}: {e}") + + # 4. Reset session state + session.active_tool_runs.clear() + session.subagent_runs.clear() + session.pending_agent_tools.clear() + session.agent_to_tool_mapping.clear() + session.ended_subagent_runs.clear() + session.subagent_transcript_paths.clear() + session.main_transcript_path = None + session.root_run = None diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_messages.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_messages.py new file mode 100644 index 0000000000000000000000000000000000000000..102c5640b710b6530b6a69f09239946299c9228d --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_messages.py @@ -0,0 +1,112 @@ +"""Message processing and content serialization for Claude Agent SDK.""" + +from typing import Any + + +def _extract_tool_result_text(content: Any) -> str: + """Extract text content from tool result content blocks.""" + if content is None: + return "" + if isinstance(content, str): + return content + if isinstance(content, list): + texts = [] + for item in content: + if isinstance(item, dict): + if item.get("type") == "text": + texts.append(item.get("text", "")) + elif hasattr(item, "text"): + texts.append(getattr(item, "text", "")) + return "\n".join(texts) if texts else str(content) + return str(content) + + +def flatten_content_blocks(content: Any) -> Any: + """Convert SDK content blocks into serializable dicts using explicit type checks.""" + if not isinstance(content, list): + return content + + result = [] + for block in content: + block_type = type(block).__name__ + + # Handle known Claude SDK block types + if block_type == "TextBlock": + result.append( + { + "type": "text", + "text": getattr(block, "text", ""), + } + ) + elif block_type == "ThinkingBlock": + result.append( + { + "type": "thinking", + "thinking": getattr(block, "thinking", ""), + "signature": getattr(block, "signature", ""), + } + ) + elif block_type == "ToolUseBlock": + result.append( + { + "type": "tool_use", + "id": getattr(block, "id", None), + "name": getattr(block, "name", None), + "input": getattr(block, "input", None), + } + ) + elif block_type == "ToolResultBlock": + # Extract text from nested content for tool results + tool_content = getattr(block, "content", None) + content_text = _extract_tool_result_text(tool_content) + result.append( + { + "type": "tool_result", + "tool_use_id": getattr(block, "tool_use_id", None), + "content": content_text, + "is_error": getattr(block, "is_error", False), + } + ) + else: + result.append(block) + return result + + +def unwrap_message_dicts(messages: list[Any]) -> list[dict[str, Any]]: + """Normalize SDK message dicts into ``{role, content}`` form. + + The Claude SDK wraps messages in ``{"message": {"role": ..., "content": ...}}`` + envelopes. This function unwraps them into a flat list. + """ + result: list[dict[str, Any]] = [] + for msg in messages: + if not isinstance(msg, dict): + result.append(msg) + continue + if "message" in msg: + inner = msg["message"] + if isinstance(inner, dict): + result.append( + { + "role": inner.get("role", "user"), + "content": inner.get("content", ""), + } + ) + else: + result.append(msg) + else: + result.append(msg) + return result + + +def build_llm_input(prompt: Any, history: list[dict[str, Any]]) -> list[dict[str, Any]]: + """Construct a combined prompt + history message list.""" + if isinstance(prompt, str): + entry = {"content": prompt, "role": "user"} + return [entry, *history] if history else [entry] + + if isinstance(prompt, list): + formatted = unwrap_message_dicts(prompt) + return [*formatted, *history] if history else formatted + + return list(history) if history else [] diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_tools.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_tools.py new file mode 100644 index 0000000000000000000000000000000000000000..0b15ef7ff9628c865e98cb3e7f0e2c87483ad8e2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_tools.py @@ -0,0 +1,43 @@ +"""Context-var storage utilities for Claude Agent SDK tracing. + +This module stores the *parent run tree* โ€” the root chain span opened by +``_traced_receive_response`` โ€” for direct/default-session hook calls. Real +instrumented client sessions primarily parent hook spans via +``SessionState.root_run``. + +A :class:`contextvars.ContextVar` is used so concurrent conversations on the +same thread (e.g. multiple ``ClaudeSDKClient`` instances driven by +``asyncio.gather``) each see their own parent run tree. +""" + +from contextvars import ContextVar +from typing import Any, Optional + +_parent_run_tree: ContextVar[Optional[Any]] = ContextVar( + "langsmith_claude_agent_parent_run_tree", default=None +) + + +def set_parent_run_tree(run_tree: Any) -> Any: + """Bind *run_tree* to the current context and return a reset token.""" + return _parent_run_tree.set(run_tree) + + +def clear_parent_run_tree(token: Any = None) -> None: + """Reset the parent run tree in the current context. + + If a *token* from :func:`set_parent_run_tree` is provided, it is used + to restore the previous value; otherwise the context is cleared. + """ + if token is not None: + try: + _parent_run_tree.reset(token) + except ValueError: + _parent_run_tree.set(None) + else: + _parent_run_tree.set(None) + + +def get_parent_run_tree() -> Any: + """Return the parent run tree bound to the current context.""" + return _parent_run_tree.get() diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_transcripts.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_transcripts.py new file mode 100644 index 0000000000000000000000000000000000000000..533089ab31076b294f7a7ffbf0de6b05bee8a85b --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_transcripts.py @@ -0,0 +1,172 @@ +"""Post-conversation transcript reconciliation. + +After a conversation ends this module: + +1. Creates LLM runs for subagent turns that were not relayed through + the parent stream (the SDK only streams the first assistant message + per subagent; subsequent turns are folded into the Agent tool result). + +2. Patches accurate token usage onto all LLM runs from the JSONL + transcripts (the live stream only has partial streaming counts). + +.. note:: + + The transcript JSONL format is **not a contracted API** of the Claude + Agent SDK. Changes to the format could silently degrade trace + fidelity. If the SDK begins relaying all subagent messages through + the stream, step 1 becomes a no-op (the dedup guard skips already- + seen ``message_id`` values). +""" + +import logging +from datetime import datetime +from typing import TYPE_CHECKING, Any, Optional + +from ._hooks import SessionState, _current_session_or_default +from ._usage import ( + extract_usage_metadata, + read_llm_turns_from_transcript, + read_usage_from_transcript, +) + +if TYPE_CHECKING: + from ._client import TurnLifecycle + +logger = logging.getLogger(__name__) + +LLM_RUN_NAME = "claude.assistant.turn" + + +def reconcile_from_transcripts( + tracker: "TurnLifecycle", + session: Optional[SessionState] = None, +) -> None: + """Read transcripts and reconcile LLM runs. + + This function does two things after the conversation ends: + + 1. **Missing subagent LLM runs** โ€” creates LLM runs for subagent + turns whose ``message_id`` is not already in + ``tracker.llm_runs_by_message_id``. + + 2. **Usage correction** โ€” patches accurate usage from the JSONL + transcripts onto all LLM runs (both streamed and synthetic). + + If *session* is omitted the current ContextVar-bound session (or the + module-level default) is used. The caller in ``receive_response`` + passes the per-conversation session explicitly to stay safe under + concurrent tracing. + """ + if session is None: + session = _current_session_or_default() + _create_missing_subagent_llm_runs(tracker, session) + _patch_usage_on_llm_runs(tracker, session) + + +# โ”€โ”€ Step 1: synthetic subagent LLM runs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +def _create_missing_subagent_llm_runs( + tracker: "TurnLifecycle", + session: SessionState, +) -> None: + # Guard against the same message_id being processed twice (e.g. if + # the same transcript path appears multiple times in the list). + created: set[str] = set() + for path, subagent_run in session.subagent_transcript_paths: + try: + turns = read_llm_turns_from_transcript(path) + for turn in turns: + mid = turn["message_id"] + if mid in tracker.llm_runs_by_message_id: + continue + if mid in created: + continue + + ts = _parse_timestamp(turn.get("timestamp")) + + input_messages = turn.get("input_messages", []) + llm_metadata: dict[str, Any] = { + "ls_provider": "anthropic", + } + if turn.get("model"): + llm_metadata["ls_model_name"] = turn["model"] + + llm_run = subagent_run.create_child( + name=LLM_RUN_NAME, + run_type="llm", + inputs={"messages": input_messages} if input_messages else {}, + extra={"metadata": llm_metadata}, + start_time=ts, + ) + + llm_run.outputs = { + "content": turn.get("content", []), + "role": "assistant", + } + + raw_usage = turn.get("usage") + if raw_usage: + usage_meta = extract_usage_metadata(raw_usage) + if usage_meta: + meta = llm_run.extra.setdefault("metadata", {}) + meta["usage_metadata"] = usage_meta + + llm_run.end(end_time=ts) + try: + llm_run.post() + llm_run.patch() + except Exception as e: + logger.warning(f"Failed to post/patch subagent LLM run: {e}") + + tracker.llm_runs_by_message_id[mid] = llm_run + created.add(mid) + logger.debug(f"Created missing subagent LLM run for message {mid}") + except Exception as e: + logger.warning( + f"Failed to create subagent LLM runs from {path}: {e}", + exc_info=True, + ) + + +# โ”€โ”€ Step 2: usage patching โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +def _patch_usage_on_llm_runs( + tracker: "TurnLifecycle", + session: SessionState, +) -> None: + if not tracker.llm_runs_by_message_id: + return + + all_usage: dict[str, dict[str, Any]] = {} + + main_path = session.main_transcript_path + if main_path: + all_usage.update(read_usage_from_transcript(main_path)) + + for path, _run in session.subagent_transcript_paths: + all_usage.update(read_usage_from_transcript(path)) + + patched = 0 + for message_id, run in tracker.llm_runs_by_message_id.items(): + usage = all_usage.get(message_id) + if usage: + meta = run.extra.setdefault("metadata", {}) + meta["usage_metadata"] = usage + patched += 1 + + if patched: + logger.debug(f"Set usage on {patched} LLM run(s) from transcripts") + + +# โ”€โ”€ Helpers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + + +def _parse_timestamp(value: Optional[str]) -> Optional[datetime]: + if not value: + return None + try: + return datetime.fromisoformat(value.replace("Z", "+00:00")) + except (ValueError, TypeError): + return None diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_usage.py b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_usage.py new file mode 100644 index 0000000000000000000000000000000000000000..46a6e679b37ebc61a5ce689b43839d112bed239f --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/claude_agent_sdk/_usage.py @@ -0,0 +1,248 @@ +"""Token usage utilities for Claude Agent SDK. + +Normalizes raw Anthropic usage dicts into the canonical ``usage_metadata`` +format expected by LangSmith. The key Anthropic-specific behavior is that +cache tokens (``cache_read_input_tokens`` and ``cache_creation_input_tokens``) +are **additive** โ€” they are *not* included in the raw ``input_tokens`` value, +so they must be summed in. + +The canonical shape matches the JS LangSmith SDK's ``createUsageMetadata``: + +.. code-block:: json + + { + "input_tokens": 21400, + "output_tokens": 7, + "total_tokens": 21407, + "input_token_details": { + "cache_read": 21375, + "ephemeral_5m_input_tokens": 0, + "ephemeral_1hr_input_tokens": 0 + } + } +""" + +import json +import logging +from pathlib import Path +from typing import Any + +logger = logging.getLogger(__name__) + + +def _to_int(value: Any) -> int: + try: + return int(value) + except (ValueError, TypeError): + return 0 + + +def extract_usage_metadata(usage: Any) -> dict[str, Any]: + """Normalize a raw Anthropic usage dict into canonical ``usage_metadata``. + + Anthropic cache tokens are **additive**: ``cache_read_input_tokens`` and + ``cache_creation_input_tokens`` are not included in the raw + ``input_tokens``, so we sum them in to get the true input total. + """ + if not usage: + return {} + + get = ( + usage.get if isinstance(usage, dict) else lambda k, d=None: getattr(usage, k, d) + ) + + raw_input = _to_int(get("input_tokens")) + output_tokens = _to_int(get("output_tokens")) + + # Build input_token_details from cache fields + input_token_details: dict[str, int] = {} + + cache_read = _to_int(get("cache_read_input_tokens")) + if cache_read: + input_token_details["cache_read"] = cache_read + + # Structured cache_creation (with ephemeral breakdown) takes precedence + # over the flat cache_creation_input_tokens field. + cache_creation = get("cache_creation") + if isinstance(cache_creation, dict): + eph_5m = _to_int(cache_creation.get("ephemeral_5m_input_tokens")) + eph_1h = _to_int(cache_creation.get("ephemeral_1h_input_tokens")) + if eph_5m: + input_token_details["ephemeral_5m_input_tokens"] = eph_5m + if eph_1h: + input_token_details["ephemeral_1hr_input_tokens"] = eph_1h + else: + # Flat/legacy field โ€” assume 5-minute cache + flat_cache_create = _to_int(get("cache_creation_input_tokens")) + if flat_cache_create: + input_token_details["ephemeral_5m_input_tokens"] = flat_cache_create + + # Sum cache tokens into input_tokens (Anthropic cache tokens are additive) + cache_token_sum = sum(input_token_details.values()) + adjusted_input = raw_input + cache_token_sum + total_tokens = adjusted_input + output_tokens + + meta: dict[str, Any] = { + "input_tokens": adjusted_input, + "output_tokens": output_tokens, + "total_tokens": total_tokens, + } + if input_token_details: + meta["input_token_details"] = input_token_details + + return meta + + +def read_usage_from_transcript( + file_path: str, +) -> dict[str, dict[str, Any]]: + """Read a JSONL transcript and return final usage per message_id. + + The Claude SDK streams assistant messages as multiple JSONL chunks + with the same ``message.id``. Only the final chunk (where + ``stop_reason`` is set) has accurate ``output_tokens``. + + Returns: + ``{message_id: usage_metadata}`` with canonical usage dicts. + """ + try: + path = Path(file_path) + if not path.exists(): + return {} + + # Collect the last usage seen per message_id โ€” the final chunk + # (with stop_reason set) overwrites earlier partials. + raw_usage: dict[str, dict[str, Any]] = {} + with open(path) as f: + for line in f: + line = line.strip() + if not line: + continue + try: + data = json.loads(line) + except (json.JSONDecodeError, ValueError): + continue + if data.get("type") != "assistant": + continue + msg = data.get("message", {}) + msg_id = msg.get("id") + usage = msg.get("usage") + if not msg_id or not usage: + continue + # Always overwrite โ€” later chunks have better counts. + # The final chunk (with stop_reason) is last. + raw_usage[msg_id] = usage + + return {mid: extract_usage_metadata(u) for mid, u in raw_usage.items() if u} + except OSError as e: + logger.debug(f"Could not read transcript {file_path}: {e}") + return {} + + +def read_llm_turns_from_transcript( + file_path: str, +) -> list[dict[str, Any]]: + """Read final LLM turns from a JSONL transcript. + + Each API request produces two assistant entries in the transcript + (a streaming partial and a final completion) sharing the same + ``message.id``. Only the **final** entry (with ``stop_reason`` set) + is returned. + + Returns a list of dicts ordered by appearance, each containing:: + + { + "message_id": str, + "model": str, + "content": list[dict], # Anthropic content blocks + "stop_reason": str, # "end_turn" or "tool_use" + "usage": dict, # raw Anthropic usage dict + "timestamp": str | None, # ISO 8601 timestamp + "input_messages": list[dict], # preceding conversation messages + } + """ + try: + path = Path(file_path) + if not path.exists(): + return [] + + # Single pass: build a running conversation history so each + # assistant turn gets the full message context the API saw. + # Tool result blocks are formatted as role:"tool" messages. + entries_by_id: dict[str, dict[str, Any]] = {} + conversation: list[dict[str, Any]] = [] + with open(path) as f: + for line in f: + line = line.strip() + if not line: + continue + try: + data = json.loads(line) + except (json.JSONDecodeError, ValueError): + continue + + entry_type = data.get("type") + + if entry_type == "user": + msg = data.get("message", {}) + content = msg.get("content") + if content is None: + continue + # Detect tool_result blocks and format as tool + # messages, matching the live stream formatting. + if isinstance(content, list) and content: + is_tool_result = any( + isinstance(b, dict) and b.get("type") == "tool_result" + for b in content + ) + if is_tool_result: + for block in content: + if ( + isinstance(block, dict) + and block.get("type") == "tool_result" + ): + conversation.append( + { + "role": "tool", + "content": block.get("content", ""), + "tool_call_id": block.get("tool_use_id"), + } + ) + continue + conversation.append({"role": "user", "content": content}) + continue + + if entry_type != "assistant": + continue + + msg = data.get("message", {}) + msg_id = msg.get("id") + if not msg_id: + continue + # Always overwrite โ€” the final entry (with stop_reason) + # comes last for each message_id. + entries_by_id[msg_id] = { + "message_id": msg_id, + "model": msg.get("model"), + "content": msg.get("content", []), + "stop_reason": msg.get("stop_reason"), + "usage": msg.get("usage"), + "timestamp": data.get("timestamp"), + # Full conversation history up to this turn. + "input_messages": list(conversation), + } + # Add completed assistant content to conversation + # so subsequent turns see it. + if msg.get("stop_reason"): + conversation.append( + { + "role": "assistant", + "content": msg.get("content", []), + } + ) + + # Only return final entries (stop_reason is set). + return [e for e in entries_by_id.values() if e.get("stop_reason")] + except OSError as e: + logger.debug(f"Could not read transcript {file_path}: {e}") + return [] diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__init__.py b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..63fa7c23ec79b2f4461d244016bf87dd95b5a2ef --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__init__.py @@ -0,0 +1,127 @@ +"""LangSmith integration for Google ADK (Agent Development Kit).""" + +from __future__ import annotations + +import logging +from typing import Optional + +from ._config import set_tracing_config + +logger = logging.getLogger(__name__) + +__all__ = ["configure_google_adk", "create_traced_session_context"] + +_patched = False + + +def configure_google_adk( + name: Optional[str] = None, + project_name: Optional[str] = None, + metadata: Optional[dict] = None, + tags: Optional[list[str]] = None, +) -> bool: + """Enable LangSmith tracing for Google ADK. + + Can be called before or after importing Runner (import-order agnostic). + + Args: + name: Name of the root trace. Defaults to "google_adk.session". + project_name: LangSmith project to trace to. + metadata: Metadata to associate with all traces. + tags: Tags to associate with all traces. + + Returns: + True if configuration was successful, False otherwise. + """ + global _patched + + if _patched: + set_tracing_config( + name=name, project_name=project_name, metadata=metadata, tags=tags + ) + return True + + try: + import google.adk # noqa: F401 + from wrapt import wrap_function_wrapper # type: ignore[import-untyped] + except ImportError as e: + logger.warning(f"Missing dependency: {e}") + return False + + set_tracing_config( + name=name, project_name=project_name, metadata=metadata, tags=tags + ) + + from ._client import ( + wrap_agent_run_async, + wrap_flow_call_llm_async, + wrap_runner_run, + wrap_runner_run_async, + wrap_tool_run_async, + ) + + _wraps = [ + ( + "google.adk.runners", + "Runner.run", + wrap_runner_run, + ), + ( + "google.adk.runners", + "Runner.run_async", + wrap_runner_run_async, + ), + ( + "google.adk.agents.base_agent", + "BaseAgent.run_async", + wrap_agent_run_async, + ), + ( + "google.adk.flows.llm_flows.base_llm_flow", + "BaseLlmFlow._call_llm_async", + wrap_flow_call_llm_async, + ), + ( + "google.adk.tools.base_tool", + "BaseTool.run_async", + wrap_tool_run_async, + ), + ( + "google.adk.tools.function_tool", + "FunctionTool.run_async", + wrap_tool_run_async, + ), + ( + "google.adk.tools.mcp_tool.mcp_tool", + "McpTool.run_async", + wrap_tool_run_async, + ), + ] + + for module, name, wrapper in _wraps: + try: + wrap_function_wrapper(module, name, wrapper) + except Exception as e: + logger.warning(f"Failed to wrap {name}: {e}") + + _patched = True + return True + + +def create_traced_session_context( + name: Optional[str] = None, + project_name: Optional[str] = None, + metadata: Optional[dict] = None, + tags: Optional[list[str]] = None, + inputs: Optional[dict] = None, +): + """Create a trace context for manual session tracing.""" + from ._client import create_traced_session_context as _create_context + + return _create_context( + name=name, + project_name=project_name, + metadata=metadata, + tags=tags, + inputs=inputs, + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..700f5a6e6a11b93447b20a080b81b227bf81ae2c Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_client.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_client.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fe0e286b16052f0d0c806f3884502f9ca5dee6b Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_client.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_config.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_config.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..872fae49698fe39eefd7e8dd0428a673bbe1ed93 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_config.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_messages.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_messages.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54a9b52591ee4225ec3278f8cece6a63631fc59f Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_messages.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_usage.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_usage.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3dd63a601639a30358c01c08139cb525c2ad025a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/__pycache__/_usage.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_client.py b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_client.py new file mode 100644 index 0000000000000000000000000000000000000000..fe521eb9c4b923606c7afded9921679c928b508b --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_client.py @@ -0,0 +1,489 @@ +"""Client instrumentation for Google ADK using wrapt.""" + +from __future__ import annotations + +import json +import logging +import time +from collections.abc import AsyncGenerator +from contextlib import aclosing +from datetime import datetime, timezone +from functools import cache +from typing import Any, Optional + +from langsmith.run_helpers import get_current_run_tree, set_tracing_parent, trace + +from ._config import get_tracing_config +from ._messages import convert_llm_request_to_messages, has_function_calls +from ._usage import extract_model_name, extract_usage_from_response + +_LS_PROVIDER_VERTEXAI = "google_vertexai" +_LS_PROVIDER_GOOGLE_AI = "google_ai" + + +def extract_tools_from_llm_request(llm_request: Any) -> list[dict[str, Any]]: + """Extract tool definitions from LlmRequest and convert to OpenAI format.""" + config = getattr(llm_request, "config", None) + if not config: + return [] + + tools_list = getattr(config, "tools", None) + if not tools_list: + return [] + + result = [] + for tool in tools_list: + for func_decl in getattr(tool, "function_declarations", None) or []: + try: + dumped = func_decl.model_dump(exclude_none=True) + result.append( + { + "type": "function", + "function": dumped, + } + ) + except Exception: + pass + + return result + + +def _get_ls_provider() -> str: + """Detect provider based on GOOGLE_GENAI_USE_VERTEXAI env var.""" + import os + + use_vertexai = os.environ.get("GOOGLE_GENAI_USE_VERTEXAI", "0").lower() in ( + "1", + "true", + "yes", + ) + return _LS_PROVIDER_VERTEXAI if use_vertexai else _LS_PROVIDER_GOOGLE_AI + + +logger = logging.getLogger(__name__) + +TRACE_CHAIN_NAME = "google_adk.session" + + +@cache +def _get_package_version(package_name: str) -> str | None: + try: + from importlib.metadata import version + + return version(package_name) + except Exception: + return None + + +# Attribute name used to bridge the root run from Runner.run (sync) into the +# background thread where Runner.run_async executes. Runner.run spins up a +# new thread for its internal asyncio event loop, so context vars don't +# propagate automatically. Storing the run on the instance (a plain object +# attribute) crosses the thread boundary, and wrap_runner_run_async picks it +# up and re-establishes it as a context var. +_SYNC_ROOT_RUN_ATTR = "_langsmith_root_run" + + +def _extract_text_from_content(content: Any) -> Optional[str]: + if content is None: + return None + parts = getattr(content, "parts", None) + if not parts: + return None + text_parts = [str(p.text) for p in parts if getattr(p, "text", None)] + return " ".join(text_parts) if text_parts else None + + +def _iter_invocation_events(ctx: Any) -> list[Any]: + """Get session events for the current invocation.""" + session = getattr(ctx, "session", None) + if session is None: + return [] + invocation_id = getattr(ctx, "invocation_id", None) + events = getattr(session, "events", None) or [] + if invocation_id is None: + return list(events) + return [e for e in events if getattr(e, "invocation_id", None) == invocation_id] + + +def _extract_latest_invocation_text(ctx: Any) -> Optional[str]: + """Get the latest text from session events for the current invocation.""" + for event in reversed(_iter_invocation_events(ctx)): + text = _extract_text_from_content(getattr(event, "content", None)) + if text: + return text + return None + + +def wrap_runner_run(wrapped: Any, instance: Any, args: Any, kwargs: Any) -> Any: + """Wrap Runner.run to create a root trace for synchronous execution. + + Runner.run internally starts a new thread to run its async event loop, so + context vars set here would not be visible to code running in that thread. + We bridge the gap by storing the root run on the instance (a plain object + attribute that IS visible across threads) so that wrap_runner_run_async can + re-establish it as a context var inside the async event loop. + """ + config = get_tracing_config() + trace_name = config.get("name") or TRACE_CHAIN_NAME + + trace_inputs: dict[str, Any] = {} + if new_message := kwargs.get("new_message"): + if text := _extract_text_from_content(new_message): + trace_inputs["input"] = text + + trace_metadata: dict[str, Any] = { + "ls_provider": _get_ls_provider(), + "ls_integration": "google-adk", + "ls_integration_version": _get_package_version("google-adk"), + **(config.get("metadata") or {}), + } + if app_name := getattr(instance, "app_name", None): + trace_metadata["app_name"] = app_name + if user_id := kwargs.get("user_id"): + trace_metadata["user_id"] = user_id + if session_id := kwargs.get("session_id"): + trace_metadata["session_id"] = session_id + + def _trace_run(): + with trace( + name=trace_name, + run_type="chain", + inputs=trace_inputs, + project_name=config.get("project_name"), + tags=config.get("tags"), + metadata=trace_metadata, + ) as root_run: + setattr(instance, _SYNC_ROOT_RUN_ATTR, root_run) + try: + events = list(wrapped(*args, **kwargs)) + final_output = None + for event in reversed(events): + if content := getattr(event, "content", None): + if text := _extract_text_from_content(content): + final_output = text + break + root_run.end(outputs={"output": final_output} if final_output else None) + yield from events + except Exception as e: + root_run.end(error=str(e)) + raise + finally: + setattr(instance, _SYNC_ROOT_RUN_ATTR, None) + + return _trace_run() + + +async def wrap_runner_run_async( + wrapped: Any, instance: Any, args: Any, kwargs: Any +) -> Any: + """Wrap Runner.run_async to create a root trace for asynchronous execution. + + When called from the background thread spawned by Runner.run, the root run + stored on the instance is re-established as a context var so that + wrap_agent_run_async and wrap_flow_call_llm_async can find the parent via + get_current_run_tree(). + """ + root_run = getattr(instance, _SYNC_ROOT_RUN_ATTR, None) + if root_run is not None: + # sync bridge: re-establish root run as context var in this thread + with set_tracing_parent(root_run): + async with aclosing(wrapped(*args, **kwargs)) as agen: + async for event in agen: + yield event + return + + config = get_tracing_config() + trace_name = config.get("name") or TRACE_CHAIN_NAME + + trace_inputs: dict[str, Any] = {} + if new_message := kwargs.get("new_message"): + if text := _extract_text_from_content(new_message): + trace_inputs["input"] = text + + trace_metadata: dict[str, Any] = { + "ls_provider": _get_ls_provider(), + "ls_integration": "google-adk", + "ls_integration_version": _get_package_version("google-adk"), + **(config.get("metadata") or {}), + } + if app_name := getattr(instance, "app_name", None): + trace_metadata["app_name"] = app_name + if user_id := kwargs.get("user_id"): + trace_metadata["user_id"] = user_id + if session_id := kwargs.get("session_id"): + trace_metadata["session_id"] = session_id + + async def _trace_run_async() -> AsyncGenerator[Any, None]: + async with trace( + name=trace_name, + run_type="chain", + inputs=trace_inputs, + project_name=config.get("project_name"), + tags=config.get("tags"), + metadata=trace_metadata, + ) as run: + try: + final_output: Optional[str] = None + async with aclosing(wrapped(*args, **kwargs)) as agen: + async for event in agen: + if content := getattr(event, "content", None): + if text := _extract_text_from_content(content): + final_output = text + yield event + run.end(outputs={"output": final_output} if final_output else None) + except Exception as e: + run.end(error=str(e)) + raise + + async for event in _trace_run_async(): + yield event + + +async def wrap_agent_run_async( + wrapped: Any, instance: Any, args: Any, kwargs: Any +) -> Any: + """Wrap BaseAgent.run_async to create a chain span for each agent invocation.""" + parent = get_current_run_tree() + if not parent: + async with aclosing(wrapped(*args, **kwargs)) as agen: + async for event in agen: + yield event + return + + ctx = args[0] if args else kwargs.get("parent_context") + agent_name = getattr(instance, "name", None) or type(instance).__name__ + + inputs: dict[str, Any] = {} + if ctx is not None: + if latest := _extract_latest_invocation_text(ctx): + inputs["input"] = latest + + async with trace(name=agent_name, run_type="chain", inputs=inputs) as agent_run: + try: + final_output: Optional[str] = None + async with aclosing(wrapped(*args, **kwargs)) as agen: + async for event in agen: + if content := getattr(event, "content", None): + if text := _extract_text_from_content(content): + final_output = text + yield event + agent_run.end(outputs={"output": final_output} if final_output else None) + except Exception as e: + agent_run.end(error=str(e)) + raise + + +async def wrap_tool_run_async( + wrapped: Any, instance: Any, args: Any, kwargs: Any +) -> Any: + """Wrap BaseTool.run_async (all tool subclasses) to trace tool invocations.""" + parent = get_current_run_tree() + if not parent: + return await wrapped(*args, **kwargs) + + tool_name = getattr(instance, "name", None) or type(instance).__name__ + tool_args = kwargs.get("args") or (args[0] if args else {}) + inputs = tool_args if isinstance(tool_args, dict) else {"args": tool_args} + + start_time = time.time() + tool_run = parent.create_child( + name=tool_name, + run_type="tool", + inputs=inputs, + extra={"metadata": {"ls_provider": _get_ls_provider()}}, + start_time=datetime.fromtimestamp(start_time, tz=timezone.utc), + ) + + try: + tool_run.post() + except Exception as e: + logger.debug(f"Failed to post tool run: {e}") + + try: + result = await wrapped(*args, **kwargs) + if isinstance(result, dict): + outputs = result + elif isinstance(result, list): + outputs = {"content": result} + elif result is not None: + outputs = {"output": str(result)} + else: + outputs = {} + tool_run.end(outputs=outputs) + try: + tool_run.patch() + except Exception as e: + logger.debug(f"Failed to patch tool run: {e}") + return result + except Exception as e: + tool_run.end(error=str(e)) + try: + tool_run.patch() + except Exception as patch_e: + logger.debug(f"Failed to patch tool run on error: {patch_e}") + raise + + +def _determine_llm_call_type(llm_request: Any, llm_response: Any) -> str: + try: + for content in getattr(llm_request, "contents", None) or []: + for part in getattr(content, "parts", None) or []: + if hasattr(part, "function_response") and part.function_response: + return "response_generation" + if has_function_calls(llm_response): + return "tool_selection" + return "direct_response" + except Exception: + return "unknown" + + +async def wrap_flow_call_llm_async( + wrapped: Any, instance: Any, args: Any, kwargs: Any +) -> Any: + """Wrap BaseLlmFlow._call_llm_async to capture LLM calls with TTFT tracking.""" + parent = get_current_run_tree() + if not parent: + async for event in wrapped(*args, **kwargs): + yield event + return + + llm_request = args[1] if len(args) > 1 else kwargs.get("llm_request") + model_name = extract_model_name(llm_request) if llm_request else None + messages = convert_llm_request_to_messages(llm_request) if llm_request else None + tools = extract_tools_from_llm_request(llm_request) if llm_request else [] + + inputs: dict[str, Any] = {} + if messages: + inputs["messages"] = messages + + metadata: dict[str, Any] = {"ls_provider": _get_ls_provider()} + if model_name: + metadata["ls_model_name"] = model_name + + # Build extra dict with invocation_params if tools exist + extra: dict[str, Any] = {"metadata": metadata} + if tools: + extra["invocation_params"] = {"tools": tools} + + start_time = time.time() + llm_run = parent.create_child( + name=model_name or "google_adk_llm", + run_type="llm", + inputs=inputs, + extra=extra, + start_time=datetime.fromtimestamp(start_time, tz=timezone.utc), + ) + + try: + llm_run.post() + except Exception as e: + logger.debug(f"Failed to post LLM run: {e}") + + first_token_time: Optional[float] = None + last_event = None + event_with_content = None + + try: + async with aclosing(wrapped(*args, **kwargs)) as agen: + async for event in agen: + is_partial = getattr(event, "partial", False) + + if first_token_time is None and is_partial: + first_token_time = time.time() + try: + llm_run.add_event( + { + "name": "new_token", + "time": datetime.fromtimestamp( + first_token_time, tz=timezone.utc + ).isoformat(), + } + ) + except Exception as e: + logger.debug(f"Failed to add new_token event: {e}") + + last_event = event + if hasattr(event, "content") and event.content is not None: + event_with_content = event + yield event + + outputs: dict[str, Any] = {"role": "assistant"} + content_source = event_with_content or last_event + + if ( + content_source + and hasattr(content_source, "content") + and content_source.content + ): + parts = getattr(content_source.content, "parts", None) or [] + text_parts, tool_calls = [], [] + + for i, part in enumerate(parts): + if hasattr(part, "text") and part.text: + text_parts.append(str(part.text)) + elif hasattr(part, "function_call") and part.function_call: + fc = part.function_call + tool_calls.append( + { + "id": f"call_{i}", + "type": "function", + "function": { + "name": getattr(fc, "name", ""), + "arguments": json.dumps( + dict(fc.args) if getattr(fc, "args", None) else {} + ), + }, + } + ) + + outputs["content"] = " ".join(text_parts) if text_parts else None + if tool_calls: + outputs["tool_calls"] = tool_calls + + if last_event: + if usage := extract_usage_from_response(last_event): + llm_run.extra.setdefault("metadata", {})["usage_metadata"] = usage + + if first_token_time is not None: + llm_run.extra.setdefault("metadata", {})["time_to_first_token"] = ( + first_token_time - start_time + ) + + if last_event and llm_request: + llm_run.extra.setdefault("metadata", {})["llm_call_type"] = ( + _determine_llm_call_type(llm_request, last_event) + ) + + llm_run.end(outputs=outputs) + try: + llm_run.patch() + except Exception as e: + logger.debug(f"Failed to patch LLM run: {e}") + + except Exception as e: + llm_run.end(error=str(e)) + try: + llm_run.patch() + except Exception as patch_e: + logger.debug(f"Failed to patch LLM run on error: {patch_e}") + raise + + +def create_traced_session_context( + name: Optional[str] = None, + project_name: Optional[str] = None, + metadata: Optional[dict[str, Any]] = None, + tags: Optional[list[str]] = None, + inputs: Optional[dict[str, Any]] = None, +): + """Create a trace context for manual session tracing.""" + config = get_tracing_config() + return trace( + name=name or config.get("name") or TRACE_CHAIN_NAME, + run_type="chain", + inputs=inputs or {}, + project_name=project_name or config.get("project_name"), + tags=tags or config.get("tags"), + metadata={**(config.get("metadata") or {}), **(metadata or {})}, + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_config.py b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_config.py new file mode 100644 index 0000000000000000000000000000000000000000..b32340bf46f7a08741585e9b0d25da25681dae6a --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_config.py @@ -0,0 +1,31 @@ +"""Configuration for Google ADK tracing.""" + +from __future__ import annotations + +from typing import Any, Optional + +_tracing_config: dict[str, Any] = { + "name": None, + "project_name": None, + "metadata": None, + "tags": None, +} + + +def set_tracing_config( + name: Optional[str] = None, + project_name: Optional[str] = None, + metadata: Optional[dict] = None, + tags: Optional[list[str]] = None, +) -> None: + global _tracing_config + _tracing_config = { + "name": name, + "project_name": project_name, + "metadata": metadata, + "tags": tags, + } + + +def get_tracing_config() -> dict[str, Any]: + return _tracing_config.copy() diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_messages.py b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_messages.py new file mode 100644 index 0000000000000000000000000000000000000000..a2b4b8352dc842b8798921222c9ea7d6401bfba8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_messages.py @@ -0,0 +1,200 @@ +"""Message serialization for Google ADK.""" + +from __future__ import annotations + +import base64 +import json +from typing import Any + + +def convert_adk_content_to_langsmith(content: Any) -> list[dict[str, Any]]: + """Convert ADK Content/Part objects to serializable format.""" + if content is None: + return [] + if hasattr(content, "parts"): + parts = content.parts + elif isinstance(content, list): + parts = content + else: + return [_serialize_part(content)] + return [_serialize_part(part) for part in parts if part is not None] + + +def _serialize_part(part: Any) -> dict[str, Any]: + """Serialize a single Part.""" + if isinstance(part, dict): + return part + + if hasattr(part, "inline_data") and part.inline_data: + data = getattr(part.inline_data, "data", None) + mime_type = getattr(part.inline_data, "mime_type", "application/octet-stream") + if data is not None: + encoded = ( + base64.b64encode(data).decode("utf-8") + if isinstance(data, bytes) + else str(data) + ) + return {"type": "image", "data": encoded, "mime_type": mime_type} + + if hasattr(part, "file_data") and part.file_data: + return { + "type": "file", + "file_uri": getattr(part.file_data, "file_uri", None), + "mime_type": getattr(part.file_data, "mime_type", None), + } + + if hasattr(part, "function_call") and part.function_call: + fc = part.function_call + return { + "type": "tool_use", + "name": getattr(fc, "name", "unknown"), + "input": dict(getattr(fc, "args", None) or {}), + } + + if hasattr(part, "function_response") and part.function_response: + fr = part.function_response + return { + "type": "tool_result", + "name": getattr(fr, "name", "unknown"), + "content": _safe_serialize(getattr(fr, "response", None)), + } + + if hasattr(part, "text") and part.text is not None: + return {"type": "text", "text": str(part.text)} + + if hasattr(part, "executable_code") and part.executable_code: + code = part.executable_code + return { + "type": "executable_code", + "language": getattr(code, "language", "python"), + "code": getattr(code, "code", ""), + } + + if hasattr(part, "code_execution_result") and part.code_execution_result: + result = part.code_execution_result + return { + "type": "code_execution_result", + "outcome": getattr(result, "outcome", "unknown"), + "output": getattr(result, "output", ""), + } + + if hasattr(part, "thought") and part.thought is not None: + return {"type": "thinking", "thinking": str(part.thought)} + + return _safe_serialize(part) + + +def _safe_serialize(obj: Any) -> Any: + """Safely serialize an object to JSON-compatible format.""" + if obj is None or isinstance(obj, (str, int, float, bool)): + return obj + if isinstance(obj, bytes): + return base64.b64encode(obj).decode("utf-8") + if isinstance(obj, dict): + return {k: _safe_serialize(v) for k, v in obj.items()} + if isinstance(obj, (list, tuple)): + return [_safe_serialize(item) for item in obj] + if hasattr(obj, "model_dump"): + try: + return obj.model_dump() + except Exception: + pass + if hasattr(obj, "__dict__"): + try: + return {k: _safe_serialize(v) for k, v in obj.__dict__.items()} + except Exception: + pass + return str(obj) + + +def convert_llm_request_to_messages(llm_request: Any) -> list[dict[str, Any]]: + """Convert LlmRequest to OpenAI-compatible message format.""" + messages: list[dict[str, Any]] = [] + + # Extract system instruction from config + config = getattr(llm_request, "config", None) + if config: + sys_inst = getattr(config, "system_instruction", None) + if sys_inst: + messages.append({"role": "system", "content": str(sys_inst)}) + + contents = getattr(llm_request, "contents", None) + if not contents: + return messages + + for content in contents: + role = getattr(content, "role", "user") + if role == "model": + role = "assistant" + + parts = convert_adk_content_to_langsmith(content) + text_parts, tool_calls, tool_results = [], [], [] + + for part in parts: + t = part.get("type") + if t == "text": + text_parts.append(part.get("text", "")) + elif t == "tool_use": + tool_calls.append(part) + elif t == "tool_result": + tool_results.append(part) + else: + text_parts.append(str(part)) + + if tool_calls and role == "assistant": + messages.append( + { + "role": "assistant", + "content": " ".join(text_parts) if text_parts else None, + "tool_calls": [ + { + "id": f"call_{i}", + "type": "function", + "function": { + "name": tc.get("name", ""), + "arguments": json.dumps(tc.get("input", {})), + }, + } + for i, tc in enumerate(tool_calls) + ], + } + ) + elif tool_results: + for tr in tool_results: + c = tr.get("content") + messages.append( + { + "role": "tool", + "name": tr.get("name", ""), + "content": ( + json.dumps(c) if isinstance(c, dict) else str(c or "") + ), + } + ) + else: + messages.append( + { + "role": role, + "content": " ".join(text_parts) if text_parts else "", + } + ) + + return messages + + +def has_function_calls(llm_response: Any) -> bool: + """Check if LlmResponse contains function calls.""" + content = getattr(llm_response, "content", None) + if not content: + return False + parts = convert_adk_content_to_langsmith(content) + return any(p.get("type") == "tool_use" for p in parts) + + +def has_function_response_in_request(llm_request: Any) -> bool: + """Check if LlmRequest contains function responses (tool results).""" + for content in getattr(llm_request, "contents", None) or []: + parts = convert_adk_content_to_langsmith(content) + if any(p.get("type") == "tool_result" for p in parts): + return True + return False diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_usage.py b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_usage.py new file mode 100644 index 0000000000000000000000000000000000000000..b7afb56e1f20aef1be37be826dabd17ce585e782 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/google_adk/_usage.py @@ -0,0 +1,36 @@ +"""Token usage extraction for Google ADK.""" + +from __future__ import annotations + +from typing import Any, Optional + + +def extract_usage_from_response(llm_response: Any) -> dict[str, Any]: + """Extract token usage from LlmResponse.""" + usage: dict[str, Any] = {} + usage_metadata = getattr(llm_response, "usage_metadata", None) + if not usage_metadata: + return usage + + if (v := getattr(usage_metadata, "prompt_token_count", None)) is not None: + usage["input_tokens"] = int(v) + if (v := getattr(usage_metadata, "candidates_token_count", None)) is not None: + usage["output_tokens"] = int(v) + if (v := getattr(usage_metadata, "total_token_count", None)) is not None: + usage["total_tokens"] = int(v) + if (v := getattr(usage_metadata, "cached_content_token_count", None)) is not None: + usage.setdefault("input_token_details", {})["cache_read"] = int(v) + if (v := getattr(usage_metadata, "thoughts_token_count", None)) is not None: + usage.setdefault("output_token_details", {})["reasoning"] = int(v) + + return usage + + +def extract_model_name(llm_request: Any) -> Optional[str]: + """Extract the model name from an LlmRequest.""" + if config := getattr(llm_request, "config", None): + if model := getattr(config, "model", None): + return str(model) + if model := getattr(llm_request, "model", None): + return str(model) + return None diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__init__.py b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..649cb4208ce8cb30f56f0fa7313cea4fa12c61d7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__init__.py @@ -0,0 +1,8 @@ +"""LangSmith integration for OpenAI Agents SDK. + +This module provides tracing support for the OpenAI Agents SDK. +""" + +from ._openai_agents import OpenAIAgentsTracingProcessor + +__all__ = ["OpenAIAgentsTracingProcessor"] diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e564dc0f3cc1720943a59d01b2a3fc8c3c03d3ea Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/_openai_agent_utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/_openai_agent_utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c9def964f5153f4d7b72f038dd452dc1d090a41 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/_openai_agent_utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/_openai_agents.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/_openai_agents.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..febb7f759b893abb22d677534702ee6072a6f2ea Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/__pycache__/_openai_agents.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/_openai_agent_utils.py b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/_openai_agent_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..f80db8d8f2dbadf7ee436013643cd9147449c9ed --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/_openai_agent_utils.py @@ -0,0 +1,228 @@ +import json +import logging +from typing import Any, Literal + +try: + from agents import tracing # type: ignore[import] + + HAVE_AGENTS = True +except ImportError: + HAVE_AGENTS = False + +logger = logging.getLogger(__name__) + +RunTypeT = Literal["tool", "chain", "llm", "retriever", "embedding", "prompt", "parser"] + +if HAVE_AGENTS: + + def parse_io(data: Any, default_key: str = "output") -> dict: + """Parse inputs or outputs into a dictionary format. + + Args: + data: The data to parse (can be inputs or outputs) + default_key: The default key to use if data is not a dict + (`'input'` or `'output'`) + + Returns: + Dict: The parsed data as a dictionary + """ + if isinstance(data, list): + if len(data) == 0: + return {} + # Check if this is a list of output blocks (reasoning, message, etc.) + if len(data) > 0 and isinstance(data[0], dict): + if "type" in data[0]: + return {default_key: data} + elif len(data) == 1: + return data[0] + return {default_key: data} + elif isinstance(data, dict): + data_ = data + elif isinstance(data, str): + try: + parsed_json = json.loads(data) + if isinstance(parsed_json, dict): + data_ = parsed_json + else: + data_ = {default_key: data} + except json.JSONDecodeError: + data_ = {default_key: data} + elif ( + data is not None + and hasattr(data, "model_dump") + and callable(data.model_dump) + and not isinstance(data, type) + ): + try: + data_ = data.model_dump(exclude_none=True, mode="json") + except Exception as e: + logger.debug( + f"Failed to use model_dump to serialize {type(data)} to JSON: {e}" + ) + data_ = {default_key: data} + else: + data_ = {default_key: data} + + return data_ + + def get_run_type(span: tracing.Span) -> RunTypeT: + span_type = getattr(span.span_data, "type", None) + if span_type in ["agent", "handoff", "custom"]: + return "chain" + elif span_type in ["function", "guardrail"]: + return "tool" + elif span_type in ["generation", "response"]: + return "llm" + else: + return "chain" + + def get_run_name(span: tracing.Span) -> str: + if hasattr(span.span_data, "name") and span.span_data.name: + return span.span_data.name + span_type = getattr(span.span_data, "type", None) + if span_type == "generation": + return "Generation" + elif span_type == "response": + return "Response" + elif span_type == "handoff": + return "Handoff" + else: + return "Span" + + def _extract_function_span_data( + span_data: tracing.FunctionSpanData, + ) -> dict[str, Any]: + return { + "inputs": parse_io(span_data.input, "input"), + "outputs": parse_io(span_data.output, "output"), + } + + def _extract_generation_span_data( + span_data: tracing.GenerationSpanData, + ) -> dict[str, Any]: + data = { + "inputs": parse_io(span_data.input, "input"), + "outputs": parse_io(span_data.output, "output"), + "invocation_params": { + "model": span_data.model, + "model_config": span_data.model_config, + }, + } + if span_data.usage: + from langsmith.wrappers._openai import _create_usage_metadata + + if "metadata" not in data: + data["metadata"] = {} + data["metadata"]["usage_metadata"] = _create_usage_metadata(span_data.usage) + return data + + def _extract_response_span_data( + span_data: tracing.ResponseSpanData, + ) -> dict[str, Any]: + data: dict[str, Any] = {} + if span_data.input is not None: + data["inputs"] = { + "input": span_data.input, + "instructions": ( + span_data.response.instructions + if span_data.response is not None + and span_data.response.instructions + else "" + ), + } + if span_data.response is not None: + response = span_data.response.model_dump(exclude_none=True, mode="json") + output_data = response.pop("output", []) + data["outputs"] = parse_io(output_data, "output") + data["invocation_params"] = { + k: v + for k, v in response.items() + if k + in ( + "max_output_tokens", + "model", + "parallel_tool_calls", + "reasoning", + "temperature", + "text", + "tool_choice", + "tools", + "top_p", + "truncation", + ) + } + metadata = { + k: v + for k, v in response.items() + if k + not in ( + {"output", "usage", "instructions"}.union(data["invocation_params"]) + ) + } + metadata.update( + { + "ls_model_name": data["invocation_params"].get("model"), + "ls_max_tokens": data["invocation_params"].get("max_output_tokens"), + "ls_temperature": data["invocation_params"].get("temperature"), + "ls_model_type": "chat", + "ls_provider": "openai", + } + ) + if usage := response.pop("usage", None): + from langsmith.wrappers._openai import _create_usage_metadata + + metadata["usage_metadata"] = _create_usage_metadata(usage) + data["metadata"] = metadata + + return data + + def _extract_agent_span_data(span_data: tracing.AgentSpanData) -> dict[str, Any]: + return { + "invocation_params": { + "tools": span_data.tools, + "handoffs": span_data.handoffs, + }, + "metadata": { + "output_type": span_data.output_type, + }, + } + + def _extract_handoff_span_data( + span_data: tracing.HandoffSpanData, + ) -> dict[str, Any]: + return { + "inputs": { + "from_agent": span_data.from_agent, + "to_agent": span_data.to_agent, + } + } + + def _extract_guardrail_span_data( + span_data: tracing.GuardrailSpanData, + ) -> dict[str, Any]: + return {"metadata": {"triggered": span_data.triggered}} + + def _extract_custom_span_data(span_data: tracing.CustomSpanData) -> dict[str, Any]: + return {"metadata": span_data.data} + + def extract_span_data(span: tracing.Span) -> dict[str, Any]: + data: dict[str, Any] = {} + + if isinstance(span.span_data, tracing.FunctionSpanData): + data.update(_extract_function_span_data(span.span_data)) + elif isinstance(span.span_data, tracing.GenerationSpanData): + data.update(_extract_generation_span_data(span.span_data)) + elif isinstance(span.span_data, tracing.ResponseSpanData): + data.update(_extract_response_span_data(span.span_data)) + elif isinstance(span.span_data, tracing.AgentSpanData): + data.update(_extract_agent_span_data(span.span_data)) + elif isinstance(span.span_data, tracing.HandoffSpanData): + data.update(_extract_handoff_span_data(span.span_data)) + elif isinstance(span.span_data, tracing.GuardrailSpanData): + data.update(_extract_guardrail_span_data(span.span_data)) + elif isinstance(span.span_data, tracing.CustomSpanData): + data.update(_extract_custom_span_data(span.span_data)) + else: + return {} + + return data diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/_openai_agents.py b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/_openai_agents.py new file mode 100644 index 0000000000000000000000000000000000000000..d95364bd89876892f1dc2df1665f526046317c09 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/openai_agents_sdk/_openai_agents.py @@ -0,0 +1,436 @@ +import logging +import weakref +from datetime import datetime +from functools import cache +from typing import Optional + +from langsmith import run_trees as rt +from langsmith._internal import _context +from langsmith.run_helpers import get_current_run_tree + +try: + from agents import tracing # type: ignore[import] + + required = ( + "TracingProcessor", + "Trace", + "Span", + "ResponseSpanData", + ) + if not all(hasattr(tracing, name) for name in required): + raise ImportError("The `agents` package is not installed.") + + from langsmith.integrations.openai_agents_sdk import ( + _openai_agent_utils as agent_utils, + ) + + HAVE_AGENTS = True +except ImportError: + HAVE_AGENTS = False + + class OpenAIAgentsTracingProcessor: + """Tracing processor for the [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/). + + Traces all intermediate steps of your OpenAI Agent to LangSmith. + + Requirements: Make sure to install `pip install -U langsmith[openai-agents]`. + + Args: + client: An instance of `langsmith.client.Client`. If not provided, a default + client is created. + + Example: + ```python + from agents import ( + Agent, + FileSearchTool, + Runner, + WebSearchTool, + function_tool, + set_trace_processors, + ) + + from langsmith.wrappers import OpenAIAgentsTracingProcessor + + set_trace_processors([OpenAIAgentsTracingProcessor()]) + + + @function_tool + def get_weather(city: str) -> str: + return f"The weather in {city} is sunny" + + + haiku_agent = Agent( + name="Haiku agent", + instructions="Always respond in haiku form", + model="o3-mini", + tools=[get_weather], + ) + agent = Agent( + name="Assistant", + tools=[WebSearchTool()], + instructions="speak in spanish. use Haiku agent if they ask for a haiku or for the weather", + handoffs=[haiku_agent], + ) + + result = await Runner.run( + agent, + "write a haiku about the weather today and tell me a recent news story about new york", + ) + print(result.final_output) + ``` + """ # noqa: E501 + + def __init__(self, *args, **kwargs): + raise ImportError( + "The `agents` package is not installed. " + "Please install it with `pip install langsmith[openai-agents]`." + ) + + +from langsmith import client as ls_client + +logger = logging.getLogger(__name__) + + +@cache +def _get_package_version(package_name: str) -> str | None: + try: + from importlib.metadata import version + + return version(package_name) + except Exception: + return None + + +if HAVE_AGENTS: + + class OpenAIAgentsTracingProcessor(tracing.TracingProcessor): # type: ignore[no-redef] + """Tracing processor for the [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/). + + Traces all intermediate steps of your OpenAI Agent to LangSmith. + + Requirements: Make sure to install `pip install -U langsmith[openai-agents]`. + + Args: + client: An instance of `langsmith.client.Client`. If not provided, + a default client is created. + metadata: Metadata to associate with all traces. + tags: Tags to associate with all traces. + project_name: LangSmith project to trace to. + name: Name of the root trace. + + Example: + ```python + from agents import ( + Agent, + FileSearchTool, + Runner, + WebSearchTool, + function_tool, + set_trace_processors, + ) + + from langsmith.wrappers import OpenAIAgentsTracingProcessor + + set_trace_processors([OpenAIAgentsTracingProcessor()]) + + + @function_tool + def get_weather(city: str) -> str: + return f"The weather in {city} is sunny" + + + haiku_agent = Agent( + name="Haiku agent", + instructions="Always respond in haiku form", + model="o3-mini", + tools=[get_weather], + ) + agent = Agent( + name="Assistant", + tools=[WebSearchTool()], + instructions="speak in spanish. use Haiku agent if they ask for a haiku or for the weather", + handoffs=[haiku_agent], + ) + + result = await Runner.run( + agent, + "write a haiku about the weather today and tell me a recent news story about new york", + ) + print(result.final_output) + ``` + """ # noqa: E501 + + def __init__( + self, + client: Optional[ls_client.Client] = None, + *, + metadata: Optional[dict] = None, + tags: Optional[list[str]] = None, + project_name: Optional[str] = None, + name: Optional[str] = None, + ): + self.client = client or rt.get_cached_client() + self._metadata = metadata + self._tags = tags + self._project_name = project_name + self._name = name + self._first_response_inputs: dict = {} + self._last_response_outputs: dict = {} + + self._runs: dict[str, rt.RunTree] = {} + self._span_data_types: dict[ + str, type + ] = {} # Track span data types by span_id + self._unposted_traces: set[str] = set() + self._unposted_spans: set[str] = set() + + def on_trace_start(self, trace: tracing.Trace) -> None: + current_run_tree = get_current_run_tree() + + # Determine run name + if self._name: + run_name = self._name + elif trace.name: + run_name = trace.name + else: + run_name = "Agent workflow" + + # Build metadata + run_extra = { + "metadata": { + **(self._metadata or {}), + "ls_integration": "openai-agents-sdk", + "ls_integration_version": _get_package_version("openai-agents"), + "ls_agent_type": "root", + } + } + trace_dict = trace.export() or {} + if trace_dict.get("group_id") is not None: + run_extra["metadata"]["thread_id"] = trace_dict["group_id"] + + try: + if current_run_tree is not None: + # Nest under existing trace + new_run = current_run_tree.create_child( + name=run_name, + run_type="chain", + inputs={}, + extra=run_extra, + tags=self._tags, + ) + else: + # Create new root trace + run_kwargs = { + "name": run_name, + "run_type": "chain", + "inputs": {}, + "extra": run_extra, + "tags": self._tags, + "client": self.client, + } + if self._project_name is not None: + run_kwargs["project_name"] = self._project_name + new_run = rt.RunTree(**run_kwargs) # type: ignore[arg-type] + + # Delay posting until first response/generation span ends + # so inputs can be included in the POST. + self._unposted_traces.add(trace.trace_id) + if new_run is not None: + _context._PARENT_RUN_TREE_REF.set(weakref.ref(new_run)) + self._runs[trace.trace_id] = new_run + except Exception as e: + logger.exception(f"Error creating trace run: {e}") + + def on_trace_end(self, trace: tracing.Trace) -> None: + run = self._runs.pop(trace.trace_id, None) + if not run: + return + + trace_dict = trace.export() or {} + metadata = {**(trace_dict.get("metadata") or {}), **(self._metadata or {})} + + try: + # Update run with final inputs/outputs + run.outputs = self._last_response_outputs.pop(trace.trace_id, {}) + + # Update metadata + if "metadata" not in run.extra: + run.extra["metadata"] = {} + run.extra["metadata"].update(metadata) + + # End and patch + run.end() + + if trace.trace_id in self._unposted_traces: + # No response/generation spans ended, post now + run.inputs = self._first_response_inputs.pop(trace.trace_id, {}) + self._unposted_traces.discard(trace.trace_id) + run.post() + else: + self._first_response_inputs.pop(trace.trace_id, None) + run.patch(exclude_inputs=True) + + # Restore parent context + if run.parent_run is not None: + _context._PARENT_RUN_TREE_REF.set(weakref.ref(run.parent_run)) + else: + _context._PARENT_RUN_TREE_REF.set(None) + except Exception as e: + logger.exception(f"Error updating trace run: {e}") + + def on_span_start(self, span: tracing.Span) -> None: + # Find parent run + parent_run = ( + self._runs.get(span.parent_id) + if span.parent_id + else self._runs.get(span.trace_id) + ) + + if parent_run is None: + logger.warning( + f"No trace info found for span, skipping: {span.span_id}" + ) + return + + # Extract span data + run_name = agent_utils.get_run_name(span) + if isinstance(span.span_data, tracing.ResponseSpanData): + parent_name = parent_run.name + raw_span_name = getattr(span, "name", None) or getattr( + span.span_data, "name", None + ) + span_name = str(raw_span_name) if raw_span_name else run_name + if parent_name: + run_name = f"{parent_name} {span_name}".strip() + else: + run_name = span_name + + run_type = agent_utils.get_run_type(span) + extracted = agent_utils.extract_span_data(span) + + try: + # Create child run + child_run = parent_run.create_child( + name=run_name, + run_type=run_type, + inputs=extracted.get("inputs", {}), + extra=extracted, + start_time=datetime.fromisoformat(span.started_at) + if span.started_at + else None, + ) + + # Add ls_agent_type metadata for agent spans that are children of + # function spans (i.e., agents used as tools via as_tool()). + # Note: Handoff agents are considered root agents, not subagents, + # since they take over the conversation rather than being called + # as tools. + if isinstance(span.span_data, tracing.AgentSpanData): + # Check if parent span is a function span (agent used as tool) + parent_span_data_type = ( + self._span_data_types.get(span.parent_id) + if span.parent_id + else None + ) + if parent_span_data_type is tracing.FunctionSpanData: + if "metadata" not in child_run.extra: + child_run.extra["metadata"] = {} + child_run.extra["metadata"]["ls_agent_type"] = "subagent" + + # Track span data type for parent lookups + self._span_data_types[span.span_id] = type(span.span_data) + + # Delay posting for spans whose inputs aren't available at start + if isinstance( + span.span_data, + ( + tracing.GenerationSpanData, + tracing.ResponseSpanData, + tracing.FunctionSpanData, + ), + ): + self._unposted_spans.add(span.span_id) + else: + child_run.post() + self._runs[span.span_id] = child_run + except Exception as e: + logger.exception(f"Error creating span run: {e}") + + def on_span_end(self, span: tracing.Span) -> None: + run = self._runs.pop(span.span_id, None) + self._span_data_types.pop( + span.span_id, None + ) # Clean up span data type tracking + if not run: + return + + try: + # Extract outputs and metadata + extracted = agent_utils.extract_span_data(span) + outputs = extracted.pop("outputs", {}) + inputs = extracted.pop("inputs", {}) + + # Update run + run.outputs = outputs + if inputs: + run.inputs = inputs + if error := span.error: + run.error = str(error) + + # Add OpenAI metadata + if "metadata" not in run.extra: + run.extra["metadata"] = {} + run.extra["metadata"].update( + { + "openai_parent_id": span.parent_id, + "openai_trace_id": span.trace_id, + "openai_span_id": span.span_id, + } + ) + if metadata := extracted.get("metadata"): + run.extra["metadata"].update(metadata) + if invocation_params := extracted.get("invocation_params"): + run.extra["invocation_params"] = invocation_params + + if isinstance(span.span_data, tracing.ResponseSpanData): + self._first_response_inputs[span.trace_id] = ( + self._first_response_inputs.get(span.trace_id) or inputs + ) + self._last_response_outputs[span.trace_id] = outputs + self._maybe_post_trace(span.trace_id, inputs) + elif isinstance(span.span_data, tracing.GenerationSpanData): + self._first_response_inputs[span.trace_id] = ( + self._first_response_inputs.get(span.trace_id) or inputs + ) + self._last_response_outputs[span.trace_id] = outputs + self._maybe_post_trace(span.trace_id, inputs) + + if span.ended_at: + run.end_time = datetime.fromisoformat(span.ended_at) + else: + run.end() + + if span.span_id in self._unposted_spans: + self._unposted_spans.discard(span.span_id) + run.post() + else: + run.patch(exclude_inputs=True) + except Exception as e: + logger.exception(f"Error updating span run: {e}") + + def _maybe_post_trace(self, trace_id: str, inputs: dict) -> None: + """Post the trace if it hasn't been posted yet.""" + if trace_id in self._unposted_traces: + trace_run = self._runs.get(trace_id) + if trace_run: + trace_run.inputs = inputs + trace_run.post() + self._unposted_traces.discard(trace_id) + + def shutdown(self) -> None: + self.client.flush() + + def force_flush(self) -> None: + self.client.flush() diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__init__.py b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d610248dcd6f7fa665a39e2b0b6198f3f52e0a79 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__init__.py @@ -0,0 +1,114 @@ +"""OpenTelemetry integration for LangSmith.""" + +import logging +from typing import Optional, cast + +from langsmith import utils as ls_utils + +from .processor import OtelExporter, OtelSpanProcessor + +logger = logging.getLogger(__name__) + +__all__ = ["configure", "OtelSpanProcessor", "OtelExporter"] + + +def configure( + api_key: Optional[str] = None, + project_name: Optional[str] = None, + SpanProcessor: Optional[type] = None, +) -> bool: + """Configure OpenTelemetry with LangSmith as the `TracerProvider`. + + Initializes OpenTelemetry with LangSmith as the primary and only `TracerProvider`. + + Usage: + >>> from langsmith.integrations.otel import configure + >>> configure( # doctest: +SKIP + ... api_key="your-api-key", project_name="your-project" + ... ) + + Using environment variables: + >>> # Set LANGSMITH_API_KEY and LANGSMITH_PROJECT + >>> configure() # Will use env vars # doctest: +SKIP + + !!! warning + + This function is only for when LangSmith is your ONLY OpenTelemetry source. + + It sets the global TracerProvider, which can only be done once per application. + + This function will fail if OpenTelemetry is already initialized with another + `TracerProvider` (you cannot override an existing `TracerProvider`). + + If you already have OpenTelemetry set up with other tools, use `OtelSpanProcessor` + directly to add LangSmith to your existing setup: + + !!! example "Adding LangSmith to existing OTEL setup" + ```python + from opentelemetry import trace + from langsmith.integrations.otel.processor import OtelSpanProcessor + + # Use your existing provider (already initialized) + provider = trace.get_tracer_provider() + + # Add LangSmith processor to existing provider + langsmith_processor = OtelSpanProcessor( + api_key="your-api-key", project="your-project" + ) + provider.add_span_processor(langsmith_processor) + ``` + + Args: + api_key: LangSmith API key. Defaults to `LANGSMITH_API_KEY` env var. + project_name: Project name. Defaults to `LANGSMITH_PROJECT` env var. + SpanProcessor: Span processor class to use. Defaults to `BatchSpanProcessor`. + + Returns: + `True` if configuration succeeded, `False` if `TracerProvider` already exists. + """ + try: + from opentelemetry import trace + from opentelemetry.sdk.trace import TracerProvider + from opentelemetry.trace import NoOpTracer, ProxyTracer, ProxyTracerProvider + + existing_provider = cast(TracerProvider, trace.get_tracer_provider()) + tracer = existing_provider.get_tracer(__name__) + + # Check if OpenTelemetry is in its default uninitialized state + # (ProxyTracerProvider with NoOpTracer means no real TracerProvider was set) + if ( + isinstance(existing_provider, ProxyTracerProvider) + and hasattr(tracer, "_tracer") + and isinstance( + cast( + ProxyTracer, # type: ignore[attr-defined, name-defined] + tracer, + )._tracer, + NoOpTracer, + ) + ): + # Safe to set TracerProvider since none exists yet + provider = TracerProvider() + trace.set_tracer_provider(provider) + else: + logger.warning( + "OpenTelemetry TracerProvider is already set. " + "Cannot override existing TracerProvider. Use OtelSpanProcessor " + "directly to add LangSmith to your existing provider instead." + ) + return False + + api_key = api_key or ls_utils.get_api_key(None) + if not api_key: + return False + + project_name = project_name or ls_utils.get_tracer_project() + + processor = OtelSpanProcessor( + api_key=api_key, project=project_name, SpanProcessor=SpanProcessor + ) + provider.add_span_processor(processor) # type: ignore + return True + except Exception as e: + logger.warning("Failed to initialize Otel for LangSmith:", e) + return False diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75635d237ddb5a734aa46ed384f0160fdf0522d3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__pycache__/processor.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__pycache__/processor.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47da0b8ee9adc1c18ea46b06ca109b4bb28a0637 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/__pycache__/processor.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/otel/processor.py b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/processor.py new file mode 100644 index 0000000000000000000000000000000000000000..b177a4c45e0fb7b7f174ae0e1f2bc9d4125c65d2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/otel/processor.py @@ -0,0 +1,243 @@ +"""OpenTelemetry span processor and exporter for LangSmith.""" + +import logging +import warnings +from typing import Any, Optional +from urllib.parse import urljoin + +from langsmith import utils as ls_utils + +try: + from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter + from opentelemetry.sdk.trace.export import BatchSpanProcessor + + OTEL_AVAILABLE = True +except ImportError: + warnings.warn( + "OpenTelemetry packages are not installed. " + "Install optional OpenTelemetry dependencies with: " + "pip install langsmith[otel]", + UserWarning, + stacklevel=2, + ) + + class OTLPSpanExporter: # type: ignore[no-redef] + """Mock otlp span exporter class.""" + + def __init__(self, *args, **kwargs): + """Mock init method.""" + raise ImportError( + "OpenTelemetry packages are not installed. " + "Install optional OpenTelemetry dependencies with: " + "pip install langsmith[otel]" + ) + + class BatchSpanProcessor: # type: ignore[no-redef] + """Mock batch span processor class.""" + + def __init__(self, *args, **kwargs): + """Mock init method.""" + raise ImportError( + "OpenTelemetry packages are not installed. " + "Install optional OpenTelemetry dependencies with: " + "pip install langsmith[otel]" + ) + + class trace: + """Mock trace class.""" + + @staticmethod + def get_tracer_provider(): + """Mock get tracer provider method.""" + raise ImportError( + "OpenTelemetry packages are not installed. " + "Install optional OpenTelemetry dependencies with: " + "pip install langsmith[otel]" + ) + + OTEL_AVAILABLE = False + +LANGSMITH_METADATA_PREFIX = "langsmith.metadata" + + +class OtelExporter(OTLPSpanExporter): + """A subclass of `OTLPSpanExporter` configured for LangSmith. + + Environment Variables: + + - `LANGSMITH_API_KEY`: Your LangSmith API key. + - `LANGSMITH_ENDPOINT`: Base URL for LangSmith API (defaults to `https://api.smith.langchain.com`). + - `LANGSMITH_PROJECT`: Project identifier. + """ + + def __init__( + self, + url: Optional[str] = None, + api_key: Optional[str] = None, + project: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + **kwargs, + ): + """Initialize the `OtelExporter`. + + Args: + url: OTLP endpoint URL. Defaults to `{LANGSMITH_ENDPOINT}/otel/v1/traces`. + api_key: LangSmith API key. Defaults to `LANGSMITH_API_KEY` env var. + parent: Parent identifier (e.g., `'project_name:test'`). + + Defaults to `LANGSMITH_PARENT` env var. + headers: Additional headers to include in requests. + **kwargs: Additional arguments passed to `OTLPSpanExporter`. + """ + base_url = ls_utils.get_api_url(None) + # Ensure base_url ends with / for proper joining + if not base_url.endswith("/"): + base_url += "/" + endpoint = url or urljoin(base_url, "otel/v1/traces") + api_key = api_key or ls_utils.get_api_key(None) + project = project or ls_utils.get_tracer_project() + headers = headers or {} + + if not api_key: + raise ValueError( + "API key is required. Provide it via api_key parameter or " + "LANGSMITH_API_KEY environment variable." + ) + + if not project: + project = "default" + logging.info( + "No project specified, using default. " + "Configure with LANGSMITH_PROJECT environment variable or " + "project parameter." + ) + + exporter_headers = { + "x-api-key": api_key, + **headers, + } + + if project: + exporter_headers["Langsmith-Project"] = project + + self.project = project + + super().__init__(endpoint=endpoint, headers=exporter_headers, **kwargs) + + +class OtelSpanProcessor: + """A span processor for adding LangSmith to OpenTelemetry setups. + + This class combines the `OtelExporter` and `BatchSpanProcessor` + into a single processor that can be added to any `TracerProvider`. + + Use this when: + + 1. You already have OpenTelemetry initialized with other tools + 2. You want to add LangSmith alongside existing OTEL exporters + + Examples: + # Fresh OpenTelemetry setup (LangSmith only): + from langsmith.integrations.otel import configure + configure(api_key="your-key", project="your-project") + + # Add LangSmith to existing OpenTelemetry setup: + from opentelemetry import trace + from langsmith.integrations.otel.processor import OtelSpanProcessor + + # Get your existing TracerProvider (already set by other tools) + provider = trace.get_tracer_provider() + + # Add LangSmith processor alongside existing processors + langsmith_processor = OtelSpanProcessor( + project="your-project", + ) + provider.add_span_processor(langsmith_processor) + """ + + def __init__( + self, + api_key: Optional[str] = None, + project: Optional[str] = None, + url: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + SpanProcessor: Optional[type] = None, + ): + """Initialize the `OtelSpanProcessor`. + + Args: + api_key: LangSmith API key. Defaults to `LANGSMITH_API_KEY` env var. + project: Project identifier. Defaults to `LANGSMITH_PROJECT` env var. + url: Base URL for LangSmith API. Defaults to `LANGSMITH_ENDPOINT` env var + or `https://api.smith.langchain.com`. + headers: Additional headers to include in requests. + SpanProcessor: Optional span processor class. Defaults to + `BatchSpanProcessor`. + """ + # Create the exporter + # Convert url to the full endpoint URL that OtelExporter expects + exporter_url = None + if url: + exporter_url = f"{url.rstrip('/')}/otel/v1/traces" + + self._exporter = OtelExporter( + url=exporter_url, api_key=api_key, project=project, headers=headers + ) + + # Create the processor chain + if not OTEL_AVAILABLE: + raise ImportError( + "OpenTelemetry packages are not installed. " + "Install optional OpenTelemetry dependencies with: " + "pip install langsmith[otel]" + ) + + if SpanProcessor is None: + SpanProcessor = BatchSpanProcessor + + self._processor = SpanProcessor(self._exporter) + self._metadata: dict[str, Any] = {} + + def set_metadata(self, metadata: dict[str, Any]) -> None: + """Set metadata attributes to propagate to all spans. + + Use this to ensure metadata like ``thread_id`` appears on every span + in a trace, not just the root span. This is required for LangSmith + features (e.g. the threads view) that query runs by metadata fields. + """ + self._metadata = metadata.copy() + + def on_start(self, span, parent_context=None): + """Forward span start events to the inner processor.""" + if self._metadata: + for key, value in self._metadata.items(): + if value is not None: + span.set_attribute(f"{LANGSMITH_METADATA_PREFIX}.{key}", value) + self._processor.on_start(span, parent_context) + + def on_end(self, span): + """Forward span end events to the inner processor.""" + self._processor.on_end(span) + + def _on_ending(self, span): + """Forward span ending events to the inner processor.""" + if hasattr(self._processor, "_on_ending"): + self._processor._on_ending(span) + + def shutdown(self): + """Shutdown processor.""" + self._processor.shutdown() + + def force_flush(self, timeout_millis=30000): + """Force flush the inner processor.""" + return self._processor.force_flush(timeout_millis) + + @property + def exporter(self): + """The underlying OtelExporter.""" + return self._exporter + + @property + def processor(self): + """The underlying span processor.""" + return self._processor diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__init__.py b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a77f9b6a1b7fd54039986a42126dd3c520d44956 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__init__.py @@ -0,0 +1,13 @@ +"""LangSmith integration for Strands Agents.""" + +from .exporter import ( + LangSmithSpanExporter, + create_langsmith_exporter, + setup_langsmith_telemetry, +) + +__all__ = [ + "LangSmithSpanExporter", + "create_langsmith_exporter", + "setup_langsmith_telemetry", +] diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0934a640cc4e1691da37f4e538a50211e60be55c Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__pycache__/exporter.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__pycache__/exporter.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91e00f3e99c37a55738321a653c9f0a36657f96f Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/__pycache__/exporter.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/exporter.py b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/exporter.py new file mode 100644 index 0000000000000000000000000000000000000000..7c66c64e4cbc7fbacce3dd30f9ffbc2a8dc820a6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/integrations/strands_agents/exporter.py @@ -0,0 +1,497 @@ +"""Transform Strands OTEL spans into LangSmith-compatible formats. + +This module wraps the standard OTLPSpanExporter and intercepts spans before export, +remapping attributes, span names, and structure to align with LangSmith's expected +OTEL ingest schema. + +Strands emits GenAI message data as span events (gen_ai.user.message, +gen_ai.assistant.message, gen_ai.choice, etc.), which is non-standard โ€” the OTEL +GenAI semantic conventions define these as Log Events, not span events. This +exporter flattens those span events into span attributes (gen_ai.prompt, +gen_ai.completion) that LangSmith's server-side OTEL ingest can consume directly. +""" + +import json +import logging +from collections.abc import Sequence +from typing import Any + +from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.trace import ReadableSpan +from opentelemetry.sdk.trace.export import ( + BatchSpanProcessor, + ConsoleSpanExporter, + SimpleSpanProcessor, + SpanExporter, + SpanExportResult, +) +from strands.telemetry import StrandsTelemetry + +logger = logging.getLogger(__name__) + +__all__ = [ + "LangSmithSpanExporter", + "create_langsmith_exporter", + "setup_langsmith_telemetry", +] + + +class LangSmithSpanExporter(SpanExporter): + """Span exporter that reformats Strands OTEL spans for LangSmith compatibility. + + Wraps a delegate exporter (typically OTLPSpanExporter pointed at LangSmith's + OTEL endpoint) and transforms each span before forwarding it. + + Args: + delegate: The underlying SpanExporter to forward transformed spans to. + """ + + def __init__(self, delegate: SpanExporter) -> None: + """Initialize the exporter. + + Args: + delegate: The underlying SpanExporter to forward transformed spans to. + """ + self._delegate = delegate + + def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: + """Transform spans and forward them to the delegate exporter. + + Args: + spans: The batch of spans to export. + + Returns: + The result from the delegate exporter. + """ + transformed = [] + for span in spans: + try: + transformed.append(self._transform_span(span)) + except Exception: + logger.warning( + "Failed to transform span %r, exporting original", + span.name, + exc_info=True, + ) + transformed.append(span) + return self._delegate.export(transformed) + + def shutdown(self) -> None: + """Shut down the delegate exporter.""" + self._delegate.shutdown() + + def force_flush(self, timeout_millis: int = 30000) -> bool: + """Force flush the delegate exporter. + + Args: + timeout_millis: Maximum time to wait for flush to complete. + + Returns: + True if flush succeeded. + """ + return self._delegate.force_flush(timeout_millis) + + # -- gen_ai.operation.name โ†’ langsmith.span.kind mapping --------------- + + _OPERATION_TO_RUN_TYPE: dict[str, str] = { + "chat": "llm", + "invoke_agent": "chain", + "execute_tool": "tool", + "execute_event_loop_cycle": "chain", + } + + # -- Span name fallback โ†’ langsmith.span.kind mapping ------------------ + # Some Strands spans (e.g. execute_event_loop_cycle) don't always carry + # gen_ai.operation.name. Fall back to the span *name* in that case. + _SPAN_NAME_TO_RUN_TYPE: dict[str, str] = { + "execute_event_loop_cycle": "chain", + } + + # -- Event name โ†’ role mapping ---------------------------------------- + + _EVENT_ROLE_MAP: dict[str, str] = { + "gen_ai.user.message": "user", + "gen_ai.assistant.message": "assistant", + "gen_ai.system.message": "system", + "gen_ai.tool.message": "tool", + "gen_ai.choice": "assistant", + } + + _MESSAGE_EVENTS: set[str] = { + "gen_ai.user.message", + "gen_ai.system.message", + "gen_ai.tool.message", + "gen_ai.assistant.message", + "gen_ai.choice", + } + + # ---------------------------------------------------------------------- + + def _transform_span(self, span: ReadableSpan) -> ReadableSpan: + """Flatten span events into prompt/completion attributes. + + Strands attaches GenAI message data as span events. LangSmith expects + them as JSON-serialized span attributes instead. Each message object + gets a ``role`` field injected when one can be inferred from the event + name and isn't already present in the payload. + + All conversation history (user, system, tool, and intermediate assistant + messages) is placed into ``gen_ai.prompt``. Only the final + ``gen_ai.choice`` event โ€” the model's actual response โ€” goes into + ``gen_ai.completion``. + + Args: + span: The original Strands span. + + Returns: + A new ReadableSpan with the message attributes added. + """ + span_attrs = dict(span.attributes) if span.attributes else {} + operation_raw = span_attrs.get("gen_ai.operation.name", "") + operation = operation_raw if isinstance(operation_raw, str) else "" + # Strands puts tool metadata in span attributes (only on tool spans) + tool_call_id_raw = span_attrs.get("gen_ai.tool.call.id", "") + tool_call_id = tool_call_id_raw if isinstance(tool_call_id_raw, str) else "" + tool_name_raw = span_attrs.get("gen_ai.tool.name", "") + tool_name = tool_name_raw if isinstance(tool_name_raw, str) else "" + + # Maps toolUseId โ†’ tool name so tool-result messages can be labelled. + # Seeded from span attrs on tool spans; extended inline as we encounter + # assistant/choice events that contain toolUse blocks. + tool_id_to_name: dict[str, str] = {} + if tool_name and tool_call_id: + tool_id_to_name[tool_call_id] = tool_name + + input_messages: list[dict[str, Any]] = [] + output_messages: list[dict[str, Any]] = [] + remaining_events: list[Any] = [] + + for event in span.events: + name = event.name + attrs = dict(event.attributes) if event.attributes else {} + + if name == "gen_ai.choice": + # The final model response is the only true output + msg = self._event_to_message( + name, attrs, tool_id_to_name=tool_id_to_name + ) + if tool_call_id: + msg["tool_call_id"] = tool_call_id + output_messages.append(msg) + elif name in self._MESSAGE_EVENTS: + msg = self._event_to_message( + name, attrs, tool_id_to_name=tool_id_to_name + ) + if tool_call_id: + msg["tool_call_id"] = tool_call_id + input_messages.append(msg) + else: + # Preserve non-message events as-is + remaining_events.append(event) + + # Merge new attributes with the originals. + # LangSmith's server-side OTEL ingest expects inputs under "gen_ai.prompt" + # and outputs under "gen_ai.completion" (matching the attribute names used + # by LangSmith's own OTELExporter). + new_attrs: dict[str, Any] = dict(span_attrs) + if input_messages: + new_attrs["gen_ai.prompt"] = json.dumps({"messages": input_messages}) + if output_messages: + new_attrs["gen_ai.completion"] = json.dumps(output_messages[-1]) + + # Map gen_ai.operation.name to langsmith.span.kind (run type). + # Some Strands spans (e.g. execute_event_loop_cycle) don't carry + # gen_ai.operation.name โ€” fall back to the span name. + run_type = self._OPERATION_TO_RUN_TYPE.get(operation) + if not run_type: + run_type = self._SPAN_NAME_TO_RUN_TYPE.get(span.name) + if run_type: + new_attrs["langsmith.span.kind"] = run_type + + # For LLM spans, set the provider metadata and display name. + # Strands hardcodes gen_ai.system to "strands-agents" regardless of + # backend, so we use langsmith.metadata.ls_provider to surface the + # actual provider. + # TODO: Detect non-Bedrock providers + if run_type == "llm" and new_attrs.get("gen_ai.system"): + new_attrs["langsmith.metadata.ls_provider"] = "amazon_bedrock" + new_attrs["langsmith.metadata.ls_model_type"] = "chat" + + return ReadableSpan( + name=span.name, + context=span.context, + parent=span.parent, + resource=span.resource, + attributes=new_attrs, + events=remaining_events, + links=span.links, + kind=span.kind, + status=span.status, + start_time=span.start_time, + end_time=span.end_time, + instrumentation_scope=span.instrumentation_scope, + ) + + def _event_to_message( + self, + event_name: str, + attrs: dict[str, Any], + *, + tool_id_to_name: dict[str, str] | None = None, + ) -> dict[str, Any]: + """Convert a span event into a message dict, injecting ``role`` if missing. + + For ``gen_ai.choice`` events the content lives under the ``message`` + key; for all other events it lives under ``content``. In both cases + the value may be a JSON-encoded string that we parse back so the final + attribute is cleanly nested. + + Args: + event_name: The OTEL event name (e.g. ``gen_ai.user.message``). + attrs: The event's attribute dict. + tool_id_to_name: Optional mapping of tool-call IDs to tool names. + + Returns: + A message dict with at least ``role`` and ``content`` keys. + """ + role = self._EVENT_ROLE_MAP.get(event_name, "unknown") + + # gen_ai.choice stores content in "message", others in "content" + if event_name == "gen_ai.choice": + raw = attrs.get("message", "[]") + else: + raw = attrs.get("content", "[]") + + # Parse the JSON string back into a list so the final serialized + # attribute isn't double-encoded. + try: + content = json.loads(raw) if isinstance(raw, str) else raw + except (json.JSONDecodeError, TypeError): + content = raw + + # Tool messages in chat history contain Bedrock toolResult blocks. + # Flatten them into the format LangSmith expects: a top-level + # tool_call_id and plain-text content. + if event_name == "gen_ai.tool.message" and isinstance(content, list): + return self._flatten_tool_result_message( + content, + tool_id_to_name=tool_id_to_name or {}, + ) + + # Convert Bedrock-shaped content blocks to LangSmith-shaped blocks. + # While iterating, harvest toolUse names so later tool-result messages + # can be labelled (assistant messages precede their tool results). + if isinstance(content, list): + converted = [] + for block in content: + if ( + tool_id_to_name is not None + and isinstance(block, dict) + and "toolUse" in block + ): + tu = block["toolUse"] + tid, tname = tu.get("toolUseId", ""), tu.get("name", "") + if tid and tname: + tool_id_to_name[tid] = tname + converted.append(self._convert_content_block(block)) + content = converted + + if event_name == "gen_ai.tool.message": + content = self._stringify_tool_content(content) + + msg: dict[str, Any] = {"role": role, "content": content} + + # Carry over tool_call_id from event attributes (Strands stores it as "id") + if "id" in attrs: + msg["tool_call_id"] = attrs["id"] + + # Carry over finish_reason for choice events + if "finish_reason" in attrs: + msg["finish_reason"] = attrs["finish_reason"] + + return msg + + @staticmethod + def _flatten_tool_result_message( + content_blocks: list[Any], + *, + tool_id_to_name: dict[str, str] | None = None, + ) -> dict[str, Any]: + """Flatten Bedrock ``toolResult`` content blocks into a LangSmith tool message. + + Bedrock tool results arrive as:: + + [ + { + "toolResult": { + "toolUseId": "x", + "status": "success", + "content": [{"text": "..."}], + } + } + ] + + LangSmith expects tool messages as:: + + {"role": "tool", "name": "my_tool", "tool_call_id": "x", "content": "..."} + + If there are multiple toolResult blocks they are joined with newlines. + Non-toolResult blocks are converted normally and appended. + + Args: + content_blocks: The parsed content block list from the event. + tool_id_to_name: Optional mapping of tool-call IDs to tool names. + + Returns: + A flat tool message dict. + """ + tool_call_id = "" + text_parts: list[str] = [] + other_blocks: list[Any] = [] + + for block in content_blocks: + if isinstance(block, dict) and "toolResult" in block: + tr = block["toolResult"] + if not tool_call_id: + tool_call_id = tr.get("toolUseId", "") + # Extract text from nested content blocks + for nested in tr.get("content", []): + if isinstance(nested, dict) and "text" in nested: + text_parts.append(nested["text"]) + else: + other_blocks.append(nested) + else: + other_blocks.append(block) + + if text_parts: + flat_content: Any = "\n".join(text_parts) + else: + flat_content = other_blocks + + msg: dict[str, Any] = { + "role": "tool", + "content": LangSmithSpanExporter._stringify_tool_content(flat_content), + } + # Look up the tool name from the toolUseId โ†’ name mapping + tool_name = (tool_id_to_name or {}).get(tool_call_id, "") + if tool_name: + msg["name"] = tool_name + if tool_call_id: + msg["tool_call_id"] = tool_call_id + return msg + + @staticmethod + def _stringify_tool_content(content: Any) -> str: + """Ensure tool message content is a string. + + Strands emits tool-call inputs as JSON-serialized objects in + ``gen_ai.tool.message`` events. After parsing event payloads for the + rest of the exporter, convert those tool inputs back to strings so + LangSmith receives tool message content as either a plain string or a + stringified object. + """ + if isinstance(content, str): + return content + try: + return json.dumps(content, ensure_ascii=False) + except (TypeError, ValueError): + return str(content) + + @staticmethod + def _convert_content_block(block: Any) -> Any: + """Convert a single Bedrock/Converse content block to LangSmith format. + + Bedrock uses implicit typing (the key name *is* the type):: + + {"text": "hello"} + {"toolUse": {"toolUseId": "x", "name": "f", "input": {...}}} + {"toolResult": {"toolUseId": "x", "status": "success", "content": [...]}} + + LangSmith expects explicit ``type`` fields:: + + {"type": "text", "text": "hello"} + {"type": "tool_use", "id": "x", "name": "f", "input": {...}} + { + "type": "tool_result", + "tool_use_id": "x", + "status": "success", + "content": [...], + } + + Unrecognised blocks are returned as-is. + """ + if not isinstance(block, dict): + return block + + if "text" in block and len(block) == 1: + return {"type": "text", "text": block["text"]} + + if "toolUse" in block: + tu = block["toolUse"] + return { + "type": "tool_use", + "id": tu.get("toolUseId", ""), + "name": tu.get("name", ""), + "input": tu.get("input", {}), + } + + if "toolResult" in block: + tr = block["toolResult"] + converted: dict[str, Any] = { + "type": "tool_result", + "tool_use_id": tr.get("toolUseId", ""), + } + if "status" in tr: + converted["status"] = tr["status"] + if "content" in tr: + # Recursively convert nested content blocks + nested = tr["content"] + if isinstance(nested, list): + nested = [ + LangSmithSpanExporter._convert_content_block(b) for b in nested + ] + converted["content"] = nested + return converted + + # Unknown block shape โ€” pass through unchanged + return block + + +# --------------------------------------------------------------------------- +# Convenience wiring +# --------------------------------------------------------------------------- + + +def create_langsmith_exporter(**otlp_kwargs: Any) -> LangSmithSpanExporter: + """Create a LangSmithSpanExporter wrapping a standard OTLPSpanExporter. + + Keyword arguments are forwarded to OTLPSpanExporter (endpoint, headers, etc.). + If not provided, the exporter will fall back to the standard OTEL_EXPORTER_OTLP_* + environment variables. + + Returns: + A ready-to-use LangSmithSpanExporter instance. + """ + delegate = OTLPSpanExporter(**otlp_kwargs) + return LangSmithSpanExporter(delegate=delegate) + + +def setup_langsmith_telemetry(*, console: bool = False) -> None: + """Wire up Strands telemetry with the LangSmith-compatible exporter. + + Call this instead of (or in addition to) the standard + ``StrandsTelemetry().setup_otlp_exporter()`` flow. + + Args: + console: If True, also add a ConsoleSpanExporter that prints transformed + spans to stdout (useful for debugging). + """ + telemetry = StrandsTelemetry() + exporter = create_langsmith_exporter() + telemetry.tracer_provider.add_span_processor(BatchSpanProcessor(exporter)) + + if console: + console_exporter = LangSmithSpanExporter(delegate=ConsoleSpanExporter()) + telemetry.tracer_provider.add_span_processor( + SimpleSpanProcessor(console_exporter) + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/README.md b/python/user_packages/Python313/site-packages/langsmith/sandbox/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b3571dcea3da9c10dfc010838ac67c552f2e5a05 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/README.md @@ -0,0 +1,1023 @@ +# LangSmith Sandbox + +Sandboxed code execution for LangSmith. Run untrusted code safely in isolated containers. + +> โš ๏ธ **Warning**: This module is experimental. Features and APIs may change, and breaking changes are expected as we iterate. + +## Quick Start + +```python +from langsmith.sandbox import SandboxClient + +# Client uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment +client = SandboxClient() + +# First, build a snapshot (defines the container image and root filesystem) +snapshot = client.create_snapshot( + "python-snapshot", + docker_image="python:3.12-slim", + fs_capacity_bytes=4 * 1024**3, # 4 GB +) + +# Now create a sandbox from the snapshot and run code +with client.sandbox(snapshot_id=snapshot.id) as sb: + result = sb.run("python -c 'print(2 + 2)'") + print(result.stdout) # "4\n" + print(result.success) # True + +# Or create a sandbox to keep +sb = client.create_sandbox(snapshot_id=snapshot.id) +result = sb.run("python -c 'print(2 + 2)'") +client.delete_sandbox(sb.name) # Don't forget to clean up when done + +# Or use an existing sandbox by name +sb = client.get_sandbox(name="your-sandbox") +result = sb.run("python -c 'print(2 + 2)'") +``` + +The examples below assume `snapshot_id` is bound to a snapshot UUID obtained +from `client.create_snapshot(...)` (or `client.list_snapshots()` / +`client.get_snapshot(...)`). You only need to build a snapshot once; many +sandboxes can be created from the same `snapshot_id`. + +## Installation + +The sandbox module works out of the box for basic command execution (HTTP). For +**real-time output** (streaming, callbacks, and `timeout=0`), install the +optional dependency: + +```bash +pip install 'langsmith[sandbox]' +``` + +This pulls in the `websockets` package. Without it, `sb.run()` falls back to +HTTP automatically. + +## Configuration + +The client automatically uses LangSmith environment variables: + +```python +from langsmith.sandbox import SandboxClient + +# Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY +client = SandboxClient() + +# Or configure explicitly +client = SandboxClient( + api_endpoint="https://api.smith.langchain.com/v2/sandboxes", + api_key="your-api-key", + timeout=30.0, +) +``` + +## Running Commands + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Run a command + result = sb.run("echo 'Hello, World!'") + + print(result.stdout) # "Hello, World!\n" + print(result.stderr) # "" + print(result.exit_code) # 0 + print(result.success) # True + + # Commands that fail return non-zero exit codes + result = sb.run("exit 1") + print(result.success) # False + print(result.exit_code) # 1 +``` + +## Streaming Output + +For long-running commands, you can stream output in real time. This requires +the `websockets` package (`pip install 'langsmith[sandbox]'`). + +### Callbacks + +The simplest way to get real-time output. Blocks until the command completes. + +```python +import sys + +with client.sandbox(snapshot_id=snapshot_id) as sb: + result = sb.run( + "make build", + timeout=600, + on_stdout=lambda s: print(s, end=""), + on_stderr=lambda s: print(s, end="", file=sys.stderr), + ) + print(f"\nBuild {'succeeded' if result.success else 'failed'}") +``` + +### Streaming with CommandHandle + +For full control โ€” access to the process handle, stream identity, kill, and +reconnection. + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run("make build", timeout=600, wait=False) + + print(f"Command ID: {handle.command_id}") + + for chunk in handle: + prefix = "OUT" if chunk.stream == "stdout" else "ERR" + print(f"[{prefix}] {chunk.data}", end="") + + result = handle.result + print(f"\nExit code: {result.exit_code}") +``` + +### Killing a Running Command + +```python +import threading +import time + +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run("sleep 3600", timeout=7200, wait=False) + + # Kill after 10 seconds from another thread + def kill_after(h, seconds): + time.sleep(seconds) + h.kill() + + threading.Thread(target=kill_after, args=(handle, 10)).start() + + for chunk in handle: + print(chunk.data, end="") + + result = handle.result + print(f"Exit code: {result.exit_code}") # non-zero (killed) +``` + +### Sending Stdin Input + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run( + "python -c 'name = input(\"Name: \"); print(f\"Hello {name}\")'", + timeout=30, + wait=False, + ) + + for chunk in handle: + if "Name:" in chunk.data: + handle.send_input("World\n") + print(chunk.data, end="") + + result = handle.result +``` + +### Auto-Reconnect + +`CommandHandle` (returned by `sb.run(wait=False)`) automatically +reconnects on transient disconnects โ€” hot-reloads, network blips, etc. No user +code needed: + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run("make build", timeout=600, wait=False) + + # Auto-reconnects on transient errors (hot-reload, network blips) + for chunk in handle: + print(chunk.data, end="") + + result = handle.result +``` + +For manual reconnection across process restarts: + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run("make build", timeout=600, wait=False) + command_id = handle.command_id + + # ... later, possibly in a different process ... + + handle = sb.reconnect(command_id) + for chunk in handle: + print(chunk.data, end="") + result = handle.result +``` + +### No Timeout (`timeout=0`) + +With WebSocket enabled, you can set `timeout=0` to let a command run +indefinitely with no server-side deadline. This works with both `wait=False` +and callbacks. Useful for long-lived processes like dev servers, file watchers, +or background tasks that you control via `kill()`. + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run("python server.py", timeout=0, wait=False) + + for chunk in handle: + print(chunk.data, end="") + if "Ready" in chunk.data: + break # server is up, do other work + + handle.kill() # stop when done +``` + +> **Note:** `timeout=0` requires WebSocket support +> (`pip install 'langsmith[sandbox]'`). Without WebSocket, `run()` falls +> back to HTTP which has its own request-level timeout. + +## Command Lifecycle & TTL + +The sandbox daemon automatically manages command session lifecycles with two +timeout mechanisms: + +### Session TTL (finished commands) + +After a command finishes (exits), its session remains in memory for a TTL +period. During this window you can still reconnect to retrieve output. After the +TTL expires, the session is cleaned up and `reconnect()` will raise an error. + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + handle = sb.run("make build", wait=False) + command_id = handle.command_id + + # Even after the command finishes, you can reconnect within the TTL window + handle = sb.reconnect(command_id) + result = handle.result + print(result.stdout) + + # After TTL expires, reconnect raises SandboxOperationError +``` + +### Idle Timeout (running commands) + +Running commands with no connected clients are killed after an idle timeout +(default: 5 minutes). The idle timer resets each time a client connects. This +prevents orphaned long-running processes from consuming resources indefinitely. + +You can set a per-command idle timeout via the `idle_timeout` parameter. +Set to `-1` for no idle timeout (the command runs indefinitely until explicitly +killed or it exits on its own). + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Start a long-running command with a 30-minute idle timeout + handle = sb.run( + "python server.py", + timeout=0, + idle_timeout=1800, + wait=False, + ) + + # As long as a client is connected (iterating), the idle timer is paused + for chunk in handle: + print(chunk.data, end="") + if "Ready" in chunk.data: + break + + # After disconnecting, the idle timer starts + # If no client reconnects within idle_timeout seconds, the process is killed +``` + +### Kill on Disconnect + +By default, commands continue running after a client disconnects and can be +reconnected to later. Set `kill_on_disconnect=True` to kill the command +immediately when the last client disconnects: + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Command is killed as soon as the client disconnects + handle = sb.run( + "python server.py", + kill_on_disconnect=True, + wait=False, + ) + + for chunk in handle: + print(chunk.data, end="") + if "Ready" in chunk.data: + break + # Command is killed here when iteration stops and the WS disconnects +``` + +### Combining Lifecycle Options + +All lifecycle parameters can be combined: + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Long-running task: 30-min idle timeout, 1-hour session TTL + handle = sb.run( + "python train.py", + timeout=0, # No command timeout + idle_timeout=1800, # Kill after 30min with no clients + ttl_seconds=3600, # Keep session for 1 hour after exit + wait=False, + ) + + # Fire-and-forget: no idle timeout, infinite TTL + handle = sb.run( + "python background_job.py", + timeout=0, + idle_timeout=-1, # Never kill due to idle + ttl_seconds=-1, # Keep session forever + wait=False, + ) +``` + +## PTY (Pseudo-Terminal) + +Set `pty=True` to allocate a pseudo-terminal for the command. This is useful +for interactive programs and commands that detect terminal capabilities: + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Run an interactive Python REPL with PTY + handle = sb.run("python", pty=True, wait=False) + + for chunk in handle: + if ">>>" in chunk.data: + handle.send_input("print('hello')\n") + break + + for chunk in handle: + if ">>>" in chunk.data: + handle.send_input("exit()\n") + break + + result = handle.result + + # Commands that require a TTY + result = sb.run("top -b -n 1", pty=True) +``` + +> **Note:** PTY mode merges stdout and stderr into a single stream (stdout). +> Only use PTY when the command requires it โ€” most commands work fine without it. + +## File Operations + +Read and write files in the sandbox: + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Write a file + sb.write("/app/script.py", "print('Hello from file!')") + + # Run the script + result = sb.run("python /app/script.py") + print(result.stdout) # "Hello from file!\n" + + # Read a file (returns bytes) + content = sb.read("/app/script.py") + print(content.decode()) # "print('Hello from file!')" + + # Write binary files + sb.write("/app/data.bin", b"\x00\x01\x02\x03") +``` + +## TCP Tunnel + +Access any TCP service running inside a sandbox (databases, Redis, HTTP servers, +etc.) as if it were running on your local machine. The tunnel opens a local TCP +port and forwards connections through a multiplexed WebSocket to the target port +inside the sandbox. + +Requires the `websockets` package (`pip install 'langsmith[sandbox]'`). + +### Basic Usage โ€” PostgreSQL + +Build a snapshot from the `postgres:16` image. The entrypoint initializes and +starts Postgres automatically: + +```python +import psycopg2 + +postgres_snapshot = client.create_snapshot( + "postgres-snapshot", + docker_image="postgres:16", + fs_capacity_bytes=4 * 1024**3, +) + +sb = client.create_sandbox(snapshot_id=postgres_snapshot.id) +pg_handle = sb.run( + "POSTGRES_HOST_AUTH_METHOD=trust docker-entrypoint.sh postgres", + timeout=0, + wait=False, +) +import time; time.sleep(6) # wait for Postgres to initialize and start + +try: + with sb.tunnel(remote_port=5432, local_port=25432) as t: + conn = psycopg2.connect( + host="127.0.0.1", + port=t.local_port, + user="postgres", + ) + cursor = conn.cursor() + cursor.execute("SELECT version()") + print(cursor.fetchone()) + conn.close() +finally: + pg_handle.kill() + client.delete_sandbox(sb.name) +``` + +### Basic Usage โ€” Redis + +Build a snapshot from the `redis:7` image. Redis self-daemonizes: + +```python +import redis + +redis_snapshot = client.create_snapshot( + "redis-snapshot", + docker_image="redis:7", + fs_capacity_bytes=2 * 1024**3, +) + +with client.sandbox(snapshot_id=redis_snapshot.id) as sb: + sb.run("redis-server --daemonize yes", timeout=10) + + with sb.tunnel(remote_port=6379, local_port=26379) as t: + r = redis.Redis(host="127.0.0.1", port=t.local_port) + r.set("key", "value") + print(r.get("key")) # b"value" +``` + +### HTTP Services + +Works with any TCP service. Start long-running services with `wait=False` and +`timeout=0` so they stay alive across commands: + +```python +sb = client.create_sandbox(snapshot_id=snapshot_id) +http_handle = sb.run("python3 -m http.server 3000", timeout=0, wait=False) +import time; time.sleep(2) + +try: + with sb.tunnel(remote_port=3000, local_port=13000) as t: + import urllib.request + resp = urllib.request.urlopen(f"http://127.0.0.1:{t.local_port}/") + print(resp.status) # 200 +finally: + http_handle.kill() + client.delete_sandbox(sb.name) +``` + +### Multiple Tunnels + +Open several tunnels simultaneously to different services: + +```python +http_handle2 = sb.run("python3 -m http.server 3001", timeout=0, wait=False) +import time; time.sleep(1) + +with sb.tunnel(remote_port=3000, local_port=23000) as t1, \ + sb.tunnel(remote_port=3001, local_port=23001) as t2: + resp1 = urllib.request.urlopen(f"http://127.0.0.1:{t1.local_port}/") + resp2 = urllib.request.urlopen(f"http://127.0.0.1:{t2.local_port}/") + +http_handle2.kill() +``` + +### Explicit Lifecycle + +For notebooks or long-lived sessions where a context manager isn't convenient: + +```python +t = sb.tunnel(remote_port=3000, local_port=23002) + +print(t.local_port) +# ... use the tunnel as long as needed ... + +t.close() +``` + +### Async Usage + +```python +async with await client.sandbox(snapshot_id=snapshot_id) as sb: + async with await sb.tunnel(remote_port=5432) as t: + conn = await asyncpg.connect(host="127.0.0.1", port=t.local_port) +``` + +## Service URLs + +Access HTTP services running inside a sandbox without opening a TCP tunnel. +`service()` returns a `ServiceURL` object with a short-lived JWT that +auto-refreshes transparently. Built-in HTTP helpers inject the auth header +for you. + +### Basic Usage + +```python +with client.sandbox(snapshot_id=snapshot_id) as sb: + # Start a web server inside the sandbox + handle = sb.run("python -m http.server 3000", timeout=0, wait=False) + import time; time.sleep(2) + + # Get a service URL for port 3000 + svc = sb.service(port=3000) + + # Make requests โ€” token is injected automatically + resp = svc.get("/") + print(resp.status_code) # 200 + + # POST with JSON body + resp = svc.post("/api/data", json={"key": "value"}) + + # Access the raw token or URLs directly + print(svc.token) # JWT (auto-refreshes near expiry) + print(svc.service_url) # base URL for programmatic access + print(svc.browser_url) # URL that sets a cookie in a browser + + handle.kill() +``` + +### Custom Token TTL + +Tokens default to 10 minutes. Set `expires_in_seconds` for longer or shorter +lifetimes (1 second to 24 hours): + +```python +# Token valid for 1 hour +svc = sb.service(port=3000, expires_in_seconds=3600) +``` + +### Auto-Refresh + +The `ServiceURL` object automatically refreshes its token before it expires. +You never need to worry about token rotation โ€” just keep using the object: + +```python +svc = sb.service(port=3000, expires_in_seconds=60) + +# Even after 60 seconds, this still works โ€” token refreshes transparently +resp = svc.get("/api/status") +``` + +### Async Usage + +```python +async with await client.sandbox(snapshot_id=snapshot_id) as sb: + svc = await sb.service(port=3000) + + # Async HTTP helpers + resp = await svc.get("/api/data") + + # Async accessors for auto-refreshing properties + token = await svc.get_token() + url = await svc.get_service_url() +``` + +## Snapshots + +Snapshots are the starting point for every sandbox. They're built from Docker +images or captured from running sandboxes, and many sandboxes can share the +same snapshot. + +### Build a Snapshot from a Docker Image + +```python +from langsmith.sandbox import SandboxClient + +client = SandboxClient() + +# Build a snapshot โ€” blocks until ready (default timeout=60s) +snapshot = client.create_snapshot( + "my-python-env", + docker_image="python:3.12-slim", + fs_capacity_bytes=4 * 1024**3, # 4 GB +) + +# Create a sandbox from the snapshot (by ID) +with client.sandbox(snapshot_id=snapshot.id) as sb: + result = sb.run("python --version") + print(result.stdout) + +# Or resolve by snapshot name โ€” the server looks up the snapshot owned by +# your tenant and boots from it. Exactly one of snapshot_id or snapshot_name +# must be provided. +with client.sandbox(snapshot_name="my-python-env") as sb: + result = sb.run("python --version") + print(result.stdout) +``` + +### Capture a Running Sandbox + +Install packages or prepare files on a running sandbox, then capture the +result as a reusable snapshot. The returned snapshot has `source_sandbox_id` +set to the sandbox it was captured from, and can be used as the +`snapshot_id` for any later `create_sandbox` / `sandbox(...)` call. + +```python +sb = client.create_sandbox(snapshot_id=base_snapshot_id, name="setup-box") +sb.run("pip install numpy pandas scikit-learn", timeout=180) +sb.write("/opt/config.yaml", "model: gpt-5\n") + +# Either form works; the instance method just forwards to the client. +snapshot = sb.capture_snapshot("ml-ready", timeout=300) +# snapshot = client.capture_snapshot(sb.name, "ml-ready", timeout=300) +print(snapshot.id, snapshot.source_sandbox_id) + +sb.delete() + +# Later: spin up sandboxes from the captured snapshot +with client.sandbox(snapshot_id=snapshot.id) as sb: + sb.run("python -c 'import numpy; print(numpy.__version__)'") + assert sb.read("/opt/config.yaml") == b"model: gpt-5\n" +``` + +> **Note:** `capture_snapshot` preserves only the **persistent filesystem**. +> Installed packages (under `/usr/local`, `/root`, `/opt`, the home +> directory, etc.) and files you wrote to those paths are kept. Running +> processes, open sockets, in-memory state, and anything under `/tmp` +> (which is a tmpfs) are **not** carried over โ€” restart the processes you +> need in the new sandbox. + +### Snapshot CRUD + +```python +# List snapshots (server paginates with a default page size of 50) +snapshots = client.list_snapshots() + +# Filter and paginate โ€” all three kwargs are optional and independent. +# `limit` must be between 1 and 500 (inclusive); `offset` must be >= 0. +snapshots = client.list_snapshots( + name_contains="python", # case-insensitive substring match on name + limit=100, + offset=0, +) + +# Get a snapshot by ID +snapshot = client.get_snapshot("550e8400-...") + +# Delete a snapshot +client.delete_snapshot("550e8400-...") + +# Build with longer timeout for large images +snapshot = client.create_snapshot( + "heavy-image", + docker_image="nvidia/cuda:12.0-devel-ubuntu22.04", + fs_capacity_bytes=16 * 1024**3, + timeout=600, +) +``` + +## Start / Stop + +Snapshot-based sandboxes can be stopped and restarted. The sandbox files are +preserved across stop/start cycles. + +```python +sb = client.create_sandbox(snapshot_id=snapshot.id, name="my-vm") +sb.run("echo 'hello' > /tmp/state.txt") + +# Stop the sandbox (preserves sandbox files) +sb.stop() + +# Later: restart it +sb.start() # blocks until ready (default timeout=120s) + +result = sb.run("cat /tmp/state.txt") +assert result.stdout.strip() == "hello" +``` + +You can also use the client methods directly: + +```python +client.stop_sandbox("my-vm") +sandbox = client.start_sandbox("my-vm") +``` + +## Sandbox Lifetime & TTL + +Sandboxes follow a two-stage retention model anchored to **idle activity** +and the **`stopped`** state โ€” there is no wall-clock "max lifetime" TTL: + +- **`idle_ttl_seconds`** โ€” Idle timeout. The launcher stops the sandbox + after this many seconds of inactivity (any command execution or file I/O + resets the timer). When omitted at creation, the server applies a default + of `600` seconds (10 minutes); pass `0` explicitly to disable the idle + stop and keep the sandbox running indefinitely. +- **`delete_after_stop_seconds`** โ€” Stop-anchored deletion. Once a sandbox + enters the `stopped` state (either via the idle timer above or an explicit + `stop_sandbox` call), this timer starts. After the deadline passes, the + sandbox row and its filesystem clone are permanently deleted by a + server-side sweep. Pass `0` to disable stop-anchored deletion (manual + cleanup required); when omitted, the server applies its configured default + (typically 14 days). + +Both values must be multiples of 60 (minute-resolution). The lifecycle is: + +``` +running โ”€โ”€(idle for idle_ttl_seconds)โ”€โ”€โ–ถ stopped โ”€โ”€(delete_after_stop_seconds)โ”€โ”€โ–ถ deleted +``` + +```python +# Default retention (server defaults: 10 min idle stop, 14 day delete) +with client.sandbox(snapshot_id=snapshot_id) as sb: + result = sb.run("echo hello") + +# Aggressive: stop after 5 min idle, delete 1 hour after stop +sb = client.create_sandbox( + snapshot_id=snapshot_id, + idle_ttl_seconds=300, + delete_after_stop_seconds=3600, +) + +# Long-running: never auto-stop, delete 7 days after manual stop +sb = client.create_sandbox( + snapshot_id=snapshot_id, + idle_ttl_seconds=0, + delete_after_stop_seconds=604800, +) + +# Inspect retention settings +print(sb.idle_ttl_seconds) # e.g. 300 +print(sb.delete_after_stop_seconds) # e.g. 3600 +print(sb.stopped_at) # None while running, ISO timestamp once stopped +``` + +### Updating retention on existing sandboxes + +You can update either retention setting on a running or stopped sandbox. +Updating `delete_after_stop_seconds` on an already-stopped sandbox shifts +its deletion deadline (`stopped_at + delete_after_stop_seconds`): + +```python +# Extend the idle stop to 30 minutes +sb = client.update_sandbox("my-sandbox", idle_ttl_seconds=1800) + +# Push the deletion deadline out to 30 days after stop +sb = client.update_sandbox("my-sandbox", delete_after_stop_seconds=2592000) + +# Disable both โ€” sandbox keeps running and never auto-deletes +sb = client.update_sandbox( + "my-sandbox", + idle_ttl_seconds=0, + delete_after_stop_seconds=0, +) +``` + +> **Migration note (alpha):** the previous `ttl_seconds` (hard wall-clock +> TTL) and `expires_at` fields were removed. The hard TTL never reliably +> deleted stopped sandboxes; replace any usage with `idle_ttl_seconds` for +> stopping and `delete_after_stop_seconds` for deletion. + +## Reusing Existing Sandboxes + +Get a sandbox that's already running: + +```python +# Create a sandbox (requires explicit cleanup) +sb = client.create_sandbox(snapshot_id=snapshot_id) +print(sb.name) # e.g., "sandbox-abc123" + +# Later, get the same sandbox +sb = client.get_sandbox("sandbox-abc123") +result = sb.run("echo 'Still running!'") + +# Clean up when done +client.delete_sandbox("sandbox-abc123") +``` + +## Async Sandbox Creation + +By default, `create_sandbox()` blocks until the sandbox is ready. For +non-blocking creation, pass `wait_for_ready=False`: + +```python +# Returns immediately with status="provisioning" +sb = client.create_sandbox(snapshot_id=snapshot_id, wait_for_ready=False) +print(sb.status) # "provisioning" + +# Poll until ready using the lightweight status endpoint +sb = client.wait_for_sandbox(sb.name, timeout=120, poll_interval=1.0) +print(sb.status) # "ready" + +# Now the sandbox is usable +result = sb.run("echo hello") +``` + +You can also poll manually for more control: + +```python +sb = client.create_sandbox(snapshot_id=snapshot_id, wait_for_ready=False) + +while True: + status = client.get_sandbox_status(sb.name) + if status.status == "ready": + sb = client.get_sandbox(sb.name) + break + if status.status == "failed": + print(f"Failed: {status.status_message}") + break + time.sleep(1) +``` + +> **Note:** Operations like `run()`, `write()`, and `read()` will raise +> `SandboxNotReadyError` if called on a sandbox that isn't ready yet. + +## Async Support + +Full async support for all operations: + +```python +from langsmith.sandbox import AsyncSandboxClient + +async def main(): + async with AsyncSandboxClient() as client: + # Build a snapshot first + snapshot = await client.create_snapshot( + "async-python", + docker_image="python:3.12-slim", + fs_capacity_bytes=4 * 1024**3, + ) + + # Use the snapshot + async with await client.sandbox(snapshot_id=snapshot.id) as sb: + result = await sb.run("python -c 'print(1 + 1)'") + print(result.stdout) # "2\n" + + await sb.write("/app/test.txt", "async content") + content = await sb.read("/app/test.txt") + print(content.decode()) +``` + +### Async Streaming + +```python +async with await client.sandbox(snapshot_id=snapshot_id) as sb: + handle = await sb.run("make build", timeout=600, wait=False) + + async for chunk in handle: + print(chunk.data, end="") + + result = await handle.result +``` + +## Error Handling + +The module provides type-based exceptions with a `resource_type` attribute for specific handling: + +```python +from langsmith.sandbox import ( + SandboxClientError, # Base exception for all sandbox errors + ResourceCreationError, # Resource provisioning failed (check resource_type, error_type) + ResourceNotFoundError, # Resource doesn't exist (check resource_type) + ResourceTimeoutError, # Operation timed out (check resource_type) + SandboxNotReadyError, # Sandbox not ready for operations yet + SandboxConnectionError, # Network/WebSocket error + CommandTimeoutError, # Command exceeded its timeout (extends SandboxOperationError) + QuotaExceededError, # Quota limit reached + TunnelError, # Base for tunnel errors + TunnelPortNotAllowedError, # Port blocked by daemon allowlist + TunnelConnectionRefusedError, # Nothing listening on remote port + TunnelUnsupportedVersionError, # Client/daemon protocol mismatch +) + +try: + with client.sandbox(snapshot_id=snapshot_id) as sb: + result = sb.run("sleep 999", timeout=10) +except CommandTimeoutError as e: + print(f"Command timed out: {e}") +except ResourceCreationError as e: + print(f"{e.resource_type} creation failed: {e}") +except ResourceNotFoundError as e: + print(f"{e.resource_type} not found: {e}") +except ResourceTimeoutError as e: + print(f"Timeout waiting for {e.resource_type}: {e}") +except SandboxConnectionError as e: + print(f"Connection error: {e}") +except SandboxClientError as e: + print(f"Error: {e}") +``` + +## API Reference + +### SandboxClient + +| Method | Description | +|--------|-------------| +| `sandbox(snapshot_id=None, *, snapshot_name=None, idle_ttl_seconds=None, delete_after_stop_seconds=None, ...)` | Create a sandbox (auto-deleted on context exit). Exactly one of `snapshot_id` / `snapshot_name` must be set. | +| `create_sandbox(snapshot_id=None, *, snapshot_name=None, wait_for_ready=True, ...)` | Create a sandbox (requires explicit delete). Exactly one of `snapshot_id` / `snapshot_name` must be set. | +| `get_sandbox(name)` | Get an existing sandbox by name | +| `get_sandbox_status(name)` | Get lightweight provisioning status (`ResourceStatus`) | +| `wait_for_sandbox(name, *, timeout=120, poll_interval=1.0)` | Poll until sandbox is ready or failed | +| `service(name, port, *, expires_in_seconds=600)` | Get a `ServiceURL` for an HTTP service on the given port | +| `list_sandboxes()` | List all sandboxes | +| `update_sandbox(name, *, new_name=None, idle_ttl_seconds=None, delete_after_stop_seconds=None)` | Update a sandbox's name or retention settings | +| `delete_sandbox(name)` | Delete a sandbox | +| `start_sandbox(name, *, timeout=120)` | Start a stopped sandbox, poll until ready | +| `stop_sandbox(name)` | Stop a running sandbox (preserves sandbox files) | +| `create_snapshot(name, docker_image, fs_capacity_bytes, *, timeout=60)` | Build a snapshot from a Docker image | +| `capture_snapshot(sandbox_name, name, *, timeout=60)` | Capture a snapshot from a running sandbox | +| `get_snapshot(snapshot_id)` | Get a snapshot by ID | +| `list_snapshots(*, name_contains=None, limit=None, offset=None)` | List a page of snapshots (server paginates, default limit 50, max 500; `name_contains` is a case-insensitive substring match) | +| `delete_snapshot(snapshot_id)` | Delete a snapshot | +| `wait_for_snapshot(snapshot_id, *, timeout=300)` | Poll until snapshot is ready or failed | + +### Sandbox + +| Property | Description | +|----------|-------------| +| `name` | Display name | +| `snapshot_id` | Snapshot ID used to create this sandbox | +| `status` | Lifecycle status: `"provisioning"`, `"ready"`, `"failed"`, or `"stopped"` | +| `status_message` | Human-readable details when status is `"failed"`, `None` otherwise | +| `dataplane_url` | URL for runtime operations (only functional when status is `"ready"`) | +| `id` | Unique identifier (UUID) | +| `idle_ttl_seconds` | Idle timeout in seconds before the launcher stops the sandbox (`0` means disabled, `None` means not set). New sandboxes get a server-side default of `600` (10 minutes) when not explicitly provided. | +| `delete_after_stop_seconds` | Seconds after entering `stopped` before the sandbox and its filesystem clone are permanently deleted (`0` means disabled, `None` means server default). | +| `stopped_at` | ISO 8601 timestamp when the sandbox transitioned to `stopped`, or `None` while running. | + +| Method | Description | +|--------|-------------| +| `run(command, *, timeout=60, on_stdout=None, on_stderr=None, idle_timeout=300, kill_on_disconnect=False, ttl_seconds=600, pty=False, wait=True)` | Execute a shell command. Returns `ExecutionResult` or `CommandHandle` (when `wait=False`). | +| `reconnect(command_id, *, stdout_offset=0, stderr_offset=0)` | Reconnect to a running command. Returns `CommandHandle`. | +| `write(path, content)` | Write file (str or bytes) | +| `read(path)` | Read file (returns bytes) | +| `tunnel(remote_port, *, local_port=0)` | Open a TCP tunnel. Returns `Tunnel` (context manager). | +| `service(port, *, expires_in_seconds=600)` | Get a `ServiceURL` for an HTTP service. Auto-refreshes token. | +| `start(*, timeout=120)` | Start a stopped sandbox and wait until ready. | +| `stop()` | Stop a running sandbox (preserves sandbox files for later restart). | +| `delete()` | Delete this sandbox. | +| `capture_snapshot(name, *, timeout=60)` | Capture a snapshot from this sandbox. | + +### ExecutionResult + +| Property | Description | +|----------|-------------| +| `stdout` | Standard output (str) | +| `stderr` | Standard error (str) | +| `exit_code` | Exit code (int) | +| `success` | True if exit_code == 0 | + +### ResourceStatus + +Returned by `client.get_sandbox_status()`. + +| Property | Description | +|----------|-------------| +| `status` | Lifecycle status: `"provisioning"`, `"ready"`, or `"failed"` | +| `status_message` | Human-readable details when `"failed"`, `None` otherwise | + +### CommandHandle + +Returned by `sb.run(wait=False)`. Iterable, yielding `OutputChunk` objects. + +| Property / Method | Description | +|-------------------|-------------| +| `command_id` | Server-assigned command ID | +| `pid` | Process ID on the sandbox | +| `result` | Final `ExecutionResult` (blocks until complete) | +| `kill()` | Send SIGKILL to the running command | +| `send_input(data)` | Write string data to the command's stdin | +| `reconnect()` | Reconnect from last known offsets | + +### OutputChunk + +| Property | Description | +|----------|-------------| +| `stream` | `"stdout"` or `"stderr"` | +| `data` | Text content of this chunk (str) | +| `offset` | Byte offset within the stream (int) | + +### Tunnel + +Returned by `sb.tunnel(remote_port)`. Context manager that opens a local TCP +listener forwarding to a port inside the sandbox. + +| Property / Method | Description | +|-------------------|-------------| +| `local_port` | Local port the tunnel is listening on (int) | +| `remote_port` | Target port inside the sandbox (int) | +| `close()` | Shut down the tunnel and all connections | + +### ServiceURL + +Returned by `sb.service(port)`. Holds a short-lived JWT for accessing an HTTP +service in the sandbox. Properties auto-refresh the token near expiry. + +| Property | Description | +|----------|-------------| +| `token` | Raw JWT for programmatic use (auto-refreshes) | +| `service_url` | Base URL for programmatic HTTP access (auto-refreshes) | +| `browser_url` | URL that exchanges the JWT for a cookie in a browser (auto-refreshes) | +| `expires_at` | ISO 8601 expiration timestamp (auto-refreshes) | + +| Method | Description | +|--------|-------------| +| `request(method, path="/", **kwargs)` | Make an HTTP request with auth header injected. Returns `httpx.Response`. | +| `get(path="/", **kwargs)` | HTTP GET | +| `post(path="/", **kwargs)` | HTTP POST | +| `put(path="/", **kwargs)` | HTTP PUT | +| `patch(path="/", **kwargs)` | HTTP PATCH | +| `delete(path="/", **kwargs)` | HTTP DELETE | + +`AsyncServiceURL` is the async variant. Use `await svc.get_token()`, +`await svc.get_service_url()`, etc. for auto-refreshing access, and +`await svc.get(path)` for async HTTP helpers. diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__init__.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..809aa2f57cacd179907b05491585678031accc6e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/__init__.py @@ -0,0 +1,124 @@ +"""LangSmith Sandbox Module. + +This module provides sandboxed code execution capabilities through the +LangSmith Sandbox API. + +Example: + from langsmith.sandbox import SandboxClient + + # Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment + client = SandboxClient() + + snapshot = client.create_snapshot( + docker_image="python:3.12-slim", name="python-snapshot" + ) + with client.sandbox(snapshot_id=snapshot.id) as sb: + result = sb.run("python --version") + print(result.stdout) + + # Or async: + from langsmith.sandbox import AsyncSandboxClient + + async with AsyncSandboxClient() as client: + snapshot = await client.create_snapshot( + docker_image="python:3.12-slim", name="python-snapshot" + ) + async with await client.sandbox(snapshot_id=snapshot.id) as sb: + result = await sb.run("python --version") + print(result.stdout) +""" + +from langsmith.sandbox._async_client import AsyncSandboxClient +from langsmith.sandbox._async_sandbox import AsyncSandbox +from langsmith.sandbox._client import SandboxClient +from langsmith.sandbox._exceptions import ( + CommandTimeoutError, + DataplaneNotConfiguredError, + QuotaExceededError, + ResourceAlreadyExistsError, + ResourceCreationError, + ResourceInUseError, + ResourceNameConflictError, + ResourceNotFoundError, + ResourceTimeoutError, + SandboxAPIError, + SandboxAuthenticationError, + SandboxClientError, + SandboxConnectionError, + SandboxNotReadyError, + SandboxOperationError, + SandboxServerReloadError, + TunnelConnectionRefusedError, + TunnelError, + TunnelPortNotAllowedError, + TunnelUnsupportedVersionError, + ValidationError, +) +from langsmith.sandbox._models import ( + AsyncCommandHandle, + AsyncServiceURL, + CommandHandle, + ExecutionResult, + OutputChunk, + ResourceStatus, + ServiceURL, + Snapshot, +) +from langsmith.sandbox._sandbox import Sandbox +from langsmith.sandbox._tunnel import AsyncTunnel, Tunnel + +__all__ = [ + # Main classes + "SandboxClient", + "AsyncSandboxClient", + "Sandbox", + "AsyncSandbox", + # Models + "ResourceStatus", + "ExecutionResult", + "Snapshot", + "ServiceURL", + "AsyncServiceURL", + # WebSocket streaming models + "CommandHandle", + "AsyncCommandHandle", + "OutputChunk", + # Base and connection errors + "SandboxClientError", + "SandboxAPIError", + "SandboxAuthenticationError", + "SandboxConnectionError", + "SandboxServerReloadError", + # Resource errors (type-based with resource_type attribute) + "ResourceCreationError", + "ResourceNotFoundError", + "ResourceTimeoutError", + "ResourceInUseError", + "ResourceAlreadyExistsError", + "ResourceNameConflictError", + # Validation and quota errors + "ValidationError", + "QuotaExceededError", + # Sandbox-specific errors + "SandboxNotReadyError", + "SandboxOperationError", + "CommandTimeoutError", + "DataplaneNotConfiguredError", + # Tunnel + "Tunnel", + "AsyncTunnel", + "TunnelError", + "TunnelPortNotAllowedError", + "TunnelConnectionRefusedError", + "TunnelUnsupportedVersionError", +] + +# Emit warning on import +import warnings + +warnings.warn( + "langsmith.sandbox is in alpha. " + "This feature is experimental, and breaking changes are expected.", + FutureWarning, + stacklevel=2, +) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4285c2a6aec01df9384537ed42619a88e3b17451 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_async_client.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_async_client.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..988f689d2fe4f5b513ddd7f68b256d4d7ae7076d Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_async_client.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_async_sandbox.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_async_sandbox.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16bbb3393aa97e6f083d359025d7aef2172f15bc Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_async_sandbox.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_client.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_client.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12e7378f2620510c6228ac7d7d80e8c03e63e94a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_client.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_exceptions.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d769f6adf97ba82aaf0f13dfae1cfdaaba4fc4e Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_exceptions.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_helpers.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_helpers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5f6690dc52dfa5f206372a79ec405e0b1f5676e Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_helpers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_models.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_models.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b7498e5ba834bd616e8e00a4e58f7a317f838bb Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_models.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_sandbox.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_sandbox.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b5bae51a0928745170ba35ad7a56c66cbe6e7d1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_sandbox.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_transport.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_transport.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7a9f3251837e6ed8254914423e4dbfa772eecaf Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_transport.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_tunnel.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_tunnel.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17c6b20a9f4b4822c9f24949a12bf9d6ee1c87c9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_tunnel.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_ws_execute.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_ws_execute.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..906a8aa3bbaaf19e107c346d76cd70c8288c4c47 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_ws_execute.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_yamux.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_yamux.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b25fe3971214c46d104493882aff7cef068bf79 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/sandbox/__pycache__/_yamux.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_async_client.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_async_client.py new file mode 100644 index 0000000000000000000000000000000000000000..d342be160e54e13390279f9f0717ca9a90859033 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_async_client.py @@ -0,0 +1,975 @@ +"""Async SandboxClient class for interacting with the sandbox server API.""" + +from __future__ import annotations + +import asyncio +from collections.abc import Mapping +from typing import Any, Optional + +import httpx + +from langsmith import utils as ls_utils +from langsmith.sandbox._async_sandbox import AsyncSandbox +from langsmith.sandbox._exceptions import ( + ResourceCreationError, + ResourceNameConflictError, + ResourceNotFoundError, + ResourceTimeoutError, + SandboxAPIError, +) +from langsmith.sandbox._helpers import ( + handle_client_http_error, + handle_sandbox_creation_error, + merge_headers, + validate_service_params, + validate_ttl, +) +from langsmith.sandbox._models import ( + AsyncServiceURL, + ResourceStatus, + Snapshot, +) +from langsmith.sandbox._transport import AsyncRetryTransport + + +def _get_default_api_endpoint() -> str: + """Get the default sandbox API endpoint from environment. + + Derives the endpoint from LANGSMITH_ENDPOINT (or LANGCHAIN_ENDPOINT). + """ + base = ls_utils.get_env_var("ENDPOINT", default="https://api.smith.langchain.com") + return f"{base.rstrip('/')}/v2/sandboxes" + + +def _get_default_api_key() -> Optional[str]: + """Get the default API key from environment.""" + return ls_utils.get_env_var("API_KEY") + + +RequestHeaders = Optional[Mapping[str, str]] + + +class AsyncSandboxClient: + """Async client for interacting with the Sandbox Server API. + + This client provides an async interface for managing sandboxes and snapshots. + + Example: + # Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment + async with AsyncSandboxClient() as client: + # Create a sandbox from a snapshot and run commands + async with await client.sandbox( + snapshot_id="" + ) as sandbox: + result = await sandbox.run("python --version") + print(result.stdout) + """ + + def __init__( + self, + *, + api_endpoint: Optional[str] = None, + timeout: float = 10.0, + api_key: Optional[str] = None, + max_retries: int = 3, + ): + """Initialize the AsyncSandboxClient. + + Args: + api_endpoint: Full URL of the sandbox API endpoint. If not provided, + derived from LANGSMITH_ENDPOINT environment variable. + timeout: Default HTTP timeout in seconds. + api_key: API key for authentication. If not provided, uses + LANGSMITH_API_KEY environment variable. + max_retries: Maximum number of retries for transient errors (502, 503, + 504), rate limits (429), and connection failures. Set to 0 + to disable retries. Default: 3. + """ + self._base_url = (api_endpoint or _get_default_api_endpoint()).rstrip("/") + resolved_api_key = api_key or _get_default_api_key() + self._api_key = resolved_api_key + headers: dict[str, str] = {} + if resolved_api_key: + headers["X-Api-Key"] = resolved_api_key + transport = AsyncRetryTransport(max_retries=max_retries) + self._http = httpx.AsyncClient( + transport=transport, timeout=timeout, headers=headers + ) + + def _request_headers(self, headers: RequestHeaders) -> Optional[dict[str, str]]: + """Merge default client headers with per-request overrides.""" + if headers is None: + return None + return merge_headers(self._http.headers, headers) + + async def aclose(self) -> None: + """Close the async HTTP client.""" + await self._http.aclose() + + def __del__(self) -> None: + """Best-effort cleanup of the async HTTP client on garbage collection. + + If an event loop is running, schedules ``aclose()`` as a task. + Otherwise the underlying sockets will be closed by the GC. + For deterministic cleanup, use ``async with`` or ``await aclose()``. + """ + try: + if not self._http.is_closed: + try: + loop = asyncio.get_running_loop() + if not loop.is_closed(): + loop.create_task(self.aclose()) + except RuntimeError: + pass + except Exception: + pass + + async def __aenter__(self) -> AsyncSandboxClient: + """Enter async context manager.""" + return self + + async def __aexit__( + self, + exc_type: Optional[type], + exc_val: Optional[BaseException], + exc_tb: Optional[Any], + ) -> None: + """Exit async context manager.""" + await self.aclose() + + def __repr__(self) -> str: + """Return a string representation of the instance. + + Returns: + The string representation of the instance. + """ + return f"AsyncSandboxClient (API URL: {self._base_url})" + + # ======================================================================== + # Sandbox Operations + # ======================================================================== + + async def sandbox( + self, + snapshot_id: Optional[str] = None, + *, + snapshot_name: Optional[str] = None, + name: Optional[str] = None, + timeout: int = 30, + idle_ttl_seconds: Optional[int] = None, + delete_after_stop_seconds: Optional[int] = None, + vcpus: Optional[int] = None, + mem_bytes: Optional[int] = None, + fs_capacity_bytes: Optional[int] = None, + proxy_config: Optional[dict[str, Any]] = None, + headers: RequestHeaders = None, + ) -> AsyncSandbox: + """Create a sandbox and return an AsyncSandbox instance. + + This is the primary method for creating sandboxes. Use it as an + async context manager for automatic cleanup: + + async with await client.sandbox(snapshot_id="") as sandbox: + result = await sandbox.run("echo hello") + + # Resolve by snapshot name instead of ID: + async with await client.sandbox(snapshot_name="my-snap") as sandbox: + result = await sandbox.run("echo hello") + + The sandbox is automatically deleted when exiting the context manager. + For sandboxes with manual lifecycle management, use create_sandbox(). + + Args: + snapshot_id: Snapshot ID to boot from. Mutually exclusive with + ``snapshot_name``; exactly one must be provided. + snapshot_name: Snapshot name to boot from. Resolved server-side to a + snapshot owned by the caller's tenant. Mutually exclusive with + ``snapshot_id``; exactly one must be provided. + name: Optional sandbox name (auto-generated if not provided). + timeout: Timeout in seconds when waiting for ready. + idle_ttl_seconds: Idle timeout in seconds. The launcher + automatically stops the sandbox after this duration of + inactivity. Must be a multiple of 60. ``0`` explicitly + disables the idle stop. When omitted (``None``), the server + applies a default of ``600`` seconds (10 minutes). + delete_after_stop_seconds: Seconds after the sandbox enters the + ``stopped`` state before it (and its filesystem clone) are + permanently deleted. Must be a multiple of 60. ``0`` disables + stop-anchored deletion (manual cleanup required). When + omitted (``None``), the server applies its configured default. + vcpus: Number of vCPUs. + mem_bytes: Memory in bytes. + fs_capacity_bytes: Root filesystem capacity in bytes. + proxy_config: Per-sandbox proxy configuration forwarded to the + server as-is. Shape matches the backend `proxy_config` field: + ``{"rules": [...], "no_proxy": [...], "access_control": + {"allow_list": [...]}}`` or ``{"access_control": + {"deny_list": [...]}}``. Use ``access_control.allow_list`` to + restrict outbound HTTPS to a set of host patterns (exact + domains, globs like ``*.example.com``, IPs, CIDRs, or + ``~regex``). + + Returns: + AsyncSandbox instance. + + Raises: + ResourceTimeoutError: If timeout waiting for sandbox to be ready. + ResourceCreationError: If sandbox creation fails. + SandboxClientError: For other errors. + ValueError: If TTL values are invalid, or if neither/both of + ``snapshot_id`` and ``snapshot_name`` are provided. + """ + sb = await self.create_sandbox( + snapshot_id, + snapshot_name=snapshot_name, + name=name, + timeout=timeout, + idle_ttl_seconds=idle_ttl_seconds, + delete_after_stop_seconds=delete_after_stop_seconds, + vcpus=vcpus, + mem_bytes=mem_bytes, + fs_capacity_bytes=fs_capacity_bytes, + proxy_config=proxy_config, + headers=headers, + ) + sb._auto_delete = True + return sb + + async def create_sandbox( + self, + snapshot_id: Optional[str] = None, + *, + snapshot_name: Optional[str] = None, + name: Optional[str] = None, + timeout: int = 30, + wait_for_ready: bool = True, + idle_ttl_seconds: Optional[int] = None, + delete_after_stop_seconds: Optional[int] = None, + vcpus: Optional[int] = None, + mem_bytes: Optional[int] = None, + fs_capacity_bytes: Optional[int] = None, + proxy_config: Optional[dict[str, Any]] = None, + headers: RequestHeaders = None, + ) -> AsyncSandbox: + """Create a new Sandbox. + + The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup, + or use sandbox() for automatic cleanup with a context manager. + + Args: + snapshot_id: Snapshot ID to boot from. Mutually exclusive with + ``snapshot_name``; exactly one must be provided. + snapshot_name: Snapshot name to boot from. Resolved server-side to a + snapshot owned by the caller's tenant. Mutually exclusive with + ``snapshot_id``; exactly one must be provided. + name: Optional sandbox name (auto-generated if not provided). + timeout: Timeout in seconds when waiting for ready (only used when + wait_for_ready=True). + wait_for_ready: If True (default), block until sandbox is ready. + If False, return immediately with status "provisioning". Use + get_sandbox_status() or wait_for_sandbox() to poll for readiness. + idle_ttl_seconds: Idle timeout in seconds. The launcher + automatically stops the sandbox after this duration of + inactivity. Must be a multiple of 60. ``0`` explicitly + disables the idle stop. When omitted (``None``), the server + applies a default of ``600`` seconds (10 minutes). + delete_after_stop_seconds: Seconds after the sandbox enters the + ``stopped`` state before it (and its filesystem clone) are + permanently deleted. Must be a multiple of 60. ``0`` disables + stop-anchored deletion (manual cleanup required). When + omitted (``None``), the server applies its configured default. + vcpus: Number of vCPUs. + mem_bytes: Memory in bytes. + fs_capacity_bytes: Root filesystem capacity in bytes. + proxy_config: Per-sandbox proxy configuration forwarded to the + server as-is. Shape matches the backend `proxy_config` field: + ``{"rules": [...], "no_proxy": [...], "access_control": + {"allow_list": [...]}}`` or ``{"access_control": + {"deny_list": [...]}}``. Use ``access_control.allow_list`` to + restrict outbound HTTPS to a set of host patterns (exact + domains, globs like ``*.example.com``, IPs, CIDRs, or + ``~regex``). + + Returns: + Created AsyncSandbox. When wait_for_ready=False, the sandbox will have + status="provisioning" and cannot be used for operations until ready. + + Raises: + ResourceTimeoutError: If timeout waiting for sandbox to be ready. + ResourceCreationError: If sandbox creation fails. + SandboxClientError: For other errors. + ValueError: If TTL values are invalid, or if neither/both of + ``snapshot_id`` and ``snapshot_name`` are provided. + """ + if bool(snapshot_id) == bool(snapshot_name): + raise ValueError("Exactly one of snapshot_id or snapshot_name must be set") + + validate_ttl(idle_ttl_seconds, "idle_ttl_seconds") + validate_ttl(delete_after_stop_seconds, "delete_after_stop_seconds") + + url = f"{self._base_url}/boxes" + + payload: dict[str, Any] = { + "wait_for_ready": wait_for_ready, + } + if snapshot_id: + payload["snapshot_id"] = snapshot_id + if snapshot_name: + payload["snapshot_name"] = snapshot_name + if wait_for_ready: + payload["timeout"] = timeout + if name: + payload["name"] = name + if idle_ttl_seconds is not None: + payload["idle_ttl_seconds"] = idle_ttl_seconds + if delete_after_stop_seconds is not None: + payload["delete_after_stop_seconds"] = delete_after_stop_seconds + if vcpus is not None: + payload["vcpus"] = vcpus + if mem_bytes is not None: + payload["mem_bytes"] = mem_bytes + if fs_capacity_bytes is not None: + payload["fs_capacity_bytes"] = fs_capacity_bytes + if proxy_config is not None: + payload["proxy_config"] = proxy_config + + http_timeout = (timeout + 30) if wait_for_ready else 30 + + try: + response = await self._http.post( + url, + json=payload, + timeout=http_timeout, + headers=self._request_headers(headers), + ) + response.raise_for_status() + return AsyncSandbox.from_dict( + response.json(), client=self, auto_delete=False + ) + except httpx.HTTPStatusError as e: + handle_sandbox_creation_error(e) + raise # pragma: no cover + + async def get_sandbox( + self, name: str, *, headers: RequestHeaders = None + ) -> AsyncSandbox: + """Get a Sandbox by name. + + The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup. + + Args: + name: Sandbox name. + + Returns: + AsyncSandbox. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}" + + try: + response = await self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + return AsyncSandbox.from_dict( + response.json(), client=self, auto_delete=False + ) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def list_sandboxes( + self, *, headers: RequestHeaders = None + ) -> list[AsyncSandbox]: + """List all Sandboxes. + + Returns: + List of AsyncSandboxes. + """ + url = f"{self._base_url}/boxes" + + try: + response = await self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + data = response.json() + return [ + AsyncSandbox.from_dict(c, client=self, auto_delete=False) + for c in data.get("sandboxes", []) + ] + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise SandboxAPIError( + f"API endpoint not found: {url}. " + f"Check that api_endpoint is correct." + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def update_sandbox( + self, + name: str, + *, + new_name: Optional[str] = None, + idle_ttl_seconds: Optional[int] = None, + delete_after_stop_seconds: Optional[int] = None, + headers: RequestHeaders = None, + ) -> AsyncSandbox: + """Update a sandbox's properties. + + Args: + name: Current sandbox name. + new_name: New display name. + idle_ttl_seconds: Idle timeout in seconds. Must be a multiple of + 60. ``0`` disables idle-stop. ``None`` leaves the existing + value unchanged. + delete_after_stop_seconds: Seconds after entering ``stopped`` + before deletion. Must be a multiple of 60. ``0`` disables + stop-anchored deletion. ``None`` leaves the existing value + unchanged. + + Returns: + Updated AsyncSandbox. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceNameConflictError: If new_name is already in use. + SandboxClientError: For other errors. + ValueError: If TTL values are invalid. + """ + validate_ttl(idle_ttl_seconds, "idle_ttl_seconds") + validate_ttl(delete_after_stop_seconds, "delete_after_stop_seconds") + + url = f"{self._base_url}/boxes/{name}" + payload: dict[str, Any] = {} + if new_name is not None: + payload["name"] = new_name + if idle_ttl_seconds is not None: + payload["idle_ttl_seconds"] = idle_ttl_seconds + if delete_after_stop_seconds is not None: + payload["delete_after_stop_seconds"] = delete_after_stop_seconds + + try: + response = await self._http.patch( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + return AsyncSandbox.from_dict( + response.json(), client=self, auto_delete=False + ) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + if e.response.status_code == 409: + raise ResourceNameConflictError( + f"Sandbox name '{new_name}' already in use", + resource_type="sandbox", + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def delete_sandbox( + self, name: str, *, headers: RequestHeaders = None + ) -> None: + """Delete a Sandbox. + + Args: + name: Sandbox name. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}" + + try: + response = await self._http.delete( + url, headers=self._request_headers(headers) + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + + async def get_sandbox_status( + self, name: str, *, headers: RequestHeaders = None + ) -> ResourceStatus: + """Get the provisioning status of a sandbox. + + This is a lightweight endpoint designed for high-frequency polling + during sandbox provisioning. It returns only the status fields + without full sandbox data. + + Args: + name: Sandbox name. + + Returns: + ResourceStatus with status and status_message. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}/status" + + try: + response = await self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + return ResourceStatus.from_dict(response.json()) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def service( + self, + name: str, + port: int, + *, + expires_in_seconds: int = 600, + headers: RequestHeaders = None, + ) -> AsyncServiceURL: + """Get an authenticated URL for a service running inside a sandbox. + + Returns an :class:`AsyncServiceURL` whose async accessors + auto-refresh the token transparently before it expires. The + object also provides async HTTP helper methods (``.get``, + ``.post``, etc.) that inject the authentication header + automatically. + + Args: + name: Sandbox name. + port: Port the service is listening on inside the sandbox. + expires_in_seconds: Token TTL in seconds (1--86400, default 600). + headers: Optional per-request header overrides. + + Returns: + AsyncServiceURL with auto-refreshing token and HTTP helpers. + + Raises: + ResourceNotFoundError: If sandbox not found. + ValueError: If port or expires_in_seconds is out of range. + SandboxClientError: For other errors. + """ + validate_service_params(port, expires_in_seconds) + url = f"{self._base_url}/boxes/{name}/service-url" + payload = {"port": port, "expires_in_seconds": expires_in_seconds} + + async def _refresher() -> AsyncServiceURL: + return await self.service( + name, + port, + expires_in_seconds=expires_in_seconds, + headers=headers, + ) + + try: + response = await self._http.post( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + return AsyncServiceURL.from_dict(response.json(), _refresher=_refresher) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def wait_for_sandbox( + self, + name: str, + *, + timeout: int = 120, + poll_interval: float = 1.0, + headers: RequestHeaders = None, + ) -> AsyncSandbox: + """Poll until a sandbox reaches "ready" or "failed" status. + + Uses the lightweight status endpoint for polling, then fetches the + full sandbox data once ready. + + Args: + name: Sandbox name. + timeout: Maximum time to wait in seconds. + poll_interval: Time between status checks in seconds. + + Returns: + AsyncSandbox in "ready" status. + + Raises: + ResourceCreationError: If sandbox status becomes "failed". + ResourceTimeoutError: If timeout expires while still "provisioning". + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + import time + + deadline = time.monotonic() + timeout + while True: + status = await self.get_sandbox_status(name, headers=headers) + if status.status == "ready": + return await self.get_sandbox(name, headers=headers) + if status.status == "failed": + raise ResourceCreationError( + status.status_message or "Sandbox provisioning failed", + resource_type="sandbox", + ) + remaining = deadline - time.monotonic() + if remaining <= 0: + raise ResourceTimeoutError( + f"Sandbox '{name}' not ready after {timeout}s", + resource_type="sandbox", + last_status=status.status, + ) + await asyncio.sleep(min(poll_interval, remaining)) + + async def start_sandbox( + self, + name: str, + *, + timeout: int = 120, + headers: RequestHeaders = None, + ) -> AsyncSandbox: + """Start a stopped sandbox and wait until ready. + + Args: + name: Sandbox name. + timeout: Timeout in seconds when waiting for ready. + + Returns: + AsyncSandbox in "ready" status. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceCreationError: If sandbox fails during startup. + ResourceTimeoutError: If sandbox doesn't become ready within timeout. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}/start" + + try: + response = await self._http.post( + url, json={}, headers=self._request_headers(headers) + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + + return await self.wait_for_sandbox(name, timeout=timeout, headers=headers) + + async def stop_sandbox(self, name: str, *, headers: RequestHeaders = None) -> None: + """Stop a running sandbox (preserves sandbox files for later restart). + + Args: + name: Sandbox name. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}/stop" + + try: + response = await self._http.post( + url, json={}, headers=self._request_headers(headers) + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + + # ======================================================================== + # Snapshot Operations + # ======================================================================== + + async def create_snapshot( + self, + name: str, + docker_image: str, + fs_capacity_bytes: int, + *, + registry_id: Optional[str] = None, + registry_url: Optional[str] = None, + registry_username: Optional[str] = None, + registry_password: Optional[str] = None, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> Snapshot: + """Build a snapshot from a Docker image. + + Blocks until the snapshot is ready (polls with 2s interval). + + Args: + name: Snapshot name. + docker_image: Docker image to build from (e.g., "python:3.12-slim"). + fs_capacity_bytes: Filesystem capacity in bytes. + registry_id: Private registry ID (alternative to URL/credentials). + registry_url: Registry URL for private images. + registry_username: Registry username. + registry_password: Registry password. + timeout: Timeout in seconds when waiting for ready. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceTimeoutError: If snapshot doesn't become ready within timeout. + ResourceCreationError: If snapshot build fails. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/snapshots" + + payload: dict[str, Any] = { + "name": name, + "docker_image": docker_image, + "fs_capacity_bytes": fs_capacity_bytes, + } + if registry_id is not None: + payload["registry_id"] = registry_id + if registry_url is not None: + payload["registry_url"] = registry_url + if registry_username is not None: + payload["registry_username"] = registry_username + if registry_password is not None: + payload["registry_password"] = registry_password + + try: + response = await self._http.post( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + snapshot = Snapshot.from_dict(response.json()) + except httpx.HTTPStatusError as e: + handle_client_http_error(e) + raise # pragma: no cover + + return await self.wait_for_snapshot( + snapshot.id, timeout=timeout, headers=headers + ) + + async def capture_snapshot( + self, + sandbox_name: str, + name: str, + *, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> Snapshot: + """Capture a snapshot from a running sandbox. + + Blocks until the snapshot is ready (polls with 2s interval). + + Args: + sandbox_name: Name of the sandbox to capture from. + name: Snapshot name. + timeout: Timeout in seconds when waiting for ready. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceTimeoutError: If snapshot doesn't become ready within timeout. + ResourceCreationError: If snapshot capture fails. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{sandbox_name}/snapshot" + + payload: dict[str, Any] = {"name": name} + + try: + response = await self._http.post( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + snapshot = Snapshot.from_dict(response.json()) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{sandbox_name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + return await self.wait_for_snapshot( + snapshot.id, timeout=timeout, headers=headers + ) + + async def get_snapshot( + self, snapshot_id: str, *, headers: RequestHeaders = None + ) -> Snapshot: + """Get a snapshot by ID. + + Args: + snapshot_id: Snapshot UUID. + + Returns: + Snapshot. + + Raises: + ResourceNotFoundError: If snapshot not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/snapshots/{snapshot_id}" + + try: + response = await self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + return Snapshot.from_dict(response.json()) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Snapshot '{snapshot_id}' not found", resource_type="snapshot" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def list_snapshots( + self, + *, + name_contains: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + headers: RequestHeaders = None, + ) -> list[Snapshot]: + """List snapshots. + + The backend always paginates this endpoint. When ``limit`` is omitted + the server applies a default page size (currently 50), so a single + call is not guaranteed to return every snapshot. To iterate through + all results, repeat the call with increasing ``offset`` values (or an + explicit ``limit``) until fewer than ``limit`` snapshots come back. + + Args: + name_contains: Optional case-insensitive substring filter applied + to snapshot names server-side. + limit: Optional maximum number of snapshots to return for a single + request. Must be between 1 and 500 (inclusive); the server + rejects values outside that range. Defaults to 50 server-side + when omitted. + offset: Optional number of snapshots to skip before returning + results. Must be ``>= 0``. Useful for paginating through + large result sets in combination with ``limit``. + + Returns: + A single page of Snapshots matching the provided filters. + """ + url = f"{self._base_url}/snapshots" + + params: dict[str, Any] = {} + if name_contains is not None: + params["name_contains"] = name_contains + if limit is not None: + params["limit"] = limit + if offset is not None: + params["offset"] = offset + + try: + response = await self._http.get( + url, + params=params or None, + headers=self._request_headers(headers), + ) + response.raise_for_status() + data = response.json() + return [Snapshot.from_dict(s) for s in data.get("snapshots", [])] + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise SandboxAPIError( + f"API endpoint not found: {url}. " + f"Check that api_endpoint is correct." + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + async def delete_snapshot( + self, snapshot_id: str, *, headers: RequestHeaders = None + ) -> None: + """Delete a snapshot. + + Args: + snapshot_id: Snapshot UUID. + + Raises: + ResourceNotFoundError: If snapshot not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/snapshots/{snapshot_id}" + + try: + response = await self._http.delete( + url, headers=self._request_headers(headers) + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Snapshot '{snapshot_id}' not found", resource_type="snapshot" + ) from e + handle_client_http_error(e) + + async def wait_for_snapshot( + self, + snapshot_id: str, + *, + timeout: int = 300, + poll_interval: float = 2.0, + headers: RequestHeaders = None, + ) -> Snapshot: + """Poll until a snapshot reaches "ready" or "failed" status. + + Args: + snapshot_id: Snapshot UUID. + timeout: Maximum time to wait in seconds. + poll_interval: Time between status checks in seconds. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceCreationError: If snapshot status becomes "failed". + ResourceTimeoutError: If timeout expires. + ResourceNotFoundError: If snapshot not found. + SandboxClientError: For other errors. + """ + import time + + deadline = time.monotonic() + timeout + while True: + snapshot = await self.get_snapshot(snapshot_id, headers=headers) + if snapshot.status == "ready": + return snapshot + if snapshot.status == "failed": + raise ResourceCreationError( + snapshot.status_message or "Snapshot build failed", + resource_type="snapshot", + ) + remaining = deadline - time.monotonic() + if remaining <= 0: + raise ResourceTimeoutError( + f"Snapshot '{snapshot_id}' not ready after {timeout}s", + resource_type="snapshot", + last_status=snapshot.status, + ) + await asyncio.sleep(min(poll_interval, remaining)) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_async_sandbox.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_async_sandbox.py new file mode 100644 index 0000000000000000000000000000000000000000..dc76451e993932dc2898a39d85107b5a2747faab --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_async_sandbox.py @@ -0,0 +1,732 @@ +"""AsyncSandbox class for async sandbox operations.""" + +from __future__ import annotations + +import asyncio +from collections.abc import Mapping +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Union, overload + +import httpx + +from langsmith.sandbox._exceptions import ( + DataplaneNotConfiguredError, + ResourceNotFoundError, + SandboxConnectionError, + SandboxNotReadyError, +) +from langsmith.sandbox._helpers import handle_sandbox_http_error +from langsmith.sandbox._models import ( + AsyncCommandHandle, + AsyncServiceURL, + ExecutionResult, + Snapshot, +) +from langsmith.sandbox._tunnel import AsyncTunnel + +if TYPE_CHECKING: + from langsmith.sandbox._async_client import AsyncSandboxClient + + +RequestHeaders = Optional[Mapping[str, str]] + + +@dataclass +class AsyncSandbox: + """Represents an active sandbox for running commands and file operations async. + + This class is typically obtained from AsyncSandboxClient.sandbox() and supports + the async context manager protocol for automatic cleanup. + + Attributes: + name: Display name (can be updated). + dataplane_url: URL for data plane operations (file I/O, command execution). + Only functional when status is "ready". + id: Unique identifier (UUID). Remains constant even if name changes. + May be None for resources created before ID support was added. + status: Sandbox lifecycle status. One of "provisioning", "ready", + "failed", "stopped". + status_message: Human-readable details when status is "failed", None otherwise. + created_at: Timestamp when the sandbox was created. + updated_at: Timestamp when the sandbox was last updated. + idle_ttl_seconds: Idle timeout TTL in seconds (``0`` means disabled). + Newly-created sandboxes receive a server-side default of ``600`` + seconds (10 minutes) when the caller did not set ``idle_ttl_seconds`` + explicitly. The launcher stops the sandbox after this many idle + seconds; deletion is anchored to ``stopped_at`` and controlled by + ``delete_after_stop_seconds`` (see below). + delete_after_stop_seconds: Seconds after a sandbox enters the + ``stopped`` state before it (and its filesystem clone) are + permanently deleted. ``0`` disables stop-anchored deletion; + ``None`` falls back to the server default. + stopped_at: Timestamp when the sandbox transitioned to ``stopped``, + or ``None`` while running. The deletion deadline is + ``stopped_at + delete_after_stop_seconds``. + snapshot_id: Snapshot ID used to create this sandbox. + vcpus: Number of vCPUs allocated. + mem_bytes: Memory allocation in bytes. + fs_capacity_bytes: Root filesystem capacity in bytes. + + Example: + async with await client.sandbox( + snapshot_id="" + ) as sandbox: + result = await sandbox.run("python --version") + print(result.stdout) + """ + + # Data fields (from API response) + name: str + dataplane_url: Optional[str] = None + id: Optional[str] = None + status: str = "ready" + status_message: Optional[str] = None + created_at: Optional[str] = None + updated_at: Optional[str] = None + idle_ttl_seconds: Optional[int] = None + delete_after_stop_seconds: Optional[int] = None + stopped_at: Optional[str] = None + snapshot_id: Optional[str] = None + vcpus: Optional[int] = None + mem_bytes: Optional[int] = None + fs_capacity_bytes: Optional[int] = None + + # Internal fields (not from API) + _client: AsyncSandboxClient = field(repr=False, default=None) # type: ignore + _auto_delete: bool = field(repr=False, default=True) + + @classmethod + def from_dict( + cls, + data: dict[str, Any], + client: AsyncSandboxClient, + auto_delete: bool = True, + ) -> AsyncSandbox: + """Create an AsyncSandbox from API response dict. + + Args: + data: API response dictionary containing sandbox data. + client: Parent AsyncSandboxClient for operations. + auto_delete: Whether to delete the sandbox on context exit. + + Returns: + AsyncSandbox instance. + """ + return cls( + name=data.get("name", ""), + dataplane_url=data.get("dataplane_url"), + id=data.get("id"), + status=data.get("status", "ready"), + status_message=data.get("status_message"), + created_at=data.get("created_at"), + updated_at=data.get("updated_at"), + idle_ttl_seconds=data.get("idle_ttl_seconds"), + delete_after_stop_seconds=data.get("delete_after_stop_seconds"), + stopped_at=data.get("stopped_at"), + snapshot_id=data.get("snapshot_id"), + vcpus=data.get("vcpus"), + mem_bytes=data.get("mem_bytes"), + fs_capacity_bytes=data.get("fs_capacity_bytes"), + _client=client, + _auto_delete=auto_delete, + ) + + async def __aenter__(self) -> AsyncSandbox: + """Enter async context manager.""" + return self + + async def __aexit__( + self, + exc_type: Optional[type], + exc_val: Optional[BaseException], + exc_tb: Optional[Any], + ) -> None: + """Exit async context manager, optionally deleting the sandbox.""" + if self._auto_delete: + try: + await self._client.delete_sandbox(self.name) + except Exception: + # Don't raise on cleanup errors + pass + + def _require_dataplane_url(self) -> str: + """Validate and return the dataplane URL. + + Returns: + The dataplane URL. + + Raises: + SandboxNotReadyError: If sandbox status is not "ready". + DataplaneNotConfiguredError: If dataplane_url is not configured. + """ + if self.status != "ready": + raise SandboxNotReadyError( + f"Sandbox '{self.name}' is not ready (status: {self.status}). " + "Wait for status 'ready' before running operations." + ) + if not self.dataplane_url: + raise DataplaneNotConfiguredError( + f"Sandbox '{self.name}' does not have a dataplane_url configured. " + "Runtime operations require a dataplane URL." + ) + return self.dataplane_url + + @overload + async def run( + self, + command: str, + *, + timeout: int = ..., + env: Optional[dict[str, str]] = ..., + cwd: Optional[str] = ..., + shell: str = ..., + on_stdout: Optional[Callable[[str], Any]] = ..., + on_stderr: Optional[Callable[[str], Any]] = ..., + idle_timeout: int = ..., + kill_on_disconnect: bool = ..., + ttl_seconds: int = ..., + pty: bool = ..., + headers: RequestHeaders = ..., + wait: Literal[True] = ..., + ) -> ExecutionResult: ... + + @overload + async def run( + self, + command: str, + *, + timeout: int = ..., + env: Optional[dict[str, str]] = ..., + cwd: Optional[str] = ..., + shell: str = ..., + on_stdout: Optional[Callable[[str], Any]] = ..., + on_stderr: Optional[Callable[[str], Any]] = ..., + idle_timeout: int = ..., + kill_on_disconnect: bool = ..., + ttl_seconds: int = ..., + pty: bool = ..., + headers: RequestHeaders = ..., + wait: Literal[False], + ) -> AsyncCommandHandle: ... + + async def run( + self, + command: str, + *, + timeout: int = 60, + env: Optional[dict[str, str]] = None, + cwd: Optional[str] = None, + shell: str = "/bin/bash", + on_stdout: Optional[Callable[[str], Any]] = None, + on_stderr: Optional[Callable[[str], Any]] = None, + idle_timeout: int = 300, + kill_on_disconnect: bool = False, + ttl_seconds: int = 600, + pty: bool = False, + headers: RequestHeaders = None, + wait: bool = True, + ) -> Union[ExecutionResult, AsyncCommandHandle]: + """Execute a command in the sandbox asynchronously. + + Args: + command: Shell command to execute. + timeout: Command timeout in seconds. + env: Environment variables to set for the command. + cwd: Working directory for command execution. If None, uses sandbox default. + shell: Shell to use for command execution. Defaults to "/bin/bash". + on_stdout: Callback invoked with each stdout chunk as it arrives. + Blocks until the command completes and returns ExecutionResult. + Cannot be combined with wait=False. + on_stderr: Callback invoked with each stderr chunk as it arrives. + Blocks until the command completes and returns ExecutionResult. + Cannot be combined with wait=False. + idle_timeout: Idle timeout in seconds. If the command has no + connected clients for this duration, it is killed. Defaults + to 300 (5 minutes). Set to -1 for no idle timeout. + Only applies to WebSocket execution. + kill_on_disconnect: If True, kill the command immediately when + the last client disconnects. Defaults to False (command + continues running and can be reconnected to). + ttl_seconds: How long (in seconds) a finished command's session + is kept for reconnection. Defaults to 600 (10 minutes). + Set to -1 to keep indefinitely. + pty: If True, allocate a pseudo-terminal for the command. + Useful for commands that require a TTY (e.g., interactive + programs, commands that use terminal control codes). + Defaults to False. + wait: If True (default), block until the command completes and + return ExecutionResult. If False, return an + AsyncCommandHandle immediately for streaming output, + kill, stdin input, and reconnection. Cannot be combined + with on_stdout/on_stderr callbacks. + + Returns: + ExecutionResult when wait=True (default). + AsyncCommandHandle when wait=False. + + Raises: + ValueError: If wait=False is combined with callbacks. + DataplaneNotConfiguredError: If dataplane_url is not configured. + SandboxOperationError: If command execution fails. + CommandTimeoutError: If command exceeds its timeout. + SandboxConnectionError: If connection to sandbox fails after retries. + SandboxNotReadyError: If sandbox is not ready. + SandboxClientError: For other errors. + """ + if not wait and (on_stdout or on_stderr): + raise ValueError( + "Cannot combine wait=False with on_stdout/on_stderr callbacks. " + "Use wait=False and iterate the CommandHandle, or use callbacks." + ) + + self._require_dataplane_url() + + use_ws = not wait or on_stdout or on_stderr + if use_ws: + return await self._run_ws( + command, + timeout=timeout, + env=env, + cwd=cwd, + shell=shell, + wait=wait, + on_stdout=on_stdout, + on_stderr=on_stderr, + idle_timeout=idle_timeout, + kill_on_disconnect=kill_on_disconnect, + ttl_seconds=ttl_seconds, + pty=pty, + headers=headers, + ) + + # Catch broad exceptions so that unexpected WS failures (e.g. version + # incompatibilities) don't break users who don't need WS features. + try: + return await self._run_ws( + command, + timeout=timeout, + env=env, + cwd=cwd, + shell=shell, + wait=True, + on_stdout=None, + on_stderr=None, + idle_timeout=idle_timeout, + kill_on_disconnect=kill_on_disconnect, + ttl_seconds=ttl_seconds, + pty=pty, + headers=headers, + ) + except (SandboxConnectionError, ImportError, OSError, TypeError): + return await self._run_http( + command, + timeout=timeout, + env=env, + cwd=cwd, + shell=shell, + headers=headers, + ) + + async def _run_ws( + self, + command: str, + *, + timeout: int, + env: Optional[dict[str, str]], + cwd: Optional[str], + shell: str, + wait: bool, + on_stdout: Optional[Callable[[str], Any]], + on_stderr: Optional[Callable[[str], Any]], + idle_timeout: int = 300, + kill_on_disconnect: bool = False, + ttl_seconds: int = 600, + pty: bool = False, + headers: RequestHeaders = None, + ) -> Union[ExecutionResult, AsyncCommandHandle]: + """Execute via WebSocket /execute/ws.""" + from langsmith.sandbox._ws_execute import run_ws_stream_async + + dataplane_url = self._require_dataplane_url() + api_key = self._client._api_key + + ws_kwargs: dict[str, Any] = { + "timeout": timeout, + "env": env, + "cwd": cwd, + "shell": shell, + "on_stdout": on_stdout, + "on_stderr": on_stderr, + "idle_timeout": idle_timeout, + "kill_on_disconnect": kill_on_disconnect, + "ttl_seconds": ttl_seconds, + "pty": pty, + } + if headers is not None: + ws_kwargs["headers"] = headers + + msg_stream, control = await run_ws_stream_async( + dataplane_url, + api_key, + command, + **ws_kwargs, + ) + + handle = AsyncCommandHandle(msg_stream, control, self) + await handle._ensure_started() + + if not wait: + return handle + + return await handle.result + + async def _run_http( + self, + command: str, + *, + timeout: int, + env: Optional[dict[str, str]], + cwd: Optional[str], + shell: str, + headers: RequestHeaders, + ) -> ExecutionResult: + """Execute via HTTP POST /execute (existing implementation).""" + dataplane_url = self._require_dataplane_url() + url = f"{dataplane_url}/execute" + payload: dict[str, Any] = { + "command": command, + "timeout": timeout, + "shell": shell, + } + if env is not None: + payload["env"] = env + if cwd is not None: + payload["cwd"] = cwd + + try: + response = await self._client._http.post( + url, + json=payload, + timeout=timeout + 10, + headers=self._client._request_headers(headers), + ) + response.raise_for_status() + data = response.json() + return ExecutionResult( + stdout=data.get("stdout", ""), + stderr=data.get("stderr", ""), + exit_code=data.get("exit_code", -1), + ) + except httpx.HTTPStatusError as e: + handle_sandbox_http_error(e) + raise # pragma: no cover + + async def reconnect( + self, + command_id: str, + *, + stdout_offset: int = 0, + stderr_offset: int = 0, + headers: RequestHeaders = None, + ) -> AsyncCommandHandle: + """Reconnect to a running or recently-finished command. + + Resumes output from the given byte offsets. Any output produced while + the client was disconnected is replayed from the server's ring buffer. + + Args: + command_id: The command ID from handle.command_id. + stdout_offset: Byte offset to resume stdout from (default: 0). + stderr_offset: Byte offset to resume stderr from (default: 0). + + Returns: + An AsyncCommandHandle for the command. + + Raises: + SandboxOperationError: If command_id is not found or session expired. + SandboxConnectionError: If connection to sandbox fails after retries. + """ + from langsmith.sandbox._ws_execute import reconnect_ws_stream_async + + dataplane_url = self._require_dataplane_url() + api_key = self._client._api_key + + reconnect_kwargs: dict[str, Any] = { + "stdout_offset": stdout_offset, + "stderr_offset": stderr_offset, + } + if headers is not None: + reconnect_kwargs["headers"] = headers + + msg_stream, control = await reconnect_ws_stream_async( + dataplane_url, + api_key, + command_id, + **reconnect_kwargs, + ) + + return AsyncCommandHandle( + msg_stream, + control, + self, + command_id=command_id, + stdout_offset=stdout_offset, + stderr_offset=stderr_offset, + ) + + async def write( + self, + path: str, + content: Union[str, bytes], + *, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> None: + """Write content to a file in the sandbox asynchronously. + + Args: + path: Target file path in the sandbox. + content: File content (str or bytes). + timeout: Request timeout in seconds. + + Raises: + DataplaneNotConfiguredError: If dataplane_url is not configured. + SandboxOperationError: If file write fails. + SandboxConnectionError: If connection to sandbox fails after retries. + SandboxNotReadyError: If sandbox is not ready. + SandboxClientError: For other errors. + """ + dataplane_url = self._require_dataplane_url() + url = f"{dataplane_url}/upload" + + # Ensure content is bytes for multipart upload + if isinstance(content, str): + content = content.encode("utf-8") + + files = {"file": ("file", content)} + + try: + response = await self._client._http.post( + url, + params={"path": path}, + files=files, + timeout=timeout, + headers=self._client._request_headers(headers), + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + handle_sandbox_http_error(e) + + async def read( + self, path: str, *, timeout: int = 60, headers: RequestHeaders = None + ) -> bytes: + """Read a file from the sandbox asynchronously. + + Args: + path: File path to read. Supports both absolute paths (e.g., /tmp/file.txt) + and relative paths (resolved from /home/user/). + timeout: Request timeout in seconds. + + Returns: + File contents as bytes. + + Raises: + DataplaneNotConfiguredError: If dataplane_url is not configured. + ResourceNotFoundError: If the file doesn't exist. + SandboxOperationError: If file read fails. + SandboxConnectionError: If connection to sandbox fails after retries. + SandboxNotReadyError: If sandbox is not ready. + SandboxClientError: For other errors. + """ + dataplane_url = self._require_dataplane_url() + url = f"{dataplane_url}/download" + + try: + response = await self._client._http.get( + url, + params={"path": path}, + timeout=timeout, + headers=self._client._request_headers(headers), + ) + response.raise_for_status() + return response.content + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"File '{path}' not found in sandbox '{self.name}'", + resource_type="file", + ) from e + handle_sandbox_http_error(e) + # This line should never be reached but satisfies type checker + raise # pragma: no cover + + async def tunnel( + self, + remote_port: int, + *, + local_port: int = 0, + max_reconnects: int = 3, + headers: RequestHeaders = None, + ) -> AsyncTunnel: + """Open a TCP tunnel to a port inside the sandbox. + + Creates a local TCP listener that forwards connections through a + yamux-multiplexed WebSocket to the specified port inside the sandbox. + Works with any TCP protocol (databases, Redis, HTTP, etc.). + + Usage:: + + async with await sandbox.tunnel(remote_port=5432) as t: + conn = await asyncpg.connect(host="127.0.0.1", port=t.local_port) + + Args: + remote_port: TCP port inside the sandbox to tunnel to (1-65535). + local_port: Local port to listen on. Defaults to mirroring + remote_port. Use 0 to let the OS pick an available port. + max_reconnects: Maximum number of automatic reconnect attempts + when the WebSocket session drops. Set to 0 to disable. + + Returns: + An AsyncTunnel instance (async context manager). + + Raises: + ValueError: If port values are out of range. + DataplaneNotConfiguredError: If dataplane_url is not configured. + SandboxNotReadyError: If sandbox is not ready. + """ + if not 1 <= remote_port <= 65535: + raise ValueError( + f"remote_port must be between 1 and 65535 (got {remote_port})" + ) + if local_port and not 1 <= local_port <= 65535: + raise ValueError( + f"local_port must be between 1 and 65535 (got {local_port})" + ) + dataplane_url = self._require_dataplane_url() + api_key = self._client._api_key + t = AsyncTunnel( + dataplane_url, + api_key, + remote_port, + local_port=local_port, + max_reconnects=max_reconnects, + headers=headers, + ) + loop = asyncio.get_running_loop() + await loop.run_in_executor(None, t._tunnel._start) + return t + + async def service( + self, + port: int, + *, + expires_in_seconds: int = 600, + headers: RequestHeaders = None, + ) -> AsyncServiceURL: + """Get an authenticated URL for a service running in this sandbox. + + Returns an :class:`AsyncServiceURL` whose async accessors + auto-refresh the token transparently before it expires. + + Args: + port: Port the service is listening on inside the sandbox. + expires_in_seconds: Token TTL in seconds (1--86400, default 600). + headers: Optional per-request header overrides. + + Returns: + AsyncServiceURL with auto-refreshing token and HTTP helpers. + + Raises: + ResourceNotFoundError: If sandbox not found. + ValueError: If port or expires_in_seconds is out of range. + SandboxClientError: For other errors. + """ + return await self._client.service( + self.name, + port, + expires_in_seconds=expires_in_seconds, + headers=headers, + ) + + async def start( + self, + *, + timeout: int = 120, + headers: RequestHeaders = None, + ) -> None: + """Start a stopped sandbox and wait until ready. + + After starting, the sandbox's status and dataplane_url are updated + in place. + + Args: + timeout: Timeout in seconds when waiting for ready. + headers: Optional per-request header overrides. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceCreationError: If sandbox fails during startup. + ResourceTimeoutError: If sandbox doesn't become ready within timeout. + SandboxClientError: For other errors. + """ + refreshed = await self._client.start_sandbox( + self.name, timeout=timeout, headers=headers + ) + self.status = refreshed.status + self.dataplane_url = refreshed.dataplane_url + + async def stop(self, *, headers: RequestHeaders = None) -> None: + """Stop a running sandbox (preserves sandbox files for later restart). + + Args: + headers: Optional per-request header overrides. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + await self._client.stop_sandbox(self.name, headers=headers) + self.status = "stopped" + self.dataplane_url = None + + async def delete(self, *, headers: RequestHeaders = None) -> None: + """Delete this sandbox. + + Args: + headers: Optional per-request header overrides. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + await self._client.delete_sandbox(self.name, headers=headers) + + async def capture_snapshot( + self, + name: str, + *, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> Snapshot: + """Capture a snapshot from this sandbox. + + Args: + name: Snapshot name. + timeout: Timeout in seconds when waiting for ready. + headers: Optional per-request header overrides. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceTimeoutError: If snapshot doesn't become ready within timeout. + ResourceCreationError: If snapshot capture fails. + SandboxClientError: For other errors. + """ + return await self._client.capture_snapshot( + self.name, + name, + timeout=timeout, + headers=headers, + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_client.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_client.py new file mode 100644 index 0000000000000000000000000000000000000000..1034b5bb102d3567dc2b4b2d34af4d7fbe240ed6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_client.py @@ -0,0 +1,951 @@ +"""Main SandboxClient class for interacting with the sandbox server API.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Optional + +import httpx + +from langsmith import utils as ls_utils +from langsmith.sandbox._exceptions import ( + ResourceCreationError, + ResourceNameConflictError, + ResourceNotFoundError, + ResourceTimeoutError, + SandboxAPIError, +) +from langsmith.sandbox._helpers import ( + handle_client_http_error, + handle_sandbox_creation_error, + merge_headers, + validate_service_params, + validate_ttl, +) +from langsmith.sandbox._models import ( + ResourceStatus, + ServiceURL, + Snapshot, +) +from langsmith.sandbox._sandbox import Sandbox +from langsmith.sandbox._transport import RetryTransport + + +def _get_default_api_endpoint() -> str: + """Get the default sandbox API endpoint from environment. + + Derives the endpoint from LANGSMITH_ENDPOINT (or LANGCHAIN_ENDPOINT). + """ + base = ls_utils.get_env_var("ENDPOINT", default="https://api.smith.langchain.com") + return f"{base.rstrip('/')}/v2/sandboxes" + + +def _get_default_api_key() -> Optional[str]: + """Get the default API key from environment.""" + return ls_utils.get_env_var("API_KEY") + + +RequestHeaders = Optional[Mapping[str, str]] + + +class SandboxClient: + """Client for interacting with the Sandbox Server API. + + This client provides a simple interface for managing sandboxes and snapshots. + + Example: + # Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment + client = SandboxClient() + + # Or with explicit configuration + client = SandboxClient( + api_endpoint="https://api.smith.langchain.com/v2/sandboxes", + api_key="your-api-key", + ) + + # Create a sandbox from a snapshot and run commands + with client.sandbox(snapshot_id="") as sandbox: + result = sandbox.run("python --version") + print(result.stdout) + """ + + def __init__( + self, + *, + api_endpoint: Optional[str] = None, + timeout: float = 10.0, + api_key: Optional[str] = None, + max_retries: int = 3, + headers: Optional[RequestHeaders] = None, + ): + """Initialize the SandboxClient. + + Args: + api_endpoint: Full URL of the sandbox API endpoint. If not provided, + derived from LANGSMITH_ENDPOINT environment variable. + timeout: Default HTTP timeout in seconds. + api_key: API key for authentication. If not provided, uses + LANGSMITH_API_KEY environment variable. + max_retries: Maximum number of retries for transient errors (502, 503, + 504), rate limits (429), and connection failures. Set to 0 + to disable retries. Default: 3. + """ + self._base_url = (api_endpoint or _get_default_api_endpoint()).rstrip("/") + resolved_api_key = api_key or _get_default_api_key() + self._api_key = resolved_api_key + client_headers: dict[str, str] = {} + if resolved_api_key: + client_headers["X-Api-Key"] = resolved_api_key + if headers: + client_headers = merge_headers(client_headers, headers) + transport = RetryTransport(max_retries=max_retries) + self._http = httpx.Client( + transport=transport, timeout=timeout, headers=client_headers + ) + + def _request_headers(self, headers: RequestHeaders) -> Optional[dict[str, str]]: + """Merge default client headers with per-request overrides.""" + if headers is None: + return None + return merge_headers(self._http.headers, headers) + + def close(self) -> None: + """Close the HTTP client.""" + self._http.close() + + def __del__(self) -> None: + """Close the HTTP client on garbage collection.""" + try: + if not self._http.is_closed: + self._http.close() + except Exception: + pass + + def __enter__(self) -> SandboxClient: + """Enter context manager.""" + return self + + def __exit__( + self, + exc_type: Optional[type], + exc_val: Optional[BaseException], + exc_tb: Optional[Any], + ) -> None: + """Exit context manager.""" + self.close() + + def __repr__(self) -> str: + """Return a string representation of the instance. + + Returns: + The string representation of the instance. + """ + return f"SandboxClient (API URL: {self._base_url})" + + # ======================================================================== + # Sandbox Operations + # ======================================================================== + + def sandbox( + self, + snapshot_id: Optional[str] = None, + *, + snapshot_name: Optional[str] = None, + name: Optional[str] = None, + timeout: int = 30, + idle_ttl_seconds: Optional[int] = None, + delete_after_stop_seconds: Optional[int] = None, + vcpus: Optional[int] = None, + mem_bytes: Optional[int] = None, + fs_capacity_bytes: Optional[int] = None, + proxy_config: Optional[dict[str, Any]] = None, + headers: RequestHeaders = None, + ) -> Sandbox: + """Create a sandbox and return a Sandbox instance. + + This is the primary method for creating sandboxes. Use it as a + context manager for automatic cleanup: + + with client.sandbox(snapshot_id="") as sandbox: + result = sandbox.run("echo hello") + + # Resolve by snapshot name instead of ID: + with client.sandbox(snapshot_name="my-snap") as sandbox: + result = sandbox.run("echo hello") + + The sandbox is automatically deleted when exiting the context manager. + For sandboxes with manual lifecycle management, use create_sandbox(). + + Args: + snapshot_id: Snapshot ID to boot from. Mutually exclusive with + ``snapshot_name``; exactly one must be provided. + snapshot_name: Snapshot name to boot from. Resolved server-side to a + snapshot owned by the caller's tenant. Mutually exclusive with + ``snapshot_id``; exactly one must be provided. + name: Optional sandbox name (auto-generated if not provided). + timeout: Timeout in seconds when waiting for ready. + idle_ttl_seconds: Idle timeout in seconds. The launcher + automatically stops the sandbox after this duration of + inactivity. Must be a multiple of 60. ``0`` explicitly + disables the idle stop. When omitted (``None``), the server + applies a default of ``600`` seconds (10 minutes). + delete_after_stop_seconds: Seconds after the sandbox enters the + ``stopped`` state before it (and its filesystem clone) are + permanently deleted. Must be a multiple of 60. ``0`` disables + stop-anchored deletion (manual cleanup required). When + omitted (``None``), the server applies its configured default. + vcpus: Number of vCPUs. + mem_bytes: Memory in bytes. + fs_capacity_bytes: Root filesystem capacity in bytes. + proxy_config: Per-sandbox proxy configuration forwarded to the + server as-is. Shape matches the backend `proxy_config` field: + ``{"rules": [...], "no_proxy": [...], "access_control": + {"allow_list": [...]}}`` or ``{"access_control": + {"deny_list": [...]}}``. Use ``access_control.allow_list`` to + restrict outbound HTTPS to a set of host patterns (exact + domains, globs like ``*.example.com``, IPs, CIDRs, or + ``~regex``). + + Returns: + Sandbox instance. + + Raises: + ResourceTimeoutError: If timeout waiting for sandbox to be ready. + ResourceCreationError: If sandbox creation fails. + SandboxClientError: For other errors. + ValueError: If TTL values are invalid, or if neither/both of + ``snapshot_id`` and ``snapshot_name`` are provided. + """ + sb = self.create_sandbox( + snapshot_id, + snapshot_name=snapshot_name, + name=name, + timeout=timeout, + idle_ttl_seconds=idle_ttl_seconds, + delete_after_stop_seconds=delete_after_stop_seconds, + vcpus=vcpus, + mem_bytes=mem_bytes, + fs_capacity_bytes=fs_capacity_bytes, + proxy_config=proxy_config, + headers=headers, + ) + sb._auto_delete = True + return sb + + def create_sandbox( + self, + snapshot_id: Optional[str] = None, + *, + snapshot_name: Optional[str] = None, + name: Optional[str] = None, + timeout: int = 30, + wait_for_ready: bool = True, + idle_ttl_seconds: Optional[int] = None, + delete_after_stop_seconds: Optional[int] = None, + vcpus: Optional[int] = None, + mem_bytes: Optional[int] = None, + fs_capacity_bytes: Optional[int] = None, + proxy_config: Optional[dict[str, Any]] = None, + headers: RequestHeaders = None, + ) -> Sandbox: + """Create a new Sandbox. + + The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup, + or use sandbox() for automatic cleanup with a context manager. + + Args: + snapshot_id: Snapshot ID to boot from. Mutually exclusive with + ``snapshot_name``; exactly one must be provided. + snapshot_name: Snapshot name to boot from. Resolved server-side to a + snapshot owned by the caller's tenant. Mutually exclusive with + ``snapshot_id``; exactly one must be provided. + name: Optional sandbox name (auto-generated if not provided). + timeout: Timeout in seconds when waiting for ready (only used when + wait_for_ready=True). + wait_for_ready: If True (default), block until sandbox is ready. + If False, return immediately with status "provisioning". Use + get_sandbox_status() or wait_for_sandbox() to poll for readiness. + idle_ttl_seconds: Idle timeout in seconds. The launcher + automatically stops the sandbox after this duration of + inactivity. Must be a multiple of 60. ``0`` explicitly + disables the idle stop. When omitted (``None``), the server + applies a default of ``600`` seconds (10 minutes). + delete_after_stop_seconds: Seconds after the sandbox enters the + ``stopped`` state before it (and its filesystem clone) are + permanently deleted. Must be a multiple of 60. ``0`` disables + stop-anchored deletion (manual cleanup required). When + omitted (``None``), the server applies its configured default. + vcpus: Number of vCPUs. + mem_bytes: Memory in bytes. + fs_capacity_bytes: Root filesystem capacity in bytes. + proxy_config: Per-sandbox proxy configuration forwarded to the + server as-is. Shape matches the backend `proxy_config` field: + ``{"rules": [...], "no_proxy": [...], "access_control": + {"allow_list": [...]}}`` or ``{"access_control": + {"deny_list": [...]}}``. Use ``access_control.allow_list`` to + restrict outbound HTTPS to a set of host patterns (exact + domains, globs like ``*.example.com``, IPs, CIDRs, or + ``~regex``). + + Returns: + Created Sandbox. When wait_for_ready=False, the sandbox will have + status="provisioning" and cannot be used for operations until ready. + + Raises: + ResourceTimeoutError: If timeout waiting for sandbox to be ready. + ResourceCreationError: If sandbox creation fails. + SandboxClientError: For other errors. + ValueError: If TTL values are invalid, or if neither/both of + ``snapshot_id`` and ``snapshot_name`` are provided. + """ + if bool(snapshot_id) == bool(snapshot_name): + raise ValueError("Exactly one of snapshot_id or snapshot_name must be set") + + validate_ttl(idle_ttl_seconds, "idle_ttl_seconds") + validate_ttl(delete_after_stop_seconds, "delete_after_stop_seconds") + + url = f"{self._base_url}/boxes" + + payload: dict[str, Any] = { + "wait_for_ready": wait_for_ready, + } + if snapshot_id: + payload["snapshot_id"] = snapshot_id + if snapshot_name: + payload["snapshot_name"] = snapshot_name + if wait_for_ready: + payload["timeout"] = timeout + if name: + payload["name"] = name + if idle_ttl_seconds is not None: + payload["idle_ttl_seconds"] = idle_ttl_seconds + if delete_after_stop_seconds is not None: + payload["delete_after_stop_seconds"] = delete_after_stop_seconds + if vcpus is not None: + payload["vcpus"] = vcpus + if mem_bytes is not None: + payload["mem_bytes"] = mem_bytes + if fs_capacity_bytes is not None: + payload["fs_capacity_bytes"] = fs_capacity_bytes + if proxy_config is not None: + payload["proxy_config"] = proxy_config + + http_timeout = (timeout + 30) if wait_for_ready else 30 + + try: + response = self._http.post( + url, + json=payload, + timeout=http_timeout, + headers=self._request_headers(headers), + ) + response.raise_for_status() + return Sandbox.from_dict(response.json(), client=self, auto_delete=False) + except httpx.HTTPStatusError as e: + handle_sandbox_creation_error(e) + raise # pragma: no cover + + def get_sandbox(self, name: str, *, headers: RequestHeaders = None) -> Sandbox: + """Get a Sandbox by name. + + The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup. + + Args: + name: Sandbox name. + + Returns: + Sandbox. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}" + + try: + response = self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + return Sandbox.from_dict(response.json(), client=self, auto_delete=False) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def list_sandboxes(self, *, headers: RequestHeaders = None) -> list[Sandbox]: + """List all Sandboxes. + + Returns: + List of Sandboxes. + """ + url = f"{self._base_url}/boxes" + + try: + response = self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + data = response.json() + return [ + Sandbox.from_dict(c, client=self, auto_delete=False) + for c in data.get("sandboxes", []) + ] + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise SandboxAPIError( + f"API endpoint not found: {url}. " + f"Check that api_endpoint is correct." + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def update_sandbox( + self, + name: str, + *, + new_name: Optional[str] = None, + idle_ttl_seconds: Optional[int] = None, + delete_after_stop_seconds: Optional[int] = None, + headers: RequestHeaders = None, + ) -> Sandbox: + """Update a sandbox's properties. + + Args: + name: Current sandbox name. + new_name: New display name. + idle_ttl_seconds: Idle timeout in seconds. Must be a multiple of + 60. ``0`` disables idle-stop. ``None`` leaves the existing + value unchanged. + delete_after_stop_seconds: Seconds after entering ``stopped`` + before deletion. Must be a multiple of 60. ``0`` disables + stop-anchored deletion. ``None`` leaves the existing value + unchanged. + + Returns: + Updated Sandbox. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceNameConflictError: If new_name is already in use. + SandboxClientError: For other errors. + ValueError: If TTL values are invalid. + """ + validate_ttl(idle_ttl_seconds, "idle_ttl_seconds") + validate_ttl(delete_after_stop_seconds, "delete_after_stop_seconds") + + url = f"{self._base_url}/boxes/{name}" + payload: dict[str, Any] = {} + if new_name is not None: + payload["name"] = new_name + if idle_ttl_seconds is not None: + payload["idle_ttl_seconds"] = idle_ttl_seconds + if delete_after_stop_seconds is not None: + payload["delete_after_stop_seconds"] = delete_after_stop_seconds + + try: + response = self._http.patch( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + return Sandbox.from_dict(response.json(), client=self, auto_delete=False) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + if e.response.status_code == 409: + raise ResourceNameConflictError( + f"Sandbox name '{new_name}' already in use", + resource_type="sandbox", + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def delete_sandbox(self, name: str, *, headers: RequestHeaders = None) -> None: + """Delete a Sandbox. + + Args: + name: Sandbox name. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}" + + try: + response = self._http.delete(url, headers=self._request_headers(headers)) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + + def get_sandbox_status( + self, name: str, *, headers: RequestHeaders = None + ) -> ResourceStatus: + """Get the provisioning status of a sandbox. + + This is a lightweight endpoint designed for high-frequency polling + during sandbox provisioning. It returns only the status fields + without full sandbox data. + + Args: + name: Sandbox name. + + Returns: + ResourceStatus with status and status_message. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}/status" + + try: + response = self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + return ResourceStatus.from_dict(response.json()) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def service( + self, + name: str, + port: int, + *, + expires_in_seconds: int = 600, + headers: RequestHeaders = None, + ) -> ServiceURL: + """Get an authenticated URL for a service running inside a sandbox. + + Returns a :class:`ServiceURL` whose properties auto-refresh the + token transparently before it expires. The object also provides + HTTP helper methods (``.get``, ``.post``, etc.) that inject the + authentication header automatically. + + Args: + name: Sandbox name. + port: Port the service is listening on inside the sandbox. + expires_in_seconds: Token TTL in seconds (1--86400, default 600). + headers: Optional per-request header overrides. + + Returns: + ServiceURL with auto-refreshing token and HTTP helpers. + + Raises: + ResourceNotFoundError: If sandbox not found. + ValueError: If port or expires_in_seconds is out of range. + SandboxClientError: For other errors. + """ + validate_service_params(port, expires_in_seconds) + url = f"{self._base_url}/boxes/{name}/service-url" + payload = {"port": port, "expires_in_seconds": expires_in_seconds} + + def _refresher() -> ServiceURL: + return self.service( + name, + port, + expires_in_seconds=expires_in_seconds, + headers=headers, + ) + + try: + response = self._http.post( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + return ServiceURL.from_dict(response.json(), _refresher=_refresher) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def wait_for_sandbox( + self, + name: str, + *, + timeout: int = 120, + poll_interval: float = 1.0, + headers: RequestHeaders = None, + ) -> Sandbox: + """Poll until a sandbox reaches "ready" or "failed" status. + + Uses the lightweight status endpoint for polling, then fetches the + full sandbox data once ready. + + Args: + name: Sandbox name. + timeout: Maximum time to wait in seconds. + poll_interval: Time between status checks in seconds. + + Returns: + Sandbox in "ready" status. + + Raises: + ResourceCreationError: If sandbox status becomes "failed". + ResourceTimeoutError: If timeout expires while still "provisioning". + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + import time + + deadline = time.monotonic() + timeout + while True: + status = self.get_sandbox_status(name, headers=headers) + if status.status == "ready": + return self.get_sandbox(name, headers=headers) + if status.status == "failed": + raise ResourceCreationError( + status.status_message or "Sandbox provisioning failed", + resource_type="sandbox", + ) + remaining = deadline - time.monotonic() + if remaining <= 0: + raise ResourceTimeoutError( + f"Sandbox '{name}' not ready after {timeout}s", + resource_type="sandbox", + last_status=status.status, + ) + time.sleep(min(poll_interval, remaining)) + + def start_sandbox( + self, + name: str, + *, + timeout: int = 120, + headers: RequestHeaders = None, + ) -> Sandbox: + """Start a stopped sandbox and wait until ready. + + Args: + name: Sandbox name. + timeout: Timeout in seconds when waiting for ready. + + Returns: + Sandbox in "ready" status. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceCreationError: If sandbox fails during startup. + ResourceTimeoutError: If sandbox doesn't become ready within timeout. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}/start" + + try: + response = self._http.post( + url, json={}, headers=self._request_headers(headers) + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + + return self.wait_for_sandbox(name, timeout=timeout, headers=headers) + + def stop_sandbox(self, name: str, *, headers: RequestHeaders = None) -> None: + """Stop a running sandbox (preserves sandbox files for later restart). + + Args: + name: Sandbox name. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{name}/stop" + + try: + response = self._http.post( + url, json={}, headers=self._request_headers(headers) + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + + # ======================================================================== + # Snapshot Operations + # ======================================================================== + + def create_snapshot( + self, + name: str, + docker_image: str, + fs_capacity_bytes: int, + *, + registry_id: Optional[str] = None, + registry_url: Optional[str] = None, + registry_username: Optional[str] = None, + registry_password: Optional[str] = None, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> Snapshot: + """Build a snapshot from a Docker image. + + Blocks until the snapshot is ready (polls with 2s interval). + + Args: + name: Snapshot name. + docker_image: Docker image to build from (e.g., "python:3.12-slim"). + fs_capacity_bytes: Filesystem capacity in bytes. + registry_id: Private registry ID (alternative to URL/credentials). + registry_url: Registry URL for private images. + registry_username: Registry username. + registry_password: Registry password. + timeout: Timeout in seconds when waiting for ready. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceTimeoutError: If snapshot doesn't become ready within timeout. + ResourceCreationError: If snapshot build fails. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/snapshots" + + payload: dict[str, Any] = { + "name": name, + "docker_image": docker_image, + "fs_capacity_bytes": fs_capacity_bytes, + } + if registry_id is not None: + payload["registry_id"] = registry_id + if registry_url is not None: + payload["registry_url"] = registry_url + if registry_username is not None: + payload["registry_username"] = registry_username + if registry_password is not None: + payload["registry_password"] = registry_password + + try: + response = self._http.post( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + snapshot = Snapshot.from_dict(response.json()) + except httpx.HTTPStatusError as e: + handle_client_http_error(e) + raise # pragma: no cover + + return self.wait_for_snapshot(snapshot.id, timeout=timeout, headers=headers) + + def capture_snapshot( + self, + sandbox_name: str, + name: str, + *, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> Snapshot: + """Capture a snapshot from a running sandbox. + + Blocks until the snapshot is ready (polls with 2s interval). + + Args: + sandbox_name: Name of the sandbox to capture from. + name: Snapshot name. + timeout: Timeout in seconds when waiting for ready. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceTimeoutError: If snapshot doesn't become ready within timeout. + ResourceCreationError: If snapshot capture fails. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/boxes/{sandbox_name}/snapshot" + + payload: dict[str, Any] = {"name": name} + + try: + response = self._http.post( + url, json=payload, headers=self._request_headers(headers) + ) + response.raise_for_status() + snapshot = Snapshot.from_dict(response.json()) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Sandbox '{sandbox_name}' not found", resource_type="sandbox" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + return self.wait_for_snapshot(snapshot.id, timeout=timeout, headers=headers) + + def get_snapshot( + self, snapshot_id: str, *, headers: RequestHeaders = None + ) -> Snapshot: + """Get a snapshot by ID. + + Args: + snapshot_id: Snapshot UUID. + + Returns: + Snapshot. + + Raises: + ResourceNotFoundError: If snapshot not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/snapshots/{snapshot_id}" + + try: + response = self._http.get(url, headers=self._request_headers(headers)) + response.raise_for_status() + return Snapshot.from_dict(response.json()) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Snapshot '{snapshot_id}' not found", resource_type="snapshot" + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def list_snapshots( + self, + *, + name_contains: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + headers: RequestHeaders = None, + ) -> list[Snapshot]: + """List snapshots. + + The backend always paginates this endpoint. When ``limit`` is omitted + the server applies a default page size (currently 50), so a single + call is not guaranteed to return every snapshot. To iterate through + all results, repeat the call with increasing ``offset`` values (or an + explicit ``limit``) until fewer than ``limit`` snapshots come back. + + Args: + name_contains: Optional case-insensitive substring filter applied + to snapshot names server-side. + limit: Optional maximum number of snapshots to return for a single + request. Must be between 1 and 500 (inclusive); the server + rejects values outside that range. Defaults to 50 server-side + when omitted. + offset: Optional number of snapshots to skip before returning + results. Must be ``>= 0``. Useful for paginating through + large result sets in combination with ``limit``. + + Returns: + A single page of Snapshots matching the provided filters. + """ + url = f"{self._base_url}/snapshots" + + params: dict[str, Any] = {} + if name_contains is not None: + params["name_contains"] = name_contains + if limit is not None: + params["limit"] = limit + if offset is not None: + params["offset"] = offset + + try: + response = self._http.get( + url, + params=params or None, + headers=self._request_headers(headers), + ) + response.raise_for_status() + data = response.json() + return [Snapshot.from_dict(s) for s in data.get("snapshots", [])] + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise SandboxAPIError( + f"API endpoint not found: {url}. " + f"Check that api_endpoint is correct." + ) from e + handle_client_http_error(e) + raise # pragma: no cover + + def delete_snapshot( + self, snapshot_id: str, *, headers: RequestHeaders = None + ) -> None: + """Delete a snapshot. + + Args: + snapshot_id: Snapshot UUID. + + Raises: + ResourceNotFoundError: If snapshot not found. + SandboxClientError: For other errors. + """ + url = f"{self._base_url}/snapshots/{snapshot_id}" + + try: + response = self._http.delete(url, headers=self._request_headers(headers)) + response.raise_for_status() + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"Snapshot '{snapshot_id}' not found", resource_type="snapshot" + ) from e + handle_client_http_error(e) + + def wait_for_snapshot( + self, + snapshot_id: str, + *, + timeout: int = 300, + poll_interval: float = 2.0, + headers: RequestHeaders = None, + ) -> Snapshot: + """Poll until a snapshot reaches "ready" or "failed" status. + + Args: + snapshot_id: Snapshot UUID. + timeout: Maximum time to wait in seconds. + poll_interval: Time between status checks in seconds. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceCreationError: If snapshot status becomes "failed". + ResourceTimeoutError: If timeout expires. + ResourceNotFoundError: If snapshot not found. + SandboxClientError: For other errors. + """ + import time + + deadline = time.monotonic() + timeout + while True: + snapshot = self.get_snapshot(snapshot_id, headers=headers) + if snapshot.status == "ready": + return snapshot + if snapshot.status == "failed": + raise ResourceCreationError( + snapshot.status_message or "Snapshot build failed", + resource_type="snapshot", + ) + remaining = deadline - time.monotonic() + if remaining <= 0: + raise ResourceTimeoutError( + f"Snapshot '{snapshot_id}' not ready after {timeout}s", + resource_type="snapshot", + last_status=snapshot.status, + ) + time.sleep(min(poll_interval, remaining)) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_exceptions.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..3848e1540240fcc3340e0d6446c3bb8184755636 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_exceptions.py @@ -0,0 +1,328 @@ +"""Custom exceptions for the sandbox client. + +All sandbox exceptions extend LangSmithError for unified error handling. +The exceptions are organized by error type rather than resource type, +with a resource_type attribute for specific handling when needed. +""" + +from __future__ import annotations + +from typing import Optional + +from langsmith.utils import LangSmithError + + +class SandboxClientError(LangSmithError): + """Base exception for sandbox client errors.""" + + pass + + +# ============================================================================= +# Connection and Authentication Errors +# ============================================================================= + + +class SandboxAPIError(SandboxClientError): + """Raised when the API endpoint returns an unexpected error. + + For example, this is raised for wrong URL or path. + """ + + pass + + +class SandboxAuthenticationError(SandboxClientError): + """Raised when authentication fails (invalid or missing API key).""" + + pass + + +class SandboxConnectionError(SandboxClientError): + """Raised when connection to the sandbox server fails.""" + + pass + + +class SandboxServerReloadError(SandboxConnectionError): + """Raised when the server sends a 1001 Going Away close frame. + + This indicates a server hot-reload, not a true connection failure. + The command is still running on the server. + + This is a subclass of SandboxConnectionError, so the auto-reconnect + logic in CommandHandle catches it along with all other + connection errors. The distinction matters for retry strategy: + SandboxServerReloadError triggers immediate reconnect (no backoff), + while other SandboxConnectionError triggers exponential backoff. + + Users typically never see this exception โ€” it's handled internally. + """ + + pass + + +# ============================================================================= +# Resource Errors (type-based, with resource_type attribute) +# ============================================================================= + + +class ResourceNotFoundError(SandboxClientError): + """Raised when a resource is not found. + + Attributes: + resource_type: Type of resource (sandbox, snapshot, file). + """ + + def __init__(self, message: str, resource_type: Optional[str] = None): + """Initialize the error.""" + super().__init__(message) + self.resource_type = resource_type + + +class ResourceTimeoutError(SandboxClientError): + """Raised when an operation times out. + + Attributes: + resource_type: Type of resource (sandbox, snapshot). + last_status: The last known status before timeout (for sandboxes). + """ + + def __init__( + self, + message: str, + resource_type: Optional[str] = None, + last_status: Optional[str] = None, + ): + """Initialize the error.""" + super().__init__(message) + self.resource_type = resource_type + self.last_status = last_status + + def __str__(self) -> str: + """Return string representation.""" + base = super().__str__() + if self.last_status: + return f"{base} (last_status: {self.last_status})" + return base + + +class ResourceInUseError(SandboxClientError): + """Raised when deleting a resource that is still in use. + + Attributes: + resource_type: Type of resource (snapshot). + """ + + def __init__(self, message: str, resource_type: Optional[str] = None): + """Initialize the error.""" + super().__init__(message) + self.resource_type = resource_type + + +class ResourceAlreadyExistsError(SandboxClientError): + """Raised when creating a resource that already exists. + + Attributes: + resource_type: Type of resource (e.g., snapshot). + """ + + def __init__(self, message: str, resource_type: Optional[str] = None): + """Initialize the error.""" + super().__init__(message) + self.resource_type = resource_type + + +class ResourceNameConflictError(SandboxClientError): + """Raised when updating a resource name to one that already exists. + + Attributes: + resource_type: Type of resource (sandbox, snapshot). + """ + + def __init__(self, message: str, resource_type: Optional[str] = None): + """Initialize the error.""" + super().__init__(message) + self.resource_type = resource_type + + +# ============================================================================= +# Validation and Quota Errors +# ============================================================================= + + +class ValidationError(SandboxClientError): + """Raised when request validation fails. + + This includes: + - Resource values exceeding server-defined limits (CPU, memory, storage) + - Invalid resource units + - Invalid name formats + + Attributes: + field: The field that failed validation (e.g., "cpu", "memory"). + details: List of validation error details from the API. + error_type: Machine-readable error type from the API. + """ + + def __init__( + self, + message: str, + field: Optional[str] = None, + details: Optional[list[dict]] = None, + error_type: Optional[str] = None, + ): + """Initialize the error.""" + super().__init__(message) + self.field = field + self.details = details or [] + self.error_type = error_type + + +class QuotaExceededError(SandboxClientError): + """Raised when organization quota limits are exceeded. + + Users should contact support@langchain.dev to increase quotas. + + Attributes: + quota_type: Type of quota exceeded (e.g., "sandbox_count", "cpu"). + """ + + def __init__(self, message: str, quota_type: Optional[str] = None): + """Initialize the error.""" + super().__init__(message) + self.quota_type = quota_type + + +# ============================================================================= +# Resource Creation Errors +# ============================================================================= + + +class ResourceCreationError(SandboxClientError): + """Raised when resource provisioning fails. + + Attributes: + resource_type: Type of resource (sandbox, snapshot). + error_type: Machine-readable error type (ImagePull, CrashLoop, + SandboxConfig, Unschedulable). + """ + + def __init__( + self, + message: str, + resource_type: Optional[str] = None, + error_type: Optional[str] = None, + ): + """Initialize the error.""" + super().__init__(message) + self.resource_type = resource_type + self.error_type = error_type + + def __str__(self) -> str: + """Return string representation.""" + if self.error_type: + return f"{super().__str__()} [{self.error_type}]" + return super().__str__() + + +# ============================================================================= +# Sandbox Operation Errors (runtime errors during sandbox interaction) +# ============================================================================= + + +class DataplaneNotConfiguredError(SandboxClientError): + """Raised when dataplane_url is not available for the sandbox. + + This occurs when the sandbox-router URL is not configured for the cluster. + """ + + pass + + +class SandboxNotReadyError(SandboxClientError): + """Raised when attempting to interact with a sandbox that is not ready.""" + + pass + + +class SandboxOperationError(SandboxClientError): + """Raised when a sandbox operation fails (run, read, write). + + Attributes: + operation: The operation that failed (command, read, write). + error_type: Machine-readable error type from the API. + """ + + def __init__( + self, + message: str, + operation: Optional[str] = None, + error_type: Optional[str] = None, + ): + """Initialize the error.""" + super().__init__(message) + self.operation = operation + self.error_type = error_type + + def __str__(self) -> str: + """Return string representation.""" + if self.error_type: + return f"{super().__str__()} [{self.error_type}]" + return super().__str__() + + +class CommandTimeoutError(SandboxOperationError): + """Raised when a command exceeds its timeout. + + Attributes: + timeout: The timeout value in seconds that was exceeded. + """ + + def __init__(self, message: str, timeout: Optional[int] = None): + """Initialize the error.""" + super().__init__(message, operation="command", error_type="CommandTimeout") + self.timeout = timeout + + +# ======================================================================== +# Tunnel Errors +# ======================================================================== + + +class TunnelError(SandboxClientError): + """Base exception for TCP tunnel errors.""" + + pass + + +class TunnelPortNotAllowedError(TunnelError): + """The daemon rejected the port as not allowed. + + Attributes: + port: The port that was rejected. + """ + + def __init__(self, message: str, *, port: int): + """Initialize the error.""" + super().__init__(message) + self.port = port + + +class TunnelConnectionRefusedError(TunnelError): + """Nothing is listening on the target port inside the sandbox. + + Attributes: + port: The port that could not be reached. + """ + + def __init__(self, message: str, *, port: int): + """Initialize the error.""" + super().__init__(message) + self.port = port + + +class TunnelUnsupportedVersionError(TunnelError): + """Protocol version mismatch between the tunnel client and the daemon.""" + + pass diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_helpers.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..e7b2af173cf1c7ab1b2ed1ee620584187031bea1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_helpers.py @@ -0,0 +1,350 @@ +"""Shared helper functions for error handling. + +These functions are used by both sync and async clients to parse error responses +and raise appropriate exceptions. They contain no I/O operations. +""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Optional + +import httpx + +from langsmith.sandbox._exceptions import ( + QuotaExceededError, + ResourceCreationError, + ResourceNotFoundError, + ResourceTimeoutError, + SandboxAPIError, + SandboxAuthenticationError, + SandboxClientError, + SandboxConnectionError, + SandboxNotReadyError, + SandboxOperationError, + ValidationError, +) + +# ============================================================================= +# Header Utilities +# ============================================================================= + + +def merge_headers( + base_headers: Optional[Mapping[str, str]] = None, + override_headers: Optional[Mapping[str, str]] = None, +) -> dict[str, str]: + """Merge request headers, giving precedence to overrides.""" + merged: dict[str, str] = dict(base_headers or {}) + if override_headers: + merged.update(override_headers) + return merged + + +# ============================================================================= +# Input Validation +# ============================================================================= + + +def validate_service_params(port: int, expires_in_seconds: int) -> None: + """Validate parameters for service URL generation. + + Args: + port: Target port inside the sandbox. + expires_in_seconds: Token TTL. + + Raises: + ValueError: If port or TTL is out of range. + """ + if not isinstance(port, int) or port <= 0: + raise ValueError(f"port must be a positive integer, got {port!r}") + if not isinstance(expires_in_seconds, int) or not ( + 1 <= expires_in_seconds <= 86400 + ): + raise ValueError( + f"expires_in_seconds must be between 1 and 86400, " + f"got {expires_in_seconds!r}" + ) + + +def validate_ttl(value: Optional[int], name: str) -> None: + """Validate a TTL value for sandbox create/update. + + Args: + value: TTL in seconds (None means unset, 0 disables). + name: Parameter name for error messages. + + Raises: + ValueError: If value is negative or not a multiple of 60. + """ + if value is None: + return + if value < 0: + raise ValueError(f"{name} must be >= 0, got {value}") + if value != 0 and value % 60 != 0: + raise ValueError(f"{name} must be a multiple of 60 seconds, got {value}") + + +# ============================================================================= +# Error Response Parsing +# ============================================================================= + + +def parse_error_response(error: httpx.HTTPStatusError) -> dict[str, Any]: + """Parse standardized error response. + + Expected format: {"detail": {"error": "...", "message": "..."}} + + Returns a dict with: + - error_type: The error type (e.g., "ImagePull", "CrashLoop") + - message: Human-readable error message + """ + try: + data = error.response.json() + detail = data.get("detail") + + # Standardized format: {"detail": {"error": "...", "message": "..."}} + if isinstance(detail, dict): + return { + "error_type": detail.get("error"), + "message": detail.get("message", str(error)), + } + + # Pydantic validation error format: {"detail": [{"loc": [...], "msg": "..."}]} + if isinstance(detail, list) and detail: + messages = [d.get("msg", str(d)) for d in detail if isinstance(d, dict)] + return { + "error_type": None, + "message": "; ".join(messages) if messages else str(error), + } + + # Fallback for plain string detail + return {"error_type": None, "message": detail or str(error)} + except Exception: + return {"error_type": None, "message": str(error)} + + +def parse_error_response_simple(error: httpx.HTTPStatusError) -> dict[str, Any]: + """Parse error response (simplified version for sandbox operations). + + Returns a dict with: + - error_type: The error type + - message: Human-readable error message + """ + try: + data = error.response.json() + detail = data.get("detail") + + if isinstance(detail, dict): + return { + "error_type": detail.get("error"), + "message": detail.get("message", str(error)), + } + + return {"error_type": None, "message": detail or str(error)} + except Exception: + return {"error_type": None, "message": str(error)} + + +def parse_validation_error(error: httpx.HTTPStatusError) -> list[dict]: + """Parse Pydantic validation error response. + + Returns a list of validation error details, each containing: + - loc: Location of the error (e.g., ["body", "resources", "cpu"]) + - msg: Human-readable error message + - type: Error type (e.g., "value_error") + """ + try: + data = error.response.json() + detail = data.get("detail", []) + if isinstance(detail, list): + return detail + return [] + except Exception: + return [] + + +def extract_quota_type(message: str) -> Optional[str]: + """Extract quota type from error message. + + Returns one of: "sandbox_count", "cpu", "memory", "storage", or None. + """ + message_lower = message.lower() + # Check for sandbox count quota + if "sandbox" in message_lower and ( + "count" in message_lower or "limit" in message_lower + ): + return "sandbox_count" + elif "cpu" in message_lower: + return "cpu" + elif "memory" in message_lower: + return "memory" + elif "storage" in message_lower: + return "storage" + return None + + +# ============================================================================= +# Client Error Handlers +# ============================================================================= + + +def raise_creation_error( + data: dict[str, Any], + error: httpx.HTTPStatusError, + resource_type: str = "sandbox", +) -> None: + """Raise ResourceCreationError with the error_type from the API response. + + The error_type indicates the specific failure reason: + - ImagePull: Image pull failed + - CrashLoop: Container crashed during startup + - SandboxConfig: Configuration error + - Unschedulable: Cannot be scheduled + """ + raise ResourceCreationError( + data.get("message", f"{resource_type.title()} creation failed"), + resource_type=resource_type, + error_type=data.get("error_type"), + ) from error + + +def handle_sandbox_creation_error(error: httpx.HTTPStatusError) -> None: + """Handle HTTP errors specific to sandbox creation. + + Maps API error responses to specific exception types: + - 408: ResourceTimeoutError (sandbox didn't become ready in time) + - 422: ValidationError (bad input) or ResourceCreationError (runtime) + - 429: QuotaExceededError (org limits exceeded) + - 503: ResourceCreationError (no resources available) + - Other: Falls through to generic error handling + """ + status = error.response.status_code + data = parse_error_response(error) + + if status == 408: + # Timeout - include the message which contains last known status + raise ResourceTimeoutError(data["message"], resource_type="sandbox") from error + elif status == 422: + # Check if this is a Pydantic validation error (bad input) vs creation error + details = parse_validation_error(error) + if details and any(d.get("type") == "value_error" for d in details): + # Pydantic validation error (bad input - exceeds server limits) + field = details[0].get("loc", [None])[-1] if details else None + raise ValidationError( + message=data["message"], + field=field, + details=details, + ) from error + else: + # Sandbox creation failed (runtime error like image pull failure) + raise_creation_error(data, error) + elif status == 429: + # Organization quota exceeded + quota_type = extract_quota_type(data["message"]) + raise QuotaExceededError( + message=data["message"], + quota_type=quota_type, + ) from error + elif status == 503: + # Service Unavailable - scheduling failed + raise ResourceCreationError( + data["message"], + resource_type="sandbox", + error_type=data.get("error_type") or "Unschedulable", + ) from error + else: + # Fall through to generic handling + handle_client_http_error(error) + + +def handle_client_http_error(error: httpx.HTTPStatusError) -> None: + """Handle HTTP errors and raise appropriate exceptions (for client operations).""" + data = parse_error_response(error) + message = data["message"] + error_type = data.get("error_type") + status = error.response.status_code + + if status in (401, 403): + raise SandboxAuthenticationError(message) from error + if status == 404: + raise ResourceNotFoundError(message) from error + + # Handle validation errors (invalid resource values, formats, etc.) + if status == 422: + details = parse_validation_error(error) + field = details[0].get("loc", [None])[-1] if details else None + raise ValidationError( + message=message, + field=field, + details=details, + ) from error + + # Handle quota exceeded errors (org limits) + if status == 429: + quota_type = extract_quota_type(message) + raise QuotaExceededError( + message=message, + quota_type=quota_type, + ) from error + + if status == 502 and error_type == "ConnectionError": + raise SandboxConnectionError(message) from error + if status == 500: + raise SandboxAPIError(message) from error + raise SandboxClientError(message) from error + + +# ============================================================================= +# Sandbox Operation Error Handlers +# ============================================================================= + + +def handle_sandbox_http_error(error: httpx.HTTPStatusError) -> None: + """Handle HTTP errors for sandbox operations (run, read, write). + + Maps API error types to specific exceptions: + - WriteError -> SandboxOperationError (operation="write") + - ReadError -> SandboxOperationError (operation="read") + - CommandError -> SandboxOperationError (operation="command") + - ConnectionError (502) -> SandboxConnectionError + - FileNotFound / 404 -> ResourceNotFoundError (resource_type="file") + - NotReady (400) -> SandboxNotReadyError + - 403 -> SandboxOperationError (permission denied) + """ + data = parse_error_response_simple(error) + message = data["message"] + error_type = data.get("error_type") + status = error.response.status_code + + # Operation-specific errors (from sandbox runtime) + if error_type == "WriteError": + raise SandboxOperationError( + message, operation="write", error_type=error_type + ) from error + if error_type == "ReadError": + raise SandboxOperationError( + message, operation="read", error_type=error_type + ) from error + if error_type == "CommandError": + raise SandboxOperationError( + message, operation="command", error_type=error_type + ) from error + + # Permission denied + if status == 403: + raise SandboxOperationError( + message, operation=None, error_type="PermissionDenied" + ) from error + + # Connection to sandbox failed + if status == 502 and error_type == "ConnectionError": + raise SandboxConnectionError(message) from error + + # Not ready / not found + if status == 400 and error_type == "NotReady": + raise SandboxNotReadyError(message) from error + if status == 404 or error_type == "FileNotFound": + raise ResourceNotFoundError(message, resource_type="file") from error + + raise SandboxClientError(message) from error diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_models.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_models.py new file mode 100644 index 0000000000000000000000000000000000000000..be06fa3c2f072f962a5e7dee4c0cc3ceccad591e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_models.py @@ -0,0 +1,918 @@ +"""Data models for the sandbox client.""" + +from __future__ import annotations + +from collections.abc import AsyncIterator, Awaitable, Callable, Iterator +from dataclasses import dataclass +from datetime import datetime, timezone +from typing import TYPE_CHECKING, Any, Optional + +import httpx + +from langsmith.sandbox._exceptions import ( + SandboxConnectionError, + SandboxOperationError, + SandboxServerReloadError, +) + +if TYPE_CHECKING: + from langsmith.sandbox._async_sandbox import AsyncSandbox + from langsmith.sandbox._sandbox import Sandbox + from langsmith.sandbox._ws_execute import ( + _AsyncWSStreamControl, + _WSStreamControl, + ) + + +@dataclass +class ExecutionResult: + """Result of executing a command in a sandbox.""" + + stdout: str + stderr: str + exit_code: int + + @property + def success(self) -> bool: + """Return True if the command exited with code 0.""" + return self.exit_code == 0 + + +@dataclass +class ResourceStatus: + """Lightweight provisioning status for any async-created resource. + + Attributes: + status: Resource lifecycle status. One of "provisioning", "ready", "failed". + status_message: Human-readable details when status is "failed", None otherwise. + """ + + status: str + status_message: Optional[str] = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> ResourceStatus: + """Create a ResourceStatus from API response dict.""" + return cls( + status=data.get("status", "provisioning"), + status_message=data.get("status_message"), + ) + + +@dataclass +class Snapshot: + """Represents a sandbox snapshot. + + Snapshots are built from Docker images or captured from running sandboxes. + They are used to create new sandboxes. + + Attributes: + id: Unique identifier (UUID). + name: Display name. + status: Build status. One of "building", "ready", "failed". + fs_capacity_bytes: Filesystem capacity in bytes. + docker_image: Source Docker image (for build snapshots). + image_digest: Docker image digest after pull. + source_sandbox_id: Source sandbox (for capture snapshots). + status_message: Human-readable details when status is "failed". + fs_used_bytes: Actual bytes used on the filesystem. + created_by: User or service that created the snapshot. + registry_id: Private registry ID, if applicable. + created_at: Timestamp when the snapshot was created. + updated_at: Timestamp when the snapshot was last updated. + """ + + id: str + name: str + status: str + fs_capacity_bytes: int + docker_image: Optional[str] = None + image_digest: Optional[str] = None + source_sandbox_id: Optional[str] = None + status_message: Optional[str] = None + fs_used_bytes: Optional[int] = None + created_by: Optional[str] = None + registry_id: Optional[str] = None + created_at: Optional[str] = None + updated_at: Optional[str] = None + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> Snapshot: + """Create a Snapshot from API response dict.""" + return cls( + id=data.get("id", ""), + name=data.get("name", ""), + status=data.get("status", "building"), + fs_capacity_bytes=data.get("fs_capacity_bytes", 0), + docker_image=data.get("docker_image"), + image_digest=data.get("image_digest"), + source_sandbox_id=data.get("source_sandbox_id"), + status_message=data.get("status_message"), + fs_used_bytes=data.get("fs_used_bytes"), + created_by=data.get("created_by"), + registry_id=data.get("registry_id"), + created_at=data.get("created_at"), + updated_at=data.get("updated_at"), + ) + + +# ============================================================================= +# Service URL Models +# ============================================================================= + +_AUTH_HEADER = "X-Langsmith-Sandbox-Service-Token" +_REFRESH_MARGIN_SECONDS = 30 + + +class ServiceURL: + """Authenticated URL for accessing an HTTP service running in a sandbox. + + Properties auto-refresh the token transparently when it nears expiry. + HTTP helper methods (``.get``, ``.post``, etc.) inject the auth header + automatically. + + When constructed by :meth:`SandboxClient.service` or + :meth:`Sandbox.service`, the object holds an internal refresher that + re-calls the API to obtain a fresh token before the current one expires. + + Example:: + + svc = sb.service(port=3000) + + resp = svc.get("/api/data") # token injected + auto-refreshed + print(svc.browser_url) # always-fresh URL + """ + + def __init__( + self, + browser_url: str, + service_url: str, + token: str, + expires_at: str, + *, + _refresher: Optional[Callable[[], ServiceURL]] = None, + ) -> None: + self._browser_url = browser_url + self._service_url = service_url + self._token = token + self._expires_at = expires_at + self._refresher = _refresher + + # -- Auto-refresh logic ------------------------------------------------- + + def _should_refresh(self) -> bool: + if self._refresher is None: + return False + raw = self._expires_at.replace("Z", "+00:00") + expires = datetime.fromisoformat(raw) + if expires.tzinfo is None: + expires = expires.replace(tzinfo=timezone.utc) + remaining = (expires - datetime.now(timezone.utc)).total_seconds() + return remaining <= _REFRESH_MARGIN_SECONDS + + def _maybe_refresh(self) -> None: + if self._should_refresh(): + fresh = self._refresher() # type: ignore[misc] + self._browser_url = fresh._browser_url + self._service_url = fresh._service_url + self._token = fresh._token + self._expires_at = fresh._expires_at + + # -- Properties (auto-refresh on access) -------------------------------- + + @property + def token(self) -> str: + """Return the raw JWT, refreshing if near expiry.""" + self._maybe_refresh() + return self._token + + @property + def service_url(self) -> str: + """Return the base URL, refreshing if near expiry.""" + self._maybe_refresh() + return self._service_url + + @property + def browser_url(self) -> str: + """Return the browser auth URL, refreshing if near expiry.""" + self._maybe_refresh() + return self._browser_url + + @property + def expires_at(self) -> str: + """Return the ISO 8601 expiration, refreshing if near expiry.""" + self._maybe_refresh() + return self._expires_at + + # -- HTTP helpers (stateless, one httpx call per request) ---------------- + + def request(self, method: str, path: str = "/", **kwargs: Any) -> httpx.Response: + """Make an HTTP request to the service, injecting the auth header. + + Args: + method: HTTP method (GET, POST, etc.). + path: Path relative to the service URL. + **kwargs: Forwarded to ``httpx.request``. + + Returns: + httpx.Response. + """ + url = self.service_url.rstrip("/") + "/" + path.lstrip("/") + headers = dict(kwargs.pop("headers", None) or {}) + headers[_AUTH_HEADER] = self.token + return httpx.request(method, url, headers=headers, **kwargs) + + def get(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """HTTP GET to the service.""" + return self.request("GET", path, **kwargs) + + def post(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """HTTP POST to the service.""" + return self.request("POST", path, **kwargs) + + def put(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """HTTP PUT to the service.""" + return self.request("PUT", path, **kwargs) + + def patch(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """HTTP PATCH to the service.""" + return self.request("PATCH", path, **kwargs) + + def delete(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """HTTP DELETE to the service.""" + return self.request("DELETE", path, **kwargs) + + # -- Construction ------------------------------------------------------- + + @classmethod + def from_dict( + cls, + data: dict[str, Any], + *, + _refresher: Optional[Callable[[], ServiceURL]] = None, + ) -> ServiceURL: + """Create a ServiceURL from API response dict.""" + return cls( + browser_url=data["browser_url"], + service_url=data["service_url"], + token=data["token"], + expires_at=data["expires_at"], + _refresher=_refresher, + ) + + def __repr__(self) -> str: + return ( + f"ServiceURL(service_url={self._service_url!r}, " + f"expires_at={self._expires_at!r})" + ) + + +class AsyncServiceURL: + """Async variant of :class:`ServiceURL` with auto-refreshing token. + + Properties and HTTP helpers are async. Use with + :meth:`AsyncSandboxClient.service` or :meth:`AsyncSandbox.service`. + + Example:: + + svc = await sb.service(port=3000) + + resp = await svc.get("/api/data") + print(await svc.get_browser_url()) + """ + + def __init__( + self, + browser_url: str, + service_url: str, + token: str, + expires_at: str, + *, + _refresher: Optional[Callable[[], Awaitable[AsyncServiceURL]]] = None, + ) -> None: + self._browser_url = browser_url + self._service_url = service_url + self._token = token + self._expires_at = expires_at + self._refresher = _refresher + + # -- Auto-refresh logic ------------------------------------------------- + + def _should_refresh(self) -> bool: + if self._refresher is None: + return False + raw = self._expires_at.replace("Z", "+00:00") + expires = datetime.fromisoformat(raw) + if expires.tzinfo is None: + expires = expires.replace(tzinfo=timezone.utc) + remaining = (expires - datetime.now(timezone.utc)).total_seconds() + return remaining <= _REFRESH_MARGIN_SECONDS + + async def _maybe_refresh(self) -> None: + if self._should_refresh(): + fresh = await self._refresher() # type: ignore[misc] + self._browser_url = fresh._browser_url + self._service_url = fresh._service_url + self._token = fresh._token + self._expires_at = fresh._expires_at + + # -- Async accessors (auto-refresh on access) --------------------------- + + async def get_token(self) -> str: + """Return the raw JWT, refreshing if near expiry.""" + await self._maybe_refresh() + return self._token + + async def get_service_url(self) -> str: + """Return the base URL, refreshing if near expiry.""" + await self._maybe_refresh() + return self._service_url + + async def get_browser_url(self) -> str: + """Return the browser auth URL, refreshing if near expiry.""" + await self._maybe_refresh() + return self._browser_url + + async def get_expires_at(self) -> str: + """Return the ISO 8601 expiration, refreshing if near expiry.""" + await self._maybe_refresh() + return self._expires_at + + # -- Sync property access (no refresh, use when token is known-fresh) --- + + @property + def token(self) -> str: + """Return the raw JWT without refreshing.""" + return self._token + + @property + def service_url(self) -> str: + """Return the base URL without refreshing.""" + return self._service_url + + @property + def browser_url(self) -> str: + """Return the browser auth URL without refreshing.""" + return self._browser_url + + @property + def expires_at(self) -> str: + """Return the expiration timestamp without refreshing.""" + return self._expires_at + + # -- HTTP helpers (one request per call) -------------------------------- + + async def request( + self, method: str, path: str = "/", **kwargs: Any + ) -> httpx.Response: + """Make an async HTTP request to the service, injecting the auth header. + + Args: + method: HTTP method (GET, POST, etc.). + path: Path relative to the service URL. + **kwargs: Forwarded to ``httpx.AsyncClient.request``. + + Returns: + httpx.Response. + """ + url = (await self.get_service_url()).rstrip("/") + "/" + path.lstrip("/") + headers = dict(kwargs.pop("headers", None) or {}) + headers[_AUTH_HEADER] = await self.get_token() + async with httpx.AsyncClient() as client: + return await client.request(method, url, headers=headers, **kwargs) + + async def get(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """Async HTTP GET to the service.""" + return await self.request("GET", path, **kwargs) + + async def post(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """Async HTTP POST to the service.""" + return await self.request("POST", path, **kwargs) + + async def put(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """Async HTTP PUT to the service.""" + return await self.request("PUT", path, **kwargs) + + async def patch(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """Async HTTP PATCH to the service.""" + return await self.request("PATCH", path, **kwargs) + + async def delete(self, path: str = "/", **kwargs: Any) -> httpx.Response: + """Async HTTP DELETE to the service.""" + return await self.request("DELETE", path, **kwargs) + + # -- Construction ------------------------------------------------------- + + @classmethod + def from_dict( + cls, + data: dict[str, Any], + *, + _refresher: Optional[Callable[[], Awaitable[AsyncServiceURL]]] = None, + ) -> AsyncServiceURL: + """Create an AsyncServiceURL from API response dict.""" + return cls( + browser_url=data["browser_url"], + service_url=data["service_url"], + token=data["token"], + expires_at=data["expires_at"], + _refresher=_refresher, + ) + + def __repr__(self) -> str: + return ( + f"AsyncServiceURL(service_url={self._service_url!r}, " + f"expires_at={self._expires_at!r})" + ) + + +# ============================================================================= +# WebSocket Command Execution Models +# ============================================================================= + + +@dataclass +class OutputChunk: + """A single chunk of streaming output from command execution. + + Attributes: + stream: Either "stdout" or "stderr". + data: The text content of this chunk (valid UTF-8, server handles + boundary splitting). + offset: Byte offset within the stream. Used internally for + reconnection; users typically don't need this. + """ + + stream: str + data: str + offset: int + + +class CommandHandle: + """Handle to a running command with streaming output and auto-reconnect. + + Iterable, yielding OutputChunk objects (stdout and stderr interleaved + in arrival order). Access .result after iteration to get the full + ExecutionResult. + + Auto-reconnect behavior: + - Server hot-reload (1001 Going Away): reconnect immediately + - Network error / unexpected close: reconnect with exponential backoff + - User called kill(): do NOT reconnect (propagate error) + + The auto-reconnect is transparent -- the iterator reconnects and + continues yielding chunks without any user intervention. If all + reconnect attempts are exhausted, SandboxConnectionError is raised. + + Construction modes (controlled by ``command_id``): + - **New execution** (``command_id=""``, the default): the constructor + eagerly reads the server's ``"started"`` message to populate + ``command_id`` and ``pid`` before returning. + - **Reconnection** (``command_id`` set): skips the started-message + read, since reconnect streams don't emit one. + + Example: + handle = sandbox.run("make build", timeout=600, wait=False) + + for chunk in handle: # auto-reconnects on transient errors + print(chunk.data, end="") + + result = handle.result + print(f"Exit code: {result.exit_code}") + """ + + MAX_AUTO_RECONNECTS = 5 + _BACKOFF_BASE = 0.5 # seconds + _BACKOFF_MAX = 8.0 # seconds + + def __init__( + self, + message_stream: Iterator[dict], + control: Optional[_WSStreamControl], + sandbox: Sandbox, + *, + command_id: str = "", + stdout_offset: int = 0, + stderr_offset: int = 0, + ) -> None: + self._stream = message_stream + self._control = control + self._sandbox = sandbox + self._command_id: Optional[str] = None + self._pid: Optional[int] = None + self._result: Optional[ExecutionResult] = None + self._stdout_parts: list[str] = [] + self._stderr_parts: list[str] = [] + self._exhausted = False + self._last_stdout_offset = stdout_offset + self._last_stderr_offset = stderr_offset + + # New executions (command_id=""): eager_start reads "started" message. + # Reconnections (command_id set): skip eager_start since reconnect + # streams don't send a "started" message. + if command_id: + self._command_id = command_id + else: + self._consume_started() + + def _consume_started(self) -> None: + """Eagerly read the 'started' message to populate command_id and pid. + + Blocks briefly until the server sends the started message (arrives + near-instantly after connection). After this call, command_id and + pid are available, and the WebSocket is bound to the control object + (so kill() works). + """ + try: + first_msg = next(self._stream) + except StopIteration: + raise SandboxOperationError( + "Command stream ended before 'started' message", + operation="command", + ) + if first_msg.get("type") != "started": + raise SandboxOperationError( + f"Expected 'started' message, got '{first_msg.get('type')}'", + operation="command", + ) + self._command_id = first_msg.get("command_id") + self._pid = first_msg.get("pid") + + @property + def command_id(self) -> Optional[str]: + """The server-assigned command ID. Available after construction.""" + return self._command_id + + @property + def pid(self) -> Optional[int]: + """The process ID on the sandbox. Available after construction.""" + return self._pid + + @property + def result(self) -> ExecutionResult: + """The final execution result. Blocks until the command completes. + + Drains the remaining stream if not already exhausted, then returns + the ExecutionResult with aggregated stdout, stderr, and exit_code. + """ + if self._result is None: + for _ in self: + pass + if self._result is None: + raise SandboxOperationError( + "Command stream ended without exit message", + operation="command", + ) + return self._result + + def _iter_stream(self) -> Iterator[OutputChunk]: + """Iterate over output chunks from the current stream (no reconnect).""" + if self._exhausted: + return + for msg in self._stream: + msg_type = msg.get("type") + if msg_type in ("stdout", "stderr"): + chunk = OutputChunk( + stream=msg_type, + data=msg["data"], + offset=msg.get("offset", 0), + ) + if msg_type == "stdout": + self._stdout_parts.append(msg["data"]) + else: + self._stderr_parts.append(msg["data"]) + yield chunk + elif msg_type == "exit": + self._result = ExecutionResult( + stdout="".join(self._stdout_parts), + stderr="".join(self._stderr_parts), + exit_code=msg["exit_code"], + ) + self._exhausted = True + return + self._exhausted = True + + def __iter__(self) -> Iterator[OutputChunk]: + """Iterate over output chunks, auto-reconnecting on transient errors. + + Reconnect strategy: + - 1001 Going Away (hot-reload): immediate reconnect, no delay + - Other SandboxConnectionError: exponential backoff (0.5s, 1s, 2s...) + - After kill(): no reconnect, error propagates + """ + import time + + reconnect_attempts = 0 + while True: + try: + for chunk in self._iter_stream(): + reconnect_attempts = 0 # Reset on successful data + if chunk.stream == "stdout": + self._last_stdout_offset = chunk.offset + len( + chunk.data.encode("utf-8") + ) + else: + self._last_stderr_offset = chunk.offset + len( + chunk.data.encode("utf-8") + ) + yield chunk + return # Stream ended normally (exit message received) + + except SandboxConnectionError as e: + if self._control and self._control.killed: + raise + + reconnect_attempts += 1 + if reconnect_attempts > self.MAX_AUTO_RECONNECTS: + raise SandboxConnectionError( + f"Lost connection {reconnect_attempts} times in " + f"succession, giving up" + ) from e + + is_hot_reload = isinstance(e, SandboxServerReloadError) + if not is_hot_reload: + delay = min( + self._BACKOFF_BASE * (2 ** (reconnect_attempts - 1)), + self._BACKOFF_MAX, + ) + time.sleep(delay) + + assert self._command_id is not None + new_handle = self._sandbox.reconnect( + self._command_id, + stdout_offset=self._last_stdout_offset, + stderr_offset=self._last_stderr_offset, + ) + self._stream = new_handle._stream + self._control = new_handle._control + self._exhausted = False + + def kill(self) -> None: + """Send a kill signal to the running command (SIGKILL). + + The server kills the entire process group. The stream will + subsequently yield an exit message with a non-zero exit code. + + Has no effect if the command has already exited or the + WebSocket connection is closed. + """ + if self._control: + self._control.send_kill() + + def send_input(self, data: str) -> None: + """Write data to the command's stdin. + + Args: + data: String data to write to stdin. + + Has no effect if the command has already exited or the + WebSocket connection is closed. + """ + if self._control: + self._control.send_input(data) + + @property + def last_stdout_offset(self) -> int: + """Last known stdout byte offset (for manual reconnection).""" + return self._last_stdout_offset + + @property + def last_stderr_offset(self) -> int: + """Last known stderr byte offset (for manual reconnection).""" + return self._last_stderr_offset + + def reconnect(self) -> CommandHandle: + """Reconnect to this command from the last known offsets. + + Returns a new handle that resumes output from where this one + left off. Any output produced while disconnected is replayed + from the server's ring buffer. + + Returns: + A new CommandHandle. + + Raises: + SandboxOperationError: If command_id is not found or + session expired. + SandboxConnectionError: If connection to sandbox fails. + """ + assert self._command_id is not None + return self._sandbox.reconnect( + self._command_id, + stdout_offset=self._last_stdout_offset, + stderr_offset=self._last_stderr_offset, + ) + + +class AsyncCommandHandle: + """Async handle to a running command with streaming output and auto-reconnect. + + Async iterable, yielding OutputChunk objects (stdout and stderr interleaved + in arrival order). Access .result after iteration to get the full + ExecutionResult. + + Auto-reconnect behavior: + - Server hot-reload (1001 Going Away): reconnect immediately + - Network error / unexpected close: reconnect with exponential backoff + - User called kill(): do NOT reconnect (propagate error) + + Construction modes (controlled by ``command_id``): + - **New execution** (``command_id=""``, the default): call + ``await handle._ensure_started()`` after construction to read the + server's ``"started"`` message and populate ``command_id`` / ``pid``. + - **Reconnection** (``command_id`` set): skips the started-message + read, since reconnect streams don't emit one. + + Example: + handle = await sandbox.run("make build", timeout=600, wait=False) + + async for chunk in handle: # auto-reconnects on transient errors + print(chunk.data, end="") + + result = await handle.result + print(f"Exit code: {result.exit_code}") + """ + + MAX_AUTO_RECONNECTS = 5 + _BACKOFF_BASE = 0.5 # seconds + _BACKOFF_MAX = 8.0 # seconds + + def __init__( + self, + message_stream: AsyncIterator[dict], + control: Optional[_AsyncWSStreamControl], + sandbox: AsyncSandbox, + *, + command_id: str = "", + stdout_offset: int = 0, + stderr_offset: int = 0, + ) -> None: + self._stream = message_stream + self._control = control + self._sandbox = sandbox + self._command_id: Optional[str] = None + self._pid: Optional[int] = None + self._result: Optional[ExecutionResult] = None + self._stdout_parts: list[str] = [] + self._stderr_parts: list[str] = [] + self._exhausted = False + self._last_stdout_offset = stdout_offset + self._last_stderr_offset = stderr_offset + + # New executions (command_id=""): _ensure_started reads "started". + # Reconnections (command_id set): skip since reconnect streams + # don't send a "started" message. + if command_id: + self._command_id = command_id + self._started = True + else: + self._started = False + + async def _ensure_started(self) -> None: + """Read the 'started' message to populate command_id and pid.""" + if self._started: + return + try: + first_msg = await self._stream.__anext__() + except StopAsyncIteration: + raise SandboxOperationError( + "Command stream ended before 'started' message", + operation="command", + ) + if first_msg.get("type") != "started": + raise SandboxOperationError( + f"Expected 'started' message, got '{first_msg.get('type')}'", + operation="command", + ) + self._command_id = first_msg.get("command_id") + self._pid = first_msg.get("pid") + self._started = True + + @property + def command_id(self) -> Optional[str]: + """The server-assigned command ID. Available after _ensure_started.""" + return self._command_id + + @property + def pid(self) -> Optional[int]: + """The process ID on the sandbox. Available after _ensure_started.""" + return self._pid + + @property + async def result(self) -> ExecutionResult: + """The final execution result. Awaitable.""" + if self._result is None: + async for _ in self: + pass + if self._result is None: + raise SandboxOperationError( + "Command stream ended without exit message", + operation="command", + ) + return self._result + + async def _aiter_stream(self) -> AsyncIterator[OutputChunk]: + """Iterate over output chunks from the current stream (no reconnect).""" + await self._ensure_started() + if self._exhausted: + return + async for msg in self._stream: + msg_type = msg.get("type") + if msg_type in ("stdout", "stderr"): + chunk = OutputChunk( + stream=msg_type, + data=msg["data"], + offset=msg.get("offset", 0), + ) + if msg_type == "stdout": + self._stdout_parts.append(msg["data"]) + else: + self._stderr_parts.append(msg["data"]) + yield chunk + elif msg_type == "exit": + self._result = ExecutionResult( + stdout="".join(self._stdout_parts), + stderr="".join(self._stderr_parts), + exit_code=msg["exit_code"], + ) + self._exhausted = True + return + self._exhausted = True + + async def __aiter__(self) -> AsyncIterator[OutputChunk]: + """Async iterate with auto-reconnect on transient errors.""" + import asyncio + + reconnect_attempts = 0 + while True: + try: + async for chunk in self._aiter_stream(): + reconnect_attempts = 0 + if chunk.stream == "stdout": + self._last_stdout_offset = chunk.offset + len( + chunk.data.encode("utf-8") + ) + else: + self._last_stderr_offset = chunk.offset + len( + chunk.data.encode("utf-8") + ) + yield chunk + return # Stream ended normally + + except SandboxConnectionError as e: + if self._control and self._control.killed: + raise + + reconnect_attempts += 1 + if reconnect_attempts > self.MAX_AUTO_RECONNECTS: + raise SandboxConnectionError( + f"Lost connection {reconnect_attempts} times " + f"in succession, giving up" + ) from e + + is_hot_reload = isinstance(e, SandboxServerReloadError) + if not is_hot_reload: + delay = min( + self._BACKOFF_BASE * (2 ** (reconnect_attempts - 1)), + self._BACKOFF_MAX, + ) + await asyncio.sleep(delay) + + assert self._command_id is not None + new_handle = await self._sandbox.reconnect( + self._command_id, + stdout_offset=self._last_stdout_offset, + stderr_offset=self._last_stderr_offset, + ) + self._stream = new_handle._stream + self._control = new_handle._control + self._exhausted = False + + async def kill(self) -> None: + """Send a kill signal to the running command.""" + if self._control: + await self._control.send_kill() + + async def send_input(self, data: str) -> None: + """Write data to the command's stdin.""" + if self._control: + await self._control.send_input(data) + + @property + def last_stdout_offset(self) -> int: + """Last known stdout byte offset (for manual reconnection).""" + return self._last_stdout_offset + + @property + def last_stderr_offset(self) -> int: + """Last known stderr byte offset (for manual reconnection).""" + return self._last_stderr_offset + + async def reconnect(self) -> AsyncCommandHandle: + """Reconnect to this command from the last known offsets.""" + assert self._command_id is not None + return await self._sandbox.reconnect( + self._command_id, + stdout_offset=self._last_stdout_offset, + stderr_offset=self._last_stderr_offset, + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_sandbox.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_sandbox.py new file mode 100644 index 0000000000000000000000000000000000000000..7507f9109a2206ae4b8f89f851f18e30d96a04b3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_sandbox.py @@ -0,0 +1,735 @@ +"""Sandbox class for interacting with a specific sandbox instance.""" + +from __future__ import annotations + +from collections.abc import Mapping +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Union, overload + +import httpx + +from langsmith.sandbox._exceptions import ( + DataplaneNotConfiguredError, + ResourceNotFoundError, + SandboxConnectionError, + SandboxNotReadyError, +) +from langsmith.sandbox._helpers import handle_sandbox_http_error +from langsmith.sandbox._models import ( + CommandHandle, + ExecutionResult, + ServiceURL, + Snapshot, +) +from langsmith.sandbox._tunnel import Tunnel + +if TYPE_CHECKING: + from langsmith.sandbox._client import SandboxClient + + +RequestHeaders = Optional[Mapping[str, str]] + + +@dataclass +class Sandbox: + """Represents an active sandbox for running commands and file operations. + + This class is typically obtained from SandboxClient.sandbox() and supports + the context manager protocol for automatic cleanup. + + Attributes: + name: Display name (can be updated). + dataplane_url: URL for data plane operations (file I/O, command execution). + Only functional when status is "ready". + id: Unique identifier (UUID). Remains constant even if name changes. + May be None for resources created before ID support was added. + status: Sandbox lifecycle status. One of "provisioning", "ready", + "failed", "stopped". + status_message: Human-readable details when status is "failed", None otherwise. + created_at: Timestamp when the sandbox was created. + updated_at: Timestamp when the sandbox was last updated. + idle_ttl_seconds: Idle timeout TTL in seconds (``0`` means disabled). + Newly-created sandboxes receive a server-side default of ``600`` + seconds (10 minutes) when the caller did not set ``idle_ttl_seconds`` + explicitly. The launcher stops the sandbox after this many idle + seconds; deletion is anchored to ``stopped_at`` and controlled by + ``delete_after_stop_seconds`` (see below). + delete_after_stop_seconds: Seconds after a sandbox enters the + ``stopped`` state before it (and its filesystem clone) are + permanently deleted. ``0`` disables stop-anchored deletion; + ``None`` falls back to the server default. + stopped_at: Timestamp when the sandbox transitioned to ``stopped``, + or ``None`` while running. The deletion deadline is + ``stopped_at + delete_after_stop_seconds``. + snapshot_id: Snapshot ID used to create this sandbox. + vcpus: Number of vCPUs allocated. + mem_bytes: Memory allocation in bytes. + fs_capacity_bytes: Root filesystem capacity in bytes. + + Example: + with client.sandbox(snapshot_id="") as sandbox: + result = sandbox.run("python --version") + print(result.stdout) + """ + + # Data fields (from API response) + name: str + dataplane_url: Optional[str] = None + id: Optional[str] = None + status: str = "ready" + status_message: Optional[str] = None + created_at: Optional[str] = None + updated_at: Optional[str] = None + idle_ttl_seconds: Optional[int] = None + delete_after_stop_seconds: Optional[int] = None + stopped_at: Optional[str] = None + snapshot_id: Optional[str] = None + vcpus: Optional[int] = None + mem_bytes: Optional[int] = None + fs_capacity_bytes: Optional[int] = None + + # Internal fields (not from API) + _client: SandboxClient = field(repr=False, default=None) # type: ignore + _auto_delete: bool = field(repr=False, default=True) + + @classmethod + def from_dict( + cls, + data: dict[str, Any], + client: SandboxClient, + auto_delete: bool = True, + ) -> Sandbox: + """Create a Sandbox from API response dict. + + Args: + data: API response dictionary containing sandbox data. + client: Parent SandboxClient for operations. + auto_delete: Whether to delete the sandbox on context exit. + + Returns: + Sandbox instance. + """ + return cls( + name=data.get("name", ""), + dataplane_url=data.get("dataplane_url"), + id=data.get("id"), + status=data.get("status", "ready"), + status_message=data.get("status_message"), + created_at=data.get("created_at"), + updated_at=data.get("updated_at"), + idle_ttl_seconds=data.get("idle_ttl_seconds"), + delete_after_stop_seconds=data.get("delete_after_stop_seconds"), + stopped_at=data.get("stopped_at"), + snapshot_id=data.get("snapshot_id"), + vcpus=data.get("vcpus"), + mem_bytes=data.get("mem_bytes"), + fs_capacity_bytes=data.get("fs_capacity_bytes"), + _client=client, + _auto_delete=auto_delete, + ) + + def __enter__(self) -> Sandbox: + """Enter context manager.""" + return self + + def __exit__( + self, + exc_type: Optional[type], + exc_val: Optional[BaseException], + exc_tb: Optional[Any], + ) -> None: + """Exit context manager, optionally deleting the sandbox.""" + if self._auto_delete: + try: + self._client.delete_sandbox(self.name) + except Exception: + # Don't raise on cleanup errors + pass + + def _require_dataplane_url(self) -> str: + """Validate and return the dataplane URL. + + Returns: + The dataplane URL. + + Raises: + SandboxNotReadyError: If sandbox status is not "ready". + DataplaneNotConfiguredError: If dataplane_url is not configured. + """ + if self.status != "ready": + raise SandboxNotReadyError( + f"Sandbox '{self.name}' is not ready (status: {self.status}). " + "Wait for status 'ready' before running operations." + ) + if not self.dataplane_url: + raise DataplaneNotConfiguredError( + f"Sandbox '{self.name}' does not have a dataplane_url configured. " + "Runtime operations require a dataplane URL." + ) + return self.dataplane_url + + @overload + def run( + self, + command: str, + *, + timeout: int = ..., + env: Optional[dict[str, str]] = ..., + cwd: Optional[str] = ..., + shell: str = ..., + on_stdout: Optional[Callable[[str], Any]] = ..., + on_stderr: Optional[Callable[[str], Any]] = ..., + idle_timeout: int = ..., + kill_on_disconnect: bool = ..., + ttl_seconds: int = ..., + pty: bool = ..., + headers: RequestHeaders = ..., + wait: Literal[True] = ..., + ) -> ExecutionResult: ... + + @overload + def run( + self, + command: str, + *, + timeout: int = ..., + env: Optional[dict[str, str]] = ..., + cwd: Optional[str] = ..., + shell: str = ..., + on_stdout: Optional[Callable[[str], Any]] = ..., + on_stderr: Optional[Callable[[str], Any]] = ..., + idle_timeout: int = ..., + kill_on_disconnect: bool = ..., + ttl_seconds: int = ..., + pty: bool = ..., + headers: RequestHeaders = ..., + wait: Literal[False], + ) -> CommandHandle: ... + + def run( + self, + command: str, + *, + timeout: int = 60, + env: Optional[dict[str, str]] = None, + cwd: Optional[str] = None, + shell: str = "/bin/bash", + on_stdout: Optional[Callable[[str], Any]] = None, + on_stderr: Optional[Callable[[str], Any]] = None, + idle_timeout: int = 300, + kill_on_disconnect: bool = False, + ttl_seconds: int = 600, + pty: bool = False, + headers: RequestHeaders = None, + wait: bool = True, + ) -> Union[ExecutionResult, CommandHandle]: + """Execute a command in the sandbox. + + Args: + command: Shell command to execute. + timeout: Command timeout in seconds. + env: Environment variables to set for the command. + cwd: Working directory for command execution. If None, uses sandbox default. + shell: Shell to use for command execution. Defaults to "/bin/bash". + on_stdout: Callback invoked with each stdout chunk as it arrives. + Blocks until the command completes and returns ExecutionResult. + Cannot be combined with wait=False. + on_stderr: Callback invoked with each stderr chunk as it arrives. + Blocks until the command completes and returns ExecutionResult. + Cannot be combined with wait=False. + idle_timeout: Idle timeout in seconds. If the command has no + connected clients for this duration, it is killed. Defaults + to 300 (5 minutes). Set to -1 for no idle timeout. + Only applies to WebSocket execution. + kill_on_disconnect: If True, kill the command immediately when + the last client disconnects. Defaults to False (command + continues running and can be reconnected to). + ttl_seconds: How long (in seconds) a finished command's session + is kept for reconnection. Defaults to 600 (10 minutes). + Set to -1 to keep indefinitely. + pty: If True, allocate a pseudo-terminal for the command. + Useful for commands that require a TTY (e.g., interactive + programs, commands that use terminal control codes). + Defaults to False. + wait: If True (default), block until the command completes and + return ExecutionResult. If False, return a + CommandHandle immediately for streaming output, + kill, stdin input, and reconnection. Cannot be combined with + on_stdout/on_stderr callbacks. + + Returns: + ExecutionResult when wait=True (default). + CommandHandle when wait=False. + + Raises: + ValueError: If wait=False is combined with callbacks. + DataplaneNotConfiguredError: If dataplane_url is not configured. + SandboxOperationError: If command execution fails. + CommandTimeoutError: If command exceeds its timeout. + SandboxConnectionError: If connection to sandbox fails after retries. + SandboxNotReadyError: If sandbox is not ready. + SandboxClientError: For other errors. + """ + if not wait and (on_stdout or on_stderr): + raise ValueError( + "Cannot combine wait=False with on_stdout/on_stderr callbacks. " + "Use wait=False and iterate the CommandHandle, or use callbacks." + ) + + self._require_dataplane_url() + + # When not waiting or callbacks are requested, WS is required + use_ws = not wait or on_stdout or on_stderr + if use_ws: + return self._run_ws( + command, + timeout=timeout, + env=env, + cwd=cwd, + shell=shell, + wait=wait, + on_stdout=on_stdout, + on_stderr=on_stderr, + idle_timeout=idle_timeout, + kill_on_disconnect=kill_on_disconnect, + ttl_seconds=ttl_seconds, + pty=pty, + headers=headers, + ) + + # Default (wait=True, no callbacks): try WS, fall back to HTTP. + # Catch broad exceptions so that unexpected WS failures (e.g. version + # incompatibilities) don't break users who don't need WS features. + try: + return self._run_ws( + command, + timeout=timeout, + env=env, + cwd=cwd, + shell=shell, + wait=True, + on_stdout=None, + on_stderr=None, + idle_timeout=idle_timeout, + kill_on_disconnect=kill_on_disconnect, + ttl_seconds=ttl_seconds, + pty=pty, + headers=headers, + ) + except (SandboxConnectionError, ImportError, OSError, TypeError): + return self._run_http( + command, + timeout=timeout, + env=env, + cwd=cwd, + shell=shell, + headers=headers, + ) + + def _run_ws( + self, + command: str, + *, + timeout: int, + env: Optional[dict[str, str]], + cwd: Optional[str], + shell: str, + wait: bool, + on_stdout: Optional[Callable[[str], Any]], + on_stderr: Optional[Callable[[str], Any]], + idle_timeout: int = 300, + kill_on_disconnect: bool = False, + ttl_seconds: int = 600, + pty: bool = False, + headers: RequestHeaders = None, + ) -> Union[ExecutionResult, CommandHandle]: + """Execute via WebSocket /execute/ws.""" + from langsmith.sandbox._ws_execute import run_ws_stream + + dataplane_url = self._require_dataplane_url() + api_key = self._client._api_key + + ws_kwargs: dict[str, Any] = { + "timeout": timeout, + "env": env, + "cwd": cwd, + "shell": shell, + "on_stdout": on_stdout, + "on_stderr": on_stderr, + "idle_timeout": idle_timeout, + "kill_on_disconnect": kill_on_disconnect, + "ttl_seconds": ttl_seconds, + "pty": pty, + } + if headers is not None: + ws_kwargs["headers"] = headers + + msg_stream, control = run_ws_stream( + dataplane_url, + api_key, + command, + **ws_kwargs, + ) + + handle = CommandHandle(msg_stream, control, self) + + if not wait: + return handle + + return handle.result # blocks until command completes + + def _run_http( + self, + command: str, + *, + timeout: int, + env: Optional[dict[str, str]], + cwd: Optional[str], + shell: str, + headers: RequestHeaders, + ) -> ExecutionResult: + """Execute via HTTP POST /execute (existing implementation).""" + dataplane_url = self._require_dataplane_url() + url = f"{dataplane_url}/execute" + payload: dict[str, Any] = { + "command": command, + "timeout": timeout, + "shell": shell, + } + if env is not None: + payload["env"] = env + if cwd is not None: + payload["cwd"] = cwd + + try: + response = self._client._http.post( + url, + json=payload, + timeout=timeout + 10, + headers=self._client._request_headers(headers), + ) + response.raise_for_status() + data = response.json() + return ExecutionResult( + stdout=data.get("stdout", ""), + stderr=data.get("stderr", ""), + exit_code=data.get("exit_code", -1), + ) + except httpx.HTTPStatusError as e: + handle_sandbox_http_error(e) + raise # pragma: no cover + + def reconnect( + self, + command_id: str, + *, + stdout_offset: int = 0, + stderr_offset: int = 0, + headers: RequestHeaders = None, + ) -> CommandHandle: + """Reconnect to a running or recently-finished command. + + Resumes output from the given byte offsets. Any output produced while + the client was disconnected is replayed from the server's ring buffer. + + Args: + command_id: The command ID from handle.command_id. + stdout_offset: Byte offset to resume stdout from (default: 0). + stderr_offset: Byte offset to resume stderr from (default: 0). + + Returns: + A CommandHandle for the command. + + Raises: + SandboxOperationError: If command_id is not found or session expired. + SandboxConnectionError: If connection to sandbox fails after retries. + """ + from langsmith.sandbox._ws_execute import reconnect_ws_stream + + dataplane_url = self._require_dataplane_url() + api_key = self._client._api_key + + reconnect_kwargs: dict[str, Any] = { + "stdout_offset": stdout_offset, + "stderr_offset": stderr_offset, + } + if headers is not None: + reconnect_kwargs["headers"] = headers + + msg_stream, control = reconnect_ws_stream( + dataplane_url, + api_key, + command_id, + **reconnect_kwargs, + ) + + return CommandHandle( + msg_stream, + control, + self, + command_id=command_id, + stdout_offset=stdout_offset, + stderr_offset=stderr_offset, + ) + + def write( + self, + path: str, + content: Union[str, bytes], + *, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> None: + """Write content to a file in the sandbox. + + Args: + path: Target file path in the sandbox. + content: File content (str or bytes). + timeout: Request timeout in seconds. + + Raises: + DataplaneNotConfiguredError: If dataplane_url is not configured. + SandboxOperationError: If file write fails. + SandboxConnectionError: If connection to sandbox fails after retries. + SandboxNotReadyError: If sandbox is not ready. + SandboxClientError: For other errors. + """ + dataplane_url = self._require_dataplane_url() + url = f"{dataplane_url}/upload" + + # Ensure content is bytes for multipart upload + if isinstance(content, str): + content = content.encode("utf-8") + + files = {"file": ("file", content)} + + try: + response = self._client._http.post( + url, + params={"path": path}, + files=files, + timeout=timeout, + headers=self._client._request_headers(headers), + ) + response.raise_for_status() + except httpx.HTTPStatusError as e: + handle_sandbox_http_error(e) + + def read( + self, path: str, *, timeout: int = 60, headers: RequestHeaders = None + ) -> bytes: + """Read a file from the sandbox. + + Args: + path: File path to read. Supports both absolute paths (e.g., /tmp/file.txt) + and relative paths (resolved from /home/user/). + timeout: Request timeout in seconds. + + Returns: + File contents as bytes. + + Raises: + DataplaneNotConfiguredError: If dataplane_url is not configured. + ResourceNotFoundError: If the file doesn't exist. + SandboxOperationError: If file read fails. + SandboxConnectionError: If connection to sandbox fails after retries. + SandboxNotReadyError: If sandbox is not ready. + SandboxClientError: For other errors. + """ + dataplane_url = self._require_dataplane_url() + url = f"{dataplane_url}/download" + + try: + response = self._client._http.get( + url, + params={"path": path}, + timeout=timeout, + headers=self._client._request_headers(headers), + ) + response.raise_for_status() + return response.content + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + raise ResourceNotFoundError( + f"File '{path}' not found in sandbox '{self.name}'", + resource_type="file", + ) from e + handle_sandbox_http_error(e) + # This line should never be reached but satisfies type checker + raise # pragma: no cover + + def tunnel( + self, + remote_port: int, + *, + local_port: int = 0, + max_reconnects: int = 3, + headers: RequestHeaders = None, + ) -> Tunnel: + """Open a TCP tunnel to a port inside the sandbox. + + Creates a local TCP listener that forwards connections through a + yamux-multiplexed WebSocket to the specified port inside the sandbox. + Works with any TCP protocol (databases, Redis, HTTP, etc.). + + Use as a context manager for automatic cleanup:: + + with sandbox.tunnel(remote_port=5432) as t: + conn = psycopg2.connect(host="127.0.0.1", port=t.local_port) + + Or manage the lifecycle explicitly:: + + t = sandbox.tunnel(remote_port=5432) + # ... use tunnel ... + t.close() + + Args: + remote_port: TCP port inside the sandbox to tunnel to (1-65535). + local_port: Local port to listen on. Defaults to mirroring + remote_port. Use 0 to let the OS pick an available port. + max_reconnects: Maximum number of automatic reconnect attempts + when the WebSocket session drops. Set to 0 to disable. + + Returns: + A Tunnel instance (context manager). + + Raises: + ValueError: If port values are out of range. + DataplaneNotConfiguredError: If dataplane_url is not configured. + SandboxNotReadyError: If sandbox is not ready. + """ + if not 1 <= remote_port <= 65535: + raise ValueError( + f"remote_port must be between 1 and 65535 (got {remote_port})" + ) + if local_port and not 1 <= local_port <= 65535: + raise ValueError( + f"local_port must be between 1 and 65535 (got {local_port})" + ) + dataplane_url = self._require_dataplane_url() + api_key = self._client._api_key + t = Tunnel( + dataplane_url, + api_key, + remote_port, + local_port=local_port, + max_reconnects=max_reconnects, + headers=headers, + ) + t._start() + return t + + def service( + self, + port: int, + *, + expires_in_seconds: int = 600, + headers: RequestHeaders = None, + ) -> ServiceURL: + """Get an authenticated URL for a service running in this sandbox. + + Returns a :class:`ServiceURL` whose properties auto-refresh the + token transparently before it expires. + + Args: + port: Port the service is listening on inside the sandbox. + expires_in_seconds: Token TTL in seconds (1--86400, default 600). + headers: Optional per-request header overrides. + + Returns: + ServiceURL with auto-refreshing token and HTTP helpers. + + Raises: + ResourceNotFoundError: If sandbox not found. + ValueError: If port or expires_in_seconds is out of range. + SandboxClientError: For other errors. + """ + return self._client.service( + self.name, + port, + expires_in_seconds=expires_in_seconds, + headers=headers, + ) + + def start( + self, + *, + timeout: int = 120, + headers: RequestHeaders = None, + ) -> None: + """Start a stopped sandbox and wait until ready. + + After starting, the sandbox's status and dataplane_url are updated + in place. + + Args: + timeout: Timeout in seconds when waiting for ready. + headers: Optional per-request header overrides. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceCreationError: If sandbox fails during startup. + ResourceTimeoutError: If sandbox doesn't become ready within timeout. + SandboxClientError: For other errors. + """ + refreshed = self._client.start_sandbox( + self.name, timeout=timeout, headers=headers + ) + self.status = refreshed.status + self.dataplane_url = refreshed.dataplane_url + + def stop(self, *, headers: RequestHeaders = None) -> None: + """Stop a running sandbox (preserves sandbox files for later restart). + + Args: + headers: Optional per-request header overrides. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + self._client.stop_sandbox(self.name, headers=headers) + self.status = "stopped" + self.dataplane_url = None + + def delete(self, *, headers: RequestHeaders = None) -> None: + """Delete this sandbox. + + Args: + headers: Optional per-request header overrides. + + Raises: + ResourceNotFoundError: If sandbox not found. + SandboxClientError: For other errors. + """ + self._client.delete_sandbox(self.name, headers=headers) + + def capture_snapshot( + self, + name: str, + *, + timeout: int = 60, + headers: RequestHeaders = None, + ) -> Snapshot: + """Capture a snapshot from this sandbox. + + Args: + name: Snapshot name. + timeout: Timeout in seconds when waiting for ready. + headers: Optional per-request header overrides. + + Returns: + Snapshot in "ready" status. + + Raises: + ResourceNotFoundError: If sandbox not found. + ResourceTimeoutError: If snapshot doesn't become ready within timeout. + ResourceCreationError: If snapshot capture fails. + SandboxClientError: For other errors. + """ + return self._client.capture_snapshot( + self.name, + name, + timeout=timeout, + headers=headers, + ) diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_transport.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_transport.py new file mode 100644 index 0000000000000000000000000000000000000000..b2901abe268d51375cbb3b48eca03ac082bdb80f --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_transport.py @@ -0,0 +1,216 @@ +"""Custom httpx transports with retry logic for the sandbox client. + +Provides RetryTransport (sync) and AsyncRetryTransport (async) that wrap +the default httpx transports with automatic retry on transient errors. +This mirrors the main LangSmith client's _LangSmithHttpAdapter + urllib3.Retry +architecture at the transport level, making retries transparent to all call sites. +""" + +from __future__ import annotations + +import asyncio +import logging +import random +import time + +import httpx + +from langsmith.sandbox._exceptions import SandboxConnectionError + +logger = logging.getLogger(__name__) + +RETRYABLE_STATUS_CODES = frozenset({502, 503, 504}) + +_MAX_BACKOFF = 10.0 + + +def _compute_backoff(attempt: int) -> float: + """Compute exponential backoff with jitter, capped at _MAX_BACKOFF.""" + return min(2**attempt + random.random(), _MAX_BACKOFF) + + +class RetryTransport(httpx.BaseTransport): + """Sync httpx transport that retries on transient errors. + + Retries on: + - 502/503/504 with exponential backoff + - 429 with Retry-After header support + - Connection errors with exponential backoff + + After exhausting retries, the last response is returned (for status errors) + or SandboxConnectionError is raised (for connection errors). + """ + + def __init__( + self, + *, + max_retries: int = 3, + transport: httpx.BaseTransport | None = None, + ) -> None: + self._transport = transport or httpx.HTTPTransport() + self._max_retries = max_retries + + def handle_request(self, request: httpx.Request) -> httpx.Response: + last_response: httpx.Response | None = None + + for attempt in range(self._max_retries + 1): + is_last_attempt = attempt == self._max_retries + + try: + response = self._transport.handle_request(request) + last_response = response + + if not is_last_attempt: + if response.status_code in RETRYABLE_STATUS_CODES: + response.close() + sleep_time = _compute_backoff(attempt) + logger.debug( + "Retrying %s %s (status %d, attempt %d/%d, sleeping %.1fs)", + request.method, + request.url, + response.status_code, + attempt + 1, + self._max_retries, + sleep_time, + ) + time.sleep(sleep_time) + continue + + if response.status_code == 429: + retry_after = _parse_retry_after(response) + sleep_time = retry_after * 2**attempt + random.random() + response.close() + logger.debug( + "Rate limited on %s %s, retrying after %.1fs " + "(attempt %d/%d)", + request.method, + request.url, + sleep_time, + attempt + 1, + self._max_retries, + ) + time.sleep(sleep_time) + continue + + return response + + except httpx.ConnectError as exc: + if not is_last_attempt: + sleep_time = _compute_backoff(attempt) + logger.debug( + "Connection error on %s %s, retrying " + "(attempt %d/%d, sleeping %.1fs): %s", + request.method, + request.url, + attempt + 1, + self._max_retries, + sleep_time, + exc, + ) + time.sleep(sleep_time) + continue + raise SandboxConnectionError( + f"Failed to connect to server after " + f"{self._max_retries + 1} attempts: {exc}" + ) from exc + + assert last_response is not None + return last_response + + def close(self) -> None: + self._transport.close() + + +class AsyncRetryTransport(httpx.AsyncBaseTransport): + """Async httpx transport that retries on transient errors. + + Async equivalent of RetryTransport. See RetryTransport for details. + """ + + def __init__( + self, + *, + max_retries: int = 3, + transport: httpx.AsyncBaseTransport | None = None, + ) -> None: + self._transport = transport or httpx.AsyncHTTPTransport() + self._max_retries = max_retries + + async def handle_async_request(self, request: httpx.Request) -> httpx.Response: + last_response: httpx.Response | None = None + + for attempt in range(self._max_retries + 1): + is_last_attempt = attempt == self._max_retries + + try: + response = await self._transport.handle_async_request(request) + last_response = response + + if not is_last_attempt: + if response.status_code in RETRYABLE_STATUS_CODES: + await response.aclose() + sleep_time = _compute_backoff(attempt) + logger.debug( + "Retrying %s %s (status %d, attempt %d/%d, sleeping %.1fs)", + request.method, + request.url, + response.status_code, + attempt + 1, + self._max_retries, + sleep_time, + ) + await asyncio.sleep(sleep_time) + continue + + if response.status_code == 429: + retry_after = _parse_retry_after(response) + sleep_time = retry_after * 2**attempt + random.random() + await response.aclose() + logger.debug( + "Rate limited on %s %s, retrying after %.1fs " + "(attempt %d/%d)", + request.method, + request.url, + sleep_time, + attempt + 1, + self._max_retries, + ) + await asyncio.sleep(sleep_time) + continue + + return response + + except httpx.ConnectError as exc: + if not is_last_attempt: + sleep_time = _compute_backoff(attempt) + logger.debug( + "Connection error on %s %s, retrying " + "(attempt %d/%d, sleeping %.1fs): %s", + request.method, + request.url, + attempt + 1, + self._max_retries, + sleep_time, + exc, + ) + await asyncio.sleep(sleep_time) + continue + raise SandboxConnectionError( + f"Failed to connect to server after " + f"{self._max_retries + 1} attempts: {exc}" + ) from exc + + assert last_response is not None + return last_response + + async def aclose(self) -> None: + await self._transport.aclose() + + +def _parse_retry_after(response: httpx.Response) -> float: + """Parse Retry-After header value, defaulting to 1.0 second.""" + raw = response.headers.get("retry-after", "1") + try: + return max(float(raw), 0.0) + except (ValueError, TypeError): + return 1.0 diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_tunnel.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_tunnel.py new file mode 100644 index 0000000000000000000000000000000000000000..80efdce55adf3a42e9f407bad50cbaf6db697e5d --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_tunnel.py @@ -0,0 +1,484 @@ +"""TCP tunnel for accessing services running inside sandboxes. + +Establishes a WebSocket connection to the daemon's ``/tunnel`` endpoint, +runs a yamux multiplexing session on top, and forwards local TCP connections +through yamux streams to the target port inside the sandbox. +""" + +from __future__ import annotations + +import asyncio +import logging +import socket +import struct +import threading +import time +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Optional + +from langsmith.sandbox._helpers import merge_headers + +if TYPE_CHECKING: + from langsmith.sandbox._yamux import YamuxSession, YamuxStream + +logger = logging.getLogger(__name__) + +# --------------------------------------------------------------------------- +# Tunnel connect-header protocol (layered on top of yamux streams) +# --------------------------------------------------------------------------- + +PROTOCOL_VERSION = 0x01 + +STATUS_OK = 0x00 +STATUS_PORT_NOT_ALLOWED = 0x01 +STATUS_DIAL_FAILED = 0x02 +STATUS_UNSUPPORTED_VERSION = 0x03 + +_CONNECT_HEADER_FMT = ">BH" # version(1) + port(2, big-endian) + + +def _write_connect_header(stream: YamuxStream, port: int) -> None: + """Write the 3-byte connect header on a freshly opened yamux stream.""" + stream.write(struct.pack(_CONNECT_HEADER_FMT, PROTOCOL_VERSION, port)) + + +def _read_status(stream: YamuxStream) -> int: + """Read the 1-byte status response from the daemon.""" + data = stream.read(1) + if not data: + raise ConnectionError("tunnel: connection closed before status") + return data[0] + + +# --------------------------------------------------------------------------- +# WebSocket adapter +# --------------------------------------------------------------------------- + + +class _WSAdapter: + """Adapts the ``websockets`` message API to a byte-stream interface. + + yamux requires a plain read/write/close byte stream. WebSocket is + message-based, so this adapter buffers partially consumed messages on + reads and sends one binary message per write. + """ + + def __init__(self, ws: Any) -> None: + self._ws = ws + self._buf = bytearray() + self._write_lock = threading.Lock() + + def read(self, n: int) -> bytes: + while len(self._buf) < n: + msg = self._ws.recv() + if isinstance(msg, str): + msg = msg.encode() + self._buf.extend(msg) + + result = bytes(self._buf[:n]) + del self._buf[:n] + return result + + def write(self, data: bytes) -> int: + with self._write_lock: + self._ws.send(data) + return len(data) + + def close(self) -> None: + try: + self._ws.close() + except Exception: + pass + + +# --------------------------------------------------------------------------- +# Bridge: bidirectional copy between yamux stream and TCP socket +# --------------------------------------------------------------------------- + +_BRIDGE_BUF_SIZE = 16384 + + +def _bridge(stream: YamuxStream, tcp_conn: socket.socket) -> None: + """Copy data bidirectionally until one side closes or errors.""" + done = threading.Event() + + def _stream_to_tcp() -> None: + try: + while True: + data = stream.read(_BRIDGE_BUF_SIZE) + if not data: + break + tcp_conn.sendall(data) + except Exception: + pass + finally: + done.set() + + def _tcp_to_stream() -> None: + try: + while True: + data = tcp_conn.recv(_BRIDGE_BUF_SIZE) + if not data: + break + stream.write(data) + except Exception: + pass + finally: + done.set() + + t1 = threading.Thread(target=_stream_to_tcp, daemon=True) + t2 = threading.Thread(target=_tcp_to_stream, daemon=True) + t1.start() + t2.start() + + done.wait() + + try: + stream.close() + except Exception: + pass + try: + tcp_conn.shutdown(socket.SHUT_RDWR) + except OSError: + pass + try: + tcp_conn.close() + except OSError: + pass + + t1.join(timeout=5) + t2.join(timeout=5) + + +# --------------------------------------------------------------------------- +# Tunnel +# --------------------------------------------------------------------------- + + +def _ensure_websockets(): + """Import websockets sync client or raise a clear error.""" + try: + from websockets.sync.client import connect as ws_connect + + return ws_connect + except ImportError: + raise ImportError( + "TCP tunnel requires the 'websockets' package. " + "Install it with: pip install 'langsmith[sandbox]'" + ) from None + + +class Tunnel: + """TCP tunnel to a port inside a sandbox. + + Opens a local TCP listener and forwards each accepted connection through + a yamux-multiplexed WebSocket to the daemon, which dials the target port + inside the sandbox. + + Typically used as a context manager:: + + with sandbox.tunnel(remote_port=5432) as t: + conn = psycopg2.connect(host="127.0.0.1", port=t.local_port) + + Or with explicit lifecycle:: + + t = sandbox.tunnel(remote_port=5432) + # ... use tunnel ... + t.close() + """ + + _BACKOFF_BASE = 0.5 + _BACKOFF_MAX = 8.0 + + def __init__( + self, + dataplane_url: str, + api_key: Optional[str], + remote_port: int, + *, + local_port: int = 0, + max_reconnects: int = 3, + headers: Optional[Mapping[str, str]] = None, + ) -> None: + self._dataplane_url = dataplane_url + self._api_key = api_key + self._headers = headers + self._remote_port = remote_port + self._requested_local_port = local_port or remote_port + self._local_port = self._requested_local_port + self._max_reconnects = max_reconnects + + self._ws: object = None + self._yamux: Optional[YamuxSession] = None + self._server_socket: Optional[socket.socket] = None + self._accept_thread: Optional[threading.Thread] = None + self._reconnect_lock = threading.Lock() + self._closed = False + self._started = False + + @property + def local_port(self) -> int: + """Local port the tunnel is listening on.""" + return self._local_port + + @property + def remote_port(self) -> int: + """Port inside the sandbox that the tunnel connects to.""" + return self._remote_port + + # -- Context manager ---------------------------------------------------- + + def __enter__(self) -> Tunnel: + return self + + def __exit__(self, *args: object) -> None: + self.close() + + # -- Lifecycle ---------------------------------------------------------- + + def _start(self) -> None: + if self._started: + return + self._started = True + + try: + self._do_start() + except Exception: + self.close() + raise + + def _do_start(self) -> None: + self._connect() + + self._server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self._server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + + # Check if another process is actively listening on this port. + # SO_REUSEADDR lets us rebind over TIME_WAIT, but we don't want to + # silently steal a port from a running service. + port = self._requested_local_port + if port != 0: + probe = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + probe.settimeout(0.5) + probe.connect(("127.0.0.1", port)) + probe.close() + raise OSError( + f"Port {port} is already in use by another service. " + f"Choose a different local_port." + ) + except ConnectionRefusedError: + pass # nothing listening โ€” safe to bind + except OSError as e: + if "Connection refused" in str(e): + pass # same as above, different OS error message + elif "already in use" in str(e).lower(): + raise + else: + pass # TIME_WAIT or other transient state โ€” safe to bind + finally: + try: + probe.close() + except OSError: + pass + + self._server_socket.bind(("127.0.0.1", self._requested_local_port)) + self._server_socket.listen(128) + self._local_port = self._server_socket.getsockname()[1] + + self._accept_thread = threading.Thread( + target=self._accept_loop, daemon=True, name="tunnel-accept" + ) + self._accept_thread.start() + + def _connect(self) -> None: + """Establish (or re-establish) the WebSocket + yamux session.""" + from langsmith.sandbox._yamux import YamuxSession + + old_yamux = self._yamux + if old_yamux: + try: + old_yamux.close() + except Exception: + pass + + ws_connect = _ensure_websockets() + ws_url = self._build_ws_url() + headers = merge_headers( + {"X-Api-Key": self._api_key} if self._api_key else None, + self._headers, + ) + + self._ws = ws_connect( + ws_url, + additional_headers=headers, + open_timeout=15, + close_timeout=5, + ping_interval=None, # yamux handles keepalive + ) + + adapter = _WSAdapter(self._ws) + self._yamux = YamuxSession(adapter) + + def _ensure_session(self) -> YamuxSession: + """Return a live yamux session, reconnecting if needed.""" + from langsmith.sandbox._exceptions import TunnelError + + if self._yamux and not self._yamux.is_closed: + return self._yamux + + with self._reconnect_lock: + if self._yamux and not self._yamux.is_closed: + return self._yamux + + last_err: Optional[Exception] = None + for attempt in range(self._max_reconnects): + try: + self._connect() + logger.debug("tunnel: reconnected (attempt %d)", attempt + 1) + return self._yamux # type: ignore[return-value] + except Exception as exc: + last_err = exc + if attempt < self._max_reconnects - 1: + delay = min( + self._BACKOFF_BASE * (2**attempt), + self._BACKOFF_MAX, + ) + time.sleep(delay) + + raise TunnelError( + f"tunnel: reconnect failed after {self._max_reconnects} attempts" + ) from last_err + + def close(self) -> None: + """Shut down the tunnel, closing all connections.""" + if self._closed: + return + self._closed = True + + if self._server_socket: + try: + self._server_socket.close() + except OSError: + pass + + if self._yamux: + self._yamux.close() + + # -- Internal ----------------------------------------------------------- + + def _accept_loop(self) -> None: + while not self._closed: + try: + conn, _ = self._server_socket.accept() # type: ignore[union-attr] + except OSError: + break + threading.Thread( + target=self._handle_conn, + args=(conn,), + daemon=True, + name="tunnel-bridge", + ).start() + + def _handle_conn(self, tcp_conn: socket.socket) -> None: + try: + session = self._ensure_session() + stream = session.open_stream() + _write_connect_header(stream, self._remote_port) + status = _read_status(stream) + + if status == STATUS_OK: + _bridge(stream, tcp_conn) + return + + stream.close() + tcp_conn.close() + + if status == STATUS_PORT_NOT_ALLOWED: + logger.warning( + "tunnel: port %d not allowed by daemon", + self._remote_port, + ) + elif status == STATUS_DIAL_FAILED: + logger.warning( + "tunnel: nothing listening on port %d inside sandbox", + self._remote_port, + ) + elif status == STATUS_UNSUPPORTED_VERSION: + logger.warning( + "tunnel: protocol version mismatch (client v%d)", + PROTOCOL_VERSION, + ) + else: + logger.warning("tunnel: unknown status %d", status) + + except Exception as exc: + logger.debug("tunnel: connection handler error: %s", exc) + try: + tcp_conn.close() + except OSError: + pass + + def _build_ws_url(self) -> str: + url = self._dataplane_url.rstrip("/") + url = url.replace("https://", "wss://").replace("http://", "ws://") + return f"{url}/tunnel" + + +# --------------------------------------------------------------------------- +# AsyncTunnel +# --------------------------------------------------------------------------- + + +class AsyncTunnel: + """Async wrapper around :class:`Tunnel`. + + The underlying tunnel runs in background threads (TCP listener + bridges); + async context-manager methods delegate to the sync tunnel via the event + loop's executor. + + Usage:: + + async with await sandbox.tunnel(remote_port=5432) as t: + conn = await asyncpg.connect(host="127.0.0.1", port=t.local_port) + """ + + def __init__( + self, + dataplane_url: str, + api_key: Optional[str], + remote_port: int, + *, + local_port: int = 0, + max_reconnects: int = 3, + headers: Optional[Mapping[str, str]] = None, + ) -> None: + self._tunnel = Tunnel( + dataplane_url, + api_key, + remote_port, + local_port=local_port, + max_reconnects=max_reconnects, + headers=headers, + ) + + @property + def local_port(self) -> int: + return self._tunnel.local_port + + @property + def remote_port(self) -> int: + return self._tunnel.remote_port + + async def __aenter__(self) -> AsyncTunnel: + loop = asyncio.get_running_loop() + await loop.run_in_executor(None, self._tunnel._start) + return self + + async def __aexit__(self, *args: object) -> None: + loop = asyncio.get_running_loop() + await loop.run_in_executor(None, self._tunnel.close) + + def close(self) -> None: + """Shut down the tunnel (sync, safe to call from any context).""" + self._tunnel.close() diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_ws_execute.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_ws_execute.py new file mode 100644 index 0000000000000000000000000000000000000000..9a2ba98629d49aaaae2d585f6608492372ac8782 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_ws_execute.py @@ -0,0 +1,565 @@ +"""WebSocket-based command execution for long-running commands.""" + +from __future__ import annotations + +import json +from collections.abc import AsyncIterator, Iterator, Mapping +from typing import Any, Callable, Optional + +from langsmith.sandbox._exceptions import ( + CommandTimeoutError, + SandboxConnectionError, + SandboxOperationError, + SandboxServerReloadError, +) +from langsmith.sandbox._helpers import merge_headers + + +def _ensure_websockets(): + """Import websockets or raise a clear error.""" + try: + from websockets.exceptions import ConnectionClosed, InvalidStatus + from websockets.sync.client import connect as ws_connect + + return ws_connect, ConnectionClosed, InvalidStatus + except ImportError: + raise ImportError( + "WebSocket-based execution requires the 'websockets' package. " + "Install it with: pip install 'langsmith[sandbox]'" + ) from None + + +def _ensure_websockets_async(): + """Import async websockets or raise a clear error.""" + try: + from websockets.asyncio.client import connect as ws_connect_async + from websockets.exceptions import ConnectionClosed, InvalidStatus + + return ws_connect_async, ConnectionClosed, InvalidStatus + except ImportError: + raise ImportError( + "WebSocket-based execution requires the 'websockets' package. " + "Install it with: pip install 'langsmith[sandbox]'" + ) from None + + +def _build_ws_url(dataplane_url: str) -> str: + """Convert dataplane HTTP URL to WebSocket URL for /execute/ws.""" + ws_url = dataplane_url.replace("https://", "wss://").replace("http://", "ws://") + return f"{ws_url}/execute/ws" + + +def _build_auth_headers( + api_key: Optional[str], headers: Optional[Mapping[str, str]] = None +) -> dict[str, str]: + """Build auth headers for the WebSocket upgrade request.""" + auth_headers = {"X-Api-Key": api_key} if api_key else None + return merge_headers(auth_headers, headers) + + +# ============================================================================= +# Stream Control +# ============================================================================= + + +class _WSStreamControl: + """Control interface for an active WebSocket stream. + + Created before the generator starts, bound to the WebSocket once + the connection opens. The CommandHandle holds a reference to this + object to send kill/input messages. + + Thread safety: websockets' sync client supports send() from one + thread while recv() runs on another. So kill() from user code + and iteration on a different thread are safe. + """ + + def __init__(self) -> None: + self._ws: Any = None + self._closed = False + self._killed = False + + def _bind(self, ws: Any) -> None: + """Bind to the active WebSocket. Called inside the generator.""" + self._ws = ws + + def _unbind(self) -> None: + """Mark as closed. Called when the generator exits.""" + self._closed = True + self._ws = None + + @property + def killed(self) -> bool: + """True if kill() has been called on this stream.""" + return self._killed + + def send_kill(self) -> None: + """Send a kill message and immediately close the WebSocket.""" + self._killed = True + if self._ws and not self._closed: + try: + self._ws.send(json.dumps({"type": "kill"})) + except Exception: + pass + try: + self._ws.close_timeout = 0 + self._ws.close() + except Exception: + pass + + def send_input(self, data: str) -> None: + """Send stdin data to the running command.""" + if self._ws and not self._closed: + self._ws.send(json.dumps({"type": "input", "data": data})) + + +class _AsyncWSStreamControl: + """Async equivalent of _WSStreamControl.""" + + def __init__(self) -> None: + self._ws: Any = None + self._closed = False + self._killed = False + + def _bind(self, ws: Any) -> None: + self._ws = ws + + def _unbind(self) -> None: + self._closed = True + self._ws = None + + @property + def killed(self) -> bool: + return self._killed + + async def send_kill(self) -> None: + self._killed = True + if self._ws and not self._closed: + try: + await self._ws.send(json.dumps({"type": "kill"})) + except Exception: + pass + try: + self._ws.close_timeout = 0 + await self._ws.close() + except Exception: + pass + + async def send_input(self, data: str) -> None: + if self._ws and not self._closed: + await self._ws.send(json.dumps({"type": "input", "data": data})) + + +# ============================================================================= +# Error Handling +# ============================================================================= + + +def _raise_for_invalid_status(exc: Exception, ws_url: str) -> None: + """Raise a clear error when the server rejects the WebSocket upgrade. + + The most common case is HTTP 404 โ€” the server doesn't have the + /execute/ws endpoint, meaning it doesn't support WebSocket streaming. + """ + status = getattr(getattr(exc, "response", None), "status_code", None) + if status == 404: + raise SandboxConnectionError( + f"The sandbox server does not support WebSocket command execution " + f"(endpoint {ws_url} returned 404). Ensure the server is updated " + f"to a version that supports the /execute/ws endpoint, or use " + f"run() without wait=False or callbacks." + ) from exc + # For other HTTP status codes, include the status in the message + raise SandboxConnectionError( + f"WebSocket upgrade rejected by server (HTTP {status}): {exc}" + ) from exc + + +def _raise_from_error_msg(msg: dict, *, command_id: str = "") -> None: + """Raise the appropriate exception from a server error message.""" + error_type = msg.get("error_type", "CommandError") + error_msg = msg.get("error", "Unknown error") + + if error_type == "CommandTimeout": + raise CommandTimeoutError(error_msg) + if error_type == "CommandNotFound": + raise SandboxOperationError( + f"Command not found: {command_id}" if command_id else error_msg, + operation="reconnect" if command_id else "command", + error_type=error_type, + ) + if error_type == "SessionExpired": + raise SandboxOperationError( + f"Session expired: {command_id}" if command_id else error_msg, + operation="reconnect" if command_id else "command", + error_type=error_type, + ) + + raise SandboxOperationError( + error_msg, + operation="reconnect" if command_id else "command", + error_type=error_type, + ) + + +# ============================================================================= +# Sync Stream Functions +# ============================================================================= + + +def run_ws_stream( + dataplane_url: str, + api_key: Optional[str], + command: str, + *, + timeout: int = 60, + env: Optional[dict[str, str]] = None, + cwd: Optional[str] = None, + shell: str = "/bin/bash", + on_stdout: Optional[Callable[[str], Any]] = None, + on_stderr: Optional[Callable[[str], Any]] = None, + idle_timeout: int = 300, + kill_on_disconnect: bool = False, + ttl_seconds: int = 600, + pty: bool = False, + headers: Optional[Mapping[str, str]] = None, +) -> tuple[Iterator[dict], _WSStreamControl]: + """Execute a command over WebSocket, yielding raw message dicts. + + Returns a tuple of (message_iterator, control). The control object + provides send_kill() and send_input() methods for the CommandHandle. + + The iterator yields dicts with a "type" field: + - {"type": "started", "command_id": "...", "pid": N} + - {"type": "stdout", "data": "...", "offset": N} + - {"type": "stderr", "data": "...", "offset": N} + - {"type": "exit", "exit_code": N} + + If on_stdout/on_stderr callbacks are provided, they are invoked as + data arrives in addition to yielding the messages. + """ + ws_connect, ConnectionClosed, InvalidStatus = _ensure_websockets() + ws_url = _build_ws_url(dataplane_url) + request_headers = _build_auth_headers(api_key, headers) + control = _WSStreamControl() + + def _stream() -> Iterator[dict]: + try: + with ws_connect( + ws_url, + additional_headers=request_headers, + open_timeout=30, + close_timeout=10, + ping_interval=30, + ping_timeout=60, + ) as ws: + control._bind(ws) + + # Send execute request + payload: dict[str, Any] = { + "type": "execute", + "command": command, + "timeout_seconds": timeout, + "shell": shell, + "idle_timeout_seconds": idle_timeout, + "kill_on_disconnect": kill_on_disconnect, + "ttl_seconds": ttl_seconds, + } + if env: + payload["env"] = env + if cwd: + payload["cwd"] = cwd + if pty: + payload["pty"] = True + ws.send(json.dumps(payload)) + + # Read messages until exit or error + for raw_msg in ws: + msg = json.loads(raw_msg) + msg_type = msg.get("type") + + if msg_type == "started": + yield msg + + elif msg_type == "stdout": + if on_stdout: + on_stdout(msg["data"]) + yield msg + + elif msg_type == "stderr": + if on_stderr: + on_stderr(msg["data"]) + yield msg + + elif msg_type == "exit": + yield msg + return + + elif msg_type == "error": + _raise_from_error_msg(msg) + + except InvalidStatus as e: + _raise_for_invalid_status(e, ws_url) + except ConnectionClosed as e: + if e.rcvd and e.rcvd.code == 1001: + raise SandboxServerReloadError( + "Server is reloading, reconnect to resume" + ) from e + raise SandboxConnectionError( + f"WebSocket connection closed unexpectedly: {e}" + ) from e + except OSError as e: + raise SandboxConnectionError(f"Failed to connect to sandbox: {e}") from e + finally: + control._unbind() + + return _stream(), control + + +def reconnect_ws_stream( + dataplane_url: str, + api_key: Optional[str], + command_id: str, + *, + stdout_offset: int = 0, + stderr_offset: int = 0, + headers: Optional[Mapping[str, str]] = None, +) -> tuple[Iterator[dict], _WSStreamControl]: + """Reconnect to an existing command over WebSocket. + + Returns a tuple of (message_iterator, control), same as run_ws_stream. + The iterator yields stdout, stderr, exit, and error messages. + No 'started' message is sent on reconnection. + + With the ring buffer reader server model, there is no replay/live + phase distinction and no deduplication needed. The server reads from + its ring buffer starting at the requested offsets and streams output + from there. If the requested offset is older than the buffer's + earliest data, the server sends from the earliest available offset. + """ + ws_connect, ConnectionClosed, InvalidStatus = _ensure_websockets() + ws_url = _build_ws_url(dataplane_url) + request_headers = _build_auth_headers(api_key, headers) + control = _WSStreamControl() + + def _stream() -> Iterator[dict]: + try: + with ws_connect( + ws_url, + additional_headers=request_headers, + open_timeout=30, + close_timeout=10, + ping_interval=30, + ping_timeout=60, + ) as ws: + control._bind(ws) + + # Send reconnect request + ws.send( + json.dumps( + { + "type": "reconnect", + "command_id": command_id, + "stdout_offset": stdout_offset, + "stderr_offset": stderr_offset, + } + ) + ) + + # Read messages until exit or error + for raw_msg in ws: + msg = json.loads(raw_msg) + msg_type = msg.get("type") + + if msg_type in ("stdout", "stderr"): + yield msg + + elif msg_type == "exit": + yield msg + return + + elif msg_type == "error": + _raise_from_error_msg(msg, command_id=command_id) + + except InvalidStatus as e: + _raise_for_invalid_status(e, ws_url) + except ConnectionClosed as e: + if e.rcvd and e.rcvd.code == 1001: + raise SandboxServerReloadError( + "Server is reloading, reconnect to resume" + ) from e + raise SandboxConnectionError( + f"WebSocket connection closed unexpectedly: {e}" + ) from e + except OSError as e: + raise SandboxConnectionError(f"Failed to connect to sandbox: {e}") from e + finally: + control._unbind() + + return _stream(), control + + +# ============================================================================= +# Async Stream Functions +# ============================================================================= + + +async def run_ws_stream_async( + dataplane_url: str, + api_key: Optional[str], + command: str, + *, + timeout: int = 60, + env: Optional[dict[str, str]] = None, + cwd: Optional[str] = None, + shell: str = "/bin/bash", + on_stdout: Optional[Callable[[str], Any]] = None, + on_stderr: Optional[Callable[[str], Any]] = None, + idle_timeout: int = 300, + kill_on_disconnect: bool = False, + ttl_seconds: int = 600, + pty: bool = False, + headers: Optional[Mapping[str, str]] = None, +) -> tuple[AsyncIterator[dict], _AsyncWSStreamControl]: + """Async equivalent of run_ws_stream. + + Returns (async_message_iterator, async_control). + """ + ws_connect_async, ConnectionClosed, InvalidStatus = _ensure_websockets_async() + ws_url = _build_ws_url(dataplane_url) + request_headers = _build_auth_headers(api_key, headers) + control = _AsyncWSStreamControl() + + async def _stream() -> AsyncIterator[dict]: + try: + async with ws_connect_async( + ws_url, + additional_headers=request_headers, + open_timeout=30, + close_timeout=10, + ping_interval=30, + ping_timeout=60, + ) as ws: + control._bind(ws) + + payload: dict[str, Any] = { + "type": "execute", + "command": command, + "timeout_seconds": timeout, + "shell": shell, + "idle_timeout_seconds": idle_timeout, + "kill_on_disconnect": kill_on_disconnect, + "ttl_seconds": ttl_seconds, + } + if env: + payload["env"] = env + if cwd: + payload["cwd"] = cwd + if pty: + payload["pty"] = True + await ws.send(json.dumps(payload)) + + async for raw_msg in ws: + msg = json.loads(raw_msg) + msg_type = msg.get("type") + + if msg_type == "started": + yield msg + elif msg_type == "stdout": + if on_stdout: + on_stdout(msg["data"]) + yield msg + elif msg_type == "stderr": + if on_stderr: + on_stderr(msg["data"]) + yield msg + elif msg_type == "exit": + yield msg + return + elif msg_type == "error": + _raise_from_error_msg(msg) + + except InvalidStatus as e: + _raise_for_invalid_status(e, ws_url) + except ConnectionClosed as e: + if e.rcvd and e.rcvd.code == 1001: + raise SandboxServerReloadError( + "Server is reloading, reconnect to resume" + ) from e + raise SandboxConnectionError( + f"WebSocket connection closed unexpectedly: {e}" + ) from e + except OSError as e: + raise SandboxConnectionError(f"Failed to connect to sandbox: {e}") from e + finally: + control._unbind() + + return _stream(), control + + +async def reconnect_ws_stream_async( + dataplane_url: str, + api_key: Optional[str], + command_id: str, + *, + stdout_offset: int = 0, + stderr_offset: int = 0, + headers: Optional[Mapping[str, str]] = None, +) -> tuple[AsyncIterator[dict], _AsyncWSStreamControl]: + """Async equivalent of reconnect_ws_stream.""" + ws_connect_async, ConnectionClosed, InvalidStatus = _ensure_websockets_async() + ws_url = _build_ws_url(dataplane_url) + request_headers = _build_auth_headers(api_key, headers) + control = _AsyncWSStreamControl() + + async def _stream() -> AsyncIterator[dict]: + try: + async with ws_connect_async( + ws_url, + additional_headers=request_headers, + open_timeout=30, + close_timeout=10, + ping_interval=30, + ping_timeout=60, + ) as ws: + control._bind(ws) + + await ws.send( + json.dumps( + { + "type": "reconnect", + "command_id": command_id, + "stdout_offset": stdout_offset, + "stderr_offset": stderr_offset, + } + ) + ) + + async for raw_msg in ws: + msg = json.loads(raw_msg) + msg_type = msg.get("type") + + if msg_type in ("stdout", "stderr"): + yield msg + elif msg_type == "exit": + yield msg + return + elif msg_type == "error": + _raise_from_error_msg(msg, command_id=command_id) + + except InvalidStatus as e: + _raise_for_invalid_status(e, ws_url) + except ConnectionClosed as e: + if e.rcvd and e.rcvd.code == 1001: + raise SandboxServerReloadError( + "Server is reloading, reconnect to resume" + ) from e + raise SandboxConnectionError( + f"WebSocket connection closed unexpectedly: {e}" + ) from e + except OSError as e: + raise SandboxConnectionError(f"Failed to connect to sandbox: {e}") from e + finally: + control._unbind() + + return _stream(), control diff --git a/python/user_packages/Python313/site-packages/langsmith/sandbox/_yamux.py b/python/user_packages/Python313/site-packages/langsmith/sandbox/_yamux.py new file mode 100644 index 0000000000000000000000000000000000000000..1ccfd0add8b3d7f9e84aa10f1a6ef28a96d14100 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/sandbox/_yamux.py @@ -0,0 +1,354 @@ +"""Minimal yamux (Yet Another Multiplexer) client for TCP tunneling. + +Implements the client side of the yamux protocol as specified at +https://github.com/hashicorp/yamux/blob/master/spec.md + +Only the subset needed for tunnel client operation is implemented: +opening streams, sending/receiving data, flow control, and keepalive. +""" + +from __future__ import annotations + +import struct +import threading +from typing import Protocol + +# --------------------------------------------------------------------------- +# Protocol constants +# --------------------------------------------------------------------------- + +_VERSION = 0 + +_TYPE_DATA = 0 +_TYPE_WINDOW_UPDATE = 1 +_TYPE_PING = 2 +_TYPE_GO_AWAY = 3 + +_FLAG_SYN = 0x0001 +_FLAG_ACK = 0x0002 +_FLAG_FIN = 0x0004 +_FLAG_RST = 0x0008 + +_HEADER_SIZE = 12 +_HEADER_FMT = ">BBHII" # version(1), type(1), flags(2), streamID(4), length(4) + +_INITIAL_WINDOW_SIZE = 256 * 1024 # 256 KB + + +# --------------------------------------------------------------------------- +# Byte-stream interface required by the session +# --------------------------------------------------------------------------- + + +class _ReadWriteCloser(Protocol): + def read(self, n: int) -> bytes: ... + + def write(self, data: bytes) -> int: ... + + def close(self) -> None: ... + + +# --------------------------------------------------------------------------- +# YamuxStream +# --------------------------------------------------------------------------- + + +class YamuxStream: + """A single multiplexed stream within a yamux session. + + Streams are created via :meth:`YamuxSession.open_stream` and provide + blocking read/write/close with per-stream flow control. + """ + + def __init__(self, stream_id: int, session: YamuxSession) -> None: + self._id = stream_id + self._session = session + + self._recv_buf = bytearray() + self._recv_cond = threading.Condition() + self._recv_closed = False + self._recv_error = False + self._recv_window = _INITIAL_WINDOW_SIZE + + self._send_window = _INITIAL_WINDOW_SIZE + self._send_cond = threading.Condition() + self._send_closed = False + + @property + def stream_id(self) -> int: + return self._id + + def read(self, n: int) -> bytes: + """Read up to *n* bytes, blocking until data is available. + + Returns ``b""`` on EOF (FIN received). + Raises :class:`ConnectionResetError` on RST. + """ + delta_to_send = 0 + + with self._recv_cond: + while not self._recv_buf and not self._recv_closed and not self._recv_error: + self._recv_cond.wait() + + if self._recv_error and not self._recv_buf: + raise ConnectionResetError("yamux stream reset by peer") + + if not self._recv_buf: + return b"" + + size = min(n, len(self._recv_buf)) + data = bytes(self._recv_buf[:size]) + del self._recv_buf[:size] + + consumed = _INITIAL_WINDOW_SIZE - self._recv_window + if consumed >= _INITIAL_WINDOW_SIZE // 2: + delta_to_send = consumed + self._recv_window += consumed + + if delta_to_send > 0: + try: + self._session._send_window_update(self._id, delta_to_send) + except Exception: + pass + + return data + + def write(self, data: bytes) -> int: + """Write *data*, blocking if the send window is exhausted.""" + if self._send_closed: + raise BrokenPipeError("yamux stream closed for writing") + + offset = 0 + mv = memoryview(data) + + while offset < len(data): + with self._send_cond: + while self._send_window == 0 and not self._send_closed: + self._send_cond.wait() + if self._send_closed: + raise BrokenPipeError("yamux stream closed for writing") + chunk = min(len(data) - offset, self._send_window) + self._send_window -= chunk + + self._session._send_data(self._id, bytes(mv[offset : offset + chunk])) + offset += chunk + + return len(data) + + def close(self) -> None: + """Close the stream (sends FIN to the remote end).""" + if not self._send_closed: + self._send_closed = True + try: + self._session._send_frame(_TYPE_DATA, _FLAG_FIN, self._id, 0) + except Exception: + pass + + with self._recv_cond: + self._recv_closed = True + self._recv_cond.notify_all() + with self._send_cond: + self._send_cond.notify_all() + + # -- Internal: called by YamuxSession._read_loop ------------------------ + + def _receive_data(self, data: bytes) -> None: + with self._recv_cond: + self._recv_buf.extend(data) + self._recv_window -= len(data) + self._recv_cond.notify_all() + + def _receive_fin(self) -> None: + with self._recv_cond: + self._recv_closed = True + self._recv_cond.notify_all() + + def _receive_rst(self) -> None: + with self._recv_cond: + self._recv_error = True + self._recv_cond.notify_all() + with self._send_cond: + self._send_closed = True + self._send_cond.notify_all() + + def _update_send_window(self, delta: int) -> None: + with self._send_cond: + self._send_window += delta + self._send_cond.notify_all() + + +# --------------------------------------------------------------------------- +# YamuxSession +# --------------------------------------------------------------------------- + + +class YamuxSession: + """Client-side yamux session over a byte-stream connection. + + The connection must implement ``read(n) -> bytes``, ``write(data) -> int``, + and ``close() -> None``. Typically this is a :class:`_WSAdapter` wrapping + a WebSocket. + + Usage:: + + session = YamuxSession(conn) + stream = session.open_stream() + stream.write(b"hello") + data = stream.read(1024) + stream.close() + session.close() + """ + + def __init__(self, conn: _ReadWriteCloser) -> None: + self._conn = conn + self._streams: dict[int, YamuxStream] = {} + self._next_stream_id = 1 # client uses odd IDs + self._lock = threading.Lock() + self._write_lock = threading.Lock() + self._closed = False + self._shutdown_event = threading.Event() + + self._reader_thread = threading.Thread( + target=self._read_loop, daemon=True, name="yamux-reader" + ) + self._reader_thread.start() + + self._keepalive_thread = threading.Thread( + target=self._keepalive_loop, daemon=True, name="yamux-keepalive" + ) + self._keepalive_thread.start() + + @property + def is_closed(self) -> bool: + return self._closed + + def open_stream(self) -> YamuxStream: + """Open a new multiplexed stream. + + Raises :class:`RuntimeError` if the session is closed. + """ + with self._lock: + if self._closed: + raise RuntimeError("yamux session is closed") + stream_id = self._next_stream_id + self._next_stream_id += 2 + stream = YamuxStream(stream_id, self) + self._streams[stream_id] = stream + + self._send_frame(_TYPE_WINDOW_UPDATE, _FLAG_SYN, stream_id, 0) + return stream + + def close(self) -> None: + """Close the session and all streams.""" + if self._closed: + return + self._closed = True + self._shutdown_event.set() + + try: + self._send_frame(_TYPE_GO_AWAY, 0, 0, 0) + except Exception: + pass + + with self._lock: + for stream in self._streams.values(): + stream._receive_rst() + + try: + self._conn.close() + except Exception: + pass + + # -- Frame I/O ---------------------------------------------------------- + + def _send_frame( + self, msg_type: int, flags: int, stream_id: int, length: int + ) -> None: + hdr = struct.pack(_HEADER_FMT, _VERSION, msg_type, flags, stream_id, length) + with self._write_lock: + self._conn.write(hdr) + + def _send_data(self, stream_id: int, data: bytes) -> None: + hdr = struct.pack(_HEADER_FMT, _VERSION, _TYPE_DATA, 0, stream_id, len(data)) + with self._write_lock: + self._conn.write(hdr + data) + + def _send_window_update(self, stream_id: int, delta: int) -> None: + self._send_frame(_TYPE_WINDOW_UPDATE, 0, stream_id, delta) + + # -- Read loop ---------------------------------------------------------- + + def _read_loop(self) -> None: + try: + while not self._closed: + hdr_bytes = self._conn.read(_HEADER_SIZE) + if len(hdr_bytes) < _HEADER_SIZE: + break + + _ver, msg_type, flags, stream_id, length = struct.unpack( + _HEADER_FMT, hdr_bytes + ) + + if msg_type == _TYPE_DATA: + self._handle_data(flags, stream_id, length) + elif msg_type == _TYPE_WINDOW_UPDATE: + self._handle_window_update(flags, stream_id, length) + elif msg_type == _TYPE_PING: + self._handle_ping(flags, length) + elif msg_type == _TYPE_GO_AWAY: + break + except Exception: + pass + finally: + if not self._closed: + self._closed = True + self._shutdown_event.set() + with self._lock: + for stream in self._streams.values(): + stream._receive_rst() + + def _handle_data(self, flags: int, stream_id: int, length: int) -> None: + payload = self._conn.read(length) if length > 0 else b"" + + with self._lock: + stream = self._streams.get(stream_id) + if stream is None: + return + + if payload: + stream._receive_data(payload) + if flags & _FLAG_FIN: + stream._receive_fin() + if flags & _FLAG_RST: + stream._receive_rst() + + def _handle_window_update(self, flags: int, stream_id: int, length: int) -> None: + with self._lock: + stream = self._streams.get(stream_id) + if stream is None: + return + + if length > 0: + stream._update_send_window(length) + if flags & _FLAG_FIN: + stream._receive_fin() + if flags & _FLAG_RST: + stream._receive_rst() + + def _handle_ping(self, flags: int, opaque: int) -> None: + if flags & _FLAG_SYN: + try: + self._send_frame(_TYPE_PING, _FLAG_ACK, 0, opaque) + except Exception: + pass + + # -- Keepalive ---------------------------------------------------------- + + def _keepalive_loop(self) -> None: + ping_id = 0 + while not self._shutdown_event.wait(30): + ping_id += 1 + try: + self._send_frame(_TYPE_PING, _FLAG_SYN, 0, ping_id) + except Exception: + break diff --git a/python/user_packages/Python313/site-packages/langsmith/testing/__init__.py b/python/user_packages/Python313/site-packages/langsmith/testing/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f64c1f687dc27941526d12b1f0e304bac9b75677 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/testing/__init__.py @@ -0,0 +1,17 @@ +"""LangSmith pytest testing module.""" + +from langsmith.testing._internal import ( + log_feedback, + log_inputs, + log_outputs, + log_reference_outputs, + trace_feedback, +) + +__all__ = [ + "log_inputs", + "log_outputs", + "log_reference_outputs", + "log_feedback", + "trace_feedback", +] diff --git a/python/user_packages/Python313/site-packages/langsmith/testing/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/testing/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44691f73430804235f83fe2ee420f8922434708b Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/testing/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/testing/__pycache__/_internal.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/testing/__pycache__/_internal.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb0020857c6ddf24dee96d5931e2aa20c8782ab7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/testing/__pycache__/_internal.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/testing/_internal.py b/python/user_packages/Python313/site-packages/langsmith/testing/_internal.py new file mode 100644 index 0000000000000000000000000000000000000000..22ee38742be75e2ec2149952a235bb43ed37d39e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/testing/_internal.py @@ -0,0 +1,1470 @@ +from __future__ import annotations + +import atexit +import contextlib +import contextvars +import datetime +import functools +import hashlib +import importlib +import inspect +import logging +import os +import threading +import time +import uuid +import warnings +from collections.abc import Generator, Sequence +from concurrent.futures import Future +from pathlib import Path +from typing import ( + Any, + Callable, + Optional, + TypeVar, + Union, + cast, + overload, +) + +from typing_extensions import TypedDict + +from langsmith import client as ls_client +from langsmith import env as ls_env +from langsmith import run_helpers as rh +from langsmith import run_trees +from langsmith import run_trees as rt +from langsmith import schemas as ls_schemas +from langsmith import utils as ls_utils +from langsmith._internal import _orjson +from langsmith._internal._serde import dumps_json +from langsmith.client import ID_TYPE + +try: + import pytest # type: ignore + + SkipException = pytest.skip.Exception +except ImportError: + + class SkipException(Exception): # type: ignore[no-redef] + pass + + +logger = logging.getLogger(__name__) + +# UUID5 namespace used for generating consistent example IDs +UUID5_NAMESPACE = uuid.UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8") + +T = TypeVar("T") +U = TypeVar("U") + + +def _object_hash(obj: Any) -> str: + """Hash an object to generate a consistent hash string.""" + # Use the existing serialization infrastructure with consistent ordering + serialized = _stringify(obj) + return hashlib.sha256(serialized.encode()).hexdigest() + + +@overload +def test( + func: Callable, +) -> Callable: ... + + +@overload +def test( + *, + id: Optional[uuid.UUID] = None, + output_keys: Optional[Sequence[str]] = None, + client: Optional[ls_client.Client] = None, + test_suite_name: Optional[str] = None, + metadata: Optional[dict] = None, + experiment_metadata: Optional[dict] = None, + repetitions: Optional[int] = None, + split: Optional[Union[str | list[str]]] = None, + cached_hosts: Optional[Sequence[str]] = None, +) -> Callable[[Callable], Callable]: ... + + +def test(*args: Any, **kwargs: Any) -> Callable: + """Trace a pytest test case in LangSmith. + + This decorator is used to trace a pytest test to LangSmith. It ensures + that the necessary example data is created and associated with the test function. + The decorated function will be executed as a test case, and the results will be + recorded and reported by LangSmith. + + Args: + - id (Optional[uuid.UUID]): A unique identifier for the test case. If not + provided, an ID will be generated based on the test function's module + and name. + - output_keys (Optional[Sequence[str]]): A list of keys to be considered as + the output keys for the test case. These keys will be extracted from the + test function's inputs and stored as the expected outputs. + - client (Optional[ls_client.Client]): An instance of the LangSmith client + to be used for communication with the LangSmith service. If not provided, + a default client will be used. + - test_suite_name (Optional[str]): The name of the test suite to which the + test case belongs. If not provided, the test suite name will be determined + based on the environment or the package name. + - cached_hosts (Optional[Sequence[str]]): A list of hosts or URL prefixes to + cache requests to during testing. If not provided, all requests will be + cached (default behavior). This is useful for caching only specific + API calls (e.g., ["api.openai.com"] or ["https://api.openai.com"]). + + Returns: + Callable: The decorated test function. + + Environment: + - `LANGSMITH_TEST_CACHE`: If set, API calls will be cached to disk to + save time and costs during testing. Recommended to commit the + cache files to your repository for faster CI/CD runs. + Requires the 'langsmith[vcr]' package to be installed. + - `LANGSMITH_TEST_TRACKING`: Set this variable to the path of a directory + to enable caching of test results. This is useful for re-running tests + without re-executing the code. Requires the 'langsmith[vcr]' package. + + Example: + For basic usage, simply decorate a test function with `@pytest.mark.langsmith`. + Under the hood this will call the `test` method: + + ```python + import pytest + + + # Equivalently can decorate with `test` directly: + # from langsmith import test + # @test + @pytest.mark.langsmith + def test_addition(): + assert 3 + 4 == 7 + ``` + + + Any code that is traced (such as those traced using `@traceable` + or `wrap_*` functions) will be traced within the test case for + improved visibility and debugging. + + ```python + import pytest + from langsmith import traceable + + + @traceable + def generate_numbers(): + return 3, 4 + + + @pytest.mark.langsmith + def test_nested(): + # Traced code will be included in the test case + a, b = generate_numbers() + assert a + b == 7 + ``` + + LLM calls are expensive! Cache requests by setting + `LANGSMITH_TEST_CACHE=path/to/cache`. Check in these files to speed up + CI/CD pipelines, so your results only change when your prompt or requested + model changes. + + Note that this will require that you install langsmith with the `vcr` extra: + + `pip install -U "langsmith[vcr]"` + + Caching is faster if you install libyaml. See + https://vcrpy.readthedocs.io/en/latest/installation.html#speed for more details. + + ```python + # os.environ["LANGSMITH_TEST_CACHE"] = "tests/cassettes" + import openai + import pytest + from langsmith import wrappers + + oai_client = wrappers.wrap_openai(openai.Client()) + + + @pytest.mark.langsmith + def test_openai_says_hello(): + # Traced code will be included in the test case + response = oai_client.chat.completions.create( + model="gpt-3.5-turbo", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say hello!"}, + ], + ) + assert "hello" in response.choices[0].message.content.lower() + ``` + + You can also specify which hosts to cache by using the `cached_hosts` parameter. + This is useful when you only want to cache specific API calls: + + ```python + @pytest.mark.langsmith(cached_hosts=["https://api.openai.com"]) + def test_openai_with_selective_caching(): + # Only OpenAI API calls will be cached, other API calls will not + # be cached + response = oai_client.chat.completions.create( + model="gpt-3.5-turbo", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say hello!"}, + ], + ) + assert "hello" in response.choices[0].message.content.lower() + ``` + + LLMs are stochastic. Naive assertions are flakey. You can use langsmith's + `expect` to score and make approximate assertions on your results. + + ```python + import pytest + from langsmith import expect + + + @pytest.mark.langsmith + def test_output_semantically_close(): + response = oai_client.chat.completions.create( + model="gpt-3.5-turbo", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say hello!"}, + ], + ) + # The embedding_distance call logs the embedding distance to LangSmith + expect.embedding_distance( + prediction=response.choices[0].message.content, + reference="Hello!", + # The following optional assertion logs a + # pass/fail score to LangSmith + # and raises an AssertionError if the assertion fails. + ).to_be_less_than(1.0) + # Compute damerau_levenshtein distance + expect.edit_distance( + prediction=response.choices[0].message.content, + reference="Hello!", + # And then log a pass/fail score to LangSmith + ).to_be_less_than(1.0) + ``` + + The `@test` decorator works natively with pytest fixtures. + The values will populate the "inputs" of the corresponding example in LangSmith. + + ```python + import pytest + + + @pytest.fixture + def some_input(): + return "Some input" + + + @pytest.mark.langsmith + def test_with_fixture(some_input: str): + assert "input" in some_input + ``` + + You can still use `pytest.parametrize()` as usual to run multiple test cases + using the same test function. + + ```python + import pytest + + + @pytest.mark.langsmith(output_keys=["expected"]) + @pytest.mark.parametrize( + "a, b, expected", + [ + (1, 2, 3), + (3, 4, 7), + ], + ) + def test_addition_with_multiple_inputs(a: int, b: int, expected: int): + assert a + b == expected + ``` + + By default, each test case will be assigned a consistent, unique identifier + based on the function name and module. You can also provide a custom identifier + using the `id` argument: + + ```python + import pytest + import uuid + + example_id = uuid.uuid4() + + + @pytest.mark.langsmith(id=str(example_id)) + def test_multiplication(): + assert 3 * 4 == 12 + ``` + + By default, all test inputs are saved as "inputs" to a dataset. + You can specify the `output_keys` argument to persist those keys + within the dataset's "outputs" fields. + + ```python + import pytest + + + @pytest.fixture + def expected_output(): + return "input" + + + @pytest.mark.langsmith(output_keys=["expected_output"]) + def test_with_expected_output(some_input: str, expected_output: str): + assert expected_output in some_input + ``` + + + To run these tests, use the pytest CLI. Or directly run the test functions. + + ```python + test_output_semantically_close() + test_addition() + test_nested() + test_with_fixture("Some input") + test_with_expected_output("Some input", "Some") + test_multiplication() + test_openai_says_hello() + test_addition_with_multiple_inputs(1, 2, 3) + ``` + """ + cached_hosts = kwargs.pop("cached_hosts", None) + cache_dir = ls_utils.get_cache_dir(kwargs.pop("cache", None)) + + # Validate cached_hosts usage + if cached_hosts and not cache_dir: + raise ValueError( + "cached_hosts parameter requires caching to be enabled. " + "Please set the LANGSMITH_TEST_CACHE environment variable " + "to a cache directory path, " + "or pass a cache parameter to the test decorator. " + "Example: LANGSMITH_TEST_CACHE='tests/cassettes' " + "or @pytest.mark.langsmith(cache='tests/cassettes', cached_hosts=[...])" + ) + + langtest_extra = _UTExtra( + id=kwargs.pop("id", None), + output_keys=kwargs.pop("output_keys", None), + client=kwargs.pop("client", None), + test_suite_name=kwargs.pop("test_suite_name", None), + cache=cache_dir, + metadata=kwargs.pop("metadata", None), + experiment_metadata=kwargs.pop("experiment_metadata", None), + repetitions=kwargs.pop("repetitions", None), + split=kwargs.pop("split", None), + cached_hosts=cached_hosts, + ) + if kwargs: + warnings.warn(f"Unexpected keyword arguments: {kwargs.keys()}") + disable_tracking = ls_utils.test_tracking_is_disabled() + if disable_tracking: + logger.info( + "LANGSMITH_TEST_TRACKING is set to 'false'." + " Skipping LangSmith test tracking." + ) + + def decorator(func: Callable) -> Callable: + # Handle repetitions + repetitions = langtest_extra.get("repetitions", 1) or 1 + + if inspect.iscoroutinefunction(func): + + @functools.wraps(func) + async def async_wrapper( + *test_args: Any, request: Any = None, **test_kwargs: Any + ): + if disable_tracking: + return await func(*test_args, **test_kwargs) + + # Run test multiple times for repetitions + for i in range(repetitions): + repetition_extra = langtest_extra.copy() + await _arun_test( + func, + *test_args, + pytest_request=request, + **test_kwargs, + langtest_extra=repetition_extra, + ) + + return async_wrapper + + @functools.wraps(func) + def wrapper(*test_args: Any, request: Any = None, **test_kwargs: Any): + if disable_tracking: + return func(*test_args, **test_kwargs) + + # Run test multiple times for repetitions + for i in range(repetitions): + repetition_extra = langtest_extra.copy() + _run_test( + func, + *test_args, + pytest_request=request, + **test_kwargs, + langtest_extra=repetition_extra, + ) + + return wrapper + + if args and callable(args[0]): + return decorator(args[0]) + + return decorator + + +## Private functions + + +def _get_experiment_name(test_suite_name: str) -> str: + # If this is a pytest-xdist multi-process run then we need to create the same + # experiment name across processes. We can do this by accessing the + # PYTEST_XDIST_TESTRUNID env var. + if os.environ.get("PYTEST_XDIST_TESTRUNUID") and importlib.util.find_spec("xdist"): + id_name = test_suite_name + os.environ["PYTEST_XDIST_TESTRUNUID"] + id_ = str(uuid.uuid5(uuid.NAMESPACE_DNS, id_name).hex[:8]) + else: + id_ = str(uuid.uuid4().hex[:8]) + + if os.environ.get("LANGSMITH_EXPERIMENT"): + prefix = os.environ["LANGSMITH_EXPERIMENT"] + else: + prefix = ls_utils.get_tracer_project(False) or "TestSuiteResult" + name = f"{prefix}:{id_}" + return name + + +def _get_test_suite_name(func: Callable) -> str: + test_suite_name = ls_utils.get_env_var("TEST_SUITE") + if test_suite_name: + return test_suite_name + repo_name = ls_env.get_git_info()["repo_name"] + try: + mod = inspect.getmodule(func) + if mod: + return f"{repo_name}.{mod.__name__}" + except BaseException: + logger.debug("Could not determine test suite name from file path.") + + raise ValueError("Please set the LANGSMITH_TEST_SUITE environment variable.") + + +def _get_test_suite( + client: ls_client.Client, test_suite_name: str +) -> ls_schemas.Dataset: + if client.has_dataset(dataset_name=test_suite_name): + return client.read_dataset(dataset_name=test_suite_name) + else: + repo = ls_env.get_git_info().get("remote_url") or "" + description = "Test suite" + if repo: + description += f" for {repo}" + try: + return client.create_dataset( + dataset_name=test_suite_name, + description=description, + metadata={"__ls_runner": "pytest"}, + ) + except ls_utils.LangSmithConflictError: + return client.read_dataset(dataset_name=test_suite_name) + + +def _start_experiment( + client: ls_client.Client, + test_suite: ls_schemas.Dataset, + experiment_metadata: Optional[dict] = None, +) -> ls_schemas.TracerSession: + experiment_name = _get_experiment_name(test_suite.name) + # User-provided experiment_metadata is merged first so that system keys + # (revision_id, __ls_runner) always take precedence. + metadata = { + **(experiment_metadata or {}), + "revision_id": ls_env.get_langchain_env_var_metadata().get("revision_id"), + "__ls_runner": "pytest", + } + try: + return client.create_project( + experiment_name, + reference_dataset_id=test_suite.id, + description="Test Suite Results.", + metadata=metadata, + ) + except ls_utils.LangSmithConflictError: + return client.read_project(project_name=experiment_name) + + +def _get_example_id( + dataset_id: str, + inputs: dict, + outputs: Optional[dict] = None, +) -> uuid.UUID: + """Generate example ID based on inputs, outputs, and dataset ID.""" + identifier_obj = (dataset_id, _object_hash(inputs), _object_hash(outputs or {})) + identifier = _stringify(identifier_obj) + return uuid.uuid5(UUID5_NAMESPACE, identifier) + + +def _get_example_id_legacy( + func: Callable, inputs: Optional[dict], suite_id: uuid.UUID +) -> tuple[uuid.UUID, str]: + try: + file_path = str(Path(inspect.getfile(func)).relative_to(Path.cwd())) + except ValueError: + # Fall back to module name if file path is not available + file_path = func.__module__ + identifier = f"{suite_id}{file_path}::{func.__name__}" + # If parametrized test, need to add inputs to identifier: + if hasattr(func, "pytestmark") and any( + m.name == "parametrize" for m in func.pytestmark + ): + identifier += _stringify(inputs) + return uuid.uuid5(uuid.NAMESPACE_DNS, identifier), identifier[len(str(suite_id)) :] + + +def _end_tests(test_suite: _LangSmithTestSuite): + git_info = ls_env.get_git_info() or {} + test_suite.shutdown() + dataset_version = test_suite.get_dataset_version() + dataset_id = test_suite._dataset.id + # User-provided experiment_metadata is merged first so that system keys + # always take precedence. + test_suite.client.update_project( + test_suite.experiment_id, + metadata={ + **(test_suite.experiment_metadata or {}), + **git_info, + "dataset_version": dataset_version, + "revision_id": ls_env.get_langchain_env_var_metadata().get("revision_id"), + "__ls_runner": "pytest", + }, + ) + if dataset_version and git_info["commit"] is not None: + test_suite.client.update_dataset_tag( + dataset_id=dataset_id, + as_of=dataset_version, + tag=f"git:commit:{git_info['commit']}", + ) + if dataset_version and git_info["branch"] is not None: + test_suite.client.update_dataset_tag( + dataset_id=dataset_id, + as_of=dataset_version, + tag=f"git:branch:{git_info['branch']}", + ) + + +VT = TypeVar("VT", bound=Optional[dict]) + + +def _serde_example_values(values: VT) -> VT: + if values is None: + return cast(VT, values) + bts = ls_client._dumps_json(values) + return _orjson.loads(bts) + + +class _LangSmithTestSuite: + _instances: Optional[dict] = None + _lock = threading.RLock() + + def __init__( + self, + client: Optional[ls_client.Client], + experiment: ls_schemas.TracerSession, + dataset: ls_schemas.Dataset, + experiment_metadata: Optional[dict] = None, + ): + self.client = client or rt.get_cached_client() + self._experiment = experiment + self._dataset = dataset + self._dataset_version: Optional[datetime.datetime] = dataset.modified_at + self._executor = ls_utils.ContextThreadPoolExecutor() + self.experiment_metadata = experiment_metadata + atexit.register(_end_tests, self) + + @property + def id(self): + return self._dataset.id + + @property + def experiment_id(self): + return self._experiment.id + + @property + def experiment(self): + return self._experiment + + @classmethod + def from_test( + cls, + client: Optional[ls_client.Client], + func: Callable, + test_suite_name: Optional[str] = None, + experiment_metadata: Optional[dict] = None, + ) -> _LangSmithTestSuite: + client = client or rt.get_cached_client() + test_suite_name = test_suite_name or _get_test_suite_name(func) + with cls._lock: + if not cls._instances: + cls._instances = {} + if test_suite_name not in cls._instances: + test_suite = _get_test_suite(client, test_suite_name) + experiment = _start_experiment(client, test_suite, experiment_metadata) + cls._instances[test_suite_name] = cls( + client, experiment, test_suite, experiment_metadata + ) + return cls._instances[test_suite_name] + + @property + def name(self): + return self._experiment.name + + def get_dataset_version(self): + return self._dataset_version + + def submit_result( + self, + run_id: uuid.UUID, + error: Optional[str] = None, + skipped: bool = False, + pytest_plugin: Any = None, + pytest_nodeid: Any = None, + ) -> None: + if skipped: + score = None + status = "skipped" + elif error: + score = 0 + status = "failed" + else: + score = 1 + status = "passed" + if pytest_plugin and pytest_nodeid: + pytest_plugin.update_process_status(pytest_nodeid, {"status": status}) + self._executor.submit(self._submit_result, run_id, score) + + def _submit_result(self, run_id: uuid.UUID, score: Optional[int]) -> None: + # trace_id will always be run_id here because the feedback is on the root + # test run + self.client.create_feedback(run_id, key="pass", score=score, trace_id=run_id) + + def sync_example( + self, + example_id: uuid.UUID, + *, + inputs: Optional[dict] = None, + outputs: Optional[dict] = None, + metadata: Optional[dict] = None, + split: Optional[Union[str, list[str]]] = None, + pytest_plugin=None, + pytest_nodeid=None, + ) -> None: + inputs = inputs or {} + if pytest_plugin and pytest_nodeid: + update = {"inputs": inputs, "reference_outputs": outputs} + update = {k: v for k, v in update.items() if v is not None} + pytest_plugin.update_process_status(pytest_nodeid, update) + metadata = metadata.copy() if metadata else metadata + inputs = _serde_example_values(inputs) + outputs = _serde_example_values(outputs) + try: + example = self.client.read_example(example_id=example_id) + except ls_utils.LangSmithNotFoundError: + try: + example = self.client.create_example( + example_id=example_id, + inputs=inputs, + outputs=outputs, + dataset_id=self.id, + metadata=metadata, + split=split, + created_at=self._experiment.start_time, + ) + except ls_utils.LangSmithConflictError: + # Another worker (e.g. pytest-xdist) created this example + # concurrently between our read and create. Read the existing one. + example = self.client.read_example(example_id=example_id) + else: + normalized_split = split + if isinstance(normalized_split, str): + normalized_split = [normalized_split] + if normalized_split and metadata: + metadata["dataset_split"] = normalized_split + existing_dataset_split = (example.metadata or {}).pop("dataset_split") + if ( + (inputs != example.inputs) + or (outputs is not None and outputs != example.outputs) + or (metadata is not None and metadata != example.metadata) + or str(example.dataset_id) != str(self.id) + or ( + normalized_split is not None + and existing_dataset_split != normalized_split + ) + ): + self.client.update_example( + example_id=example.id, + inputs=inputs, + outputs=outputs, + metadata=metadata, + split=split, + dataset_id=self.id, + ) + example = self.client.read_example(example_id=example.id) + if self._dataset_version is None: + self._dataset_version = example.modified_at + elif ( + example.modified_at + and self._dataset_version + and example.modified_at > self._dataset_version + ): + self._dataset_version = example.modified_at + + def _submit_feedback( + self, + run_id: ID_TYPE, + feedback: Union[dict, list], + pytest_plugin: Any = None, + pytest_nodeid: Any = None, + **kwargs: Any, + ): + feedback = feedback if isinstance(feedback, list) else [feedback] + for fb in feedback: + if pytest_plugin and pytest_nodeid: + val = fb["score"] if "score" in fb else fb["value"] + pytest_plugin.update_process_status( + pytest_nodeid, {"feedback": {fb["key"]: val}} + ) + self._executor.submit( + self._create_feedback, run_id=run_id, feedback=fb, **kwargs + ) + + def _create_feedback(self, run_id: ID_TYPE, feedback: dict, **kwargs: Any) -> None: + # trace_id will always be run_id here because the feedback is on the root + # test run + self.client.create_feedback(run_id, **feedback, **kwargs, trace_id=run_id) + + def shutdown(self): + self._executor.shutdown() + + def end_run( + self, + run_tree, + example_id, + outputs, + reference_outputs, + metadata, + split, + pytest_plugin=None, + pytest_nodeid=None, + ) -> Future: + return self._executor.submit( + self._end_run, + run_tree=run_tree, + example_id=example_id, + outputs=outputs, + reference_outputs=reference_outputs, + metadata=metadata, + split=split, + pytest_plugin=pytest_plugin, + pytest_nodeid=pytest_nodeid, + ) + + def _end_run( + self, + run_tree, + example_id, + outputs, + reference_outputs, + metadata, + split, + pytest_plugin, + pytest_nodeid, + ) -> None: + # TODO: remove this hack so that run durations are correct + # Ensure example is fully updated + self.sync_example( + example_id, + inputs=run_tree.inputs, + outputs=reference_outputs, + split=split, + metadata=metadata, + ) + run_tree.reference_example_id = example_id + run_tree.end(outputs=outputs, metadata={"reference_example_id": example_id}) + run_tree.patch() + + +class _TestCase: + def __init__( + self, + test_suite: _LangSmithTestSuite, + run_id: uuid.UUID, + example_id: Optional[uuid.UUID] = None, + metadata: Optional[dict] = None, + split: Optional[Union[str, list[str]]] = None, + pytest_plugin: Any = None, + pytest_nodeid: Any = None, + inputs: Optional[dict] = None, + reference_outputs: Optional[dict] = None, + ) -> None: + self.test_suite = test_suite + self.example_id = example_id + self.run_id = run_id + self.metadata = metadata + self.split = split + self.pytest_plugin = pytest_plugin + self.pytest_nodeid = pytest_nodeid + self.inputs = inputs + self.reference_outputs = reference_outputs + self._logged_reference_outputs: Optional[dict] = None + self._logged_outputs: Optional[dict] = None + + if pytest_plugin and pytest_nodeid: + pytest_plugin.add_process_to_test_suite( + test_suite._dataset.name, pytest_nodeid + ) + if inputs: + self.log_inputs(inputs) + if reference_outputs: + self.log_reference_outputs(reference_outputs) + + def submit_feedback(self, *args, **kwargs: Any): + self.test_suite._submit_feedback( + *args, + **{ + **kwargs, + **dict( + pytest_plugin=self.pytest_plugin, + pytest_nodeid=self.pytest_nodeid, + ), + }, + ) + + def log_inputs(self, inputs: dict) -> None: + self.inputs = inputs + if self.pytest_plugin and self.pytest_nodeid: + self.pytest_plugin.update_process_status( + self.pytest_nodeid, {"inputs": inputs} + ) + + def log_outputs(self, outputs: dict) -> None: + self._logged_outputs = outputs + if self.pytest_plugin and self.pytest_nodeid: + self.pytest_plugin.update_process_status( + self.pytest_nodeid, {"outputs": outputs} + ) + + def log_reference_outputs(self, reference_outputs: dict) -> None: + self._logged_reference_outputs = reference_outputs + if self.pytest_plugin and self.pytest_nodeid: + self.pytest_plugin.update_process_status( + self.pytest_nodeid, {"reference_outputs": reference_outputs} + ) + + def submit_test_result( + self, + error: Optional[str] = None, + skipped: bool = False, + ) -> None: + return self.test_suite.submit_result( + self.run_id, + error=error, + skipped=skipped, + pytest_plugin=self.pytest_plugin, + pytest_nodeid=self.pytest_nodeid, + ) + + def start_time(self) -> None: + if self.pytest_plugin and self.pytest_nodeid: + self.pytest_plugin.update_process_status( + self.pytest_nodeid, {"start_time": time.time()} + ) + + def end_time(self) -> None: + if self.pytest_plugin and self.pytest_nodeid: + self.pytest_plugin.update_process_status( + self.pytest_nodeid, {"end_time": time.time()} + ) + + def end_run(self, run_tree, outputs: Any) -> None: + if not (outputs is None or isinstance(outputs, dict)): + outputs = {"output": outputs} + example_id = self.example_id or _get_example_id( + dataset_id=str(self.test_suite.id), + inputs=self.inputs or {}, + outputs=outputs, + ) + self.test_suite.end_run( + run_tree, + example_id, + outputs, + reference_outputs=self._logged_reference_outputs, + metadata=self.metadata, + split=self.split, + pytest_plugin=self.pytest_plugin, + pytest_nodeid=self.pytest_nodeid, + ) + + +_TEST_CASE = contextvars.ContextVar[Optional[_TestCase]]("_TEST_CASE", default=None) + + +class _UTExtra(TypedDict, total=False): + client: Optional[ls_client.Client] + id: Optional[uuid.UUID] + output_keys: Optional[Sequence[str]] + test_suite_name: Optional[str] + cache: Optional[str] + metadata: Optional[dict] + experiment_metadata: Optional[dict] + repetitions: Optional[int] + split: Optional[Union[str, list[str]]] + cached_hosts: Optional[Sequence[str]] + + +def _create_test_case( + func: Callable, + *args: Any, + pytest_request: Any, + langtest_extra: _UTExtra, + **kwargs: Any, +) -> _TestCase: + client = langtest_extra["client"] or rt.get_cached_client() + output_keys = langtest_extra["output_keys"] + metadata = langtest_extra["metadata"] + split = langtest_extra["split"] + # Resolve experiment_metadata: explicit kwarg > env var + experiment_metadata = langtest_extra.get("experiment_metadata") + if experiment_metadata is None: + env_val = os.environ.get("LANGSMITH_EXPERIMENT_METADATA") + if env_val: + try: + experiment_metadata = _orjson.loads(env_val) + except Exception as e: + msg = f"LANGSMITH_EXPERIMENT_METADATA env var is not valid JSON: {e}" + raise ValueError(msg) from e + signature = inspect.signature(func) + inputs = rh._get_inputs_safe(signature, *args, **kwargs) or None + outputs = None + if output_keys: + outputs = {} + if not inputs: + msg = ( + "'output_keys' should only be specified when marked test function has " + "input arguments." + ) + raise ValueError(msg) + for k in output_keys: + outputs[k] = inputs.pop(k, None) + test_suite = _LangSmithTestSuite.from_test( + client, func, langtest_extra.get("test_suite_name"), experiment_metadata + ) + example_id = langtest_extra["id"] + dataset_sdk_version = ( + test_suite._dataset.metadata + and test_suite._dataset.metadata.get("runtime") + and test_suite._dataset.metadata.get("runtime", {}).get("sdk_version") + ) + if not dataset_sdk_version or not ls_utils.is_version_greater_or_equal( + dataset_sdk_version, "0.4.33" + ): + legacy_example_id, example_name = _get_example_id_legacy( + func, inputs, test_suite.id + ) + example_id = example_id or legacy_example_id + pytest_plugin = ( + pytest_request.config.pluginmanager.get_plugin("langsmith_output_plugin") + if pytest_request + else None + ) + pytest_nodeid = pytest_request.node.nodeid if pytest_request else None + if pytest_plugin: + pytest_plugin.test_suite_urls[test_suite._dataset.name] = ( + cast(str, test_suite._dataset.url) + + "/compare?selectedSessions=" + + str(test_suite.experiment_id) + ) + test_case = _TestCase( + test_suite, + run_id=uuid.uuid4(), + example_id=example_id, + metadata=metadata, + split=split, + inputs=inputs, + reference_outputs=outputs, + pytest_plugin=pytest_plugin, + pytest_nodeid=pytest_nodeid, + ) + return test_case + + +def _run_test( + func: Callable, + *test_args: Any, + pytest_request: Any, + langtest_extra: _UTExtra, + **test_kwargs: Any, +) -> None: + test_case = _create_test_case( + func, + *test_args, + **test_kwargs, + pytest_request=pytest_request, + langtest_extra=langtest_extra, + ) + _TEST_CASE.set(test_case) + + def _test(): + test_case.start_time() + with rh.trace( + name=getattr(func, "__name__", "Test"), + run_id=test_case.run_id, + inputs=test_case.inputs, + metadata={ + # Experiment run metadata is prefixed with "ls_example_" in + # the ingest backend, but we must reproduce this behavior here + # because the example may not have been created before the trace + # starts. + f"ls_example_{k}": v + for k, v in (test_case.metadata or {}).items() + }, + project_name=test_case.test_suite.name, + exceptions_to_handle=(SkipException,), + _end_on_exit=False, + ) as run_tree: + try: + result = func(*test_args, **test_kwargs) + except SkipException as e: + test_case.submit_test_result(error=repr(e), skipped=True) + test_case.end_run(run_tree, {"skipped_reason": repr(e)}) + raise e + except BaseException as e: + test_case.submit_test_result(error=repr(e)) + test_case.end_run(run_tree, None) + raise e + else: + test_case.end_run(run_tree, result) + finally: + test_case.end_time() + try: + test_case.submit_test_result() + except BaseException as e: + logger.warning( + f"Failed to create feedback for run_id {test_case.run_id}:\n{e}" + ) + + if langtest_extra["cache"]: + cache_path = Path(langtest_extra["cache"]) / f"{test_case.test_suite.id}.yaml" + else: + cache_path = None + current_context = rh.get_tracing_context() + metadata = { + **(current_context["metadata"] or {}), + **{ + "experiment": test_case.test_suite.experiment.name, + }, + } + # Handle cached_hosts parameter + ignore_hosts = [test_case.test_suite.client.api_url] + allow_hosts = langtest_extra.get("cached_hosts") or None + + with ( + rh.tracing_context(**{**current_context, "metadata": metadata}), + ls_utils.with_optional_cache( + cache_path, ignore_hosts=ignore_hosts, allow_hosts=allow_hosts + ), + ): + _test() + + +async def _arun_test( + func: Callable, + *test_args: Any, + pytest_request: Any, + langtest_extra: _UTExtra, + **test_kwargs: Any, +) -> None: + test_case = _create_test_case( + func, + *test_args, + **test_kwargs, + pytest_request=pytest_request, + langtest_extra=langtest_extra, + ) + _TEST_CASE.set(test_case) + + async def _test(): + test_case.start_time() + with rh.trace( + name=getattr(func, "__name__", "Test"), + run_id=test_case.run_id, + reference_example_id=test_case.example_id, + inputs=test_case.inputs, + metadata={ + # Experiment run metadata is prefixed with "ls_example_" in + # the ingest backend, but we must reproduce this behavior here + # because the example may not have been created before the trace + # starts. + f"ls_example_{k}": v + for k, v in (test_case.metadata or {}).items() + }, + project_name=test_case.test_suite.name, + exceptions_to_handle=(SkipException,), + _end_on_exit=False, + ) as run_tree: + try: + result = await func(*test_args, **test_kwargs) + except SkipException as e: + test_case.submit_test_result(error=repr(e), skipped=True) + test_case.end_run(run_tree, {"skipped_reason": repr(e)}) + raise e + except BaseException as e: + test_case.submit_test_result(error=repr(e)) + test_case.end_run(run_tree, None) + raise e + else: + test_case.end_run(run_tree, result) + finally: + test_case.end_time() + try: + test_case.submit_test_result() + except BaseException as e: + logger.warning( + f"Failed to create feedback for run_id {test_case.run_id}:\n{e}" + ) + + if langtest_extra["cache"]: + cache_path = Path(langtest_extra["cache"]) / f"{test_case.test_suite.id}.yaml" + else: + cache_path = None + current_context = rh.get_tracing_context() + metadata = { + **(current_context["metadata"] or {}), + **{ + "experiment": test_case.test_suite.experiment.name, + "reference_example_id": str(test_case.example_id), + }, + } + # Handle cached_hosts parameter + ignore_hosts = [test_case.test_suite.client.api_url] + cached_hosts = langtest_extra.get("cached_hosts") + allow_hosts = cached_hosts if cached_hosts else None + + with ( + rh.tracing_context(**{**current_context, "metadata": metadata}), + ls_utils.with_optional_cache( + cache_path, ignore_hosts=ignore_hosts, allow_hosts=allow_hosts + ), + ): + await _test() + + +# For backwards compatibility +unit = test + + +def log_inputs(inputs: dict, /) -> None: + """Log run inputs from within a pytest test run. + + Should only be used in pytest tests decorated with @pytest.mark.langsmith. + + Args: + inputs: Inputs to log. + + Example: + ```python + from langsmith import testing as t + + + @pytest.mark.langsmith + def test_foo() -> None: + x = 0 + y = 1 + t.log_inputs({"x": x, "y": y}) + assert foo(x, y) == 2 + ``` + """ + if ls_utils.test_tracking_is_disabled(): + logger.info("LANGSMITH_TEST_TRACKING is set to 'false'. Skipping log_inputs.") + return + run_tree = rh.get_current_run_tree() + test_case = _TEST_CASE.get() + if not run_tree or not test_case: + msg = ( + "log_inputs should only be called within a pytest test decorated with " + "@pytest.mark.langsmith, and with tracing enabled (by setting the " + "LANGSMITH_TRACING environment variable to 'true')." + ) + raise ValueError(msg) + run_tree.add_inputs(inputs) + test_case.log_inputs(run_tree.inputs) + + +def log_outputs(outputs: dict, /) -> None: + """Log run outputs from within a pytest test run. + + Should only be used in pytest tests decorated with @pytest.mark.langsmith. + + Args: + outputs: Outputs to log. + + Example: + ```python + from langsmith import testing as t + + + @pytest.mark.langsmith + def test_foo() -> None: + x = 0 + y = 1 + result = foo(x, y) + t.log_outputs({"foo": result}) + assert result == 2 + ``` + """ + if ls_utils.test_tracking_is_disabled(): + logger.info("LANGSMITH_TEST_TRACKING is set to 'false'. Skipping log_outputs.") + return + run_tree = rh.get_current_run_tree() + test_case = _TEST_CASE.get() + if not run_tree or not test_case: + msg = ( + "log_outputs should only be called within a pytest test decorated with " + "@pytest.mark.langsmith, and with tracing enabled (by setting the " + "LANGSMITH_TRACING environment variable to 'true')." + ) + raise ValueError(msg) + outputs = _dumpd(outputs) + run_tree.add_outputs(outputs) + test_case.log_outputs(outputs) + + +def log_reference_outputs(reference_outputs: dict, /) -> None: + """Log example reference outputs from within a pytest test run. + + Should only be used in pytest tests decorated with @pytest.mark.langsmith. + + Args: + reference_outputs: Reference outputs to log. + + Example: + ```python + from langsmith import testing + + + @pytest.mark.langsmith + def test_foo() -> None: + x = 0 + y = 1 + expected = 2 + testing.log_reference_outputs({"foo": expected}) + assert foo(x, y) == expected + ``` + """ + if ls_utils.test_tracking_is_disabled(): + logger.info( + "LANGSMITH_TEST_TRACKING is set to 'false'. Skipping log_reference_outputs." + ) + return + test_case = _TEST_CASE.get() + if not test_case: + msg = ( + "log_reference_outputs should only be called within a pytest test " + "decorated with @pytest.mark.langsmith." + ) + raise ValueError(msg) + test_case.log_reference_outputs(reference_outputs) + + +def log_feedback( + feedback: Optional[Union[dict, list[dict]]] = None, + /, + *, + key: str, + score: Optional[Union[int, bool, float]] = None, + value: Optional[Union[str, int, float, bool]] = None, + **kwargs: Any, +) -> None: + """Log run feedback from within a pytest test run. + + Should only be used in pytest tests decorated with @pytest.mark.langsmith. + + Args: + key: Feedback name. + score: Numerical feedback value. + value: Categorical feedback value + kwargs: Any other Client.create_feedback args. + + Example: + ```python + import pytest + from langsmith import testing as t + + + @pytest.mark.langsmith + def test_foo() -> None: + x = 0 + y = 1 + expected = 2 + result = foo(x, y) + t.log_feedback(key="right_type", score=isinstance(result, int)) + assert result == expected + ``` + """ + if ls_utils.test_tracking_is_disabled(): + logger.info("LANGSMITH_TEST_TRACKING is set to 'false'. Skipping log_feedback.") + return + if feedback and any((key, score, value)): + msg = "Must specify one of 'feedback' and ('key', 'score', 'value'), not both." + raise ValueError(msg) + elif not (feedback or key): + msg = "Must specify at least one of 'feedback' or ('key', 'score', value')." + raise ValueError(msg) + elif key: + feedback = {"key": key} + if score is not None: + feedback["score"] = score + if value is not None: + feedback["value"] = value + else: + pass + + run_tree = rh.get_current_run_tree() + test_case = _TEST_CASE.get() + if not run_tree or not test_case: + msg = ( + "log_feedback should only be called within a pytest test decorated with " + "@pytest.mark.langsmith, and with tracing enabled (by setting the " + "LANGSMITH_TRACING environment variable to 'true')." + ) + raise ValueError(msg) + if run_tree.session_name == "evaluators" and run_tree.metadata.get( + "reference_run_id" + ): + run_id = run_tree.metadata["reference_run_id"] + run_tree.add_outputs( + feedback if isinstance(feedback, dict) else {"feedback": feedback} + ) + kwargs["source_run_id"] = run_tree.id + else: + run_id = run_tree.trace_id + test_case.submit_feedback(run_id, cast(Union[list, dict], feedback), **kwargs) + + +@contextlib.contextmanager +def trace_feedback( + *, name: str = "Feedback" +) -> Generator[Optional[run_trees.RunTree], None, None]: + """Trace the computation of a pytest run feedback as its own run. + + Args: + name: Feedback run name. Defaults to "Feedback". + + Example: + ```python + import openai + import pytest + + from langsmith import testing as t + from langsmith import wrappers + + oai_client = wrappers.wrap_openai(openai.Client()) + + + @pytest.mark.langsmith + def test_openai_says_hello(): + # Traced code will be included in the test case + text = "Say hello!" + response = oai_client.chat.completions.create( + model="gpt-4o-mini", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": text}, + ], + ) + t.log_inputs({"text": text}) + t.log_outputs({"response": response.choices[0].message.content}) + t.log_reference_outputs({"response": "hello!"}) + + # Use this context manager to trace any steps used for generating evaluation + # feedback separately from the main application logic + with t.trace_feedback(): + grade = oai_client.chat.completions.create( + model="gpt-4o-mini", + messages=[ + { + "role": "system", + "content": "Return 1 if 'hello' is in the user message and 0 otherwise.", + }, + { + "role": "user", + "content": response.choices[0].message.content, + }, + ], + ) + # Make sure to log relevant feedback within the context for the + # trace to be associated with this feedback. + t.log_feedback( + key="llm_judge", score=float(grade.choices[0].message.content) + ) + + assert "hello" in response.choices[0].message.content.lower() + ``` + """ # noqa: E501 + if ls_utils.test_tracking_is_disabled(): + logger.info("LANGSMITH_TEST_TRACKING is set to 'false'. Skipping log_feedback.") + yield None + return + test_case = _TEST_CASE.get() + if not test_case: + msg = ( + "trace_feedback should only be called within a pytest test decorated with " + "@pytest.mark.langsmith, and with tracing enabled (by setting the " + "LANGSMITH_TRACING environment variable to 'true')." + ) + raise ValueError(msg) + metadata = { + "experiment": test_case.test_suite.experiment.name, + "reference_example_id": test_case.example_id, + "reference_run_id": test_case.run_id, + } + with rh.trace( + name=name, + inputs=test_case._logged_outputs, + parent="ignore", + project_name="evaluators", + metadata=metadata, + ) as run_tree: + yield run_tree + + +def _stringify(x: Any) -> str: + try: + return dumps_json(x).decode("utf-8", errors="surrogateescape") + except Exception: + return str(x) + + +def _dumpd(x: Any) -> Any: + """Serialize LangChain Serializable objects.""" + dumpd = _get_langchain_dumpd() + if not dumpd: + return x + try: + serialized = dumpd(x) + return serialized + except Exception: + return x + + +@functools.lru_cache +def _get_langchain_dumpd() -> Optional[Callable]: + try: + from langchain_core.load import dumpd + + return dumpd + except ImportError: + return None diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/__init__.py b/python/user_packages/Python313/site-packages/langsmith/wrappers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..da062025e0b8c326b15f03d15f113ca865193fd0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/wrappers/__init__.py @@ -0,0 +1,13 @@ +"""This module provides convenient tracing wrappers for popular libraries.""" + +from langsmith.wrappers._anthropic import wrap_anthropic +from langsmith.wrappers._gemini import wrap_gemini # BETA +from langsmith.wrappers._openai import wrap_openai +from langsmith.wrappers._openai_agents import OpenAIAgentsTracingProcessor + +__all__ = [ + "wrap_anthropic", + "wrap_gemini", # BETA + "wrap_openai", + "OpenAIAgentsTracingProcessor", +] diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..629baaaaf5611bafbd6777104b10f152ba19e934 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_anthropic.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_anthropic.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e7fea41138ea675113659ce1af77aa80d85fa99 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_anthropic.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_gemini.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_gemini.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f55dc420dfd7193f3c2223421e090e0a5d842e2a Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_gemini.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_openai.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_openai.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2fbfdd001362d14fcdf86988aee30e4278a0fa33 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_openai.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_openai_agents.cpython-313.pyc b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_openai_agents.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9afb8454ef098fdd712097fb5669c61d96215f97 Binary files /dev/null and b/python/user_packages/Python313/site-packages/langsmith/wrappers/__pycache__/_openai_agents.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/_anthropic.py b/python/user_packages/Python313/site-packages/langsmith/wrappers/_anthropic.py new file mode 100644 index 0000000000000000000000000000000000000000..ed17394c992678d9a0d58cc7f919bea17640451e --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/wrappers/_anthropic.py @@ -0,0 +1,608 @@ +from __future__ import annotations + +import functools +import logging +import warnings +from collections.abc import AsyncIterator, Mapping, Sequence +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Optional, + TypeVar, + Union, +) + +from typing_extensions import Self, TypedDict + +from langsmith import client as ls_client +from langsmith import run_helpers +from langsmith._internal._orjson import dumps as _dumps +from langsmith.schemas import InputTokenDetails, UsageMetadata + +if TYPE_CHECKING: + import httpx + from anthropic import Anthropic, AsyncAnthropic + from anthropic.lib.streaming import AsyncMessageStream, MessageStream + from anthropic.types import Completion, Message, MessageStreamEvent + +C = TypeVar("C", bound=Union["Anthropic", "AsyncAnthropic", Any]) +logger = logging.getLogger(__name__) + + +@functools.lru_cache +def _get_not_given() -> Optional[tuple[type, ...]]: + try: + from anthropic._types import NotGiven, Omit + + return (NotGiven, Omit) + except ImportError: + return None + + +def _strip_not_given(d: dict) -> dict: + try: + if not_given := _get_not_given(): + d = { + k: v + for k, v in d.items() + if not any(isinstance(v, t) for t in not_given) + } + except Exception as e: + logger.error(f"Error stripping NotGiven: {e}") + + if "system" in d: + d["messages"] = [{"role": "system", "content": d["system"]}] + d.get( + "messages", [] + ) + d.pop("system") + return {k: v for k, v in d.items() if v is not None} + + +def _infer_ls_params(prepopulated_invocation_params: dict, kwargs: dict): + stripped = _strip_not_given(kwargs) + + stop = stripped.get("stop") + if stop and isinstance(stop, str): + stop = [stop] + + # Allowlist of safe invocation parameters to include + # Only include known, non-sensitive parameters + allowed_invocation_keys = { + "mcp_servers", + "service_tier", + "tool_choice", + "top_k", + "top_p", + "stream", + "thinking", + } + + # Only include allowlisted parameters + invocation_params = { + k: v for k, v in stripped.items() if k in allowed_invocation_keys + } + + return { + "ls_provider": "anthropic", + "ls_model_type": "chat", + "ls_model_name": stripped.get("model", None), + "ls_temperature": stripped.get("temperature", None), + "ls_max_tokens": stripped.get("max_tokens", None), + "ls_stop": stop, + "ls_invocation_params": { + **prepopulated_invocation_params, + **invocation_params, + }, + } + + +@functools.lru_cache +def _get_sdk_accumulate_event() -> Optional[Callable]: + try: + from anthropic.lib.streaming._messages import accumulate_event + + return accumulate_event + except ImportError: + return None + + +def _create_usage_metadata(anthropic_token_usage: dict) -> UsageMetadata: + input_tokens = anthropic_token_usage.get("input_tokens") or 0 + output_tokens = anthropic_token_usage.get("output_tokens") or 0 + + input_token_details: dict = {} + cache_read = anthropic_token_usage.get("cache_read_input_tokens") or 0 + if cache_read: + input_token_details["cache_read"] = cache_read + + cache_creation_obj = anthropic_token_usage.get("cache_creation") or {} + if cache_creation_obj: + ephemeral_5m = cache_creation_obj.get("ephemeral_5m_input_tokens") or 0 + ephemeral_1h = cache_creation_obj.get("ephemeral_1h_input_tokens") or 0 + if ephemeral_5m: + input_token_details["ephemeral_5m_input_tokens"] = ephemeral_5m + if ephemeral_1h: + input_token_details["ephemeral_1h_input_tokens"] = ephemeral_1h + else: + cache_creation = anthropic_token_usage.get("cache_creation_input_tokens") or 0 + if cache_creation: + input_token_details["cache_creation"] = cache_creation + + # Anthropic cache tokens are ADDITIVE (not subsets of input_tokens like OpenAI). + # Sum them into input_tokens so the backend cost calculation is correct. + cache_token_sum = sum(input_token_details.values()) + adjusted_input = input_tokens + cache_token_sum + adjusted_total = adjusted_input + output_tokens + + result = UsageMetadata( + input_tokens=adjusted_input, + output_tokens=output_tokens, + total_tokens=adjusted_total, + ) + if input_token_details: + result["input_token_details"] = InputTokenDetails(**input_token_details) + return result + + +def _message_to_outputs(message: Any) -> dict: + """Convert an Anthropic Message to a flat outputs dict with usage_metadata.""" + # ParsedBetaMessage/ParsedMessage (from beta.messages.parse()) carry user-defined + # Pydantic models in parsed_output and ParsedBetaTextBlock in content. These trigger + # PydanticSerializationUnexpectedValue warnings because the values do not match the + # declared union types in the base BetaMessage schema. Suppress for parsed types. + if hasattr(message, "parsed_output"): + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + outputs = message.model_dump() + else: + outputs = message.model_dump() + anthropic_token_usage = outputs.pop("usage", None) + if anthropic_token_usage: + outputs["usage_metadata"] = _create_usage_metadata(anthropic_token_usage) + outputs.pop("type", None) + + content = outputs.get("content") or [] + tool_use_blocks = [ + b for b in content if isinstance(b, dict) and b.get("type") == "tool_use" + ] + if tool_use_blocks: + text_parts = [ + b.get("text", "") + for b in content + if isinstance(b, dict) and b.get("type") == "text" + ] + outputs["content"] = "".join(text_parts) or None + outputs["tool_calls"] = [ + { + "id": block.get("id", f"call_{i}"), + "type": "function", + "index": i, + "function": { + "name": block.get("name", ""), + "arguments": _dumps(block.get("input", {})).decode(), + }, + } + for i, block in enumerate(tool_use_blocks) + ] + return outputs + + +def _reduce_chat_chunks(all_chunks: Sequence) -> dict: + accumulate = _get_sdk_accumulate_event() + if accumulate is None: + return {"output": all_chunks} + full_message = None + for chunk in all_chunks: + try: + full_message = accumulate( + event=chunk, + current_snapshot=full_message, + ) + except RuntimeError as e: + logger.debug(f"Error accumulating event in Anthropic Wrapper: {e}") + return {"output": all_chunks} + if full_message is None: + return {"output": all_chunks} + return _message_to_outputs(full_message) + + +def _reduce_completions(all_chunks: list[Completion]) -> dict: + all_content = [] + for chunk in all_chunks: + content = chunk.completion + if content is not None: + all_content.append(content) + content = "".join(all_content) + if all_chunks: + d = all_chunks[-1].model_dump() + d["choices"] = [{"text": content}] + else: + d = {"choices": [{"text": content}]} + + return d + + +def _process_chat_completion(outputs: Any): + try: + # Check if outputs is a LegacyAPIResponse wrapper (from with_raw_response). + # The Anthropic SDK's LegacyAPIResponse wraps the actual response object. + # Call .parse() to extract the Message for tracing. + # See: anthropics/anthropic-sdk-python _legacy_response.py#L102 + if hasattr(outputs, "parse") and callable(outputs.parse): + try: + outputs = outputs.parse() + except Exception: + pass + return _message_to_outputs(outputs) + except BaseException as e: + logger.debug(f"Error processing chat completion: {e}") + return {"output": outputs} + + +def _get_wrapper( + original_create: Callable, + name: str, + reduce_fn: Callable, + prepopulated_invocation_params: dict, + tracing_extra: TracingExtra, +) -> Callable: + @functools.wraps(original_create) + def create(*args, **kwargs): + stream = kwargs.get("stream") + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=reduce_fn if stream else None, + process_inputs=_strip_not_given, + process_outputs=_process_chat_completion, + _invocation_params_fn=functools.partial( + _infer_ls_params, prepopulated_invocation_params + ), + **tracing_extra, + ) + + result = decorator(original_create)(*args, **kwargs) + return result + + @functools.wraps(original_create) + async def acreate(*args, **kwargs): + stream = kwargs.get("stream") + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=reduce_fn if stream else None, + process_inputs=_strip_not_given, + process_outputs=_process_chat_completion, + _invocation_params_fn=functools.partial( + _infer_ls_params, prepopulated_invocation_params + ), + **tracing_extra, + ) + result = await decorator(original_create)(*args, **kwargs) + return result + + return acreate if run_helpers.is_async(original_create) else create + + +def _get_stream_wrapper( + original_stream: Callable, + name: str, + prepopulated_invocation_params: dict, + tracing_extra: TracingExtra, +) -> Callable: + """Create a wrapper for Anthropic's streaming context manager.""" + is_async = "async" in str(original_stream).lower() + configured_traceable = run_helpers.traceable( + name=name, + reduce_fn=_reduce_chat_chunks, + run_type="llm", + process_inputs=_strip_not_given, + _invocation_params_fn=functools.partial( + _infer_ls_params, prepopulated_invocation_params + ), + **tracing_extra, + ) + configured_traceable_text = run_helpers.traceable( + name=name, + run_type="llm", + process_inputs=_strip_not_given, + process_outputs=_process_chat_completion, + _invocation_params_fn=functools.partial( + _infer_ls_params, prepopulated_invocation_params + ), + **tracing_extra, + ) + + if is_async: + + class AsyncMessageStreamWrapper: + def __init__( + self, + wrapped: AsyncMessageStream, + **kwargs, + ) -> None: + self._wrapped = wrapped + self._kwargs = kwargs + + @property + def text_stream(self): + @configured_traceable_text + async def _text_stream(**_): + async for chunk in self._wrapped.text_stream: + yield chunk + run_tree = run_helpers.get_current_run_tree() + final_message = await self._wrapped.get_final_message() + outputs = _message_to_outputs(final_message) + run_tree.outputs = outputs + if usage := outputs.get("usage_metadata"): + run_tree.metadata["usage_metadata"] = usage + + return _text_stream(**self._kwargs) + + @property + def response(self) -> httpx.Response: + return self._wrapped.response + + @property + def request_id(self) -> str | None: + return self._wrapped.request_id + + async def __anext__(self) -> MessageStreamEvent: + aiter = self.__aiter__() + return await aiter.__anext__() + + async def __aiter__(self) -> AsyncIterator[MessageStreamEvent]: + @configured_traceable + def traced_iter(**_): + return self._wrapped.__aiter__() + + async for chunk in traced_iter(**self._kwargs): + yield chunk + + async def __aenter__(self) -> Self: + await self._wrapped.__aenter__() + return self + + async def __aexit__(self, *exc) -> None: + await self._wrapped.__aexit__(*exc) + + async def close(self) -> None: + await self._wrapped.close() + + async def get_final_message(self) -> Message: + return await self._wrapped.get_final_message() + + async def get_final_text(self) -> str: + return await self._wrapped.get_final_text() + + async def until_done(self) -> None: + await self._wrapped.until_done() + + @property + def current_message_snapshot(self) -> Message: + return self._wrapped.current_message_snapshot + + class AsyncMessagesStreamManagerWrapper: + def __init__(self, **kwargs): + self._kwargs = kwargs + + async def __aenter__(self): + self._manager = original_stream(**self._kwargs) + stream = await self._manager.__aenter__() + return AsyncMessageStreamWrapper(stream, **self._kwargs) + + async def __aexit__(self, *exc): + await self._manager.__aexit__(*exc) + + return AsyncMessagesStreamManagerWrapper + else: + + class MessageStreamWrapper: + def __init__( + self, + wrapped: MessageStream, + **kwargs, + ) -> None: + self._wrapped = wrapped + self._kwargs = kwargs + + @property + def response(self) -> Any: + return self._wrapped.response + + @property + def request_id(self) -> str | None: + return self._wrapped.request_id # type: ignore[no-any-return] + + @property + def text_stream(self): + @configured_traceable_text + def _text_stream(**_): + yield from self._wrapped.text_stream + run_tree = run_helpers.get_current_run_tree() + final_message = self._wrapped.get_final_message() + outputs = _message_to_outputs(final_message) + run_tree.outputs = outputs + if usage := outputs.get("usage_metadata"): + run_tree.metadata["usage_metadata"] = usage + + return _text_stream(**self._kwargs) + + def __next__(self) -> MessageStreamEvent: + return self.__iter__().__next__() + + def __iter__(self): + @configured_traceable + def traced_iter(**_): + return self._wrapped.__iter__() + + return traced_iter(**self._kwargs) + + def __enter__(self) -> Self: + self._wrapped.__enter__() + return self + + def __exit__(self, *exc) -> None: + self._wrapped.__exit__(*exc) + + def close(self) -> None: + self._wrapped.close() + + def get_final_message(self) -> Message: + return self._wrapped.get_final_message() + + def get_final_text(self) -> str: + return self._wrapped.get_final_text() + + def until_done(self) -> None: + return self._wrapped.until_done() + + @property + def current_message_snapshot(self) -> Message: + return self._wrapped.current_message_snapshot + + class MessagesStreamManagerWrapper: + def __init__(self, **kwargs): + self._kwargs = kwargs + + def __enter__(self): + self._manager = original_stream(**self._kwargs) + return MessageStreamWrapper(self._manager.__enter__(), **self._kwargs) + + def __exit__(self, *exc): + self._manager.__exit__(*exc) + + return MessagesStreamManagerWrapper + + +class TracingExtra(TypedDict, total=False): + metadata: Optional[Mapping[str, Any]] + tags: Optional[list[str]] + client: Optional[ls_client.Client] + + +def wrap_anthropic( + client: C, + *, + tracing_extra: Optional[TracingExtra] = None, + chat_name: str = "ChatAnthropic", + completions_name: str = "Anthropic", +) -> C: + """Patch the Anthropic client to make it traceable. + + Args: + client: The client to patch. + tracing_extra: Extra tracing information. + chat_name: The run name for the messages endpoint. + completions_name: The run name for the completions endpoint. + + Returns: + The patched client. + + Example: + ```python + import anthropic + from langsmith import wrappers + + client = wrappers.wrap_anthropic(anthropic.Anthropic()) + + # Use Anthropic client same as you normally would: + system = "You are a helpful assistant." + messages = [ + { + "role": "user", + "content": "What physics breakthroughs do you predict will happen by 2300?", + } + ] + completion = client.messages.create( + model="claude-3-5-sonnet-latest", + messages=messages, + max_tokens=1000, + system=system, + ) + print(completion.content) + + # With raw response to access headers: + raw_response = client.messages.with_raw_response.create( + model="claude-3-5-sonnet-latest", + messages=messages, + max_tokens=1000, + system=system, + ) + print(raw_response.headers) # Access HTTP headers + message = raw_response.parse() # Get parsed response + + # You can also use the streaming context manager: + with client.messages.stream( + model="claude-3-5-sonnet-latest", + messages=messages, + max_tokens=1000, + system=system, + ) as stream: + for text in stream.text_stream: + print(text, end="", flush=True) + message = stream.get_final_message() + ``` + """ # noqa: E501 + tracing_extra = tracing_extra or {} + + # Extract ls_invocation_params from metadata + metadata = dict(tracing_extra.get("metadata") or {}) + prepopulated_invocation_params = metadata.pop("ls_invocation_params", {}) + + # Create new tracing_extra without ls_invocation_params in metadata + tracing_extra_rest: TracingExtra = { # type: ignore[assignment] + k: v for k, v in tracing_extra.items() if k != "metadata" + } + if metadata: + tracing_extra_rest["metadata"] = metadata # type: ignore[typeddict-item] + + client.messages.create = _get_wrapper( # type: ignore[method-assign] + client.messages.create, + chat_name, + _reduce_chat_chunks, + prepopulated_invocation_params, + tracing_extra_rest, + ) + + client.messages.stream = _get_stream_wrapper( # type: ignore[method-assign] + client.messages.stream, + chat_name, + prepopulated_invocation_params, + tracing_extra_rest, + ) + client.completions.create = _get_wrapper( # type: ignore[method-assign] + client.completions.create, + completions_name, + _reduce_completions, + prepopulated_invocation_params, + tracing_extra_rest, + ) + + if ( + hasattr(client, "beta") + and hasattr(client.beta, "messages") + and hasattr(client.beta.messages, "create") + ): + client.beta.messages.create = _get_wrapper( # type: ignore[method-assign] + client.beta.messages.create, # type: ignore + chat_name, + _reduce_chat_chunks, + prepopulated_invocation_params, + tracing_extra_rest, + ) + + if ( + hasattr(client, "beta") + and hasattr(client.beta, "messages") + and hasattr(client.beta.messages, "parse") + ): + client.beta.messages.parse = _get_wrapper( # type: ignore[method-assign] + client.beta.messages.parse, # type: ignore + chat_name, + _reduce_chat_chunks, + prepopulated_invocation_params, + tracing_extra_rest, + ) + return client diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/_gemini.py b/python/user_packages/Python313/site-packages/langsmith/wrappers/_gemini.py new file mode 100644 index 0000000000000000000000000000000000000000..f65c40c1ed3356603068046855fde0e8b035457a --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/wrappers/_gemini.py @@ -0,0 +1,686 @@ +from __future__ import annotations + +import base64 +import functools +import logging +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Optional, + TypeVar, + Union, +) + +from typing_extensions import TypedDict + +from langsmith import client as ls_client +from langsmith import run_helpers +from langsmith._internal._beta_decorator import warn_beta +from langsmith._internal._orjson import dumps as _dumps +from langsmith.schemas import InputTokenDetails, OutputTokenDetails, UsageMetadata + +if TYPE_CHECKING: + from google import genai # type: ignore[import-untyped, attr-defined] + +C = TypeVar("C", bound=Union["genai.Client", Any]) +logger = logging.getLogger(__name__) + + +def _strip_none(d: dict) -> dict: + """Remove `None` values from dictionary.""" + return {k: v for k, v in d.items() if v is not None} + + +def _convert_config_for_tracing(kwargs: dict) -> None: + """Convert `GenerateContentConfig` to `dict` for LangSmith compatibility.""" + if "config" in kwargs and not isinstance(kwargs["config"], dict): + kwargs["config"] = vars(kwargs["config"]) + + +def _to_dict(obj: Any) -> Any: + """Serialize a Pydantic/model object to dict (or return as-is for dict/str).""" + if isinstance(obj, (dict, str)): + return obj + if hasattr(obj, "model_dump"): + return obj.model_dump() + if hasattr(obj, "to_dict"): + return obj.to_dict() + return obj + + +def _process_gemini_inputs(inputs: dict) -> dict: + r"""Process Gemini inputs to normalize them for LangSmith tracing. + + Example: + ```txt + {"contents": "Hello", "model": "gemini-pro"} + โ†’ {"messages": [{"role": "user", "content": "Hello"}], "model": "gemini-pro"} + {"contents": [{"role": "user", "parts": [{"text": "What is AI?"}]}], "model": "gemini-pro"} + โ†’ {"messages": [{"role": "user", "content": "What is AI?"}], "model": "gemini-pro"} + ``` + """ # noqa: E501 + # If contents is not present or not in list format, return as-is + contents = inputs.get("contents") + if not contents: + return inputs + + # Handle string input (simple case) + if isinstance(contents, str): + return { + "messages": [{"role": "user", "content": contents}], + "model": inputs.get("model"), + **({k: v for k, v in inputs.items() if k not in ("contents", "model")}), + } + + # Handle list of content objects (multimodal case) + if isinstance(contents, list): + # Check if it's a simple list of strings + if all(isinstance(item, str) for item in contents): + # Each string becomes a separate user message (matches Gemini's behavior) + return { + "messages": [{"role": "user", "content": item} for item in contents], + "model": inputs.get("model"), + **({k: v for k, v in inputs.items() if k not in ("contents", "model")}), + } + # Handle complex multimodal case (dict or types.Content / types.Part objects) + messages = [] + for content in contents: + content = _to_dict(content) + if not isinstance(content, dict): + continue + role = content.get("role", "user") + raw_parts = content.get("parts", []) + + text_parts: list[str] = [] + content_parts: list[dict[str, Any]] = [] + + for part in raw_parts: + part = _to_dict(part) + if isinstance(part, str): + text_parts.append(part) + content_parts.append({"type": "text", "text": part}) + continue + if not isinstance(part, dict): + continue + if "text" in part and part["text"]: + text_parts.append(part["text"]) + content_parts.append({"type": "text", "text": part["text"]}) + elif "inline_data" in part: + inline_data = _to_dict(part["inline_data"]) + if not isinstance(inline_data, dict): + continue + mime_type = inline_data.get("mime_type", "image/jpeg") + data = inline_data.get("data", b"") + + if isinstance(data, bytes): + data_b64 = base64.b64encode(data).decode("utf-8") + else: + data_b64 = data + + content_parts.append( + { + "type": "image_url", + "image_url": { + "url": f"data:{mime_type};base64,{data_b64}", + "detail": "high", + }, + } + ) + elif "functionResponse" in part: + function_response = part["functionResponse"] + content_parts.append( + { + "type": "function_response", + "function_response": { + "name": function_response.get("name"), + "response": function_response.get("response", {}), + }, + } + ) + elif "function_call" in part or "functionCall" in part: + fc = _to_dict(part.get("function_call") or part.get("functionCall")) + if isinstance(fc, dict): + content_parts.append( + { + "type": "function_call", + "function_call": { + "id": fc.get("id"), + "name": fc.get("name"), + "arguments": fc.get("args", {}), + }, + } + ) + + # If only text parts, use simple string format + if content_parts and all(p.get("type") == "text" for p in content_parts): + message_content: Union[str, list[dict[str, Any]]] = "\n".join( + text_parts + ) + else: + message_content = content_parts if content_parts else "" + + messages.append({"role": role, "content": message_content}) + + return { + "messages": messages, + "model": inputs.get("model"), + **({k: v for k, v in inputs.items() if k not in ("contents", "model")}), + } + + # Fallback: return original inputs + return inputs + + +def _infer_invocation_params( + prepopulated_invocation_params: dict, kwargs: dict +) -> dict: + """Extract invocation parameters for tracing.""" + stripped = _strip_none(kwargs) + config = stripped.get("config", {}) + + # Handle both dict config and GenerateContentConfig object + if hasattr(config, "temperature"): + temperature = config.temperature + max_tokens = getattr(config, "max_output_tokens", None) + stop = getattr(config, "stop_sequences", None) + else: + temperature = config.get("temperature") + max_tokens = config.get("max_output_tokens") + stop = config.get("stop_sequences") + + return { + "ls_provider": "google", + "ls_model_type": "chat", + "ls_model_name": stripped.get("model"), + "ls_temperature": temperature, + "ls_max_tokens": max_tokens, + "ls_stop": stop, + "ls_invocation_params": prepopulated_invocation_params, + } + + +def _create_usage_metadata(gemini_usage_metadata: dict) -> UsageMetadata: + """Convert Gemini usage metadata to LangSmith format.""" + prompt_token_count = gemini_usage_metadata.get("prompt_token_count") or 0 + candidates_token_count = gemini_usage_metadata.get("candidates_token_count") or 0 + cached_content_token_count = ( + gemini_usage_metadata.get("cached_content_token_count") or 0 + ) + thoughts_token_count = gemini_usage_metadata.get("thoughts_token_count") or 0 + total_token_count = ( + gemini_usage_metadata.get("total_token_count") + or prompt_token_count + candidates_token_count + ) + + input_token_details: dict = {} + if cached_content_token_count: + input_token_details["cache_read"] = cached_content_token_count + input_token_details["cache_read_over_200k"] = max( + 0, cached_content_token_count - 200000 + ) + input_token_details["over_200k"] = max(0, prompt_token_count - 200000) + + output_token_details: dict = {} + if thoughts_token_count: + output_token_details["reasoning"] = thoughts_token_count + + if candidates_token_count: + output_token_details["over_200k"] = max(0, candidates_token_count - 200000) + + return UsageMetadata( + input_tokens=prompt_token_count, + output_tokens=candidates_token_count, + total_tokens=total_token_count, + input_token_details=InputTokenDetails( + **{k: v for k, v in input_token_details.items() if v is not None} + ), + output_token_details=OutputTokenDetails( + **{k: v for k, v in output_token_details.items() if v is not None} + ), + ) + + +def _process_generate_content_response(response: Any) -> dict: + """Process Gemini response for tracing.""" + try: + # Convert response to dictionary + if hasattr(response, "to_dict"): + rdict = response.to_dict() + elif hasattr(response, "model_dump"): + rdict = response.model_dump() + else: + rdict = {"text": getattr(response, "text", str(response))} + + # Extract content from candidates if available + content_result = "" + content_parts = [] + finish_reason: Optional[str] = None + if "candidates" in rdict and rdict["candidates"]: + candidate = rdict["candidates"][0] + if "content" in candidate: + content = candidate["content"] + if "parts" in content and content["parts"]: + for part in content["parts"]: + # Handle text parts + if "text" in part and part["text"]: + content_result += part["text"] + content_parts.append({"type": "text", "text": part["text"]}) + # Handle inline data (images) in response + elif "inline_data" in part and part["inline_data"] is not None: + inline_data = part["inline_data"] + mime_type = inline_data.get("mime_type", "image/jpeg") + data = inline_data.get("data", b"") + + # Convert bytes to base64 string if needed + if isinstance(data, bytes): + data_b64 = base64.b64encode(data).decode("utf-8") + else: + data_b64 = data # Already a string + + content_parts.append( + { + "type": "image_url", + "image_url": { + "url": f"data:{mime_type};base64,{data_b64}", + "detail": "high", + }, + } + ) + elif "function_call" in part or "functionCall" in part: + fc = _to_dict( + part.get("function_call") or part.get("functionCall") + ) + if isinstance(fc, dict): + content_parts.append( + { + "type": "function_call", + "function_call": { + "id": fc.get("id"), + "name": fc.get("name"), + "arguments": fc.get("args", {}), + }, + } + ) + if "finish_reason" in candidate and candidate["finish_reason"]: + finish_reason = candidate["finish_reason"] + elif "text" in rdict: + content_result = rdict["text"] + content_parts.append({"type": "text", "text": content_result}) + + # Build chat-like response format - use OpenAI-compatible format for tool calls + tool_calls = [p for p in content_parts if p.get("type") == "function_call"] + if tool_calls: + # OpenAI-compatible format for LangSmith UI + result = { + "content": content_result or None, + "role": "assistant", + "finish_reason": finish_reason, + "tool_calls": [ + { + "id": tc["function_call"].get("id") or f"call_{i}", + "type": "function", + "index": i, + "function": { + "name": tc["function_call"]["name"], + "arguments": _dumps( + tc["function_call"]["arguments"] + ).decode(), + }, + } + for i, tc in enumerate(tool_calls) + ], + } + elif len(content_parts) > 1 or ( + content_parts and content_parts[0]["type"] != "text" + ): + # Use structured format for mixed non-tool content + result = { + "content": content_parts, + "role": "assistant", + "finish_reason": finish_reason, + } + else: + # Use simple string format for text-only responses + result = { + "content": content_result, + "role": "assistant", + "finish_reason": finish_reason, + } + + # Extract and convert usage metadata + usage_metadata = rdict.get("usage_metadata") + usage_dict: UsageMetadata = UsageMetadata( + input_tokens=0, output_tokens=0, total_tokens=0 + ) + if usage_metadata: + usage_dict = _create_usage_metadata(usage_metadata) + + # Return in a format that avoids stringification by LangSmith + if result.get("tool_calls"): + # For responses with tool calls, return structured format + return { + "content": result["content"], + "role": "assistant", + "finish_reason": finish_reason, + "tool_calls": result["tool_calls"], + "usage_metadata": usage_dict, + } + else: + # For simple text responses, return minimal structure with usage metadata + if isinstance(result["content"], str): + return { + "content": result["content"], + "role": "assistant", + "finish_reason": finish_reason, + "usage_metadata": usage_dict, + } + else: + # For multimodal content, return structured format with usage metadata + return { + "content": result["content"], + "role": "assistant", + "finish_reason": finish_reason, + "usage_metadata": usage_dict, + } + except Exception as e: + logger.debug(f"Error processing Gemini response: {e}") + return {"output": response} + + +def _reduce_generate_content_chunks(all_chunks: list) -> dict: + """Reduce streaming chunks into a single response.""" + if not all_chunks: + return { + "content": "", + "usage_metadata": UsageMetadata( + input_tokens=0, output_tokens=0, total_tokens=0 + ), + } + + # Accumulate text from all chunks + full_text = "" + last_chunk = None + + for chunk in all_chunks: + try: + if hasattr(chunk, "text") and chunk.text: + full_text += chunk.text + last_chunk = chunk + except Exception as e: + logger.debug(f"Error processing chunk: {e}") + + # Extract usage metadata from the last chunk + usage_metadata: UsageMetadata = UsageMetadata( + input_tokens=0, output_tokens=0, total_tokens=0 + ) + if last_chunk: + try: + if hasattr(last_chunk, "usage_metadata") and last_chunk.usage_metadata: + if hasattr(last_chunk.usage_metadata, "to_dict"): + usage_dict = last_chunk.usage_metadata.to_dict() + elif hasattr(last_chunk.usage_metadata, "model_dump"): + usage_dict = last_chunk.usage_metadata.model_dump() + else: + usage_dict = { + "prompt_token_count": getattr( + last_chunk.usage_metadata, "prompt_token_count", 0 + ), + "candidates_token_count": getattr( + last_chunk.usage_metadata, "candidates_token_count", 0 + ), + "cached_content_token_count": getattr( + last_chunk.usage_metadata, "cached_content_token_count", 0 + ), + "thoughts_token_count": getattr( + last_chunk.usage_metadata, "thoughts_token_count", 0 + ), + "total_token_count": getattr( + last_chunk.usage_metadata, "total_token_count", 0 + ), + } + # Add usage_metadata to both run.extra AND outputs + usage_metadata = _create_usage_metadata(usage_dict) + + except Exception as e: + logger.debug(f"Error extracting metadata from last chunk: {e}") + + # Return minimal structure with usage_metadata in outputs + return { + "content": full_text, + "usage_metadata": usage_metadata, + } + + +def _get_wrapper( + original_generate: Callable, + name: str, + prepopulated_invocation_params: dict, + tracing_extra: Optional[TracingExtra] = None, + is_streaming: bool = False, +) -> Callable: + """Create a wrapper for Gemini's `generate_content` methods.""" + textra = tracing_extra or {} + + @functools.wraps(original_generate) + def generate(*args, **kwargs): + # Handle config object before tracing setup + _convert_config_for_tracing(kwargs) + + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=_reduce_generate_content_chunks if is_streaming else None, + process_inputs=_process_gemini_inputs, + process_outputs=( + _process_generate_content_response if not is_streaming else None + ), + _invocation_params_fn=functools.partial( + _infer_invocation_params, prepopulated_invocation_params + ), + **textra, + ) + + return decorator(original_generate)(*args, **kwargs) + + @functools.wraps(original_generate) + async def agenerate(*args, **kwargs): + # Handle config object before tracing setup + _convert_config_for_tracing(kwargs) + + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=_reduce_generate_content_chunks if is_streaming else None, + process_inputs=_process_gemini_inputs, + process_outputs=( + _process_generate_content_response if not is_streaming else None + ), + _invocation_params_fn=functools.partial( + _infer_invocation_params, prepopulated_invocation_params + ), + **textra, + ) + + return await decorator(original_generate)(*args, **kwargs) + + return agenerate if run_helpers.is_async(original_generate) else generate + + +class TracingExtra(TypedDict, total=False): + metadata: Optional[Mapping[str, Any]] + tags: Optional[list[str]] + client: Optional[ls_client.Client] + + +@warn_beta +def wrap_gemini( + client: C, + *, + tracing_extra: Optional[TracingExtra] = None, + chat_name: str = "ChatGoogleGenerativeAI", +) -> C: + """Patch the Google Gen AI client to make it traceable. + + !!! warning + + **BETA**: This wrapper is in beta. + + Supports: + - `generate_content` and `generate_content_stream` methods + - Sync and async clients + - Streaming and non-streaming responses + - Tool/function calling with proper UI rendering + - Multimodal inputs (text + images) + - Image generation with `inline_data` support + - Token usage tracking including reasoning tokens + + Args: + client: The Google Gen AI client to patch. + tracing_extra: Extra tracing information. + chat_name: The run name for the chat endpoint. + + Returns: + The patched client. + + Example: + ```python + from google import genai + from google.genai import types + from langsmith import wrappers + + # Use Google Gen AI client same as you normally would. + client = wrappers.wrap_gemini(genai.Client(api_key="your-api-key")) + + # Basic text generation: + response = client.models.generate_content( + model="gemini-2.5-flash", + contents="Why is the sky blue?", + ) + print(response.text) + + # Streaming: + for chunk in client.models.generate_content_stream( + model="gemini-2.5-flash", + contents="Tell me a story", + ): + print(chunk.text, end="") + + # Tool/Function calling: + schedule_meeting_function = { + "name": "schedule_meeting", + "description": "Schedules a meeting with specified attendees.", + "parameters": { + "type": "object", + "properties": { + "attendees": {"type": "array", "items": {"type": "string"}}, + "date": {"type": "string"}, + "time": {"type": "string"}, + "topic": {"type": "string"}, + }, + "required": ["attendees", "date", "time", "topic"], + }, + } + + tools = types.Tool(function_declarations=[schedule_meeting_function]) + config = types.GenerateContentConfig(tools=[tools]) + + response = client.models.generate_content( + model="gemini-2.5-flash", + contents="Schedule a meeting with Bob and Alice tomorrow at 2 PM.", + config=config, + ) + + # Image generation: + response = client.models.generate_content( + model="gemini-2.5-flash-image", + contents=["Create a picture of a futuristic city"], + ) + + # Save generated image + from io import BytesIO + from PIL import Image + + for part in response.candidates[0].content.parts: + if part.inline_data is not None: + image = Image.open(BytesIO(part.inline_data.data)) + image.save("generated_image.png") + ``` + + !!! version-added "Added in `langsmith` 0.4.33" + + Initial beta release of Google Gemini wrapper. + + """ + tracing_extra = tracing_extra or {} + + # Extract ls_invocation_params from metadata + metadata = dict(tracing_extra.get("metadata") or {}) + prepopulated_invocation_params = metadata.pop("ls_invocation_params", {}) + + # Create new tracing_extra without ls_invocation_params in metadata + tracing_extra_rest: TracingExtra = { # type: ignore[assignment] + k: v for k, v in tracing_extra.items() if k != "metadata" + } + if metadata: + tracing_extra_rest["metadata"] = metadata # type: ignore[typeddict-item] + + # Check if already wrapped to prevent double-wrapping + if ( + hasattr(client, "models") + and hasattr(client.models, "generate_content") + and hasattr(client.models.generate_content, "__wrapped__") + ): + raise ValueError( + "This Google Gen AI client has already been wrapped. " + "Wrapping a client multiple times is not supported." + ) + + # Wrap synchronous methods + if hasattr(client, "models") and hasattr(client.models, "generate_content"): + client.models.generate_content = _get_wrapper( # type: ignore[method-assign] + client.models.generate_content, + chat_name, + prepopulated_invocation_params, + tracing_extra=tracing_extra_rest, + is_streaming=False, + ) + + if hasattr(client, "models") and hasattr(client.models, "generate_content_stream"): + client.models.generate_content_stream = _get_wrapper( # type: ignore[method-assign] + client.models.generate_content_stream, + chat_name, + prepopulated_invocation_params, + tracing_extra=tracing_extra_rest, + is_streaming=True, + ) + + # Wrap async methods (aio namespace) + if ( + hasattr(client, "aio") + and hasattr(client.aio, "models") + and hasattr(client.aio.models, "generate_content") + ): + client.aio.models.generate_content = _get_wrapper( # type: ignore[method-assign] + client.aio.models.generate_content, + chat_name, + prepopulated_invocation_params, + tracing_extra=tracing_extra_rest, + is_streaming=False, + ) + + if ( + hasattr(client, "aio") + and hasattr(client.aio, "models") + and hasattr(client.aio.models, "generate_content_stream") + ): + client.aio.models.generate_content_stream = _get_wrapper( # type: ignore[method-assign] + client.aio.models.generate_content_stream, + chat_name, + prepopulated_invocation_params, + tracing_extra=tracing_extra_rest, + is_streaming=True, + ) + + return client diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/_openai.py b/python/user_packages/Python313/site-packages/langsmith/wrappers/_openai.py new file mode 100644 index 0000000000000000000000000000000000000000..ffaa1eec487fc666ffb5898f0cd05bbbef827693 --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/wrappers/_openai.py @@ -0,0 +1,648 @@ +from __future__ import annotations + +import functools +import logging +from collections import defaultdict +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Optional, + TypeVar, + Union, +) + +from typing_extensions import TypedDict + +from langsmith import client as ls_client +from langsmith import run_helpers +from langsmith.schemas import InputTokenDetails, OutputTokenDetails, UsageMetadata + +if TYPE_CHECKING: + from openai import AsyncOpenAI, OpenAI + from openai.types.chat.chat_completion_chunk import ( + ChatCompletionChunk, + Choice, + ChoiceDeltaToolCall, + ) + from openai.types.completion import Completion + from openai.types.responses import ResponseStreamEvent # type: ignore + +# Any is used since it may work with Azure or other providers +C = TypeVar("C", bound=Union["OpenAI", "AsyncOpenAI", Any]) +logger = logging.getLogger(__name__) + + +@functools.lru_cache +def _get_omit_types() -> tuple[type, ...]: + """Get NotGiven/Omit sentinel types used by OpenAI SDK.""" + types: list[type[Any]] = [] + try: + from openai._types import NotGiven, Omit + + types.append(NotGiven) + types.append(Omit) + except ImportError: + pass + + return tuple(types) + + +def _strip_not_given(d: dict) -> dict: + try: + omit_types = _get_omit_types() + if not omit_types: + return d + return { + k: v + for k, v in d.items() + if not (isinstance(v, omit_types) or (k.startswith("extra_") and v is None)) + } + except Exception as e: + logger.error(f"Error stripping NotGiven: {e}") + return d + + +def _process_inputs(d: dict) -> dict: + """Strip `NotGiven` values and serialize `text_format` to JSON schema.""" + d = _strip_not_given(d) + + # Convert text_format (Pydantic model) to JSON schema if present + if "text_format" in d: + text_format = d["text_format"] + if hasattr(text_format, "model_json_schema"): + try: + return { + **d, + "text_format": text_format.model_json_schema(), + } + except Exception: + pass + return d + + +def _infer_invocation_params( + model_type: str, + provider: str, + prepopulated_invocation_params: dict, + use_responses_api: bool, + kwargs: dict, +): + stripped = _strip_not_given(kwargs) + + stop = stripped.get("stop") + if stop and isinstance(stop, str): + stop = [stop] + + # Allowlist of safe invocation parameters to include + # Only include known, non-sensitive parameters + allowed_invocation_keys = { + "frequency_penalty", + "n", + "logit_bias", + "logprobs", + "modalities", + "parallel_tool_calls", + "prediction", + "presence_penalty", + "prompt_cache_key", + "reasoning", + "reasoning_effort", + "response_format", + "seed", + "service_tier", + "stream_options", + "top_logprobs", + "top_p", + "truncation", + "user", + "verbosity", + "web_search_options", + } + + # Only include allowlisted parameters + invocation_params = { + k: v for k, v in stripped.items() if k in allowed_invocation_keys + } + + if use_responses_api: + invocation_params["use_responses_api"] = True + + return { + "ls_provider": provider, + "ls_model_type": model_type, + "ls_model_name": stripped.get("model"), + "ls_temperature": stripped.get("temperature"), + "ls_max_tokens": stripped.get("max_tokens") + or stripped.get("max_completion_tokens") + or stripped.get("max_output_tokens"), + "ls_stop": stop, + "ls_invocation_params": { + **prepopulated_invocation_params, + **invocation_params, + }, + } + + +def _reduce_choices(choices: list[Choice]) -> dict: + reversed_choices = list(reversed(choices)) + message: dict[str, Any] = { + "role": "assistant", + "content": "", + } + for c in reversed_choices: + if hasattr(c, "delta") and getattr(c.delta, "role", None): + message["role"] = c.delta.role + break + tool_calls: defaultdict[int, list[ChoiceDeltaToolCall]] = defaultdict(list) + for c in choices: + if hasattr(c, "delta"): + if getattr(c.delta, "content", None): + message["content"] += c.delta.content + if getattr(c.delta, "function_call", None): + if not message.get("function_call"): + message["function_call"] = {"name": "", "arguments": ""} + name_ = getattr(c.delta.function_call, "name", None) + if name_: + message["function_call"]["name"] += name_ + arguments_ = getattr(c.delta.function_call, "arguments", None) + if arguments_: + message["function_call"]["arguments"] += arguments_ + if getattr(c.delta, "tool_calls", None): + tool_calls_list = c.delta.tool_calls + if tool_calls_list is not None: + for tool_call in tool_calls_list: + tool_calls[tool_call.index].append(tool_call) + if tool_calls: + message["tool_calls"] = [None for _ in range(max(tool_calls.keys()) + 1)] + for index, tool_call_chunks in tool_calls.items(): + message["tool_calls"][index] = { + "index": index, + "id": next((c.id for c in tool_call_chunks if c.id), None), + "type": next((c.type for c in tool_call_chunks if c.type), None), + "function": {"name": "", "arguments": ""}, + } + for chunk in tool_call_chunks: + if getattr(chunk, "function", None): + name_ = getattr(chunk.function, "name", None) + if name_: + message["tool_calls"][index]["function"]["name"] += name_ + arguments_ = getattr(chunk.function, "arguments", None) + if arguments_: + message["tool_calls"][index]["function"]["arguments"] += ( + arguments_ + ) + return { + "index": getattr(choices[0], "index", 0) if choices else 0, + "finish_reason": next( + ( + c.finish_reason + for c in reversed_choices + if getattr(c, "finish_reason", None) + ), + None, + ), + "message": message, + } + + +def _reduce_chat(all_chunks: list[ChatCompletionChunk]) -> dict: + choices_by_index: defaultdict[int, list[Choice]] = defaultdict(list) + for chunk in all_chunks: + for choice in chunk.choices: + choices_by_index[choice.index].append(choice) + if all_chunks: + d = all_chunks[-1].model_dump() + d["choices"] = [ + _reduce_choices(choices) for choices in choices_by_index.values() + ] + else: + d = {"choices": [{"message": {"role": "assistant", "content": ""}}]} + # streamed outputs don't go through `process_outputs` + # so we need to flatten metadata here + oai_token_usage = d.pop("usage", None) + d["usage_metadata"] = ( + _create_usage_metadata(oai_token_usage) if oai_token_usage else None + ) + return d + + +def _reduce_completions(all_chunks: list[Completion]) -> dict: + all_content = [] + for chunk in all_chunks: + content = chunk.choices[0].text + if content is not None: + all_content.append(content) + content = "".join(all_content) + if all_chunks: + d = all_chunks[-1].model_dump() + d["choices"] = [{"text": content}] + else: + d = {"choices": [{"text": content}]} + + return d + + +def _create_usage_metadata( + oai_token_usage: dict, service_tier: Optional[str] = None +) -> UsageMetadata: + recognized_service_tier = ( + service_tier if service_tier in ["priority", "flex"] else None + ) + service_tier_prefix = ( + f"{recognized_service_tier}_" if recognized_service_tier else "" + ) + + input_tokens = ( + oai_token_usage.get("prompt_tokens") or oai_token_usage.get("input_tokens") or 0 + ) + output_tokens = ( + oai_token_usage.get("completion_tokens") + or oai_token_usage.get("output_tokens") + or 0 + ) + total_tokens = oai_token_usage.get("total_tokens") or input_tokens + output_tokens + input_token_details: dict = { + "audio": ( + oai_token_usage.get("prompt_tokens_details") + or oai_token_usage.get("input_tokens_details") + or {} + ).get("audio_tokens"), + f"{service_tier_prefix}cache_read": ( + oai_token_usage.get("prompt_tokens_details") + or oai_token_usage.get("input_tokens_details") + or {} + ).get("cached_tokens"), + } + output_token_details: dict = { + "audio": ( + oai_token_usage.get("completion_tokens_details") + or oai_token_usage.get("output_tokens_details") + or {} + ).get("audio_tokens"), + f"{service_tier_prefix}reasoning": ( + oai_token_usage.get("completion_tokens_details") + or oai_token_usage.get("output_tokens_details") + or {} + ).get("reasoning_tokens"), + } + + if recognized_service_tier: + # Avoid counting cache read and reasoning tokens towards the + # service tier token count since service tier tokens are already + # priced differently + input_token_details[recognized_service_tier] = input_tokens - ( + input_token_details.get(f"{service_tier_prefix}cache_read") or 0 + ) + output_token_details[recognized_service_tier] = output_tokens - ( + output_token_details.get(f"{service_tier_prefix}reasoning") or 0 + ) + + return UsageMetadata( + input_tokens=input_tokens, + output_tokens=output_tokens, + total_tokens=total_tokens, + input_token_details=InputTokenDetails( + **{k: v for k, v in input_token_details.items() if v is not None} + ), + output_token_details=OutputTokenDetails( + **{k: v for k, v in output_token_details.items() if v is not None} + ), + ) + + +def _process_chat_completion(outputs: Any): + try: + # Check if outputs is an APIResponse wrapper (from with_raw_response). + # The OpenAI SDK's APIResponse wraps the actual response object. + # Call .parse() to extract the ChatCompletion/Completion for tracing. + # See: github.com/openai/openai-python/blob/main/src/openai/_response.py#L285 + if hasattr(outputs, "parse") and callable(outputs.parse): + try: + outputs = outputs.parse() + except Exception: + pass + + rdict = outputs.model_dump() + oai_token_usage = rdict.pop("usage", None) + rdict["usage_metadata"] = ( + _create_usage_metadata(oai_token_usage, rdict.get("service_tier")) + if oai_token_usage + else None + ) + return rdict + except BaseException as e: + logger.debug(f"Error processing chat completion: {e}") + return {"output": outputs} + + +def _get_wrapper( + original_create: Callable, + name: str, + reduce_fn: Callable, + tracing_extra: Optional[TracingExtra] = None, + invocation_params_fn: Optional[Callable] = None, + process_outputs: Optional[Callable] = None, +) -> Callable: + textra = tracing_extra or {} + + @functools.wraps(original_create) + def create(*args, **kwargs): + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=reduce_fn if kwargs.get("stream") is True else None, + process_inputs=_process_inputs, + _invocation_params_fn=invocation_params_fn, + process_outputs=process_outputs, + **textra, + ) + + return decorator(original_create)(*args, **kwargs) + + @functools.wraps(original_create) + async def acreate(*args, **kwargs): + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=reduce_fn if kwargs.get("stream") is True else None, + process_inputs=_process_inputs, + _invocation_params_fn=invocation_params_fn, + process_outputs=process_outputs, + **textra, + ) + return await decorator(original_create)(*args, **kwargs) + + return acreate if run_helpers.is_async(original_create) else create + + +def _get_parse_wrapper( + original_parse: Callable, + name: str, + process_outputs: Callable, + tracing_extra: Optional[TracingExtra] = None, + invocation_params_fn: Optional[Callable] = None, +) -> Callable: + textra = tracing_extra or {} + + @functools.wraps(original_parse) + def parse(*args, **kwargs): + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=None, + process_inputs=_process_inputs, + _invocation_params_fn=invocation_params_fn, + process_outputs=process_outputs, + **textra, + ) + return decorator(original_parse)(*args, **kwargs) + + @functools.wraps(original_parse) + async def aparse(*args, **kwargs): + decorator = run_helpers.traceable( + name=name, + run_type="llm", + reduce_fn=None, + process_inputs=_process_inputs, + _invocation_params_fn=invocation_params_fn, + process_outputs=process_outputs, + **textra, + ) + return await decorator(original_parse)(*args, **kwargs) + + return aparse if run_helpers.is_async(original_parse) else parse + + +def _reduce_response_events(events: list[ResponseStreamEvent]) -> dict: + for event in events: + if event.type == "response.completed": + return _process_responses_api_output(event.response) + return {} + + +class TracingExtra(TypedDict, total=False): + metadata: Optional[Mapping[str, Any]] + tags: Optional[list[str]] + client: Optional[ls_client.Client] + + +def wrap_openai( + client: C, + *, + tracing_extra: Optional[TracingExtra] = None, + chat_name: str = "ChatOpenAI", + completions_name: str = "OpenAI", +) -> C: + """Patch the OpenAI client to make it traceable. + + Supports: + - Chat and Responses API's + - Sync and async OpenAI clients + - `create` and `parse` methods + - With and without streaming + - `with_raw_response` API for accessing HTTP headers + + Args: + client: The client to patch. + tracing_extra: Extra tracing information. + chat_name: The run name for the chat completions endpoint. + completions_name: The run name for the completions endpoint. + + Returns: + The patched client. + + Example: + ```python + import openai + from langsmith import wrappers + + # Use OpenAI client same as you normally would. + client = wrappers.wrap_openai(openai.OpenAI()) + + # Chat API: + messages = [ + {"role": "system", "content": "You are a helpful assistant."}, + { + "role": "user", + "content": "What physics breakthroughs do you predict will happen by 2300?", + }, + ] + completion = client.chat.completions.create( + model="gpt-4o-mini", messages=messages + ) + print(completion.choices[0].message.content) + + # Responses API: + response = client.responses.create( + model="gpt-4o-mini", + messages=messages, + ) + print(response.output_text) + + # With raw response to access headers: + raw_response = client.chat.completions.with_raw_response.create( + model="gpt-4o-mini", messages=messages + ) + print(raw_response.headers) # Access HTTP headers + completion = raw_response.parse() # Get parsed response + ``` + + !!! warning "Behavior changed in `langsmith` 0.3.16" + + Support for Responses API added. + + !!! warning "Behavior changed in `langsmith` 0.3.x" + + Support for `with_raw_response` API added. + """ # noqa: E501 + tracing_extra = tracing_extra or {} + + # Extract ls_invocation_params from metadata + metadata = dict(tracing_extra.get("metadata") or {}) + prepopulated_invocation_params = metadata.pop("ls_invocation_params", {}) + + # Create new tracing_extra without ls_invocation_params in metadata + tracing_extra_rest: TracingExtra = { # type: ignore[assignment] + k: v for k, v in tracing_extra.items() if k != "metadata" + } + if metadata: + tracing_extra_rest["metadata"] = metadata # type: ignore[typeddict-item] + + ls_provider = "openai" + try: + from openai import AsyncAzureOpenAI, AzureOpenAI + + if isinstance(client, AzureOpenAI) or isinstance(client, AsyncAzureOpenAI): + ls_provider = "azure" + chat_name = "AzureChatOpenAI" + completions_name = "AzureOpenAI" + except ImportError: + pass + + # First wrap the create methods - these handle non-streaming cases + client.chat.completions.create = _get_wrapper( # type: ignore[method-assign] + client.chat.completions.create, + chat_name, + _reduce_chat, + tracing_extra=tracing_extra_rest, + invocation_params_fn=functools.partial( + _infer_invocation_params, + "chat", + ls_provider, + prepopulated_invocation_params, + False, + ), + process_outputs=_process_chat_completion, + ) + + client.completions.create = _get_wrapper( # type: ignore[method-assign] + client.completions.create, + completions_name, + _reduce_completions, + tracing_extra=tracing_extra_rest, + invocation_params_fn=functools.partial( + _infer_invocation_params, + "llm", + ls_provider, + prepopulated_invocation_params, + False, + ), + ) + + # Wrap beta.chat.completions.parse if it exists + if ( + hasattr(client, "beta") + and hasattr(client.beta, "chat") + and hasattr(client.beta.chat, "completions") + and hasattr(client.beta.chat.completions, "parse") + ): + client.beta.chat.completions.parse = _get_parse_wrapper( # type: ignore[method-assign] + client.beta.chat.completions.parse, # type: ignore + chat_name, + _process_chat_completion, + tracing_extra=tracing_extra_rest, + invocation_params_fn=functools.partial( + _infer_invocation_params, + "chat", + ls_provider, + prepopulated_invocation_params, + False, + ), + ) + + # Wrap chat.completions.parse if it exists + if ( + hasattr(client, "chat") + and hasattr(client.chat, "completions") + and hasattr(client.chat.completions, "parse") + ): + client.chat.completions.parse = _get_parse_wrapper( # type: ignore[method-assign] + client.chat.completions.parse, # type: ignore + chat_name, + _process_chat_completion, + tracing_extra=tracing_extra_rest, + invocation_params_fn=functools.partial( + _infer_invocation_params, + "chat", + ls_provider, + prepopulated_invocation_params, + False, + ), + ) + + # For the responses API: "client.responses.create(**kwargs)" + if hasattr(client, "responses"): + if hasattr(client.responses, "create"): + client.responses.create = _get_wrapper( # type: ignore[method-assign] + client.responses.create, + chat_name, + _reduce_response_events, + process_outputs=_process_responses_api_output, + tracing_extra=tracing_extra_rest, + invocation_params_fn=functools.partial( + _infer_invocation_params, + "chat", + ls_provider, + prepopulated_invocation_params, + True, + ), + ) + if hasattr(client.responses, "parse"): + client.responses.parse = _get_parse_wrapper( # type: ignore[method-assign] + client.responses.parse, + chat_name, + _process_responses_api_output, + tracing_extra=tracing_extra_rest, + invocation_params_fn=functools.partial( + _infer_invocation_params, + "chat", + ls_provider, + prepopulated_invocation_params, + True, + ), + ) + + return client + + +def _process_responses_api_output(response: Any) -> dict: + if response: + try: + # Unwrap APIResponse from with_raw_response for tracing + if hasattr(response, "parse") and callable(response.parse): + try: + response = response.parse() + except Exception: + pass + + output = response.model_dump(exclude_none=True, mode="json") + if usage := output.pop("usage", None): + output["usage_metadata"] = _create_usage_metadata( + usage, output.get("service_tier") + ) + return output + except Exception: + return {"output": response} + return {} diff --git a/python/user_packages/Python313/site-packages/langsmith/wrappers/_openai_agents.py b/python/user_packages/Python313/site-packages/langsmith/wrappers/_openai_agents.py new file mode 100644 index 0000000000000000000000000000000000000000..804b9bd5893b42bc0b9029ad84cb06b7812b667f --- /dev/null +++ b/python/user_packages/Python313/site-packages/langsmith/wrappers/_openai_agents.py @@ -0,0 +1,19 @@ +"""Tombstone module for backward compatibility. + +This module has been moved to `langsmith.integrations.openai_agents`. + +Imports from this location are deprecated but will continue to work. +""" + +import warnings + +from langsmith.integrations.openai_agents_sdk import OpenAIAgentsTracingProcessor + +warnings.warn( + "langsmith.wrappers._openai_agents is deprecated and has been moved to " + "langsmith.integrations.openai_agents_sdk. Please update your imports.", + DeprecationWarning, + stacklevel=2, +) + +__all__ = ["OpenAIAgentsTracingProcessor"] diff --git a/python/user_packages/Python313/site-packages/ldap3/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d082a81a876e2dbb2c46afcb5e05a41c9c080be Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/__pycache__/version.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/__pycache__/version.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db2e06d877e1fae621648b459c8f8b85bc4842c2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/__pycache__/version.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__init__.py b/python/user_packages/Python313/site-packages/ldap3/abstract/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..29aabb381072ccd7ccd4d89703110ad79951ebc1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/abstract/__init__.py @@ -0,0 +1,50 @@ +""" +""" + +# Created on 2016.08.31 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +STATUS_INIT = 'Initialized' # The entry object is initialized +STATUS_VIRTUAL = 'Virtual' # The entry is a new writable entry, still empty +STATUS_MANDATORY_MISSING = 'Missing mandatory attributes' # The entry has some mandatory attributes missing +STATUS_READ = 'Read' # The entry has been read +STATUS_WRITABLE = 'Writable' # The entry has been made writable, still no changes +STATUS_PENDING_CHANGES = 'Pending changes' # The entry has some changes to commit, mandatory attributes are present +STATUS_COMMITTED = 'Committed' # The entry changes has been committed +STATUS_READY_FOR_DELETION = 'Ready for deletion' # The entry is set to be deleted +STATUS_READY_FOR_MOVING = 'Ready for moving' # The entry is set to be moved in the DIT +STATUS_READY_FOR_RENAMING = 'Ready for renaming' # The entry is set to be renamed +STATUS_DELETED = 'Deleted' # The entry has been deleted + +STATUSES = [STATUS_INIT, + STATUS_VIRTUAL, + STATUS_MANDATORY_MISSING, + STATUS_READ, + STATUS_WRITABLE, + STATUS_PENDING_CHANGES, + STATUS_COMMITTED, + STATUS_READY_FOR_DELETION, + STATUS_READY_FOR_MOVING, + STATUS_READY_FOR_RENAMING, + STATUS_DELETED] + +INITIAL_STATUSES = [STATUS_READ, STATUS_WRITABLE, STATUS_VIRTUAL] diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..80063009b59023fe1c1fc280bb447ac3e956d4f3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/attrDef.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/attrDef.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b1f4f2419dfb746149d6458b14200729b3d7683 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/attrDef.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/attribute.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/attribute.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42b74dec44a8116402348758f543ccf5aee6e0e3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/attribute.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/cursor.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/cursor.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4567750135096fcf7ffc3e0f7bd12c05cf94e1a6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/cursor.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/entry.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/entry.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7359eb02ca8f96470db0da289f18ffd07c6ca1cc Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/entry.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/objectDef.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/objectDef.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f818f1e584994f075b966cc86b767c87d48ab169 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/abstract/__pycache__/objectDef.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/attrDef.py b/python/user_packages/Python313/site-packages/ldap3/abstract/attrDef.py new file mode 100644 index 0000000000000000000000000000000000000000..caffb535f7dc0d0b7302a2d2e17c274dfa4936a9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/abstract/attrDef.py @@ -0,0 +1,121 @@ +""" +""" + +# Created on 2014.01.11 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata + +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from os import linesep + +from .. import SEQUENCE_TYPES +from ..core.exceptions import LDAPKeyError +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, EXTENDED + + +class AttrDef(object): + """Hold the definition of an attribute + + :param name: the real attribute name + :type name: string + :param key: the friendly name to use in queries and when accessing the attribute, default to the real attribute name + :type key: string + :param validate: called to check if the value in the query is valid, the callable is called with the value parameter + :type validate: callable + :param pre_query: called to transform values returned by search + :type pre_query: callable + :param post_query: called to transform values returned by search + :type post_query: callable + :param default: value returned when the attribute is absent (defaults to NotImplemented to allow use of None as default) + :type default: string, integer + :param dereference_dn: reference to an ObjectDef instance. When the attribute value contains a dn it will be searched and substituted in the entry + :type dereference_dn: ObjectDef + :param description: custom attribute description + :type description: string + :param mandatory: specify if attribute is defined as mandatory in LDAP schema + :type mandatory: boolean + """ + + def __init__(self, name, key=None, validate=None, pre_query=None, post_query=None, default=NotImplemented, dereference_dn=None, description=None, mandatory=False, single_value=None, alias=None): + self.name = name + self.key = ''.join(key.split()) if key else name # key set to name if not present + self.validate = validate + self.pre_query = pre_query + self.post_query = post_query + self.default = default + self.dereference_dn = dereference_dn + self.description = description + self.mandatory = mandatory + self.single_value = single_value + self.oid_info = None + if not alias: + self.other_names = None + elif isinstance(alias, SEQUENCE_TYPES): # multiple aliases + self.\ + other_names = set(alias) + else: # single alias + self.other_names = set([alias]) # python 2 compatibility + + if log_enabled(BASIC): + log(BASIC, 'instantiated AttrDef: <%r>', self) + + def __repr__(self): + r = 'ATTR: ' + ', '.join([self.key] + list(self.other_names)) if self.other_names else self.key + r += '' if self.name == self.key else ' [' + self.name + ']' + r += '' if self.default is NotImplemented else ' - default: ' + str(self.default) + r += '' if self.mandatory is None else ' - mandatory: ' + str(self.mandatory) + r += '' if self.single_value is None else ' - single_value: ' + str(self.single_value) + r += '' if not self.dereference_dn else ' - dereference_dn: ' + str(self.dereference_dn) + r += '' if not self.description else ' - description: ' + str(self.description) + if self.oid_info: + for line in str(self.oid_info).split(linesep): + r += linesep + ' ' + line + return r + + def __str__(self): + return self.__repr__() + + def __eq__(self, other): + if isinstance(other, AttrDef): + return self.key == other.key + + return False + + def __lt__(self, other): + if isinstance(other, AttrDef): + return self.key < other.key + + return False + + def __hash__(self): + if self.key: + return hash(self.key) + else: + return id(self) # unique for each instance + + def __setattr__(self, key, value): + if hasattr(self, 'key') and key == 'key': # key cannot be changed because is being used for __hash__ + error_message = 'key \'%s\' already set' % key + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPKeyError(error_message) + else: + object.__setattr__(self, key, value) diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/attribute.py b/python/user_packages/Python313/site-packages/ldap3/abstract/attribute.py new file mode 100644 index 0000000000000000000000000000000000000000..5d33cc78b204cca8f677ba3ae4a802811710bb09 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/abstract/attribute.py @@ -0,0 +1,290 @@ +""" +""" + +# Created on 2014.01.06 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from os import linesep + +from .. import MODIFY_ADD, MODIFY_REPLACE, MODIFY_DELETE, SEQUENCE_TYPES +from ..core.exceptions import LDAPCursorError +from ..utils.repr import to_stdout_encoding +from . import STATUS_PENDING_CHANGES, STATUS_VIRTUAL, STATUS_READY_FOR_DELETION, STATUS_READY_FOR_MOVING, STATUS_READY_FOR_RENAMING +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, EXTENDED + + +# noinspection PyUnresolvedReferences +class Attribute(object): + """Attribute/values object, it includes the search result (after post_query transformation) of each attribute in an entry + + Attribute object is read only + + - values: contain the processed attribute values + - raw_values': contain the unprocessed attribute values + + + """ + + def __init__(self, attr_def, entry, cursor): + self.key = attr_def.key + self.definition = attr_def + self.values = [] + self.raw_values = [] + self.response = None + self.entry = entry + self.cursor = cursor + other_names = [name for name in attr_def.oid_info.name if self.key.lower() != name.lower()] if attr_def.oid_info else None + self.other_names = set(other_names) if other_names else None # self.other_names is None if there are no short names, else is a set of secondary names + + def __repr__(self): + if len(self.values) == 1: + r = to_stdout_encoding(self.key) + ': ' + to_stdout_encoding(self.values[0]) + elif len(self.values) > 1: + r = to_stdout_encoding(self.key) + ': ' + to_stdout_encoding(self.values[0]) + filler = ' ' * (len(self.key) + 6) + for value in self.values[1:]: + r += linesep + filler + to_stdout_encoding(value) + else: + r = to_stdout_encoding(self.key) + ': ' + to_stdout_encoding('') + + return r + + def __str__(self): + if len(self.values) == 1: + return to_stdout_encoding(self.values[0]) + else: + return to_stdout_encoding(self.values) + + def __len__(self): + return len(self.values) + + def __iter__(self): + return self.values.__iter__() + + def __getitem__(self, item): + return self.values[item] + + def __getstate__(self): + cpy = dict(self.__dict__) + cpy['cursor'] = None + return cpy + + def __eq__(self, other): + try: + if self.value == other: + return True + except Exception: + return False + + def __ne__(self, other): + return not self == other + + @property + def value(self): + """ + :return: The single value or a list of values of the attribute. + """ + if not self.values: + return None + + return self.values[0] if len(self.values) == 1 else self.values + + +class OperationalAttribute(Attribute): + """Operational attribute/values object. Include the search result of an + operational attribute in an entry + + OperationalAttribute object is read only + + - values: contains the processed attribute values + - raw_values: contains the unprocessed attribute values + + It may not have an AttrDef + + """ + + def __repr__(self): + if len(self.values) == 1: + r = to_stdout_encoding(self.key) + ' [OPERATIONAL]: ' + to_stdout_encoding(self.values[0]) + elif len(self.values) > 1: + r = to_stdout_encoding(self.key) + ' [OPERATIONAL]: ' + to_stdout_encoding(self.values[0]) + filler = ' ' * (len(self.key) + 6) + for value in sorted(self.values[1:]): + r += linesep + filler + to_stdout_encoding(value) + else: + r = '' + + return r + + +class WritableAttribute(Attribute): + def __repr__(self): + filler = ' ' * (len(self.key) + 6) + if len(self.values) == 1: + r = to_stdout_encoding(self.key) + ': ' + to_stdout_encoding(self.values[0]) + elif len(self.values) > 1: + r = to_stdout_encoding(self.key) + ': ' + to_stdout_encoding(self.values[0]) + for value in self.values[1:]: + r += linesep + filler + to_stdout_encoding(value) + else: + r = to_stdout_encoding(self.key) + to_stdout_encoding(': ') + if self.definition.name in self.entry._changes: + r += linesep + filler + 'CHANGES: ' + str(self.entry._changes[self.definition.name]) + return r + + def __iadd__(self, other): + self.add(other) + return Ellipsis # hack to avoid calling set() in entry __setattr__ + + def __isub__(self, other): + self.delete(other) + return Ellipsis # hack to avoid calling set_value in entry __setattr__ + + def _update_changes(self, changes, remove_old=False): + # checks for friendly key in AttrDef and uses the real attribute name + if self.definition and self.definition.name: + key = self.definition.name + else: + key = self.key + + if key not in self.entry._changes or remove_old: # remove old changes (for removing attribute) + self.entry._changes[key] = [] + + self.entry._changes[key].append(changes) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'updated changes <%r> for <%s> attribute in <%s> entry', changes, self.key, self.entry.entry_dn) + self.entry._state.set_status(STATUS_PENDING_CHANGES) + + def add(self, values): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'adding %r to <%s> attribute in <%s> entry', values, self.key, self.entry.entry_dn) + # new value for attribute to commit with a MODIFY_ADD + if self.entry._state._initial_status == STATUS_VIRTUAL: + error_message = 'cannot perform a modify operation in a new entry' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if self.entry.entry_status in [STATUS_READY_FOR_DELETION, STATUS_READY_FOR_MOVING, STATUS_READY_FOR_RENAMING]: + error_message = self.entry.entry_status + ' - cannot add attributes' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if values is None: + error_message = 'value to add cannot be None' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if values is not None: + validated = self.definition.validate(values) # returns True, False or a value to substitute to the actual values + if validated is False: + error_message = 'value \'%s\' non valid for attribute \'%s\'' % (values, self.key) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + elif validated is not True: # a valid LDAP value equivalent to the actual values + values = validated + self._update_changes((MODIFY_ADD, values if isinstance(values, SEQUENCE_TYPES) else [values])) + + def set(self, values): + # new value for attribute to commit with a MODIFY_REPLACE, old values are deleted + if log_enabled(PROTOCOL): + log(PROTOCOL, 'setting %r to <%s> attribute in <%s> entry', values, self.key, self.entry.entry_dn) + if self.entry.entry_status in [STATUS_READY_FOR_DELETION, STATUS_READY_FOR_MOVING, STATUS_READY_FOR_RENAMING]: + error_message = self.entry.entry_status + ' - cannot set attributes' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if values is None: + error_message = 'new value cannot be None' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + validated = self.definition.validate(values) # returns True, False or a value to substitute to the actual values + if validated is False: + error_message = 'value \'%s\' non valid for attribute \'%s\'' % (values, self.key) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + elif validated is not True: # a valid LDAP value equivalent to the actual values + values = validated + self._update_changes((MODIFY_REPLACE, values if isinstance(values, SEQUENCE_TYPES) else [values]), remove_old=True) + + def delete(self, values): + # value for attribute to delete in commit with a MODIFY_DELETE + if log_enabled(PROTOCOL): + log(PROTOCOL, 'deleting %r from <%s> attribute in <%s> entry', values, self.key, self.entry.entry_dn) + if self.entry._state._initial_status == STATUS_VIRTUAL: + error_message = 'cannot delete an attribute value in a new entry' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if self.entry.entry_status in [STATUS_READY_FOR_DELETION, STATUS_READY_FOR_MOVING, STATUS_READY_FOR_RENAMING]: + error_message = self.entry.entry_status + ' - cannot delete attributes' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if values is None: + error_message = 'value to delete cannot be None' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if not isinstance(values, SEQUENCE_TYPES): + values = [values] + for single_value in values: + if single_value not in self.values: + error_message = 'value \'%s\' not present in \'%s\'' % (single_value, ', '.join(self.values)) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + self._update_changes((MODIFY_DELETE, values)) + + def remove(self): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'removing <%s> attribute in <%s> entry', self.key, self.entry.entry_dn) + if self.entry._state._initial_status == STATUS_VIRTUAL: + error_message = 'cannot remove an attribute in a new entry' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if self.entry.entry_status in [STATUS_READY_FOR_DELETION, STATUS_READY_FOR_MOVING, STATUS_READY_FOR_RENAMING]: + error_message = self.entry.entry_status + ' - cannot remove attributes' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + self._update_changes((MODIFY_REPLACE, []), True) + + def discard(self): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'discarding <%s> attribute in <%s> entry', self.key, self.entry.entry_dn) + del self.entry._changes[self.key] + if not self.entry._changes: + self.entry._state.set_status(self.entry._state._initial_status) + + @property + def virtual(self): + return False if len(self.values) else True + + @property + def changes(self): + if self.key in self.entry._changes: + return self.entry._changes[self.key] + return None diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/cursor.py b/python/user_packages/Python313/site-packages/ldap3/abstract/cursor.py new file mode 100644 index 0000000000000000000000000000000000000000..690e87d476596cf477d98b5d63f7848715a667ed --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/abstract/cursor.py @@ -0,0 +1,912 @@ +""" +""" + +# Created on 2014.01.06 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from collections import namedtuple +from copy import deepcopy +from datetime import datetime +from os import linesep +from time import sleep + +from . import STATUS_VIRTUAL, STATUS_READ, STATUS_WRITABLE +from .. import SUBTREE, LEVEL, DEREF_ALWAYS, DEREF_NEVER, BASE, SEQUENCE_TYPES, STRING_TYPES, get_config_parameter +from ..abstract import STATUS_PENDING_CHANGES +from .attribute import Attribute, OperationalAttribute, WritableAttribute +from .attrDef import AttrDef +from .objectDef import ObjectDef +from .entry import Entry, WritableEntry +from ..core.exceptions import LDAPCursorError, LDAPObjectDereferenceError +from ..core.results import RESULT_SUCCESS +from ..utils.ciDict import CaseInsensitiveWithAliasDict +from ..utils.dn import safe_dn, safe_rdn +from ..utils.conv import to_raw +from ..utils.config import get_config_parameter +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, EXTENDED +from ..protocol.oid import ATTRIBUTE_DIRECTORY_OPERATION, ATTRIBUTE_DISTRIBUTED_OPERATION, ATTRIBUTE_DSA_OPERATION, CLASS_AUXILIARY + +Operation = namedtuple('Operation', ('request', 'result', 'response')) + + +def _ret_search_value(value): + return value[0] + '=' + value[1:] if value[0] in '<>~' and value[1] != '=' else value + + +def _create_query_dict(query_text): + """ + Create a dictionary with query key:value definitions + query_text is a comma delimited key:value sequence + """ + query_dict = dict() + if query_text: + for arg_value_str in query_text.split(','): + if ':' in arg_value_str: + arg_value_list = arg_value_str.split(':') + query_dict[arg_value_list[0].strip()] = arg_value_list[1].strip() + + return query_dict + + +class Cursor(object): + # entry_class and attribute_class define the type of entry and attribute used by the cursor + # entry_initial_status defines the initial status of a entry + # entry_class = Entry, must be defined in subclasses + # attribute_class = Attribute, must be defined in subclasses + # entry_initial_status = STATUS, must be defined in subclasses + + def __init__(self, connection, object_def, get_operational_attributes=False, attributes=None, controls=None, auxiliary_class=None): + conf_attributes_excluded_from_object_def = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF')] + self.connection = connection + self.get_operational_attributes = get_operational_attributes + if connection._deferred_bind or connection._deferred_open: # probably a lazy connection, tries to bind + connection._fire_deferred() + + if isinstance(object_def, (STRING_TYPES, SEQUENCE_TYPES)): + if connection.closed: # try to open connection if closed to read schema + connection.bind() + object_def = ObjectDef(object_def, connection.server.schema, auxiliary_class=auxiliary_class) + self.definition = object_def + if attributes: # checks if requested attributes are defined in ObjectDef + not_defined_attributes = [] + if isinstance(attributes, STRING_TYPES): + attributes = [attributes] + + for attribute in attributes: + if attribute not in self.definition._attributes and attribute.lower() not in conf_attributes_excluded_from_object_def: + not_defined_attributes.append(attribute) + + if not_defined_attributes: + error_message = 'Attributes \'%s\' non in definition' % ', '.join(not_defined_attributes) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + + self.attributes = set(attributes) if attributes else set([attr.name for attr in self.definition]) + self.controls = controls + self.execution_time = None + self.entries = [] + self.schema = self.connection.server.schema + self._do_not_reset = False # used for refreshing entry in entry_refresh() without removing all entries from the Cursor + self._operation_history = list() # a list storing all the requests, results and responses for the last cursor operation + + def __repr__(self): + r = 'CURSOR : ' + self.__class__.__name__ + linesep + r += 'CONN : ' + str(self.connection) + linesep + r += 'DEFS : ' + ', '.join(self.definition._object_class) + if self.definition._auxiliary_class: + r += ' [AUX: ' + ', '.join(self.definition._auxiliary_class) + ']' + r += linesep + # for attr_def in sorted(self.definition): + # r += (attr_def.key if attr_def.key == attr_def.name else (attr_def.key + ' <' + attr_def.name + '>')) + ', ' + # if r[-2] == ',': + # r = r[:-2] + # r += ']' + linesep + if hasattr(self, 'attributes'): + r += 'ATTRS : ' + repr(sorted(self.attributes)) + (' [OPERATIONAL]' if self.get_operational_attributes else '') + linesep + if isinstance(self, Reader): + if hasattr(self, 'base'): + r += 'BASE : ' + repr(self.base) + (' [SUB]' if self.sub_tree else ' [LEVEL]') + linesep + if hasattr(self, '_query') and self._query: + r += 'QUERY : ' + repr(self._query) + ('' if '(' in self._query else (' [AND]' if self.components_in_and else ' [OR]')) + linesep + if hasattr(self, 'validated_query') and self.validated_query: + r += 'PARSED : ' + repr(self.validated_query) + ('' if '(' in self._query else (' [AND]' if self.components_in_and else ' [OR]')) + linesep + if hasattr(self, 'query_filter') and self.query_filter: + r += 'FILTER : ' + repr(self.query_filter) + linesep + + if hasattr(self, 'execution_time') and self.execution_time: + r += 'ENTRIES: ' + str(len(self.entries)) + r += ' [executed at: ' + str(self.execution_time.isoformat()) + ']' + linesep + + if self.failed: + r += 'LAST OPERATION FAILED [' + str(len(self.errors)) + ' failure' + ('s' if len(self.errors) > 1 else '') + ' at operation' + ('s ' if len(self.errors) > 1 else ' ') + ', '.join([str(i) for i, error in enumerate(self.operations) if error.result['result'] != RESULT_SUCCESS]) + ']' + + return r + + def __str__(self): + return self.__repr__() + + def __iter__(self): + return self.entries.__iter__() + + def __getitem__(self, item): + """Return indexed item, if index is not found then try to sequentially search in DN of entries. + If only one entry is found return it else raise a KeyError exception. The exception message + includes the number of entries that matches, if less than 10 entries match then show the DNs + in the exception message. + """ + try: + return self.entries[item] + except TypeError: + pass + + if isinstance(item, STRING_TYPES): + found = self.match_dn(item) + + if len(found) == 1: + return found[0] + elif len(found) > 1: + error_message = 'Multiple entries found: %d entries match the text in dn' % len(found) + ('' if len(found) > 10 else (' [' + '; '.join([e.entry_dn for e in found]) + ']')) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise KeyError(error_message) + + error_message = 'no entry found' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise KeyError(error_message) + + def __len__(self): + return len(self.entries) + + if str is not bytes: # Python 3 + def __bool__(self): # needed to make the cursor appears as existing in "if cursor:" even if there are no entries + return True + else: # Python 2 + def __nonzero__(self): + return True + + def _get_attributes(self, response, attr_defs, entry): + """Assign the result of the LDAP query to the Entry object dictionary. + + If the optional 'post_query' callable is present in the AttrDef it is called with each value of the attribute and the callable result is stored in the attribute. + + Returns the default value for missing attributes. + If the 'dereference_dn' in AttrDef is a ObjectDef then the attribute values are treated as distinguished name and the relevant entry is retrieved and stored in the attribute value. + + """ + conf_operational_attribute_prefix = get_config_parameter('ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX') + conf_attributes_excluded_from_object_def = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF')] + attributes = CaseInsensitiveWithAliasDict() + used_attribute_names = set() + for attr in attr_defs: + attr_def = attr_defs[attr] + attribute_name = None + for attr_name in response['attributes']: + if attr_def.name.lower() == attr_name.lower(): + attribute_name = attr_name + break + + if attribute_name or attr_def.default is not NotImplemented: # attribute value found in result or default value present - NotImplemented allows use of None as default + attribute = self.attribute_class(attr_def, entry, self) + attribute.response = response + attribute.raw_values = response['raw_attributes'][attribute_name] if attribute_name else None + if attr_def.post_query and attr_def.name in response['attributes'] and response['raw_attributes'] != list(): + attribute.values = attr_def.post_query(attr_def.key, response['attributes'][attribute_name]) + else: + if attr_def.default is NotImplemented or (attribute_name and response['raw_attributes'][attribute_name] != list()): + attribute.values = response['attributes'][attribute_name] + else: + attribute.values = attr_def.default if isinstance(attr_def.default, SEQUENCE_TYPES) else [attr_def.default] + if not isinstance(attribute.values, list): # force attribute values to list (if attribute is single-valued) + attribute.values = [attribute.values] + if attr_def.dereference_dn: # try to get object referenced in value + if attribute.values: + temp_reader = Reader(self.connection, attr_def.dereference_dn, base='', get_operational_attributes=self.get_operational_attributes, controls=self.controls) + temp_values = [] + for element in attribute.values: + if entry.entry_dn != element: + temp_values.append(temp_reader.search_object(element)) + else: + error_message = 'object %s is referencing itself in the \'%s\' attribute' % (entry.entry_dn, attribute.definition.name) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPObjectDereferenceError(error_message) + del temp_reader # remove the temporary Reader + attribute.values = temp_values + attributes[attribute.key] = attribute + if attribute.other_names: + attributes.set_alias(attribute.key, attribute.other_names) + if attr_def.other_names: + attributes.set_alias(attribute.key, attr_def.other_names) + used_attribute_names.add(attribute_name) + + if self.attributes: + used_attribute_names.update(self.attributes) + + for attribute_name in response['attributes']: + if attribute_name not in used_attribute_names: + operational_attribute = False + # check if the type is an operational attribute + if attribute_name in self.schema.attribute_types: + if self.schema.attribute_types[attribute_name].no_user_modification or self.schema.attribute_types[attribute_name].usage in [ATTRIBUTE_DIRECTORY_OPERATION, ATTRIBUTE_DISTRIBUTED_OPERATION, ATTRIBUTE_DSA_OPERATION]: + operational_attribute = True + else: + operational_attribute = True + if not operational_attribute and attribute_name not in attr_defs and attribute_name.lower() not in conf_attributes_excluded_from_object_def: + error_message = 'attribute \'%s\' not in object class \'%s\' for entry %s' % (attribute_name, ', '.join(entry.entry_definition._object_class), entry.entry_dn) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + attribute = OperationalAttribute(AttrDef(conf_operational_attribute_prefix + attribute_name), entry, self) + attribute.raw_values = response['raw_attributes'][attribute_name] + attribute.values = response['attributes'][attribute_name] if isinstance(response['attributes'][attribute_name], SEQUENCE_TYPES) else [response['attributes'][attribute_name]] + if (conf_operational_attribute_prefix + attribute_name) not in attributes: + attributes[conf_operational_attribute_prefix + attribute_name] = attribute + + return attributes + + def match_dn(self, dn): + """Return entries with text in DN""" + matched = [] + for entry in self.entries: + if dn.lower() in entry.entry_dn.lower(): + matched.append(entry) + return matched + + def match(self, attributes, value): + """Return entries with text in one of the specified attributes""" + matched = [] + if not isinstance(attributes, SEQUENCE_TYPES): + attributes = [attributes] + + for entry in self.entries: + found = False + for attribute in attributes: + if attribute in entry: + for attr_value in entry[attribute].values: + if hasattr(attr_value, 'lower') and hasattr(value, 'lower') and value.lower() in attr_value.lower(): + found = True + elif value == attr_value: + found = True + if found: + matched.append(entry) + break + if found: + break + # checks raw values, tries to convert value to byte + raw_value = to_raw(value) + if isinstance(raw_value, (bytes, bytearray)): + for attr_value in entry[attribute].raw_values: + if hasattr(attr_value, 'lower') and hasattr(raw_value, 'lower') and raw_value.lower() in attr_value.lower(): + found = True + elif raw_value == attr_value: + found = True + if found: + matched.append(entry) + break + if found: + break + return matched + + def _create_entry(self, response): + if not response['type'] == 'searchResEntry': + return None + + entry = self.entry_class(response['dn'], self) # define an Entry (writable or readonly), as specified in the cursor definition + entry._state.attributes = self._get_attributes(response, self.definition._attributes, entry) + entry._state.raw_attributes = deepcopy(response['raw_attributes']) + + entry._state.response = response + entry._state.read_time = datetime.now() + entry._state.set_status(self.entry_initial_status) + for attr in entry: # returns the whole attribute object + entry.__dict__[attr.key] = attr + + return entry + + def _execute_query(self, query_scope, attributes): + if not self.connection: + error_message = 'no connection established' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + old_query_filter = None + if query_scope == BASE: # requesting a single object so an always-valid filter is set + if hasattr(self, 'query_filter'): # only Reader has a query filter + old_query_filter = self.query_filter + self.query_filter = '(objectclass=*)' + else: + self._create_query_filter() + if log_enabled(PROTOCOL): + log(PROTOCOL, 'executing query - base: %s - filter: %s - scope: %s for <%s>', self.base, self.query_filter, query_scope, self) + with self.connection: + result = self.connection.search(search_base=self.base, + search_filter=self.query_filter, + search_scope=query_scope, + dereference_aliases=self.dereference_aliases, + attributes=attributes if attributes else list(self.attributes), + get_operational_attributes=self.get_operational_attributes, + controls=self.controls) + if not self.connection.strategy.sync: + response, result, request = self.connection.get_response(result, get_request=True) + else: + if self.connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = self.connection.response + result = self.connection.result + request = self.connection.request + + self._store_operation_in_history(request, result, response) + + if self._do_not_reset: # trick to not remove entries when using _refresh() + return self._create_entry(response[0]) + + self.entries = [] + for r in response: + entry = self._create_entry(r) + if entry is not None: + self.entries.append(entry) + if 'objectClass' in entry: + for object_class in entry.objectClass: + if self.schema and self.schema.object_classes[object_class].kind == CLASS_AUXILIARY and object_class not in self.definition._auxiliary_class: + # add auxiliary class to object definition + self.definition._auxiliary_class.append(object_class) + self.definition._populate_attr_defs(object_class) + self.execution_time = datetime.now() + + if old_query_filter: # requesting a single object so an always-valid filter is set + self.query_filter = old_query_filter + + def remove(self, entry): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'removing entry <%s> in <%s>', entry, self) + self.entries.remove(entry) + + def _reset_history(self): + self._operation_history = list() + + def _store_operation_in_history(self, request, result, response): + self._operation_history.append(Operation(request, result, response)) + + @property + def operations(self): + return self._operation_history + + @property + def errors(self): + return [error for error in self._operation_history if error.result['result'] != RESULT_SUCCESS] + + @property + def failed(self): + if hasattr(self, '_operation_history'): + return any([error.result['result'] != RESULT_SUCCESS for error in self._operation_history]) + + +class Reader(Cursor): + """Reader object to perform searches: + + :param connection: the LDAP connection object to use + :type connection: LDAPConnection + :param object_def: the ObjectDef of the LDAP object returned + :type object_def: ObjectDef + :param query: the simplified query (will be transformed in an LDAP filter) + :type query: str + :param base: starting base of the search + :type base: str + :param components_in_and: specify if assertions in the query must all be satisfied or not (AND/OR) + :type components_in_and: bool + :param sub_tree: specify if the search must be performed ad Single Level (False) or Whole SubTree (True) + :type sub_tree: bool + :param get_operational_attributes: specify if operational attributes are returned or not + :type get_operational_attributes: bool + :param controls: controls to be used in search + :type controls: tuple + + """ + entry_class = Entry # entries are read_only + attribute_class = Attribute # attributes are read_only + entry_initial_status = STATUS_READ + + def __init__(self, connection, object_def, base, query='', components_in_and=True, sub_tree=True, get_operational_attributes=False, attributes=None, controls=None, auxiliary_class=None): + Cursor.__init__(self, connection, object_def, get_operational_attributes, attributes, controls, auxiliary_class) + self._components_in_and = components_in_and + self.sub_tree = sub_tree + self._query = query + self.base = base + self.dereference_aliases = DEREF_ALWAYS + self.validated_query = None + self._query_dict = dict() + self._validated_query_dict = dict() + self.query_filter = None + self.reset() + + if log_enabled(BASIC): + log(BASIC, 'instantiated Reader Cursor: <%r>', self) + + @property + def query(self): + return self._query + + @query.setter + def query(self, value): + self._query = value + self.reset() + + @property + def components_in_and(self): + return self._components_in_and + + @components_in_and.setter + def components_in_and(self, value): + self._components_in_and = value + self.reset() + + def clear(self): + """Clear the Reader search parameters + + """ + self.dereference_aliases = DEREF_ALWAYS + self._reset_history() + + def reset(self): + """Clear all the Reader parameters + + """ + self.clear() + self.validated_query = None + self._query_dict = dict() + self._validated_query_dict = dict() + self.execution_time = None + self.query_filter = None + self.entries = [] + self._create_query_filter() + + def _validate_query(self): + """Processes the text query and verifies that the requested friendly names are in the Reader dictionary + If the AttrDef has a 'validate' property the callable is executed and if it returns False an Exception is raised + + """ + if not self._query_dict: + self._query_dict = _create_query_dict(self._query) + + query = '' + for d in sorted(self._query_dict): + attr = d[1:] if d[0] in '&|' else d + for attr_def in self.definition: + if ''.join(attr.split()).lower() == attr_def.key.lower(): + attr = attr_def.key + break + if attr in self.definition: + vals = sorted(self._query_dict[d].split(';')) + + query += (d[0] + attr if d[0] in '&|' else attr) + ': ' + for val in vals: + val = val.strip() + val_not = True if val[0] == '!' else False + val_search_operator = '=' # default + if val_not: + if val[1:].lstrip()[0] not in '=<>~': + value = val[1:].lstrip() + else: + val_search_operator = val[1:].lstrip()[0] + value = val[1:].lstrip()[1:] + else: + if val[0] not in '=<>~': + value = val.lstrip() + else: + val_search_operator = val[0] + value = val[1:].lstrip() + + if self.definition[attr].validate: + validated = self.definition[attr].validate(value) # returns True, False or a value to substitute to the actual values + if validated is False: + error_message = 'validation failed for attribute %s and value %s' % (d, val) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + elif validated is not True: # a valid LDAP value equivalent to the actual values + value = validated + if val_not: + query += '!' + val_search_operator + str(value) + else: + query += val_search_operator + str(value) + + query += ';' + query = query[:-1] + ', ' + else: + error_message = 'attribute \'%s\' not in definition' % attr + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + self.validated_query = query[:-2] + self._validated_query_dict = _create_query_dict(self.validated_query) + + def _create_query_filter(self): + """Converts the query dictionary to the filter text""" + self.query_filter = '' + + if self.definition._object_class: + self.query_filter += '(&' + if isinstance(self.definition._object_class, SEQUENCE_TYPES) and len(self.definition._object_class) == 1: + self.query_filter += '(objectClass=' + self.definition._object_class[0] + ')' + elif isinstance(self.definition._object_class, SEQUENCE_TYPES): + self.query_filter += '(&' + for object_class in self.definition._object_class: + self.query_filter += '(objectClass=' + object_class + ')' + self.query_filter += ')' + else: + error_message = 'object class must be a string or a list' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + + if self._query and self._query.startswith('(') and self._query.endswith(')'): # query is already an LDAP filter + if 'objectclass' not in self._query.lower(): + self.query_filter += self._query + ')' # if objectclass not in filter adds from definition + else: + self.query_filter = self._query + return + elif self._query: # if a simplified filter is present + if not self.components_in_and: + self.query_filter += '(|' + elif not self.definition._object_class: + self.query_filter += '(&' + + self._validate_query() + + attr_counter = 0 + for attr in sorted(self._validated_query_dict): + attr_counter += 1 + multi = True if ';' in self._validated_query_dict[attr] else False + vals = sorted(self._validated_query_dict[attr].split(';')) + attr_def = self.definition[attr[1:]] if attr[0] in '&|' else self.definition[attr] + if attr_def.pre_query: + modvals = [] + for val in vals: + modvals.append(val[0] + attr_def.pre_query(attr_def.key, val[1:])) + vals = modvals + if multi: + if attr[0] in '&|': + self.query_filter += '(' + attr[0] + else: + self.query_filter += '(|' + + for val in vals: + if val[0] == '!': + self.query_filter += '(!(' + attr_def.name + _ret_search_value(val[1:]) + '))' + else: + self.query_filter += '(' + attr_def.name + _ret_search_value(val) + ')' + if multi: + self.query_filter += ')' + + if not self.components_in_and: + self.query_filter += '))' + else: + self.query_filter += ')' + + if not self.definition._object_class and attr_counter == 1: # removes unneeded starting filter + self.query_filter = self.query_filter[2: -1] + + if self.query_filter == '(|)' or self.query_filter == '(&)': # removes empty filter + self.query_filter = '' + else: # no query, remove unneeded leading (& + self.query_filter = self.query_filter[2:] + + def search(self, attributes=None): + """Perform the LDAP search + + :return: Entries found in search + + """ + self.clear() + query_scope = SUBTREE if self.sub_tree else LEVEL + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing search in <%s>', self) + self._execute_query(query_scope, attributes) + + return self.entries + + def search_object(self, entry_dn=None, attributes=None): # base must be a single dn + """Perform the LDAP search operation SINGLE_OBJECT scope + + :return: Entry found in search + + """ + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing object search in <%s>', self) + self.clear() + if entry_dn: + old_base = self.base + self.base = entry_dn + self._execute_query(BASE, attributes) + self.base = old_base + else: + self._execute_query(BASE, attributes) + + return self.entries[0] if len(self.entries) > 0 else None + + def search_level(self, attributes=None): + """Perform the LDAP search operation with SINGLE_LEVEL scope + + :return: Entries found in search + + """ + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing single level search in <%s>', self) + self.clear() + self._execute_query(LEVEL, attributes) + + return self.entries + + def search_subtree(self, attributes=None): + """Perform the LDAP search operation WHOLE_SUBTREE scope + + :return: Entries found in search + + """ + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing whole subtree search in <%s>', self) + self.clear() + self._execute_query(SUBTREE, attributes) + + return self.entries + + def _entries_generator(self, responses): + for response in responses: + yield self._create_entry(response) + + def search_paged(self, paged_size, paged_criticality=True, generator=True, attributes=None): + """Perform a paged search, can be called as an Iterator + + :param attributes: optional attributes to search + :param paged_size: number of entries returned in each search + :type paged_size: int + :param paged_criticality: specify if server must not execute the search if it is not capable of paging searches + :type paged_criticality: bool + :param generator: if True the paged searches are executed while generating the entries, + if False all the paged searches are execute before returning the generator + :type generator: bool + :return: Entries found in search + + """ + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing paged search in <%s> with paged size %s', self, str(paged_size)) + if not self.connection: + error_message = 'no connection established' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + + self.clear() + self._create_query_filter() + self.entries = [] + self.execution_time = datetime.now() + response = self.connection.extend.standard.paged_search(search_base=self.base, + search_filter=self.query_filter, + search_scope=SUBTREE if self.sub_tree else LEVEL, + dereference_aliases=self.dereference_aliases, + attributes=attributes if attributes else self.attributes, + get_operational_attributes=self.get_operational_attributes, + controls=self.controls, + paged_size=paged_size, + paged_criticality=paged_criticality, + generator=generator) + if generator: + return self._entries_generator(response) + else: + return list(self._entries_generator(response)) + + +class Writer(Cursor): + entry_class = WritableEntry + attribute_class = WritableAttribute + entry_initial_status = STATUS_WRITABLE + + @staticmethod + def from_cursor(cursor, connection=None, object_def=None, custom_validator=None): + if connection is None: + connection = cursor.connection + if object_def is None: + object_def = cursor.definition + writer = Writer(connection, object_def, attributes=cursor.attributes) + for entry in cursor.entries: + if isinstance(cursor, Reader): + entry.entry_writable(object_def, writer, custom_validator=custom_validator) + elif isinstance(cursor, Writer): + pass + else: + error_message = 'unknown cursor type %s' % str(type(cursor)) + if log_enabled(ERROR): + log(ERROR, '%s', error_message) + raise LDAPCursorError(error_message) + writer.execution_time = cursor.execution_time + if log_enabled(BASIC): + log(BASIC, 'instantiated Writer Cursor <%r> from cursor <%r>', writer, cursor) + return writer + + @staticmethod + def from_response(connection, object_def, response=None): + if response is None: + if not connection.strategy.sync: + error_message = 'with asynchronous strategies response must be specified' + if log_enabled(ERROR): + log(ERROR, '%s', error_message) + raise LDAPCursorError(error_message) + elif connection.response: + response = connection.response + else: + error_message = 'response not present' + if log_enabled(ERROR): + log(ERROR, '%s', error_message) + raise LDAPCursorError(error_message) + writer = Writer(connection, object_def) + + for resp in response: + if resp['type'] == 'searchResEntry': + entry = writer._create_entry(resp) + writer.entries.append(entry) + if log_enabled(BASIC): + log(BASIC, 'instantiated Writer Cursor <%r> from response', writer) + return writer + + def __init__(self, connection, object_def, get_operational_attributes=False, attributes=None, controls=None, auxiliary_class=None): + Cursor.__init__(self, connection, object_def, get_operational_attributes, attributes, controls, auxiliary_class) + self.dereference_aliases = DEREF_NEVER + + if log_enabled(BASIC): + log(BASIC, 'instantiated Writer Cursor: <%r>', self) + + def commit(self, refresh=True): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'committed changes for <%s>', self) + self._reset_history() + successful = True + for entry in self.entries: + if not entry.entry_commit_changes(refresh=refresh, controls=self.controls, clear_history=False): + successful = False + + self.execution_time = datetime.now() + + return successful + + def discard(self): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'discarded changes for <%s>', self) + for entry in self.entries: + entry.entry_discard_changes() + + def _refresh_object(self, entry_dn, attributes=None, tries=4, seconds=2, controls=None): # base must be a single dn + """Performs the LDAP search operation SINGLE_OBJECT scope + + :return: Entry found in search + + """ + if log_enabled(PROTOCOL): + log(PROTOCOL, 'refreshing object <%s> for <%s>', entry_dn, self) + if not self.connection: + error_message = 'no connection established' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + + response = [] + with self.connection: + counter = 0 + while counter < tries: + result = self.connection.search(search_base=entry_dn, + search_filter='(objectclass=*)', + search_scope=BASE, + dereference_aliases=DEREF_NEVER, + attributes=attributes if attributes else self.attributes, + get_operational_attributes=self.get_operational_attributes, + controls=controls) + if not self.connection.strategy.sync: + response, result, request = self.connection.get_response(result, get_request=True) + else: + if self.connection.strategy.thread_safe: + _, result, response, request = result + else: + response = self.connection.response + result = self.connection.result + request = self.connection.request + + if result['result'] in [RESULT_SUCCESS]: + break + sleep(seconds) + counter += 1 + self._store_operation_in_history(request, result, response) + + if len(response) == 1: + return self._create_entry(response[0]) + elif len(response) == 0: + return None + + error_message = 'more than 1 entry returned for a single object search' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + + def new(self, dn): + if log_enabled(BASIC): + log(BASIC, 'creating new entry <%s> for <%s>', dn, self) + dn = safe_dn(dn) + for entry in self.entries: # checks if dn is already used in an cursor entry + if entry.entry_dn == dn: + error_message = 'dn already present in cursor' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + rdns = safe_rdn(dn, decompose=True) + entry = self.entry_class(dn, self) # defines a new empty Entry + for attr in entry.entry_mandatory_attributes: # defines all mandatory attributes as virtual + entry._state.attributes[attr] = self.attribute_class(entry._state.definition[attr], entry, self) + entry.__dict__[attr] = entry._state.attributes[attr] + entry.objectclass.set(self.definition._object_class) + for rdn in rdns: # adds virtual attributes from rdns in entry name (should be more than one with + syntax) + if rdn[0] in entry._state.definition._attributes: + rdn_name = entry._state.definition._attributes[rdn[0]].name # normalize case folding + if rdn_name not in entry._state.attributes: + entry._state.attributes[rdn_name] = self.attribute_class(entry._state.definition[rdn_name], entry, self) + entry.__dict__[rdn_name] = entry._state.attributes[rdn_name] + entry.__dict__[rdn_name].set(rdn[1]) + else: + error_message = 'rdn type \'%s\' not in object class definition' % rdn[0] + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + entry._state.set_status(STATUS_VIRTUAL) # set intial status + entry._state.set_status(STATUS_PENDING_CHANGES) # tries to change status to PENDING_CHANGES. If mandatory attributes are missing status is reverted to MANDATORY_MISSING + self.entries.append(entry) + return entry + + def refresh_entry(self, entry, tries=4, seconds=2): + conf_operational_attribute_prefix = get_config_parameter('ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX') + + self._do_not_reset = True + attr_list = [] + if log_enabled(PROTOCOL): + log(PROTOCOL, 'refreshing entry <%s> for <%s>', entry, self) + for attr in entry._state.attributes: # check friendly attribute name in AttrDef, do not check operational attributes + if attr.lower().startswith(conf_operational_attribute_prefix.lower()): + continue + if entry._state.definition[attr].name: + attr_list.append(entry._state.definition[attr].name) + else: + attr_list.append(entry._state.definition[attr].key) + + temp_entry = self._refresh_object(entry.entry_dn, attr_list, tries, seconds=seconds) # if any attributes is added adds only to the entry not to the definition + self._do_not_reset = False + if temp_entry: + temp_entry._state.origin = entry._state.origin + entry.__dict__.clear() + entry.__dict__['_state'] = temp_entry._state + for attr in entry._state.attributes: # returns the attribute key + entry.__dict__[attr] = entry._state.attributes[attr] + + for attr in entry.entry_attributes: # if any attribute of the class was deleted makes it virtual + if attr not in entry._state.attributes and attr in entry.entry_definition._attributes: + entry._state.attributes[attr] = WritableAttribute(entry.entry_definition[attr], entry, self) + entry.__dict__[attr] = entry._state.attributes[attr] + entry._state.set_status(entry._state._initial_status) + return True + return False diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/entry.py b/python/user_packages/Python313/site-packages/ldap3/abstract/entry.py new file mode 100644 index 0000000000000000000000000000000000000000..2375796a682fd10384b8f7c0d9fbe6c1c07f1467 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/abstract/entry.py @@ -0,0 +1,712 @@ +""" +""" + +# Created on 2016.08.19 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + + +import json +try: + from collections import OrderedDict +except ImportError: + from ..utils.ordDict import OrderedDict # for Python 2.6 + +from os import linesep +from copy import deepcopy + +from .. import STRING_TYPES, SEQUENCE_TYPES, MODIFY_ADD, MODIFY_REPLACE +from .attribute import WritableAttribute +from .objectDef import ObjectDef +from .attrDef import AttrDef +from ..core.exceptions import LDAPKeyError, LDAPCursorError, LDAPCursorAttributeError +from ..utils.conv import check_json_dict, format_json, prepare_for_stream +from ..protocol.rfc2849 import operation_to_ldif, add_ldif_header +from ..utils.dn import safe_dn, safe_rdn, to_dn +from ..utils.repr import to_stdout_encoding +from ..utils.ciDict import CaseInsensitiveWithAliasDict +from ..utils.config import get_config_parameter +from . import STATUS_VIRTUAL, STATUS_WRITABLE, STATUS_PENDING_CHANGES, STATUS_COMMITTED, STATUS_DELETED,\ + STATUS_INIT, STATUS_READY_FOR_DELETION, STATUS_READY_FOR_MOVING, STATUS_READY_FOR_RENAMING, STATUS_MANDATORY_MISSING, STATUSES, INITIAL_STATUSES +from ..core.results import RESULT_SUCCESS +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, EXTENDED + + +class EntryState(object): + """Contains data on the status of the entry. Does not pollute the Entry __dict__. + + """ + + def __init__(self, dn, cursor): + self.dn = dn + self._initial_status = None + self._to = None # used for move and rename + self.status = STATUS_INIT + self.attributes = CaseInsensitiveWithAliasDict() + self.raw_attributes = CaseInsensitiveWithAliasDict() + self.response = None + self.cursor = cursor + self.origin = None # reference to the original read-only entry (set when made writable). Needed to update attributes in read-only when modified (only if both refer the same server) + self.read_time = None + self.changes = OrderedDict() # includes changes to commit in a writable entry + if cursor.definition: + self.definition = cursor.definition + else: + self.definition = None + + def __repr__(self): + if self.__dict__ and self.dn is not None: + r = 'DN: ' + to_stdout_encoding(self.dn) + ' - STATUS: ' + ((self._initial_status + ', ') if self._initial_status != self.status else '') + self.status + ' - READ TIME: ' + (self.read_time.isoformat() if self.read_time else '') + linesep + r += 'attributes: ' + ', '.join(sorted(self.attributes.keys())) + linesep + r += 'object def: ' + (', '.join(sorted(self.definition._object_class)) if self.definition._object_class else '') + linesep + r += 'attr defs: ' + ', '.join(sorted(self.definition._attributes.keys())) + linesep + r += 'response: ' + ('present' if self.response else '') + linesep + r += 'cursor: ' + (self.cursor.__class__.__name__ if self.cursor else '') + linesep + return r + else: + return object.__repr__(self) + + def __str__(self): + return self.__repr__() + + def __getstate__(self): + cpy = dict(self.__dict__) + cpy['cursor'] = None + return cpy + + def set_status(self, status): + conf_ignored_mandatory_attributes_in_object_def = [v.lower() for v in get_config_parameter('IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF')] + if status not in STATUSES: + error_message = 'invalid entry status ' + str(status) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + if status in INITIAL_STATUSES: + self._initial_status = status + self.status = status + if status == STATUS_DELETED: + self._initial_status = STATUS_VIRTUAL + if status == STATUS_COMMITTED: + self._initial_status = STATUS_WRITABLE + if self.status == STATUS_VIRTUAL or (self.status == STATUS_PENDING_CHANGES and self._initial_status == STATUS_VIRTUAL): # checks if all mandatory attributes are present in new entries + for attr in self.definition._attributes: + if self.definition._attributes[attr].mandatory and attr.lower() not in conf_ignored_mandatory_attributes_in_object_def: + if (attr not in self.attributes or self.attributes[attr].virtual) and attr not in self.changes: + self.status = STATUS_MANDATORY_MISSING + break + + @property + def entry_raw_attributes(self): + return self.raw_attributes + + +class EntryBase(object): + """The Entry object contains a single LDAP entry. + Attributes can be accessed either by sequence, by assignment + or as dictionary keys. Keys are not case sensitive. + + The Entry object is read only + + - The DN is retrieved by entry_dn + - The cursor reference is in _cursor + - Raw attributes values are retrieved with _raw_attributes and the _raw_attribute() methods + """ + + def __init__(self, dn, cursor): + self._state = EntryState(dn, cursor) + + def __repr__(self): + if self.__dict__ and self.entry_dn is not None: + r = 'DN: ' + to_stdout_encoding(self.entry_dn) + ' - STATUS: ' + ((self._state._initial_status + ', ') if self._state._initial_status != self.entry_status else '') + self.entry_status + ' - READ TIME: ' + (self.entry_read_time.isoformat() if self.entry_read_time else '') + linesep + if self._state.attributes: + for attr in sorted(self._state.attributes): + if self._state.attributes[attr] or (hasattr(self._state.attributes[attr], 'changes') and self._state.attributes[attr].changes): + r += ' ' + repr(self._state.attributes[attr]) + linesep + return r + else: + return object.__repr__(self) + + def __str__(self): + return self.__repr__() + + def __iter__(self): + for attribute in self._state.attributes: + yield self._state.attributes[attribute] + # raise StopIteration # deprecated in PEP 479 + return + + def __contains__(self, item): + try: + self.__getitem__(item) + return True + except LDAPKeyError: + return False + + def __getattr__(self, item): + if isinstance(item, STRING_TYPES): + if item == '_state': + return object.__getattr__(self, item) + item = ''.join(item.split()).lower() + attr_found = None + for attr in self._state.attributes.keys(): + if item == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.aliases(): + if item == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.keys(): + if item + ';binary' == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.aliases(): + if item + ';binary' == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.keys(): + if item + ';range' in attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.aliases(): + if item + ';range' in attr.lower(): + attr_found = attr + break + if not attr_found: + error_message = 'attribute \'%s\' not found' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + return self._state.attributes[attr] + error_message = 'attribute name must be a string' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + + def __setattr__(self, item, value): + if item == '_state': + object.__setattr__(self, item, value) + elif item in self._state.attributes: + error_message = 'attribute \'%s\' is read only' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + else: + error_message = 'entry is read only, cannot add \'%s\'' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + + def __getitem__(self, item): + if isinstance(item, STRING_TYPES): + item = ''.join(item.split()).lower() + attr_found = None + for attr in self._state.attributes.keys(): + if item == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.aliases(): + if item == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.keys(): + if item + ';binary' == attr.lower(): + attr_found = attr + break + if not attr_found: + for attr in self._state.attributes.aliases(): + if item + ';binary' == attr.lower(): + attr_found = attr + break + if not attr_found: + error_message = 'key \'%s\' not found' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPKeyError(error_message) + return self._state.attributes[attr] + + error_message = 'key must be a string' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPKeyError(error_message) + + def __eq__(self, other): + if isinstance(other, EntryBase): + return self.entry_dn == other.entry_dn + + return False + + def __lt__(self, other): + if isinstance(other, EntryBase): + return self.entry_dn <= other.entry_dn + + return False + + @property + def entry_dn(self): + return self._state.dn + + @property + def entry_cursor(self): + return self._state.cursor + + @property + def entry_status(self): + return self._state.status + + @property + def entry_definition(self): + return self._state.definition + + @property + def entry_raw_attributes(self): + return self._state.raw_attributes + + def entry_raw_attribute(self, name): + """ + + :param name: name of the attribute + :return: raw (unencoded) value of the attribute, None if attribute is not found + """ + return self._state.raw_attributes[name] if name in self._state.raw_attributes else None + + @property + def entry_mandatory_attributes(self): + return [attribute for attribute in self.entry_definition._attributes if self.entry_definition._attributes[attribute].mandatory] + + @property + def entry_attributes(self): + return list(self._state.attributes.keys()) + + @property + def entry_attributes_as_dict(self): + return dict((attribute_key, deepcopy(attribute_value.values)) for (attribute_key, attribute_value) in self._state.attributes.items()) + + @property + def entry_read_time(self): + return self._state.read_time + + @property + def _changes(self): + return self._state.changes + + def entry_to_json(self, raw=False, indent=4, sort=True, stream=None, checked_attributes=True, include_empty=True): + json_entry = dict() + json_entry['dn'] = self.entry_dn + if checked_attributes: + if not include_empty: + # needed for python 2.6 compatibility + json_entry['attributes'] = dict((key, self.entry_attributes_as_dict[key]) for key in self.entry_attributes_as_dict if self.entry_attributes_as_dict[key]) + else: + json_entry['attributes'] = self.entry_attributes_as_dict + if raw: + if not include_empty: + # needed for python 2.6 compatibility + json_entry['raw'] = dict((key, self.entry_raw_attributes[key]) for key in self.entry_raw_attributes if self.entry_raw_attributes[key]) + else: + json_entry['raw'] = dict(self.entry_raw_attributes) + + if str is bytes: # Python 2 + check_json_dict(json_entry) + + json_output = json.dumps(json_entry, + ensure_ascii=True, + sort_keys=sort, + indent=indent, + check_circular=True, + default=format_json, + separators=(',', ': ')) + + if stream: + stream.write(json_output) + + return json_output + + def entry_to_ldif(self, all_base64=False, line_separator=None, sort_order=None, stream=None): + ldif_lines = operation_to_ldif('searchResponse', [self._state.response], all_base64, sort_order=sort_order) + ldif_lines = add_ldif_header(ldif_lines) + line_separator = line_separator or linesep + ldif_output = line_separator.join(ldif_lines) + if stream: + if stream.tell() == 0: + header = add_ldif_header(['-'])[0] + stream.write(prepare_for_stream(header + line_separator + line_separator)) + stream.write(prepare_for_stream(ldif_output + line_separator + line_separator)) + return ldif_output + + +class Entry(EntryBase): + """The Entry object contains a single LDAP entry. + Attributes can be accessed either by sequence, by assignment + or as dictionary keys. Keys are not case sensitive. + + The Entry object is read only + + - The DN is retrieved by entry_dn + - The Reader reference is in _cursor() + - Raw attributes values are retrieved by the _ra_attributes and + _raw_attribute() methods + + """ + def entry_writable(self, object_def=None, writer_cursor=None, attributes=None, custom_validator=None, auxiliary_class=None): + conf_operational_attribute_prefix = get_config_parameter('ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX') + if not self.entry_cursor.schema: + error_message = 'schema must be available to make an entry writable' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + # returns a new WritableEntry and its Writer cursor + if object_def is None: + if self.entry_cursor.definition._object_class: + object_def = self.entry_definition._object_class + auxiliary_class = self.entry_definition._auxiliary_class + (auxiliary_class if isinstance(auxiliary_class, SEQUENCE_TYPES) else []) + elif 'objectclass' in self: + object_def = self.objectclass.values + + if not object_def: + error_message = 'object class must be specified to make an entry writable' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + + if not isinstance(object_def, ObjectDef): + object_def = ObjectDef(object_def, self.entry_cursor.schema, custom_validator, auxiliary_class) + + if attributes: + if isinstance(attributes, STRING_TYPES): + attributes = [attributes] + + if isinstance(attributes, SEQUENCE_TYPES): + for attribute in attributes: + if attribute not in object_def._attributes: + error_message = 'attribute \'%s\' not in schema for \'%s\'' % (attribute, object_def) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + else: + attributes = [] + + if not writer_cursor: + from .cursor import Writer # local import to avoid circular reference in import at startup + writable_cursor = Writer(self.entry_cursor.connection, object_def) + else: + writable_cursor = writer_cursor + + if attributes: # force reading of attributes + writable_entry = writable_cursor._refresh_object(self.entry_dn, list(attributes) + self.entry_attributes) + else: + writable_entry = writable_cursor._create_entry(self._state.response) + writable_cursor.entries.append(writable_entry) + writable_entry._state.read_time = self.entry_read_time + writable_entry._state.origin = self # reference to the original read-only entry + # checks original entry for custom definitions in AttrDefs + attr_to_add = [] + attr_to_remove = [] + object_def_to_add = [] + object_def_to_remove = [] + for attr in writable_entry._state.origin.entry_definition._attributes: + original_attr = writable_entry._state.origin.entry_definition._attributes[attr] + if attr != original_attr.name and (attr not in writable_entry._state.attributes or conf_operational_attribute_prefix + original_attr.name not in writable_entry._state.attributes): + old_attr_def = writable_entry.entry_definition._attributes[original_attr.name] + new_attr_def = AttrDef(original_attr.name, + key=attr, + validate=original_attr.validate, + pre_query=original_attr.pre_query, + post_query=original_attr.post_query, + default=original_attr.default, + dereference_dn=original_attr.dereference_dn, + description=original_attr.description, + mandatory=old_attr_def.mandatory, # keeps value read from schema + single_value=old_attr_def.single_value, # keeps value read from schema + alias=original_attr.other_names) + od = writable_entry.entry_definition + object_def_to_remove.append(old_attr_def) + object_def_to_add.append(new_attr_def) + # updates attribute name in entry attributes + new_attr = WritableAttribute(new_attr_def, writable_entry, writable_cursor) + if original_attr.name in writable_entry._state.attributes: + new_attr.other_names = writable_entry._state.attributes[original_attr.name].other_names + new_attr.raw_values = writable_entry._state.attributes[original_attr.name].raw_values + new_attr.values = writable_entry._state.attributes[original_attr.name].values + new_attr.response = writable_entry._state.attributes[original_attr.name].response + attr_to_add.append((attr, new_attr)) + attr_to_remove.append(original_attr.name) + # writable_entry._state.attributes[attr] = new_attr + ## writable_entry._state.attributes.set_alias(attr, new_attr.other_names) + # del writable_entry._state.attributes[original_attr.name] + for attr, new_attr in attr_to_add: + writable_entry._state.attributes[attr] = new_attr + for attr in attr_to_remove: + del writable_entry._state.attributes[attr] + for object_def in object_def_to_remove: + o = writable_entry.entry_definition + o -= object_def + for object_def in object_def_to_add: + o = writable_entry.entry_definition + o += object_def + + writable_entry._state.set_status(STATUS_WRITABLE) + return writable_entry + + +class WritableEntry(EntryBase): + def __setitem__(self, key, value): + if value is not Ellipsis: # hack for using implicit operators in writable attributes + self.__setattr__(key, value) + + def __setattr__(self, item, value): + conf_attributes_excluded_from_object_def = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF')] + if item == '_state' and isinstance(value, EntryState): + self.__dict__['_state'] = value + return + + if value is not Ellipsis: # hack for using implicit operators in writable attributes + # checks if using an alias + if item in self.entry_cursor.definition._attributes or item.lower() in conf_attributes_excluded_from_object_def: + if item not in self._state.attributes: # setting value to an attribute still without values + new_attribute = WritableAttribute(self.entry_cursor.definition._attributes[item], self, cursor=self.entry_cursor) + self._state.attributes[str(item)] = new_attribute # force item to a string for key in attributes dict + self._state.attributes[item].set(value) # try to add to new_values + else: + error_message = 'attribute \'%s\' not defined' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + + def __getattr__(self, item): + if isinstance(item, STRING_TYPES): + if item == '_state': + return self.__dict__['_state'] + item = ''.join(item.split()).lower() + for attr in self._state.attributes.keys(): + if item == attr.lower(): + return self._state.attributes[attr] + for attr in self._state.attributes.aliases(): + if item == attr.lower(): + return self._state.attributes[attr] + if item in self.entry_definition._attributes: # item is a new attribute to commit, creates the AttrDef and add to the attributes to retrive + self._state.attributes[item] = WritableAttribute(self.entry_definition._attributes[item], self, self.entry_cursor) + self.entry_cursor.attributes.add(item) + return self._state.attributes[item] + error_message = 'attribute \'%s\' not defined' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + else: + error_message = 'attribute name must be a string' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorAttributeError(error_message) + + @property + def entry_virtual_attributes(self): + return [attr for attr in self.entry_attributes if self[attr].virtual] + + def entry_commit_changes(self, refresh=True, controls=None, clear_history=True): + if clear_history: + self.entry_cursor._reset_history() + + if self.entry_status == STATUS_READY_FOR_DELETION: + result = self.entry_cursor.connection.delete(self.entry_dn, controls) + if not self.entry_cursor.connection.strategy.sync: + response, result, request = self.entry_cursor.connection.get_response(result, get_request=True) + else: + if self.entry_cursor.connection.strategy.thread_safe: + _, result, response, request = result + else: + response = self.entry_cursor.connection.response + result = self.entry_cursor.connection.result + request = self.entry_cursor.connection.request + self.entry_cursor._store_operation_in_history(request, result, response) + if result['result'] == RESULT_SUCCESS: + dn = self.entry_dn + if self._state.origin and self.entry_cursor.connection.server == self._state.origin.entry_cursor.connection.server: # deletes original read-only Entry + cursor = self._state.origin.entry_cursor + self._state.origin.__dict__.clear() + self._state.origin.__dict__['_state'] = EntryState(dn, cursor) + self._state.origin._state.set_status(STATUS_DELETED) + cursor = self.entry_cursor + self.__dict__.clear() + self._state = EntryState(dn, cursor) + self._state.set_status(STATUS_DELETED) + return True + return False + elif self.entry_status == STATUS_READY_FOR_MOVING: + result = self.entry_cursor.connection.modify_dn(self.entry_dn, '+'.join(safe_rdn(self.entry_dn)), new_superior=self._state._to) + if not self.entry_cursor.connection.strategy.sync: + response, result, request = self.entry_cursor.connection.get_response(result, get_request=True) + else: + if self.entry_cursor.connection.strategy.thread_safe: + _, result, response, request = result + else: + response = self.entry_cursor.connection.response + result = self.entry_cursor.connection.result + request = self.entry_cursor.connection.request + self.entry_cursor._store_operation_in_history(request, result, response) + if result['result'] == RESULT_SUCCESS: + self._state.dn = safe_dn('+'.join(safe_rdn(self.entry_dn)) + ',' + self._state._to) + if refresh: + if self.entry_refresh(): + if self._state.origin and self.entry_cursor.connection.server == self._state.origin.entry_cursor.connection.server: # refresh dn of origin + self._state.origin._state.dn = self.entry_dn + self._state.set_status(STATUS_COMMITTED) + self._state._to = None + return True + return False + elif self.entry_status == STATUS_READY_FOR_RENAMING: + rdn = '+'.join(safe_rdn(self._state._to)) + result = self.entry_cursor.connection.modify_dn(self.entry_dn, rdn) + if not self.entry_cursor.connection.strategy.sync: + response, result, request = self.entry_cursor.connection.get_response(result, get_request=True) + else: + if self.entry_cursor.connection.strategy.thread_safe: + _, result, response, request = result + else: + response = self.entry_cursor.connection.response + result = self.entry_cursor.connection.result + request = self.entry_cursor.connection.request + self.entry_cursor._store_operation_in_history(request, result, response) + if result['result'] == RESULT_SUCCESS: + self._state.dn = rdn + ',' + ','.join(to_dn(self.entry_dn)[1:]) + if refresh: + if self.entry_refresh(): + if self._state.origin and self.entry_cursor.connection.server == self._state.origin.entry_cursor.connection.server: # refresh dn of origin + self._state.origin._state.dn = self.entry_dn + self._state.set_status(STATUS_COMMITTED) + self._state._to = None + return True + return False + elif self.entry_status in [STATUS_VIRTUAL, STATUS_MANDATORY_MISSING]: + missing_attributes = [] + for attr in self.entry_mandatory_attributes: + if (attr not in self._state.attributes or self._state.attributes[attr].virtual) and attr not in self._changes: + missing_attributes.append('\'' + attr + '\'') + error_message = 'mandatory attributes %s missing in entry %s' % (', '.join(missing_attributes), self.entry_dn) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + elif self.entry_status == STATUS_PENDING_CHANGES: + if self._changes: + if self.entry_definition._auxiliary_class: # checks if an attribute is from an auxiliary class and adds it to the objectClass attribute if not present + for attr in self._changes: + # checks schema to see if attribute is defined in one of the already present object classes + attr_classes = self.entry_cursor.schema.attribute_types[attr].mandatory_in + self.entry_cursor.schema.attribute_types[attr].optional_in + for object_class in self.objectclass: + if object_class in attr_classes: + break + else: # executed only if the attribute class is not present in the objectClass attribute + # checks if attribute is defined in one of the possible auxiliary classes + for aux_class in self.entry_definition._auxiliary_class: + if aux_class in attr_classes: + if self._state._initial_status == STATUS_VIRTUAL: # entry is new, there must be a pending objectClass MODIFY_REPLACE + self._changes['objectClass'][0][1].append(aux_class) + else: + self.objectclass += aux_class + if self._state._initial_status == STATUS_VIRTUAL: + new_attributes = dict() + for attr in self._changes: + new_attributes[attr] = self._changes[attr][0][1] + result = self.entry_cursor.connection.add(self.entry_dn, None, new_attributes, controls) + else: + result = self.entry_cursor.connection.modify(self.entry_dn, self._changes, controls) + + if not self.entry_cursor.connection.strategy.sync: # asynchronous request + response, result, request = self.entry_cursor.connection.get_response(result, get_request=True) + else: + if self.entry_cursor.connection.strategy.thread_safe: + _, result, response, request = result + else: + response = self.entry_cursor.connection.response + result = self.entry_cursor.connection.result + request = self.entry_cursor.connection.request + self.entry_cursor._store_operation_in_history(request, result, response) + + if result['result'] == RESULT_SUCCESS: + if refresh: + if self.entry_refresh(): + if self._state.origin and self.entry_cursor.connection.server == self._state.origin.entry_cursor.connection.server: # updates original read-only entry if present + for attr in self: # adds AttrDefs from writable entry to origin entry definition if some is missing + if attr.key in self.entry_definition._attributes and attr.key not in self._state.origin.entry_definition._attributes: + self._state.origin.entry_cursor.definition.add_attribute(self.entry_cursor.definition._attributes[attr.key]) # adds AttrDef from writable entry to original entry if missing + temp_entry = self._state.origin.entry_cursor._create_entry(self._state.response) + self._state.origin.__dict__.clear() + self._state.origin.__dict__['_state'] = temp_entry._state + for attr in self: # returns the whole attribute object + if not hasattr(attr,'virtual'): + self._state.origin.__dict__[attr.key] = self._state.origin._state.attributes[attr.key] + self._state.origin._state.read_time = self.entry_read_time + else: + self.entry_discard_changes() # if not refreshed remove committed changes + self._state.set_status(STATUS_COMMITTED) + return True + return False + + def entry_discard_changes(self): + self._changes.clear() + self._state.set_status(self._state._initial_status) + + def entry_delete(self): + if self.entry_status not in [STATUS_WRITABLE, STATUS_COMMITTED, STATUS_READY_FOR_DELETION]: + error_message = 'cannot delete entry, invalid status: ' + self.entry_status + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + self._state.set_status(STATUS_READY_FOR_DELETION) + + def entry_refresh(self, tries=4, seconds=2): + """ + + Refreshes the entry from the LDAP Server + """ + if self.entry_cursor.connection: + if self.entry_cursor.refresh_entry(self, tries, seconds): + return True + + return False + + def entry_move(self, destination_dn): + if self.entry_status not in [STATUS_WRITABLE, STATUS_COMMITTED, STATUS_READY_FOR_MOVING]: + error_message = 'cannot move entry, invalid status: ' + self.entry_status + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + self._state._to = safe_dn(destination_dn) + self._state.set_status(STATUS_READY_FOR_MOVING) + + def entry_rename(self, new_name): + if self.entry_status not in [STATUS_WRITABLE, STATUS_COMMITTED, STATUS_READY_FOR_RENAMING]: + error_message = 'cannot rename entry, invalid status: ' + self.entry_status + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPCursorError(error_message) + self._state._to = new_name + self._state.set_status(STATUS_READY_FOR_RENAMING) + + @property + def entry_changes(self): + return self._changes diff --git a/python/user_packages/Python313/site-packages/ldap3/abstract/objectDef.py b/python/user_packages/Python313/site-packages/ldap3/abstract/objectDef.py new file mode 100644 index 0000000000000000000000000000000000000000..1f8609c43d980587e25d374904bce5cb76b103f3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/abstract/objectDef.py @@ -0,0 +1,270 @@ +""" +""" + +# Created on 2014.02.02 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from os import linesep + +from .attrDef import AttrDef +from ..core.exceptions import LDAPKeyError, LDAPObjectError, LDAPAttributeError, LDAPSchemaError +from .. import STRING_TYPES, SEQUENCE_TYPES, Server, Connection +from ..protocol.rfc4512 import SchemaInfo, constant_to_class_kind +from ..protocol.formatters.standard import find_attribute_validator +from ..utils.ciDict import CaseInsensitiveWithAliasDict +from ..utils.config import get_config_parameter +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, EXTENDED + + +class ObjectDef(object): + """Represent an object in the LDAP server. AttrDefs are stored in a dictionary; the key is the friendly name defined in AttrDef. + + AttrDefs can be added and removed using the += and -= operators + + ObjectDef can be accessed either as a sequence and a dictionary. When accessed the whole AttrDef instance is returned + + """ + def __init__(self, object_class=None, schema=None, custom_validator=None, auxiliary_class=None): + if object_class is None: + object_class = [] + + if not isinstance(object_class, SEQUENCE_TYPES): + object_class = [object_class] + + if auxiliary_class is None: + auxiliary_class = [] + + if not isinstance(auxiliary_class, SEQUENCE_TYPES): + auxiliary_class = [auxiliary_class] + + self.__dict__['_attributes'] = CaseInsensitiveWithAliasDict() + self.__dict__['_custom_validator'] = custom_validator + self.__dict__['_oid_info'] = [] + + if isinstance(schema, Connection) and (schema._deferred_bind or schema._deferred_open): # probably a lazy connection, tries to bind + schema._fire_deferred() + + if schema is not None: + if isinstance(schema, Server): + schema = schema.schema + elif isinstance(schema, Connection): + schema = schema.server.schema + elif isinstance(schema, SchemaInfo): + pass + elif schema: + error_message = 'unable to read schema' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPSchemaError(error_message) + if schema is None: + error_message = 'schema not present' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPSchemaError(error_message) + self.__dict__['_schema'] = schema + + if self._schema: + object_class = [schema.object_classes[name].name[0] for name in object_class] # uses object class names capitalized as in schema + auxiliary_class = [schema.object_classes[name].name[0] for name in auxiliary_class] + for object_name in object_class: + if object_name: + self._populate_attr_defs(object_name) + + for object_name in auxiliary_class: + if object_name: + self._populate_attr_defs(object_name) + + self.__dict__['_object_class'] = object_class + self.__dict__['_auxiliary_class'] = auxiliary_class + + if log_enabled(BASIC): + log(BASIC, 'instantiated ObjectDef: <%r>', self) + + def _populate_attr_defs(self, object_name): + if object_name in self._schema.object_classes: + object_schema = self._schema.object_classes[object_name] + self.__dict__['_oid_info'].append(object_name + " (" + constant_to_class_kind(object_schema.kind) + ") " + str(object_schema.oid)) + + if object_schema.superior: + for sup in object_schema.superior: + self._populate_attr_defs(sup) + for attribute_name in object_schema.must_contain: + self.add_from_schema(attribute_name, True) + for attribute_name in object_schema.may_contain: + if attribute_name not in self._attributes: # the attribute could already be defined as "mandatory" in a superclass + self.add_from_schema(attribute_name, False) + else: + error_message = 'object class \'%s\' not defined in schema' % object_name + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPObjectError(error_message) + + def __repr__(self): + if self._object_class: + r = 'OBJ : ' + ', '.join(self._object_class) + linesep + else: + r = 'OBJ : ' + linesep + if self._auxiliary_class: + r += 'AUX : ' + ', '.join(self._auxiliary_class) + linesep + else: + r += 'AUX : ' + linesep + r += 'OID: ' + ', '.join([oid for oid in self._oid_info]) + linesep + r += 'MUST: ' + ', '.join(sorted([attr for attr in self._attributes if self._attributes[attr].mandatory])) + linesep + r += 'MAY : ' + ', '.join(sorted([attr for attr in self._attributes if not self._attributes[attr].mandatory])) + linesep + + return r + + def __str__(self): + return self.__repr__() + + def __getitem__(self, item): + return self.__getattr__(item) + + def __getattr__(self, item): + item = ''.join(item.split()).lower() + if '_attributes' in self.__dict__: + try: + return self._attributes[item] + except KeyError: + error_message = 'key \'%s\' not present' % item + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPKeyError(error_message) + else: + error_message = 'internal _attributes property not defined' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPKeyError(error_message) + + def __setattr__(self, key, value): + error_message = 'object \'%s\' is read only' % key + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPObjectError(error_message) + + def __iadd__(self, other): + self.add_attribute(other) + return self + + def __isub__(self, other): + if isinstance(other, AttrDef): + self.remove_attribute(other.key) + elif isinstance(other, STRING_TYPES): + self.remove_attribute(other) + + return self + + def __iter__(self): + for attribute in self._attributes: + yield self._attributes[attribute] + + def __len__(self): + return len(self._attributes) + + if str is not bytes: # Python 3 + def __bool__(self): # needed to make the objectDef appears as existing in "if cursor:" even if there are no entries + return True + else: # Python 2 + def __nonzero__(self): + return True + + def __contains__(self, item): + try: + self.__getitem__(item) + except KeyError: + return False + + return True + + def add_from_schema(self, attribute_name, mandatory=False): + attr_def = AttrDef(attribute_name) + attr_def.validate = find_attribute_validator(self._schema, attribute_name, self._custom_validator) + attr_def.mandatory = mandatory # in schema mandatory is specified in the object class, not in the attribute class + if self._schema and self._schema.attribute_types and attribute_name in self._schema.attribute_types: + attr_def.single_value = self._schema.attribute_types[attribute_name].single_value + attr_def.oid_info = self._schema.attribute_types[attribute_name] + self.add_attribute(attr_def) + + def add_attribute(self, definition=None): + """Add an AttrDef to the ObjectDef. Can be called with the += operator. + :param definition: the AttrDef object to add, can also be a string containing the name of attribute to add. Can be a list of both + + """ + conf_attributes_excluded_from_object_def = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF')] + if isinstance(definition, STRING_TYPES): + self.add_from_schema(definition) + elif isinstance(definition, AttrDef): + if definition.key.lower() not in conf_attributes_excluded_from_object_def: + if definition.key not in self._attributes: + self._attributes[definition.key] = definition + if definition.name and definition.name != definition.key: + self._attributes.set_alias(definition.key, definition.name) + other_names = [name for name in definition.oid_info.name if definition.key.lower() != name.lower()] if definition.oid_info else None + if other_names: + self._attributes.set_alias(definition.key, other_names) + + if not definition.validate: + validator = find_attribute_validator(self._schema, definition.key, self._custom_validator) + self._attributes[definition.key].validate = validator + elif isinstance(definition, SEQUENCE_TYPES): + for element in definition: + self.add_attribute(element) + else: + error_message = 'unable to add element to object definition' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPObjectError(error_message) + + def remove_attribute(self, item): + """Remove an AttrDef from the ObjectDef. Can be called with the -= operator. + :param item: the AttrDef to remove, can also be a string containing the name of attribute to remove + + """ + key = None + if isinstance(item, STRING_TYPES): + key = ''.join(item.split()).lower() + elif isinstance(item, AttrDef): + key = item.key.lower() + + if key: + for attr in self._attributes: + if key == attr.lower(): + del self._attributes[attr] + break + else: + error_message = 'key \'%s\' not present' % key + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPKeyError(error_message) + else: + error_message = 'key type must be str or AttrDef not ' + str(type(item)) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error_message, self) + raise LDAPAttributeError(error_message) + + def clear_attributes(self): + """Empty the ObjectDef attribute list + + """ + self.__dict__['object_class'] = None + self.__dict__['auxiliary_class'] = None + self.__dict__['_attributes'] = dict() diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__init__.py b/python/user_packages/Python313/site-packages/ldap3/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..660d5aaebf159727654c0928705fe255cca43bfd Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/connection.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/connection.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b20a5805b7c7facbe5fa56635403e383a0ac682 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/connection.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/exceptions.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0cd1ea1d87f6b017a020f84088f20b169cc12fa9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/exceptions.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/pooling.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/pooling.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2a14934760c79b4d02bccc59dc278a86f6be2b2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/pooling.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/rdns.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/rdns.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72b2d178afee9a3a2003f7c9391a1dc70b22ec62 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/rdns.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/results.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/results.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1f122b60c92b8dab685c6829d3f486dbd3aa4f0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/results.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/server.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/server.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0972b0fa09c67e4abf883153855bec42bb52a9d9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/server.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/timezone.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/timezone.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7521ac8d8346942d7751afe68170ad179ed604ff Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/timezone.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/tls.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/tls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d06f6e66756c00818b11a3c3ee7fef7ab19d6f6e Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/tls.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/usage.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/usage.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43507edc4e778ca6dcc8faab0c27668c79bb95b8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/core/__pycache__/usage.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/core/connection.py b/python/user_packages/Python313/site-packages/ldap3/core/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..c062d3aa3922f5b4cefbc85b6736353556c8009c --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/connection.py @@ -0,0 +1,1605 @@ +""" +""" + +# Created on 2014.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from copy import deepcopy, copy +from os import linesep +from threading import RLock +from functools import reduce +import json + +from .. import ANONYMOUS, SIMPLE, SASL, MODIFY_ADD, MODIFY_DELETE, MODIFY_REPLACE, get_config_parameter, DEREF_ALWAYS, \ + SUBTREE, ASYNC, SYNC, NO_ATTRIBUTES, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, MODIFY_INCREMENT, LDIF, ASYNC_STREAM, \ + RESTARTABLE, ROUND_ROBIN, REUSABLE, AUTO_BIND_DEFAULT, AUTO_BIND_NONE, AUTO_BIND_TLS_BEFORE_BIND, SAFE_SYNC, SAFE_RESTARTABLE, \ + AUTO_BIND_TLS_AFTER_BIND, AUTO_BIND_NO_TLS, STRING_TYPES, SEQUENCE_TYPES, MOCK_SYNC, MOCK_ASYNC, NTLM, EXTERNAL,\ + DIGEST_MD5, GSSAPI, PLAIN, DSA, SCHEMA, ALL + +from .results import RESULT_SUCCESS, RESULT_COMPARE_TRUE, RESULT_COMPARE_FALSE +from ..extend import ExtendedOperationsRoot +from .pooling import ServerPool +from .server import Server +from ..operation.abandon import abandon_operation, abandon_request_to_dict +from ..operation.add import add_operation, add_request_to_dict +from ..operation.bind import bind_operation, bind_request_to_dict +from ..operation.compare import compare_operation, compare_request_to_dict +from ..operation.delete import delete_operation, delete_request_to_dict +from ..operation.extended import extended_operation, extended_request_to_dict +from ..operation.modify import modify_operation, modify_request_to_dict +from ..operation.modifyDn import modify_dn_operation, modify_dn_request_to_dict +from ..operation.search import search_operation, search_request_to_dict +from ..protocol.rfc2849 import operation_to_ldif, add_ldif_header +from ..protocol.sasl.digestMd5 import sasl_digest_md5 +from ..protocol.sasl.external import sasl_external +from ..protocol.sasl.plain import sasl_plain +from ..strategy.sync import SyncStrategy +from ..strategy.safeSync import SafeSyncStrategy +from ..strategy.safeRestartable import SafeRestartableStrategy +from ..strategy.mockAsync import MockAsyncStrategy +from ..strategy.asynchronous import AsyncStrategy +from ..strategy.reusable import ReusableStrategy +from ..strategy.restartable import RestartableStrategy +from ..strategy.ldifProducer import LdifProducerStrategy +from ..strategy.mockSync import MockSyncStrategy +from ..strategy.asyncStream import AsyncStreamStrategy +from ..operation.unbind import unbind_operation +from ..protocol.rfc2696 import paged_search_control +from .usage import ConnectionUsage +from .tls import Tls +from .exceptions import LDAPUnknownStrategyError, LDAPBindError, LDAPUnknownAuthenticationMethodError, \ + LDAPSASLMechanismNotSupportedError, LDAPObjectClassError, LDAPConnectionIsReadOnlyError, LDAPChangeError, LDAPExceptionError, \ + LDAPObjectError, LDAPSocketReceiveError, LDAPAttributeError, LDAPInvalidValueError, LDAPInvalidPortError, LDAPStartTLSError + +from ..utils.conv import escape_bytes, prepare_for_stream, check_json_dict, format_json, to_unicode +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, EXTENDED, get_library_log_hide_sensitive_data +from ..utils.dn import safe_dn +from ..utils.port_validators import check_port_and_port_list + + +SASL_AVAILABLE_MECHANISMS = [EXTERNAL, + DIGEST_MD5, + GSSAPI, + PLAIN] + +CLIENT_STRATEGIES = [SYNC, + SAFE_SYNC, + SAFE_RESTARTABLE, + ASYNC, + LDIF, + RESTARTABLE, + REUSABLE, + MOCK_SYNC, + MOCK_ASYNC, + ASYNC_STREAM] + + +def _format_socket_endpoint(endpoint): + if endpoint and len(endpoint) == 2: # IPv4 + return str(endpoint[0]) + ':' + str(endpoint[1]) + elif endpoint and len(endpoint) == 4: # IPv6 + return '[' + str(endpoint[0]) + ']:' + str(endpoint[1]) + + try: + return str(endpoint) + except Exception: + return '?' + + +def _format_socket_endpoints(sock): + if sock: + try: + local = sock.getsockname() + except Exception: + local = (None, None, None, None) + try: + remote = sock.getpeername() + except Exception: + remote = (None, None, None, None) + + return '' + return '' + + +class Connection(object): + """Main ldap connection class. + + Controls, if used, must be a list of tuples. Each tuple must have 3 + elements, the control OID, a boolean meaning if the control is + critical, a value. + + If the boolean is set to True the server must honor the control or + refuse the operation + + Mixing controls must be defined in controls specification (as per + RFC 4511) + + :param server: the Server object to connect to + :type server: Server, str + :param user: the user name for simple authentication + :type user: str + :param password: the password for simple authentication + :type password: str + :param auto_bind: specify if the bind will be performed automatically when defining the Connection object + :type auto_bind: int, can be one of AUTO_BIND_DEFAULT, AUTO_BIND_NONE, AUTO_BIND_NO_TLS, AUTO_BIND_TLS_BEFORE_BIND, AUTO_BIND_TLS_AFTER_BIND as specified in ldap3 + :param version: LDAP version, default to 3 + :type version: int + :param authentication: type of authentication + :type authentication: int, can be one of ANONYMOUS, SIMPLE or SASL, as specified in ldap3 + :param client_strategy: communication strategy used in the Connection + :type client_strategy: can be one of SYNC, ASYNC, LDIF, RESTARTABLE, REUSABLE as specified in ldap3 + :param auto_referrals: specify if the connection object must automatically follow referrals + :type auto_referrals: bool + :param sasl_mechanism: mechanism for SASL authentication, can be one of 'EXTERNAL', 'DIGEST-MD5', 'GSSAPI', 'PLAIN' + :type sasl_mechanism: str + :param sasl_credentials: credentials for SASL mechanism + :type sasl_credentials: tuple + :param check_names: if True the library will check names of attributes and object classes against the schema. Also values found in entries will be formatted as indicated by the schema + :type check_names: bool + :param collect_usage: collect usage metrics in the usage attribute + :type collect_usage: bool + :param read_only: disable operations that modify data in the LDAP server + :type read_only: bool + :param lazy: open and bind the connection only when an actual operation is performed + :type lazy: bool + :param raise_exceptions: raise exceptions when operations are not successful, if False operations return False if not successful but not raise exceptions + :type raise_exceptions: bool + :param pool_name: pool name for pooled strategies + :type pool_name: str + :param pool_size: pool size for pooled strategies + :type pool_size: int + :param pool_lifetime: pool lifetime for pooled strategies + :type pool_lifetime: int + :param cred_store: credential store for gssapi + :type cred_store: dict + :param use_referral_cache: keep referral connections open and reuse them + :type use_referral_cache: bool + :param auto_escape: automatic escaping of filter values + :type auto_escape: bool + :param auto_encode: automatic encoding of attribute values + :type auto_encode: bool + :param source_address: the ip address or hostname to use as the source when opening the connection to the server + :type source_address: str + :param source_port: the source port to use when opening the connection to the server. Cannot be specified with source_port_list + :type source_port: int + :param source_port_list: a list of source ports to choose from when opening the connection to the server. Cannot be specified with source_port + :type source_port_list: list + """ + def __init__(self, + server, + user=None, + password=None, + auto_bind=AUTO_BIND_DEFAULT, + version=3, + authentication=None, + client_strategy=SYNC, + auto_referrals=True, + auto_range=True, + sasl_mechanism=None, + sasl_credentials=None, + check_names=True, + collect_usage=False, + read_only=False, + lazy=False, + raise_exceptions=False, + pool_name=None, + pool_size=None, + pool_lifetime=None, + cred_store=None, + fast_decoder=True, + receive_timeout=None, + return_empty_attributes=True, + use_referral_cache=False, + auto_escape=True, + auto_encode=True, + pool_keepalive=None, + source_address=None, + source_port=None, + source_port_list=None): + + conf_default_pool_name = get_config_parameter('DEFAULT_THREADED_POOL_NAME') + self.connection_lock = RLock() # re-entrant lock to ensure that operations in the Connection object are executed atomically in the same thread + with self.connection_lock: + if client_strategy not in CLIENT_STRATEGIES: + self.last_error = 'unknown client connection strategy' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownStrategyError(self.last_error) + + self.strategy_type = client_strategy + self.user = user + self.password = password + + if not authentication and self.user: + self.authentication = SIMPLE + elif not authentication: + self.authentication = ANONYMOUS + elif authentication in [SIMPLE, ANONYMOUS, SASL, NTLM]: + self.authentication = authentication + else: + self.last_error = 'unknown authentication method' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownAuthenticationMethodError(self.last_error) + + self.version = version + self.auto_referrals = True if auto_referrals else False + self.request = None + self.response = None + self.result = None + self.bound = False + self.listening = False + self.closed = True + self.last_error = None + if auto_bind is False: # compatibility with older version where auto_bind was a boolean + self.auto_bind = AUTO_BIND_DEFAULT + elif auto_bind is True: + self.auto_bind = AUTO_BIND_NO_TLS + else: + self.auto_bind = auto_bind + self.sasl_mechanism = sasl_mechanism + self.sasl_credentials = sasl_credentials + self._usage = ConnectionUsage() if collect_usage else None + self.socket = None + self.tls_started = False + self.sasl_in_progress = False + self.read_only = read_only + self._context_state = [] + self._deferred_open = False + self._deferred_bind = False + self._deferred_start_tls = False + self._bind_controls = None + self._executing_deferred = False + self.lazy = lazy + self.pool_name = pool_name if pool_name else conf_default_pool_name + self.pool_size = pool_size + self.cred_store = cred_store + self.pool_lifetime = pool_lifetime + self.pool_keepalive = pool_keepalive + self.starting_tls = False + self.check_names = check_names + self.raise_exceptions = raise_exceptions + self.auto_range = True if auto_range else False + self.extend = ExtendedOperationsRoot(self) + self._entries = [] + self.fast_decoder = fast_decoder + self.receive_timeout = receive_timeout + self.empty_attributes = return_empty_attributes + self.use_referral_cache = use_referral_cache + self.auto_escape = auto_escape + self.auto_encode = auto_encode + self._digest_md5_kic = None + self._digest_md5_kis = None + self._digest_md5_sec_num = 0 + + port_err = check_port_and_port_list(source_port, source_port_list) + if port_err: + if log_enabled(ERROR): + log(ERROR, port_err) + raise LDAPInvalidPortError(port_err) + # using an empty string to bind a socket means "use the default as if this wasn't provided" because socket + # binding requires that you pass something for the ip if you want to pass a specific port + self.source_address = source_address if source_address is not None else '' + # using 0 as the source port to bind a socket means "use the default behavior of picking a random port from + # all ports as if this wasn't provided" because socket binding requires that you pass something for the port + # if you want to pass a specific ip + self.source_port_list = [0] + if source_port is not None: + self.source_port_list = [source_port] + elif source_port_list is not None: + self.source_port_list = source_port_list[:] + + if isinstance(server, STRING_TYPES): + server = Server(server) + if isinstance(server, SEQUENCE_TYPES): + server = ServerPool(server, ROUND_ROBIN, active=True, exhaust=True) + + if isinstance(server, ServerPool): + self.server_pool = server + self.server_pool.initialize(self) + self.server = self.server_pool.get_current_server(self) + else: + self.server_pool = None + self.server = server + + # if self.authentication == SIMPLE and self.user and self.check_names: + # self.user = safe_dn(self.user) + # if log_enabled(EXTENDED): + # log(EXTENDED, 'user name sanitized to <%s> for simple authentication via <%s>', self.user, self) + + if self.strategy_type == SYNC: + self.strategy = SyncStrategy(self) + elif self.strategy_type == SAFE_SYNC: + self.strategy = SafeSyncStrategy(self) + elif self.strategy_type == SAFE_RESTARTABLE: + self.strategy = SafeRestartableStrategy(self) + elif self.strategy_type == ASYNC: + self.strategy = AsyncStrategy(self) + elif self.strategy_type == LDIF: + self.strategy = LdifProducerStrategy(self) + elif self.strategy_type == RESTARTABLE: + self.strategy = RestartableStrategy(self) + elif self.strategy_type == REUSABLE: + self.strategy = ReusableStrategy(self) + self.lazy = False + elif self.strategy_type == MOCK_SYNC: + self.strategy = MockSyncStrategy(self) + elif self.strategy_type == MOCK_ASYNC: + self.strategy = MockAsyncStrategy(self) + elif self.strategy_type == ASYNC_STREAM: + self.strategy = AsyncStreamStrategy(self) + else: + self.last_error = 'unknown strategy' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownStrategyError(self.last_error) + + # maps strategy functions to connection functions + self.send = self.strategy.send + self.open = self.strategy.open + self.get_response = self.strategy.get_response + self.post_send_single_response = self.strategy.post_send_single_response + self.post_send_search = self.strategy.post_send_search + + if not self.strategy.no_real_dsa: + self._do_auto_bind() + # else: # for strategies with a fake server set get_info to NONE if server hasn't a schema + # if self.server and not self.server.schema: + # self.server.get_info = NONE + if log_enabled(BASIC): + if get_library_log_hide_sensitive_data(): + log(BASIC, 'instantiated Connection: <%s>', self.repr_with_sensitive_data_stripped()) + else: + log(BASIC, 'instantiated Connection: <%r>', self) + + def _prepare_return_value(self, status, response=False): + if self.strategy.thread_safe: + temp_response = self.response + self.response = None + temp_request = self.request + self.request = None + return status, deepcopy(self.result), deepcopy(temp_response) if response else None, copy(temp_request) + return status + + def _do_auto_bind(self): + if self.auto_bind and self.auto_bind not in [AUTO_BIND_NONE, AUTO_BIND_DEFAULT]: + if log_enabled(BASIC): + log(BASIC, 'performing automatic bind for <%s>', self) + if self.closed: + self.open(read_server_info=False) + if self.auto_bind == AUTO_BIND_NO_TLS: + self.bind(read_server_info=True) + elif self.auto_bind == AUTO_BIND_TLS_BEFORE_BIND: + if self.start_tls(read_server_info=False): + self.bind(read_server_info=True) + else: + error = 'automatic start_tls befored bind not successful' + (' - ' + self.last_error if self.last_error else '') + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error, self) + self.unbind() # unbind anyway to close connection + raise LDAPStartTLSError(error) + elif self.auto_bind == AUTO_BIND_TLS_AFTER_BIND: + self.bind(read_server_info=False) + if not self.start_tls(read_server_info=True): + error = 'automatic start_tls after bind not successful' + (' - ' + self.last_error if self.last_error else '') + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error, self) + self.unbind() + raise LDAPStartTLSError(error) + if not self.bound: + error = 'automatic bind not successful' + (' - ' + self.last_error if self.last_error else '') + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error, self) + self.unbind() + raise LDAPBindError(error) + + def __str__(self): + s = [ + str(self.server) if self.server else 'None', + 'user: ' + str(self.user), + 'lazy' if self.lazy else 'not lazy', + 'unbound' if not self.bound else ('deferred bind' if self._deferred_bind else 'bound'), + 'closed' if self.closed else ('deferred open' if self._deferred_open else 'open'), + _format_socket_endpoints(self.socket), + 'tls not started' if not self.tls_started else('deferred start_tls' if self._deferred_start_tls else 'tls started'), + 'listening' if self.listening else 'not listening', + self.strategy.__class__.__name__ if hasattr(self, 'strategy') else 'No strategy', + 'internal decoder' if self.fast_decoder else 'pyasn1 decoder' + ] + return ' - '.join(s) + + def __repr__(self): + conf_default_pool_name = get_config_parameter('DEFAULT_THREADED_POOL_NAME') + if self.server_pool: + r = 'Connection(server={0.server_pool!r}'.format(self) + else: + r = 'Connection(server={0.server!r}'.format(self) + r += '' if self.user is None else ', user={0.user!r}'.format(self) + r += '' if self.password is None else ', password={0.password!r}'.format(self) + r += '' if self.auto_bind is None else ', auto_bind={0.auto_bind!r}'.format(self) + r += '' if self.version is None else ', version={0.version!r}'.format(self) + r += '' if self.authentication is None else ', authentication={0.authentication!r}'.format(self) + r += '' if self.strategy_type is None else ', client_strategy={0.strategy_type!r}'.format(self) + r += '' if self.auto_referrals is None else ', auto_referrals={0.auto_referrals!r}'.format(self) + r += '' if self.sasl_mechanism is None else ', sasl_mechanism={0.sasl_mechanism!r}'.format(self) + r += '' if self.sasl_credentials is None else ', sasl_credentials={0.sasl_credentials!r}'.format(self) + r += '' if self.check_names is None else ', check_names={0.check_names!r}'.format(self) + r += '' if self.usage is None else (', collect_usage=' + ('True' if self.usage else 'False')) + r += '' if self.read_only is None else ', read_only={0.read_only!r}'.format(self) + r += '' if self.lazy is None else ', lazy={0.lazy!r}'.format(self) + r += '' if self.raise_exceptions is None else ', raise_exceptions={0.raise_exceptions!r}'.format(self) + r += '' if (self.pool_name is None or self.pool_name == conf_default_pool_name) else ', pool_name={0.pool_name!r}'.format(self) + r += '' if self.pool_size is None else ', pool_size={0.pool_size!r}'.format(self) + r += '' if self.pool_lifetime is None else ', pool_lifetime={0.pool_lifetime!r}'.format(self) + r += '' if self.pool_keepalive is None else ', pool_keepalive={0.pool_keepalive!r}'.format(self) + r += '' if self.cred_store is None else (', cred_store=' + repr(self.cred_store)) + r += '' if self.fast_decoder is None else (', fast_decoder=' + ('True' if self.fast_decoder else 'False')) + r += '' if self.auto_range is None else (', auto_range=' + ('True' if self.auto_range else 'False')) + r += '' if self.receive_timeout is None else ', receive_timeout={0.receive_timeout!r}'.format(self) + r += '' if self.empty_attributes is None else (', return_empty_attributes=' + ('True' if self.empty_attributes else 'False')) + r += '' if self.auto_encode is None else (', auto_encode=' + ('True' if self.auto_encode else 'False')) + r += '' if self.auto_escape is None else (', auto_escape=' + ('True' if self.auto_escape else 'False')) + r += '' if self.use_referral_cache is None else (', use_referral_cache=' + ('True' if self.use_referral_cache else 'False')) + r += ')' + + return r + + def repr_with_sensitive_data_stripped(self): + conf_default_pool_name = get_config_parameter('DEFAULT_THREADED_POOL_NAME') + if self.server_pool: + r = 'Connection(server={0.server_pool!r}'.format(self) + else: + r = 'Connection(server={0.server!r}'.format(self) + r += '' if self.user is None else ', user={0.user!r}'.format(self) + r += '' if self.password is None else ", password='{0}'".format('' % len(self.password)) + r += '' if self.auto_bind is None else ', auto_bind={0.auto_bind!r}'.format(self) + r += '' if self.version is None else ', version={0.version!r}'.format(self) + r += '' if self.authentication is None else ', authentication={0.authentication!r}'.format(self) + r += '' if self.strategy_type is None else ', client_strategy={0.strategy_type!r}'.format(self) + r += '' if self.auto_referrals is None else ', auto_referrals={0.auto_referrals!r}'.format(self) + r += '' if self.sasl_mechanism is None else ', sasl_mechanism={0.sasl_mechanism!r}'.format(self) + if self.sasl_mechanism == DIGEST_MD5: + r += '' if self.sasl_credentials is None else ", sasl_credentials=({0!r}, {1!r}, '{2}', {3!r})".format(self.sasl_credentials[0], self.sasl_credentials[1], '*' * len(self.sasl_credentials[2]), self.sasl_credentials[3]) + else: + r += '' if self.sasl_credentials is None else ', sasl_credentials={0.sasl_credentials!r}'.format(self) + r += '' if self.check_names is None else ', check_names={0.check_names!r}'.format(self) + r += '' if self.usage is None else (', collect_usage=' + 'True' if self.usage else 'False') + r += '' if self.read_only is None else ', read_only={0.read_only!r}'.format(self) + r += '' if self.lazy is None else ', lazy={0.lazy!r}'.format(self) + r += '' if self.raise_exceptions is None else ', raise_exceptions={0.raise_exceptions!r}'.format(self) + r += '' if (self.pool_name is None or self.pool_name == conf_default_pool_name) else ', pool_name={0.pool_name!r}'.format(self) + r += '' if self.pool_size is None else ', pool_size={0.pool_size!r}'.format(self) + r += '' if self.pool_lifetime is None else ', pool_lifetime={0.pool_lifetime!r}'.format(self) + r += '' if self.pool_keepalive is None else ', pool_keepalive={0.pool_keepalive!r}'.format(self) + r += '' if self.cred_store is None else (', cred_store=' + repr(self.cred_store)) + r += '' if self.fast_decoder is None else (', fast_decoder=' + 'True' if self.fast_decoder else 'False') + r += '' if self.auto_range is None else (', auto_range=' + ('True' if self.auto_range else 'False')) + r += '' if self.receive_timeout is None else ', receive_timeout={0.receive_timeout!r}'.format(self) + r += '' if self.empty_attributes is None else (', return_empty_attributes=' + 'True' if self.empty_attributes else 'False') + r += '' if self.auto_encode is None else (', auto_encode=' + ('True' if self.auto_encode else 'False')) + r += '' if self.auto_escape is None else (', auto_escape=' + ('True' if self.auto_escape else 'False')) + r += '' if self.use_referral_cache is None else (', use_referral_cache=' + ('True' if self.use_referral_cache else 'False')) + r += ')' + + return r + + @property + def stream(self): + """Used by the LDIFProducer strategy to accumulate the ldif-change operations with a single LDIF header + :return: reference to the response stream if defined in the strategy. + """ + return self.strategy.get_stream() if self.strategy.can_stream else None + + @stream.setter + def stream(self, value): + with self.connection_lock: + if self.strategy.can_stream: + self.strategy.set_stream(value) + + @property + def usage(self): + """Usage statistics for the connection. + :return: Usage object + """ + if not self._usage: + return None + if self.strategy.pooled: # update master connection usage from pooled connections + self._usage.reset() + for worker in self.strategy.pool.workers: + self._usage += worker.connection.usage + self._usage += self.strategy.pool.terminated_usage + return self._usage + + def __enter__(self): + with self.connection_lock: + self._context_state.append((self.bound, self.closed)) # save status out of context as a tuple in a list + if self.auto_bind != AUTO_BIND_NONE: + if self.auto_bind == AUTO_BIND_DEFAULT: + self.auto_bind = AUTO_BIND_NO_TLS + if self.closed: + self.open() + if not self.bound: + if not self.bind(): + raise LDAPBindError('unable to bind') + + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + with self.connection_lock: + context_bound, context_closed = self._context_state.pop() + if (not context_bound and self.bound) or self.stream: # restore status prior to entering context + try: + self.unbind() + except LDAPExceptionError: + pass + + if not context_closed and self.closed: + self.open() + + if exc_type is not None: + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', exc_type, self) + return False # re-raise LDAPExceptionError + + def bind(self, + read_server_info=True, + controls=None): + """Bind to ldap Server with the authentication method and the user defined in the connection + + :param read_server_info: reads info from server + :param controls: LDAP controls to send along with the bind operation + :type controls: list of tuple + :return: bool + + """ + if log_enabled(BASIC): + log(BASIC, 'start BIND operation via <%s>', self) + self.last_error = None + with self.connection_lock: + if self.lazy and not self._executing_deferred: + if self.strategy.pooled: + self.strategy.validate_bind(controls) + self._deferred_bind = True + self._bind_controls = controls + self.bound = True + if log_enabled(BASIC): + log(BASIC, 'deferring bind for <%s>', self) + else: + self._deferred_bind = False + self._bind_controls = None + if self.closed: # try to open connection if closed + self.open(read_server_info=False) + if self.authentication == ANONYMOUS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing anonymous BIND for <%s>', self) + if not self.strategy.pooled: + request = bind_operation(self.version, self.authentication, self.user, '', auto_encode=self.auto_encode) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'anonymous BIND request <%s> sent via <%s>', bind_request_to_dict(request), self) + response = self.post_send_single_response(self.send('bindRequest', request, controls)) + else: + response = self.strategy.validate_bind(controls) # only for REUSABLE + elif self.authentication == SIMPLE: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing simple BIND for <%s>', self) + if not self.strategy.pooled: + request = bind_operation(self.version, self.authentication, self.user, self.password, auto_encode=self.auto_encode) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'simple BIND request <%s> sent via <%s>', bind_request_to_dict(request), self) + response = self.post_send_single_response(self.send('bindRequest', request, controls)) + else: + response = self.strategy.validate_bind(controls) # only for REUSABLE + elif self.authentication == SASL: + if self.sasl_mechanism in SASL_AVAILABLE_MECHANISMS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing SASL BIND for <%s>', self) + if not self.strategy.pooled: + response = self.do_sasl_bind(controls) + else: + response = self.strategy.validate_bind(controls) # only for REUSABLE + else: + self.last_error = 'requested SASL mechanism not supported' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPSASLMechanismNotSupportedError(self.last_error) + elif self.authentication == NTLM: + if self.user and self.password and len(self.user.split('\\')) == 2: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing NTLM BIND for <%s>', self) + if not self.strategy.pooled: + response = self.do_ntlm_bind(controls) + else: + response = self.strategy.validate_bind(controls) # only for REUSABLE + else: # user or password missing + self.last_error = 'NTLM needs domain\\username and a password' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownAuthenticationMethodError(self.last_error) + else: + self.last_error = 'unknown authentication method' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownAuthenticationMethodError(self.last_error) + + if not self.strategy.sync and not self.strategy.pooled and self.authentication not in (SASL, NTLM): # get response if asynchronous except for SASL and NTLM that return the bind result even for asynchronous strategy + _, result = self.get_response(response) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async BIND response id <%s> received via <%s>', result, self) + elif self.strategy.sync: + result = self.result + if log_enabled(PROTOCOL): + log(PROTOCOL, 'BIND response <%s> received via <%s>', result, self) + elif self.strategy.pooled or self.authentication in (SASL, NTLM): # asynchronous SASL and NTLM or reusable strtegy get the bind result synchronously + result = response + else: + self.last_error = 'unknown authentication method' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownAuthenticationMethodError(self.last_error) + + if result is None: + # self.bound = True if self.strategy_type == REUSABLE else False + self.bound = False + elif result is True: + self.bound = True + elif result is False: + self.bound = False + else: + self.bound = True if result['result'] == RESULT_SUCCESS else False + if not self.bound and result and result['description'] and not self.last_error: + self.last_error = result['description'] + + if read_server_info and self.bound: + self.refresh_server_info() + self._entries = [] + + if log_enabled(BASIC): + log(BASIC, 'done BIND operation, result <%s>', self.bound) + + return self._prepare_return_value(self.bound, self.result) + + def rebind(self, + user=None, + password=None, + authentication=None, + sasl_mechanism=None, + sasl_credentials=None, + read_server_info=True, + controls=None + ): + + if log_enabled(BASIC): + log(BASIC, 'start (RE)BIND operation via <%s>', self) + self.last_error = None + with self.connection_lock: + if user: + self.user = user + if password is not None: + self.password = password + if not authentication and user: + self.authentication = SIMPLE + if authentication in [SIMPLE, ANONYMOUS, SASL, NTLM]: + self.authentication = authentication + elif authentication is not None: + self.last_error = 'unknown authentication method' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPUnknownAuthenticationMethodError(self.last_error) + if sasl_mechanism: + self.sasl_mechanism = sasl_mechanism + if sasl_credentials: + self.sasl_credentials = sasl_credentials + + # if self.authentication == SIMPLE and self.user and self.check_names: + # self.user = safe_dn(self.user) + # if log_enabled(EXTENDED): + # log(EXTENDED, 'user name sanitized to <%s> for rebind via <%s>', self.user, self) + + if not self.strategy.pooled: + try: + return self.bind(read_server_info, controls) + except LDAPSocketReceiveError: + self.last_error = 'Unable to rebind as a different user, furthermore the server abruptly closed the connection' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPBindError(self.last_error) + else: + self.strategy.pool.rebind_pool() + return self._prepare_return_value(True, self.result) + + def unbind(self, + controls=None): + """Unbind the connected user. Unbind implies closing session as per RFC4511 (4.3) + + :param controls: LDAP controls to send along with the bind operation + + """ + if log_enabled(BASIC): + log(BASIC, 'start UNBIND operation via <%s>', self) + + if self.use_referral_cache: + self.strategy.unbind_referral_cache() + + self.last_error = None + with self.connection_lock: + if self.lazy and not self._executing_deferred and (self._deferred_bind or self._deferred_open): # _clear deferred status + self.strategy.close() + self._deferred_open = False + self._deferred_bind = False + self._deferred_start_tls = False + elif not self.closed: + request = unbind_operation() + if log_enabled(PROTOCOL): + log(PROTOCOL, 'UNBIND request sent via <%s>', self) + self.send('unbindRequest', request, controls) + self.strategy.close() + + if log_enabled(BASIC): + log(BASIC, 'done UNBIND operation, result <%s>', True) + + return self._prepare_return_value(True) + + def search(self, + search_base, + search_filter, + search_scope=SUBTREE, + dereference_aliases=DEREF_ALWAYS, + attributes=None, + size_limit=0, + time_limit=0, + types_only=False, + get_operational_attributes=False, + controls=None, + paged_size=None, + paged_criticality=False, + paged_cookie=None, + auto_escape=None): + """ + Perform an ldap search: + + - If attributes is empty noRFC2696 with the specified size + - If paged is 0 and cookie is present the search is abandoned on + server attribute is returned + - If attributes is ALL_ATTRIBUTES all attributes are returned + - If paged_size is an int greater than 0 a simple paged search + is tried as described in + - Cookie is an opaque string received in the last paged search + and must be used on the next paged search response + - If lazy == True open and bind will be deferred until another + LDAP operation is performed + - If mssing_attributes == True then an attribute not returned by the server is set to None + - If auto_escape is set it overrides the Connection auto_escape + """ + conf_attributes_excluded_from_check = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_CHECK')] + if log_enabled(BASIC): + log(BASIC, 'start SEARCH operation via <%s>', self) + + if self.check_names and search_base: + search_base = safe_dn(search_base) + if log_enabled(EXTENDED): + log(EXTENDED, 'search base sanitized to <%s> for SEARCH operation via <%s>', search_base, self) + + with self.connection_lock: + self._fire_deferred() + if not attributes: + attributes = [NO_ATTRIBUTES] + elif attributes == ALL_ATTRIBUTES: + attributes = [ALL_ATTRIBUTES] + + if isinstance(attributes, STRING_TYPES): + attributes = [attributes] + + if get_operational_attributes and isinstance(attributes, list): + attributes.append(ALL_OPERATIONAL_ATTRIBUTES) + elif get_operational_attributes and isinstance(attributes, tuple): + attributes += (ALL_OPERATIONAL_ATTRIBUTES, ) # concatenate tuple + + if isinstance(paged_size, int): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing paged search for %d items with cookie <%s> for <%s>', paged_size, escape_bytes(paged_cookie), self) + + if controls is None: + controls = [] + else: + # Copy the controls to prevent modifying the original object + controls = list(controls) + controls.append(paged_search_control(paged_criticality, paged_size, paged_cookie)) + + if self.server and self.server.schema and self.check_names: + for attribute_name in attributes: + if ';' in attribute_name: # remove tags + attribute_name_to_check = attribute_name.split(';')[0] + else: + attribute_name_to_check = attribute_name + if self.server.schema and attribute_name_to_check.lower() not in conf_attributes_excluded_from_check and attribute_name_to_check not in self.server.schema.attribute_types: + self.last_error = 'invalid attribute type ' + attribute_name_to_check + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPAttributeError(self.last_error) + + request = search_operation(search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + self.auto_escape if auto_escape is None else auto_escape, + self.auto_encode, + self.server.schema if self.server else None, + validator=self.server.custom_validator, + check_names=self.check_names) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'SEARCH request <%s> sent via <%s>', search_request_to_dict(request), self) + response = self.post_send_search(self.send('searchRequest', request, controls)) + self._entries = [] + + if isinstance(response, int): # asynchronous strategy + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async SEARCH response id <%s> received via <%s>', return_value, self) + else: + return_value = True if self.result['type'] == 'searchResDone' and len(response) > 0 else False + if not return_value and self.result['result'] not in [RESULT_SUCCESS] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(PROTOCOL): + for entry in response: + if entry['type'] == 'searchResEntry': + log(PROTOCOL, 'SEARCH response entry <%s> received via <%s>', entry, self) + elif entry['type'] == 'searchResRef': + log(PROTOCOL, 'SEARCH response reference <%s> received via <%s>', entry, self) + + if log_enabled(BASIC): + log(BASIC, 'done SEARCH operation, result <%s>', return_value) + + return self._prepare_return_value(return_value, response=True) + + def compare(self, + dn, + attribute, + value, + controls=None): + """ + Perform a compare operation + """ + conf_attributes_excluded_from_check = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_CHECK')] + + if log_enabled(BASIC): + log(BASIC, 'start COMPARE operation via <%s>', self) + self.last_error = None + if self.check_names: + dn = safe_dn(dn) + if log_enabled(EXTENDED): + log(EXTENDED, 'dn sanitized to <%s> for COMPARE operation via <%s>', dn, self) + + if self.server and self.server.schema and self.check_names: + if ';' in attribute: # remove tags for checking + attribute_name_to_check = attribute.split(';')[0] + else: + attribute_name_to_check = attribute + + if self.server.schema.attribute_types and attribute_name_to_check.lower() not in conf_attributes_excluded_from_check and attribute_name_to_check not in self.server.schema.attribute_types: + self.last_error = 'invalid attribute type ' + attribute_name_to_check + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPAttributeError(self.last_error) + + if isinstance(value, SEQUENCE_TYPES): # value can't be a sequence + self.last_error = 'value cannot be a sequence' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPInvalidValueError(self.last_error) + + with self.connection_lock: + self._fire_deferred() + request = compare_operation(dn, attribute, value, self.auto_encode, self.server.schema if self.server else None, validator=self.server.custom_validator if self.server else None, check_names=self.check_names) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'COMPARE request <%s> sent via <%s>', compare_request_to_dict(request), self) + response = self.post_send_single_response(self.send('compareRequest', request, controls)) + self._entries = [] + if isinstance(response, int): + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async COMPARE response id <%s> received via <%s>', return_value, self) + else: + return_value = True if self.result['type'] == 'compareResponse' and self.result['result'] == RESULT_COMPARE_TRUE else False + if not return_value and self.result['result'] not in [RESULT_COMPARE_TRUE, RESULT_COMPARE_FALSE] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(PROTOCOL): + log(PROTOCOL, 'COMPARE response <%s> received via <%s>', response, self) + + if log_enabled(BASIC): + log(BASIC, 'done COMPARE operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def add(self, + dn, + object_class=None, + attributes=None, + controls=None): + """ + Add dn to the DIT, object_class is None, a class name or a list + of class names. + + Attributes is a dictionary in the form 'attr': 'val' or 'attr': + ['val1', 'val2', ...] for multivalued attributes + """ + conf_attributes_excluded_from_check = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_CHECK')] + conf_classes_excluded_from_check = [v.lower() for v in get_config_parameter('CLASSES_EXCLUDED_FROM_CHECK')] + if log_enabled(BASIC): + log(BASIC, 'start ADD operation via <%s>', self) + self.last_error = None + _attributes = deepcopy(attributes) # dict could change when adding objectClass values + if self.check_names: + dn = safe_dn(dn) + if log_enabled(EXTENDED): + log(EXTENDED, 'dn sanitized to <%s> for ADD operation via <%s>', dn, self) + + with self.connection_lock: + self._fire_deferred() + attr_object_class = [] + if object_class is None: + parm_object_class = [] + else: + parm_object_class = list(object_class) if isinstance(object_class, SEQUENCE_TYPES) else [object_class] + + object_class_attr_name = '' + if _attributes: + for attr in _attributes: + if attr.lower() == 'objectclass': + object_class_attr_name = attr + attr_object_class = list(_attributes[object_class_attr_name]) if isinstance(_attributes[object_class_attr_name], SEQUENCE_TYPES) else [_attributes[object_class_attr_name]] + break + else: + _attributes = dict() + + if not object_class_attr_name: + object_class_attr_name = 'objectClass' + + attr_object_class = [to_unicode(object_class) for object_class in attr_object_class] # converts objectclass to unicode in case of bytes value + _attributes[object_class_attr_name] = reduce(lambda x, y: x + [y] if y not in x else x, parm_object_class + attr_object_class, []) # remove duplicate ObjectClasses + + if not _attributes[object_class_attr_name]: + self.last_error = 'objectClass attribute is mandatory' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPObjectClassError(self.last_error) + + if self.server and self.server.schema and self.check_names: + for object_class_name in _attributes[object_class_attr_name]: + if object_class_name.lower() not in conf_classes_excluded_from_check and object_class_name not in self.server.schema.object_classes: + self.last_error = 'invalid object class ' + str(object_class_name) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPObjectClassError(self.last_error) + + for attribute_name in _attributes: + if ';' in attribute_name: # remove tags for checking + attribute_name_to_check = attribute_name.split(';')[0] + else: + attribute_name_to_check = attribute_name + + if attribute_name_to_check.lower() not in conf_attributes_excluded_from_check and attribute_name_to_check not in self.server.schema.attribute_types: + self.last_error = 'invalid attribute type ' + attribute_name_to_check + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPAttributeError(self.last_error) + + request = add_operation(dn, _attributes, self.auto_encode, self.server.schema if self.server else None, validator=self.server.custom_validator if self.server else None, check_names=self.check_names) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'ADD request <%s> sent via <%s>', add_request_to_dict(request), self) + response = self.post_send_single_response(self.send('addRequest', request, controls)) + self._entries = [] + + if isinstance(response, STRING_TYPES + (int, )): + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async ADD response id <%s> received via <%s>', return_value, self) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'ADD response <%s> received via <%s>', response, self) + return_value = True if self.result['type'] == 'addResponse' and self.result['result'] == RESULT_SUCCESS else False + if not return_value and self.result['result'] not in [RESULT_SUCCESS] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(BASIC): + log(BASIC, 'done ADD operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def delete(self, + dn, + controls=None): + """ + Delete the entry identified by the DN from the DIB. + """ + if log_enabled(BASIC): + log(BASIC, 'start DELETE operation via <%s>', self) + self.last_error = None + if self.check_names: + dn = safe_dn(dn) + if log_enabled(EXTENDED): + log(EXTENDED, 'dn sanitized to <%s> for DELETE operation via <%s>', dn, self) + + with self.connection_lock: + self._fire_deferred() + if self.read_only: + self.last_error = 'connection is read-only' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPConnectionIsReadOnlyError(self.last_error) + + request = delete_operation(dn) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'DELETE request <%s> sent via <%s>', delete_request_to_dict(request), self) + response = self.post_send_single_response(self.send('delRequest', request, controls)) + self._entries = [] + + if isinstance(response, STRING_TYPES + (int, )): + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async DELETE response id <%s> received via <%s>', return_value, self) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'DELETE response <%s> received via <%s>', response, self) + return_value = True if self.result['type'] == 'delResponse' and self.result['result'] == RESULT_SUCCESS else False + if not return_value and self.result['result'] not in [RESULT_SUCCESS] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(BASIC): + log(BASIC, 'done DELETE operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def modify(self, + dn, + changes, + controls=None): + """ + Modify attributes of entry + + - changes is a dictionary in the form {'attribute1': change), 'attribute2': [change, change, ...], ...} + - change is (operation, [value1, value2, ...]) + - operation is 0 (MODIFY_ADD), 1 (MODIFY_DELETE), 2 (MODIFY_REPLACE), 3 (MODIFY_INCREMENT) + """ + conf_attributes_excluded_from_check = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_CHECK')] + + if log_enabled(BASIC): + log(BASIC, 'start MODIFY operation via <%s>', self) + self.last_error = None + if self.check_names: + dn = safe_dn(dn) + if log_enabled(EXTENDED): + log(EXTENDED, 'dn sanitized to <%s> for MODIFY operation via <%s>', dn, self) + + with self.connection_lock: + self._fire_deferred() + if self.read_only: + self.last_error = 'connection is read-only' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPConnectionIsReadOnlyError(self.last_error) + + if not isinstance(changes, dict): + self.last_error = 'changes must be a dictionary' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPChangeError(self.last_error) + + if not changes: + self.last_error = 'no changes in modify request' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPChangeError(self.last_error) + + changelist = dict() + for attribute_name in changes: + if self.server and self.server.schema and self.check_names: + if ';' in attribute_name: # remove tags for checking + attribute_name_to_check = attribute_name.split(';')[0] + else: + attribute_name_to_check = attribute_name + + if self.server.schema.attribute_types and attribute_name_to_check.lower() not in conf_attributes_excluded_from_check and attribute_name_to_check not in self.server.schema.attribute_types: + self.last_error = 'invalid attribute type ' + attribute_name_to_check + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPAttributeError(self.last_error) + change = changes[attribute_name] + if isinstance(change, SEQUENCE_TYPES) and change[0] in [MODIFY_ADD, MODIFY_DELETE, MODIFY_REPLACE, MODIFY_INCREMENT, 0, 1, 2, 3]: + if len(change) != 2: + self.last_error = 'malformed change' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPChangeError(self.last_error) + + changelist[attribute_name] = [change] # insert change in a list + else: + for change_operation in change: + if len(change_operation) != 2 or change_operation[0] not in [MODIFY_ADD, MODIFY_DELETE, MODIFY_REPLACE, MODIFY_INCREMENT, 0, 1, 2, 3]: + self.last_error = 'invalid change list' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPChangeError(self.last_error) + changelist[attribute_name] = change + request = modify_operation(dn, changelist, self.auto_encode, self.server.schema if self.server else None, validator=self.server.custom_validator if self.server else None, check_names=self.check_names) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'MODIFY request <%s> sent via <%s>', modify_request_to_dict(request), self) + response = self.post_send_single_response(self.send('modifyRequest', request, controls)) + self._entries = [] + + if isinstance(response, STRING_TYPES + (int, )): + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async MODIFY response id <%s> received via <%s>', return_value, self) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'MODIFY response <%s> received via <%s>', response, self) + return_value = True if self.result['type'] == 'modifyResponse' and self.result['result'] == RESULT_SUCCESS else False + if not return_value and self.result['result'] not in [RESULT_SUCCESS] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(BASIC): + log(BASIC, 'done MODIFY operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def modify_dn(self, + dn, + relative_dn, + delete_old_dn=True, + new_superior=None, + controls=None): + """ + Modify DN of the entry or performs a move of the entry in the + DIT. + """ + if log_enabled(BASIC): + log(BASIC, 'start MODIFY DN operation via <%s>', self) + self.last_error = None + if self.check_names: + dn = safe_dn(dn) + if log_enabled(EXTENDED): + log(EXTENDED, 'dn sanitized to <%s> for MODIFY DN operation via <%s>', dn, self) + relative_dn = safe_dn(relative_dn) + if log_enabled(EXTENDED): + log(EXTENDED, 'relative dn sanitized to <%s> for MODIFY DN operation via <%s>', relative_dn, self) + + with self.connection_lock: + self._fire_deferred() + if self.read_only: + self.last_error = 'connection is read-only' + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', self.last_error, self) + raise LDAPConnectionIsReadOnlyError(self.last_error) + + # if new_superior and not dn.startswith(relative_dn): # as per RFC4511 (4.9) + # self.last_error = 'DN cannot change while performing moving' + # if log_enabled(ERROR): + # log(ERROR, '%s for <%s>', self.last_error, self) + # raise LDAPChangeError(self.last_error) + + request = modify_dn_operation(dn, relative_dn, delete_old_dn, new_superior) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'MODIFY DN request <%s> sent via <%s>', modify_dn_request_to_dict(request), self) + response = self.post_send_single_response(self.send('modDNRequest', request, controls)) + self._entries = [] + + if isinstance(response, STRING_TYPES + (int, )): + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async MODIFY DN response id <%s> received via <%s>', return_value, self) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'MODIFY DN response <%s> received via <%s>', response, self) + return_value = True if self.result['type'] == 'modDNResponse' and self.result['result'] == RESULT_SUCCESS else False + if not return_value and self.result['result'] not in [RESULT_SUCCESS] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(BASIC): + log(BASIC, 'done MODIFY DN operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def abandon(self, + message_id, + controls=None): + """ + Abandon the operation indicated by message_id + """ + if log_enabled(BASIC): + log(BASIC, 'start ABANDON operation via <%s>', self) + self.last_error = None + with self.connection_lock: + self._fire_deferred() + return_value = False + if self.strategy._outstanding or message_id == 0: + # only current operation should be abandoned, abandon, bind and unbind cannot ever be abandoned, + # messagiId 0 is invalid and should be used as a "ping" to keep alive the connection + if (self.strategy._outstanding and message_id in self.strategy._outstanding and self.strategy._outstanding[message_id]['type'] not in ['abandonRequest', 'bindRequest', 'unbindRequest']) or message_id == 0: + request = abandon_operation(message_id) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'ABANDON request: <%s> sent via <%s>', abandon_request_to_dict(request), self) + self.send('abandonRequest', request, controls) + self.result = None + self.response = None + self._entries = [] + return_value = True + else: + if log_enabled(ERROR): + log(ERROR, 'cannot abandon a Bind, an Unbind or an Abandon operation or message ID %s not found via <%s>', str(message_id), self) + + if log_enabled(BASIC): + log(BASIC, 'done ABANDON operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def extended(self, + request_name, + request_value=None, + controls=None, + no_encode=None): + """ + Performs an extended operation + """ + if log_enabled(BASIC): + log(BASIC, 'start EXTENDED operation via <%s>', self) + self.last_error = None + with self.connection_lock: + self._fire_deferred() + request = extended_operation(request_name, request_value, no_encode=no_encode) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'EXTENDED request <%s> sent via <%s>', extended_request_to_dict(request), self) + response = self.post_send_single_response(self.send('extendedReq', request, controls)) + self._entries = [] + if isinstance(response, int): + return_value = response + if log_enabled(PROTOCOL): + log(PROTOCOL, 'async EXTENDED response id <%s> received via <%s>', return_value, self) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'EXTENDED response <%s> received via <%s>', response, self) + return_value = True if self.result['type'] == 'extendedResp' and self.result['result'] == RESULT_SUCCESS else False + if not return_value and self.result['result'] not in [RESULT_SUCCESS] and not self.last_error: + self.last_error = self.result['description'] + + if log_enabled(BASIC): + log(BASIC, 'done EXTENDED operation, result <%s>', return_value) + + return self._prepare_return_value(return_value, response=True) + + def start_tls(self, read_server_info=True): # as per RFC4511. Removal of TLS is defined as MAY in RFC4511 so the client can't implement a generic stop_tls method0 + if log_enabled(BASIC): + log(BASIC, 'start START TLS operation via <%s>', self) + + with self.connection_lock: + return_value = False + self.result = None + + if not self.server.tls: + self.server.tls = Tls() + + if self.lazy and not self._executing_deferred: + self._deferred_start_tls = True + self.tls_started = True + return_value = True + if log_enabled(BASIC): + log(BASIC, 'deferring START TLS for <%s>', self) + else: + self._deferred_start_tls = False + if self.closed: + self.open() + if self.server.tls.start_tls(self) and self.strategy.sync: # for asynchronous connections _start_tls is run by the strategy + if read_server_info: + self.refresh_server_info() # refresh server info as per RFC4515 (3.1.5) + return_value = True + elif not self.strategy.sync: + return_value = True + + if log_enabled(BASIC): + log(BASIC, 'done START TLS operation, result <%s>', return_value) + + return self._prepare_return_value(return_value) + + def do_sasl_bind(self, + controls): + if log_enabled(BASIC): + log(BASIC, 'start SASL BIND operation via <%s>', self) + self.last_error = None + with self.connection_lock: + result = None + + if not self.sasl_in_progress: + self.sasl_in_progress = True + try: + if self.sasl_mechanism == EXTERNAL: + result = sasl_external(self, controls) + elif self.sasl_mechanism == DIGEST_MD5: + result = sasl_digest_md5(self, controls) + elif self.sasl_mechanism == GSSAPI: + from ..protocol.sasl.kerberos import sasl_gssapi # needs the gssapi package + result = sasl_gssapi(self, controls) + elif self.sasl_mechanism == 'PLAIN': + result = sasl_plain(self, controls) + finally: + self.sasl_in_progress = False + + if log_enabled(BASIC): + log(BASIC, 'done SASL BIND operation, result <%s>', result) + + return result + + def do_ntlm_bind(self, + controls): + if log_enabled(BASIC): + log(BASIC, 'start NTLM BIND operation via <%s>', self) + self.last_error = None + with self.connection_lock: + if not self.sasl_in_progress: + self.sasl_in_progress = True # ntlm is same of sasl authentication + try: + # additional import for NTLM + from ..utils.ntlm import NtlmClient + domain_name, user_name = self.user.split('\\', 1) + ntlm_client = NtlmClient(user_name=user_name, domain=domain_name, password=self.password) + + # as per https://msdn.microsoft.com/en-us/library/cc223501.aspx + # send a sicilyPackageDiscovery request (in the bindRequest) + request = bind_operation(self.version, 'SICILY_PACKAGE_DISCOVERY', ntlm_client) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'NTLM SICILY PACKAGE DISCOVERY request sent via <%s>', self) + response = self.post_send_single_response(self.send('bindRequest', request, controls)) + if not self.strategy.sync: + _, result = self.get_response(response) + else: + result = response[0] + if 'server_creds' in result: + sicily_packages = result['server_creds'].decode('ascii').split(';') + if 'NTLM' in sicily_packages: # NTLM available on server + request = bind_operation(self.version, 'SICILY_NEGOTIATE_NTLM', ntlm_client) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'NTLM SICILY NEGOTIATE request sent via <%s>', self) + response = self.post_send_single_response(self.send('bindRequest', request, controls)) + if not self.strategy.sync: + _, result = self.get_response(response) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'NTLM SICILY NEGOTIATE response <%s> received via <%s>', response[0], + self) + result = response[0] + + if result['result'] == RESULT_SUCCESS: + request = bind_operation(self.version, 'SICILY_RESPONSE_NTLM', ntlm_client, + result['server_creds']) + if log_enabled(PROTOCOL): + log(PROTOCOL, 'NTLM SICILY RESPONSE NTLM request sent via <%s>', self) + response = self.post_send_single_response(self.send('bindRequest', request, controls)) + if not self.strategy.sync: + _, result = self.get_response(response) + else: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'NTLM BIND response <%s> received via <%s>', response[0], self) + result = response[0] + else: + result = None + finally: + self.sasl_in_progress = False + + if log_enabled(BASIC): + log(BASIC, 'done SASL NTLM operation, result <%s>', result) + + return result + + def refresh_server_info(self): + # if self.strategy.no_real_dsa: # do not refresh for mock strategies + # return + + if not self.strategy.pooled: + with self.connection_lock: + if not self.closed: + if log_enabled(BASIC): + log(BASIC, 'refreshing server info for <%s>', self) + previous_response = self.response + previous_result = self.result + previous_entries = self._entries + self.server.get_info_from_server(self) + self.response = previous_response + self.result = previous_result + self._entries = previous_entries + else: + if log_enabled(BASIC): + log(BASIC, 'refreshing server info from pool for <%s>', self) + self.strategy.pool.get_info_from_server() + + def response_to_ldif(self, + search_result=None, + all_base64=False, + line_separator=None, + sort_order=None, + stream=None): + with self.connection_lock: + if search_result is None: + search_result = self.response + + if isinstance(search_result, SEQUENCE_TYPES): + ldif_lines = operation_to_ldif('searchResponse', search_result, all_base64, sort_order=sort_order) + ldif_lines = add_ldif_header(ldif_lines) + line_separator = line_separator or linesep + ldif_output = line_separator.join(ldif_lines) + if stream: + if stream.tell() == 0: + header = add_ldif_header(['-'])[0] + stream.write(prepare_for_stream(header + line_separator + line_separator)) + stream.write(prepare_for_stream(ldif_output + line_separator + line_separator)) + if log_enabled(BASIC): + log(BASIC, 'building LDIF output <%s> for <%s>', ldif_output, self) + return ldif_output + + return None + + def response_to_json(self, + raw=False, + search_result=None, + indent=4, + sort=True, + stream=None, + checked_attributes=True, + include_empty=True): + + with self.connection_lock: + if search_result is None: + search_result = self.response + + if isinstance(search_result, SEQUENCE_TYPES): + json_dict = dict() + json_dict['entries'] = [] + + for response in search_result: + if response['type'] == 'searchResEntry': + entry = dict() + + entry['dn'] = response['dn'] + if checked_attributes: + if not include_empty: + # needed for python 2.6 compatibility + entry['attributes'] = dict((key, response['attributes'][key]) for key in response['attributes'] if response['attributes'][key]) + else: + entry['attributes'] = dict(response['attributes']) + if raw: + if not include_empty: + # needed for python 2.6 compatibility + entry['raw_attributes'] = dict((key, response['raw_attributes'][key]) for key in response['raw_attributes'] if response['raw:attributes'][key]) + else: + entry['raw'] = dict(response['raw_attributes']) + json_dict['entries'].append(entry) + + if str is bytes: # Python 2 + check_json_dict(json_dict) + + json_output = json.dumps(json_dict, ensure_ascii=True, sort_keys=sort, indent=indent, check_circular=True, default=format_json, separators=(',', ': ')) + + if log_enabled(BASIC): + log(BASIC, 'building JSON output <%s> for <%s>', json_output, self) + if stream: + stream.write(json_output) + + return json_output + + def response_to_file(self, + target, + raw=False, + indent=4, + sort=True): + with self.connection_lock: + if self.response: + if isinstance(target, STRING_TYPES): + target = open(target, 'w+') + + if log_enabled(BASIC): + log(BASIC, 'writing response to file for <%s>', self) + + target.writelines(self.response_to_json(raw=raw, indent=indent, sort=sort)) + target.close() + + def _fire_deferred(self, read_info=None): + # if read_info is None reads the schema and server info if not present, if False doesn't read server info, if True reads always server info + with self.connection_lock: + if self.lazy and not self._executing_deferred: + self._executing_deferred = True + + if log_enabled(BASIC): + log(BASIC, 'executing deferred (open: %s, start_tls: %s, bind: %s) for <%s>', self._deferred_open, self._deferred_start_tls, self._deferred_bind, self) + try: + if self._deferred_open: + self.open(read_server_info=False) + if self._deferred_start_tls: + if not self.start_tls(read_server_info=False): + error = 'deferred start_tls not successful' + (' - ' + self.last_error if self.last_error else '') + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error, self) + self.unbind() + raise LDAPStartTLSError(error) + if self._deferred_bind: + self.bind(read_server_info=False, controls=self._bind_controls) + if (read_info is None and (not self.server.info and self.server.get_info in [DSA, ALL]) or (not self.server.schema and self.server.get_info in [SCHEMA, ALL])) or read_info: + self.refresh_server_info() + except LDAPExceptionError as e: + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', e, self) + raise # re-raise LDAPExceptionError + finally: + self._executing_deferred = False + + @property + def entries(self): + if self.response: + if not self._entries: + self._entries = self._get_entries(self.response, self.request) + return self._entries + + def _get_entries(self, search_response, search_request): + with self.connection_lock: + from .. import ObjectDef, Reader + + # build a table of ObjectDefs, grouping the entries found in search_response for their attributes set, subset will be included in superset + attr_sets = [] + for response in search_response: + if response['type'] == 'searchResEntry': + resp_attr_set = set(response['attributes'].keys()) + if resp_attr_set not in attr_sets: + attr_sets.append(resp_attr_set) + attr_sets.sort(key=lambda x: -len(x)) # sorts the list in descending length order + unique_attr_sets = [] + for attr_set in attr_sets: + for unique_set in unique_attr_sets: + if unique_set >= attr_set: # checks if unique set is a superset of attr_set + break + else: # the attr_set is not a subset of any element in unique_attr_sets + unique_attr_sets.append(attr_set) + object_defs = [] + for attr_set in unique_attr_sets: + object_def = ObjectDef(schema=self.server.schema) + object_def += list(attr_set) # converts the set in a list to be added to the object definition + object_defs.append((attr_set, + object_def, + Reader(self, object_def, search_request['base'], search_request['filter'], attributes=attr_set) if self.strategy.sync else Reader(self, object_def, '', '', attributes=attr_set)) + ) # objects_defs contains a tuple with the set, the ObjectDef and a cursor + + entries = [] + for response in search_response: + if response['type'] == 'searchResEntry': + resp_attr_set = set(response['attributes'].keys()) + for object_def in object_defs: + if resp_attr_set <= object_def[0]: # finds the ObjectDef for the attribute set of this entry + entry = object_def[2]._create_entry(response) + entries.append(entry) + break + else: + self.last_error = 'attribute set not found for ' + str(resp_attr_set) + if log_enabled(ERROR): + log(ERROR, self.last_error, self) + raise LDAPObjectError(self.last_error) + + return entries diff --git a/python/user_packages/Python313/site-packages/ldap3/core/exceptions.py b/python/user_packages/Python313/site-packages/ldap3/core/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..f5d1e864adf9c54f90772997f11c0a43f76cb060 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/exceptions.py @@ -0,0 +1,608 @@ +""" +""" + +# Created on 2014.05.14 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from os import sep +from .results import RESULT_OPERATIONS_ERROR, RESULT_PROTOCOL_ERROR, RESULT_TIME_LIMIT_EXCEEDED, RESULT_SIZE_LIMIT_EXCEEDED, \ + RESULT_STRONGER_AUTH_REQUIRED, RESULT_REFERRAL, RESULT_ADMIN_LIMIT_EXCEEDED, RESULT_UNAVAILABLE_CRITICAL_EXTENSION, \ + RESULT_AUTH_METHOD_NOT_SUPPORTED, RESULT_UNDEFINED_ATTRIBUTE_TYPE, RESULT_NO_SUCH_ATTRIBUTE, \ + RESULT_SASL_BIND_IN_PROGRESS, RESULT_CONFIDENTIALITY_REQUIRED, RESULT_INAPPROPRIATE_MATCHING, \ + RESULT_CONSTRAINT_VIOLATION, \ + RESULT_ATTRIBUTE_OR_VALUE_EXISTS, RESULT_INVALID_ATTRIBUTE_SYNTAX, RESULT_NO_SUCH_OBJECT, RESULT_ALIAS_PROBLEM, \ + RESULT_INVALID_DN_SYNTAX, RESULT_ALIAS_DEREFERENCING_PROBLEM, RESULT_INVALID_CREDENTIALS, RESULT_LOOP_DETECTED, \ + RESULT_ENTRY_ALREADY_EXISTS, RESULT_LCUP_SECURITY_VIOLATION, RESULT_CANCELED, RESULT_E_SYNC_REFRESH_REQUIRED, \ + RESULT_NO_SUCH_OPERATION, RESULT_LCUP_INVALID_DATA, RESULT_OBJECT_CLASS_MODS_PROHIBITED, RESULT_NAMING_VIOLATION, \ + RESULT_INSUFFICIENT_ACCESS_RIGHTS, RESULT_OBJECT_CLASS_VIOLATION, RESULT_TOO_LATE, RESULT_CANNOT_CANCEL, \ + RESULT_LCUP_UNSUPPORTED_SCHEME, RESULT_BUSY, RESULT_AFFECT_MULTIPLE_DSAS, RESULT_UNAVAILABLE, \ + RESULT_NOT_ALLOWED_ON_NON_LEAF, \ + RESULT_UNWILLING_TO_PERFORM, RESULT_OTHER, RESULT_LCUP_RELOAD_REQUIRED, RESULT_ASSERTION_FAILED, \ + RESULT_AUTHORIZATION_DENIED, RESULT_LCUP_RESOURCES_EXHAUSTED, RESULT_NOT_ALLOWED_ON_RDN, \ + RESULT_INAPPROPRIATE_AUTHENTICATION +import socket + + +# LDAPException hierarchy +class LDAPException(Exception): + pass + + +class LDAPOperationResult(LDAPException): + def __new__(cls, result=None, description=None, dn=None, message=None, response_type=None, response=None): + if cls is LDAPOperationResult and result and result in exception_table: + exc = super(LDAPOperationResult, exception_table[result]).__new__( + exception_table[result]) # create an exception of the required result error + exc.result = result + exc.description = description + exc.dn = dn + exc.message = message + exc.type = response_type + exc.response = response + else: + exc = super(LDAPOperationResult, cls).__new__(cls) + return exc + + def __init__(self, result=None, description=None, dn=None, message=None, response_type=None, response=None): + self.result = result + self.description = description + self.dn = dn + self.message = message + self.type = response_type + self.response = response + + def __str__(self): + s = [self.__class__.__name__, + str(self.result) if self.result else None, + self.description if self.description else None, + self.dn if self.dn else None, + self.message if self.message else None, + self.type if self.type else None, + self.response if self.response else None] + + return ' - '.join([str(item) for item in s if s is not None]) + + def __repr__(self): + return self.__str__() + + +class LDAPOperationsErrorResult(LDAPOperationResult): + pass + + +class LDAPProtocolErrorResult(LDAPOperationResult): + pass + + +class LDAPTimeLimitExceededResult(LDAPOperationResult): + pass + + +class LDAPSizeLimitExceededResult(LDAPOperationResult): + pass + + +class LDAPAuthMethodNotSupportedResult(LDAPOperationResult): + pass + + +class LDAPStrongerAuthRequiredResult(LDAPOperationResult): + pass + + +class LDAPReferralResult(LDAPOperationResult): + pass + + +class LDAPAdminLimitExceededResult(LDAPOperationResult): + pass + + +class LDAPUnavailableCriticalExtensionResult(LDAPOperationResult): + pass + + +class LDAPConfidentialityRequiredResult(LDAPOperationResult): + pass + + +class LDAPSASLBindInProgressResult(LDAPOperationResult): + pass + + +class LDAPNoSuchAttributeResult(LDAPOperationResult): + pass + + +class LDAPUndefinedAttributeTypeResult(LDAPOperationResult): + pass + + +class LDAPInappropriateMatchingResult(LDAPOperationResult): + pass + + +class LDAPConstraintViolationResult(LDAPOperationResult): + pass + + +class LDAPAttributeOrValueExistsResult(LDAPOperationResult): + pass + + +class LDAPInvalidAttributeSyntaxResult(LDAPOperationResult): + pass + + +class LDAPNoSuchObjectResult(LDAPOperationResult): + pass + + +class LDAPAliasProblemResult(LDAPOperationResult): + pass + + +class LDAPInvalidDNSyntaxResult(LDAPOperationResult): + pass + + +class LDAPAliasDereferencingProblemResult(LDAPOperationResult): + pass + + +class LDAPInappropriateAuthenticationResult(LDAPOperationResult): + pass + + +class LDAPInvalidCredentialsResult(LDAPOperationResult): + pass + + +class LDAPInsufficientAccessRightsResult(LDAPOperationResult): + pass + + +class LDAPBusyResult(LDAPOperationResult): + pass + + +class LDAPUnavailableResult(LDAPOperationResult): + pass + + +class LDAPUnwillingToPerformResult(LDAPOperationResult): + pass + + +class LDAPLoopDetectedResult(LDAPOperationResult): + pass + + +class LDAPNamingViolationResult(LDAPOperationResult): + pass + + +class LDAPObjectClassViolationResult(LDAPOperationResult): + pass + + +class LDAPNotAllowedOnNotLeafResult(LDAPOperationResult): + pass + + +class LDAPNotAllowedOnRDNResult(LDAPOperationResult): + pass + + +class LDAPEntryAlreadyExistsResult(LDAPOperationResult): + pass + + +class LDAPObjectClassModsProhibitedResult(LDAPOperationResult): + pass + + +class LDAPAffectMultipleDSASResult(LDAPOperationResult): + pass + + +class LDAPOtherResult(LDAPOperationResult): + pass + + +class LDAPLCUPResourcesExhaustedResult(LDAPOperationResult): + pass + + +class LDAPLCUPSecurityViolationResult(LDAPOperationResult): + pass + + +class LDAPLCUPInvalidDataResult(LDAPOperationResult): + pass + + +class LDAPLCUPUnsupportedSchemeResult(LDAPOperationResult): + pass + + +class LDAPLCUPReloadRequiredResult(LDAPOperationResult): + pass + + +class LDAPCanceledResult(LDAPOperationResult): + pass + + +class LDAPNoSuchOperationResult(LDAPOperationResult): + pass + + +class LDAPTooLateResult(LDAPOperationResult): + pass + + +class LDAPCannotCancelResult(LDAPOperationResult): + pass + + +class LDAPAssertionFailedResult(LDAPOperationResult): + pass + + +class LDAPAuthorizationDeniedResult(LDAPOperationResult): + pass + + +class LDAPESyncRefreshRequiredResult(LDAPOperationResult): + pass + + +exception_table = {RESULT_OPERATIONS_ERROR: LDAPOperationsErrorResult, + RESULT_PROTOCOL_ERROR: LDAPProtocolErrorResult, + RESULT_TIME_LIMIT_EXCEEDED: LDAPTimeLimitExceededResult, + RESULT_SIZE_LIMIT_EXCEEDED: LDAPSizeLimitExceededResult, + RESULT_AUTH_METHOD_NOT_SUPPORTED: LDAPAuthMethodNotSupportedResult, + RESULT_STRONGER_AUTH_REQUIRED: LDAPStrongerAuthRequiredResult, + RESULT_REFERRAL: LDAPReferralResult, + RESULT_ADMIN_LIMIT_EXCEEDED: LDAPAdminLimitExceededResult, + RESULT_UNAVAILABLE_CRITICAL_EXTENSION: LDAPUnavailableCriticalExtensionResult, + RESULT_CONFIDENTIALITY_REQUIRED: LDAPConfidentialityRequiredResult, + RESULT_SASL_BIND_IN_PROGRESS: LDAPSASLBindInProgressResult, + RESULT_NO_SUCH_ATTRIBUTE: LDAPNoSuchAttributeResult, + RESULT_UNDEFINED_ATTRIBUTE_TYPE: LDAPUndefinedAttributeTypeResult, + RESULT_INAPPROPRIATE_MATCHING: LDAPInappropriateMatchingResult, + RESULT_CONSTRAINT_VIOLATION: LDAPConstraintViolationResult, + RESULT_ATTRIBUTE_OR_VALUE_EXISTS: LDAPAttributeOrValueExistsResult, + RESULT_INVALID_ATTRIBUTE_SYNTAX: LDAPInvalidAttributeSyntaxResult, + RESULT_NO_SUCH_OBJECT: LDAPNoSuchObjectResult, + RESULT_ALIAS_PROBLEM: LDAPAliasProblemResult, + RESULT_INVALID_DN_SYNTAX: LDAPInvalidDNSyntaxResult, + RESULT_ALIAS_DEREFERENCING_PROBLEM: LDAPAliasDereferencingProblemResult, + RESULT_INAPPROPRIATE_AUTHENTICATION: LDAPInappropriateAuthenticationResult, + RESULT_INVALID_CREDENTIALS: LDAPInvalidCredentialsResult, + RESULT_INSUFFICIENT_ACCESS_RIGHTS: LDAPInsufficientAccessRightsResult, + RESULT_BUSY: LDAPBusyResult, + RESULT_UNAVAILABLE: LDAPUnavailableResult, + RESULT_UNWILLING_TO_PERFORM: LDAPUnwillingToPerformResult, + RESULT_LOOP_DETECTED: LDAPLoopDetectedResult, + RESULT_NAMING_VIOLATION: LDAPNamingViolationResult, + RESULT_OBJECT_CLASS_VIOLATION: LDAPObjectClassViolationResult, + RESULT_NOT_ALLOWED_ON_NON_LEAF: LDAPNotAllowedOnNotLeafResult, + RESULT_NOT_ALLOWED_ON_RDN: LDAPNotAllowedOnRDNResult, + RESULT_ENTRY_ALREADY_EXISTS: LDAPEntryAlreadyExistsResult, + RESULT_OBJECT_CLASS_MODS_PROHIBITED: LDAPObjectClassModsProhibitedResult, + RESULT_AFFECT_MULTIPLE_DSAS: LDAPAffectMultipleDSASResult, + RESULT_OTHER: LDAPOtherResult, + RESULT_LCUP_RESOURCES_EXHAUSTED: LDAPLCUPResourcesExhaustedResult, + RESULT_LCUP_SECURITY_VIOLATION: LDAPLCUPSecurityViolationResult, + RESULT_LCUP_INVALID_DATA: LDAPLCUPInvalidDataResult, + RESULT_LCUP_UNSUPPORTED_SCHEME: LDAPLCUPUnsupportedSchemeResult, + RESULT_LCUP_RELOAD_REQUIRED: LDAPLCUPReloadRequiredResult, + RESULT_CANCELED: LDAPCanceledResult, + RESULT_NO_SUCH_OPERATION: LDAPNoSuchOperationResult, + RESULT_TOO_LATE: LDAPTooLateResult, + RESULT_CANNOT_CANCEL: LDAPCannotCancelResult, + RESULT_ASSERTION_FAILED: LDAPAssertionFailedResult, + RESULT_AUTHORIZATION_DENIED: LDAPAuthorizationDeniedResult, + RESULT_E_SYNC_REFRESH_REQUIRED: LDAPESyncRefreshRequiredResult} + + +class LDAPExceptionError(LDAPException): + pass + + +# configuration exceptions +class LDAPConfigurationError(LDAPExceptionError): + pass + + +class LDAPUnknownStrategyError(LDAPConfigurationError): + pass + + +class LDAPUnknownAuthenticationMethodError(LDAPConfigurationError): + pass + + +class LDAPSSLConfigurationError(LDAPConfigurationError): + pass + + +class LDAPDefinitionError(LDAPConfigurationError): + pass + + +class LDAPPackageUnavailableError(LDAPConfigurationError, ImportError): + pass + + +class LDAPConfigurationParameterError(LDAPConfigurationError): + pass + + +# abstract layer exceptions +class LDAPKeyError(LDAPExceptionError, KeyError, AttributeError): + pass + + +class LDAPObjectError(LDAPExceptionError, ValueError): + pass + + +class LDAPAttributeError(LDAPExceptionError, ValueError, TypeError): + pass + + +class LDAPCursorError(LDAPExceptionError): + pass + + +class LDAPCursorAttributeError(LDAPCursorError, AttributeError): + pass + + +class LDAPObjectDereferenceError(LDAPExceptionError): + pass + + +# security exceptions +class LDAPSSLNotSupportedError(LDAPExceptionError, ImportError): + pass + + +class LDAPInvalidTlsSpecificationError(LDAPExceptionError): + pass + + +class LDAPInvalidHashAlgorithmError(LDAPExceptionError, ValueError): + pass + +class LDAPSignatureVerificationFailedError(LDAPExceptionError): + pass + + +# connection exceptions +class LDAPBindError(LDAPExceptionError): + pass + + +class LDAPInvalidServerError(LDAPExceptionError): + pass + + +class LDAPSASLMechanismNotSupportedError(LDAPExceptionError): + pass + + +class LDAPConnectionIsReadOnlyError(LDAPExceptionError): + pass + + +class LDAPChangeError(LDAPExceptionError, ValueError): + pass + + +class LDAPServerPoolError(LDAPExceptionError): + pass + + +class LDAPServerPoolExhaustedError(LDAPExceptionError): + pass + + +class LDAPInvalidPortError(LDAPExceptionError): + pass + + +class LDAPStartTLSError(LDAPExceptionError): + pass + + +class LDAPCertificateError(LDAPExceptionError): + pass + + +class LDAPUserNameNotAllowedError(LDAPExceptionError): + pass + + +class LDAPUserNameIsMandatoryError(LDAPExceptionError): + pass + + +class LDAPPasswordIsMandatoryError(LDAPExceptionError): + pass + + +class LDAPInvalidFilterError(LDAPExceptionError): + pass + + +class LDAPInvalidScopeError(LDAPExceptionError, ValueError): + pass + + +class LDAPInvalidDereferenceAliasesError(LDAPExceptionError, ValueError): + pass + + +class LDAPInvalidValueError(LDAPExceptionError, ValueError): + pass + + +class LDAPControlError(LDAPExceptionError, ValueError): + pass + + +class LDAPExtensionError(LDAPExceptionError, ValueError): + pass + + +class LDAPLDIFError(LDAPExceptionError): + pass + + +class LDAPSchemaError(LDAPExceptionError): + pass + + +class LDAPSASLPrepError(LDAPExceptionError): + pass + + +class LDAPSASLBindInProgressError(LDAPExceptionError): + pass + + +class LDAPMetricsError(LDAPExceptionError): + pass + + +class LDAPObjectClassError(LDAPExceptionError): + pass + + +class LDAPInvalidDnError(LDAPExceptionError): + pass + + +class LDAPResponseTimeoutError(LDAPExceptionError): + pass + + +class LDAPTransactionError(LDAPExceptionError): + pass + + +class LDAPInfoError(LDAPExceptionError): + pass + + +# communication exceptions +class LDAPCommunicationError(LDAPExceptionError): + pass + + +class LDAPSocketOpenError(LDAPCommunicationError): + pass + + +class LDAPSocketCloseError(LDAPCommunicationError): + pass + + +class LDAPSocketReceiveError(LDAPCommunicationError, socket.error): + pass + + +class LDAPSocketSendError(LDAPCommunicationError, socket.error): + pass + + +class LDAPSessionTerminatedByServerError(LDAPCommunicationError): + pass + + +class LDAPUnknownResponseError(LDAPCommunicationError): + pass + + +class LDAPUnknownRequestError(LDAPCommunicationError): + pass + + +class LDAPReferralError(LDAPCommunicationError): + pass + + +# pooling exceptions +class LDAPConnectionPoolNameIsMandatoryError(LDAPExceptionError): + pass + + +class LDAPConnectionPoolNotStartedError(LDAPExceptionError): + pass + + +# restartable strategy +class LDAPMaximumRetriesError(LDAPExceptionError): + def __str__(self): + s = [] + if self.args: + if isinstance(self.args, tuple): + if len(self.args) > 0: + s.append('LDAPMaximumRetriesError: ' + str(self.args[0])) + if len(self.args) > 1: + s.append('Exception history:') + prev_exc = '' + for i, exc in enumerate(self.args[1]): # args[1] contains exception history + # if str(exc[1]) != prev_exc: + # s.append((str(i).rjust(5) + ' ' + str(exc[0]) + ': ' + str(exc[1]) + ' - ' + str(exc[2]))) + # prev_exc = str(exc[1]) + if str(exc) != prev_exc: + s.append((str(i).rjust(5) + ' ' + str(type(exc)) + ': ' + str(exc))) + prev_exc = str(exc) + if len(self.args) > 2: + s.append('Maximum number of retries reached: ' + str(self.args[2])) + else: + s = [LDAPExceptionError.__str__(self)] + + return sep.join(s) + + +# exception factories +def communication_exception_factory(exc_to_raise, exc): + """ + Generates a new exception class of the requested type (subclass of LDAPCommunication) merged with the exception raised by the interpreter + """ + if exc_to_raise.__name__ in [cls.__name__ for cls in LDAPCommunicationError.__subclasses__()]: + return type(exc_to_raise.__name__, (exc_to_raise, type(exc)), dict()) + else: + raise LDAPExceptionError('unable to generate exception type ' + str(exc_to_raise)) + + +def start_tls_exception_factory(exc): + """ + Generates a new exception class of the requested type merged with the exception raised by the interpreter + """ + return type(LDAPStartTLSError.__name__, (LDAPStartTLSError, type(exc)), dict()) diff --git a/python/user_packages/Python313/site-packages/ldap3/core/pooling.py b/python/user_packages/Python313/site-packages/ldap3/core/pooling.py new file mode 100644 index 0000000000000000000000000000000000000000..24a5b0fa65a847628395805e89df59c38b0a9a05 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/pooling.py @@ -0,0 +1,329 @@ +""" +""" + +# Created on 2014.03.14 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from datetime import datetime, MINYEAR +from os import linesep +from random import randint +from time import sleep + +from .. import FIRST, ROUND_ROBIN, RANDOM, SEQUENCE_TYPES, STRING_TYPES, get_config_parameter +from .exceptions import LDAPUnknownStrategyError, LDAPServerPoolError, LDAPServerPoolExhaustedError +from .server import Server +from ..utils.log import log, log_enabled, ERROR, BASIC, NETWORK + +POOLING_STRATEGIES = [FIRST, ROUND_ROBIN, RANDOM] + + +class ServerState(object): + def __init__(self, server, last_checked_time, available): + self.server = server + self.last_checked_time = last_checked_time + self.available = available + + +class ServerPoolState(object): + def __init__(self, server_pool): + self.server_states = [] # each element is a ServerState + self.strategy = server_pool.strategy + self.server_pool = server_pool + self.last_used_server = 0 + self.refresh() + self.initialize_time = datetime.now() + + if log_enabled(BASIC): + log(BASIC, 'instantiated ServerPoolState: <%r>', self) + + def __str__(self): + s = 'servers: ' + linesep + if self.server_states: + for state in self.server_states: + s += str(state.server) + linesep + else: + s += 'None' + linesep + s += 'Pool strategy: ' + str(self.strategy) + linesep + s += ' - Last used server: ' + ('None' if self.last_used_server == -1 else str(self.server_states[self.last_used_server].server)) + + return s + + def refresh(self): + self.server_states = [] + for server in self.server_pool.servers: + self.server_states.append(ServerState(server, datetime(MINYEAR, 1, 1), True)) # server, smallest date ever, supposed available + self.last_used_server = randint(0, len(self.server_states) - 1) + + def get_current_server(self): + return self.server_states[self.last_used_server].server + + def get_server(self): + if self.server_states: + if self.server_pool.strategy == FIRST: + if self.server_pool.active: + # returns the first active server + self.last_used_server = self.find_active_server(starting=0) + else: + # returns always the first server - no pooling + self.last_used_server = 0 + elif self.server_pool.strategy == ROUND_ROBIN: + if self.server_pool.active: + # returns the next active server in a circular range + self.last_used_server = self.find_active_server(self.last_used_server + 1) + else: + # returns the next server in a circular range + self.last_used_server = self.last_used_server + 1 if (self.last_used_server + 1) < len(self.server_states) else 0 + elif self.server_pool.strategy == RANDOM: + if self.server_pool.active: + self.last_used_server = self.find_active_random_server() + else: + # returns a random server in the pool + self.last_used_server = randint(0, len(self.server_states) - 1) + else: + if log_enabled(ERROR): + log(ERROR, 'unknown server pooling strategy <%s>', self.server_pool.strategy) + raise LDAPUnknownStrategyError('unknown server pooling strategy') + if log_enabled(BASIC): + log(BASIC, 'server returned from Server Pool: <%s>', self.last_used_server) + return self.server_states[self.last_used_server].server + else: + if log_enabled(ERROR): + log(ERROR, 'no servers in Server Pool <%s>', self) + raise LDAPServerPoolError('no servers in server pool') + + def find_active_random_server(self): + counter = self.server_pool.active # can be True for "forever" or the number of cycles to try + while counter: + if log_enabled(NETWORK): + log(NETWORK, 'entering loop for finding active server in pool <%s>', self) + temp_list = self.server_states[:] # copy + while temp_list: + # pops a random server from a temp list and checks its + # availability, if not available tries another one + server_state = temp_list.pop(randint(0, len(temp_list) - 1)) + if not server_state.available: # server is offline + if (isinstance(self.server_pool.exhaust, bool) and self.server_pool.exhaust) or (datetime.now() - server_state.last_checked_time).seconds < self.server_pool.exhaust: # keeps server offline + if log_enabled(NETWORK): + log(NETWORK, 'server <%s> excluded from checking because it is offline', server_state.server) + continue + if log_enabled(NETWORK): + log(NETWORK, 'server <%s> reinserted in pool', server_state.server) + server_state.last_checked_time = datetime.now() + if log_enabled(NETWORK): + log(NETWORK, 'checking server <%s> for availability', server_state.server) + if server_state.server.check_availability(): + # returns a random active server in the pool + server_state.available = True + return self.server_states.index(server_state) + else: + server_state.available = False + if not isinstance(self.server_pool.active, bool): + counter -= 1 + if log_enabled(ERROR): + log(ERROR, 'no random active server available in Server Pool <%s> after maximum number of tries', self) + raise LDAPServerPoolExhaustedError('no random active server available in server pool after maximum number of tries') + + def find_active_server(self, starting): + conf_pool_timeout = get_config_parameter('POOLING_LOOP_TIMEOUT') + counter = self.server_pool.active # can be True for "forever" or the number of cycles to try + if starting >= len(self.server_states): + starting = 0 + + while counter: + if log_enabled(NETWORK): + log(NETWORK, 'entering loop number <%s> for finding active server in pool <%s>', counter, self) + index = -1 + pool_size = len(self.server_states) + while index < pool_size - 1: + index += 1 + offset = index + starting if index + starting < pool_size else index + starting - pool_size + server_state = self.server_states[offset] + if not server_state.available: # server is offline + if (isinstance(self.server_pool.exhaust, bool) and self.server_pool.exhaust) or (datetime.now() - server_state.last_checked_time).seconds < self.server_pool.exhaust: # keeps server offline + if log_enabled(NETWORK): + if isinstance(self.server_pool.exhaust, bool): + log(NETWORK, 'server <%s> excluded from checking because is offline', server_state.server) + else: + log(NETWORK, 'server <%s> excluded from checking because is offline for %d seconds', server_state.server, (self.server_pool.exhaust - (datetime.now() - server_state.last_checked_time).seconds)) + continue + if log_enabled(NETWORK): + log(NETWORK, 'server <%s> reinserted in pool', server_state.server) + server_state.last_checked_time = datetime.now() + if log_enabled(NETWORK): + log(NETWORK, 'checking server <%s> for availability', server_state.server) + if server_state.server.check_availability(): + server_state.available = True + return offset + else: + server_state.available = False # sets server offline + + if not isinstance(self.server_pool.active, bool): + counter -= 1 + if log_enabled(NETWORK): + log(NETWORK, 'waiting for %d seconds before retrying pool servers cycle', conf_pool_timeout) + sleep(conf_pool_timeout) + + if log_enabled(ERROR): + log(ERROR, 'no active server available in Server Pool <%s> after maximum number of tries', self) + raise LDAPServerPoolExhaustedError('no active server available in server pool after maximum number of tries') + + def __len__(self): + return len(self.server_states) + + +class ServerPool(object): + def __init__(self, + servers=None, + pool_strategy=ROUND_ROBIN, + active=True, + exhaust=False, + single_state=True): + + if pool_strategy not in POOLING_STRATEGIES: + if log_enabled(ERROR): + log(ERROR, 'unknown pooling strategy <%s>', pool_strategy) + raise LDAPUnknownStrategyError('unknown pooling strategy') + if exhaust and not active: + if log_enabled(ERROR): + log(ERROR, 'cannot instantiate pool with exhaust and not active') + raise LDAPServerPoolError('pools can be exhausted only when checking for active servers') + self.servers = [] + self.pool_states = dict() + self.active = active + self.exhaust = exhaust + self.single = single_state + self._pool_state = None # used for storing the global state of the pool + if isinstance(servers, SEQUENCE_TYPES + (Server, )): + self.add(servers) + elif isinstance(servers, STRING_TYPES): + self.add(Server(servers)) + self.strategy = pool_strategy + + if log_enabled(BASIC): + log(BASIC, 'instantiated ServerPool: <%r>', self) + + def __str__(self): + s = 'servers: ' + linesep + if self.servers: + for server in self.servers: + s += str(server) + linesep + else: + s += 'None' + linesep + s += 'Pool strategy: ' + str(self.strategy) + s += ' - ' + 'active: ' + (str(self.active) if self.active else 'False') + s += ' - ' + 'exhaust pool: ' + (str(self.exhaust) if self.exhaust else 'False') + return s + + def __repr__(self): + r = 'ServerPool(servers=' + if self.servers: + r += '[' + for server in self.servers: + r += server.__repr__() + ', ' + r = r[:-2] + ']' + else: + r += 'None' + r += ', pool_strategy={0.strategy!r}'.format(self) + r += ', active={0.active!r}'.format(self) + r += ', exhaust={0.exhaust!r}'.format(self) + r += ')' + + return r + + def __len__(self): + return len(self.servers) + + def __getitem__(self, item): + return self.servers[item] + + def __iter__(self): + return self.servers.__iter__() + + def add(self, servers): + if isinstance(servers, Server): + if servers not in self.servers: + self.servers.append(servers) + elif isinstance(servers, STRING_TYPES): + self.servers.append(Server(servers)) + elif isinstance(servers, SEQUENCE_TYPES): + for server in servers: + if isinstance(server, Server): + self.servers.append(server) + elif isinstance(server, STRING_TYPES): + self.servers.append(Server(server)) + else: + if log_enabled(ERROR): + log(ERROR, 'element must be a server in Server Pool <%s>', self) + raise LDAPServerPoolError('server in ServerPool must be a Server') + else: + if log_enabled(ERROR): + log(ERROR, 'server must be a Server of a list of Servers when adding to Server Pool <%s>', self) + raise LDAPServerPoolError('server must be a Server or a list of Server') + + if self.single: + if self._pool_state: + self._pool_state.refresh() + else: + for connection in self.pool_states: + # notifies connections using this pool to refresh + self.pool_states[connection].refresh() + + def remove(self, server): + if server in self.servers: + self.servers.remove(server) + else: + if log_enabled(ERROR): + log(ERROR, 'server %s to be removed not in Server Pool <%s>', server, self) + raise LDAPServerPoolError('server not in server pool') + + if self.single: + if self._pool_state: + self._pool_state.refresh() + else: + for connection in self.pool_states: + # notifies connections using this pool to refresh + self.pool_states[connection].refresh() + + def initialize(self, connection): + # registers pool_state in ServerPool object + if self.single: + if not self._pool_state: + self._pool_state = ServerPoolState(self) + self.pool_states[connection] = self._pool_state + else: + self.pool_states[connection] = ServerPoolState(self) + + def get_server(self, connection): + if connection in self.pool_states: + return self.pool_states[connection].get_server() + else: + if log_enabled(ERROR): + log(ERROR, 'connection <%s> not in Server Pool State <%s>', connection, self) + raise LDAPServerPoolError('connection not in ServerPoolState') + + def get_current_server(self, connection): + if connection in self.pool_states: + return self.pool_states[connection].get_current_server() + else: + if log_enabled(ERROR): + log(ERROR, 'connection <%s> not in Server Pool State <%s>', connection, self) + raise LDAPServerPoolError('connection not in ServerPoolState') diff --git a/python/user_packages/Python313/site-packages/ldap3/core/rdns.py b/python/user_packages/Python313/site-packages/ldap3/core/rdns.py new file mode 100644 index 0000000000000000000000000000000000000000..b3bbe6ac2338cd2c88bd0f24c57534cdf45c9f18 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/rdns.py @@ -0,0 +1,68 @@ +""" Utilities and constants related to reverse dns lookup """ + +# Created on 2020.09.16 +# +# Author: Azaria Zornberg +# +# Copyright 2020 Giovanni Cannata +# Copyright 2020 Azaria Zornberg +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import socket + + +class ReverseDnsSetting(object): + OFF = 0, + REQUIRE_RESOLVE_ALL_ADDRESSES = 1, + REQUIRE_RESOLVE_IP_ADDRESSES_ONLY = 2, + OPTIONAL_RESOLVE_ALL_ADDRESSES = 3, + OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY = 4, + SUPPORTED_VALUES = {OFF, REQUIRE_RESOLVE_ALL_ADDRESSES, REQUIRE_RESOLVE_IP_ADDRESSES_ONLY, + OPTIONAL_RESOLVE_ALL_ADDRESSES, OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY} + + +def get_hostname_by_addr(addr, success_required=True): + """ Resolve the hostname for an ip address. If success is required, raise an exception if a hostname cannot + be resolved for the address. + Returns the hostname resolved for the address. + If success is not required, returns None for addresses that do not resolve to hostnames. + """ + try: + return socket.gethostbyaddr(addr)[0] + except Exception as ex: + # if we need to succeed, just re-raise + if success_required: + raise + return None + + +def is_ip_addr(addr): + """Returns True if an address is an ipv4 address or an ipv6 address based on format. False otherwise.""" + for addr_type in [socket.AF_INET, socket.AF_INET6]: + try: + socket.inet_pton(addr_type, addr) # not present on python 2.7 on Windows + return True + except AttributeError: # not present on Windows, always valid + if '.' in addr and any([c.isalpha() for c in addr.replace('.', '')]): # not an IPv4 address, probably an hostname + return False + else: # do not check for ipv6 + return True + except OSError: + pass + + return False diff --git a/python/user_packages/Python313/site-packages/ldap3/core/results.py b/python/user_packages/Python313/site-packages/ldap3/core/results.py new file mode 100644 index 0000000000000000000000000000000000000000..14f8f73ad1bdb7c4aa44920d54af8f93ecca2ed1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/results.py @@ -0,0 +1,137 @@ +""" +""" + +# Created on 2016.08.31 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + + +# result codes +RESULT_SUCCESS = 0 +RESULT_OPERATIONS_ERROR = 1 +RESULT_PROTOCOL_ERROR = 2 +RESULT_TIME_LIMIT_EXCEEDED = 3 +RESULT_SIZE_LIMIT_EXCEEDED = 4 +RESULT_COMPARE_FALSE = 5 +RESULT_COMPARE_TRUE = 6 +RESULT_AUTH_METHOD_NOT_SUPPORTED = 7 +RESULT_STRONGER_AUTH_REQUIRED = 8 +RESULT_RESERVED = 9 +RESULT_REFERRAL = 10 +RESULT_ADMIN_LIMIT_EXCEEDED = 11 +RESULT_UNAVAILABLE_CRITICAL_EXTENSION = 12 +RESULT_CONFIDENTIALITY_REQUIRED = 13 +RESULT_SASL_BIND_IN_PROGRESS = 14 +RESULT_NO_SUCH_ATTRIBUTE = 16 +RESULT_UNDEFINED_ATTRIBUTE_TYPE = 17 +RESULT_INAPPROPRIATE_MATCHING = 18 +RESULT_CONSTRAINT_VIOLATION = 19 +RESULT_ATTRIBUTE_OR_VALUE_EXISTS = 20 +RESULT_INVALID_ATTRIBUTE_SYNTAX = 21 +RESULT_NO_SUCH_OBJECT = 32 +RESULT_ALIAS_PROBLEM = 33 +RESULT_INVALID_DN_SYNTAX = 34 +RESULT_ALIAS_DEREFERENCING_PROBLEM = 36 +RESULT_INAPPROPRIATE_AUTHENTICATION = 48 +RESULT_INVALID_CREDENTIALS = 49 +RESULT_INSUFFICIENT_ACCESS_RIGHTS = 50 +RESULT_BUSY = 51 +RESULT_UNAVAILABLE = 52 +RESULT_UNWILLING_TO_PERFORM = 53 +RESULT_LOOP_DETECTED = 54 +RESULT_NAMING_VIOLATION = 64 +RESULT_OBJECT_CLASS_VIOLATION = 65 +RESULT_NOT_ALLOWED_ON_NON_LEAF = 66 +RESULT_NOT_ALLOWED_ON_RDN = 67 +RESULT_ENTRY_ALREADY_EXISTS = 68 +RESULT_OBJECT_CLASS_MODS_PROHIBITED = 69 +RESULT_AFFECT_MULTIPLE_DSAS = 71 +RESULT_OTHER = 80 +RESULT_LCUP_RESOURCES_EXHAUSTED = 113 +RESULT_LCUP_SECURITY_VIOLATION = 114 +RESULT_LCUP_INVALID_DATA = 115 +RESULT_LCUP_UNSUPPORTED_SCHEME = 116 +RESULT_LCUP_RELOAD_REQUIRED = 117 +RESULT_CANCELED = 118 +RESULT_NO_SUCH_OPERATION = 119 +RESULT_TOO_LATE = 120 +RESULT_CANNOT_CANCEL = 121 +RESULT_ASSERTION_FAILED = 122 +RESULT_AUTHORIZATION_DENIED = 123 +RESULT_E_SYNC_REFRESH_REQUIRED = 4096 + +RESULT_CODES = { + RESULT_SUCCESS: 'success', + RESULT_OPERATIONS_ERROR: 'operationsError', + RESULT_PROTOCOL_ERROR: 'protocolError', + RESULT_TIME_LIMIT_EXCEEDED: 'timeLimitExceeded', + RESULT_SIZE_LIMIT_EXCEEDED: 'sizeLimitExceeded', + RESULT_COMPARE_FALSE: 'compareFalse', + RESULT_COMPARE_TRUE: 'compareTrue', + RESULT_AUTH_METHOD_NOT_SUPPORTED: 'authMethodNotSupported', + RESULT_RESERVED: 'reserved', + RESULT_STRONGER_AUTH_REQUIRED: 'strongerAuthRequired', + RESULT_REFERRAL: 'referral', + RESULT_ADMIN_LIMIT_EXCEEDED: 'adminLimitExceeded', + RESULT_UNAVAILABLE_CRITICAL_EXTENSION: 'unavailableCriticalExtension', + RESULT_CONFIDENTIALITY_REQUIRED: 'confidentialityRequired', + RESULT_SASL_BIND_IN_PROGRESS: 'saslBindInProgress', + RESULT_NO_SUCH_ATTRIBUTE: 'noSuchAttribute', + RESULT_UNDEFINED_ATTRIBUTE_TYPE: 'undefinedAttributeType', + RESULT_INAPPROPRIATE_MATCHING: 'inappropriateMatching', + RESULT_CONSTRAINT_VIOLATION: 'constraintViolation', + RESULT_ATTRIBUTE_OR_VALUE_EXISTS: 'attributeOrValueExists', + RESULT_INVALID_ATTRIBUTE_SYNTAX: 'invalidAttributeSyntax', + RESULT_NO_SUCH_OBJECT: 'noSuchObject', + RESULT_ALIAS_PROBLEM: 'aliasProblem', + RESULT_INVALID_DN_SYNTAX: 'invalidDNSyntax', + RESULT_ALIAS_DEREFERENCING_PROBLEM: 'aliasDereferencingProblem', + RESULT_INAPPROPRIATE_AUTHENTICATION: 'inappropriateAuthentication', + RESULT_INVALID_CREDENTIALS: 'invalidCredentials', + RESULT_INSUFFICIENT_ACCESS_RIGHTS: 'insufficientAccessRights', + RESULT_BUSY: 'busy', + RESULT_UNAVAILABLE: 'unavailable', + RESULT_UNWILLING_TO_PERFORM: 'unwillingToPerform', + RESULT_LOOP_DETECTED: 'loopDetected', + RESULT_NAMING_VIOLATION: 'namingViolation', + RESULT_OBJECT_CLASS_VIOLATION: 'objectClassViolation', + RESULT_NOT_ALLOWED_ON_NON_LEAF: 'notAllowedOnNonLeaf', + RESULT_NOT_ALLOWED_ON_RDN: 'notAllowedOnRDN', + RESULT_ENTRY_ALREADY_EXISTS: 'entryAlreadyExists', + RESULT_OBJECT_CLASS_MODS_PROHIBITED: 'objectClassModsProhibited', + RESULT_AFFECT_MULTIPLE_DSAS: 'affectMultipleDSAs', + RESULT_OTHER: 'other', + RESULT_LCUP_RESOURCES_EXHAUSTED: 'lcupResourcesExhausted', + RESULT_LCUP_SECURITY_VIOLATION: 'lcupSecurityViolation', + RESULT_LCUP_INVALID_DATA: 'lcupInvalidData', + RESULT_LCUP_UNSUPPORTED_SCHEME: 'lcupUnsupportedScheme', + RESULT_LCUP_RELOAD_REQUIRED: 'lcupReloadRequired', + RESULT_CANCELED: 'canceled', + RESULT_NO_SUCH_OPERATION: 'noSuchOperation', + RESULT_TOO_LATE: 'tooLate', + RESULT_CANNOT_CANCEL: 'cannotCancel', + RESULT_ASSERTION_FAILED: 'assertionFailed', + RESULT_AUTHORIZATION_DENIED: 'authorizationDenied', + RESULT_E_SYNC_REFRESH_REQUIRED: 'e-syncRefreshRequired' +} + +# do not raise exception for (in raise_exceptions connection mode) +DO_NOT_RAISE_EXCEPTIONS = [RESULT_SUCCESS, RESULT_COMPARE_FALSE, RESULT_COMPARE_TRUE, RESULT_REFERRAL, RESULT_SASL_BIND_IN_PROGRESS, RESULT_SIZE_LIMIT_EXCEEDED, RESULT_TIME_LIMIT_EXCEEDED] diff --git a/python/user_packages/Python313/site-packages/ldap3/core/server.py b/python/user_packages/Python313/site-packages/ldap3/core/server.py new file mode 100644 index 0000000000000000000000000000000000000000..41ff2afa24e181af3a08192d65e8823e55b155af --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/server.py @@ -0,0 +1,682 @@ +""" +""" + +# Created on 2014.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import socket +from threading import Lock +from datetime import datetime, MINYEAR + +from .. import DSA, SCHEMA, ALL, BASE, get_config_parameter, OFFLINE_EDIR_8_8_8, OFFLINE_EDIR_9_1_4, OFFLINE_AD_2012_R2, OFFLINE_SLAPD_2_4, OFFLINE_DS389_1_3_3, SEQUENCE_TYPES, IP_SYSTEM_DEFAULT, IP_V4_ONLY, IP_V6_ONLY, IP_V4_PREFERRED, IP_V6_PREFERRED, STRING_TYPES +from .exceptions import LDAPInvalidServerError, LDAPDefinitionError, LDAPInvalidPortError, LDAPInvalidTlsSpecificationError, LDAPSocketOpenError, LDAPInfoError +from ..protocol.formatters.standard import format_attribute_values +from ..protocol.rfc4511 import LDAP_MAX_INT +from ..protocol.rfc4512 import SchemaInfo, DsaInfo +from .tls import Tls +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, NETWORK +from ..utils.conv import to_unicode +from ..utils.port_validators import check_port, check_port_and_port_list + +try: + from urllib.parse import unquote # Python 3 +except ImportError: + from urllib import unquote # Python 2 + +try: # try to discover if unix sockets are available for LDAP over IPC (ldapi:// scheme) + # noinspection PyUnresolvedReferences + from socket import AF_UNIX + unix_socket_available = True +except ImportError: + unix_socket_available = False + + +class Server(object): + """ + LDAP Server definition class + + Allowed_referral_hosts can be None (default), or a list of tuples of + allowed servers ip address or names to contact while redirecting + search to referrals. + + The second element of the tuple is a boolean to indicate if + authentication to that server is allowed; if False only anonymous + bind will be used. + + Per RFC 4516. Use [('*', False)] to allow any host with anonymous + bind, use [('*', True)] to allow any host with same authentication of + Server. + """ + + _message_counter = 0 + _message_id_lock = Lock() # global lock for message_id shared by all Server objects + + def __init__(self, + host, + port=None, + use_ssl=False, + allowed_referral_hosts=None, + get_info=SCHEMA, + tls=None, + formatter=None, + connect_timeout=None, + mode=IP_V6_PREFERRED, + validator=None): + + self.ipc = False + url_given = False + host = host.strip() + if host.lower().startswith('ldap://'): + self.host = host[7:] + use_ssl = False + url_given = True + elif host.lower().startswith('ldaps://'): + self.host = host[8:] + use_ssl = True + url_given = True + elif host.lower().startswith('ldapi://') and unix_socket_available: + self.ipc = True + use_ssl = False + url_given = True + elif host.lower().startswith('ldapi://') and not unix_socket_available: + raise LDAPSocketOpenError('LDAP over IPC not available - UNIX sockets non present') + else: + self.host = host + + if self.ipc: + if str is bytes: # Python 2 + self.host = unquote(host[7:]).decode('utf-8') + else: # Python 3 + self.host = unquote(host[7:]) # encoding defaults to utf-8 in python3 + self.port = None + elif ':' in self.host and self.host.count(':') == 1: + hostname, _, hostport = self.host.partition(':') + try: + port = int(hostport) or port + except ValueError: + if log_enabled(ERROR): + log(ERROR, 'port <%s> must be an integer', port) + raise LDAPInvalidPortError('port must be an integer') + self.host = hostname + elif url_given and self.host.startswith('['): + hostname, sep, hostport = self.host[1:].partition(']') + if sep != ']' or not self._is_ipv6(hostname): + if log_enabled(ERROR): + log(ERROR, 'invalid IPv6 server address for <%s>', self.host) + raise LDAPInvalidServerError() + if len(hostport): + if not hostport.startswith(':'): + if log_enabled(ERROR): + log(ERROR, 'invalid URL in server name for <%s>', self.host) + raise LDAPInvalidServerError('invalid URL in server name') + if not hostport[1:].isdecimal(): + if log_enabled(ERROR): + log(ERROR, 'port must be an integer for <%s>', self.host) + raise LDAPInvalidPortError('port must be an integer') + port = int(hostport[1:]) + self.host = hostname + elif not url_given and self._is_ipv6(self.host): + pass + elif self.host.count(':') > 1: + if log_enabled(ERROR): + log(ERROR, 'invalid server address for <%s>', self.host) + raise LDAPInvalidServerError() + + if not self.ipc: + self.host.rstrip('/') + if not use_ssl and not port: + port = 389 + elif use_ssl and not port: + port = 636 + + port_err = check_port(port) + if port_err: + if log_enabled(ERROR): + log(ERROR, port_err) + raise LDAPInvalidPortError(port_err) + self.port = port + + if allowed_referral_hosts is None: # defaults to any server with authentication + allowed_referral_hosts = [('*', True)] + + if isinstance(allowed_referral_hosts, SEQUENCE_TYPES): + self.allowed_referral_hosts = [] + for referral_host in allowed_referral_hosts: + if isinstance(referral_host, tuple): + if isinstance(referral_host[1], bool): + self.allowed_referral_hosts.append(referral_host) + elif isinstance(allowed_referral_hosts, tuple): + if isinstance(allowed_referral_hosts[1], bool): + self.allowed_referral_hosts = [allowed_referral_hosts] + else: + self.allowed_referral_hosts = [] + + self.ssl = True if use_ssl else False + if tls and not isinstance(tls, Tls): + if log_enabled(ERROR): + log(ERROR, 'invalid tls specification: <%s>', tls) + raise LDAPInvalidTlsSpecificationError('invalid Tls object') + + self.tls = Tls() if self.ssl and not tls else tls + + if not self.ipc: + if self._is_ipv6(self.host): + self.name = ('ldaps' if self.ssl else 'ldap') + '://[' + self.host + ']:' + str(self.port) + else: + self.name = ('ldaps' if self.ssl else 'ldap') + '://' + self.host + ':' + str(self.port) + else: + self.name = host + + self.get_info = get_info + self._dsa_info = None + self._schema_info = None + self.dit_lock = Lock() + self.custom_formatter = formatter + self.custom_validator = validator + self._address_info = [] # property self.address_info resolved at open time (or when check_availability is called) + self._address_info_resolved_time = datetime(MINYEAR, 1, 1) # smallest date ever + self.current_address = None + self.connect_timeout = connect_timeout + self.mode = mode + + self.get_info_from_server(None) # load offline schema if needed + + if log_enabled(BASIC): + log(BASIC, 'instantiated Server: <%r>', self) + + @staticmethod + def _is_ipv6(host): + try: + socket.inet_pton(socket.AF_INET6, host) + except (socket.error, AttributeError, ValueError): + return False + return True + + def __str__(self): + if self.host: + s = self.name + (' - ssl' if self.ssl else ' - cleartext') + (' - unix socket' if self.ipc else '') + else: + s = object.__str__(self) + return s + + def __repr__(self): + r = 'Server(host={0.host!r}, port={0.port!r}, use_ssl={0.ssl!r}'.format(self) + r += '' if not self.allowed_referral_hosts else ', allowed_referral_hosts={0.allowed_referral_hosts!r}'.format(self) + r += '' if self.tls is None else ', tls={0.tls!r}'.format(self) + r += '' if not self.get_info else ', get_info={0.get_info!r}'.format(self) + r += '' if not self.connect_timeout else ', connect_timeout={0.connect_timeout!r}'.format(self) + r += '' if not self.mode else ', mode={0.mode!r}'.format(self) + r += ')' + + return r + + @property + def address_info(self): + conf_refresh_interval = get_config_parameter('ADDRESS_INFO_REFRESH_TIME') + if not self._address_info or (datetime.now() - self._address_info_resolved_time).seconds > conf_refresh_interval: + # converts addresses tuple to list and adds a 6th parameter for availability (None = not checked, True = available, False=not available) and a 7th parameter for the checking time + addresses = None + try: + if self.ipc: + addresses = [(socket.AF_UNIX, socket.SOCK_STREAM, 0, None, self.host, None)] + else: + if self.mode == IP_V4_ONLY: + addresses = socket.getaddrinfo(self.host, self.port, socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP, socket.AI_ADDRCONFIG | socket.AI_V4MAPPED) + elif self.mode == IP_V6_ONLY: + addresses = socket.getaddrinfo(self.host, self.port, socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_TCP, socket.AI_ADDRCONFIG | socket.AI_V4MAPPED) + else: + addresses = socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.IPPROTO_TCP, socket.AI_ADDRCONFIG | socket.AI_V4MAPPED) + except (socket.gaierror, AttributeError): + pass + + if not addresses: # if addresses not found or raised an exception (for example for bad flags) tries again without flags + try: + if self.mode == IP_V4_ONLY: + addresses = socket.getaddrinfo(self.host, self.port, socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) + elif self.mode == IP_V6_ONLY: + addresses = socket.getaddrinfo(self.host, self.port, socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_TCP) + else: + addresses = socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.IPPROTO_TCP) + except socket.gaierror: + pass + + if addresses: + self._address_info = [list(address) + [None, None] for address in addresses] + self._address_info_resolved_time = datetime.now() + else: + self._address_info = [] + self._address_info_resolved_time = datetime(MINYEAR, 1, 1) # smallest date + + if log_enabled(BASIC): + for address in self._address_info: + log(BASIC, 'address for <%s> resolved as <%r>', self, address[:-2]) + return self._address_info + + def update_availability(self, address, available): + cont = 0 + while cont < len(self._address_info): + if self.address_info[cont] == address: + self._address_info[cont][5] = True if available else False + self._address_info[cont][6] = datetime.now() + break + cont += 1 + + def reset_availability(self): + for address in self._address_info: + address[5] = None + address[6] = None + + def check_availability(self, source_address=None, source_port=None, source_port_list=None): + """ + Tries to open, connect and close a socket to specified address and port to check availability. + Timeout in seconds is specified in CHECK_AVAILABITY_TIMEOUT if not specified in + the Server object. + If specified, use a specific address, port, or list of possible ports, when attempting to check availability. + NOTE: This will only consider multiple ports from the source port list if the first ones we try to bind to are + already in use. This will not attempt using different ports in the list if the server is unavailable, + as that could result in the runtime of check_availability significantly exceeding the connection timeout. + """ + source_port_err = check_port_and_port_list(source_port, source_port_list) + if source_port_err: + if log_enabled(ERROR): + log(ERROR, source_port_err) + raise LDAPInvalidPortError(source_port_err) + + # using an empty string to bind a socket means "use the default as if this wasn't provided" because socket + # binding requires that you pass something for the ip if you want to pass a specific port + bind_address = source_address if source_address is not None else '' + # using 0 as the source port to bind a socket means "use the default behavior of picking a random port from + # all ports as if this wasn't provided" because socket binding requires that you pass something for the port + # if you want to pass a specific ip + candidate_bind_ports = [0] + + # if we have either a source port or source port list, convert that into our candidate list + if source_port is not None: + candidate_bind_ports = [source_port] + elif source_port_list is not None: + candidate_bind_ports = source_port_list[:] + + conf_availability_timeout = get_config_parameter('CHECK_AVAILABILITY_TIMEOUT') + available = False + self.reset_availability() + for address in self.candidate_addresses(): + available = True + try: + temp_socket = socket.socket(*address[:3]) + + # Go through our candidate bind ports and try to bind our socket to our source address with them. + # if no source address or ports were specified, this will have the same success/fail result as if we + # tried to connect to the remote server without binding locally first. + # This is actually a little bit better, as it lets us distinguish the case of "issue binding the socket + # locally" from "remote server is unavailable" with more clarity, though this will only really be an + # issue when no source address/port is specified if the system checking server availability is running + # as a very unprivileged user. + last_bind_exc = None + socket_bind_succeeded = False + for bind_port in candidate_bind_ports: + try: + temp_socket.bind((bind_address, bind_port)) + socket_bind_succeeded = True + break + except Exception as bind_ex: + last_bind_exc = bind_ex + if log_enabled(NETWORK): + log(NETWORK, 'Unable to bind to local address <%s> with source port <%s> due to <%s>', + bind_address, bind_port, bind_ex) + if not socket_bind_succeeded: + if log_enabled(ERROR): + log(ERROR, 'Unable to locally bind to local address <%s> with any of the source ports <%s> due to <%s>', + bind_address, candidate_bind_ports, last_bind_exc) + raise LDAPSocketOpenError('Unable to bind socket locally to address {} with any of the source ports {} due to {}' + .format(bind_address, candidate_bind_ports, last_bind_exc)) + + if self.connect_timeout: + temp_socket.settimeout(self.connect_timeout) + else: + temp_socket.settimeout(conf_availability_timeout) # set timeout for checking availability to default + try: + temp_socket.connect(address[4]) + except socket.error: + available = False + finally: + try: + temp_socket.shutdown(socket.SHUT_RDWR) + except socket.error: + available = False + finally: + temp_socket.close() + except socket.gaierror: + available = False + + if available: + if log_enabled(BASIC): + log(BASIC, 'server <%s> available at <%r>', self, address) + self.update_availability(address, True) + break # if an available address is found exits immediately + else: + self.update_availability(address, False) + if log_enabled(ERROR): + log(ERROR, 'server <%s> not available at <%r>', self, address) + + return available + + @staticmethod + def next_message_id(): + """ + LDAP messageId is unique for all connections to same server + """ + with Server._message_id_lock: + Server._message_counter += 1 + if Server._message_counter >= LDAP_MAX_INT: + Server._message_counter = 1 + if log_enabled(PROTOCOL): + log(PROTOCOL, 'new message id <%d> generated', Server._message_counter) + + return Server._message_counter + + def _get_dsa_info(self, connection): + """ + Retrieve DSE operational attribute as per RFC4512 (5.1). + """ + if connection.strategy.no_real_dsa: # do not try for mock strategies + return + + if not connection.strategy.pooled: # in pooled strategies get_dsa_info is performed by the worker threads + result = connection.search(search_base='', + search_filter='(objectClass=*)', + search_scope=BASE, + attributes=['altServer', # requests specific dsa info attributes + 'namingContexts', + 'supportedControl', + 'supportedExtension', + 'supportedFeatures', + 'supportedCapabilities', + 'supportedLdapVersion', + 'supportedSASLMechanisms', + 'vendorName', + 'vendorVersion', + 'subschemaSubentry', + '*', + '+'], # requests all remaining attributes (other), + get_operational_attributes=True) + + if connection.strategy.thread_safe: + status, result, response, _ = result + else: + status = result + result = connection.result + response = connection.response + + with self.dit_lock: + if connection.strategy.sync: # sync request + self._dsa_info = DsaInfo(response[0]['attributes'], response[0]['raw_attributes']) if status else self._dsa_info + elif status: # asynchronous request, must check if attributes in response + results, _ = connection.get_response(status) + if len(results) == 1 and 'attributes' in results[0] and 'raw_attributes' in results[0]: + self._dsa_info = DsaInfo(results[0]['attributes'], results[0]['raw_attributes']) + + if log_enabled(BASIC): + log(BASIC, 'DSA info read for <%s> via <%s>', self, connection) + + def _get_schema_info(self, connection, entry=''): + """ + Retrieve schema from subschemaSubentry DSE attribute, per RFC + 4512 (4.4 and 5.1); entry = '' means DSE. + """ + if connection.strategy.no_real_dsa: # do not try for mock strategies + return + + schema_entry = None + if self._dsa_info and entry == '': # subschemaSubentry already present in dsaInfo + if isinstance(self._dsa_info.schema_entry, SEQUENCE_TYPES): + schema_entry = self._dsa_info.schema_entry[0] if self._dsa_info.schema_entry else None + else: + schema_entry = self._dsa_info.schema_entry if self._dsa_info.schema_entry else None + else: + result = connection.search(entry, '(objectClass=*)', BASE, attributes=['subschemaSubentry'], get_operational_attributes=True) + if connection.strategy.thread_safe: + status, result, response, _ = result + else: + status = result + result = connection.result + response = connection.response + if connection.strategy.sync: # sync request + if status and 'subschemaSubentry' in response[0]['raw_attributes']: + if len(response[0]['raw_attributes']['subschemaSubentry']) > 0: + schema_entry = response[0]['raw_attributes']['subschemaSubentry'][0] + else: # asynchronous request, must check if subschemaSubentry in attributes + results, _ = connection.get_response(status) + if len(results) == 1 and 'raw_attributes' in results[0] and 'subschemaSubentry' in results[0]['attributes']: + if len(results[0]['raw_attributes']['subschemaSubentry']) > 0: + schema_entry = results[0]['raw_attributes']['subschemaSubentry'][0] + + if schema_entry and not connection.strategy.pooled: # in pooled strategies get_schema_info is performed by the worker threads + if isinstance(schema_entry, bytes) and str is not bytes: # Python 3 + schema_entry = to_unicode(schema_entry, from_server=True) + result = connection.search(schema_entry, + search_filter='(objectClass=subschema)', + search_scope=BASE, + attributes=['objectClasses', # requests specific subschema attributes + 'attributeTypes', + 'ldapSyntaxes', + 'matchingRules', + 'matchingRuleUse', + 'dITContentRules', + 'dITStructureRules', + 'nameForms', + 'createTimestamp', + 'modifyTimestamp', + '*'], # requests all remaining attributes (other) + get_operational_attributes=True + ) + if connection.strategy.thread_safe: + status, result, response, _ = result + else: + status = result + result = connection.result + response = connection.response + with self.dit_lock: + self._schema_info = None + if status: + if connection.strategy.sync: # sync request + self._schema_info = SchemaInfo(schema_entry, response[0]['attributes'], response[0]['raw_attributes']) + else: # asynchronous request, must check if attributes in response + results, result = connection.get_response(status) + if len(results) == 1 and 'attributes' in results[0] and 'raw_attributes' in results[0]: + self._schema_info = SchemaInfo(schema_entry, results[0]['attributes'], results[0]['raw_attributes']) + if self._schema_info and not self._schema_info.is_valid(): # flaky servers can return an empty schema, checks if it is so and set schema to None + self._schema_info = None + if self._schema_info: # if schema is valid tries to apply formatter to the "other" dict with raw values for schema and info + for attribute in self._schema_info.other: + self._schema_info.other[attribute] = format_attribute_values(self._schema_info, attribute, self._schema_info.raw[attribute], self.custom_formatter) + if self._dsa_info: # try to apply formatter to the "other" dict with dsa info raw values + for attribute in self._dsa_info.other: + self._dsa_info.other[attribute] = format_attribute_values(self._schema_info, attribute, self._dsa_info.raw[attribute], self.custom_formatter) + if log_enabled(BASIC): + log(BASIC, 'schema read for <%s> via <%s>', self, connection) + + def get_info_from_server(self, connection): + """ + reads info from DSE and from subschema + """ + if connection and not connection.closed: + if self.get_info in [DSA, ALL]: + self._get_dsa_info(connection) + if self.get_info in [SCHEMA, ALL]: + self._get_schema_info(connection) + elif self.get_info == OFFLINE_EDIR_8_8_8: + from ..protocol.schemas.edir888 import edir_8_8_8_schema, edir_8_8_8_dsa_info + self.attach_schema_info(SchemaInfo.from_json(edir_8_8_8_schema)) + self.attach_dsa_info(DsaInfo.from_json(edir_8_8_8_dsa_info)) + elif self.get_info == OFFLINE_EDIR_9_1_4: + from ..protocol.schemas.edir914 import edir_9_1_4_schema, edir_9_1_4_dsa_info + self.attach_schema_info(SchemaInfo.from_json(edir_9_1_4_schema)) + self.attach_dsa_info(DsaInfo.from_json(edir_9_1_4_dsa_info)) + elif self.get_info == OFFLINE_AD_2012_R2: + from ..protocol.schemas.ad2012R2 import ad_2012_r2_schema, ad_2012_r2_dsa_info + self.attach_schema_info(SchemaInfo.from_json(ad_2012_r2_schema)) + self.attach_dsa_info(DsaInfo.from_json(ad_2012_r2_dsa_info)) + elif self.get_info == OFFLINE_SLAPD_2_4: + from ..protocol.schemas.slapd24 import slapd_2_4_schema, slapd_2_4_dsa_info + self.attach_schema_info(SchemaInfo.from_json(slapd_2_4_schema)) + self.attach_dsa_info(DsaInfo.from_json(slapd_2_4_dsa_info)) + elif self.get_info == OFFLINE_DS389_1_3_3: + from ..protocol.schemas.ds389 import ds389_1_3_3_schema, ds389_1_3_3_dsa_info + self.attach_schema_info(SchemaInfo.from_json(ds389_1_3_3_schema)) + self.attach_dsa_info(DsaInfo.from_json(ds389_1_3_3_dsa_info)) + + def attach_dsa_info(self, dsa_info=None): + if isinstance(dsa_info, DsaInfo): + self._dsa_info = dsa_info + if log_enabled(BASIC): + log(BASIC, 'attached DSA info to Server <%s>', self) + + def attach_schema_info(self, dsa_schema=None): + if isinstance(dsa_schema, SchemaInfo): + self._schema_info = dsa_schema + if log_enabled(BASIC): + log(BASIC, 'attached schema info to Server <%s>', self) + + @property + def info(self): + return self._dsa_info + + @property + def schema(self): + return self._schema_info + + @staticmethod + def from_definition(host, dsa_info, dsa_schema, port=None, use_ssl=False, formatter=None, validator=None): + """ + Define a dummy server with preloaded schema and info + :param host: host name + :param dsa_info: DsaInfo preloaded object or a json formatted string or a file name + :param dsa_schema: SchemaInfo preloaded object or a json formatted string or a file name + :param port: fake port + :param use_ssl: use_ssl + :param formatter: custom formatters + :return: Server object + """ + if isinstance(host, SEQUENCE_TYPES): + dummy = Server(host=host[0], port=port, use_ssl=use_ssl, formatter=formatter, validator=validator, get_info=ALL) # for ServerPool object + else: + dummy = Server(host=host, port=port, use_ssl=use_ssl, formatter=formatter, validator=validator, get_info=ALL) + if isinstance(dsa_info, DsaInfo): + dummy._dsa_info = dsa_info + elif isinstance(dsa_info, STRING_TYPES): + try: + dummy._dsa_info = DsaInfo.from_json(dsa_info) # tries to use dsa_info as a json configuration string + except Exception: + dummy._dsa_info = DsaInfo.from_file(dsa_info) # tries to use dsa_info as a file name + + if not dummy.info: + if log_enabled(ERROR): + log(ERROR, 'invalid DSA info for %s', host) + raise LDAPDefinitionError('invalid dsa info') + + if isinstance(dsa_schema, SchemaInfo): + dummy._schema_info = dsa_schema + elif isinstance(dsa_schema, STRING_TYPES): + try: + dummy._schema_info = SchemaInfo.from_json(dsa_schema) + except Exception: + dummy._schema_info = SchemaInfo.from_file(dsa_schema) + + if not dummy.schema: + if log_enabled(ERROR): + log(ERROR, 'invalid schema info for %s', host) + raise LDAPDefinitionError('invalid schema info') + + if log_enabled(BASIC): + log(BASIC, 'created server <%s> from definition', dummy) + + return dummy + + def candidate_addresses(self): + conf_reset_availability_timeout = get_config_parameter('RESET_AVAILABILITY_TIMEOUT') + if self.ipc: + candidates = self.address_info + if log_enabled(BASIC): + log(BASIC, 'candidate address for <%s>: <%s> with mode UNIX_SOCKET', self, self.name) + else: + # checks reset availability timeout + for address in self.address_info: + if address[6] and ((datetime.now() - address[6]).seconds > conf_reset_availability_timeout): + address[5] = None + address[6] = None + + # selects server address based on server mode and availability (in address[5]) + addresses = self.address_info[:] # copy to avoid refreshing while searching candidates + candidates = [] + if addresses: + if self.mode == IP_SYSTEM_DEFAULT: + candidates.append(addresses[0]) + elif self.mode == IP_V4_ONLY: + candidates = [address for address in addresses if address[0] == socket.AF_INET and (address[5] or address[5] is None)] + elif self.mode == IP_V6_ONLY: + candidates = [address for address in addresses if address[0] == socket.AF_INET6 and (address[5] or address[5] is None)] + elif self.mode == IP_V4_PREFERRED: + candidates = [address for address in addresses if address[0] == socket.AF_INET and (address[5] or address[5] is None)] + candidates += [address for address in addresses if address[0] == socket.AF_INET6 and (address[5] or address[5] is None)] + elif self.mode == IP_V6_PREFERRED: + candidates = [address for address in addresses if address[0] == socket.AF_INET6 and (address[5] or address[5] is None)] + candidates += [address for address in addresses if address[0] == socket.AF_INET and (address[5] or address[5] is None)] + else: + if log_enabled(ERROR): + log(ERROR, 'invalid server mode for <%s>', self) + raise LDAPInvalidServerError('invalid server mode') + + if log_enabled(BASIC): + for candidate in candidates: + log(BASIC, 'obtained candidate address for <%s>: <%r> with mode %s', self, candidate[:-2], self.mode) + return candidates + + def _check_info_property(self, kind, name): + if not self._dsa_info: + raise LDAPInfoError('server info not loaded') + + if kind == 'control': + properties = self.info.supported_controls + elif kind == 'extension': + properties = self.info.supported_extensions + elif kind == 'feature': + properties = self.info.supported_features + else: + raise LDAPInfoError('invalid info category') + + for prop in properties: + if name == prop[0] or (prop[2] and name.lower() == prop[2].lower()): # checks oid and description + return True + + return False + + def has_control(self, control): + return self._check_info_property('control', control) + + def has_extension(self, extension): + return self._check_info_property('extension', extension) + + def has_feature(self, feature): + return self._check_info_property('feature', feature) + + + diff --git a/python/user_packages/Python313/site-packages/ldap3/core/timezone.py b/python/user_packages/Python313/site-packages/ldap3/core/timezone.py new file mode 100644 index 0000000000000000000000000000000000000000..0c24a771f3fe432d2ac56417cff1dddfc93e76bf --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/timezone.py @@ -0,0 +1,56 @@ +""" +""" + +# Created on 2015.01.07 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from datetime import timedelta, tzinfo + + +# from python standard library docs +class OffsetTzInfo(tzinfo): + """Fixed offset in minutes east from UTC""" + + def __init__(self, offset, name): + self.offset = offset + self.name = name + self._offset = timedelta(minutes=offset) + + def __str__(self): + return self.name + + def __repr__(self): + + return 'OffsetTzInfo(offset={0.offset!r}, name={0.name!r})'.format(self) + + def utcoffset(self, dt): + return self._offset + + def tzname(self, dt): + return self.name + + # noinspection PyMethodMayBeStatic + def dst(self, dt): + return timedelta(0) + + def __getinitargs__(self): # for pickling/unpickling + return self.offset, self.name diff --git a/python/user_packages/Python313/site-packages/ldap3/core/tls.py b/python/user_packages/Python313/site-packages/ldap3/core/tls.py new file mode 100644 index 0000000000000000000000000000000000000000..ca8592b38b604b3926ab0ac88f4a3fa2f1a30e2f --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/tls.py @@ -0,0 +1,327 @@ +""" +""" + +# Created on 2013.08.05 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .exceptions import LDAPSSLNotSupportedError, LDAPSSLConfigurationError, LDAPCertificateError, start_tls_exception_factory, LDAPStartTLSError +from .. import SEQUENCE_TYPES +from ..utils.log import log, log_enabled, ERROR, BASIC, NETWORK + +try: + # noinspection PyUnresolvedReferences + import ssl +except ImportError: + if log_enabled(ERROR): + log(ERROR, 'SSL not supported in this Python interpreter') + raise LDAPSSLNotSupportedError('SSL not supported in this Python interpreter') + +try: + from ssl import match_hostname, CertificateError # backport for python2 missing ssl functionalities +except ImportError: + from ..utils.tls_backport import CertificateError + from ..utils.tls_backport import match_hostname + if log_enabled(BASIC): + log(BASIC, 'using tls_backport') + +try: # try to use SSLContext + # noinspection PyUnresolvedReferences + from ssl import create_default_context, Purpose # defined in Python 3.4 and Python 2.7.9 + use_ssl_context = True +except ImportError: + use_ssl_context = False + if log_enabled(BASIC): + log(BASIC, 'SSLContext unavailable') + +from os import path + + +# noinspection PyProtectedMember +class Tls(object): + """ + tls/ssl configuration for Server object + Starting from python 2.7.9 and python 3.4 uses the SSLContext object + that tries to read the CAs defined at system level + ca_certs_path and ca_certs_data are valid only when using SSLContext + local_private_key_password is valid only when using SSLContext + ssl_options is valid only when using SSLContext + sni is the server name for Server Name Indication (when available) + """ + + def __init__(self, + local_private_key_file=None, + local_certificate_file=None, + validate=ssl.CERT_NONE, + version=None, + ssl_options=None, + ca_certs_file=None, + valid_names=None, + ca_certs_path=None, + ca_certs_data=None, + local_private_key_password=None, + ciphers=None, + sni=None): + if ssl_options is None: + ssl_options = [] + self.ssl_options = ssl_options + if validate in [ssl.CERT_NONE, ssl.CERT_OPTIONAL, ssl.CERT_REQUIRED]: + self.validate = validate + elif validate: + if log_enabled(ERROR): + log(ERROR, 'invalid validate parameter <%s>', validate) + raise LDAPSSLConfigurationError('invalid validate parameter') + if ca_certs_file and path.exists(ca_certs_file): + self.ca_certs_file = ca_certs_file + elif ca_certs_file: + if log_enabled(ERROR): + log(ERROR, 'invalid CA public key file <%s>', ca_certs_file) + raise LDAPSSLConfigurationError('invalid CA public key file') + else: + self.ca_certs_file = None + + if ca_certs_path and use_ssl_context and path.exists(ca_certs_path): + self.ca_certs_path = ca_certs_path + elif ca_certs_path and not use_ssl_context: + if log_enabled(ERROR): + log(ERROR, 'cannot use CA public keys path, SSLContext not available') + raise LDAPSSLNotSupportedError('cannot use CA public keys path, SSLContext not available') + elif ca_certs_path: + if log_enabled(ERROR): + log(ERROR, 'invalid CA public keys path <%s>', ca_certs_path) + raise LDAPSSLConfigurationError('invalid CA public keys path') + else: + self.ca_certs_path = None + + if ca_certs_data and use_ssl_context: + self.ca_certs_data = ca_certs_data + elif ca_certs_data: + if log_enabled(ERROR): + log(ERROR, 'cannot use CA data, SSLContext not available') + raise LDAPSSLNotSupportedError('cannot use CA data, SSLContext not available') + else: + self.ca_certs_data = None + + if local_private_key_password and use_ssl_context: + self.private_key_password = local_private_key_password + elif local_private_key_password: + if log_enabled(ERROR): + log(ERROR, 'cannot use local private key password, SSLContext not available') + raise LDAPSSLNotSupportedError('cannot use local private key password, SSLContext is not available') + else: + self.private_key_password = None + + self.version = version + self.private_key_file = local_private_key_file + self.certificate_file = local_certificate_file + self.valid_names = valid_names + self.ciphers = ciphers + self.sni = sni + + if log_enabled(BASIC): + log(BASIC, 'instantiated Tls: <%r>' % self) + + def __str__(self): + s = [ + 'protocol: ' + str(self.version), + 'client private key: ' + ('present ' if self.private_key_file else 'not present'), + 'client certificate: ' + ('present ' if self.certificate_file else 'not present'), + 'private key password: ' + ('present ' if self.private_key_password else 'not present'), + 'CA certificates file: ' + ('present ' if self.ca_certs_file else 'not present'), + 'CA certificates path: ' + ('present ' if self.ca_certs_path else 'not present'), + 'CA certificates data: ' + ('present ' if self.ca_certs_data else 'not present'), + 'verify mode: ' + str(self.validate), + 'valid names: ' + str(self.valid_names), + 'ciphers: ' + str(self.ciphers), + 'sni: ' + str(self.sni) + ] + return ' - '.join(s) + + def __repr__(self): + r = '' if self.private_key_file is None else ', local_private_key_file={0.private_key_file!r}'.format(self) + r += '' if self.certificate_file is None else ', local_certificate_file={0.certificate_file!r}'.format(self) + r += '' if self.validate is None else ', validate={0.validate!r}'.format(self) + r += '' if self.version is None else ', version={0.version!r}'.format(self) + r += '' if self.ca_certs_file is None else ', ca_certs_file={0.ca_certs_file!r}'.format(self) + r += '' if self.ca_certs_path is None else ', ca_certs_path={0.ca_certs_path!r}'.format(self) + r += '' if self.ca_certs_data is None else ', ca_certs_data={0.ca_certs_data!r}'.format(self) + r += '' if self.ciphers is None else ', ciphers={0.ciphers!r}'.format(self) + r += '' if self.sni is None else ', sni={0.sni!r}'.format(self) + r = 'Tls(' + r[2:] + ')' + return r + + def wrap_socket(self, connection, do_handshake=False): + """ + Adds TLS to the connection socket + """ + if use_ssl_context: + if self.version is None: # uses the default ssl context for reasonable security + ssl_context = create_default_context(purpose=Purpose.SERVER_AUTH, + cafile=self.ca_certs_file, + capath=self.ca_certs_path, + cadata=self.ca_certs_data) + else: # code from create_default_context in the Python standard library 3.5.1, creates a ssl context with the specificd protocol version + ssl_context = ssl.SSLContext(self.version) + if self.ca_certs_file or self.ca_certs_path or self.ca_certs_data: + ssl_context.load_verify_locations(self.ca_certs_file, self.ca_certs_path, self.ca_certs_data) + elif self.validate != ssl.CERT_NONE: + ssl_context.load_default_certs(Purpose.SERVER_AUTH) + + if self.certificate_file: + ssl_context.load_cert_chain(self.certificate_file, keyfile=self.private_key_file, password=self.private_key_password) + ssl_context.check_hostname = False + ssl_context.verify_mode = self.validate + for option in self.ssl_options: + ssl_context.options |= option + + if self.ciphers: + try: + ssl_context.set_ciphers(self.ciphers) + except ssl.SSLError: + pass + + if self.sni: + wrapped_socket = ssl_context.wrap_socket(connection.socket, server_side=False, do_handshake_on_connect=do_handshake, server_hostname=self.sni) + else: + wrapped_socket = ssl_context.wrap_socket(connection.socket, server_side=False, do_handshake_on_connect=do_handshake) + if log_enabled(NETWORK): + log(NETWORK, 'socket wrapped with SSL using SSLContext for <%s>', connection) + else: + if self.version is None and hasattr(ssl, 'PROTOCOL_SSLv23'): + self.version = ssl.PROTOCOL_SSLv23 + if self.ciphers: + try: + + wrapped_socket = ssl.wrap_socket(connection.socket, + keyfile=self.private_key_file, + certfile=self.certificate_file, + server_side=False, + cert_reqs=self.validate, + ssl_version=self.version, + ca_certs=self.ca_certs_file, + do_handshake_on_connect=do_handshake, + ciphers=self.ciphers) + except ssl.SSLError: + raise + except TypeError: # in python2.6 no ciphers argument is present, failback to self.ciphers=None + self.ciphers = None + + if not self.ciphers: + wrapped_socket = ssl.wrap_socket(connection.socket, + keyfile=self.private_key_file, + certfile=self.certificate_file, + server_side=False, + cert_reqs=self.validate, + ssl_version=self.version, + ca_certs=self.ca_certs_file, + do_handshake_on_connect=do_handshake) + if log_enabled(NETWORK): + log(NETWORK, 'socket wrapped with SSL for <%s>', connection) + + if do_handshake and (self.validate == ssl.CERT_REQUIRED or self.validate == ssl.CERT_OPTIONAL): + check_hostname(wrapped_socket, connection.server.host, self.valid_names) + + connection.socket = wrapped_socket + return + + def start_tls(self, connection): + if connection.server.ssl: # ssl already established at server level + return False + + if (connection.tls_started and not connection._executing_deferred) or connection.strategy._outstanding or connection.sasl_in_progress: + # Per RFC 4513 (3.1.1) + if log_enabled(ERROR): + log(ERROR, "can't start tls because operations are in progress for <%s>", self) + return False + connection.starting_tls = True + if log_enabled(BASIC): + log(BASIC, 'starting tls for <%s>', connection) + if not connection.strategy.sync: + connection._awaiting_for_async_start_tls = True # some flaky servers (OpenLDAP) doesn't return the extended response name in response + result = connection.extended('1.3.6.1.4.1.1466.20037') + if not connection.strategy.sync: + # asynchronous - _start_tls must be executed by the strategy + response = connection.get_response(result) + if response != (None, None): + if log_enabled(BASIC): + log(BASIC, 'tls started for <%s>', connection) + return True + else: + if log_enabled(BASIC): + log(BASIC, 'tls not started for <%s>', connection) + return False + else: + if connection.result['description'] not in ['success']: + # startTLS failed + connection.last_error = 'startTLS failed - ' + str(connection.result['description']) + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', connection.last_error, connection) + raise LDAPStartTLSError(connection.last_error) + if log_enabled(BASIC): + log(BASIC, 'tls started for <%s>', connection) + return self._start_tls(connection) + + def _start_tls(self, connection): + try: + self.wrap_socket(connection, do_handshake=True) + except Exception as e: + connection.last_error = 'wrap socket error: ' + str(e) + if log_enabled(ERROR): + log(ERROR, 'error <%s> wrapping socket for TLS in <%s>', connection.last_error, connection) + raise start_tls_exception_factory(e)(connection.last_error) + finally: + connection.starting_tls = False + + if connection.usage: + connection._usage.wrapped_sockets += 1 + connection.tls_started = True + return True + + +def check_hostname(sock, server_name, additional_names): + server_certificate = sock.getpeercert() + if log_enabled(NETWORK): + log(NETWORK, 'certificate found for %s: %s', sock, server_certificate) + if additional_names: + host_names = [server_name] + (additional_names if isinstance(additional_names, SEQUENCE_TYPES) else [additional_names]) + else: + host_names = [server_name] + + for host_name in host_names: + if not host_name: + continue + elif host_name == '*': + if log_enabled(NETWORK): + log(NETWORK, 'certificate matches * wildcard') + return # valid + + try: + match_hostname(server_certificate, host_name) # raise CertificateError if certificate doesn't match server name + if log_enabled(NETWORK): + log(NETWORK, 'certificate matches host name <%s>', host_name) + return # valid + except CertificateError as e: + if log_enabled(NETWORK): + log(NETWORK, str(e)) + + if log_enabled(ERROR): + log(ERROR, "hostname doesn't match certificate") + raise LDAPCertificateError("certificate %s doesn't match any name in %s " % (server_certificate, str(host_names))) diff --git a/python/user_packages/Python313/site-packages/ldap3/core/usage.py b/python/user_packages/Python313/site-packages/ldap3/core/usage.py new file mode 100644 index 0000000000000000000000000000000000000000..7748c768939d87f2b62fd0052ac225a58c10c079 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/core/usage.py @@ -0,0 +1,229 @@ +""" +""" + +# Created on 2014.03.15 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from datetime import datetime, timedelta +from os import linesep + +from .exceptions import LDAPMetricsError +from ..utils.log import log, log_enabled, ERROR, BASIC + + +class ConnectionUsage(object): + """ + Collect statistics on connection usage + """ + + def reset(self): + self.open_sockets = 0 + self.closed_sockets = 0 + self.wrapped_sockets = 0 + self.bytes_transmitted = 0 + self.bytes_received = 0 + self.messages_transmitted = 0 + self.messages_received = 0 + self.operations = 0 + self.abandon_operations = 0 + self.add_operations = 0 + self.bind_operations = 0 + self.compare_operations = 0 + self.delete_operations = 0 + self.extended_operations = 0 + self.modify_operations = 0 + self.modify_dn_operations = 0 + self.search_operations = 0 + self.unbind_operations = 0 + self.referrals_received = 0 + self.referrals_followed = 0 + self.referrals_connections = 0 + self.restartable_failures = 0 + self.restartable_successes = 0 + self.servers_from_pool = 0 + if log_enabled(BASIC): + log(BASIC, 'reset usage metrics') + + def __init__(self): + self.initial_connection_start_time = None + self.open_socket_start_time = None + self.connection_stop_time = None + self.last_transmitted_time = None + self.last_received_time = None + self.open_sockets = 0 + self.closed_sockets = 0 + self.wrapped_sockets = 0 + self.bytes_transmitted = 0 + self.bytes_received = 0 + self.messages_transmitted = 0 + self.messages_received = 0 + self.operations = 0 + self.abandon_operations = 0 + self.add_operations = 0 + self.bind_operations = 0 + self.compare_operations = 0 + self.delete_operations = 0 + self.extended_operations = 0 + self.modify_operations = 0 + self.modify_dn_operations = 0 + self.search_operations = 0 + self.unbind_operations = 0 + self.referrals_received = 0 + self.referrals_followed = 0 + self.referrals_connections = 0 + self.restartable_failures = 0 + self.restartable_successes = 0 + self.servers_from_pool = 0 + + if log_enabled(BASIC): + log(BASIC, 'instantiated Usage object') + + def __repr__(self): + r = 'Connection Usage:' + linesep + r += ' Time: [elapsed: ' + str(self.elapsed_time) + ']' + linesep + r += ' Initial start time: ' + (str(self.initial_connection_start_time.isoformat()) if self.initial_connection_start_time else '') + linesep + r += ' Open socket time: ' + (str(self.open_socket_start_time.isoformat()) if self.open_socket_start_time else '') + linesep + r += ' Last transmitted time: ' + (str(self.last_transmitted_time.isoformat()) if self.last_transmitted_time else '') + linesep + r += ' Last received time: ' + (str(self.last_received_time.isoformat()) if self.last_received_time else '') + linesep + r += ' Close socket time: ' + (str(self.connection_stop_time.isoformat()) if self.connection_stop_time else '') + linesep + r += ' Server:' + linesep + r += ' Servers from pool: ' + str(self.servers_from_pool) + linesep + r += ' Sockets open: ' + str(self.open_sockets) + linesep + r += ' Sockets closed: ' + str(self.closed_sockets) + linesep + r += ' Sockets wrapped: ' + str(self.wrapped_sockets) + linesep + r += ' Bytes: ' + str(self.bytes_transmitted + self.bytes_received) + linesep + r += ' Transmitted: ' + str(self.bytes_transmitted) + linesep + r += ' Received: ' + str(self.bytes_received) + linesep + r += ' Messages: ' + str(self.messages_transmitted + self.messages_received) + linesep + r += ' Transmitted: ' + str(self.messages_transmitted) + linesep + r += ' Received: ' + str(self.messages_received) + linesep + r += ' Operations: ' + str(self.operations) + linesep + r += ' Abandon: ' + str(self.abandon_operations) + linesep + r += ' Bind: ' + str(self.bind_operations) + linesep + r += ' Add: ' + str(self.add_operations) + linesep + r += ' Compare: ' + str(self.compare_operations) + linesep + r += ' Delete: ' + str(self.delete_operations) + linesep + r += ' Extended: ' + str(self.extended_operations) + linesep + r += ' Modify: ' + str(self.modify_operations) + linesep + r += ' ModifyDn: ' + str(self.modify_dn_operations) + linesep + r += ' Search: ' + str(self.search_operations) + linesep + r += ' Unbind: ' + str(self.unbind_operations) + linesep + r += ' Referrals: ' + linesep + r += ' Received: ' + str(self.referrals_received) + linesep + r += ' Followed: ' + str(self.referrals_followed) + linesep + r += ' Connections: ' + str(self.referrals_connections) + linesep + r += ' Restartable tries: ' + str(self.restartable_failures + self.restartable_successes) + linesep + r += ' Failed restarts: ' + str(self.restartable_failures) + linesep + r += ' Successful restarts: ' + str(self.restartable_successes) + linesep + return r + + def __str__(self): + return self.__repr__() + + def __iadd__(self, other): + if not isinstance(other, ConnectionUsage): + raise LDAPMetricsError('unable to add to ConnectionUsage') + + self.open_sockets += other.open_sockets + self.closed_sockets += other.closed_sockets + self.wrapped_sockets += other.wrapped_sockets + self.bytes_transmitted += other.bytes_transmitted + self.bytes_received += other.bytes_received + self.messages_transmitted += other.messages_transmitted + self.messages_received += other.messages_received + self.operations += other.operations + self.abandon_operations += other.abandon_operations + self.add_operations += other.add_operations + self.bind_operations += other.bind_operations + self.compare_operations += other.compare_operations + self.delete_operations += other.delete_operations + self.extended_operations += other.extended_operations + self.modify_operations += other.modify_operations + self.modify_dn_operations += other.modify_dn_operations + self.search_operations += other.search_operations + self.unbind_operations += other.unbind_operations + self.referrals_received += other.referrals_received + self.referrals_followed += other.referrals_followed + self.referrals_connections += other.referrals_connections + self.restartable_failures += other.restartable_failures + self.restartable_successes += other.restartable_successes + self.servers_from_pool += other.servers_from_pool + return self + + def update_transmitted_message(self, message, length): + self.last_transmitted_time = datetime.now() + self.bytes_transmitted += length + self.operations += 1 + self.messages_transmitted += 1 + if message['type'] == 'abandonRequest': + self.abandon_operations += 1 + elif message['type'] == 'addRequest': + self.add_operations += 1 + elif message['type'] == 'bindRequest': + self.bind_operations += 1 + elif message['type'] == 'compareRequest': + self.compare_operations += 1 + elif message['type'] == 'delRequest': + self.delete_operations += 1 + elif message['type'] == 'extendedReq': + self.extended_operations += 1 + elif message['type'] == 'modifyRequest': + self.modify_operations += 1 + elif message['type'] == 'modDNRequest': + self.modify_dn_operations += 1 + elif message['type'] == 'searchRequest': + self.search_operations += 1 + elif message['type'] == 'unbindRequest': + self.unbind_operations += 1 + else: + if log_enabled(ERROR): + log(ERROR, 'unable to collect usage for unknown message type <%s>', message['type']) + raise LDAPMetricsError('unable to collect usage for unknown message type') + + def update_received_message(self, length): + self.last_received_time = datetime.now() + self.bytes_received += length + self.messages_received += 1 + + def start(self, reset=True): + if reset: + self.reset() + self.open_socket_start_time = datetime.now() + self.connection_stop_time = None + if not self.initial_connection_start_time: + self.initial_connection_start_time = self.open_socket_start_time + + if log_enabled(BASIC): + log(BASIC, 'start collecting usage metrics') + + def stop(self): + if self.open_socket_start_time: + self.connection_stop_time = datetime.now() + if log_enabled(BASIC): + log(BASIC, 'stop collecting usage metrics') + + @property + def elapsed_time(self): + if self.connection_stop_time: + return self.connection_stop_time - self.open_socket_start_time + else: + return (datetime.now() - self.open_socket_start_time) if self.open_socket_start_time else timedelta(0) diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/__init__.py b/python/user_packages/Python313/site-packages/ldap3/extend/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b359be58a0e8a69c07ffd764ead96ac466b0d421 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/__init__.py @@ -0,0 +1,334 @@ +""" +""" + +# Created on 2014.04.28 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from os import linesep + +from .. import SUBTREE, DEREF_ALWAYS, ALL_ATTRIBUTES, DEREF_NEVER +from .microsoft.dirSync import DirSync +from .microsoft.modifyPassword import ad_modify_password +from .microsoft.unlockAccount import ad_unlock_account +from .microsoft.addMembersToGroups import ad_add_members_to_groups +from .microsoft.removeMembersFromGroups import ad_remove_members_from_groups +from .microsoft.persistentSearch import ADPersistentSearch +from .novell.partition_entry_count import PartitionEntryCount +from .novell.replicaInfo import ReplicaInfo +from .novell.listReplicas import ListReplicas +from .novell.getBindDn import GetBindDn +from .novell.nmasGetUniversalPassword import NmasGetUniversalPassword +from .novell.nmasSetUniversalPassword import NmasSetUniversalPassword +from .novell.startTransaction import StartTransaction +from .novell.endTransaction import EndTransaction +from .novell.addMembersToGroups import edir_add_members_to_groups +from .novell.removeMembersFromGroups import edir_remove_members_from_groups +from .novell.checkGroupsMemberships import edir_check_groups_memberships +from .standard.whoAmI import WhoAmI +from .standard.modifyPassword import ModifyPassword +from .standard.PagedSearch import paged_search_generator, paged_search_accumulator +from .standard.PersistentSearch import PersistentSearch + + +class ExtendedOperationContainer(object): + def __init__(self, connection): + self._connection = connection + + def __repr__(self): + return linesep.join([' ' + element for element in dir(self) if element[0] != '_']) + + def __str__(self): + return self.__repr__() + + +class StandardExtendedOperations(ExtendedOperationContainer): + def who_am_i(self, controls=None): + return WhoAmI(self._connection, + controls).send() + + def modify_password(self, + user=None, + old_password=None, + new_password=None, + hash_algorithm=None, + salt=None, + controls=None): + + return ModifyPassword(self._connection, + user, + old_password, + new_password, + hash_algorithm, + salt, + controls).send() + + def paged_search(self, + search_base, + search_filter, + search_scope=SUBTREE, + dereference_aliases=DEREF_ALWAYS, + attributes=None, + size_limit=0, + time_limit=0, + types_only=False, + get_operational_attributes=False, + controls=None, + paged_size=100, + paged_criticality=False, + generator=True): + + if generator: + return paged_search_generator(self._connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + get_operational_attributes, + controls, + paged_size, + paged_criticality) + else: + return paged_search_accumulator(self._connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + get_operational_attributes, + controls, + paged_size, + paged_criticality) + + def persistent_search(self, + search_base='', + search_filter='(objectclass=*)', + search_scope=SUBTREE, + dereference_aliases=DEREF_NEVER, + attributes=ALL_ATTRIBUTES, + size_limit=0, + time_limit=0, + controls=None, + changes_only=True, + show_additions=True, + show_deletions=True, + show_modifications=True, + show_dn_modifications=True, + notifications=True, + streaming=True, + callback=None + ): + events_type = 0 + if show_additions: + events_type += 1 + if show_deletions: + events_type += 2 + if show_modifications: + events_type += 4 + if show_dn_modifications: + events_type += 8 + + if callback: + streaming = False + return PersistentSearch(self._connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + controls, + changes_only, + events_type, + notifications, + streaming, + callback) + + def funnel_search(self, + search_base='', + search_filter='', + search_scope=SUBTREE, + dereference_aliases=DEREF_NEVER, + attributes=ALL_ATTRIBUTES, + size_limit=0, + time_limit=0, + controls=None, + streaming=False, + callback=None + ): + return PersistentSearch(self._connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + controls, + None, + None, + None, + streaming, + callback) + + +class NovellExtendedOperations(ExtendedOperationContainer): + def get_bind_dn(self, controls=None): + return GetBindDn(self._connection, + controls).send() + + def get_universal_password(self, user, controls=None): + return NmasGetUniversalPassword(self._connection, + user, + controls).send() + + def set_universal_password(self, user, new_password=None, controls=None): + return NmasSetUniversalPassword(self._connection, + user, + new_password, + controls).send() + + def list_replicas(self, server_dn, controls=None): + return ListReplicas(self._connection, + server_dn, + controls).send() + + def partition_entry_count(self, partition_dn, controls=None): + return PartitionEntryCount(self._connection, + partition_dn, + controls).send() + + def replica_info(self, server_dn, partition_dn, controls=None): + return ReplicaInfo(self._connection, + server_dn, + partition_dn, + controls).send() + + def start_transaction(self, controls=None): + return StartTransaction(self._connection, + controls).send() + + def end_transaction(self, commit=True, controls=None): # attach the groupingControl to commit, None to abort transaction + return EndTransaction(self._connection, + commit, + controls).send() + + def add_members_to_groups(self, members, groups, fix=True, transaction=True): + return edir_add_members_to_groups(self._connection, + members_dn=members, + groups_dn=groups, + fix=fix, + transaction=transaction) + + def remove_members_from_groups(self, members, groups, fix=True, transaction=True): + return edir_remove_members_from_groups(self._connection, + members_dn=members, + groups_dn=groups, + fix=fix, + transaction=transaction) + + def check_groups_memberships(self, members, groups, fix=False, transaction=True): + return edir_check_groups_memberships(self._connection, + members_dn=members, + groups_dn=groups, + fix=fix, + transaction=transaction) + + +class MicrosoftExtendedOperations(ExtendedOperationContainer): + def dir_sync(self, + sync_base, + sync_filter='(objectclass=*)', + attributes=ALL_ATTRIBUTES, + cookie=None, + object_security=False, + ancestors_first=True, + public_data_only=False, + incremental_values=True, + max_length=2147483647, + hex_guid=False): + return DirSync(self._connection, + sync_base=sync_base, + sync_filter=sync_filter, + attributes=attributes, + cookie=cookie, + object_security=object_security, + ancestors_first=ancestors_first, + public_data_only=public_data_only, + incremental_values=incremental_values, + max_length=max_length, + hex_guid=hex_guid) + + def modify_password(self, user, new_password, old_password=None, controls=None): + return ad_modify_password(self._connection, + user, + new_password, + old_password, + controls) + + def unlock_account(self, user): + return ad_unlock_account(self._connection, + user) + + def add_members_to_groups(self, members, groups, fix=True): + return ad_add_members_to_groups(self._connection, + members_dn=members, + groups_dn=groups, + fix=fix) + + def remove_members_from_groups(self, members, groups, fix=True): + return ad_remove_members_from_groups(self._connection, + members_dn=members, + groups_dn=groups, + fix=fix) + + def persistent_search(self, + search_base='', + search_scope=SUBTREE, + attributes=ALL_ATTRIBUTES, + streaming=True, + callback=None + ): + + if callback: + streaming = False + return ADPersistentSearch(self._connection, + search_base, + search_scope, + attributes, + streaming, + callback) + + +class ExtendedOperationsRoot(ExtendedOperationContainer): + def __init__(self, connection): + ExtendedOperationContainer.__init__(self, connection) # calls super + self.standard = StandardExtendedOperations(self._connection) + self.novell = NovellExtendedOperations(self._connection) + self.microsoft = MicrosoftExtendedOperations(self._connection) diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b258e1765f514cc64b42f7da709636aaa063fba5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/__pycache__/operation.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/__pycache__/operation.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a678461f4d9cda8aef7996aafc2887b00e341e2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/__pycache__/operation.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__init__.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36728ea640a378e056f8b3b92fbc7f2d2ed771f5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/addMembersToGroups.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/addMembersToGroups.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7d2def55fbae80ae4125adf62e7c83581749d77 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/addMembersToGroups.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/dirSync.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/dirSync.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91c5e7c310ef15f60de43f5469c9ac681fa01a53 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/dirSync.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/modifyPassword.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/modifyPassword.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..146bd4f4c54ef85a787f2f2fe94c31a24ef81050 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/modifyPassword.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/persistentSearch.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/persistentSearch.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f328955b69f5e9574a1a7047f22e2327f9748b25 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/persistentSearch.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/removeMembersFromGroups.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/removeMembersFromGroups.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f58841454409808b0151ba7dcda0ebfbcf85280 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/removeMembersFromGroups.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/unlockAccount.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/unlockAccount.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e10c5a091a0cbc920d08486ec6a429f790bb37b5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/__pycache__/unlockAccount.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/addMembersToGroups.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/addMembersToGroups.py new file mode 100644 index 0000000000000000000000000000000000000000..fb6528a5c0fbfddb475098ad1983d2cd43c9aa84 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/addMembersToGroups.py @@ -0,0 +1,98 @@ +""" +""" + +# Created on 2016.12.26 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ... import SEQUENCE_TYPES, MODIFY_ADD, BASE, DEREF_NEVER +from ...core.exceptions import LDAPInvalidDnError, LDAPOperationsErrorResult +from ...utils.dn import safe_dn + + +def ad_add_members_to_groups(connection, + members_dn, + groups_dn, + fix=True, + raise_error=False): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to add to groups + :param groups_dn: the list of groups where members are to be added + :param fix: checks for group existence and already assigned members + :param raise_error: If the operation fails it raises an error instead of returning False + :return: a boolean where True means that the operation was successful and False means an error has happened + Establishes users-groups relations following the Active Directory rules: users are added to the member attribute of groups. + Raises LDAPInvalidDnError if members or groups are not found in the DIT. + """ + + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + if connection.check_names: # builds new lists with sanitized dn + members_dn = [safe_dn(member_dn) for member_dn in members_dn] + groups_dn = [safe_dn(group_dn) for group_dn in groups_dn] + + error = False + for group in groups_dn: + if fix: # checks for existance of group and for already assigned members + result = connection.search(group, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['member']) + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = connection.response + result = connection.result + + if not result['description'] == 'success': + raise LDAPInvalidDnError(group + ' not found') + + existing_members = response[0]['attributes']['member'] if 'member' in response[0]['attributes'] else [] + existing_members = [element.lower() for element in existing_members] + else: + existing_members = [] + + changes = dict() + member_to_add = [element for element in members_dn if element.lower() not in existing_members] + if member_to_add: + changes['member'] = (MODIFY_ADD, member_to_add) + if changes: + result = connection.modify(group, changes) + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + if result['description'] != 'success': + error = True + result_error_params = ['result', 'description', 'dn', 'message'] + if raise_error: + raise LDAPOperationsErrorResult([(k, v) for k, v in result.items() if k in result_error_params]) + break + + return not error # returns True if no error is raised in the LDAP operations diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/dirSync.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/dirSync.py new file mode 100644 index 0000000000000000000000000000000000000000..e5dd8ae5f5ceb954524f1299bed3266797c1b5f3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/dirSync.py @@ -0,0 +1,94 @@ +""" +""" + +# Created on 2015.10.21 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...core.exceptions import LDAPExtensionError +from ...protocol.microsoft import dir_sync_control, extended_dn_control, show_deleted_control +from ... import SUBTREE, DEREF_NEVER +from ...utils.dn import safe_dn + + +class DirSync(object): + def __init__(self, + connection, + sync_base, + sync_filter, + attributes, + cookie, + object_security, + ancestors_first, + public_data_only, + incremental_values, + max_length, + hex_guid + ): + self.connection = connection + if self.connection.check_names and sync_base: + self. base = safe_dn(sync_base) + else: + self.base = sync_base + self.filter = sync_filter + self.attributes = attributes + self.cookie = cookie + self.object_security = object_security + self.ancestors_first = ancestors_first + self.public_data_only = public_data_only + self.incremental_values = incremental_values + self.max_length = max_length + self.hex_guid = hex_guid + self.more_results = True + + def loop(self): + result = self.connection.search(search_base=self.base, + search_filter=self.filter, + search_scope=SUBTREE, + attributes=self.attributes, + dereference_aliases=DEREF_NEVER, + controls=[dir_sync_control(criticality=True, + object_security=self.object_security, + ancestors_first=self.ancestors_first, + public_data_only=self.public_data_only, + incremental_values=self.incremental_values, + max_length=self.max_length, cookie=self.cookie), + extended_dn_control(criticality=False, hex_format=self.hex_guid), + show_deleted_control(criticality=False)] + ) + if not self.connection.strategy.sync: + response, result = self.connection.get_response(result) + else: + if self.connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = self.connection.response + result = self.connection.result + + if result['description'] == 'success' and 'controls' in result and '1.2.840.113556.1.4.841' in result['controls']: + self.more_results = result['controls']['1.2.840.113556.1.4.841']['value']['more_results'] + self.cookie = result['controls']['1.2.840.113556.1.4.841']['value']['cookie'] + return response + elif 'controls' in result: + raise LDAPExtensionError('Missing DirSync control in response from server') + else: + raise LDAPExtensionError('error %r in DirSync' % result) + diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/modifyPassword.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/modifyPassword.py new file mode 100644 index 0000000000000000000000000000000000000000..e304cafa1214145d991bbfd793978e4739dd1540 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/modifyPassword.py @@ -0,0 +1,75 @@ +""" +""" + +# Created on 2015.11.27 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + + +from ... import MODIFY_REPLACE, MODIFY_DELETE, MODIFY_ADD +from ...utils.log import log, log_enabled, PROTOCOL +from ...core.results import RESULT_SUCCESS +from ...utils.dn import safe_dn +from ...utils.conv import to_unicode + + +def ad_modify_password(connection, user_dn, new_password, old_password, controls=None): + # old password must be None to reset password with sufficient privileges + if connection.check_names: + user_dn = safe_dn(user_dn) + if str is bytes: # python2, converts to unicode + new_password = to_unicode(new_password) + if old_password: + old_password = to_unicode(old_password) + + encoded_new_password = ('"%s"' % new_password).encode('utf-16-le') + + if old_password: # normal users must specify old and new password + encoded_old_password = ('"%s"' % old_password).encode('utf-16-le') + result = connection.modify(user_dn, + {'unicodePwd': [(MODIFY_DELETE, [encoded_old_password]), + (MODIFY_ADD, [encoded_new_password])]}, + controls) + else: # admin users can reset password without sending the old one + result = connection.modify(user_dn, + {'unicodePwd': [(MODIFY_REPLACE, [encoded_new_password])]}, + controls) + + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + + # change successful, returns True + if result['result'] == RESULT_SUCCESS: + return True + + # change was not successful, raises exception if raise_exception = True in connection or returns the operation result, error code is in result['result'] + if connection.raise_exceptions: + from ...core.exceptions import LDAPOperationResult + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, connection) + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + + return False diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/persistentSearch.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/persistentSearch.py new file mode 100644 index 0000000000000000000000000000000000000000..455bedca7b7b02c0d6ab1f7513d51a40175cade5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/persistentSearch.py @@ -0,0 +1,117 @@ +""" +""" + +# Created on 2016.07.08 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +try: + from queue import Empty +except ImportError: # Python 2 + # noinspection PyUnresolvedReferences + from Queue import Empty + +from ...core.exceptions import LDAPExtensionError +from ...utils.dn import safe_dn +from ...protocol.microsoft import persistent_search_control + + +class ADPersistentSearch(object): + def __init__(self, + connection, + search_base, + search_scope, + attributes, + streaming, + callback + ): + if connection.strategy.sync: + raise LDAPExtensionError('Persistent Search needs an asynchronous streaming connection') + + if connection.check_names and search_base: + search_base = safe_dn(search_base) + + self.connection = connection + self.message_id = None + self.base = search_base + self.scope = search_scope + self.attributes = attributes + self.controls = [persistent_search_control()] + + # this is the only filter permitted by AD persistent search + self.filter = '(objectClass=*)' + + self.connection.strategy.streaming = streaming + if callback and callable(callback): + self.connection.strategy.callback = callback + elif callback: + raise LDAPExtensionError('callback is not callable') + + self.start() + + def start(self): + if self.message_id: # persistent search already started + return + + if not self.connection.bound: + self.connection.bind() + + with self.connection.strategy.async_lock: + self.message_id = self.connection.search(search_base=self.base, + search_filter=self.filter, + search_scope=self.scope, + attributes=self.attributes, + controls=self.controls) + self.connection.strategy.persistent_search_message_id = self.message_id + + def stop(self, unbind=True): + self.connection.abandon(self.message_id) + if unbind: + self.connection.unbind() + if self.message_id in self.connection.strategy._responses: + del self.connection.strategy._responses[self.message_id] + if hasattr(self.connection.strategy, '_requests') and self.message_id in self.connection.strategy._requests: # asynchronous strategy has a dict of request that could be returned by get_response() + del self.connection.strategy._requests[self.message_id] + self.connection.strategy.persistent_search_message_id = None + self.message_id = None + + def next(self, block=False, timeout=None): + if not self.connection.strategy.streaming and not self.connection.strategy.callback: + try: + return self.connection.strategy.events.get(block, timeout) + except Empty: + return None + + raise LDAPExtensionError('Persistent search is not accumulating events in queue') + + def funnel(self, block=False, timeout=None): + done = False + while not done: + try: + entry = self.connection.strategy.events.get(block, timeout) + except Empty: + yield None + if entry['type'] == 'searchResEntry': + yield entry + else: + done = True + + yield entry diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/removeMembersFromGroups.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/removeMembersFromGroups.py new file mode 100644 index 0000000000000000000000000000000000000000..86b799a84c8c49bf241b6634550fe0e1eb041df7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/removeMembersFromGroups.py @@ -0,0 +1,99 @@ +""" +""" + +# Created on 2016.12.26 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...core.exceptions import LDAPInvalidDnError, LDAPOperationsErrorResult +from ... import SEQUENCE_TYPES, MODIFY_DELETE, BASE, DEREF_NEVER +from ...utils.dn import safe_dn + + +def ad_remove_members_from_groups(connection, + members_dn, + groups_dn, + fix, + raise_error=False): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to remove from groups + :param groups_dn: the list of groups where members are to be removed + :param fix: checks for group existence and existing members + :param raise_error: If the operation fails it raises an error instead of returning False + :return: a boolean where True means that the operation was successful and False means an error has happened + Removes users-groups relations following the Activwe Directory rules: users are removed from groups' member attribute + + """ + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + if connection.check_names: # builds new lists with sanitized dn + members_dn = [safe_dn(member_dn) for member_dn in members_dn] + groups_dn = [safe_dn(group_dn) for group_dn in groups_dn] + + error = False + + for group in groups_dn: + if fix: # checks for existance of group and for already assigned members + result = connection.search(group, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['member']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = connection.response + result = connection.result + + if not result['description'] == 'success': + raise LDAPInvalidDnError(group + ' not found') + + existing_members = response[0]['attributes']['member'] if 'member' in response[0]['attributes'] else [] + else: + existing_members = members_dn + + existing_members = [element.lower() for element in existing_members] + changes = dict() + member_to_remove = [element for element in members_dn if element.lower() in existing_members] + if member_to_remove: + changes['member'] = (MODIFY_DELETE, member_to_remove) + if changes: + result = connection.modify(group, changes) + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + if result['description'] != 'success': + error = True + result_error_params = ['result', 'description', 'dn', 'message'] + if raise_error: + raise LDAPOperationsErrorResult([(k, v) for k, v in result.items() if k in result_error_params]) + break + + return not error diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/unlockAccount.py b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/unlockAccount.py new file mode 100644 index 0000000000000000000000000000000000000000..b1c65b83281860d236718107627aa64297e88f4f --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/microsoft/unlockAccount.py @@ -0,0 +1,57 @@ +""" +""" + +# Created on 2016.11.01 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + + +from ... import MODIFY_REPLACE +from ...utils.log import log, log_enabled, PROTOCOL +from ...core.results import RESULT_SUCCESS +from ...utils.dn import safe_dn + + +def ad_unlock_account(connection, user_dn, controls=None): + if connection.check_names: + user_dn = safe_dn(user_dn) + result = connection.modify(user_dn, {'lockoutTime': [(MODIFY_REPLACE, ['0'])]}, controls) + + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + + # change successful, returns True + if result['result'] == RESULT_SUCCESS: + return True + + # change was not successful, raises exception if raise_exception = True in connection or returns the operation result, error code is in result['result'] + if connection.raise_exceptions: + from ...core.exceptions import LDAPOperationResult + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, connection) + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + + return result diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__init__.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..361d62d7b0085ac2e02542adcfbb9e9e6a087df3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/addMembersToGroups.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/addMembersToGroups.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..967fda04b7f2d4b5ab580c372fd1f276eb074613 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/addMembersToGroups.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/checkGroupsMemberships.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/checkGroupsMemberships.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3afc5a8b23a4b69304d719a3168aac1bedb01389 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/checkGroupsMemberships.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/endTransaction.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/endTransaction.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6b2549902144361f9e503df275241d824784e42 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/endTransaction.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/getBindDn.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/getBindDn.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1858a00e53ca4aca13b7473701f286ac17c81e0b Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/getBindDn.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/listReplicas.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/listReplicas.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20ee4d3d9ef9700d28330f4518d754b74b80c6f6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/listReplicas.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/nmasGetUniversalPassword.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/nmasGetUniversalPassword.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3adefebf14b788a434d7c6f4820413d189a1d21d Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/nmasGetUniversalPassword.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/nmasSetUniversalPassword.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/nmasSetUniversalPassword.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77787610afdce0a0b75ebbc5b62283c1d1265679 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/nmasSetUniversalPassword.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/partition_entry_count.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/partition_entry_count.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7a7f779fcef611ba8f18a12129e91558adedace Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/partition_entry_count.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/removeMembersFromGroups.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/removeMembersFromGroups.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd73e92e6994c2cfabe259c0764535b6677a584e Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/removeMembersFromGroups.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/replicaInfo.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/replicaInfo.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e38ee07219199b1411fb2c3f818e6ac6ff2e5ac3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/replicaInfo.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/startTransaction.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/startTransaction.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bff9cc50af2ec0900d33a54515b75b5fc100370e Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/novell/__pycache__/startTransaction.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/addMembersToGroups.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/addMembersToGroups.py new file mode 100644 index 0000000000000000000000000000000000000000..b832b9a6771d063fa0ec72876df6fbf6944db79c --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/addMembersToGroups.py @@ -0,0 +1,167 @@ +""" +""" + +# Created on 2016.04.16 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from ...core.exceptions import LDAPInvalidDnError +from ... import SEQUENCE_TYPES, MODIFY_ADD, BASE, DEREF_NEVER +from ...utils.dn import safe_dn + + +def edir_add_members_to_groups(connection, + members_dn, + groups_dn, + fix, + transaction): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to add to groups + :param groups_dn: the list of groups where members are to be added + :param fix: checks for inconsistences in the users-groups relation and fixes them + :param transaction: activates an LDAP transaction + :return: a boolean where True means that the operation was successful and False means an error has happened + Establishes users-groups relations following the eDirectory rules: groups are added to securityEquals and groupMembership + attributes in the member object while members are added to member and equivalentToMe attributes in the group object. + Raises LDAPInvalidDnError if members or groups are not found in the DIT. + """ + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + transaction_control = None + error = False + + if connection.check_names: # builds new lists with sanitized dn + safe_members_dn = [] + safe_groups_dn = [] + for member_dn in members_dn: + safe_members_dn.append(safe_dn(member_dn)) + for group_dn in groups_dn: + safe_groups_dn.append(safe_dn(group_dn)) + + members_dn = safe_members_dn + groups_dn = safe_groups_dn + + if transaction: + transaction_control = connection.extend.novell.start_transaction() + + if not error: + for member in members_dn: + if fix: # checks for existance of member and for already assigned groups + result = connection.search(member, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['securityEquals', 'groupMembership']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + result = connection.result + response = connection.response + + if not result['description'] == 'success': + raise LDAPInvalidDnError(member + ' not found') + + existing_security_equals = response[0]['attributes']['securityEquals'] if 'securityEquals' in response[0]['attributes'] else [] + existing_group_membership = response[0]['attributes']['groupMembership'] if 'groupMembership' in response[0]['attributes'] else [] + existing_security_equals = [element.lower() for element in existing_security_equals] + existing_group_membership = [element.lower() for element in existing_group_membership] + else: + existing_security_equals = [] + existing_group_membership = [] + changes = dict() + security_equals_to_add = [element for element in groups_dn if element.lower() not in existing_security_equals] + group_membership_to_add = [element for element in groups_dn if element.lower() not in existing_group_membership] + if security_equals_to_add: + changes['securityEquals'] = (MODIFY_ADD, security_equals_to_add) + if group_membership_to_add: + changes['groupMembership'] = (MODIFY_ADD, group_membership_to_add) + if changes: + result = connection.modify(member, changes, controls=[transaction_control] if transaction else None) + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + if result['description'] != 'success': + error = True + break + + if not error: + for group in groups_dn: + if fix: # checks for existance of group and for already assigned members + result = connection.search(group, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['member', 'equivalentToMe']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + result = connection.result + response = connection.response + + if not result['description'] == 'success': + raise LDAPInvalidDnError(group + ' not found') + + existing_members = response[0]['attributes']['member'] if 'member' in response[0]['attributes'] else [] + existing_equivalent_to_me = response[0]['attributes']['equivalentToMe'] if 'equivalentToMe' in response[0]['attributes'] else [] + existing_members = [element.lower() for element in existing_members] + existing_equivalent_to_me = [element.lower() for element in existing_equivalent_to_me] + else: + existing_members = [] + existing_equivalent_to_me = [] + + changes = dict() + member_to_add = [element for element in members_dn if element.lower() not in existing_members] + equivalent_to_me_to_add = [element for element in members_dn if element.lower() not in existing_equivalent_to_me] + if member_to_add: + changes['member'] = (MODIFY_ADD, member_to_add) + if equivalent_to_me_to_add: + changes['equivalentToMe'] = (MODIFY_ADD, equivalent_to_me_to_add) + if changes: + result = connection.modify(group, changes, controls=[transaction_control] if transaction else None) + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + if result['description'] != 'success': + error = True + break + + if transaction: + if error: # aborts transaction in case of error in the modify operations + result = connection.extend.novell.end_transaction(commit=False, controls=[transaction_control]) + else: + result = connection.extend.novell.end_transaction(commit=True, controls=[transaction_control]) + + if result['description'] != 'success': + error = True + + return not error # returns True if no error is raised in the LDAP operations diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/checkGroupsMemberships.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/checkGroupsMemberships.py new file mode 100644 index 0000000000000000000000000000000000000000..0f65b5d4047393f2a0797f9bdb9e1f289071ddc5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/checkGroupsMemberships.py @@ -0,0 +1,180 @@ +""" +""" + +# Created on 2016.05.14 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + + +from .addMembersToGroups import edir_add_members_to_groups +from ...core.exceptions import LDAPInvalidDnError +from ... import SEQUENCE_TYPES, BASE, DEREF_NEVER +from ...utils.dn import safe_dn + + +def _check_members_have_memberships(connection, + members_dn, + groups_dn): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to add to groups + :param groups_dn: the list of groups where members are to be added + :return: two booleans. The first when True means that all members have membership in all groups, The second when True means that + there are inconsistences in the securityEquals attribute + Checks user's group membership. + Raises LDAPInvalidDNError if member is not found in the DIT. + """ + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + partial = False # True when a member has groupMembership but doesn't have securityEquals + for member in members_dn: + result = connection.search(member, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['groupMembership', 'securityEquals']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + result = connection.result + response = connection.response + + if not result['description'] == 'success': # member not found in DIT + raise LDAPInvalidDnError(member + ' not found') + + existing_security_equals = response[0]['attributes']['securityEquals'] if 'securityEquals' in response[0]['attributes'] else [] + existing_group_membership = response[0]['attributes']['groupMembership'] if 'groupMembership' in response[0]['attributes'] else [] + existing_security_equals = [element.lower() for element in existing_security_equals] + existing_group_membership = [element.lower() for element in existing_group_membership] + + for group in groups_dn: + if group.lower() not in existing_group_membership: + return False, False + if group.lower() not in existing_security_equals: + partial = True + + return True, partial + + +def _check_groups_contain_members(connection, + groups_dn, + members_dn): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to add to groups + :param groups_dn: the list of groups where members are to be added + :return: two booleans. The first when True means that all members have membership in all groups, The second when True means that + there are inconsistences in the EquivalentToMe attribute + Checks if groups have members in their 'member' attribute. + Raises LDAPInvalidDNError if member is not found in the DIT. + """ + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + partial = False # True when a group has member but doesn't have equivalentToMe + for group in groups_dn: + result = connection.search(group, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['member', 'equivalentToMe']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + result = connection.result + response = connection.response + + if not result['description'] == 'success': + raise LDAPInvalidDnError(group + ' not found') + + existing_members = response[0]['attributes']['member'] if 'member' in response[0]['attributes'] else [] + existing_equivalent_to_me = response[0]['attributes']['equivalentToMe'] if 'equivalentToMe' in response[0]['attributes'] else [] + existing_members = [element.lower() for element in existing_members] + existing_equivalent_to_me = [element.lower() for element in existing_equivalent_to_me] + for member in members_dn: + if member.lower() not in existing_members: + return False, False + if member.lower() not in existing_equivalent_to_me: + partial = True + + return True, partial + + +def edir_check_groups_memberships(connection, + members_dn, + groups_dn, + fix, + transaction): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to check + :param groups_dn: the list of groups to check + :param fix: checks for inconsistences in the users-groups relation and fixes them + :param transaction: activates an LDAP transaction when fixing + :return: a boolean where True means that the operation was successful and False means an error has happened + Checks and fixes users-groups relations following the eDirectory rules: groups are checked against 'groupMembership' + attribute in the member object while members are checked against 'member' attribute in the group object. + Raises LDAPInvalidDnError if members or groups are not found in the DIT. + """ + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + if connection.check_names: # builds new lists with sanitized dn + safe_members_dn = [] + safe_groups_dn = [] + for member_dn in members_dn: + safe_members_dn.append(safe_dn(member_dn)) + for group_dn in groups_dn: + safe_groups_dn.append(safe_dn(group_dn)) + + members_dn = safe_members_dn + groups_dn = safe_groups_dn + + try: + members_have_memberships, partial_member_security = _check_members_have_memberships(connection, members_dn, groups_dn) + groups_contain_members, partial_group_security = _check_groups_contain_members(connection, groups_dn, members_dn) + except LDAPInvalidDnError: + return False + + if not members_have_memberships and not groups_contain_members: + return False + + if fix: # fix any inconsistences + if (members_have_memberships and not groups_contain_members) \ + or (groups_contain_members and not members_have_memberships) \ + or partial_group_security \ + or partial_member_security: + + for member in members_dn: + for group in groups_dn: + edir_add_members_to_groups(connection, member, group, True, transaction) + + return True diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/endTransaction.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/endTransaction.py new file mode 100644 index 0000000000000000000000000000000000000000..18bc04146a10c39c9ffafd0203fa4d137d4d5059 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/endTransaction.py @@ -0,0 +1,58 @@ +""" +""" + +# Created on 2016.04.14 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...extend.operation import ExtendedOperation +from ...protocol.novell import EndGroupTypeRequestValue, EndGroupTypeResponseValue, Sequence +from ...utils.asn1 import decoder + + +class EndTransaction(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.27.103.2' + self.response_name = '2.16.840.1.113719.1.27.103.2' + self.request_value = EndGroupTypeRequestValue() + self.asn1_spec = EndGroupTypeResponseValue() + + def __init__(self, connection, commit=True, controls=None): + if controls and len(controls) == 1: + group_cookie = decoder.decode(controls[0][2], asn1Spec=Sequence())[0][0] # get the cookie from the built groupingControl + else: + group_cookie = None + controls = None + + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + if group_cookie: + self.request_value['endGroupCookie'] = group_cookie # transactionGroupingType + if not commit: + self.request_value['endGroupValue'] = '' # an empty endGroupValue means abort transaction + + def populate_result(self): + try: + self.result['value'] = self.decoded_response['endGroupValue'] + except TypeError: + self.result['value'] = None + + def set_response(self): + self.response_value = self.result diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/getBindDn.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/getBindDn.py new file mode 100644 index 0000000000000000000000000000000000000000..492bcdd86e0a09a505a63501efb84a035c78ba84 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/getBindDn.py @@ -0,0 +1,41 @@ +""" +""" + +# Created on 2014.04.30 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...protocol.novell import Identity +from ...extend.operation import ExtendedOperation + + +class GetBindDn(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.27.100.31' + self.response_name = '2.16.840.1.113719.1.27.100.32' + self.response_attribute = 'identity' + self.asn1_spec = Identity() + + def populate_result(self): + try: + self.result['identity'] = str(self.decoded_response) if self.decoded_response else None + except TypeError: + self.result['identity'] = None diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/listReplicas.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/listReplicas.py new file mode 100644 index 0000000000000000000000000000000000000000..8ccf2ff3cfef8377915a75801d5e4c9149709615 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/listReplicas.py @@ -0,0 +1,50 @@ +""" +""" + +# Created on 2014.07.03 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...extend.operation import ExtendedOperation +from ...protocol.novell import ReplicaList +from ...protocol.rfc4511 import LDAPDN +from ...utils.dn import safe_dn + + +class ListReplicas(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.27.100.19' + self.response_name = '2.16.840.1.113719.1.27.100.20' + self.request_value = LDAPDN() + self.asn1_spec = ReplicaList() + self.response_attribute = 'replicas' + + def __init__(self, connection, server_dn, controls=None): + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + if connection.check_names: + server_dn = safe_dn(server_dn) + self.request_value = LDAPDN(server_dn) + + def populate_result(self): + try: + self.result['replicas'] = [str(replica) for replica in self.decoded_response] if self.decoded_response else None + except TypeError: + self.result['replicas'] = None diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/nmasGetUniversalPassword.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/nmasGetUniversalPassword.py new file mode 100644 index 0000000000000000000000000000000000000000..291ae9218b1cda4e7e5da4008b3396269bcff966 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/nmasGetUniversalPassword.py @@ -0,0 +1,56 @@ +""" +""" + +# Created on 2014.07.03 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...extend.operation import ExtendedOperation +from ...protocol.novell import NmasGetUniversalPasswordRequestValue, NmasGetUniversalPasswordResponseValue, NMAS_LDAP_EXT_VERSION +from ...utils.dn import safe_dn + + +class NmasGetUniversalPassword(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.39.42.100.13' + self.response_name = '2.16.840.1.113719.1.39.42.100.14' + self.request_value = NmasGetUniversalPasswordRequestValue() + self.asn1_spec = NmasGetUniversalPasswordResponseValue() + self.response_attribute = 'password' + + def __init__(self, connection, user, controls=None): + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + + if connection.check_names: + user = safe_dn(user) + + self.request_value['nmasver'] = NMAS_LDAP_EXT_VERSION + self.request_value['reqdn'] = user + + def populate_result(self): + if self.decoded_response: + self.result['nmasver'] = int(self.decoded_response['nmasver']) + self.result['error'] = int(self.decoded_response['err']) + try: + + self.result['password'] = str(self.decoded_response['passwd']) if self.decoded_response['passwd'].hasValue() else None + except TypeError: + self.result['password'] = None diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/nmasSetUniversalPassword.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/nmasSetUniversalPassword.py new file mode 100644 index 0000000000000000000000000000000000000000..dadab59c11843d3f9aaa943741459c8b61a048da --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/nmasSetUniversalPassword.py @@ -0,0 +1,52 @@ +""" +""" + +# Created on 2014.07.03 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...extend.operation import ExtendedOperation +from ...protocol.novell import NmasSetUniversalPasswordRequestValue, NmasSetUniversalPasswordResponseValue, NMAS_LDAP_EXT_VERSION +from ...utils.dn import safe_dn + + +class NmasSetUniversalPassword(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.39.42.100.11' + self.response_name = '2.16.840.1.113719.1.39.42.100.12' + self.request_value = NmasSetUniversalPasswordRequestValue() + self.asn1_spec = NmasSetUniversalPasswordResponseValue() + self.response_attribute = 'password' + + def __init__(self, connection, user, new_password, controls=None): + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + if connection.check_names and user: + user = safe_dn(user) + + self.request_value['nmasver'] = NMAS_LDAP_EXT_VERSION + if user: + self.request_value['reqdn'] = user + if new_password: + self.request_value['new_passwd'] = new_password + + def populate_result(self): + self.result['nmasver'] = int(self.decoded_response['nmasver']) + self.result['error'] = int(self.decoded_response['err']) diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/partition_entry_count.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/partition_entry_count.py new file mode 100644 index 0000000000000000000000000000000000000000..3d46c7ae925ae27aa6ea1bc45415bcfce4e552d1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/partition_entry_count.py @@ -0,0 +1,57 @@ +""" +""" + +# Created on 2014.08.05 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1.type.univ import Integer + +from ...core.exceptions import LDAPExtensionError +from ..operation import ExtendedOperation +from ...protocol.rfc4511 import LDAPDN +from ...utils.asn1 import decoder +from ...utils.dn import safe_dn + + +class PartitionEntryCount(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.27.100.13' + self.response_name = '2.16.840.1.113719.1.27.100.14' + self.request_value = LDAPDN() + self.response_attribute = 'entry_count' + + def __init__(self, connection, partition_dn, controls=None): + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + if connection.check_names: + partition_dn = safe_dn(partition_dn) + self.request_value = LDAPDN(partition_dn) + + def populate_result(self): + substrate = self.decoded_response + try: + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['entry_count'] = int(decoded) + except Exception: + raise LDAPExtensionError('unable to decode substrate') + + if substrate: + raise LDAPExtensionError('unknown substrate remaining') diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/removeMembersFromGroups.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/removeMembersFromGroups.py new file mode 100644 index 0000000000000000000000000000000000000000..5736079a1318736316ca30fd1000269d18c8d59e --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/removeMembersFromGroups.py @@ -0,0 +1,170 @@ +""" +""" + +# Created on 2016.04.17 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from ...core.exceptions import LDAPInvalidDnError +from ... import SEQUENCE_TYPES, MODIFY_DELETE, BASE, DEREF_NEVER +from ...utils.dn import safe_dn + + +def edir_remove_members_from_groups(connection, + members_dn, + groups_dn, + fix, + transaction): + """ + :param connection: a bound Connection object + :param members_dn: the list of members to remove from groups + :param groups_dn: the list of groups where members are to be removed + :param fix: checks for inconsistences in the users-groups relation and fixes them + :param transaction: activates an LDAP transaction + :return: a boolean where True means that the operation was successful and False means an error has happened + Removes users-groups relations following the eDirectory rules: groups are removed from securityEquals and groupMembership + attributes in the member object while members are removed from member and equivalentToMe attributes in the group object. + Raises LDAPInvalidDnError if members or groups are not found in the DIT. + + """ + if not isinstance(members_dn, SEQUENCE_TYPES): + members_dn = [members_dn] + + if not isinstance(groups_dn, SEQUENCE_TYPES): + groups_dn = [groups_dn] + + if connection.check_names: # builds new lists with sanitized dn + safe_members_dn = [] + safe_groups_dn = [] + for member_dn in members_dn: + safe_members_dn.append(safe_dn(member_dn)) + for group_dn in groups_dn: + safe_groups_dn.append(safe_dn(group_dn)) + + members_dn = safe_members_dn + groups_dn = safe_groups_dn + + transaction_control = None + error = False + + if transaction: + transaction_control = connection.extend.novell.start_transaction() + + if not error: + for member in members_dn: + if fix: # checks for existance of member and for already assigned groups + result = connection.search(member, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['securityEquals', 'groupMembership']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = connection.response + result = connection.result + + if not result['description'] == 'success': + raise LDAPInvalidDnError(member + ' not found') + + existing_security_equals = response[0]['attributes']['securityEquals'] if 'securityEquals' in response[0]['attributes'] else [] + existing_group_membership = response[0]['attributes']['groupMembership'] if 'groupMembership' in response[0]['attributes'] else [] + else: + existing_security_equals = groups_dn + existing_group_membership = groups_dn + existing_security_equals = [element.lower() for element in existing_security_equals] + existing_group_membership = [element.lower() for element in existing_group_membership] + + changes = dict() + security_equals_to_remove = [element for element in groups_dn if element.lower() in existing_security_equals] + group_membership_to_remove = [element for element in groups_dn if element.lower() in existing_group_membership] + if security_equals_to_remove: + changes['securityEquals'] = (MODIFY_DELETE, security_equals_to_remove) + if group_membership_to_remove: + changes['groupMembership'] = (MODIFY_DELETE, group_membership_to_remove) + if changes: + result = connection.modify(member, changes, controls=[transaction_control] if transaction else None) + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + if result['description'] != 'success': + error = True + break + + if not error: + for group in groups_dn: + if fix: # checks for existance of group and for already assigned members + result = connection.search(group, '(objectclass=*)', BASE, dereference_aliases=DEREF_NEVER, attributes=['member', 'equivalentToMe']) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = connection.response + result = connection.result + + if not result['description'] == 'success': + raise LDAPInvalidDnError(group + ' not found') + + existing_members = response[0]['attributes']['member'] if 'member' in response[0]['attributes'] else [] + existing_equivalent_to_me = response[0]['attributes']['equivalentToMe'] if 'equivalentToMe' in response[0]['attributes'] else [] + else: + existing_members = members_dn + existing_equivalent_to_me = members_dn + + existing_members = [element.lower() for element in existing_members] + existing_equivalent_to_me = [element.lower() for element in existing_equivalent_to_me] + + changes = dict() + member_to_remove = [element for element in members_dn if element.lower() in existing_members] + equivalent_to_me_to_remove = [element for element in members_dn if element.lower() in existing_equivalent_to_me] + if member_to_remove: + changes['member'] = (MODIFY_DELETE, member_to_remove) + if equivalent_to_me_to_remove: + changes['equivalentToMe'] = (MODIFY_DELETE, equivalent_to_me_to_remove) + if changes: + result = connection.modify(group, changes, controls=[transaction_control] if transaction else None) + if not connection.strategy.sync: + _, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, _, _ = result + else: + result = connection.result + if result['description'] != 'success': + error = True + break + + if transaction: + if error: # aborts transaction in case of error in the modify operations + result = connection.extend.novell.end_transaction(commit=False, controls=[transaction_control]) + else: + result = connection.extend.novell.end_transaction(commit=True, controls=[transaction_control]) + + if result['description'] != 'success': + error = True + + return not error # return True if no error is raised in the LDAP operations diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/replicaInfo.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/replicaInfo.py new file mode 100644 index 0000000000000000000000000000000000000000..057f934206f8a0ef87125a31e2c8522e9f157da8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/replicaInfo.py @@ -0,0 +1,79 @@ +""" +""" + +# Created on 2014.08.07 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from datetime import datetime + +from pyasn1.type.univ import Integer + +from ...core.exceptions import LDAPExtensionError +from ...protocol.novell import LDAPDN, ReplicaInfoRequestValue +from ..operation import ExtendedOperation +from ...utils.asn1 import decoder +from ...utils.dn import safe_dn + + +class ReplicaInfo(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.27.100.17' + self.response_name = '2.16.840.1.113719.1.27.100.18' + # self.asn1_spec = ReplicaInfoResponseValue() + self.request_value = ReplicaInfoRequestValue() + self.response_attribute = 'partition_dn' + + def __init__(self, connection, server_dn, partition_dn, controls=None): + if connection.check_names: + if server_dn: + server_dn = safe_dn(server_dn) + if partition_dn: + partition_dn = safe_dn(partition_dn) + + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + self.request_value['server_dn'] = server_dn + self.request_value['partition_dn'] = partition_dn + + def populate_result(self): + substrate = self.decoded_response + try: + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['partition_id'] = int(decoded) + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['replica_state'] = int(decoded) + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['modification_time'] = datetime.utcfromtimestamp(int(decoded)) + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['purge_time'] = datetime.utcfromtimestamp(int(decoded)) + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['local_partition_id'] = int(decoded) + decoded, substrate = decoder.decode(substrate, asn1Spec=LDAPDN()) + self.result['partition_dn'] = str(decoded) + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['replica_type'] = int(decoded) + decoded, substrate = decoder.decode(substrate, asn1Spec=Integer()) + self.result['flags'] = int(decoded) + except Exception: + raise LDAPExtensionError('unable to decode substrate') + + if substrate: + raise LDAPExtensionError('unknown substrate remaining') diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/novell/startTransaction.py b/python/user_packages/Python313/site-packages/ldap3/extend/novell/startTransaction.py new file mode 100644 index 0000000000000000000000000000000000000000..6179cb03e293d8cc01e20669baec86831447ced0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/novell/startTransaction.py @@ -0,0 +1,56 @@ +""" +""" + +# Created on 2016.04.14 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...extend.operation import ExtendedOperation +from ...protocol.novell import CreateGroupTypeRequestValue, CreateGroupTypeResponseValue, GroupingControlValue +from ...protocol.controls import build_control + + +class StartTransaction(ExtendedOperation): + def config(self): + self.request_name = '2.16.840.1.113719.1.27.103.1' + self.response_name = '2.16.840.1.113719.1.27.103.1' + self.request_value = CreateGroupTypeRequestValue() + self.asn1_spec = CreateGroupTypeResponseValue() + + def __init__(self, connection, controls=None): + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + self.request_value['createGroupType'] = '2.16.840.1.113719.1.27.103.7' # transactionGroupingType + + def populate_result(self): + self.result['cookie'] = int(self.decoded_response['createGroupCookie']) + try: + self.result['value'] = self.decoded_response['createGroupValue'] + except TypeError: + self.result['value'] = None + + def set_response(self): + try: + grouping_cookie_value = GroupingControlValue() + grouping_cookie_value['groupingCookie'] = self.result['cookie'] + self.response_value = build_control('2.16.840.1.113719.1.27.103.7', True, grouping_cookie_value, encode_control_value=True) # groupingControl + except TypeError: + self.response_value = None + diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/operation.py b/python/user_packages/Python313/site-packages/ldap3/extend/operation.py new file mode 100644 index 0000000000000000000000000000000000000000..fcfdad40b9f71eb31bc79a65eda762af8b3d1ae9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/operation.py @@ -0,0 +1,98 @@ +""" +""" + +# Created on 2014.07.04 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..core.results import RESULT_SUCCESS +from ..core.exceptions import LDAPExtensionError +from ..utils.asn1 import decoder + + +class ExtendedOperation(object): + def __init__(self, connection, controls=None): + self.connection = connection + self.decoded_response = None + self.result = None + self.asn1_spec = None # if None the response_value is returned without encoding + self.request_name = None + self.response_name = None + self.request_value = None + self.response_value = None + self.response_attribute = None + self.controls = controls + self.config() + + def send(self): + if self.connection.check_names and self.connection.server.info is not None and self.connection.server.info.supported_extensions is not None: # checks if extension is supported + for request_name in self.connection.server.info.supported_extensions: + if request_name[0] == self.request_name: + break + else: + raise LDAPExtensionError('extension not in DSA list of supported extensions') + + resp = self.connection.extended(self.request_name, self.request_value, self.controls) + if not self.connection.strategy.sync: + _, result = self.connection.get_response(resp) + else: + if self.connection.strategy.thread_safe: + _, result, _, _ = resp + else: + result = self.connection.result + self.result = result + self.decode_response(result) + self.populate_result() + self.set_response() + return self.response_value + + def populate_result(self): + pass + + def decode_response(self, response=None): + if not response: + response = self.result + if not response: + return None + if response['result'] not in [RESULT_SUCCESS]: + if self.connection.raise_exceptions: + raise LDAPExtensionError('extended operation error: ' + response['description'] + ' - ' + response['message']) + else: + return None + if not self.response_name or response['responseName'] == self.response_name: + if response['responseValue']: + if self.asn1_spec is not None: + decoded, unprocessed = decoder.decode(response['responseValue'], asn1Spec=self.asn1_spec) + if unprocessed: + raise LDAPExtensionError('error decoding extended response value') + self.decoded_response = decoded + else: + self.decoded_response = response['responseValue'] + else: + raise LDAPExtensionError('invalid response name received') + + def set_response(self): + self.response_value = self.result[self.response_attribute] if self.result and self.response_attribute in self.result else None + if not self.connection.strategy.thread_safe: + self.connection.response = self.response_value + + def config(self): + pass diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/PagedSearch.py b/python/user_packages/Python313/site-packages/ldap3/extend/standard/PagedSearch.py new file mode 100644 index 0000000000000000000000000000000000000000..a0f986ec3a7e80d01c086fcfe2f3ce1666b152d7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/standard/PagedSearch.py @@ -0,0 +1,146 @@ +""" +""" + +# Created on 2014.07.08 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ... import SUBTREE, DEREF_ALWAYS +from ...utils.dn import safe_dn +from ...core.results import DO_NOT_RAISE_EXCEPTIONS, RESULT_SIZE_LIMIT_EXCEEDED +from ...core.exceptions import LDAPOperationResult +from ...utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, NETWORK, EXTENDED + + +def paged_search_generator(connection, + search_base, + search_filter, + search_scope=SUBTREE, + dereference_aliases=DEREF_ALWAYS, + attributes=None, + size_limit=0, + time_limit=0, + types_only=False, + get_operational_attributes=False, + controls=None, + paged_size=100, + paged_criticality=False): + if connection.check_names and search_base: + search_base = safe_dn(search_base) + + responses = [] + original_connection = None + original_auto_referrals = connection.auto_referrals + connection.auto_referrals = False # disable auto referrals because it cannot handle paged searches + cookie = True # performs search operation at least one time + cachekey = None # for referrals cache + while cookie: + result = connection.search(search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + get_operational_attributes, + controls, + paged_size, + paged_criticality, + None if cookie is True else cookie) + + if not connection.strategy.sync: + response, result = connection.get_response(result) + else: + if connection.strategy.thread_safe: + _, result, response, _ = result + else: + response = connection.response + result = connection.result + + if result['referrals'] and original_auto_referrals: # if rererrals are returned start over the loop with a new connection to the referral + if not original_connection: + original_connection = connection + _, connection, cachekey = connection.strategy.create_referral_connection(result['referrals']) # change connection to a valid referrals + continue + + responses.extend(response) + try: + cookie = result['controls']['1.2.840.113556.1.4.319']['value']['cookie'] + except KeyError: + cookie = None + + if connection.raise_exceptions and result and result['result'] not in DO_NOT_RAISE_EXCEPTIONS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'paged search operation result <%s> for <%s>', result, connection) + if result['result'] == RESULT_SIZE_LIMIT_EXCEEDED: + while responses: + yield responses.pop() + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + + while responses: + yield responses.pop() + + if original_connection: + connection = original_connection + if connection.use_referral_cache and cachekey: + connection.strategy.referral_cache[cachekey] = connection + else: + connection.unbind() + + connection.auto_referrals = original_auto_referrals + connection.response = None + + +def paged_search_accumulator(connection, + search_base, + search_filter, + search_scope=SUBTREE, + dereference_aliases=DEREF_ALWAYS, + attributes=None, + size_limit=0, + time_limit=0, + types_only=False, + get_operational_attributes=False, + controls=None, + paged_size=100, + paged_criticality=False): + if connection.check_names and search_base: + search_base = safe_dn(search_base) + + responses = [] + for response in paged_search_generator(connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + get_operational_attributes, + controls, + paged_size, + paged_criticality): + responses.append(response) + + connection.response = responses + return responses diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/PersistentSearch.py b/python/user_packages/Python313/site-packages/ldap3/extend/standard/PersistentSearch.py new file mode 100644 index 0000000000000000000000000000000000000000..b25ec68e918d8bfaca4b9852938e0abf4cba2d2f --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/standard/PersistentSearch.py @@ -0,0 +1,137 @@ +""" +""" + +# Created on 2016.07.08 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +try: + from queue import Empty +except ImportError: # Python 2 + # noinspection PyUnresolvedReferences + from Queue import Empty + +from ...core.exceptions import LDAPExtensionError +from ...protocol.persistentSearch import persistent_search_control +from ... import SEQUENCE_TYPES +from ...utils.dn import safe_dn + + +class PersistentSearch(object): + 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 + ): + if connection.strategy.sync: + raise LDAPExtensionError('Persistent Search needs an asynchronous streaming connection') + + if connection.check_names and search_base: + search_base = safe_dn(search_base) + + self.connection = connection + self.changes_only = changes_only + self.notifications = notifications + self.message_id = None + self.base = search_base + self.filter = search_filter + self.scope = search_scope + self.dereference_aliases = dereference_aliases + self.attributes = attributes + self.size_limit = size_limit + self.time_limit = time_limit + self.connection.strategy.streaming = streaming + if callback and callable(callback): + self.connection.strategy.callback = callback + elif callback: + raise LDAPExtensionError('callback is not callable') + + if not isinstance(controls, SEQUENCE_TYPES): + self.controls = [] + else: + self.controls = controls + + if events_type and changes_only and notifications: + self.controls.append(persistent_search_control(events_type, changes_only, notifications)) + self.start() + + def start(self): + if self.message_id: # persistent search already started + return + + if not self.connection.bound: + self.connection.bind() + + with self.connection.strategy.async_lock: + self.message_id = self.connection.search(search_base=self.base, + search_filter=self.filter, + search_scope=self.scope, + dereference_aliases=self.dereference_aliases, + attributes=self.attributes, + size_limit=self.size_limit, + time_limit=self.time_limit, + controls=self.controls) + self.connection.strategy.persistent_search_message_id = self.message_id + + def stop(self, unbind=True): + self.connection.abandon(self.message_id) + if unbind: + self.connection.unbind() + if self.message_id in self.connection.strategy._responses: + del self.connection.strategy._responses[self.message_id] + if hasattr(self.connection.strategy, '_requests') and self.message_id in self.connection.strategy._requests: # asynchronous strategy has a dict of request that could be returned by get_response() + del self.connection.strategy._requests[self.message_id] + self.connection.strategy.persistent_search_message_id = None + self.message_id = None + + def next(self, block=False, timeout=None): + if not self.connection.strategy.streaming and not self.connection.strategy.callback: + try: + return self.connection.strategy.events.get(block, timeout) + except Empty: + return None + + raise LDAPExtensionError('Persistent search is not accumulating events in queue') + + def funnel(self, block=False, timeout=None): + done = False + while not done: + try: + entry = self.connection.strategy.events.get(block, timeout) + except Empty: + yield None + if entry['type'] == 'searchResEntry': + yield entry + else: + done = True + + yield entry diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/__init__.py b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/PagedSearch.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/PagedSearch.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8b1e1f635ca76cf5790b1588b50cf785d8f765c Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/PagedSearch.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/PersistentSearch.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/PersistentSearch.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..549dfa424348ec351ea9e4350bd76acda9aedab6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/PersistentSearch.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b354b7e15396a5245ed7fb82592895f450c53590 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/modifyPassword.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/modifyPassword.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb5bec0f200d625b6d9d583074722099986a0d5b Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/modifyPassword.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/whoAmI.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/whoAmI.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdfe18b2045274ff501d74ee4da12516addaeb74 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/extend/standard/__pycache__/whoAmI.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/modifyPassword.py b/python/user_packages/Python313/site-packages/ldap3/extend/standard/modifyPassword.py new file mode 100644 index 0000000000000000000000000000000000000000..7837355dcdb40c57cdd10307d7f67b1e320b12f0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/standard/modifyPassword.py @@ -0,0 +1,72 @@ +""" +""" + +# Created on 2014.04.30 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ... import HASHED_NONE +from ...extend.operation import ExtendedOperation +from ...protocol.rfc3062 import PasswdModifyRequestValue, PasswdModifyResponseValue +from ...utils.hashed import hashed +from ...protocol.sasl.sasl import validate_simple_password +from ...utils.dn import safe_dn +from ...core.results import RESULT_SUCCESS + +# implements RFC3062 + + +class ModifyPassword(ExtendedOperation): + def config(self): + self.request_name = '1.3.6.1.4.1.4203.1.11.1' + self.request_value = PasswdModifyRequestValue() + self.asn1_spec = PasswdModifyResponseValue() + self.response_attribute = 'new_password' + + def __init__(self, connection, user=None, old_password=None, new_password=None, hash_algorithm=None, salt=None, controls=None): + ExtendedOperation.__init__(self, connection, controls) # calls super __init__() + if user: + if connection.check_names: + user = safe_dn(user) + self.request_value['userIdentity'] = user + if old_password: + if not isinstance(old_password, bytes): # bytes are returned raw, as per RFC (4.2) + old_password = validate_simple_password(old_password, True) + self.request_value['oldPasswd'] = old_password + if new_password: + if not isinstance(new_password, bytes): # bytes are returned raw, as per RFC (4.2) + new_password = validate_simple_password(new_password, True) + if hash_algorithm is None or hash_algorithm == HASHED_NONE: + self.request_value['newPasswd'] = new_password + else: + self.request_value['newPasswd'] = hashed(hash_algorithm, new_password, salt) + + def populate_result(self): + try: + self.result[self.response_attribute] = str(self.decoded_response['genPasswd']) + except TypeError: # optional field can be absent, so returns True if operation is successful else False + if self.result['result'] == RESULT_SUCCESS: + self.result[self.response_attribute] = True + else: # change was not successful, raises exception if raise_exception = True in connection or returns the operation result, error code is in result['result'] + self.result[self.response_attribute] = False + if self.connection.raise_exceptions: + from ...core.exceptions import LDAPOperationResult + raise LDAPOperationResult(result=self.result['result'], description=self.result['description'], dn=self.result['dn'], message=self.result['message'], response_type=self.result['type']) diff --git a/python/user_packages/Python313/site-packages/ldap3/extend/standard/whoAmI.py b/python/user_packages/Python313/site-packages/ldap3/extend/standard/whoAmI.py new file mode 100644 index 0000000000000000000000000000000000000000..a6c08a89423d576f66a529e0377f130bbc8117a8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/extend/standard/whoAmI.py @@ -0,0 +1,40 @@ +""" +""" + +# Created on 2014.04.30 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +# implements RFC4532 +from ...extend.operation import ExtendedOperation +from ...utils.conv import to_unicode + + +class WhoAmI(ExtendedOperation): + def config(self): + self.request_name = '1.3.6.1.4.1.4203.1.11.3' + self.response_attribute = 'authzid' + + def populate_result(self): + try: + self.result['authzid'] = to_unicode(self.decoded_response) if self.decoded_response else None + except TypeError: + self.result['authzid'] = self.decoded_response if self.decoded_response else None diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__init__.py b/python/user_packages/Python313/site-packages/ldap3/operation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28062cb88aac283fd1c6357c9583de936246167e Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/abandon.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/abandon.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dfff252abe40909fbd2b1b0ec3026c90bbc8f387 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/abandon.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/add.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/add.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2dcf9ff1412a213a40240990a34e64f9176e9b83 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/add.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/bind.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/bind.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e704326d9729a8ea7d552125c99527a376dd9edf Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/bind.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/compare.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/compare.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be3e8dc49ab49afe9ccb89572c2a14f137b9eb91 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/compare.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/delete.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/delete.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..840838c3a11172f163a9a85d45abe5eb1a542f7e Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/delete.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/extended.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/extended.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c28077302587ab3ec19764854c32b774afdec4a Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/extended.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/modify.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/modify.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c137cd4120dbe507b1f8735e23d9788246ae904a Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/modify.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/modifyDn.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/modifyDn.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..694d21a83a983ed82e30661a1ffa5e165b347c0d Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/modifyDn.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/search.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/search.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3741eac24f2b51f4aad3c0aca9b2ccc035ca4095 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/search.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/unbind.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/unbind.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5f08428bbe7a3da6f43f2a3883fa2a4c92f0ece Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/operation/__pycache__/unbind.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/abandon.py b/python/user_packages/Python313/site-packages/ldap3/operation/abandon.py new file mode 100644 index 0000000000000000000000000000000000000000..66fcb6c9ae0d27984e27f0a4e7f581ba7ea3c493 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/abandon.py @@ -0,0 +1,36 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..protocol.rfc4511 import AbandonRequest, MessageID + + +def abandon_operation(msg_id): + # AbandonRequest ::= [APPLICATION 16] MessageID + request = AbandonRequest(MessageID(msg_id)) + return request + + +def abandon_request_to_dict(request): + return {'messageId': str(request)} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/add.py b/python/user_packages/Python313/site-packages/ldap3/operation/add.py new file mode 100644 index 0000000000000000000000000000000000000000..d0b95b4ace3abef69507de0043021a5f646da37f --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/add.py @@ -0,0 +1,72 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import SEQUENCE_TYPES +from ..protocol.rfc4511 import AddRequest, LDAPDN, AttributeList, Attribute, AttributeDescription, ResultCode, Vals +from ..protocol.convert import referrals_to_list, attributes_to_dict, validate_attribute_value, prepare_for_sending + + +def add_operation(dn, + attributes, + auto_encode, + schema=None, + validator=None, + check_names=False): + # AddRequest ::= [APPLICATION 8] SEQUENCE { + # entry LDAPDN, + # attributes AttributeList } + # + # attributes is a dictionary in the form 'attribute': ['val1', 'val2', 'valN'] + attribute_list = AttributeList() + for pos, attribute in enumerate(attributes): + attribute_list[pos] = Attribute() + attribute_list[pos]['type'] = AttributeDescription(attribute) + vals = Vals() # changed from ValsAtLeast1() for allowing empty member value in groups + if isinstance(attributes[attribute], SEQUENCE_TYPES): + for index, value in enumerate(attributes[attribute]): + vals.setComponentByPosition(index, prepare_for_sending(validate_attribute_value(schema, attribute, value, auto_encode, validator, check_names))) + else: + vals.setComponentByPosition(0, prepare_for_sending(validate_attribute_value(schema, attribute, attributes[attribute], auto_encode, validator, check_names))) + + attribute_list[pos]['vals'] = vals + + request = AddRequest() + request['entry'] = LDAPDN(dn) + request['attributes'] = attribute_list + + return request + + +def add_request_to_dict(request): + return {'entry': str(request['entry']), + 'attributes': attributes_to_dict(request['attributes'])} + + +def add_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'dn': str(response['matchedDN']), + 'message': str(response['diagnosticMessage']), + 'referrals': referrals_to_list(response['referral'])} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/bind.py b/python/user_packages/Python313/site-packages/ldap3/operation/bind.py new file mode 100644 index 0000000000000000000000000000000000000000..43ad1fb02af6552ff1d4813d9953efbab4acad79 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/bind.py @@ -0,0 +1,160 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import SIMPLE, ANONYMOUS, SASL, STRING_TYPES +from ..core.results import RESULT_CODES +from ..core.exceptions import LDAPUserNameIsMandatoryError, LDAPPasswordIsMandatoryError, LDAPUnknownAuthenticationMethodError, LDAPUserNameNotAllowedError +from ..protocol.sasl.sasl import validate_simple_password +from ..protocol.rfc4511 import Version, AuthenticationChoice, Simple, BindRequest, ResultCode, SaslCredentials, BindResponse, \ + LDAPDN, LDAPString, Referral, ServerSaslCreds, SicilyPackageDiscovery, SicilyNegotiate, SicilyResponse +from ..protocol.convert import authentication_choice_to_dict, referrals_to_list +from ..utils.conv import to_unicode, to_raw + +# noinspection PyUnresolvedReferences +def bind_operation(version, + authentication, + name='', + password=None, + sasl_mechanism=None, + sasl_credentials=None, + auto_encode=False): + # BindRequest ::= [APPLICATION 0] SEQUENCE { + # version INTEGER (1 .. 127), + # name LDAPDN, + # authentication AuthenticationChoice } + request = BindRequest() + request['version'] = Version(version) + if name is None: + name = '' + if isinstance(name, STRING_TYPES): + request['name'] = to_unicode(name) if auto_encode else name + if authentication == SIMPLE: + if not name: + raise LDAPUserNameIsMandatoryError('user name is mandatory in simple bind') + if password: + request['authentication'] = AuthenticationChoice().setComponentByName('simple', Simple(validate_simple_password(password))) + else: + raise LDAPPasswordIsMandatoryError('password is mandatory in simple bind') + elif authentication == SASL: + sasl_creds = SaslCredentials() + sasl_creds['mechanism'] = sasl_mechanism + if sasl_credentials is not None: + sasl_creds['credentials'] = sasl_credentials + # else: + # sasl_creds['credentials'] = None + request['authentication'] = AuthenticationChoice().setComponentByName('sasl', sasl_creds) + elif authentication == ANONYMOUS: + if name: + raise LDAPUserNameNotAllowedError('user name not allowed in anonymous bind') + request['name'] = '' + request['authentication'] = AuthenticationChoice().setComponentByName('simple', Simple('')) + elif authentication == 'SICILY_PACKAGE_DISCOVERY': # https://msdn.microsoft.com/en-us/library/cc223501.aspx + request['name'] = '' + request['authentication'] = AuthenticationChoice().setComponentByName('sicilyPackageDiscovery', SicilyPackageDiscovery('')) + elif authentication == 'SICILY_NEGOTIATE_NTLM': # https://msdn.microsoft.com/en-us/library/cc223501.aspx + request['name'] = 'NTLM' + request['authentication'] = AuthenticationChoice().setComponentByName('sicilyNegotiate', SicilyNegotiate(name.create_negotiate_message())) # ntlm client in self.name + elif authentication == 'SICILY_RESPONSE_NTLM': # https://msdn.microsoft.com/en-us/library/cc223501.aspx + name.parse_challenge_message(password) # server_creds returned by server in password + server_creds = name.create_authenticate_message() + if server_creds: + request['name'] = '' + request['authentication'] = AuthenticationChoice().setComponentByName('sicilyResponse', SicilyResponse(server_creds)) + else: + request = None + else: + raise LDAPUnknownAuthenticationMethodError('unknown authentication method') + + return request + + +def bind_request_to_dict(request): + return {'version': int(request['version']), + 'name': str(request['name']), + 'authentication': authentication_choice_to_dict(request['authentication'])} + + +def bind_response_operation(result_code, + matched_dn='', + diagnostic_message='', + referral=None, + server_sasl_credentials=None): + # BindResponse ::= [APPLICATION 1] SEQUENCE { + # COMPONENTS OF LDAPResult, + # serverSaslCreds [7] OCTET STRING OPTIONAL } + response = BindResponse() + response['resultCode'] = ResultCode(result_code) + response['matchedDN'] = LDAPDN(matched_dn) + response['diagnosticMessage'] = LDAPString(diagnostic_message) + if referral: + response['referral'] = Referral(referral) + + if server_sasl_credentials: + response['serverSaslCreds'] = ServerSaslCreds(server_sasl_credentials) + + return response + + +def bind_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'dn': str(response['matchedDN']), + 'message': str(response['diagnosticMessage']), + 'referrals': referrals_to_list(response['referral']) if response['referral'] is not None and response['referral'].hasValue() else [], + 'saslCreds': bytes(response['serverSaslCreds']) if response['serverSaslCreds'] is not None and response['serverSaslCreds'].hasValue() else None} + + +def sicily_bind_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'server_creds': bytes(response['matchedDN']), + 'error_message': str(response['diagnosticMessage'])} + + +def bind_response_to_dict_fast(response): + response_dict = dict() + response_dict['result'] = int(response[0][3]) # resultCode + response_dict['description'] = RESULT_CODES[response_dict['result']] + response_dict['dn'] = to_unicode(response[1][3], from_server=True) # matchedDN + response_dict['message'] = to_unicode(response[2][3], from_server=True) # diagnosticMessage + response_dict['referrals'] = None # referrals + response_dict['saslCreds'] = None # saslCreds + for r in response[3:]: + if r[2] == 3: # referrals + response_dict['referrals'] = referrals_to_list(r[3]) # referrals + else: + response_dict['saslCreds'] = bytes(r[3]) # saslCreds + + return response_dict + + +def sicily_bind_response_to_dict_fast(response): + response_dict = dict() + response_dict['result'] = int(response[0][3]) # resultCode + response_dict['description'] = RESULT_CODES[response_dict['result']] + response_dict['server_creds'] = bytes(response[1][3]) # server_creds + response_dict['error_message'] = to_unicode(response[2][3], from_server=True) # error_message + + return response_dict diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/compare.py b/python/user_packages/Python313/site-packages/ldap3/operation/compare.py new file mode 100644 index 0000000000000000000000000000000000000000..2232f61ae752b67595e55d0cc5503a21b7e2002f --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/compare.py @@ -0,0 +1,64 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..protocol.convert import validate_attribute_value, prepare_for_sending +from ..protocol.rfc4511 import CompareRequest, AttributeValueAssertion, AttributeDescription, LDAPDN, AssertionValue, ResultCode +from ..operation.search import ava_to_dict +from ..operation.bind import referrals_to_list + + +def compare_operation(dn, + attribute, + value, + auto_encode, + schema=None, + validator=None, + check_names=False): + # CompareRequest ::= [APPLICATION 14] SEQUENCE { + # entry LDAPDN, + # ava AttributeValueAssertion } + ava = AttributeValueAssertion() + ava['attributeDesc'] = AttributeDescription(attribute) + ava['assertionValue'] = AssertionValue(prepare_for_sending(validate_attribute_value(schema, attribute, value, auto_encode, validator, check_names=check_names))) + + request = CompareRequest() + request['entry'] = LDAPDN(dn) + request['ava'] = ava + + return request + + +def compare_request_to_dict(request): + ava = ava_to_dict(request['ava']) + return {'entry': str(request['entry']), + 'attribute': ava['attribute'], + 'value': ava['value']} + + +def compare_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'dn': str(response['matchedDN']), 'message': str(response['diagnosticMessage']), + 'referrals': referrals_to_list(response['referral'])} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/delete.py b/python/user_packages/Python313/site-packages/ldap3/operation/delete.py new file mode 100644 index 0000000000000000000000000000000000000000..2db40f45ad81128bed7522017ac0f4084e3dc520 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/delete.py @@ -0,0 +1,46 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..protocol.rfc4511 import DelRequest, LDAPDN, ResultCode +from ..operation.bind import referrals_to_list + + +def delete_operation(dn): + # DelRequest ::= [APPLICATION 10] LDAPDN + request = DelRequest(LDAPDN(dn)) + + return request + + +def delete_request_to_dict(request): + return {'entry': str(request)} + + +def delete_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'dn': str(response['matchedDN']), + 'message': str(response['diagnosticMessage']), + 'referrals': referrals_to_list(response['referral'])} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/extended.py b/python/user_packages/Python313/site-packages/ldap3/operation/extended.py new file mode 100644 index 0000000000000000000000000000000000000000..4b1ebc7f68dc98bbfee475eb26cb7ba6e9e749bb --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/extended.py @@ -0,0 +1,109 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1.type.univ import OctetString +from pyasn1.type.base import Asn1Item + +from ..core.results import RESULT_CODES +from ..protocol.rfc4511 import ExtendedRequest, RequestName, ResultCode, RequestValue +from ..protocol.convert import referrals_to_list +from ..utils.asn1 import encode +from ..utils.conv import to_unicode + +# ExtendedRequest ::= [APPLICATION 23] SEQUENCE { +# requestName [0] LDAPOID, +# requestValue [1] OCTET STRING OPTIONAL } + + +def extended_operation(request_name, + request_value=None, + no_encode=None): + request = ExtendedRequest() + request['requestName'] = RequestName(request_name) + if request_value and isinstance(request_value, Asn1Item): + request['requestValue'] = RequestValue(encode(request_value)) + elif str is not bytes and isinstance(request_value, (bytes, bytearray)): # in Python 3 doesn't try to encode a byte value + request['requestValue'] = request_value + elif request_value and no_encode: # doesn't encode the value + request['requestValue'] = request_value + elif request_value: # tries to encode as a octet string + request['requestValue'] = RequestValue(encode(OctetString(str(request_value)))) + + # elif request_value is not None: + # raise LDAPExtensionError('unable to encode value for extended operation') + return request + + +def extended_request_to_dict(request): + # return {'name': str(request['requestName']), 'value': bytes(request['requestValue']) if request['requestValue'] else None} + return {'name': str(request['requestName']), 'value': bytes(request['requestValue']) if 'requestValue' in request and request['requestValue'] is not None and request['requestValue'].hasValue() else None} + +def extended_response_to_dict(response): + return {'result': int(response['resultCode']), + 'dn': str(response['matchedDN']), + 'message': str(response['diagnosticMessage']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'referrals': referrals_to_list(response['referral']), + 'responseName': str(response['responseName']) if response['responseName'] is not None and response['responseName'].hasValue() else str(), + 'responseValue': bytes(response['responseValue']) if response['responseValue'] is not None and response['responseValue'].hasValue() else bytes()} + + +def intermediate_response_to_dict(response): + return {'responseName': str(response['responseName']), + 'responseValue': bytes(response['responseValue']) if response['responseValue'] else bytes()} + + +def extended_response_to_dict_fast(response): + response_dict = dict() + response_dict['result'] = int(response[0][3]) # resultCode + response_dict['description'] = RESULT_CODES[response_dict['result']] + response_dict['dn'] = to_unicode(response[1][3], from_server=True) # matchedDN + response_dict['message'] = to_unicode(response[2][3], from_server=True) # diagnosticMessage + response_dict['referrals'] = None # referrals + response_dict['responseName'] = None # referrals + response_dict['responseValue'] = None # responseValue + + for r in response[3:]: + if r[2] == 3: # referrals + response_dict['referrals'] = referrals_to_list(r[3]) # referrals + elif r[2] == 10: # responseName + response_dict['responseName'] = to_unicode(r[3], from_server=True) + response_dict['responseValue'] = b'' # responseValue could be empty + + else: # responseValue (11) + response_dict['responseValue'] = bytes(r[3]) + + return response_dict + + +def intermediate_response_to_dict_fast(response): + response_dict = dict() + for r in response: + if r[2] == 0: # responseName + response_dict['responseName'] = to_unicode(r[3], from_server=True) + else: # responseValue (1) + response_dict['responseValue'] = bytes(r[3]) + + return response_dict diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/modify.py b/python/user_packages/Python313/site-packages/ldap3/operation/modify.py new file mode 100644 index 0000000000000000000000000000000000000000..31867e9fc1ad190f7afc35afbe76308aba820125 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/modify.py @@ -0,0 +1,96 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import SEQUENCE_TYPES, MODIFY_ADD, MODIFY_DELETE, MODIFY_REPLACE, MODIFY_INCREMENT +from ..protocol.rfc4511 import ModifyRequest, LDAPDN, Changes, Change, Operation, PartialAttribute, AttributeDescription, Vals, ResultCode +from ..operation.bind import referrals_to_list +from ..protocol.convert import changes_to_list, validate_attribute_value, prepare_for_sending + +# ModifyRequest ::= [APPLICATION 6] SEQUENCE { +# object LDAPDN, +# changes SEQUENCE OF change SEQUENCE { +# operation ENUMERATED { +# add (0), +# delete (1), +# replace (2), +# ... }, +# modification PartialAttribute } } + +change_table = {MODIFY_ADD: 0, # accepts actual values too + MODIFY_DELETE: 1, + MODIFY_REPLACE: 2, + MODIFY_INCREMENT: 3, + 0: 0, + 1: 1, + 2: 2, + 3: 3} + + +def modify_operation(dn, + changes, + auto_encode, + schema=None, + validator=None, + check_names=False): + # changes is a dictionary in the form {'attribute': [(operation, [val1, ...]), ...], ...} + # operation is 0 (add), 1 (delete), 2 (replace), 3 (increment) + # increment as per RFC4525 + + change_list = Changes() + pos = 0 + for attribute in changes: + for change_operation in changes[attribute]: + partial_attribute = PartialAttribute() + partial_attribute['type'] = AttributeDescription(attribute) + partial_attribute['vals'] = Vals() + if isinstance(change_operation[1], SEQUENCE_TYPES): + for index, value in enumerate(change_operation[1]): + partial_attribute['vals'].setComponentByPosition(index, prepare_for_sending(validate_attribute_value(schema, attribute, value, auto_encode, validator, check_names=check_names))) + else: + partial_attribute['vals'].setComponentByPosition(0, prepare_for_sending(validate_attribute_value(schema, attribute, change_operation[1], auto_encode, validator, check_names=check_names))) + change = Change() + change['operation'] = Operation(change_table[change_operation[0]]) + change['modification'] = partial_attribute + + change_list[pos] = change + pos += 1 + + request = ModifyRequest() + request['object'] = LDAPDN(dn) + request['changes'] = change_list + return request + + +def modify_request_to_dict(request): + return {'entry': str(request['object']), + 'changes': changes_to_list(request['changes'])} + + +def modify_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'message': str(response['diagnosticMessage']), + 'dn': str(response['matchedDN']), + 'referrals': referrals_to_list(response['referral'])} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/modifyDn.py b/python/user_packages/Python313/site-packages/ldap3/operation/modifyDn.py new file mode 100644 index 0000000000000000000000000000000000000000..73c6da38bd98f0be40e5f49a1fd05ba38b9eb125 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/modifyDn.py @@ -0,0 +1,62 @@ +""" +""" + +# Created on 2013.05.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..protocol.rfc4511 import ModifyDNRequest, LDAPDN, RelativeLDAPDN, DeleteOldRDN, NewSuperior, ResultCode +from ..operation.bind import referrals_to_list + +# ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { +# entry LDAPDN, +# newrdn RelativeLDAPDN, +# deleteoldrdn BOOLEAN, +# newSuperior [0] LDAPDN OPTIONAL } + + +def modify_dn_operation(dn, + new_relative_dn, + delete_old_rdn=True, + new_superior=None): + request = ModifyDNRequest() + request['entry'] = LDAPDN(dn) + request['newrdn'] = RelativeLDAPDN(new_relative_dn) + request['deleteoldrdn'] = DeleteOldRDN(delete_old_rdn) + if new_superior: + request['newSuperior'] = NewSuperior(new_superior) + + return request + + +def modify_dn_request_to_dict(request): + return {'entry': str(request['entry']), + 'newRdn': str(request['newrdn']), + 'deleteOldRdn': bool(request['deleteoldrdn']), + 'newSuperior': str(request['newSuperior']) if request['newSuperior'] is not None and request['newSuperior'].hasValue() else None} + + +def modify_dn_response_to_dict(response): + return {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'dn': str(response['matchedDN']), + 'referrals': referrals_to_list(response['referral']), + 'message': str(response['diagnosticMessage'])} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/search.py b/python/user_packages/Python313/site-packages/ldap3/operation/search.py new file mode 100644 index 0000000000000000000000000000000000000000..e12c13c170502a6fd7eb4565de3f3a5004523b94 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/search.py @@ -0,0 +1,579 @@ +""" +""" + +# Created on 2013.06.02 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from string import whitespace +from os import linesep + +from .. import DEREF_NEVER, BASE, LEVEL, SUBTREE, DEREF_SEARCH, DEREF_BASE, DEREF_ALWAYS, NO_ATTRIBUTES, SEQUENCE_TYPES, get_config_parameter, STRING_TYPES + +from ..core.exceptions import LDAPInvalidFilterError, LDAPAttributeError, LDAPInvalidScopeError, LDAPInvalidDereferenceAliasesError +from ..utils.ciDict import CaseInsensitiveDict +from ..protocol.rfc4511 import SearchRequest, LDAPDN, Scope, DerefAliases, Integer0ToMax, TypesOnly, \ + AttributeSelection, Selector, EqualityMatch, AttributeDescription, AssertionValue, Filter, \ + Not, And, Or, ApproxMatch, GreaterOrEqual, LessOrEqual, ExtensibleMatch, Present, SubstringFilter, \ + Substrings, Final, Initial, Any, ResultCode, Substring, MatchingRule, Type, MatchValue, DnAttributes +from ..operation.bind import referrals_to_list +from ..protocol.convert import ava_to_dict, attributes_to_list, search_refs_to_list, validate_assertion_value, prepare_filter_for_sending, search_refs_to_list_fast +from ..protocol.formatters.standard import format_attribute_values +from ..utils.conv import to_unicode, to_raw + +ROOT = 0 +AND = 1 +OR = 2 +NOT = 3 +MATCH_APPROX = 4 +MATCH_GREATER_OR_EQUAL = 5 +MATCH_LESS_OR_EQUAL = 6 +MATCH_EXTENSIBLE = 7 +MATCH_PRESENT = 8 +MATCH_SUBSTRING = 9 +MATCH_EQUAL = 10 + +SEARCH_OPEN = 20 +SEARCH_OPEN_OR_CLOSE = 21 +SEARCH_MATCH_OR_CLOSE = 22 +SEARCH_MATCH_OR_CONTROL = 23 + + +class FilterNode(object): + def __init__(self, tag=None, assertion=None): + self.tag = tag + self.parent = None + self.assertion = assertion + self.elements = [] + + def append(self, filter_node): + filter_node.parent = self + self.elements.append(filter_node) + return filter_node + + def __str__(self, pos=0): + self.__repr__(pos) + + def __repr__(self, pos=0): + node_tags = ['ROOT', 'AND', 'OR', 'NOT', 'MATCH_APPROX', 'MATCH_GREATER_OR_EQUAL', 'MATCH_LESS_OR_EQUAL', 'MATCH_EXTENSIBLE', 'MATCH_PRESENT', 'MATCH_SUBSTRING', 'MATCH_EQUAL'] + representation = ' ' * pos + 'tag: ' + node_tags[self.tag] + ' - assertion: ' + str(self.assertion) + if self.elements: + representation += ' - elements: ' + str(len(self.elements)) + for element in self.elements: + representation += linesep + ' ' * pos + element.__repr__(pos + 2) + return representation + + +def evaluate_match(match, schema, auto_escape, auto_encode, validator, check_names): + left_part, equal_sign, right_part = match.strip().partition('=') + if not equal_sign: + raise LDAPInvalidFilterError('invalid matching assertion') + if left_part.endswith('~'): # approximate match '~=' + tag = MATCH_APPROX + left_part = left_part[:-1].strip() + right_part = right_part.strip() + assertion = {'attr': left_part, 'value': validate_assertion_value(schema, left_part, right_part, auto_escape, auto_encode, validator, check_names)} + elif left_part.endswith('>'): # greater or equal match '>=' + tag = MATCH_GREATER_OR_EQUAL + left_part = left_part[:-1].strip() + right_part = right_part.strip() + assertion = {'attr': left_part, 'value': validate_assertion_value(schema, left_part, right_part, auto_escape, auto_encode, validator, check_names)} + elif left_part.endswith('<'): # less or equal match '<=' + tag = MATCH_LESS_OR_EQUAL + left_part = left_part[:-1].strip() + right_part = right_part.strip() + assertion = {'attr': left_part, 'value': validate_assertion_value(schema, left_part, right_part, auto_escape, auto_encode, validator, check_names)} + elif left_part.endswith(':'): # extensible match ':=' + tag = MATCH_EXTENSIBLE + left_part = left_part[:-1].strip() + right_part = right_part.strip() + extended_filter_list = left_part.split(':') + matching_rule = False + dn_attributes = False + attribute_name = False + if extended_filter_list[0] == '': # extensible filter format [:dn]:matchingRule:=assertionValue + if len(extended_filter_list) == 2 and extended_filter_list[1].lower().strip() != 'dn': + matching_rule = extended_filter_list[1] + elif len(extended_filter_list) == 3 and extended_filter_list[1].lower().strip() == 'dn': + dn_attributes = True + matching_rule = extended_filter_list[2] + else: + raise LDAPInvalidFilterError('invalid extensible filter') + elif len(extended_filter_list) <= 3: # extensible filter format attr[:dn][:matchingRule]:=assertionValue + if len(extended_filter_list) == 1: + attribute_name = extended_filter_list[0] + elif len(extended_filter_list) == 2: + attribute_name = extended_filter_list[0] + if extended_filter_list[1].lower().strip() == 'dn': + dn_attributes = True + else: + matching_rule = extended_filter_list[1] + elif len(extended_filter_list) == 3 and extended_filter_list[1].lower().strip() == 'dn': + attribute_name = extended_filter_list[0] + dn_attributes = True + matching_rule = extended_filter_list[2] + else: + raise LDAPInvalidFilterError('invalid extensible filter') + + if not attribute_name and not matching_rule: + raise LDAPInvalidFilterError('invalid extensible filter') + attribute_name = attribute_name.strip() if attribute_name else False + matching_rule = matching_rule.strip() if matching_rule else False + assertion = {'attr': attribute_name, 'value': validate_assertion_value(schema, attribute_name, right_part, auto_escape, auto_encode, validator, check_names), 'matchingRule': matching_rule, 'dnAttributes': dn_attributes} + elif right_part == '*': # attribute present match '=*' + tag = MATCH_PRESENT + left_part = left_part.strip() + assertion = {'attr': left_part} + elif '*' in right_part: # substring match '=initial*substring*substring*final' + tag = MATCH_SUBSTRING + left_part = left_part.strip() + right_part = right_part.strip() + substrings = right_part.split('*') + initial = validate_assertion_value(schema, left_part, substrings[0], auto_escape, auto_encode, validator, check_names) if substrings[0] else None + final = validate_assertion_value(schema, left_part, substrings[-1], auto_escape, auto_encode, validator, check_names) if substrings[-1] else None + any_string = [validate_assertion_value(schema, left_part, substring, auto_escape, auto_encode, validator, check_names) for substring in substrings[1:-1] if substring] + #assertion = {'attr': left_part, 'initial': initial, 'any': any_string, 'final': final} + assertion = {'attr': left_part} + if initial: + assertion['initial'] = initial + if any_string: + assertion['any'] = any_string + if final: + assertion['final'] = final + else: # equality match '=' + tag = MATCH_EQUAL + left_part = left_part.strip() + right_part = right_part.strip() + assertion = {'attr': left_part, 'value': validate_assertion_value(schema, left_part, right_part, auto_escape, auto_encode, validator, check_names)} + + return FilterNode(tag, assertion) + + +def parse_filter(search_filter, schema, auto_escape, auto_encode, validator, check_names): + if str is not bytes and isinstance(search_filter, bytes): # python 3 with byte filter + search_filter = to_unicode(search_filter) + search_filter = search_filter.strip() + if search_filter and search_filter.count('(') == search_filter.count(')') and search_filter.startswith('(') and search_filter.endswith(')'): + state = SEARCH_OPEN_OR_CLOSE + root = FilterNode(ROOT) + current_node = root + start_pos = None + skip_white_space = True + just_closed = False + for pos, c in enumerate(search_filter): + if skip_white_space and c in whitespace: + continue + elif (state == SEARCH_OPEN or state == SEARCH_OPEN_OR_CLOSE) and c == '(': + state = SEARCH_MATCH_OR_CONTROL + just_closed = False + elif state == SEARCH_MATCH_OR_CONTROL and c in '&!|': + if c == '&': + current_node = current_node.append(FilterNode(AND)) + elif c == '|': + current_node = current_node.append(FilterNode(OR)) + elif c == '!': + current_node = current_node.append(FilterNode(NOT)) + state = SEARCH_OPEN + elif (state == SEARCH_MATCH_OR_CLOSE or state == SEARCH_OPEN_OR_CLOSE) and c == ')': + if just_closed: + current_node = current_node.parent + else: + just_closed = True + skip_white_space = True + end_pos = pos + if start_pos: + if current_node.tag == NOT and len(current_node.elements) > 0: + raise LDAPInvalidFilterError('NOT (!) clause in filter cannot be multiple') + current_node.append(evaluate_match(search_filter[start_pos:end_pos], schema, auto_escape, auto_encode, validator, check_names)) + start_pos = None + state = SEARCH_OPEN_OR_CLOSE + elif (state == SEARCH_MATCH_OR_CLOSE or state == SEARCH_MATCH_OR_CONTROL) and c not in '()': + skip_white_space = False + if not start_pos: + start_pos = pos + state = SEARCH_MATCH_OR_CLOSE + else: + raise LDAPInvalidFilterError('malformed filter') + if len(root.elements) != 1: + raise LDAPInvalidFilterError('missing boolean operator in filter') + return root + else: + raise LDAPInvalidFilterError('invalid filter') + + +def compile_filter(filter_node): + """Builds ASN1 structure for filter, converts from filter LDAP escaping to bytes""" + compiled_filter = Filter() + if filter_node.tag == AND: + boolean_filter = And() + pos = 0 + for element in filter_node.elements: + boolean_filter[pos] = compile_filter(element) + pos += 1 + compiled_filter['and'] = boolean_filter + elif filter_node.tag == OR: + boolean_filter = Or() + pos = 0 + for element in filter_node.elements: + boolean_filter[pos] = compile_filter(element) + pos += 1 + compiled_filter['or'] = boolean_filter + elif filter_node.tag == NOT: + boolean_filter = Not() + boolean_filter['innerNotFilter'] = compile_filter(filter_node.elements[0]) + compiled_filter.setComponentByName('notFilter', boolean_filter, verifyConstraints=False) # do not verify constraints because of hack for recursive filters in rfc4511 + + elif filter_node.tag == MATCH_APPROX: + matching_filter = ApproxMatch() + matching_filter['attributeDesc'] = AttributeDescription(filter_node.assertion['attr']) + matching_filter['assertionValue'] = AssertionValue(prepare_filter_for_sending(filter_node.assertion['value'])) + compiled_filter['approxMatch'] = matching_filter + elif filter_node.tag == MATCH_GREATER_OR_EQUAL: + matching_filter = GreaterOrEqual() + matching_filter['attributeDesc'] = AttributeDescription(filter_node.assertion['attr']) + matching_filter['assertionValue'] = AssertionValue(prepare_filter_for_sending(filter_node.assertion['value'])) + compiled_filter['greaterOrEqual'] = matching_filter + elif filter_node.tag == MATCH_LESS_OR_EQUAL: + matching_filter = LessOrEqual() + matching_filter['attributeDesc'] = AttributeDescription(filter_node.assertion['attr']) + matching_filter['assertionValue'] = AssertionValue(prepare_filter_for_sending(filter_node.assertion['value'])) + compiled_filter['lessOrEqual'] = matching_filter + elif filter_node.tag == MATCH_EXTENSIBLE: + matching_filter = ExtensibleMatch() + if filter_node.assertion['matchingRule']: + matching_filter['matchingRule'] = MatchingRule(filter_node.assertion['matchingRule']) + if filter_node.assertion['attr']: + matching_filter['type'] = Type(filter_node.assertion['attr']) + matching_filter['matchValue'] = MatchValue(prepare_filter_for_sending(filter_node.assertion['value'])) + matching_filter['dnAttributes'] = DnAttributes(filter_node.assertion['dnAttributes']) + compiled_filter['extensibleMatch'] = matching_filter + elif filter_node.tag == MATCH_PRESENT: + matching_filter = Present(AttributeDescription(filter_node.assertion['attr'])) + compiled_filter['present'] = matching_filter + elif filter_node.tag == MATCH_SUBSTRING: + matching_filter = SubstringFilter() + matching_filter['type'] = AttributeDescription(filter_node.assertion['attr']) + substrings = Substrings() + pos = 0 + if 'initial' in filter_node.assertion and filter_node.assertion['initial']: + substrings[pos] = Substring().setComponentByName('initial', Initial(prepare_filter_for_sending(filter_node.assertion['initial']))) + pos += 1 + if 'any' in filter_node.assertion and filter_node.assertion['any']: + for substring in filter_node.assertion['any']: + substrings[pos] = Substring().setComponentByName('any', Any(prepare_filter_for_sending(substring))) + pos += 1 + if 'final' in filter_node.assertion and filter_node.assertion['final']: + substrings[pos] = Substring().setComponentByName('final', Final(prepare_filter_for_sending(filter_node.assertion['final']))) + matching_filter['substrings'] = substrings + compiled_filter['substringFilter'] = matching_filter + elif filter_node.tag == MATCH_EQUAL: + matching_filter = EqualityMatch() + matching_filter['attributeDesc'] = AttributeDescription(filter_node.assertion['attr']) + matching_filter['assertionValue'] = AssertionValue(prepare_filter_for_sending(filter_node.assertion['value'])) + compiled_filter.setComponentByName('equalityMatch', matching_filter) + else: + raise LDAPInvalidFilterError('unknown filter node tag') + + return compiled_filter + + +def build_attribute_selection(attribute_list, schema): + conf_attributes_excluded_from_check = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_CHECK')] + + attribute_selection = AttributeSelection() + for index, attribute in enumerate(attribute_list): + if schema and schema.attribute_types: + if ';' in attribute: # exclude tags from validation + if not attribute[0:attribute.index(';')] in schema.attribute_types and attribute.lower() not in conf_attributes_excluded_from_check: + raise LDAPAttributeError('invalid attribute type in attribute list: ' + attribute) + else: + if attribute not in schema.attribute_types and attribute.lower() not in conf_attributes_excluded_from_check: + raise LDAPAttributeError('invalid attribute type in attribute list: ' + attribute) + attribute_selection[index] = Selector(attribute) + + return attribute_selection + + +def search_operation(search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + auto_escape, + auto_encode, + schema=None, + validator=None, + check_names=False): + # SearchRequest ::= [APPLICATION 3] SEQUENCE { + # baseObject LDAPDN, + # scope ENUMERATED { + # baseObject (0), + # singleLevel (1), + # wholeSubtree (2), + # ... }, + # derefAliases ENUMERATED { + # neverDerefAliases (0), + # derefInSearching (1), + # derefFindingBaseObj (2), + # derefAlways (3) }, + # sizeLimit INTEGER (0 .. maxInt), + # timeLimit INTEGER (0 .. maxInt), + # typesOnly BOOLEAN, + # filter Filter, + # attributes AttributeSelection } + request = SearchRequest() + request['baseObject'] = LDAPDN(search_base) + + if search_scope == BASE or search_scope == 0: + request['scope'] = Scope('baseObject') + elif search_scope == LEVEL or search_scope == 1: + request['scope'] = Scope('singleLevel') + elif search_scope == SUBTREE or search_scope == 2: + request['scope'] = Scope('wholeSubtree') + else: + raise LDAPInvalidScopeError('invalid scope type') + + if dereference_aliases == DEREF_NEVER or dereference_aliases == 0: + request['derefAliases'] = DerefAliases('neverDerefAliases') + elif dereference_aliases == DEREF_SEARCH or dereference_aliases == 1: + request['derefAliases'] = DerefAliases('derefInSearching') + elif dereference_aliases == DEREF_BASE or dereference_aliases == 2: + request['derefAliases'] = DerefAliases('derefFindingBaseObj') + elif dereference_aliases == DEREF_ALWAYS or dereference_aliases == 3: + request['derefAliases'] = DerefAliases('derefAlways') + else: + raise LDAPInvalidDereferenceAliasesError('invalid dereference aliases type') + + request['sizeLimit'] = Integer0ToMax(size_limit) + request['timeLimit'] = Integer0ToMax(time_limit) + request['typesOnly'] = TypesOnly(True) if types_only else TypesOnly(False) + request['filter'] = compile_filter(parse_filter(search_filter, schema, auto_escape, auto_encode, validator, check_names).elements[0]) # parse the searchFilter string and compile it starting from the root node + if not isinstance(attributes, SEQUENCE_TYPES): + attributes = [NO_ATTRIBUTES] + + request['attributes'] = build_attribute_selection(attributes, schema) + + return request + + +def decode_vals(vals): + try: + return [str(val) for val in vals if val] if vals else None + except UnicodeDecodeError: + return decode_raw_vals(vals) + +def decode_vals_fast(vals): + try: + return [to_unicode(val[3], from_server=True) for val in vals if val] if vals else None + except UnicodeDecodeError: + return [val[3] for val in vals if val] if vals else None + + +def attributes_to_dict(attribute_list): + conf_case_insensitive_attributes = get_config_parameter('CASE_INSENSITIVE_ATTRIBUTE_NAMES') + attributes = CaseInsensitiveDict() if conf_case_insensitive_attributes else dict() + for attribute in attribute_list: + attributes[str(attribute['type'])] = decode_vals(attribute['vals']) + return attributes + + +def attributes_to_dict_fast(attribute_list): + conf_case_insensitive_attributes = get_config_parameter('CASE_INSENSITIVE_ATTRIBUTE_NAMES') + attributes = CaseInsensitiveDict() if conf_case_insensitive_attributes else dict() + for attribute in attribute_list: + attributes[to_unicode(attribute[3][0][3], from_server=True)] = decode_vals_fast(attribute[3][1][3]) + + return attributes + + +def decode_raw_vals(vals): + return [bytes(val) for val in vals] if vals else None + + +def decode_raw_vals_fast(vals): + return [bytes(val[3]) for val in vals] if vals else None + + +def raw_attributes_to_dict(attribute_list): + conf_case_insensitive_attributes = get_config_parameter('CASE_INSENSITIVE_ATTRIBUTE_NAMES') + + attributes = CaseInsensitiveDict() if conf_case_insensitive_attributes else dict() + for attribute in attribute_list: + attributes[str(attribute['type'])] = decode_raw_vals(attribute['vals']) + + return attributes + + +def raw_attributes_to_dict_fast(attribute_list): + conf_case_insensitive_attributes = get_config_parameter('CASE_INSENSITIVE_ATTRIBUTE_NAMES') + attributes = CaseInsensitiveDict() if conf_case_insensitive_attributes else dict() + for attribute in attribute_list: + attributes[to_unicode(attribute[3][0][3], from_server=True)] = decode_raw_vals_fast(attribute[3][1][3]) + + return attributes + + +def checked_attributes_to_dict(attribute_list, schema=None, custom_formatter=None): + conf_case_insensitive_attributes = get_config_parameter('CASE_INSENSITIVE_ATTRIBUTE_NAMES') + + checked_attributes = CaseInsensitiveDict() if conf_case_insensitive_attributes else dict() + for attribute in attribute_list: + name = str(attribute['type']) + checked_attributes[name] = format_attribute_values(schema, name, decode_raw_vals(attribute['vals']) or [], custom_formatter) + return checked_attributes + + +def checked_attributes_to_dict_fast(attribute_list, schema=None, custom_formatter=None): + conf_case_insensitive_attributes = get_config_parameter('CASE_INSENSITIVE_ATTRIBUTE_NAMES') + + checked_attributes = CaseInsensitiveDict() if conf_case_insensitive_attributes else dict() + for attribute in attribute_list: + name = to_unicode(attribute[3][0][3], from_server=True) + checked_attributes[name] = format_attribute_values(schema, name, decode_raw_vals_fast(attribute[3][1][3]) or [], custom_formatter) + return checked_attributes + + +def matching_rule_assertion_to_string(matching_rule_assertion): + return str(matching_rule_assertion) + + +def filter_to_string(filter_object): + filter_type = filter_object.getName() + filter_string = '(' + if filter_type == 'and': + filter_string += '&' + for f in filter_object['and']: + filter_string += filter_to_string(f) + elif filter_type == 'or': + filter_string += '|' + for f in filter_object['or']: + filter_string += filter_to_string(f) + elif filter_type == 'notFilter': + filter_string += '!' + filter_to_string(filter_object['notFilter']['innerNotFilter']) + elif filter_type == 'equalityMatch': + ava = ava_to_dict(filter_object['equalityMatch']) + filter_string += ava['attribute'] + '=' + ava['value'] + elif filter_type == 'substringFilter': + attribute = filter_object['substringFilter']['type'] + filter_string += str(attribute) + '=' + for substring in filter_object['substringFilter']['substrings']: + component = substring.getName() + if substring[component] is not None and substring[component].hasValue(): + if component == 'initial': + filter_string += str(substring['initial']) + '*' + elif component == 'any': + filter_string += str(substring['any']) if filter_string.endswith('*') else '*' + str(substring['any']) + filter_string += '*' + elif component == 'final': + filter_string += '*' + str(substring['final']) + elif filter_type == 'greaterOrEqual': + ava = ava_to_dict(filter_object['greaterOrEqual']) + filter_string += ava['attribute'] + '>=' + ava['value'] + elif filter_type == 'lessOrEqual': + ava = ava_to_dict(filter_object['lessOrEqual']) + filter_string += ava['attribute'] + '<=' + ava['value'] + elif filter_type == 'present': + filter_string += str(filter_object['present']) + '=*' + elif filter_type == 'approxMatch': + ava = ava_to_dict(filter_object['approxMatch']) + filter_string += ava['attribute'] + '~=' + ava['value'] + elif filter_type == 'extensibleMatch': + filter_string += matching_rule_assertion_to_string(filter_object['extensibleMatch']) + else: + raise LDAPInvalidFilterError('error converting filter to string') + filter_string += ')' + + if str is bytes: # Python2, forces conversion to Unicode + filter_string = to_unicode(filter_string) + + return filter_string + + +def search_request_to_dict(request): + return {'base': str(request['baseObject']), + 'scope': int(request['scope']), + 'dereferenceAlias': int(request['derefAliases']), + 'sizeLimit': int(request['sizeLimit']), + 'timeLimit': int(request['timeLimit']), + 'typesOnly': bool(request['typesOnly']), + 'filter': filter_to_string(request['filter']), + 'attributes': attributes_to_list(request['attributes'])} + + +def search_result_entry_response_to_dict(response, schema, custom_formatter, check_names): + entry = dict() + # entry['dn'] = str(response['object']) + if response['object']: + if isinstance(response['object'], STRING_TYPES): # mock strategies return string not a PyAsn1 object + entry['raw_dn'] = to_raw(response['object']) + entry['dn'] = to_unicode(response['object']) + else: + entry['raw_dn'] = str(response['object']) + entry['dn'] = to_unicode(bytes(response['object']), from_server=True) + else: + entry['raw_dn'] = b'' + entry['dn'] = '' + entry['raw_attributes'] = raw_attributes_to_dict(response['attributes']) + if check_names: + entry['attributes'] = checked_attributes_to_dict(response['attributes'], schema, custom_formatter) + else: + entry['attributes'] = attributes_to_dict(response['attributes']) + + return entry + + +def search_result_done_response_to_dict(response): + result = {'result': int(response['resultCode']), + 'description': ResultCode().getNamedValues().getName(response['resultCode']), + 'message': str(response['diagnosticMessage']), + 'dn': str(response['matchedDN']), + 'referrals': referrals_to_list(response['referral'])} + + if 'controls' in response: # used for returning controls in Mock strategies + result['controls'] = dict() + for control in response['controls']: + result['controls'][control[0]] = control[1] + + return result + + +def search_result_reference_response_to_dict(response): + return {'uri': search_refs_to_list(response)} + + +def search_result_entry_response_to_dict_fast(response, schema, custom_formatter, check_names): + entry_dict = dict() + entry_dict['raw_dn'] = response[0][3] + entry_dict['dn'] = to_unicode(response[0][3], from_server=True) + entry_dict['raw_attributes'] = raw_attributes_to_dict_fast(response[1][3]) # attributes + if check_names: + entry_dict['attributes'] = checked_attributes_to_dict_fast(response[1][3], schema, custom_formatter) # attributes + else: + entry_dict['attributes'] = attributes_to_dict_fast(response[1][3]) # attributes + + return entry_dict + + +def search_result_reference_response_to_dict_fast(response): + return {'uri': search_refs_to_list_fast([r[3] for r in response])} diff --git a/python/user_packages/Python313/site-packages/ldap3/operation/unbind.py b/python/user_packages/Python313/site-packages/ldap3/operation/unbind.py new file mode 100644 index 0000000000000000000000000000000000000000..4d418fb576ca8ce79670ce6f21b73dc856cdd860 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/operation/unbind.py @@ -0,0 +1,32 @@ +""" +""" + +# Created on 2013.09.03 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..protocol.rfc4511 import UnbindRequest + + +def unbind_operation(): + # UnbindRequest ::= [APPLICATION 2] NULL + request = UnbindRequest() + return request diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__init__.py b/python/user_packages/Python313/site-packages/ldap3/protocol/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8781346131da9c8687271c2c251b9ebb28e0e9d5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/controls.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/controls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dbadaa1894ddb85781ee594e7ca8b712571c08a8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/controls.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/convert.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/convert.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cdd1651705275c89c5dbc269fd46ecbfb2bb08a Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/convert.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/microsoft.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/microsoft.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8810b6f9dc82d45d31de68244a0731a8082cbd03 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/microsoft.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/novell.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/novell.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3013ada0de6184be241ce41810ecbed7e1553d44 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/novell.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/persistentSearch.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/persistentSearch.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f63e7f4c365e24c8743538352b7132e59a127ab9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/persistentSearch.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc2696.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc2696.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f4190fbf721955d6ee492830b172fb4a326f7a1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc2696.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc2849.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc2849.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d83650da840737e6bedde9d60cf08303780e26ef Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc2849.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc3062.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc3062.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..324e85f0d396bc8aa114c4965d7676764cd219e6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc3062.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4511.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4511.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efb2a3f3596fca4d5154ee3cf19df988ea2d02df Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4511.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4512.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4512.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8b5449eae59683fc67622cb1600e2254e78b661 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4512.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4527.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4527.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5da5949034e6aeb172ba047e3ff353e3cf1be78f Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/__pycache__/rfc4527.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/controls.py b/python/user_packages/Python313/site-packages/ldap3/protocol/controls.py new file mode 100644 index 0000000000000000000000000000000000000000..658867bb79169ca4f3ffbdb28884f5e794d0bd79 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/controls.py @@ -0,0 +1,40 @@ +""" +""" + +# Created on 2015.10.20 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .rfc4511 import Control, Criticality, LDAPOID +from ..utils.asn1 import encode + + +def build_control(oid, criticality, value, encode_control_value=True): + control = Control() + control.setComponentByName('controlType', LDAPOID(oid)) + control.setComponentByName('criticality', Criticality(criticality)) + if value is not None: + if encode_control_value: + control.setComponentByName('controlValue', encode(value)) + else: + control.setComponentByName('controlValue', value) + + return control diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/convert.py b/python/user_packages/Python313/site-packages/ldap3/protocol/convert.py new file mode 100644 index 0000000000000000000000000000000000000000..4acc3cbf197bc79fc55b3d018a3416ff50e58a96 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/convert.py @@ -0,0 +1,221 @@ +""" +""" + +# Created on 2013.07.24 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from pyasn1.error import PyAsn1Error + +from .. import SEQUENCE_TYPES, STRING_TYPES, get_config_parameter +from ..core.exceptions import LDAPControlError, LDAPAttributeError, LDAPObjectClassError, LDAPInvalidValueError +from ..protocol.rfc4511 import Controls, Control +from ..utils.conv import to_raw, to_unicode, escape_filter_chars, is_filter_escaped +from ..protocol.formatters.standard import find_attribute_validator + + +def to_str_or_normalized_unicode(val): + """ Attempt to convert value to a string. If that would error, convert it to normalized unicode. + Python 3 string conversion handles unicode -> str without issue, but python 2 doesn't. + """ + try: + return str(val) + except: + return val.encode('ascii', 'backslashreplace') + + +def attribute_to_dict(attribute): + try: + return {'type': str(attribute['type']), 'values': [str(val) for val in attribute['vals']]} + except PyAsn1Error: # invalid encoding, return bytes value + return {'type': str(attribute['type']), 'values': [bytes(val) for val in attribute['vals']]} + + +def attributes_to_dict(attributes): + attributes_dict = dict() + for attribute in attributes: + attribute_dict = attribute_to_dict(attribute) + attributes_dict[attribute_dict['type']] = attribute_dict['values'] + return attributes_dict + + +def referrals_to_list(referrals): + if isinstance(referrals, list): + return [to_str_or_normalized_unicode(referral) for referral in referrals if referral] if referrals else None + else: + return [to_str_or_normalized_unicode(referral) for referral in referrals if referral] if referrals is not None and referrals.hasValue() else None + + +def search_refs_to_list(search_refs): + return [to_str_or_normalized_unicode(search_ref) for search_ref in search_refs if search_ref] if search_refs else None + + +def search_refs_to_list_fast(search_refs): + return [to_unicode(search_ref) for search_ref in search_refs if search_ref] if search_refs else None + + +def sasl_to_dict(sasl): + return {'mechanism': str(sasl['mechanism']), 'credentials': bytes(sasl['credentials']) if sasl['credentials'] is not None and sasl['credentials'].hasValue() else None} + + +def authentication_choice_to_dict(authentication_choice): + return {'simple': str(authentication_choice['simple']) if authentication_choice.getName() == 'simple' else None, 'sasl': sasl_to_dict(authentication_choice['sasl']) if authentication_choice.getName() == 'sasl' else None} + + +def partial_attribute_to_dict(modification): + try: + return {'type': str(modification['type']), 'value': [str(value) for value in modification['vals']]} + except PyAsn1Error: # invalid encoding, return bytes value + return {'type': str(modification['type']), 'value': [bytes(value) for value in modification['vals']]} + + +def change_to_dict(change): + return {'operation': int(change['operation']), 'attribute': partial_attribute_to_dict(change['modification'])} + + +def changes_to_list(changes): + return [change_to_dict(change) for change in changes] + + +def attributes_to_list(attributes): + return [to_str_or_normalized_unicode(attribute) for attribute in attributes] + + +def ava_to_dict(ava): + try: + return {'attribute': str(ava['attributeDesc']), 'value': escape_filter_chars(str(ava['assertionValue']))} + except Exception: # invalid encoding, return bytes value + try: + return {'attribute': str(ava['attributeDesc']), 'value': escape_filter_chars(bytes(ava['assertionValue']))} + except Exception: + return {'attribute': str(ava['attributeDesc']), 'value': bytes(ava['assertionValue'])} + + +def substring_to_dict(substring): + return {'initial': substring['initial'] if substring['initial'] else '', 'any': [middle for middle in substring['any']] if substring['any'] else '', 'final': substring['final'] if substring['final'] else ''} + + +def prepare_changes_for_request(changes): + prepared = dict() + for change in changes: + attribute_name = change['attribute']['type'] + if attribute_name not in prepared: + prepared[attribute_name] = [] + prepared[attribute_name].append((change['operation'], change['attribute']['value'])) + return prepared + + +def build_controls_list(controls): + """controls is a sequence of Control() or sequences + each sequence must have 3 elements: the control OID, the criticality, the value + criticality must be a boolean + """ + + if not controls: + return None + + if not isinstance(controls, SEQUENCE_TYPES): + raise LDAPControlError('controls must be a sequence') + + built_controls = Controls() + for idx, control in enumerate(controls): + if isinstance(control, Control): + built_controls.setComponentByPosition(idx, control) + elif len(control) == 3 and isinstance(control[1], bool): + built_control = Control() + built_control['controlType'] = control[0] + built_control['criticality'] = control[1] + if control[2] is not None: + built_control['controlValue'] = control[2] + built_controls.setComponentByPosition(idx, built_control) + else: + raise LDAPControlError('control must be a sequence of 3 elements: controlType, criticality (boolean) and controlValue (None if not provided)') + + return built_controls + + +def validate_assertion_value(schema, name, value, auto_escape, auto_encode, validator, check_names): + value = to_unicode(value) + if auto_escape: + if '\\' in value and not is_filter_escaped(value): + value = escape_filter_chars(value) + value = validate_attribute_value(schema, name, value, auto_encode, validator=validator, check_names=check_names) + return value + + +def validate_attribute_value(schema, name, value, auto_encode, validator=None, check_names=False): + conf_classes_excluded_from_check = [v.lower() for v in get_config_parameter('CLASSES_EXCLUDED_FROM_CHECK')] + conf_attributes_excluded_from_check = [v.lower() for v in get_config_parameter('ATTRIBUTES_EXCLUDED_FROM_CHECK')] + conf_utf8_syntaxes = get_config_parameter('UTF8_ENCODED_SYNTAXES') + conf_utf8_types = [v.lower() for v in get_config_parameter('UTF8_ENCODED_TYPES')] + if schema and schema.attribute_types: + if ';' in name: + name = name.split(';')[0] + if check_names and schema.object_classes and name.lower() == 'objectclass': + if to_unicode(value).lower() not in conf_classes_excluded_from_check and to_unicode(value) not in schema.object_classes: + raise LDAPObjectClassError('invalid class in objectClass attribute: ' + str(value)) + elif check_names and name not in schema.attribute_types and name.lower() not in conf_attributes_excluded_from_check: + raise LDAPAttributeError('invalid attribute ' + name) + else: # try standard validators + validator = find_attribute_validator(schema, name, validator) + validated = validator(value) + if validated is False: + try: # checks if the value is a byte value erroneously converted to a string (as "b'1234'"), this is a common case in Python 3 when encoding is not specified + if value[0:2] == "b'" and value [-1] == "'": + value = to_raw(value[2:-1]) + validated = validator(value) + except Exception: + raise LDAPInvalidValueError('value \'%s\' non valid for attribute \'%s\'' % (value, name)) + if validated is False: + raise LDAPInvalidValueError('value \'%s\' non valid for attribute \'%s\'' % (value, name)) + elif validated is not True: # a valid LDAP value equivalent to the actual value + value = validated + # converts to utf-8 for well known Unicode LDAP syntaxes + if auto_encode and ((name in schema.attribute_types and schema.attribute_types[name].syntax in conf_utf8_syntaxes) or name.lower() in conf_utf8_types): + value = to_unicode(value) # tries to convert from local encoding to Unicode + return to_raw(value) + + +def prepare_filter_for_sending(raw_string): + i = 0 + ints = [] + raw_string = to_raw(raw_string) + while i < len(raw_string): + if (raw_string[i] == 92 or raw_string[i] == '\\') and i < len(raw_string) - 2: # 92 (0x5C) is backslash + try: + ints.append(int(raw_string[i + 1: i + 3], 16)) + i += 2 + except ValueError: # not an ldap escaped value, sends as is + ints.append(92) # adds backslash + else: + if str is not bytes: # Python 3 + ints.append(raw_string[i]) + else: # Python 2 + ints.append(ord(raw_string[i])) + i += 1 + + if str is not bytes: # Python 3 + return bytes(ints) + else: # Python 2 + return ''.join(chr(x) for x in ints) + + +def prepare_for_sending(raw_string): + return to_raw(raw_string) if isinstance(raw_string, STRING_TYPES) else raw_string diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__init__.py b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a20524bb9e0fd89d118eadabfd3b0247f4ce5826 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/formatters.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/formatters.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..203cf46370d199f14800631cbeb66310ac48289b Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/formatters.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/standard.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/standard.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5de71f47844eb04235e4aaa7af992484e1b37715 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/standard.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/validators.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/validators.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf5451676966b319a4bc5327b56b3af5f304305b Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/__pycache__/validators.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/formatters.py b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/formatters.py new file mode 100644 index 0000000000000000000000000000000000000000..2638d52b6ed6d7a65011db1f1e553a1a12e75f66 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/formatters.py @@ -0,0 +1,436 @@ +""" +""" + +# Created on 2014.10.28 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import re + +from binascii import hexlify +from uuid import UUID +from datetime import datetime, timedelta +from ...utils.conv import to_unicode + +from ...core.timezone import OffsetTzInfo + + +def format_unicode(raw_value): + try: + if str is not bytes: # Python 3 + return str(raw_value, 'utf-8', errors='strict') + else: # Python 2 + return unicode(raw_value, 'utf-8', errors='strict') + except (TypeError, UnicodeDecodeError): + pass + + return raw_value + + +def format_integer(raw_value): + try: + return int(raw_value) + except (TypeError, ValueError): # expected exceptions + pass + except Exception: # any other exception should be investigated, anyway the formatter return the raw_value + pass + + return raw_value + + +def format_binary(raw_value): + try: + return bytes(raw_value) + except TypeError: # expected exceptions + pass + except Exception: # any other exception should be investigated, anyway the formatter return the raw_value + pass + + return raw_value + + +def format_uuid(raw_value): + try: + return str(UUID(bytes=raw_value)) + except (TypeError, ValueError): + return format_unicode(raw_value) + except Exception: # any other exception should be investigated, anyway the formatter return the raw_value + pass + + return raw_value + + +def format_uuid_le(raw_value): + try: + return '{' + str(UUID(bytes_le=raw_value)) + '}' + except (TypeError, ValueError): + return format_unicode(raw_value) + except Exception: # any other exception should be investigated, anyway the formatter return the raw_value + pass + + return raw_value + + +def format_boolean(raw_value): + if raw_value in [b'TRUE', b'true', b'True']: + return True + if raw_value in [b'FALSE', b'false', b'False']: + return False + + return raw_value + + +def format_ad_timestamp(raw_value): + """ + Active Directory stores date/time values as the number of 100-nanosecond intervals + that have elapsed since the 0 hour on January 1, 1601 till the date/time that is being stored. + The time is always stored in Greenwich Mean Time (GMT) in the Active Directory. + """ + utc_timezone = OffsetTzInfo(0, 'UTC') + if raw_value == b'9223372036854775807': # max value to be stored in a 64 bit signed int + return datetime.max.replace(tzinfo=utc_timezone) # returns datetime.datetime(9999, 12, 31, 23, 59, 59, 999999, tzinfo=OffsetTzInfo(offset=0, name='UTC')) + try: + timestamp = int(raw_value) + if timestamp < 0: # ad timestamp cannot be negative + timestamp = timestamp * -1 + except Exception: + return raw_value + + try: + return datetime.fromtimestamp(timestamp / 10000000.0 - 11644473600, + tz=utc_timezone) # forces true division in python 2 + except (OSError, OverflowError, ValueError): # on Windows backwards timestamps are not allowed + try: + unix_epoch = datetime.fromtimestamp(0, tz=utc_timezone) + diff_seconds = timedelta(seconds=timestamp / 10000000.0 - 11644473600) + return unix_epoch + diff_seconds + except Exception: + pass + except Exception: + pass + + return raw_value + + +try: # uses regular expressions and the timezone class (python3.2 and later) + from datetime import timezone + + time_format = re.compile( + r''' + ^ + (?P[0-9]{4}) + (?P0[1-9]|1[0-2]) + (?P0[1-9]|[12][0-9]|3[01]) + (?P[01][0-9]|2[0-3]) + (?: + (?P[0-5][0-9]) + (?P[0-5][0-9]|60)? + )? + (?: + [.,] + (?P[0-9]+) + )? + (?: + Z + | + (?: + (?P[+-]) + (?P[01][0-9]|2[0-3]) + (?P[0-5][0-9])? + ) + ) + $ + ''', + re.VERBOSE + ) + + + def format_time(raw_value): + try: + match = time_format.fullmatch(to_unicode(raw_value)) + if match is None: + return raw_value + matches = match.groupdict() + + offset = timedelta( + hours=int(matches['OffHour'] or 0), + minutes=int(matches['OffMinute'] or 0) + ) + + if matches['Offset'] == '-': + offset *= -1 + + # Python does not support leap second in datetime (!) + if matches['Second'] == '60': + matches['Second'] = '59' + + # According to RFC, fraction may be applied to an Hour/Minute (!) + fraction = float('0.' + (matches['Fraction'] or '0')) + + if matches['Minute'] is None: + fraction *= 60 + minute = int(fraction) + fraction -= minute + else: + minute = int(matches['Minute']) + + if matches['Second'] is None: + fraction *= 60 + second = int(fraction) + fraction -= second + else: + second = int(matches['Second']) + + microseconds = int(fraction * 1000000) + + return datetime( + int(matches['Year']), + int(matches['Month']), + int(matches['Day']), + int(matches['Hour']), + minute, + second, + microseconds, + timezone(offset), + ) + except Exception: # exceptions should be investigated, anyway the formatter return the raw_value + pass + return raw_value + +except ImportError: + def format_time(raw_value): + """ + From RFC4517: + A value of the Generalized Time syntax is a character string + representing a date and time. The LDAP-specific encoding of a value + of this syntax is a restriction of the format defined in [ISO8601], + and is described by the following ABNF: + + GeneralizedTime = century year month day hour + [ minute [ second / leap-second ] ] + [ fraction ] + g-time-zone + + century = 2(%x30-39) ; "00" to "99" + year = 2(%x30-39) ; "00" to "99" + month = ( %x30 %x31-39 ) ; "01" (January) to "09" + / ( %x31 %x30-32 ) ; "10" to "12" + day = ( %x30 %x31-39 ) ; "01" to "09" + / ( %x31-32 %x30-39 ) ; "10" to "29" + / ( %x33 %x30-31 ) ; "30" to "31" + hour = ( %x30-31 %x30-39 ) / ( %x32 %x30-33 ) ; "00" to "23" + minute = %x30-35 %x30-39 ; "00" to "59" + second = ( %x30-35 %x30-39 ) ; "00" to "59" + leap-second = ( %x36 %x30 ) ; "60" + fraction = ( DOT / COMMA ) 1*(%x30-39) + g-time-zone = %x5A ; "Z" + / g-differential + g-differential = ( MINUS / PLUS ) hour [ minute ] + MINUS = %x2D ; minus sign ("-") + """ + + if len(raw_value) < 10 or not all((c in b'0123456789+-,.Z' for c in raw_value)) or ( + b'Z' in raw_value and not raw_value.endswith( + b'Z')): # first ten characters are mandatory and must be numeric or timezone or fraction + return raw_value + + # sets position for fixed values + year = int(raw_value[0: 4]) + month = int(raw_value[4: 6]) + day = int(raw_value[6: 8]) + hour = int(raw_value[8: 10]) + minute = 0 + second = 0 + microsecond = 0 + + remain = raw_value[10:] + if remain and remain.endswith(b'Z'): # uppercase 'Z' + sep = b'Z' + elif b'+' in remain: # timezone can be specified with +hh[mm] or -hh[mm] + sep = b'+' + elif b'-' in remain: + sep = b'-' + else: # timezone not specified + return raw_value + + time, _, offset = remain.partition(sep) + + if time and (b'.' in time or b',' in time): + # fraction time + if time[0] in b',.': + minute = 6 * int(time[1] if str is bytes else chr(time[1])) # Python 2 / Python 3 + elif time[2] in b',.': + minute = int(raw_value[10: 12]) + second = 6 * int(time[3] if str is bytes else chr(time[3])) # Python 2 / Python 3 + elif time[4] in b',.': + minute = int(raw_value[10: 12]) + second = int(raw_value[12: 14]) + microsecond = 100000 * int(time[5] if str is bytes else chr(time[5])) # Python 2 / Python 3 + elif len(time) == 2: # mmZ format + minute = int(raw_value[10: 12]) + elif len(time) == 0: # Z format + pass + elif len(time) == 4: # mmssZ + minute = int(raw_value[10: 12]) + second = int(raw_value[12: 14]) + else: + return raw_value + + if sep == b'Z': # UTC + timezone = OffsetTzInfo(0, 'UTC') + else: # build timezone + try: + if len(offset) == 2: + timezone_hour = int(offset[:2]) + timezone_minute = 0 + elif len(offset) == 4: + timezone_hour = int(offset[:2]) + timezone_minute = int(offset[2:4]) + else: # malformed timezone + raise ValueError + except ValueError: + return raw_value + if timezone_hour > 23 or timezone_minute > 59: # invalid timezone + return raw_value + + if str is not bytes: # Python 3 + timezone = OffsetTzInfo((timezone_hour * 60 + timezone_minute) * (1 if sep == b'+' else -1), + 'UTC' + str(sep + offset, encoding='utf-8')) + else: # Python 2 + timezone = OffsetTzInfo((timezone_hour * 60 + timezone_minute) * (1 if sep == b'+' else -1), + unicode('UTC' + sep + offset, encoding='utf-8')) + + try: + return datetime(year=year, + month=month, + day=day, + hour=hour, + minute=minute, + second=second, + microsecond=microsecond, + tzinfo=timezone) + except (TypeError, ValueError): + pass + + return raw_value + + +def format_ad_timedelta(raw_value): + """ + Convert a negative filetime value to a timedelta. + """ + # Active Directory stores attributes like "minPwdAge" as a negative + # "filetime" timestamp, which is the number of 100-nanosecond intervals that + # have elapsed since the 0 hour on January 1, 1601. + # + # Handle the minimum value that can be stored in a 64 bit signed integer. + # See https://docs.microsoft.com/en-us/dotnet/api/system.int64.minvalue + # In attributes like "maxPwdAge", this signifies never. + if raw_value == b'-9223372036854775808': + return timedelta.max + # We can reuse format_ad_timestamp to get a datetime object from the + # timestamp. Afterwards, we can subtract a datetime representing 0 hour on + # January 1, 1601 from the returned datetime to get the timedelta. + return format_ad_timestamp(raw_value) - format_ad_timestamp(0) + + +def format_time_with_0_year(raw_value): + try: + if raw_value.startswith(b'0000'): + return raw_value + except Exception: + try: + if raw_value.startswith('0000'): + return raw_value + except Exception: + pass + + return format_time(raw_value) + + +def format_sid(raw_value): + """ + SID= "S-1-" IdentifierAuthority 1*SubAuthority + IdentifierAuthority= IdentifierAuthorityDec / IdentifierAuthorityHex + ; If the identifier authority is < 2^32, the + ; identifier authority is represented as a decimal + ; number + ; If the identifier authority is >= 2^32, + ; the identifier authority is represented in + ; hexadecimal + IdentifierAuthorityDec = 1*10DIGIT + ; IdentifierAuthorityDec, top level authority of a + ; security identifier is represented as a decimal number + IdentifierAuthorityHex = "0x" 12HEXDIG + ; IdentifierAuthorityHex, the top-level authority of a + ; security identifier is represented as a hexadecimal number + SubAuthority= "-" 1*10DIGIT + ; Sub-Authority is always represented as a decimal number + ; No leading "0" characters are allowed when IdentifierAuthority + ; or SubAuthority is represented as a decimal number + ; All hexadecimal digits must be output in string format, + ; pre-pended by "0x" + + Revision (1 byte): An 8-bit unsigned integer that specifies the revision level of the SID. This value MUST be set to 0x01. + SubAuthorityCount (1 byte): An 8-bit unsigned integer that specifies the number of elements in the SubAuthority array. The maximum number of elements allowed is 15. + IdentifierAuthority (6 bytes): A SID_IDENTIFIER_AUTHORITY structure that indicates the authority under which the SID was created. It describes the entity that created the SID. The Identifier Authority value {0,0,0,0,0,5} denotes SIDs created by the NT SID authority. + SubAuthority (variable): A variable length array of unsigned 32-bit integers that uniquely identifies a principal relative to the IdentifierAuthority. Its length is determined by SubAuthorityCount. + """ + try: + if raw_value.startswith(b'S-1-'): + return raw_value + except Exception: + try: + if raw_value.startswith('S-1-'): + return raw_value + except Exception: + pass + try: + if str is not bytes: # Python 3 + revision = int(raw_value[0]) + sub_authority_count = int(raw_value[1]) + identifier_authority = int.from_bytes(raw_value[2:8], byteorder='big') + if identifier_authority >= 4294967296: # 2 ^ 32 + identifier_authority = hex(identifier_authority) + + sub_authority = '' + i = 0 + while i < sub_authority_count: + sub_authority += '-' + str( + int.from_bytes(raw_value[8 + (i * 4): 12 + (i * 4)], byteorder='little')) # little endian + i += 1 + else: # Python 2 + revision = int(ord(raw_value[0])) + sub_authority_count = int(ord(raw_value[1])) + identifier_authority = int(hexlify(raw_value[2:8]), 16) + if identifier_authority >= 4294967296: # 2 ^ 32 + identifier_authority = hex(identifier_authority) + + sub_authority = '' + i = 0 + while i < sub_authority_count: + sub_authority += '-' + str(int(hexlify(raw_value[11 + (i * 4): 7 + (i * 4): -1]), 16)) # little endian + i += 1 + return 'S-' + str(revision) + '-' + str(identifier_authority) + sub_authority + except Exception: # any exception should be investigated, anyway the formatter return the raw_value + pass + + return raw_value diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/standard.py b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/standard.py new file mode 100644 index 0000000000000000000000000000000000000000..42f6c2666cec7bc0454511d0bde69dc31adf9267 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/standard.py @@ -0,0 +1,238 @@ +""" +""" + +# Created on 2014.10.28 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ... import SEQUENCE_TYPES +from .formatters import format_ad_timestamp, format_binary, format_boolean,\ + format_integer, format_sid, format_time, format_unicode, format_uuid, format_uuid_le, format_time_with_0_year,\ + format_ad_timedelta +from .validators import validate_integer, validate_time, always_valid,\ + validate_generic_single_value, validate_boolean, validate_ad_timestamp, validate_sid,\ + validate_uuid_le, validate_uuid, validate_zero_and_minus_one_and_positive_int, validate_guid, validate_time_with_0_year,\ + validate_ad_timedelta + +# for each syntax can be specified a format function and a input validation function + +standard_formatter = { + '1.2.840.113556.1.4.903': (format_binary, None), # Object (DN-binary) - Microsoft + '1.2.840.113556.1.4.904': (format_unicode, None), # Object (DN-string) - Microsoft + '1.2.840.113556.1.4.905': (format_unicode, None), # String (Teletex) - Microsoft + '1.2.840.113556.1.4.906': (format_integer, validate_integer), # Large integer - Microsoft + '1.2.840.113556.1.4.907': (format_binary, None), # String (NT-sec-desc) - Microsoft + '1.2.840.113556.1.4.1221': (format_binary, None), # Object (OR-name) - Microsoft + '1.2.840.113556.1.4.1362': (format_unicode, None), # String (Case) - Microsoft + '1.3.6.1.4.1.1466.115.121.1.1': (format_binary, None), # ACI item [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.2': (format_binary, None), # Access point [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.3': (format_unicode, None), # Attribute type description + '1.3.6.1.4.1.1466.115.121.1.4': (format_binary, None), # Audio [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.5': (format_binary, None), # Binary [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.6': (format_unicode, None), # Bit String + '1.3.6.1.4.1.1466.115.121.1.7': (format_boolean, validate_boolean), # Boolean + '1.3.6.1.4.1.1466.115.121.1.8': (format_binary, None), # Certificate [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.9': (format_binary, None), # Certificate List [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.10': (format_binary, None), # Certificate Pair [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.11': (format_unicode, None), # Country String + '1.3.6.1.4.1.1466.115.121.1.12': (format_unicode, None), # Distinguished name (DN) + '1.3.6.1.4.1.1466.115.121.1.13': (format_binary, None), # Data Quality Syntax [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.14': (format_unicode, None), # Delivery method + '1.3.6.1.4.1.1466.115.121.1.15': (format_unicode, None), # Directory string + '1.3.6.1.4.1.1466.115.121.1.16': (format_unicode, None), # DIT Content Rule Description + '1.3.6.1.4.1.1466.115.121.1.17': (format_unicode, None), # DIT Structure Rule Description + '1.3.6.1.4.1.1466.115.121.1.18': (format_binary, None), # DL Submit Permission [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.19': (format_binary, None), # DSA Quality Syntax [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.20': (format_binary, None), # DSE Type [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.21': (format_binary, None), # Enhanced Guide + '1.3.6.1.4.1.1466.115.121.1.22': (format_unicode, None), # Facsimile Telephone Number + '1.3.6.1.4.1.1466.115.121.1.23': (format_binary, None), # Fax + '1.3.6.1.4.1.1466.115.121.1.24': (format_time, validate_time), # Generalized time + '1.3.6.1.4.1.1466.115.121.1.25': (format_binary, None), # Guide [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.26': (format_unicode, None), # IA5 string + '1.3.6.1.4.1.1466.115.121.1.27': (format_integer, validate_integer), # Integer + '1.3.6.1.4.1.1466.115.121.1.28': (format_binary, None), # JPEG + '1.3.6.1.4.1.1466.115.121.1.29': (format_binary, None), # Master and Shadow Access Points [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.30': (format_unicode, None), # Matching rule description + '1.3.6.1.4.1.1466.115.121.1.31': (format_unicode, None), # Matching rule use description + '1.3.6.1.4.1.1466.115.121.1.32': (format_unicode, None), # Mail Preference [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.33': (format_unicode, None), # MHS OR Address [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.34': (format_unicode, None), # Name and optional UID + '1.3.6.1.4.1.1466.115.121.1.35': (format_unicode, None), # Name form description + '1.3.6.1.4.1.1466.115.121.1.36': (format_unicode, None), # Numeric string + '1.3.6.1.4.1.1466.115.121.1.37': (format_unicode, None), # Object class description + '1.3.6.1.4.1.1466.115.121.1.38': (format_unicode, None), # OID + '1.3.6.1.4.1.1466.115.121.1.39': (format_unicode, None), # Other mailbox + '1.3.6.1.4.1.1466.115.121.1.40': (format_binary, None), # Octet string + '1.3.6.1.4.1.1466.115.121.1.41': (format_unicode, None), # Postal address + '1.3.6.1.4.1.1466.115.121.1.42': (format_binary, None), # Protocol Information [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.43': (format_binary, None), # Presentation Address [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.44': (format_unicode, None), # Printable string + '1.3.6.1.4.1.1466.115.121.1.45': (format_binary, None), # Subtree specification [OBSOLETE + '1.3.6.1.4.1.1466.115.121.1.46': (format_binary, None), # Supplier Information [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.47': (format_binary, None), # Supplier Or Consumer [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.48': (format_binary, None), # Supplier And Consumer [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.49': (format_binary, None), # Supported Algorithm [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.50': (format_unicode, None), # Telephone number + '1.3.6.1.4.1.1466.115.121.1.51': (format_unicode, None), # Teletex terminal identifier + '1.3.6.1.4.1.1466.115.121.1.52': (format_unicode, None), # Teletex number + '1.3.6.1.4.1.1466.115.121.1.53': (format_time, validate_time), # Utc time (deprecated) + '1.3.6.1.4.1.1466.115.121.1.54': (format_unicode, None), # LDAP syntax description + '1.3.6.1.4.1.1466.115.121.1.55': (format_binary, None), # Modify rights [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.56': (format_binary, None), # LDAP Schema Definition [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.57': (format_unicode, None), # LDAP Schema Description [OBSOLETE] + '1.3.6.1.4.1.1466.115.121.1.58': (format_unicode, None), # Substring assertion + '1.3.6.1.1.16.1': (format_uuid, validate_uuid), # UUID + '1.3.6.1.1.16.4': (format_uuid, validate_uuid), # entryUUID (RFC 4530) + '2.16.840.1.113719.1.1.4.1.501': (format_uuid, validate_guid), # GUID (Novell) + '2.16.840.1.113719.1.1.5.1.0': (format_binary, None), # Unknown (Novell) + '2.16.840.1.113719.1.1.5.1.6': (format_unicode, None), # Case Ignore List (Novell) + '2.16.840.1.113719.1.1.5.1.12': (format_binary, None), # Tagged Data (Novell) + '2.16.840.1.113719.1.1.5.1.13': (format_binary, None), # Octet List (Novell) + '2.16.840.1.113719.1.1.5.1.14': (format_unicode, None), # Tagged String (Novell) + '2.16.840.1.113719.1.1.5.1.15': (format_unicode, None), # Tagged Name And String (Novell) + '2.16.840.1.113719.1.1.5.1.16': (format_binary, None), # NDS Replica Pointer (Novell) + '2.16.840.1.113719.1.1.5.1.17': (format_unicode, None), # NDS ACL (Novell) + '2.16.840.1.113719.1.1.5.1.19': (format_time, validate_time), # NDS Timestamp (Novell) + '2.16.840.1.113719.1.1.5.1.22': (format_integer, validate_integer), # Counter (Novell) + '2.16.840.1.113719.1.1.5.1.23': (format_unicode, None), # Tagged Name (Novell) + '2.16.840.1.113719.1.1.5.1.25': (format_unicode, None), # Typed Name (Novell) + 'supportedldapversion': (format_integer, None), # supportedLdapVersion (Microsoft) + 'octetstring': (format_binary, validate_uuid_le), # octect string (Microsoft) + '1.2.840.113556.1.4.2': (format_uuid_le, validate_uuid_le), # objectGUID (Microsoft) + '1.2.840.113556.1.4.13': (format_ad_timestamp, validate_ad_timestamp), # builtinCreationTime (Microsoft) + '1.2.840.113556.1.4.26': (format_ad_timestamp, validate_ad_timestamp), # creationTime (Microsoft) + '1.2.840.113556.1.4.49': (format_ad_timestamp, validate_ad_timestamp), # badPasswordTime (Microsoft) + '1.2.840.113556.1.4.51': (format_ad_timestamp, validate_ad_timestamp), # lastLogoff (Microsoft) + '1.2.840.113556.1.4.52': (format_ad_timestamp, validate_ad_timestamp), # lastLogon (Microsoft) + '1.2.840.113556.1.4.60': (format_ad_timedelta, validate_ad_timedelta), # lockoutDuration (Microsoft) + '1.2.840.113556.1.4.61': (format_ad_timedelta, validate_ad_timedelta), # lockOutObservationWindow (Microsoft) + '1.2.840.113556.1.4.74': (format_ad_timedelta, validate_ad_timedelta), # maxPwdAge (Microsoft) + '1.2.840.113556.1.4.78': (format_ad_timedelta, validate_ad_timedelta), # minPwdAge (Microsoft) + '1.2.840.113556.1.4.96': (format_ad_timestamp, validate_zero_and_minus_one_and_positive_int), # pwdLastSet (Microsoft, can be set to -1 only) + '1.2.840.113556.1.4.146': (format_sid, validate_sid), # objectSid (Microsoft) + '1.2.840.113556.1.4.159': (format_ad_timestamp, validate_ad_timestamp), # accountExpires (Microsoft) + '1.2.840.113556.1.4.662': (format_ad_timestamp, validate_ad_timestamp), # lockoutTime (Microsoft) + '1.2.840.113556.1.4.1696': (format_ad_timestamp, validate_ad_timestamp), # lastLogonTimestamp (Microsoft) + '1.3.6.1.4.1.42.2.27.8.1.17': (format_time_with_0_year, validate_time_with_0_year) # pwdAccountLockedTime (Novell) +} + + +def find_attribute_helpers(attr_type, name, custom_formatter): + """ + Tries to format following the OIDs info and format_helper specification. + Search for attribute oid, then attribute name (can be multiple), then attribute syntax + Precedence is: + 1. attribute name + 2. attribute oid(from schema) + 3. attribute names (from oid_info) + 4. attribute syntax (from schema) + Custom formatters can be defined in Server object and have precedence over the standard_formatters + If no formatter is found the raw_value is returned as bytes. + Attributes defined as SINGLE_VALUE in schema are returned as a single object, otherwise are returned as a list of object + Formatter functions can return any kind of object + return a tuple (formatter, validator) + """ + formatter = None + if custom_formatter and isinstance(custom_formatter, dict): # if custom formatters are defined they have precedence over the standard formatters + if name in custom_formatter: # search for attribute name, as returned by the search operation + formatter = custom_formatter[name] + + if not formatter and attr_type and attr_type.oid in custom_formatter: # search for attribute oid as returned by schema + formatter = custom_formatter[attr_type.oid] + if not formatter and attr_type and attr_type.oid_info: + if isinstance(attr_type.oid_info[2], SEQUENCE_TYPES): # search for multiple names defined in oid_info + for attr_name in attr_type.oid_info[2]: + if attr_name in custom_formatter: + formatter = custom_formatter[attr_name] + break + elif attr_type.oid_info[2] in custom_formatter: # search for name defined in oid_info + formatter = custom_formatter[attr_type.oid_info[2]] + + if not formatter and attr_type and attr_type.syntax in custom_formatter: # search for syntax defined in schema + formatter = custom_formatter[attr_type.syntax] + + if not formatter and name in standard_formatter: # search for attribute name, as returned by the search operation + formatter = standard_formatter[name] + + if not formatter and attr_type and attr_type.oid in standard_formatter: # search for attribute oid as returned by schema + formatter = standard_formatter[attr_type.oid] + + if not formatter and attr_type and attr_type.oid_info: + if isinstance(attr_type.oid_info[2], SEQUENCE_TYPES): # search for multiple names defined in oid_info + for attr_name in attr_type.oid_info[2]: + if attr_name in standard_formatter: + formatter = standard_formatter[attr_name] + break + elif attr_type.oid_info[2] in standard_formatter: # search for name defined in oid_info + formatter = standard_formatter[attr_type.oid_info[2]] + if not formatter and attr_type and attr_type.syntax in standard_formatter: # search for syntax defined in schema + formatter = standard_formatter[attr_type.syntax] + + if formatter is None: + return None, None + + return formatter + + +def format_attribute_values(schema, name, values, custom_formatter): + if not values: # RFCs states that attributes must always have values, but a flaky server returns empty values too + return [] + + if not isinstance(values, SEQUENCE_TYPES): + values = [values] + + if schema and schema.attribute_types and name in schema.attribute_types: + attr_type = schema.attribute_types[name] + else: + attr_type = None + + attribute_helpers = find_attribute_helpers(attr_type, name, custom_formatter) + if not isinstance(attribute_helpers, tuple): # custom formatter + formatter = attribute_helpers + else: + formatter = format_unicode if not attribute_helpers[0] else attribute_helpers[0] + + formatted_values = [formatter(raw_value) for raw_value in values] # executes formatter + if formatted_values: + return formatted_values[0] if (attr_type and attr_type.single_value) else formatted_values + else: # RFCs states that attributes must always have values, but AD return empty values in DirSync + return [] + + +def find_attribute_validator(schema, name, custom_validator): + if schema and schema.attribute_types and name in schema.attribute_types: + attr_type = schema.attribute_types[name] + else: + attr_type = None + + attribute_helpers = find_attribute_helpers(attr_type, name, custom_validator) + if not isinstance(attribute_helpers, tuple): # custom validator + validator = attribute_helpers + else: + if not attribute_helpers[1]: + if attr_type and attr_type.single_value: + validator = validate_generic_single_value # validate only single value + else: + validator = always_valid # unknown syntax, accepts single and multi value + else: + validator = attribute_helpers[1] + return validator diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/validators.py b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/validators.py new file mode 100644 index 0000000000000000000000000000000000000000..d30b80f615f9e458fb544b605c2d30039b7502cb --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/formatters/validators.py @@ -0,0 +1,502 @@ +""" +""" + +# Created on 2016.08.09 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from binascii import a2b_hex, hexlify +from datetime import datetime +from calendar import timegm +from uuid import UUID +from struct import pack + + +from ... import SEQUENCE_TYPES, STRING_TYPES, NUMERIC_TYPES, INTEGER_TYPES +from .formatters import format_time, format_ad_timestamp +from ...utils.conv import to_raw, to_unicode, ldap_escape_to_bytes, escape_bytes + +# Validators return True if value is valid, False if value is not valid, +# or a value different from True and False that is a valid value to substitute to the input value + + +def check_backslash(value): + if isinstance(value, (bytearray, bytes)): + if b'\\' in value: + value = value.replace(b'\\', b'\\5C') + elif isinstance(value, STRING_TYPES): + if '\\' in value: + value = value.replace('\\', '\\5C') + return value + + +def check_type(input_value, value_type): + if isinstance(input_value, value_type): + return True + + if isinstance(input_value, SEQUENCE_TYPES): + for value in input_value: + if not isinstance(value, value_type): + return False + return True + + return False + + +# noinspection PyUnusedLocal +def always_valid(input_value): + return True + + +def validate_generic_single_value(input_value): + if not isinstance(input_value, SEQUENCE_TYPES): + return True + + try: # object couldn't have a __len__ method + if len(input_value) == 1: + return True + except Exception: + pass + + return False + + +def validate_zero_and_minus_one_and_positive_int(input_value): + """Accept -1 and 0 only (used by pwdLastSet in AD) + """ + if not isinstance(input_value, SEQUENCE_TYPES): + if isinstance(input_value, NUMERIC_TYPES) or isinstance(input_value, STRING_TYPES): + return True if int(input_value) >= -1 else False + return False + else: + if len(input_value) == 1 and (isinstance(input_value[0], NUMERIC_TYPES) or isinstance(input_value[0], STRING_TYPES)): + return True if int(input_value[0]) >= -1 else False + + return False + + +def validate_integer(input_value): + if check_type(input_value, (float, bool)): + return False + if check_type(input_value, INTEGER_TYPES): + return True + + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] # builds a list of valid int values + from decimal import Decimal, InvalidOperation + for element in input_value: + try: #try to convert any type to int, an invalid conversion raise TypeError or ValueError, doublecheck with Decimal type, if both are valid and equal then then int() value is used + value = to_unicode(element) if isinstance(element, bytes) else element + decimal_value = Decimal(value) + int_value = int(value) + if decimal_value == int_value: + valid_values.append(int_value) + else: + return False + except (ValueError, TypeError, InvalidOperation): + return False + + if sequence: + return valid_values + else: + return valid_values[0] + + +def validate_bytes(input_value): + return check_type(input_value, bytes) + + +def validate_boolean(input_value): + # it could be a real bool or the string TRUE or FALSE, # only a single valued is allowed + if validate_generic_single_value(input_value): # valid only if a single value or a sequence with a single element + if isinstance(input_value, SEQUENCE_TYPES): + input_value = input_value[0] + if isinstance(input_value, bool): + if input_value: + return 'TRUE' + else: + return 'FALSE' + if str is not bytes and isinstance(input_value, bytes): # python3 try to converts bytes to string + input_value = to_unicode(input_value) + if isinstance(input_value, STRING_TYPES): + if input_value.lower() == 'true': + return 'TRUE' + elif input_value.lower() == 'false': + return 'FALSE' + return False + + +def validate_time_with_0_year(input_value): + # validates generalized time but accept a 0000 year too + # if datetime object doesn't have a timezone it's considered local time and is adjusted to UTC + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + if str is not bytes and isinstance(element, bytes): # python3 try to converts bytes to string + element = to_unicode(element) + if isinstance(element, STRING_TYPES): # tries to check if it is already be a Generalized Time + if element.startswith('0000') or isinstance(format_time(to_raw(element)), datetime): # valid Generalized Time string + valid_values.append(element) + else: + return False + elif isinstance(element, datetime): + changed = True + if element.tzinfo: # a datetime with a timezone + valid_values.append(element.strftime('%Y%m%d%H%M%S%z')) + else: # datetime without timezone, assumed local and adjusted to UTC + offset = datetime.now() - datetime.utcnow() + valid_values.append((element - offset).strftime('%Y%m%d%H%M%SZ')) + else: + return False + + if changed: + if sequence: + return valid_values + else: + return valid_values[0] + else: + return True + + +def validate_time(input_value): + # if datetime object doesn't have a timezone it's considered local time and is adjusted to UTC + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + if str is not bytes and isinstance(element, bytes): # python3 try to converts bytes to string + element = to_unicode(element) + if isinstance(element, STRING_TYPES): # tries to check if it is already be a Generalized Time + if isinstance(format_time(to_raw(element)), datetime): # valid Generalized Time string + valid_values.append(element) + else: + return False + elif isinstance(element, datetime): + changed = True + if element.tzinfo: # a datetime with a timezone + valid_values.append(element.strftime('%Y%m%d%H%M%S%z')) + else: # datetime without timezone, assumed local and adjusted to UTC + offset = datetime.now() - datetime.utcnow() + valid_values.append((element - offset).strftime('%Y%m%d%H%M%SZ')) + else: + return False + + if changed: + if sequence: + return valid_values + else: + return valid_values[0] + else: + return True + + +def validate_ad_timestamp(input_value): + """ + Active Directory stores date/time values as the number of 100-nanosecond intervals + that have elapsed since the 0 hour on January 1, 1601 till the date/time that is being stored. + The time is always stored in Greenwich Mean Time (GMT) in the Active Directory. + """ + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + if str is not bytes and isinstance(element, bytes): # python3 try to converts bytes to string + element = to_unicode(element) + if isinstance(element, NUMERIC_TYPES): + if 0 <= element <= 9223372036854775807: # min and max for the AD timestamp starting from 12:00 AM January 1, 1601 + valid_values.append(element) + else: + return False + elif isinstance(element, STRING_TYPES): # tries to check if it is already be a AD timestamp + if isinstance(format_ad_timestamp(to_raw(element)), datetime): # valid Generalized Time string + valid_values.append(element) + else: + return False + elif isinstance(element, datetime): + changed = True + if element.tzinfo: # a datetime with a timezone + valid_values.append(to_raw((timegm(element.utctimetuple()) + 11644473600) * 10000000, encoding='ascii')) + else: # datetime without timezone, assumed local and adjusted to UTC + offset = datetime.now() - datetime.utcnow() + valid_values.append(to_raw((timegm((element - offset).timetuple()) + 11644473600) * 10000000, encoding='ascii')) + else: + return False + + if changed: + if sequence: + return valid_values + else: + return valid_values[0] + else: + return True + + +def validate_ad_timedelta(input_value): + """ + Should be validated like an AD timestamp except that since it is a time + delta, it is stored as a negative number. + """ + if not isinstance(input_value, INTEGER_TYPES) or input_value > 0: + return False + return validate_ad_timestamp(input_value * -1) + + +def validate_guid(input_value): + """ + object guid in uuid format (Novell eDirectory) + """ + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + if isinstance(element, STRING_TYPES): + try: + valid_values.append(UUID(element).bytes) + changed = True + except ValueError: # try if the value is an escaped ldap byte sequence + try: + x = ldap_escape_to_bytes(element) + valid_values.append(UUID(bytes=x).bytes) + changed = True + continue + except ValueError: + if str is not bytes: # python 3 + pass + else: + valid_values.append(element) + continue + return False + elif isinstance(element, (bytes, bytearray)): # assumes bytes are valid + valid_values.append(element) + else: + return False + + if changed: + # valid_values = [check_backslash(value) for value in valid_values] + if sequence: + return valid_values + else: + return valid_values[0] + else: + return True + + +def validate_uuid(input_value): + """ + object entryUUID in uuid format + """ + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + if isinstance(element, STRING_TYPES): + try: + valid_values.append(str(UUID(element))) + changed = True + except ValueError: # try if the value is an escaped byte sequence + try: + valid_values.append(str(UUID(element.replace('\\', '')))) + changed = True + continue + except ValueError: + if str is not bytes: # python 3 + pass + else: + valid_values.append(element) + continue + return False + elif isinstance(element, (bytes, bytearray)): # assumes bytes are valid + valid_values.append(element) + else: + return False + + if changed: + # valid_values = [check_backslash(value) for value in valid_values] + if sequence: + return valid_values + else: + return valid_values[0] + else: + return True + + +def validate_uuid_le(input_value): + r""" + Active Directory stores objectGUID in uuid_le format, follows RFC4122 and MS-DTYP: + "{07039e68-4373-264d-a0a7-07039e684373}": string representation big endian, converted to little endian (with or without brace curles) + "689e030773434d26a7a007039e684373": packet representation, already in little endian + "\68\9e\03\07\73\43\4d\26\a7\a0\07\03\9e\68\43\73": bytes representation, already in little endian + byte sequence: already in little endian + + """ + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + error = False + if isinstance(element, STRING_TYPES): + if element[0] == '{' and element[-1] == '}': + try: + valid_values.append(UUID(hex=element).bytes_le) # string representation, value in big endian, converts to little endian + changed = True + except ValueError: + error = True + elif '-' in element: + try: + valid_values.append(UUID(hex=element).bytes_le) # string representation, value in big endian, converts to little endian + changed = True + except ValueError: + error = True + elif '\\' in element: + try: + valid_values.append(UUID(bytes_le=ldap_escape_to_bytes(element)).bytes_le) # byte representation, value in little endian + changed = True + except ValueError: + error = True + elif '-' not in element: # value in little endian + try: + valid_values.append(UUID(bytes_le=a2b_hex(element)).bytes_le) # packet representation, value in little endian, converts to little endian + changed = True + except ValueError: + error = True + if error and (str is bytes): # python2 only assume value is bytes and valid + valid_values.append(element) # value is untouched, must be in little endian + elif isinstance(element, (bytes, bytearray)): # assumes bytes are valid uuid + valid_values.append(element) # value is untouched, must be in little endian + else: + return False + + if changed: + # valid_values = [check_backslash(value) for value in valid_values] + if sequence: + return valid_values + else: + return valid_values[0] + else: + return True + + +def validate_sid(input_value): + """ + SID= "S-1-" IdentifierAuthority 1*SubAuthority + IdentifierAuthority= IdentifierAuthorityDec / IdentifierAuthorityHex + ; If the identifier authority is < 2^32, the + ; identifier authority is represented as a decimal + ; number + ; If the identifier authority is >= 2^32, + ; the identifier authority is represented in + ; hexadecimal + IdentifierAuthorityDec = 1*10DIGIT + ; IdentifierAuthorityDec, top level authority of a + ; security identifier is represented as a decimal number + IdentifierAuthorityHex = "0x" 12HEXDIG + ; IdentifierAuthorityHex, the top-level authority of a + ; security identifier is represented as a hexadecimal number + SubAuthority= "-" 1*10DIGIT + ; Sub-Authority is always represented as a decimal number + ; No leading "0" characters are allowed when IdentifierAuthority + ; or SubAuthority is represented as a decimal number + ; All hexadecimal digits must be output in string format, + ; pre-pended by "0x" + + Revision (1 byte): An 8-bit unsigned integer that specifies the revision level of the SID. This value MUST be set to 0x01. + SubAuthorityCount (1 byte): An 8-bit unsigned integer that specifies the number of elements in the SubAuthority array. The maximum number of elements allowed is 15. + IdentifierAuthority (6 bytes): A SID_IDENTIFIER_AUTHORITY structure that indicates the authority under which the SID was created. It describes the entity that created the SID. The Identifier Authority value {0,0,0,0,0,5} denotes SIDs created by the NT SID authority. + SubAuthority (variable): A variable length array of unsigned 32-bit integers that uniquely identifies a principal relative to the IdentifierAuthority. Its length is determined by SubAuthorityCount. + + If you have a SID like S-a-b-c-d-e-f-g-... + + Then the bytes are + a (revision) + N (number of dashes minus two) + bbbbbb (six bytes of "b" treated as a 48-bit number in big-endian format) + cccc (four bytes of "c" treated as a 32-bit number in little-endian format) + dddd (four bytes of "d" treated as a 32-bit number in little-endian format) + eeee (four bytes of "e" treated as a 32-bit number in little-endian format) + ffff (four bytes of "f" treated as a 32-bit number in little-endian format) + + """ + if not isinstance(input_value, SEQUENCE_TYPES): + sequence = False + input_value = [input_value] + else: + sequence = True # indicates if a sequence must be returned + + valid_values = [] + changed = False + for element in input_value: + if isinstance(element, STRING_TYPES): + if element.startswith('S-'): + parts = element.split('-') + sid_bytes = pack('q', int(parts[2]))[2:] # authority (in dec) + else: + sid_bytes += pack('>q', int(parts[2], 16))[2:] # authority (in hex) + for sub_auth in parts[3:]: + sid_bytes += pack('. + +import ctypes + +from pyasn1.type.namedtype import NamedTypes, NamedType +from pyasn1.type.tag import Tag, tagClassApplication, tagFormatConstructed +from pyasn1.type.univ import Sequence, OctetString, Integer +from .rfc4511 import ResultCode, LDAPString +from .controls import build_control + + +class SicilyBindResponse(Sequence): + # SicilyBindResponse ::= [APPLICATION 1] SEQUENCE { + # + # resultCode ENUMERATED { + # success (0), + # protocolError (2), + # adminLimitExceeded (11), + # inappropriateAuthentication (48), + # invalidCredentials (49), + # busy (51), + # unavailable (52), + # unwillingToPerform (53), + # other (80) }, + # + # serverCreds OCTET STRING, + # errorMessage LDAPString } + # BindResponse ::= [APPLICATION 1] SEQUENCE { + # COMPONENTS OF LDAPResult, + # serverSaslCreds [7] OCTET STRING OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 1)) + componentType = NamedTypes(NamedType('resultCode', ResultCode()), + NamedType('serverCreds', OctetString()), + NamedType('errorMessage', LDAPString()) + ) + + +class DirSyncControlRequestValue(Sequence): + # DirSyncRequestValue ::= SEQUENCE { + # Flags integer + # MaxBytes integer + # Cookie OCTET STRING } + componentType = NamedTypes(NamedType('Flags', Integer()), + NamedType('MaxBytes', Integer()), + NamedType('Cookie', OctetString()) + ) + + +class DirSyncControlResponseValue(Sequence): + # DirSyncResponseValue ::= SEQUENCE { + # MoreResults INTEGER + # unused INTEGER + # CookieServer OCTET STRING + # } + componentType = NamedTypes(NamedType('MoreResults', Integer()), + NamedType('unused', Integer()), + NamedType('CookieServer', OctetString()) + ) + + +class SdFlags(Sequence): + # SDFlagsRequestValue ::= SEQUENCE { + # Flags INTEGER + # } + componentType = NamedTypes(NamedType('Flags', Integer()) + ) + + +class ExtendedDN(Sequence): + # A flag value 0 specifies that the GUID and SID values be returned in hexadecimal string + # A flag value of 1 will return the GUID and SID values in standard string format + componentType = NamedTypes(NamedType('option', Integer()) + ) + + +def dir_sync_control(criticality, object_security, ancestors_first, public_data_only, incremental_values, max_length, cookie): + control_value = DirSyncControlRequestValue() + flags = 0x0 + if object_security: + flags |= 0x00000001 + + if ancestors_first: + flags |= 0x00000800 + + if public_data_only: + flags |= 0x00002000 + + if incremental_values: + flags |= 0x80000000 + # converts flags to signed 32 bit (AD expects a 4 bytes long unsigned integer, but ASN.1 Integer type is signed + # so the BER encoder gives back a 5 bytes long signed integer + flags = ctypes.c_long(flags & 0xFFFFFFFF).value + + control_value.setComponentByName('Flags', flags) + control_value.setComponentByName('MaxBytes', max_length) + if cookie: + control_value.setComponentByName('Cookie', cookie) + else: + control_value.setComponentByName('Cookie', OctetString('')) + return build_control('1.2.840.113556.1.4.841', criticality, control_value) + + +def extended_dn_control(criticality=False, hex_format=False): + control_value = ExtendedDN() + control_value.setComponentByName('option', Integer(not hex_format)) + return build_control('1.2.840.113556.1.4.529', criticality, control_value) + + +def show_deleted_control(criticality=False): + return build_control('1.2.840.113556.1.4.417', criticality, value=None) + + +def security_descriptor_control(criticality=False, sdflags=0x0F): + sdcontrol = SdFlags() + sdcontrol.setComponentByName('Flags', sdflags) + return [build_control('1.2.840.113556.1.4.801', criticality, sdcontrol)] + +def persistent_search_control(criticality=False): + return build_control('1.2.840.113556.1.4.528', criticality, value=None) \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/novell.py b/python/user_packages/Python313/site-packages/ldap3/protocol/novell.py new file mode 100644 index 0000000000000000000000000000000000000000..af8aeb31be326b904a5b30ffd62a922c6d5d1578 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/novell.py @@ -0,0 +1,141 @@ +""" +""" + +# Created on 2014.06.27 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1.type.univ import OctetString, Integer, Sequence, SequenceOf +from pyasn1.type.namedtype import NamedType, NamedTypes, OptionalNamedType +from pyasn1.type.tag import Tag, tagFormatSimple, tagClassUniversal, TagSet + +NMAS_LDAP_EXT_VERSION = 1 + + +class Identity(OctetString): + encoding = 'utf-8' + + +class LDAPDN(OctetString): + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 4)) + encoding = 'utf-8' + + +class Password(OctetString): + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 4)) + encoding = 'utf-8' + + +class LDAPOID(OctetString): + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 4)) + encoding = 'utf-8' + + +class GroupCookie(Integer): + tagSet = Integer.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 2)) + + +class NmasVer(Integer): + tagSet = Integer.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 2)) + + +class Error(Integer): + tagSet = Integer.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 2)) + + +class NmasGetUniversalPasswordRequestValue(Sequence): + componentType = NamedTypes(NamedType('nmasver', NmasVer()), + NamedType('reqdn', Identity()) + ) + + +class NmasGetUniversalPasswordResponseValue(Sequence): + componentType = NamedTypes(NamedType('nmasver', NmasVer()), + NamedType('err', Error()), + OptionalNamedType('passwd', Password()) + ) + + +class NmasSetUniversalPasswordRequestValue(Sequence): + componentType = NamedTypes(NamedType('nmasver', NmasVer()), + NamedType('reqdn', Identity()), + NamedType('new_passwd', Password()) + ) + + +class NmasSetUniversalPasswordResponseValue(Sequence): + componentType = NamedTypes(NamedType('nmasver', NmasVer()), + NamedType('err', Error()) + ) + + +class ReplicaList(SequenceOf): + componentType = OctetString() + + +class ReplicaInfoRequestValue(Sequence): + tagSet = TagSet() + componentType = NamedTypes(NamedType('server_dn', LDAPDN()), + NamedType('partition_dn', LDAPDN()) + ) + + +class ReplicaInfoResponseValue(Sequence): + # tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 3)) + tagSet = TagSet() + componentType = NamedTypes(NamedType('partition_id', Integer()), + NamedType('replica_state', Integer()), + NamedType('modification_time', Integer()), + NamedType('purge_time', Integer()), + NamedType('local_partition_id', Integer()), + NamedType('partition_dn', LDAPDN()), + NamedType('replica_type', Integer()), + NamedType('flags', Integer()) + ) + + +class CreateGroupTypeRequestValue(Sequence): + componentType = NamedTypes(NamedType('createGroupType', LDAPOID()), + OptionalNamedType('createGroupValue', OctetString()) + ) + + +class CreateGroupTypeResponseValue(Sequence): + componentType = NamedTypes(NamedType('createGroupCookie', GroupCookie()), + OptionalNamedType('createGroupValue', OctetString()) + ) + + +class EndGroupTypeRequestValue(Sequence): + componentType = NamedTypes(NamedType('endGroupCookie', GroupCookie()), + OptionalNamedType('endGroupValue', OctetString()) + ) + + +class EndGroupTypeResponseValue(Sequence): + componentType = NamedTypes(OptionalNamedType('endGroupValue', OctetString()) + ) + + +class GroupingControlValue(Sequence): + componentType = NamedTypes(NamedType('groupingCookie', GroupCookie()), + OptionalNamedType('groupValue', OctetString()) + ) diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/oid.py b/python/user_packages/Python313/site-packages/ldap3/protocol/oid.py new file mode 100644 index 0000000000000000000000000000000000000000..6dfadd3aa95ebaf93bd1ba3eff88be219057adc4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/oid.py @@ -0,0 +1,1208 @@ +""" +""" + +# Created on 2013.08.30 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import SEQUENCE_TYPES + +# Holds info about OIDs. +# Each OID info is a named tuple with the following attributes: +# oid - the OID number +# type - type of OID +# name - description of OID +# doc - reference document of OID +# +# Source of information is IANA ldap-parameters.txt, oid-registry and products documentation as of 2013.08.21 + + +# OID database definition +OID_CONTROL = 'CONTROL' +OID_EXTENSION = 'EXTENSION' +OID_FEATURE = 'FEATURE' +OID_UNSOLICITED_NOTICE = 'UNSOLICITED_NOTICE' +OID_ATTRIBUTE_TYPE = 'ATTRIBUTE_TYPE' +OID_DIT_CONTENT_RULE = 'DIT_CONTENT_RULE' +OID_LDAP_URL_EXTENSION = 'LDAP_URL_EXTENSION' +OID_FAMILY = 'FAMILY' +OID_MATCHING_RULE = 'MATCHING_RULE' +OID_NAME_FORM = 'NAME_FORM' +OID_OBJECT_CLASS = 'OBJECT_CLASS' +OID_ADMINISTRATIVE_ROLE = 'ADMINISTRATIVE_ROLE' +OID_LDAP_SYNTAX = 'LDAP_SYNTAX' + +# class kind +CLASS_STRUCTURAL = 'STRUCTURAL' +CLASS_ABSTRACT = 'ABSTRACT' +CLASS_AUXILIARY = 'AUXILIARY' + +# attribute kind +ATTRIBUTE_USER_APPLICATION = 'USER_APPLICATION' +ATTRIBUTE_DIRECTORY_OPERATION = 'DIRECTORY_OPERATION' +ATTRIBUTE_DISTRIBUTED_OPERATION = 'DISTRIBUTED_OPERATION' +ATTRIBUTE_DSA_OPERATION = 'DSA_OPERATION' + + +def constant_to_oid_kind(oid_kind): + if oid_kind == OID_CONTROL: + return 'Control' + elif oid_kind == OID_EXTENSION: + return 'Extension' + elif oid_kind == OID_FEATURE: + return 'Feature' + elif oid_kind == OID_UNSOLICITED_NOTICE: + return 'Unsolicited Notice' + elif oid_kind == OID_ATTRIBUTE_TYPE: + return 'Attribute Type' + elif oid_kind == OID_DIT_CONTENT_RULE: + return 'DIT Content Rule' + elif oid_kind == OID_LDAP_URL_EXTENSION: + return 'LDAP URL Extension' + elif oid_kind == OID_FAMILY: + return 'Family' + elif oid_kind == OID_MATCHING_RULE: + return 'Matching Rule' + elif oid_kind == OID_NAME_FORM: + return 'Name Form' + elif oid_kind == OID_OBJECT_CLASS: + return 'Object Class' + elif oid_kind == OID_ADMINISTRATIVE_ROLE: + return 'Administrative Role' + elif oid_kind == OID_LDAP_SYNTAX: + return 'LDAP Syntax' + else: + return 'Unknown' + + +def decode_oids(sequence): + if sequence: + return sorted([Oids.get(oid, (oid, None, None, None)) for oid in sequence if oid]) + return list() + + +def decode_syntax(syntax): + if not syntax: + return None + return Oids.get(syntax, None) + + +def oid_to_string(oid): + s = oid[0] + if oid[2]: + s += ' - ' + ((', '.join(oid[2])) if isinstance(oid[2], SEQUENCE_TYPES) else oid[2]) + s += (' - ' + constant_to_oid_kind(oid[1])) if oid[1] is not None else '' + s += (' - ' + oid[3]) if oid[3] else '' + + return s + +# tuple structure: (oid, kind, name, docs) + +# noinspection PyPep8 +Oids = { # administrative role + '2.5.23.1': ('2.5.23.1', OID_ADMINISTRATIVE_ROLE, 'autonomousArea', 'RFC3672'), + '2.5.23.2': ('2.5.23.2', OID_ADMINISTRATIVE_ROLE, 'accessControlSpecificArea', 'RFC3672'), + '2.5.23.3': ('2.5.23.3', OID_ADMINISTRATIVE_ROLE, 'accessControlInnerArea', 'RFC3672'), + '2.5.23.4': ('2.5.23.4', OID_ADMINISTRATIVE_ROLE, 'subschemaAdminSpecificArea', 'RFC3672'), + '2.5.23.5': ('2.5.23.5', OID_ADMINISTRATIVE_ROLE, 'collectiveAttributeSpecificArea', 'RFC3672'), + '2.5.23.6': ('2.5.23.6', OID_ADMINISTRATIVE_ROLE, 'collectiveAttributeInnerArea', 'RFC3672'), + + # attributes type + '0.9.2342.19200300.100.1.1': ('0.9.2342.19200300.100.1.1', OID_ATTRIBUTE_TYPE, ['uid', 'userId'], 'RFC4519'), + '0.9.2342.19200300.100.1.2': ('0.9.2342.19200300.100.1.2', OID_ATTRIBUTE_TYPE, 'textEncodedORAddress', 'RFC1274'), + '0.9.2342.19200300.100.1.3': ('0.9.2342.19200300.100.1.3', OID_ATTRIBUTE_TYPE, ['mail', 'RFC822Mailbox'], 'RFC4524'), + '0.9.2342.19200300.100.1.4': ('0.9.2342.19200300.100.1.4', OID_ATTRIBUTE_TYPE, 'info', 'RFC4524'), + '0.9.2342.19200300.100.1.5': ('0.9.2342.19200300.100.1.5', OID_ATTRIBUTE_TYPE, ['drink', 'favouriteDrink'], 'RFC4524'), + '0.9.2342.19200300.100.1.6': ('0.9.2342.19200300.100.1.6', OID_ATTRIBUTE_TYPE, 'roomNumber', 'RFC4524'), + '0.9.2342.19200300.100.1.7': ('0.9.2342.19200300.100.1.7', OID_ATTRIBUTE_TYPE, 'photo', 'RFC1274'), + '0.9.2342.19200300.100.1.8': ('0.9.2342.19200300.100.1.8', OID_ATTRIBUTE_TYPE, 'userClass', 'RFC4524'), + '0.9.2342.19200300.100.1.9': ('0.9.2342.19200300.100.1.9', OID_ATTRIBUTE_TYPE, 'host', 'RFC4524'), + '0.9.2342.19200300.100.1.10': ('0.9.2342.19200300.100.1.10', OID_ATTRIBUTE_TYPE, 'manager', 'RFC4524'), + '0.9.2342.19200300.100.1.11': ('0.9.2342.19200300.100.1.11', OID_ATTRIBUTE_TYPE, 'documentIdentifier', 'RFC4524'), + '0.9.2342.19200300.100.1.12': ('0.9.2342.19200300.100.1.12', OID_ATTRIBUTE_TYPE, 'documentTitle', 'RFC4524'), + '0.9.2342.19200300.100.1.13': ('0.9.2342.19200300.100.1.13', OID_ATTRIBUTE_TYPE, 'documentVersion', 'RFC4524'), + '0.9.2342.19200300.100.1.14': ('0.9.2342.19200300.100.1.14', OID_ATTRIBUTE_TYPE, 'documentAuthor', 'RFC4524'), + '0.9.2342.19200300.100.1.15': ('0.9.2342.19200300.100.1.15', OID_ATTRIBUTE_TYPE, 'documentLocation', 'RFC4524'), + '0.9.2342.19200300.100.1.20': ('0.9.2342.19200300.100.1.20', OID_ATTRIBUTE_TYPE, ['homePhone', 'homeTelephone'], 'RFC4524'), + '0.9.2342.19200300.100.1.21': ('0.9.2342.19200300.100.1.21', OID_ATTRIBUTE_TYPE, 'secretary', 'RFC4524'), + '0.9.2342.19200300.100.1.22': ('0.9.2342.19200300.100.1.22', OID_ATTRIBUTE_TYPE, 'otherMailbox', 'RFC1274'), + '0.9.2342.19200300.100.1.23': ('0.9.2342.19200300.100.1.23', OID_ATTRIBUTE_TYPE, 'lastModifiedTime', 'RFC1274'), + '0.9.2342.19200300.100.1.24': ('0.9.2342.19200300.100.1.24', OID_ATTRIBUTE_TYPE, 'lastModifiedBy', 'RFC1274'), + '0.9.2342.19200300.100.1.25': ('0.9.2342.19200300.100.1.25', OID_ATTRIBUTE_TYPE, ['DC', 'domainComponent'], 'RFC4519'), + '0.9.2342.19200300.100.1.26': ('0.9.2342.19200300.100.1.26', OID_ATTRIBUTE_TYPE, 'aRecord', 'RFC1274'), + '0.9.2342.19200300.100.1.27': ('0.9.2342.19200300.100.1.27', OID_ATTRIBUTE_TYPE, 'mDRecord', 'RFC1274'), + '0.9.2342.19200300.100.1.28': ('0.9.2342.19200300.100.1.28', OID_ATTRIBUTE_TYPE, 'mXRecord', 'RFC1274'), + '0.9.2342.19200300.100.1.29': ('0.9.2342.19200300.100.1.29', OID_ATTRIBUTE_TYPE, 'nSRecord', 'RFC1274'), + '0.9.2342.19200300.100.1.30': ('0.9.2342.19200300.100.1.30', OID_ATTRIBUTE_TYPE, 'sOARecord', 'RFC1274'), + '0.9.2342.19200300.100.1.31': ('0.9.2342.19200300.100.1.31', OID_ATTRIBUTE_TYPE, 'cNAMERecord', 'RFC1274'), + '0.9.2342.19200300.100.1.37': ('0.9.2342.19200300.100.1.37', OID_ATTRIBUTE_TYPE, 'associatedDomain', 'RFC4524'), + '0.9.2342.19200300.100.1.38': ('0.9.2342.19200300.100.1.38', OID_ATTRIBUTE_TYPE, 'associatedName', 'RFC4524'), + '0.9.2342.19200300.100.1.39': ('0.9.2342.19200300.100.1.39', OID_ATTRIBUTE_TYPE, 'homePostalAddress', 'RFC4524'), + '0.9.2342.19200300.100.1.40': ('0.9.2342.19200300.100.1.40', OID_ATTRIBUTE_TYPE, 'personalTitle', 'RFC4524'), + '0.9.2342.19200300.100.1.41': ('0.9.2342.19200300.100.1.41', OID_ATTRIBUTE_TYPE, ['mobile', 'mobileTelephoneNumber'], 'RFC4524'), + '0.9.2342.19200300.100.1.42': ('0.9.2342.19200300.100.1.42', OID_ATTRIBUTE_TYPE, ['pager', 'pagerTelephoneNumber'], 'RFC4524'), + '0.9.2342.19200300.100.1.43': ('0.9.2342.19200300.100.1.43', OID_ATTRIBUTE_TYPE, ['co', 'friendlyCountryName'], 'RFC4524'), + '0.9.2342.19200300.100.1.44': ('0.9.2342.19200300.100.1.44', OID_ATTRIBUTE_TYPE, 'uniqueIdentifier', 'RFC4524'), + '0.9.2342.19200300.100.1.45': ('0.9.2342.19200300.100.1.45', OID_ATTRIBUTE_TYPE, 'organizationalStatus', 'RFC4524'), + '0.9.2342.19200300.100.1.46': ('0.9.2342.19200300.100.1.46', OID_ATTRIBUTE_TYPE, 'janetMailbox', 'RFC1274'), + '0.9.2342.19200300.100.1.47': ('0.9.2342.19200300.100.1.47', OID_ATTRIBUTE_TYPE, 'mailPreferenceOption', 'RFC1274'), + '0.9.2342.19200300.100.1.48': ('0.9.2342.19200300.100.1.48', OID_ATTRIBUTE_TYPE, 'buildingName', 'RFC4524'), + '0.9.2342.19200300.100.1.49': ('0.9.2342.19200300.100.1.49', OID_ATTRIBUTE_TYPE, 'dSAQuality', 'RFC1274'), + '0.9.2342.19200300.100.1.50': ('0.9.2342.19200300.100.1.50', OID_ATTRIBUTE_TYPE, 'singleLevelQuality', 'RFC4524'), + '0.9.2342.19200300.100.1.51': ('0.9.2342.19200300.100.1.51', OID_ATTRIBUTE_TYPE, 'subtreeMinimumQuality', 'RFC1274'), + '0.9.2342.19200300.100.1.52': ('0.9.2342.19200300.100.1.52', OID_ATTRIBUTE_TYPE, 'subtreeMaximumQuality', 'RFC1274'), + '0.9.2342.19200300.100.1.53': ('0.9.2342.19200300.100.1.53', OID_ATTRIBUTE_TYPE, 'personalSignature', 'RFC1274'), + '0.9.2342.19200300.100.1.54': ('0.9.2342.19200300.100.1.54', OID_ATTRIBUTE_TYPE, 'dITRedirect', 'RFC1274'), + '0.9.2342.19200300.100.1.55': ('0.9.2342.19200300.100.1.55', OID_ATTRIBUTE_TYPE, 'audio', 'RFC1274'), + '0.9.2342.19200300.100.1.56': ('0.9.2342.19200300.100.1.56', OID_ATTRIBUTE_TYPE, 'documentPublisher', 'RFC4524'), + '0.9.2342.19200300.100.1.60': ('0.9.2342.19200300.100.1.60', OID_ATTRIBUTE_TYPE, 'jpegPhoto', 'RFC2798'), + '1.2.840.113549.1.9.1': ('1.2.840.113549.1.9.1', OID_ATTRIBUTE_TYPE, ['email', 'emailAddress'], 'RFC3280'), + '1.2.840.113556.1.4.478': ('1.2.840.113556.1.4.478', OID_ATTRIBUTE_TYPE, 'calCalURI', 'RFC2739'), + '1.2.840.113556.1.4.479': ('1.2.840.113556.1.4.479', OID_ATTRIBUTE_TYPE, 'calFBURL', 'RFC2739'), + '1.2.840.113556.1.4.480': ('1.2.840.113556.1.4.480', OID_ATTRIBUTE_TYPE, 'calCAPURI', 'RFC2739'), + '1.2.840.113556.1.4.481': ('1.2.840.113556.1.4.481', OID_ATTRIBUTE_TYPE, 'calCalAdrURI', 'RFC2739'), + '1.2.840.113556.1.4.482': ('1.2.840.113556.1.4.482', OID_ATTRIBUTE_TYPE, 'calOtherCalURIs', 'RFC2739'), + '1.2.840.113556.1.4.483': ('1.2.840.113556.1.4.483', OID_ATTRIBUTE_TYPE, 'calOtherFBURLs', 'RFC2739'), + '1.2.840.113556.1.4.484': ('1.2.840.113556.1.4.484', OID_ATTRIBUTE_TYPE, 'calOtherCAPURIs', 'RFC2739'), + '1.2.840.113556.1.4.485': ('1.2.840.113556.1.4.485', OID_ATTRIBUTE_TYPE, 'calOtherCalAdrURIs', 'RFC2739'), + '1.3.18.0.2.4.1107': ('1.3.18.0.2.4.1107', OID_ATTRIBUTE_TYPE, 'printer-xri-supported', 'RFC3712'), + '1.3.18.0.2.4.1108': ('1.3.18.0.2.4.1108', OID_ATTRIBUTE_TYPE, 'printer-aliases', 'RFC3712'), + '1.3.18.0.2.4.1109': ('1.3.18.0.2.4.1109', OID_ATTRIBUTE_TYPE, 'printer-charset-configured', 'RFC3712'), + '1.3.18.0.2.4.1110': ('1.3.18.0.2.4.1110', OID_ATTRIBUTE_TYPE, 'printer-job-priority-supported', 'RFC3712'), + '1.3.18.0.2.4.1111': ('1.3.18.0.2.4.1111', OID_ATTRIBUTE_TYPE, 'printer-job-k-octets-supported', 'RFC3712'), + '1.3.18.0.2.4.1112': ('1.3.18.0.2.4.1112', OID_ATTRIBUTE_TYPE, 'printer-current-operator', 'RFC3712'), + '1.3.18.0.2.4.1113': ('1.3.18.0.2.4.1113', OID_ATTRIBUTE_TYPE, 'printer-service-person', 'RFC3712'), + '1.3.18.0.2.4.1114': ('1.3.18.0.2.4.1114', OID_ATTRIBUTE_TYPE, 'printer-delivery-orientation-supported', 'RFC3712'), + '1.3.18.0.2.4.1115': ('1.3.18.0.2.4.1115', OID_ATTRIBUTE_TYPE, 'printer-stacking-order-supported', 'RFC3712'), + '1.3.18.0.2.4.1116': ('1.3.18.0.2.4.1116', OID_ATTRIBUTE_TYPE, 'printer-output-features-supported', 'RFC3712'), + '1.3.18.0.2.4.1117': ('1.3.18.0.2.4.1117', OID_ATTRIBUTE_TYPE, 'printer-media-local-supported', 'RFC3712'), + '1.3.18.0.2.4.1118': ('1.3.18.0.2.4.1118', OID_ATTRIBUTE_TYPE, 'printer-copies-supported', 'RFC3712'), + '1.3.18.0.2.4.1119': ('1.3.18.0.2.4.1119', OID_ATTRIBUTE_TYPE, 'printer-natural-language-configured', 'RFC3712'), + '1.3.18.0.2.4.1120': ('1.3.18.0.2.4.1120', OID_ATTRIBUTE_TYPE, 'printer-print-quality-supported', 'RFC3712'), + '1.3.18.0.2.4.1121': ('1.3.18.0.2.4.1121', OID_ATTRIBUTE_TYPE, 'printer-resolution-supported', 'RFC3712'), + '1.3.18.0.2.4.1122': ('1.3.18.0.2.4.1122', OID_ATTRIBUTE_TYPE, 'printer-media-supported', 'RFC3712'), + '1.3.18.0.2.4.1123': ('1.3.18.0.2.4.1123', OID_ATTRIBUTE_TYPE, 'printer-sides-supported', 'RFC3712'), + '1.3.18.0.2.4.1124': ('1.3.18.0.2.4.1124', OID_ATTRIBUTE_TYPE, 'printer-number-up-supported', 'RFC3712'), + '1.3.18.0.2.4.1125': ('1.3.18.0.2.4.1125', OID_ATTRIBUTE_TYPE, 'printer-finishings-supported', 'RFC3712'), + '1.3.18.0.2.4.1126': ('1.3.18.0.2.4.1126', OID_ATTRIBUTE_TYPE, 'printer-pages-per-minute-color', 'RFC3712'), + '1.3.18.0.2.4.1127': ('1.3.18.0.2.4.1127', OID_ATTRIBUTE_TYPE, 'printer-pages-per-minute', 'RFC3712'), + '1.3.18.0.2.4.1128': ('1.3.18.0.2.4.1128', OID_ATTRIBUTE_TYPE, 'printer-compression-supported', 'RFC3712'), + '1.3.18.0.2.4.1129': ('1.3.18.0.2.4.1129', OID_ATTRIBUTE_TYPE, 'printer-color-supported', 'RFC3712'), + '1.3.18.0.2.4.1130': ('1.3.18.0.2.4.1130', OID_ATTRIBUTE_TYPE, 'printer-document-format-supported', 'RFC3712'), + '1.3.18.0.2.4.1131': ('1.3.18.0.2.4.1131', OID_ATTRIBUTE_TYPE, 'printer-charset-supported', 'RFC3712'), + '1.3.18.0.2.4.1132': ('1.3.18.0.2.4.1132', OID_ATTRIBUTE_TYPE, 'printer-multiple-document-jobs-supported', 'RFC3712'), + '1.3.18.0.2.4.1133': ('1.3.18.0.2.4.1133', OID_ATTRIBUTE_TYPE, 'printer-ipp-versions-supported', 'RFC3712'), + '1.3.18.0.2.4.1134': ('1.3.18.0.2.4.1134', OID_ATTRIBUTE_TYPE, 'printer-more-info', 'RFC3712'), + '1.3.18.0.2.4.1135': ('1.3.18.0.2.4.1135', OID_ATTRIBUTE_TYPE, 'printer-name', 'RFC3712'), + '1.3.18.0.2.4.1136': ('1.3.18.0.2.4.1136', OID_ATTRIBUTE_TYPE, 'printer-location', 'RFC3712'), + '1.3.18.0.2.4.1137': ('1.3.18.0.2.4.1137', OID_ATTRIBUTE_TYPE, 'printer-generated-natural-language-supported', 'RFC3712'), + '1.3.18.0.2.4.1138': ('1.3.18.0.2.4.1138', OID_ATTRIBUTE_TYPE, 'printer-make-and-model', 'RFC3712'), + '1.3.18.0.2.4.1139': ('1.3.18.0.2.4.1139', OID_ATTRIBUTE_TYPE, 'printer-info', 'RFC3712'), + '1.3.18.0.2.4.1140': ('1.3.18.0.2.4.1140', OID_ATTRIBUTE_TYPE, 'printer-uri', 'RFC3712'), + '1.3.6.1.1.10.4.1': ('1.3.6.1.1.10.4.1', OID_ATTRIBUTE_TYPE, 'uddiBusinessKey', 'RFC4403'), + '1.3.6.1.1.10.4.2': ('1.3.6.1.1.10.4.2', OID_ATTRIBUTE_TYPE, 'uddiAuthorizedName', 'RFC4403'), + '1.3.6.1.1.10.4.3': ('1.3.6.1.1.10.4.3', OID_ATTRIBUTE_TYPE, 'uddiOperator', 'RFC4403'), + '1.3.6.1.1.10.4.4': ('1.3.6.1.1.10.4.4', OID_ATTRIBUTE_TYPE, 'uddiName', 'RFC4403'), + '1.3.6.1.1.10.4.5': ('1.3.6.1.1.10.4.5', OID_ATTRIBUTE_TYPE, 'uddiDescription', 'RFC4403'), + '1.3.6.1.1.10.4.6': ('1.3.6.1.1.10.4.6', OID_ATTRIBUTE_TYPE, 'uddiDiscoveryURLs', 'RFC4403'), + '1.3.6.1.1.10.4.7': ('1.3.6.1.1.10.4.7', OID_ATTRIBUTE_TYPE, 'uddiUseType', 'RFC4403'), + '1.3.6.1.1.10.4.8': ('1.3.6.1.1.10.4.8', OID_ATTRIBUTE_TYPE, 'uddiPersonName', 'RFC4403'), + '1.3.6.1.1.10.4.9': ('1.3.6.1.1.10.4.9', OID_ATTRIBUTE_TYPE, 'uddiPhone', 'RFC4403'), + '1.3.6.1.1.10.4.10': ('1.3.6.1.1.10.4.10', OID_ATTRIBUTE_TYPE, 'uddiEMail', 'RFC4403'), + '1.3.6.1.1.10.4.11': ('1.3.6.1.1.10.4.11', OID_ATTRIBUTE_TYPE, 'uddiSortCode', 'RFC4403'), + '1.3.6.1.1.10.4.12': ('1.3.6.1.1.10.4.12', OID_ATTRIBUTE_TYPE, 'uddiTModelKey', 'RFC4403'), + '1.3.6.1.1.10.4.13': ('1.3.6.1.1.10.4.13', OID_ATTRIBUTE_TYPE, 'uddiAddressLine', 'RFC4403'), + '1.3.6.1.1.10.4.14': ('1.3.6.1.1.10.4.14', OID_ATTRIBUTE_TYPE, 'uddiIdentifierBag', 'RFC4403'), + '1.3.6.1.1.10.4.15': ('1.3.6.1.1.10.4.15', OID_ATTRIBUTE_TYPE, 'uddiCategoryBag', 'RFC4403'), + '1.3.6.1.1.10.4.16': ('1.3.6.1.1.10.4.16', OID_ATTRIBUTE_TYPE, 'uddiKeyedReference', 'RFC4403'), + '1.3.6.1.1.10.4.17': ('1.3.6.1.1.10.4.17', OID_ATTRIBUTE_TYPE, 'uddiServiceKey', 'RFC4403'), + '1.3.6.1.1.10.4.18': ('1.3.6.1.1.10.4.18', OID_ATTRIBUTE_TYPE, 'uddiBindingKey', 'RFC4403'), + '1.3.6.1.1.10.4.19': ('1.3.6.1.1.10.4.19', OID_ATTRIBUTE_TYPE, 'uddiAccessPoint', 'RFC4403'), + '1.3.6.1.1.10.4.20': ('1.3.6.1.1.10.4.20', OID_ATTRIBUTE_TYPE, 'uddiHostingRedirector', 'RFC4403'), + '1.3.6.1.1.10.4.21': ('1.3.6.1.1.10.4.21', OID_ATTRIBUTE_TYPE, 'uddiInstanceDescription', 'RFC4403'), + '1.3.6.1.1.10.4.22': ('1.3.6.1.1.10.4.22', OID_ATTRIBUTE_TYPE, 'uddiInstanceParms', 'RFC4403'), + '1.3.6.1.1.10.4.23': ('1.3.6.1.1.10.4.23', OID_ATTRIBUTE_TYPE, 'uddiOverviewDescription', 'RFC4403'), + '1.3.6.1.1.10.4.24': ('1.3.6.1.1.10.4.24', OID_ATTRIBUTE_TYPE, 'uddiOverviewURL', 'RFC4403'), + '1.3.6.1.1.10.4.25': ('1.3.6.1.1.10.4.25', OID_ATTRIBUTE_TYPE, 'uddiFromKey', 'RFC4403'), + '1.3.6.1.1.10.4.26': ('1.3.6.1.1.10.4.26', OID_ATTRIBUTE_TYPE, 'uddiToKey', 'RFC4403'), + '1.3.6.1.1.10.4.27': ('1.3.6.1.1.10.4.27', OID_ATTRIBUTE_TYPE, 'uddiUUID', 'RFC4403'), + '1.3.6.1.1.10.4.28': ('1.3.6.1.1.10.4.28', OID_ATTRIBUTE_TYPE, 'uddiIsHidden', 'RFC4403'), + '1.3.6.1.1.10.4.29': ('1.3.6.1.1.10.4.29', OID_ATTRIBUTE_TYPE, 'uddiIsProjection', 'RFC4403'), + '1.3.6.1.1.10.4.30': ('1.3.6.1.1.10.4.30', OID_ATTRIBUTE_TYPE, 'uddiLang', 'RFC4403'), + '1.3.6.1.1.10.4.31': ('1.3.6.1.1.10.4.31', OID_ATTRIBUTE_TYPE, 'uddiv3BusinessKey', 'RFC4403'), + '1.3.6.1.1.10.4.32': ('1.3.6.1.1.10.4.32', OID_ATTRIBUTE_TYPE, 'uddiv3ServiceKey', 'RFC4403'), + '1.3.6.1.1.10.4.33': ('1.3.6.1.1.10.4.33', OID_ATTRIBUTE_TYPE, 'uddiv3BindingKey', 'RFC4403'), + '1.3.6.1.1.10.4.34': ('1.3.6.1.1.10.4.34', OID_ATTRIBUTE_TYPE, 'uddiv3TmodelKey', 'RFC4403'), + '1.3.6.1.1.10.4.35': ('1.3.6.1.1.10.4.35', OID_ATTRIBUTE_TYPE, 'uddiv3DigitalSignature', 'RFC4403'), + '1.3.6.1.1.10.4.36': ('1.3.6.1.1.10.4.36', OID_ATTRIBUTE_TYPE, 'uddiv3NodeId', 'RFC4403'), + '1.3.6.1.1.10.4.37': ('1.3.6.1.1.10.4.37', OID_ATTRIBUTE_TYPE, 'uddiv3EntityModificationTime', 'RFC4403'), + '1.3.6.1.1.10.4.38': ('1.3.6.1.1.10.4.38', OID_ATTRIBUTE_TYPE, 'uddiv3SubscriptionKey', 'RFC4403'), + '1.3.6.1.1.10.4.39': ('1.3.6.1.1.10.4.39', OID_ATTRIBUTE_TYPE, 'uddiv3SubscriptionFilter', 'RFC4403'), + '1.3.6.1.1.10.4.40': ('1.3.6.1.1.10.4.40', OID_ATTRIBUTE_TYPE, 'uddiv3NotificationInterval', 'RFC4403'), + '1.3.6.1.1.10.4.41': ('1.3.6.1.1.10.4.41', OID_ATTRIBUTE_TYPE, 'uddiv3MaxEntities', 'RFC4403'), + '1.3.6.1.1.10.4.42': ('1.3.6.1.1.10.4.42', OID_ATTRIBUTE_TYPE, 'uddiv3ExpiresAfter', 'RFC4403'), + '1.3.6.1.1.10.4.43': ('1.3.6.1.1.10.4.43', OID_ATTRIBUTE_TYPE, 'uddiv3BriefResponse', 'RFC4403'), + '1.3.6.1.1.10.4.44': ('1.3.6.1.1.10.4.44', OID_ATTRIBUTE_TYPE, 'uddiv3EntityKey', 'RFC4403'), + '1.3.6.1.1.10.4.45': ('1.3.6.1.1.10.4.45', OID_ATTRIBUTE_TYPE, 'uddiv3EntityCreationTime', 'RFC4403'), + '1.3.6.1.1.10.4.46': ('1.3.6.1.1.10.4.46', OID_ATTRIBUTE_TYPE, 'uddiv3EntityDeletionTime', 'RFC4403'), + '1.3.6.1.1.11.2.1': ('1.3.6.1.1.11.2.1', OID_ATTRIBUTE_TYPE, 'vPIMTelephoneNumber', 'RFC4237'), + '1.3.6.1.1.11.2.2': ('1.3.6.1.1.11.2.2', OID_ATTRIBUTE_TYPE, 'vPIMRfc822Mailbox', 'RFC4237'), + '1.3.6.1.1.11.2.3': ('1.3.6.1.1.11.2.3', OID_ATTRIBUTE_TYPE, 'vPIMSpokenName', 'RFC4237'), + '1.3.6.1.1.11.2.4': ('1.3.6.1.1.11.2.4', OID_ATTRIBUTE_TYPE, 'vPIMSupportedUABehaviors', 'RFC4237'), + '1.3.6.1.1.11.2.5': ('1.3.6.1.1.11.2.5', OID_ATTRIBUTE_TYPE, 'vPIMSupportedAudioMediaTypes', 'RFC4237'), + '1.3.6.1.1.11.2.6': ('1.3.6.1.1.11.2.6', OID_ATTRIBUTE_TYPE, 'vPIMSupportedMessageContext', 'RFC4237'), + '1.3.6.1.1.11.2.7': ('1.3.6.1.1.11.2.7', OID_ATTRIBUTE_TYPE, 'vPIMTextName', 'RFC4237'), + '1.3.6.1.1.11.2.8': ('1.3.6.1.1.11.2.8', OID_ATTRIBUTE_TYPE, 'vPIMExtendedAbsenceStatus', 'RFC4237'), + '1.3.6.1.1.11.2.9': ('1.3.6.1.1.11.2.9', OID_ATTRIBUTE_TYPE, 'vPIMMaxMessageSize', 'RFC4237'), + '1.3.6.1.1.11.2.10': ('1.3.6.1.1.11.2.10', OID_ATTRIBUTE_TYPE, 'vPIMSubMailboxes', 'RFC4237'), + '1.3.6.1.1.16.4': ('1.3.6.1.1.16.4', OID_ATTRIBUTE_TYPE, 'entryUUID', 'RFC4530'), + '1.3.6.1.1.20': ('1.3.6.1.1.20', OID_ATTRIBUTE_TYPE, 'entryDN', 'RFC5020'), + '1.3.6.1.1.6.2.3': ('1.3.6.1.1.6.2.3', OID_ATTRIBUTE_TYPE, 'pcimKeywords', 'RFC3703'), + '1.3.6.1.1.6.2.4': ('1.3.6.1.1.6.2.4', OID_ATTRIBUTE_TYPE, 'pcimGroupName', 'RFC3703'), + '1.3.6.1.1.6.2.5': ('1.3.6.1.1.6.2.5', OID_ATTRIBUTE_TYPE, 'pcimRuleName', 'RFC3703'), + '1.3.6.1.1.6.2.6': ('1.3.6.1.1.6.2.6', OID_ATTRIBUTE_TYPE, 'pcimRuleEnabled', 'RFC3703'), + '1.3.6.1.1.6.2.7': ('1.3.6.1.1.6.2.7', OID_ATTRIBUTE_TYPE, 'pcimRuleConditionListType', 'RFC3703'), + '1.3.6.1.1.6.2.8': ('1.3.6.1.1.6.2.8', OID_ATTRIBUTE_TYPE, 'pcimRuleConditionList', 'RFC3703'), + '1.3.6.1.1.6.2.9': ('1.3.6.1.1.6.2.9', OID_ATTRIBUTE_TYPE, 'pcimRuleActionList', 'RFC3703'), + '1.3.6.1.1.6.2.10': ('1.3.6.1.1.6.2.10', OID_ATTRIBUTE_TYPE, 'pcimRuleValidityPeriodList', 'RFC3703'), + '1.3.6.1.1.6.2.11': ('1.3.6.1.1.6.2.11', OID_ATTRIBUTE_TYPE, 'pcimRuleUsage', 'RFC3703'), + '1.3.6.1.1.6.2.12': ('1.3.6.1.1.6.2.12', OID_ATTRIBUTE_TYPE, 'pcimRulePriority', 'RFC3703'), + '1.3.6.1.1.6.2.13': ('1.3.6.1.1.6.2.13', OID_ATTRIBUTE_TYPE, 'pcimRuleMandatory', 'RFC3703'), + '1.3.6.1.1.6.2.14': ('1.3.6.1.1.6.2.14', OID_ATTRIBUTE_TYPE, 'pcimRuleSequencedActions', 'RFC3703'), + '1.3.6.1.1.6.2.15': ('1.3.6.1.1.6.2.15', OID_ATTRIBUTE_TYPE, 'pcimRoles', 'RFC3703'), + '1.3.6.1.1.6.2.16': ('1.3.6.1.1.6.2.16', OID_ATTRIBUTE_TYPE, 'pcimConditionGroupNumber', 'RFC3703'), + '1.3.6.1.1.6.2.17': ('1.3.6.1.1.6.2.17', OID_ATTRIBUTE_TYPE, 'pcimConditionNegated', 'RFC3703'), + '1.3.6.1.1.6.2.18': ('1.3.6.1.1.6.2.18', OID_ATTRIBUTE_TYPE, 'pcimConditionName', 'RFC3703'), + '1.3.6.1.1.6.2.19': ('1.3.6.1.1.6.2.19', OID_ATTRIBUTE_TYPE, 'pcimConditionDN', 'RFC3703'), + '1.3.6.1.1.6.2.20': ('1.3.6.1.1.6.2.20', OID_ATTRIBUTE_TYPE, 'pcimValidityConditionName', 'RFC3703'), + '1.3.6.1.1.6.2.21': ('1.3.6.1.1.6.2.21', OID_ATTRIBUTE_TYPE, 'pcimTimePeriodConditionDN', 'RFC3703'), + '1.3.6.1.1.6.2.22': ('1.3.6.1.1.6.2.22', OID_ATTRIBUTE_TYPE, 'pcimActionName', 'RFC3703'), + '1.3.6.1.1.6.2.23': ('1.3.6.1.1.6.2.23', OID_ATTRIBUTE_TYPE, 'pcimActionOrder', 'RFC3703'), + '1.3.6.1.1.6.2.24': ('1.3.6.1.1.6.2.24', OID_ATTRIBUTE_TYPE, 'pcimActionDN', 'RFC3703'), + '1.3.6.1.1.6.2.25': ('1.3.6.1.1.6.2.25', OID_ATTRIBUTE_TYPE, 'pcimTPCTime', 'RFC3703'), + '1.3.6.1.1.6.2.26': ('1.3.6.1.1.6.2.26', OID_ATTRIBUTE_TYPE, 'pcimTPCMonthOfYearMask', 'RFC3703'), + '1.3.6.1.1.6.2.27': ('1.3.6.1.1.6.2.27', OID_ATTRIBUTE_TYPE, 'pcimTPCDayOfMonthMask', 'RFC3703'), + '1.3.6.1.1.6.2.28': ('1.3.6.1.1.6.2.28', OID_ATTRIBUTE_TYPE, 'pcimTPCDayOfWeekMask', 'RFC3703'), + '1.3.6.1.1.6.2.29': ('1.3.6.1.1.6.2.29', OID_ATTRIBUTE_TYPE, 'pcimTPCTimeOfDayMask', 'RFC3703'), + '1.3.6.1.1.6.2.30': ('1.3.6.1.1.6.2.30', OID_ATTRIBUTE_TYPE, 'pcimTPCLocalOrUtcTime', 'RFC3703'), + '1.3.6.1.1.6.2.31': ('1.3.6.1.1.6.2.31', OID_ATTRIBUTE_TYPE, 'pcimVendorConstraintData', 'RFC3703'), + '1.3.6.1.1.6.2.32': ('1.3.6.1.1.6.2.32', OID_ATTRIBUTE_TYPE, 'pcimVendorConstraintEncoding', 'RFC3703'), + '1.3.6.1.1.6.2.33': ('1.3.6.1.1.6.2.33', OID_ATTRIBUTE_TYPE, 'pcimVendorActionData', 'RFC3703'), + '1.3.6.1.1.6.2.34': ('1.3.6.1.1.6.2.34', OID_ATTRIBUTE_TYPE, 'pcimVendorActionEncoding', 'RFC3703'), + '1.3.6.1.1.6.2.35': ('1.3.6.1.1.6.2.35', OID_ATTRIBUTE_TYPE, 'pcimPolicyInstanceName', 'RFC3703'), + '1.3.6.1.1.6.2.36': ('1.3.6.1.1.6.2.36', OID_ATTRIBUTE_TYPE, 'pcimRepositoryName', 'RFC3703'), + '1.3.6.1.1.6.2.37': ('1.3.6.1.1.6.2.37', OID_ATTRIBUTE_TYPE, 'pcimSubtreesAuxContainedSet', 'RFC3703'), + '1.3.6.1.1.6.2.38': ('1.3.6.1.1.6.2.38', OID_ATTRIBUTE_TYPE, 'pcimGroupsAuxContainedSet', 'RFC3703'), + '1.3.6.1.1.6.2.39': ('1.3.6.1.1.6.2.39', OID_ATTRIBUTE_TYPE, 'pcimRulesAuxContainedSet', 'RFC3703'), + '1.3.6.1.1.9.2.1': ('1.3.6.1.1.9.2.1', OID_ATTRIBUTE_TYPE, 'pcelsPolicySetName', 'RFC4104'), + '1.3.6.1.1.9.2.2': ('1.3.6.1.1.9.2.2', OID_ATTRIBUTE_TYPE, 'pcelsDecisionStrategy', 'RFC4104'), + '1.3.6.1.1.9.2.3': ('1.3.6.1.1.9.2.3', OID_ATTRIBUTE_TYPE, 'pcelsPolicySetList', 'RFC4104'), + '1.3.6.1.1.9.2.4': ('1.3.6.1.1.9.2.4', OID_ATTRIBUTE_TYPE, 'pcelsPriority', 'RFC4104'), + '1.3.6.1.1.9.2.5': ('1.3.6.1.1.9.2.5', OID_ATTRIBUTE_TYPE, 'pcelsPolicySetDN', 'RFC4104'), + '1.3.6.1.1.9.2.6': ('1.3.6.1.1.9.2.6', OID_ATTRIBUTE_TYPE, 'pcelsConditionListType', 'RFC4104'), + '1.3.6.1.1.9.2.7': ('1.3.6.1.1.9.2.7', OID_ATTRIBUTE_TYPE, 'pcelsConditionList', 'RFC4104'), + '1.3.6.1.1.9.2.8': ('1.3.6.1.1.9.2.8', OID_ATTRIBUTE_TYPE, 'pcelsActionList', 'RFC4104'), + '1.3.6.1.1.9.2.9': ('1.3.6.1.1.9.2.9', OID_ATTRIBUTE_TYPE, 'pcelsSequencedActions', 'RFC4104'), + '1.3.6.1.1.9.2.10': ('1.3.6.1.1.9.2.10', OID_ATTRIBUTE_TYPE, 'pcelsExecutionStrategy', 'RFC4104'), + '1.3.6.1.1.9.2.11': ('1.3.6.1.1.9.2.11', OID_ATTRIBUTE_TYPE, 'pcelsVariableDN', 'RFC4104'), + '1.3.6.1.1.9.2.12': ('1.3.6.1.1.9.2.12', OID_ATTRIBUTE_TYPE, 'pcelsValueDN', 'RFC4104'), + '1.3.6.1.1.9.2.13': ('1.3.6.1.1.9.2.13', OID_ATTRIBUTE_TYPE, 'pcelsIsMirrored', 'RFC4104'), + '1.3.6.1.1.9.2.14': ('1.3.6.1.1.9.2.14', OID_ATTRIBUTE_TYPE, 'pcelsVariableName', 'RFC4104'), + '1.3.6.1.1.9.2.15': ('1.3.6.1.1.9.2.15', OID_ATTRIBUTE_TYPE, 'pcelsExpectedValueList', 'RFC4104'), + '1.3.6.1.1.9.2.16': ('1.3.6.1.1.9.2.16', OID_ATTRIBUTE_TYPE, 'pcelsVariableModelClass', 'RFC4104'), + '1.3.6.1.1.9.2.17': ('1.3.6.1.1.9.2.17', OID_ATTRIBUTE_TYPE, 'pcelsVariableModelProperty', 'RFC4104'), + '1.3.6.1.1.9.2.18': ('1.3.6.1.1.9.2.18', OID_ATTRIBUTE_TYPE, 'pcelsExpectedValueTypes', 'RFC4104'), + '1.3.6.1.1.9.2.19': ('1.3.6.1.1.9.2.19', OID_ATTRIBUTE_TYPE, 'pcelsValueName', 'RFC4104'), + '1.3.6.1.1.9.2.20': ('1.3.6.1.1.9.2.20', OID_ATTRIBUTE_TYPE, 'pcelsIPv4AddrList', 'RFC4104'), + '1.3.6.1.1.9.2.21': ('1.3.6.1.1.9.2.21', OID_ATTRIBUTE_TYPE, 'pcelsIPv6AddrList', 'RFC4104'), + '1.3.6.1.1.9.2.22': ('1.3.6.1.1.9.2.22', OID_ATTRIBUTE_TYPE, 'pcelsMACAddrList', 'RFC4104'), + '1.3.6.1.1.9.2.23': ('1.3.6.1.1.9.2.23', OID_ATTRIBUTE_TYPE, 'pcelsStringList', 'RFC4104'), + '1.3.6.1.1.9.2.24': ('1.3.6.1.1.9.2.24', OID_ATTRIBUTE_TYPE, 'pcelsBitStringList', 'RFC4104'), + '1.3.6.1.1.9.2.25': ('1.3.6.1.1.9.2.25', OID_ATTRIBUTE_TYPE, 'pcelsIntegerList', 'RFC4104'), + '1.3.6.1.1.9.2.26': ('1.3.6.1.1.9.2.26', OID_ATTRIBUTE_TYPE, 'pcelsBoolean', 'RFC4104'), + '1.3.6.1.1.9.2.27': ('1.3.6.1.1.9.2.27', OID_ATTRIBUTE_TYPE, 'pcelsReusableContainerName', 'RFC4104'), + '1.3.6.1.1.9.2.28': ('1.3.6.1.1.9.2.28', OID_ATTRIBUTE_TYPE, 'pcelsReusableContainerList', 'RFC4104'), + '1.3.6.1.1.9.2.29': ('1.3.6.1.1.9.2.29', OID_ATTRIBUTE_TYPE, 'pcelsRole', 'RFC4104'), + '1.3.6.1.1.9.2.30': ('1.3.6.1.1.9.2.30', OID_ATTRIBUTE_TYPE, 'pcelsRoleCollectionName', 'RFC4104'), + '1.3.6.1.1.9.2.31': ('1.3.6.1.1.9.2.31', OID_ATTRIBUTE_TYPE, 'pcelsElementList', 'RFC4104'), + '1.3.6.1.1.9.2.32': ('1.3.6.1.1.9.2.32', OID_ATTRIBUTE_TYPE, 'pcelsFilterName', 'RFC4104'), + '1.3.6.1.1.9.2.33': ('1.3.6.1.1.9.2.33', OID_ATTRIBUTE_TYPE, 'pcelsFilterIsNegated', 'RFC4104'), + '1.3.6.1.1.9.2.34': ('1.3.6.1.1.9.2.34', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrVersion', 'RFC4104'), + '1.3.6.1.1.9.2.35': ('1.3.6.1.1.9.2.35', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrSourceAddress', 'RFC4104'), + '1.3.6.1.1.9.2.36': ('1.3.6.1.1.9.2.36', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrSourceAddressEndOfRange', 'RFC4104'), + '1.3.6.1.1.9.2.37': ('1.3.6.1.1.9.2.37', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrSourceMask', 'RFC4104'), + '1.3.6.1.1.9.2.38': ('1.3.6.1.1.9.2.38', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrDestAddress', 'RFC4104'), + '1.3.6.1.1.9.2.39': ('1.3.6.1.1.9.2.39', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrDestAddressEndOfRange', 'RFC4104'), + '1.3.6.1.1.9.2.40': ('1.3.6.1.1.9.2.40', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrDestMask', 'RFC4104'), + '1.3.6.1.1.9.2.41': ('1.3.6.1.1.9.2.41', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrProtocolID', 'RFC4104'), + '1.3.6.1.1.9.2.42': ('1.3.6.1.1.9.2.42', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrSourcePortStart', 'RFC4104'), + '1.3.6.1.1.9.2.43': ('1.3.6.1.1.9.2.43', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrSourcePortEnd', 'RFC4104'), + '1.3.6.1.1.9.2.44': ('1.3.6.1.1.9.2.44', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrDestPortStart', 'RFC4104'), + '1.3.6.1.1.9.2.45': ('1.3.6.1.1.9.2.45', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrDestPortEnd', 'RFC4104'), + '1.3.6.1.1.9.2.46': ('1.3.6.1.1.9.2.46', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrDSCPList', 'RFC4104'), + '1.3.6.1.1.9.2.47': ('1.3.6.1.1.9.2.47', OID_ATTRIBUTE_TYPE, 'pcelsIPHdrFlowLabel', 'RFC4104'), + '1.3.6.1.1.9.2.48': ('1.3.6.1.1.9.2.48', OID_ATTRIBUTE_TYPE, 'pcels8021HdrSourceMACAddress', 'RFC4104'), + '1.3.6.1.1.9.2.49': ('1.3.6.1.1.9.2.49', OID_ATTRIBUTE_TYPE, 'pcels8021HdrSourceMACMask', 'RFC4104'), + '1.3.6.1.1.9.2.50': ('1.3.6.1.1.9.2.50', OID_ATTRIBUTE_TYPE, 'pcels8021HdrDestMACAddress', 'RFC4104'), + '1.3.6.1.1.9.2.51': ('1.3.6.1.1.9.2.51', OID_ATTRIBUTE_TYPE, 'pcels8021HdrDestMACMask', 'RFC4104'), + '1.3.6.1.1.9.2.52': ('1.3.6.1.1.9.2.52', OID_ATTRIBUTE_TYPE, 'pcels8021HdrProtocolID', 'RFC4104'), + '1.3.6.1.1.9.2.53': ('1.3.6.1.1.9.2.53', OID_ATTRIBUTE_TYPE, 'pcels8021HdrPriority', 'RFC4104'), + '1.3.6.1.1.9.2.54': ('1.3.6.1.1.9.2.54', OID_ATTRIBUTE_TYPE, 'pcels8021HdrVLANID', 'RFC4104'), + '1.3.6.1.1.9.2.55': ('1.3.6.1.1.9.2.55', OID_ATTRIBUTE_TYPE, 'pcelsFilterListName', 'RFC4104'), + '1.3.6.1.1.9.2.56': ('1.3.6.1.1.9.2.56', OID_ATTRIBUTE_TYPE, 'pcelsFilterDirection', 'RFC4104'), + '1.3.6.1.1.9.2.57': ('1.3.6.1.1.9.2.57', OID_ATTRIBUTE_TYPE, 'pcelsFilterEntryList', 'RFC4104'), + '1.3.6.1.1.9.2.58': ('1.3.6.1.1.9.2.58', OID_ATTRIBUTE_TYPE, 'pcelsVendorVariableData', 'RFC4104'), + '1.3.6.1.1.9.2.59': ('1.3.6.1.1.9.2.59', OID_ATTRIBUTE_TYPE, 'pcelsVendorVariableEncoding', 'RFC4104'), + '1.3.6.1.1.9.2.60': ('1.3.6.1.1.9.2.60', OID_ATTRIBUTE_TYPE, 'pcelsVendorValueData', 'RFC4104'), + '1.3.6.1.1.9.2.61': ('1.3.6.1.1.9.2.61', OID_ATTRIBUTE_TYPE, 'pcelsVendorValueEncoding', 'RFC4104'), + '1.3.6.1.1.9.2.62': ('1.3.6.1.1.9.2.62', OID_ATTRIBUTE_TYPE, 'pcelsRuleValidityPeriodList', 'RFC4104'), + '1.3.6.1.4.1.11.1.3.1.1.0': ('1.3.6.1.4.1.11.1.3.1.1.0', OID_ATTRIBUTE_TYPE, 'defaultServerList', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.1': ('1.3.6.1.4.1.11.1.3.1.1.1', OID_ATTRIBUTE_TYPE, 'defaultSearchBase', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.2': ('1.3.6.1.4.1.11.1.3.1.1.2', OID_ATTRIBUTE_TYPE, 'preferredServerList', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.3': ('1.3.6.1.4.1.11.1.3.1.1.3', OID_ATTRIBUTE_TYPE, 'search_time_limit', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.4': ('1.3.6.1.4.1.11.1.3.1.1.4', OID_ATTRIBUTE_TYPE, 'bindTimeLimit', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.5': ('1.3.6.1.4.1.11.1.3.1.1.5', OID_ATTRIBUTE_TYPE, 'followReferrals', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.6': ('1.3.6.1.4.1.11.1.3.1.1.6', OID_ATTRIBUTE_TYPE, 'authenticationMethod', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.7': ('1.3.6.1.4.1.11.1.3.1.1.7', OID_ATTRIBUTE_TYPE, 'profileTTL', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.9': ('1.3.6.1.4.1.11.1.3.1.1.9', OID_ATTRIBUTE_TYPE, 'attributeMap', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.10': ('1.3.6.1.4.1.11.1.3.1.1.10', OID_ATTRIBUTE_TYPE, 'credentialLevel', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.11': ('1.3.6.1.4.1.11.1.3.1.1.11', OID_ATTRIBUTE_TYPE, 'objectclassMap', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.12': ('1.3.6.1.4.1.11.1.3.1.1.12', OID_ATTRIBUTE_TYPE, 'defaultSearchScope', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.13': ('1.3.6.1.4.1.11.1.3.1.1.13', OID_ATTRIBUTE_TYPE, 'serviceCredentialLevel', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.14': ('1.3.6.1.4.1.11.1.3.1.1.14', OID_ATTRIBUTE_TYPE, 'serviceSearchDescriptor', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.15': ('1.3.6.1.4.1.11.1.3.1.1.15', OID_ATTRIBUTE_TYPE, 'serviceAuthenticationMethod', 'RFC4876'), + '1.3.6.1.4.1.11.1.3.1.1.16': ('1.3.6.1.4.1.11.1.3.1.1.16', OID_ATTRIBUTE_TYPE, 'dereferenceAliases', 'RFC4876'), + '1.3.6.1.4.1.1466.101.119.3': ('1.3.6.1.4.1.1466.101.119.3', OID_ATTRIBUTE_TYPE, 'entryTtl', 'RFC2589'), + '1.3.6.1.4.1.1466.101.119.4': ('1.3.6.1.4.1.1466.101.119.4', OID_ATTRIBUTE_TYPE, 'dynamicSubtrees', 'RFC2589'), + '1.3.6.1.4.1.1466.101.120.1': ('1.3.6.1.4.1.1466.101.120.1', OID_ATTRIBUTE_TYPE, 'administratorsAddress', 'Mark_Wahl'), + '1.3.6.1.4.1.1466.101.120.5': ('1.3.6.1.4.1.1466.101.120.5', OID_ATTRIBUTE_TYPE, 'namingContexts', 'RFC4512'), + '1.3.6.1.4.1.1466.101.120.6': ('1.3.6.1.4.1.1466.101.120.6', OID_ATTRIBUTE_TYPE, 'altServer', 'RFC4512'), + '1.3.6.1.4.1.1466.101.120.7': ('1.3.6.1.4.1.1466.101.120.7', OID_ATTRIBUTE_TYPE, 'supportedExtension', 'RFC4512'), + '1.3.6.1.4.1.1466.101.120.13': ('1.3.6.1.4.1.1466.101.120.13', OID_ATTRIBUTE_TYPE, 'supportedControl', 'RFC4512'), + '1.3.6.1.4.1.1466.101.120.14': ('1.3.6.1.4.1.1466.101.120.14', OID_ATTRIBUTE_TYPE, 'supportedSASLMechanisms', 'RFC4512'), + '1.3.6.1.4.1.1466.101.120.15': ('1.3.6.1.4.1.1466.101.120.15', OID_ATTRIBUTE_TYPE, 'supportedLDAPVersion', 'RFC4512'), + '1.3.6.1.4.1.1466.101.120.16': ('1.3.6.1.4.1.1466.101.120.16', OID_ATTRIBUTE_TYPE, 'ldapSyntaxes', 'RFC4512'), + '1.3.6.1.4.1.16572.2.2.1': ('1.3.6.1.4.1.16572.2.2.1', OID_ATTRIBUTE_TYPE, 'providerCertificateHash', 'RFC6109'), + '1.3.6.1.4.1.16572.2.2.2': ('1.3.6.1.4.1.16572.2.2.2', OID_ATTRIBUTE_TYPE, 'providerCertificate', 'RFC6109'), + '1.3.6.1.4.1.16572.2.2.3': ('1.3.6.1.4.1.16572.2.2.3', OID_ATTRIBUTE_TYPE, 'providerName', 'RFC6109'), + '1.3.6.1.4.1.16572.2.2.4': ('1.3.6.1.4.1.16572.2.2.4', OID_ATTRIBUTE_TYPE, 'mailReceipt', 'RFC6109'), + '1.3.6.1.4.1.16572.2.2.5': ('1.3.6.1.4.1.16572.2.2.5', OID_ATTRIBUTE_TYPE, 'managedDomains', 'RFC6109'), + '1.3.6.1.4.1.16572.2.2.6': ('1.3.6.1.4.1.16572.2.2.6', OID_ATTRIBUTE_TYPE, 'LDIFLocationURL', 'RFC6109'), + '1.3.6.1.4.1.16572.2.2.7': ('1.3.6.1.4.1.16572.2.2.7', OID_ATTRIBUTE_TYPE, 'providerUnit', 'RFC6109'), + '1.3.6.1.4.1.250.1.57': ('1.3.6.1.4.1.250.1.57', OID_ATTRIBUTE_TYPE, 'labeledURI', 'RFC2079'), + '1.3.6.1.4.1.31103.1.1': ('1.3.6.1.4.1.31103.1.1', OID_ATTRIBUTE_TYPE, 'fedfsUuid', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.2': ('1.3.6.1.4.1.31103.1.2', OID_ATTRIBUTE_TYPE, 'fedfsNetAddr', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.3': ('1.3.6.1.4.1.31103.1.3', OID_ATTRIBUTE_TYPE, 'fedfsNetPort', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.4': ('1.3.6.1.4.1.31103.1.4', OID_ATTRIBUTE_TYPE, 'fedfsFsnUuid', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.5': ('1.3.6.1.4.1.31103.1.5', OID_ATTRIBUTE_TYPE, 'fedfsNsdbName', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.6': ('1.3.6.1.4.1.31103.1.6', OID_ATTRIBUTE_TYPE, 'fedfsNsdbPort', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.7': ('1.3.6.1.4.1.31103.1.7', OID_ATTRIBUTE_TYPE, 'fedfsNcePrefix', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.8': ('1.3.6.1.4.1.31103.1.8', OID_ATTRIBUTE_TYPE, 'fedfsFslUuid', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.9': ('1.3.6.1.4.1.31103.1.9', OID_ATTRIBUTE_TYPE, 'fedfsFslHost', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.10': ('1.3.6.1.4.1.31103.1.10', OID_ATTRIBUTE_TYPE, 'fedfsFslPort', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.11': ('1.3.6.1.4.1.31103.1.11', OID_ATTRIBUTE_TYPE, 'fedfsFslTTL', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.12': ('1.3.6.1.4.1.31103.1.12', OID_ATTRIBUTE_TYPE, 'fedfsAnnotation', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.13': ('1.3.6.1.4.1.31103.1.13', OID_ATTRIBUTE_TYPE, 'fedfsDescr', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.14': ('1.3.6.1.4.1.31103.1.14', OID_ATTRIBUTE_TYPE, 'fedfsNceDN', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.15': ('1.3.6.1.4.1.31103.1.15', OID_ATTRIBUTE_TYPE, 'fedfsFsnTTL', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.100': ('1.3.6.1.4.1.31103.1.100', OID_ATTRIBUTE_TYPE, 'fedfsNfsPath', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.101': ('1.3.6.1.4.1.31103.1.101', OID_ATTRIBUTE_TYPE, 'fedfsNfsMajorVer', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.102': ('1.3.6.1.4.1.31103.1.102', OID_ATTRIBUTE_TYPE, 'fedfsNfsMinorVer', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.103': ('1.3.6.1.4.1.31103.1.103', OID_ATTRIBUTE_TYPE, 'fedfsNfsCurrency', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.104': ('1.3.6.1.4.1.31103.1.104', OID_ATTRIBUTE_TYPE, 'fedfsNfsGenFlagWritable', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.105': ('1.3.6.1.4.1.31103.1.105', OID_ATTRIBUTE_TYPE, 'fedfsNfsGenFlagGoing', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.106': ('1.3.6.1.4.1.31103.1.106', OID_ATTRIBUTE_TYPE, 'fedfsNfsGenFlagSplit', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.107': ('1.3.6.1.4.1.31103.1.107', OID_ATTRIBUTE_TYPE, 'fedfsNfsTransFlagRdma', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.108': ('1.3.6.1.4.1.31103.1.108', OID_ATTRIBUTE_TYPE, 'fedfsNfsClassSimul', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.109': ('1.3.6.1.4.1.31103.1.109', OID_ATTRIBUTE_TYPE, 'fedfsNfsClassHandle', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.110': ('1.3.6.1.4.1.31103.1.110', OID_ATTRIBUTE_TYPE, 'fedfsNfsClassFileid', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.111': ('1.3.6.1.4.1.31103.1.111', OID_ATTRIBUTE_TYPE, 'fedfsNfsClassWritever', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.112': ('1.3.6.1.4.1.31103.1.112', OID_ATTRIBUTE_TYPE, 'fedfsNfsClassChange', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.113': ('1.3.6.1.4.1.31103.1.113', OID_ATTRIBUTE_TYPE, 'fedfsNfsClassReaddir', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.114': ('1.3.6.1.4.1.31103.1.114', OID_ATTRIBUTE_TYPE, 'fedfsNfsReadRank', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.115': ('1.3.6.1.4.1.31103.1.115', OID_ATTRIBUTE_TYPE, 'fedfsNfsReadOrder', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.116': ('1.3.6.1.4.1.31103.1.116', OID_ATTRIBUTE_TYPE, 'fedfsNfsWriteRank', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.117': ('1.3.6.1.4.1.31103.1.117', OID_ATTRIBUTE_TYPE, 'fedfsNfsWriteOrder', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.118': ('1.3.6.1.4.1.31103.1.118', OID_ATTRIBUTE_TYPE, 'fedfsNfsVarSub', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.119': ('1.3.6.1.4.1.31103.1.119', OID_ATTRIBUTE_TYPE, 'fedfsNfsValidFor', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.120': ('1.3.6.1.4.1.31103.1.120', OID_ATTRIBUTE_TYPE, 'fedfsNfsURI', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.4203.1.3.5': ('1.3.6.1.4.1.4203.1.3.5', OID_ATTRIBUTE_TYPE, 'supportedFeatures', 'RFC4512'), + '1.3.6.1.4.1.453.7.2.1': ('1.3.6.1.4.1.453.7.2.1', OID_ATTRIBUTE_TYPE, 'textTableKey', 'RFC2293'), + '1.3.6.1.4.1.453.7.2.2': ('1.3.6.1.4.1.453.7.2.2', OID_ATTRIBUTE_TYPE, 'textTableValue', 'RFC2293'), + '1.3.6.1.4.1.453.7.2.3': ('1.3.6.1.4.1.453.7.2.3', OID_ATTRIBUTE_TYPE, ['associatedX400Gateway', 'distinguishedNameTableKey'], 'RFC2164-RFC2293'), + '1.3.6.1.4.1.453.7.2.6': ('1.3.6.1.4.1.453.7.2.6', OID_ATTRIBUTE_TYPE, 'associatedORAddress', 'RFC2164'), + '1.3.6.1.4.1.453.7.2.7': ('1.3.6.1.4.1.453.7.2.7', OID_ATTRIBUTE_TYPE, 'oRAddressComponentType', 'RFC2164'), + '1.3.6.1.4.1.453.7.2.8': ('1.3.6.1.4.1.453.7.2.8', OID_ATTRIBUTE_TYPE, 'associatedInternetGateway', 'RFC2164'), + '1.3.6.1.4.1.453.7.2.9': ('1.3.6.1.4.1.453.7.2.9', OID_ATTRIBUTE_TYPE, 'mcgamTables', 'RFC2164'), + '2.16.840.1.113730.3.1.34': ('2.16.840.1.113730.3.1.34', OID_ATTRIBUTE_TYPE, 'ref', 'RFC3296'), + '2.5.18.1': ('2.5.18.1', OID_ATTRIBUTE_TYPE, 'createTimestamp', 'RFC4512'), + '2.5.18.2': ('2.5.18.2', OID_ATTRIBUTE_TYPE, 'modifyTimestamp', 'RFC4512'), + '2.5.18.3': ('2.5.18.3', OID_ATTRIBUTE_TYPE, 'creatorsName', 'RFC4512'), + '2.5.18.4': ('2.5.18.4', OID_ATTRIBUTE_TYPE, 'modifiersName', 'RFC4512'), + '2.5.18.5': ('2.5.18.5', OID_ATTRIBUTE_TYPE, 'administrativeRole', 'RFC3672'), + '2.5.18.6': ('2.5.18.6', OID_ATTRIBUTE_TYPE, 'subtreeSpecification', 'RFC3672'), + '2.5.18.7': ('2.5.18.7', OID_ATTRIBUTE_TYPE, 'collectiveExclusions', 'RFC3671'), + '2.5.18.10': ('2.5.18.10', OID_ATTRIBUTE_TYPE, 'subschemaSubentry', 'RFC4512'), + '2.5.18.12': ('2.5.18.12', OID_ATTRIBUTE_TYPE, 'collectiveAttributeSubentries', 'RFC3671'), + '2.5.21.1': ('2.5.21.1', OID_ATTRIBUTE_TYPE, 'dITStructureRules', 'RFC4512'), + '2.5.21.2': ('2.5.21.2', OID_ATTRIBUTE_TYPE, 'dITContentRules', 'RFC4512'), + '2.5.21.4': ('2.5.21.4', OID_ATTRIBUTE_TYPE, 'matchingRules', 'RFC4512'), + '2.5.21.5': ('2.5.21.5', OID_ATTRIBUTE_TYPE, 'attributeTypes', 'RFC4512'), + '2.5.21.6': ('2.5.21.6', OID_ATTRIBUTE_TYPE, 'objectClasses', 'RFC4512'), + '2.5.21.7': ('2.5.21.7', OID_ATTRIBUTE_TYPE, 'nameForms', 'RFC4512'), + '2.5.21.8': ('2.5.21.8', OID_ATTRIBUTE_TYPE, 'matchingRuleUse', 'RFC4512'), + '2.5.21.9': ('2.5.21.9', OID_ATTRIBUTE_TYPE, 'structuralObjectClass', 'RFC4512'), + '2.5.21.10': ('2.5.21.10', OID_ATTRIBUTE_TYPE, 'governingStructureRule', 'RFC4512'), + '2.5.4.0': ('2.5.4.0', OID_ATTRIBUTE_TYPE, 'objectClass', 'RFC4512'), + '2.5.4.1': ('2.5.4.1', OID_ATTRIBUTE_TYPE, ['aliasedEntryName', 'aliasedObjectName'], 'X.501-RFC4512'), + '2.5.4.2': ('2.5.4.2', OID_ATTRIBUTE_TYPE, 'knowledgeInformation', 'RFC2256'), + '2.5.4.3': ('2.5.4.3', OID_ATTRIBUTE_TYPE, ['cn', 'commonName'], 'RFC4519'), + '2.5.4.4': ('2.5.4.4', OID_ATTRIBUTE_TYPE, ['sn', 'surname'], 'RFC4519'), + '2.5.4.5': ('2.5.4.5', OID_ATTRIBUTE_TYPE, 'serialNumber', 'RFC4519'), + '2.5.4.6': ('2.5.4.6', OID_ATTRIBUTE_TYPE, ['c', 'countryName'], 'RFC4519'), + '2.5.4.7': ('2.5.4.7', OID_ATTRIBUTE_TYPE, ['L', 'localityName'], 'RFC4519'), + '2.5.4.7.1': ('2.5.4.7.1', OID_ATTRIBUTE_TYPE, 'c-l', 'RFC3671'), + '2.5.4.8': ('2.5.4.8', OID_ATTRIBUTE_TYPE, ['st', 'stateOrProvinceName'], 'RFC4519-RFC2256'), + '2.5.4.8.1': ('2.5.4.8.1', OID_ATTRIBUTE_TYPE, 'c-st', 'RFC3671'), + '2.5.4.9': ('2.5.4.9', OID_ATTRIBUTE_TYPE, ['street', 'streetAddress'], 'RFC4519-RFC2256'), + '2.5.4.9.1': ('2.5.4.9.1', OID_ATTRIBUTE_TYPE, 'c-street', 'RFC3671'), + '2.5.4.10': ('2.5.4.10', OID_ATTRIBUTE_TYPE, ['o', 'organizationName'], 'RFC4519'), + '2.5.4.10.1': ('2.5.4.10.1', OID_ATTRIBUTE_TYPE, 'c-o', 'RFC3671'), + '2.5.4.11': ('2.5.4.11', OID_ATTRIBUTE_TYPE, ['ou', 'organizationalUnitName'], 'RFC4519'), + '2.5.4.11.1': ('2.5.4.11.1', OID_ATTRIBUTE_TYPE, 'c-ou', 'RFC3671'), + '2.5.4.12': ('2.5.4.12', OID_ATTRIBUTE_TYPE, 'title', 'RFC4519'), + '2.5.4.13': ('2.5.4.13', OID_ATTRIBUTE_TYPE, 'description', 'RFC4519'), + '2.5.4.14': ('2.5.4.14', OID_ATTRIBUTE_TYPE, 'searchGuide', 'RFC4519'), + '2.5.4.15': ('2.5.4.15', OID_ATTRIBUTE_TYPE, 'businessCategory', 'RFC4519'), + '2.5.4.16': ('2.5.4.16', OID_ATTRIBUTE_TYPE, 'postalAddress', 'RFC4519'), + '2.5.4.16.1': ('2.5.4.16.1', OID_ATTRIBUTE_TYPE, 'c-PostalAddress', 'RFC3671'), + '2.5.4.17': ('2.5.4.17', OID_ATTRIBUTE_TYPE, 'postalCode', 'RFC4519'), + '2.5.4.17.1': ('2.5.4.17.1', OID_ATTRIBUTE_TYPE, 'c-PostalCode', 'RFC3671'), + '2.5.4.18': ('2.5.4.18', OID_ATTRIBUTE_TYPE, 'postOfficeBox', 'RFC4519'), + '2.5.4.18.1': ('2.5.4.18.1', OID_ATTRIBUTE_TYPE, 'c-PostOfficeBox', 'RFC3671'), + '2.5.4.19': ('2.5.4.19', OID_ATTRIBUTE_TYPE, 'physicalDeliveryOfficeName', 'RFC4519'), + '2.5.4.19.1': ('2.5.4.19.1', OID_ATTRIBUTE_TYPE, 'c-PhysicalDeliveryOffice', 'RFC3671'), + '2.5.4.20': ('2.5.4.20', OID_ATTRIBUTE_TYPE, 'telephoneNumber', 'RFC4519'), + '2.5.4.20.1': ('2.5.4.20.1', OID_ATTRIBUTE_TYPE, 'c-TelephoneNumber', 'RFC3671'), + '2.5.4.21': ('2.5.4.21', OID_ATTRIBUTE_TYPE, 'telexNumber', 'RFC4519'), + '2.5.4.21.1': ('2.5.4.21.1', OID_ATTRIBUTE_TYPE, 'c-TelexNumber', 'RFC3671'), + '2.5.4.22': ('2.5.4.22', OID_ATTRIBUTE_TYPE, 'teletexTerminalIdentifier', 'RFC4519'), + '2.5.4.23': ('2.5.4.23', OID_ATTRIBUTE_TYPE, 'facsimileTelephoneNumber', 'RFC4519'), + '2.5.4.23.1': ('2.5.4.23.1', OID_ATTRIBUTE_TYPE, 'c-FacsimileTelephoneNumber', 'RFC3671'), + '2.5.4.24': ('2.5.4.24', OID_ATTRIBUTE_TYPE, 'x121Address', 'RFC4519'), + '2.5.4.25': ('2.5.4.25', OID_ATTRIBUTE_TYPE, 'internationaliSDNNumber', 'RFC4519'), + '2.5.4.25.1': ('2.5.4.25.1', OID_ATTRIBUTE_TYPE, 'c-InternationalISDNNumber', 'RFC3671'), + '2.5.4.26': ('2.5.4.26', OID_ATTRIBUTE_TYPE, 'registeredAddress', 'RFC4519'), + '2.5.4.27': ('2.5.4.27', OID_ATTRIBUTE_TYPE, 'destinationIndicator', 'RFC4519'), + '2.5.4.28': ('2.5.4.28', OID_ATTRIBUTE_TYPE, 'preferredDeliveryMethod', 'RFC4519'), + '2.5.4.29': ('2.5.4.29', OID_ATTRIBUTE_TYPE, 'presentationAddress', 'RFC2256'), + '2.5.4.30': ('2.5.4.30', OID_ATTRIBUTE_TYPE, 'supportedApplicationContext', 'RFC2256'), + '2.5.4.31': ('2.5.4.31', OID_ATTRIBUTE_TYPE, 'member', 'RFC4519'), + '2.5.4.32': ('2.5.4.32', OID_ATTRIBUTE_TYPE, 'owner', 'RFC4519'), + '2.5.4.33': ('2.5.4.33', OID_ATTRIBUTE_TYPE, 'roleOccupant', 'RFC4519'), + '2.5.4.34': ('2.5.4.34', OID_ATTRIBUTE_TYPE, 'seeAlso', 'RFC4519'), + '2.5.4.35': ('2.5.4.35', OID_ATTRIBUTE_TYPE, 'userPassword', 'RFC4519'), + '2.5.4.36': ('2.5.4.36', OID_ATTRIBUTE_TYPE, 'userCertificate', 'RFC4523'), + '2.5.4.37': ('2.5.4.37', OID_ATTRIBUTE_TYPE, 'cACertificate', 'RFC4523'), + '2.5.4.38': ('2.5.4.38', OID_ATTRIBUTE_TYPE, 'authorityRevocationList', 'RFC4523'), + '2.5.4.39': ('2.5.4.39', OID_ATTRIBUTE_TYPE, 'certificateRevocationList', 'RFC4523'), + '2.5.4.40': ('2.5.4.40', OID_ATTRIBUTE_TYPE, 'crossCertificatePair', 'RFC4523'), + '2.5.4.41': ('2.5.4.41', OID_ATTRIBUTE_TYPE, 'name', 'RFC4519'), + '2.5.4.42': ('2.5.4.42', OID_ATTRIBUTE_TYPE, 'givenName', 'RFC4519'), + '2.5.4.43': ('2.5.4.43', OID_ATTRIBUTE_TYPE, 'initials', 'RFC4519'), + '2.5.4.44': ('2.5.4.44', OID_ATTRIBUTE_TYPE, 'generationQualifier', 'RFC4519'), + '2.5.4.45': ('2.5.4.45', OID_ATTRIBUTE_TYPE, 'x500UniqueIdentifier', 'RFC4519'), + '2.5.4.46': ('2.5.4.46', OID_ATTRIBUTE_TYPE, 'dnQualifier', 'RFC4519'), + '2.5.4.47': ('2.5.4.47', OID_ATTRIBUTE_TYPE, 'enhancedSearchGuide', 'RFC4519'), + '2.5.4.48': ('2.5.4.48', OID_ATTRIBUTE_TYPE, 'protocolInformation', 'RFC2256'), + '2.5.4.49': ('2.5.4.49', OID_ATTRIBUTE_TYPE, 'distinguishedName', 'RFC4519'), + '2.5.4.50': ('2.5.4.50', OID_ATTRIBUTE_TYPE, 'uniqueMember', 'RFC4519'), + '2.5.4.51': ('2.5.4.51', OID_ATTRIBUTE_TYPE, 'houseIdentifier', 'RFC4519'), + '2.5.4.52': ('2.5.4.52', OID_ATTRIBUTE_TYPE, 'supportedAlgorithms', 'RFC4523'), + '2.5.4.53': ('2.5.4.53', OID_ATTRIBUTE_TYPE, 'deltaRevocationList', 'RFC4523'), + '2.5.4.54': ('2.5.4.54', OID_ATTRIBUTE_TYPE, 'dmdName', 'RFC2256'), + '2.5.4.65': ('2.5.4.65', OID_ATTRIBUTE_TYPE, 'pseudonym', 'RFC3280'), + '2.16.840.1.113719.1.1.4.1.501': ('2.16.840.1.113719.1.1.4.1.501', OID_ATTRIBUTE_TYPE, 'GUID', 'NOVELL'), + '2.16.840.1.113719.1.27.4.50': ('2.16.840.1.113719.1.27.4.50', OID_ATTRIBUTE_TYPE, 'localEntryID', 'NOVELL'), + '2.16.840.1.113730.3.8.3.1': ('2.16.840.1.113730.3.8.3.1', OID_ATTRIBUTE_TYPE, 'ipaUniqueID', 'freeIPA'), + '2.16.840.1.113730.3.8.3.2': ('2.16.840.1.113730.3.8.3.2', OID_ATTRIBUTE_TYPE, 'ipaClientVersion', 'freeIPA'), + '2.16.840.1.113730.3.8.3.3': ('2.16.840.1.113730.3.8.3.3', OID_ATTRIBUTE_TYPE, 'enrolledBy', 'freeIPA'), + '2.16.840.1.113730.3.8.3.4': ('2.16.840.1.113730.3.8.3.4', OID_ATTRIBUTE_TYPE, 'fqdn', 'freeIPA'), + '2.16.840.1.113730.3.8.3.18': ('2.16.840.1.113730.3.8.3.18', OID_ATTRIBUTE_TYPE, 'managedBy', 'freeIPA'), + '2.16.840.1.113730.3.8.3.24': ('2.16.840.1.113730.3.8.3.24', OID_ATTRIBUTE_TYPE, 'ipaEntitlementId', 'freeIPA'), + + # controls + '1.2.826.0.1.3344810.2.3': ('1.2.826.0.1.3344810.2.3', OID_CONTROL, 'Matched Values', 'RFC3876'), + '1.2.840.113556.1.4.319': ('1.2.840.113556.1.4.319', OID_CONTROL, 'LDAP Simple Paged Results', 'RFC2696'), + '1.2.840.113556.1.4.417': ('1.2.840.113556.1.4.417', OID_CONTROL, 'LDAP server show deleted objects', 'MICROSOFT'), + '1.2.840.113556.1.4.473': ('1.2.840.113556.1.4.473', OID_CONTROL, 'Sort Request', 'RFC2891'), + '1.2.840.113556.1.4.474': ('1.2.840.113556.1.4.474', OID_CONTROL, 'Sort Response', 'RFC2891'), + '1.2.840.113556.1.4.521': ('1.2.840.113556.1.4.521', OID_CONTROL, 'Cross-domain move', 'MICROSOFT'), + '1.2.840.113556.1.4.528': ('1.2.840.113556.1.4.528', OID_CONTROL, 'Server search notification', 'MICROSOFT'), + '1.2.840.113556.1.4.529': ('1.2.840.113556.1.4.529', OID_CONTROL, 'Extended DN', 'MICROSOFT'), + '1.2.840.113556.1.4.619': ('1.2.840.113556.1.4.619', OID_CONTROL, 'Lazy commit', 'MICROSOFT'), + '1.2.840.113556.1.4.801': ('1.2.840.113556.1.4.801', OID_CONTROL, 'Security descriptor flags', 'MICROSOFT'), + '1.2.840.113556.1.4.802': ('1.2.840.113556.1.4.802', OID_CONTROL, 'Range option', 'MICROSOFT'), + '1.2.840.113556.1.4.805': ('1.2.840.113556.1.4.805', OID_CONTROL, 'Tree delete', 'MICROSOFT'), + '1.2.840.113556.1.4.841': ('1.2.840.113556.1.4.841', OID_CONTROL, 'Directory synchronization', 'MICROSOFT'), + '1.2.840.113556.1.4.970': ('1.2.840.113556.1.4.970', OID_CONTROL, 'Get stats', 'MICROSOFT'), + '1.2.840.113556.1.4.1338': ('1.2.840.113556.1.4.1338', OID_CONTROL, 'Verify name', 'MICROSOFT'), + '1.2.840.113556.1.4.1339': ('1.2.840.113556.1.4.1339', OID_CONTROL, 'Domain scope', 'MICROSOFT'), + '1.2.840.113556.1.4.1340': ('1.2.840.113556.1.4.1340', OID_CONTROL, 'Search options', 'MICROSOFT'), + '1.2.840.113556.1.4.1341': ('1.2.840.113556.1.4.1341', OID_CONTROL, 'RODC DCPROMO', 'MICROSOFT'), + '1.2.840.113556.1.4.1413': ('1.2.840.113556.1.4.1413', OID_CONTROL, 'Permissive modify', 'MICROSOFT'), + '1.2.840.113556.1.4.1504': ('1.2.840.113556.1.4.1504', OID_CONTROL, 'Attribute scoped query', 'MICROSOFT'), + '1.2.840.113556.1.4.1852': ('1.2.840.113556.1.4.1852', OID_CONTROL, 'User quota', 'MICROSOFT'), + '1.2.840.113556.1.4.1907': ('1.2.840.113556.1.4.1907', OID_CONTROL, 'Server shutdown notify', 'MICROSOFT'), + '1.2.840.113556.1.4.1948': ('1.2.840.113556.1.4.1948', OID_CONTROL, 'Range retrieval no error', 'MICROSOFT'), + '1.2.840.113556.1.4.1974': ('1.2.840.113556.1.4.1974', OID_CONTROL, 'Server force update', 'MICROSOFT'), + '1.2.840.113556.1.4.2026': ('1.2.840.113556.1.4.2026', OID_CONTROL, 'Input DN', 'MICROSOFT'), + '1.2.840.113556.1.4.2064': ('1.2.840.113556.1.4.2064', OID_CONTROL, 'Show recycled', 'MICROSOFT'), + '1.2.840.113556.1.4.2065': ('1.2.840.113556.1.4.2065', OID_CONTROL, 'Show deactivated link', 'MICROSOFT'), + '1.2.840.113556.1.4.2066': ('1.2.840.113556.1.4.2066', OID_CONTROL, 'Policy hints [DEPRECATED]', 'MICROSOFT'), + '1.2.840.113556.1.4.2090': ('1.2.840.113556.1.4.2090', OID_CONTROL, 'DirSync EX', 'MICROSOFT'), + '1.2.840.113556.1.4.2204': ('1.2.840.113556.1.4.2204', OID_CONTROL, 'Tree deleted EX', 'MICROSOFT'), + '1.2.840.113556.1.4.2205': ('1.2.840.113556.1.4.2205', OID_CONTROL, 'Updates stats', 'MICROSOFT'), + '1.2.840.113556.1.4.2206': ('1.2.840.113556.1.4.2206', OID_CONTROL, 'Search hints', 'MICROSOFT'), + '1.2.840.113556.1.4.2211': ('1.2.840.113556.1.4.2211', OID_CONTROL, 'Expected entry count', 'MICROSOFT'), + '1.2.840.113556.1.4.2239': ('1.2.840.113556.1.4.2239', OID_CONTROL, 'Policy hints', 'MICROSOFT'), + '1.2.840.113556.1.4.2255': ('1.2.840.113556.1.4.2255', OID_CONTROL, 'Set owner', 'MICROSOFT'), + '1.2.840.113556.1.4.2256': ('1.2.840.113556.1.4.2256', OID_CONTROL, 'Bypass quota', 'MICROSOFT'), + '1.3.6.1.1.7.1': ('1.3.6.1.1.7.1', OID_CONTROL, 'LCUP Sync Request', 'RFC3928'), + '1.3.6.1.1.7.2': ('1.3.6.1.1.7.2', OID_CONTROL, 'LCUP Sync Update', 'RFC3928'), + '1.3.6.1.1.7.3': ('1.3.6.1.1.7.3', OID_CONTROL, 'LCUP Sync Done', 'RFC3928'), + '1.3.6.1.1.12': ('1.3.6.1.1.12', OID_CONTROL, 'Assertion', 'RFC4528'), + '1.3.6.1.1.13.1': ('1.3.6.1.1.13.1', OID_CONTROL, 'LDAP Pre-read', 'RFC4527'), + '1.3.6.1.1.13.2': ('1.3.6.1.1.13.2', OID_CONTROL, 'LDAP Post-read', 'RFC4527'), + '1.3.6.1.1.21.2': ('1.3.6.1.1.21.2', OID_CONTROL, 'Transaction Specification', 'RFC5805'), + '1.3.6.1.1.22': ('1.3.6.1.1.22', OID_CONTROL, "LDAP Don't Use Copy", 'RFC6171'), + '1.3.6.1.4.1.42.2.27.8.5.1': ('1.3.6.1.4.1.42.2.27.8.5.1', OID_CONTROL, 'Password policy', 'IETF DRAFT behera-ldap-password-policy'), + '1.3.6.1.4.1.42.2.27.9.5.2': ('1.3.6.1.4.1.42.2.27.9.5.2', OID_CONTROL, 'Get effective rights', 'IETF DRAFT draft-ietf-ldapext-acl-model'), + '1.3.6.1.4.1.42.2.27.9.5.8': ('1.3.6.1.4.1.42.2.27.9.5.8', OID_CONTROL, 'Account usability', 'SUN microsystems'), + '1.3.6.1.4.1.1466.29539.12': ('1.3.6.1.4.1.1466.29539.12', OID_CONTROL, 'Chaining loop detect', 'SUN microsystems'), + '1.3.6.1.4.1.4203.1.9.1.1': ('1.3.6.1.4.1.4203.1.9.1.1', OID_CONTROL, 'LDAP content synchronization', 'RFC4533'), + '1.3.6.1.4.1.4203.1.10.1': ('1.3.6.1.4.1.4203.1.10.1', OID_CONTROL, 'Subentries', 'RFC3672'), + '1.3.6.1.4.1.4203.1.10.2': ('1.3.6.1.4.1.4203.1.10.2', OID_CONTROL, 'No-Operation', 'IETF DRAFT draft-zeilenga-ldap-noop'), + '1.3.6.1.4.1.4203.666.5.16': ('1.3.6.1.4.1.4203.666.5.16', OID_CONTROL, 'LDAP Dereference', 'IETF DRAFT draft-masarati-ldap-deref'), + '1.3.6.1.4.1.7628.5.101.1': ('1.3.6.1.4.1.7628.5.101.1', OID_CONTROL, 'LDAP subentries', 'IETF DRAFT draft-ietf-ldup-subentry'), + '1.3.6.1.4.1.26027.1.5.2': ('1.3.6.1.4.1.26027.1.5.2', OID_CONTROL, 'Replication repair', 'OpenDS'), + '2.16.840.1.113719.1.27.101.5': ('2.16.840.1.113719.1.27.101.5', OID_CONTROL, 'Simple password', 'NOVELL'), + '1.3.6.1.4.1.26027.1.6.1': ('1.3.6.1.4.1.26027.1.6.1', OID_CONTROL, 'Password policy state', 'OpenDS'), + '1.3.6.1.4.1.26027.1.6.2': ('1.3.6.1.4.1.26027.1.6.2', OID_CONTROL, 'Get connection ID', 'OpenDS'), + '1.3.6.1.4.1.26027.1.6.3': ('1.3.6.1.4.1.26027.1.6.3', OID_CONTROL, 'Get symmetric key', 'OpenDS'), + '2.16.840.1.113719.1.27.101.6': ('2.16.840.1.113719.1.27.101.6', OID_CONTROL, 'Forward reference', 'NOVELL'), + '2.16.840.1.113719.1.27.103.7': ('2.16.840.1.113719.1.27.103.7', OID_CONTROL, 'Grouping', 'NOVELL'), + '2.16.840.1.113730.3.4.2': ('2.16.840.1.113730.3.4.2', OID_CONTROL, 'ManageDsaIT', 'RFC3296'), + '2.16.840.1.113730.3.4.3': ('2.16.840.1.113730.3.4.3', OID_CONTROL, 'Persistent Search', 'IETF'), + '2.16.840.1.113730.3.4.4': ('2.16.840.1.113730.3.4.4', OID_CONTROL, 'Netscape Password Expired', 'Netscape'), + '2.16.840.1.113730.3.4.5': ('2.16.840.1.113730.3.4.5', OID_CONTROL, 'Netscape Password Expiring', 'Netscape'), + '2.16.840.1.113730.3.4.6': ('2.16.840.1.113730.3.4.6', OID_CONTROL, 'Netscape NT Synchronization Client', 'Netscape'), + '2.16.840.1.113730.3.4.7': ('2.16.840.1.113730.3.4.7', OID_CONTROL, 'Entry Change Notification', 'Netscape'), + '2.16.840.1.113730.3.4.9': ('2.16.840.1.113730.3.4.9', OID_CONTROL, 'Virtual List View Request', 'IETF'), + '2.16.840.1.113730.3.4.10': ('2.16.840.1.113730.3.4.10', OID_CONTROL, 'Virtual List View Response', 'IETF'), + '2.16.840.1.113730.3.4.12': ('2.16.840.1.113730.3.4.12', OID_CONTROL, 'Proxied Authorization (old)', 'Netscape'), + '2.16.840.1.113730.3.4.13': ('2.16.840.1.113730.3.4.13', OID_CONTROL, 'iPlanet Directory Server Replication Update Information', 'Netscape'), + '2.16.840.1.113730.3.4.14': ('2.16.840.1.113730.3.4.14', OID_CONTROL, 'Search on specific database', 'Netscape'), + '2.16.840.1.113730.3.4.15': ('2.16.840.1.113730.3.4.15', OID_CONTROL, 'Authorization Identity Response Control', 'RFC3829'), + '2.16.840.1.113730.3.4.16': ('2.16.840.1.113730.3.4.16', OID_CONTROL, 'Authorization Identity Request Control', 'RFC3829'), + '2.16.840.1.113730.3.4.17': ('2.16.840.1.113730.3.4.17', OID_CONTROL, 'Real attribute only request', 'Netscape'), + '2.16.840.1.113730.3.4.18': ('2.16.840.1.113730.3.4.18', OID_CONTROL, 'Proxy Authorization Control', 'RFC6171'), + '2.16.840.1.113730.3.4.19': ('2.16.840.1.113730.3.4.19', OID_CONTROL, 'Chaining loop detection', 'Netscape'), + '2.16.840.1.113730.3.4.20': ('2.16.840.1.113730.3.4.20', OID_CONTROL, 'Mapping Tree Node - Use one backend [extended]', 'openLDAP'), + '2.16.840.1.113730.3.8.10.6': ('2.16.840.1.113730.3.8.10.6', OID_CONTROL, 'OTP Sync Request', 'freeIPA'), + + # dit content rules + + # extensions + '1.2.840.113556.1.4.1781': ('1.2.840.113556.1.4.1781', OID_EXTENSION, 'Fast concurrent bind', 'MICROSOFT'), + '1.2.840.113556.1.4.2212': ('1.2.840.113556.1.4.2212', OID_EXTENSION, 'Batch request', 'MICROSOFT'), + '1.3.6.1.1.8': ('1.3.6.1.1.8', OID_EXTENSION, 'Cancel Operation', 'RFC3909'), + '1.3.6.1.1.21.1': ('1.3.6.1.1.21.1', OID_EXTENSION, 'Start Transaction Extended Request', 'RFC5805'), + '1.3.6.1.1.21.3': ('1.3.6.1.1.21.3', OID_EXTENSION, 'End Transaction Extended Request', 'RFC5805'), + '1.3.6.1.4.1.1466.101.119.1': ('1.3.6.1.4.1.1466.101.119.1', OID_EXTENSION, 'Dynamic Refresh', 'RFC2589'), + '1.3.6.1.4.1.1466.20037': ('1.3.6.1.4.1.1466.20037', OID_EXTENSION, 'StartTLS', 'RFC4511-RFC4513'), + '1.3.6.1.4.1.4203.1.11.1': ('1.3.6.1.4.1.4203.1.11.1', OID_EXTENSION, 'Modify Password', 'RFC3062'), + '1.3.6.1.4.1.4203.1.11.3': ('1.3.6.1.4.1.4203.1.11.3', OID_EXTENSION, 'Who am I', 'RFC4532'), + '1.3.6.1.1.17.1': ('1.3.6.1.1.17.1', OID_EXTENSION, 'StartLBURPRequest LDAP ExtendedRequest message', 'RFC4373'), + '1.3.6.1.1.17.2': ('1.3.6.1.1.17.2', OID_EXTENSION, 'StartLBURPResponse LDAP ExtendedResponse message', 'RFC4373'), + '1.3.6.1.1.17.3': ('1.3.6.1.1.17.3', OID_EXTENSION, 'EndLBURPRequest LDAP ExtendedRequest message', 'RFC4373'), + '1.3.6.1.1.17.4': ('1.3.6.1.1.17.4', OID_EXTENSION, 'EndLBURPResponse LDAP ExtendedResponse message', 'RFC4373'), + '1.3.6.1.1.17.5': ('1.3.6.1.1.17.5', OID_EXTENSION, 'LBURPUpdateRequest LDAP ExtendedRequest message', 'RFC4373'), + '1.3.6.1.1.17.6': ('1.3.6.1.1.17.6', OID_EXTENSION, 'LBURPUpdateResponse LDAP ExtendedResponse message', 'RFC4373'), + '1.3.6.1.1.19': ('1.3.6.1.1.19', OID_EXTENSION, 'LDAP Turn Operation', 'RFC4531'), + '2.16.840.1.113719.1.14.100.1': ('2.16.840.1.113719.1.14.100.1', OID_EXTENSION, 'getDriverSetRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.2': ('2.16.840.1.113719.1.14.100.2', OID_EXTENSION, 'getDriverSetResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.3': ('2.16.840.1.113719.1.14.100.3', OID_EXTENSION, 'setDriverSetRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.4': ('2.16.840.1.113719.1.14.100.4', OID_EXTENSION, 'setDriverSetResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.5': ('2.16.840.1.113719.1.14.100.5', OID_EXTENSION, 'clearDriverSetRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.6': ('2.16.840.1.113719.1.14.100.6', OID_EXTENSION, 'clearDriverSetResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.7': ('2.16.840.1.113719.1.14.100.7', OID_EXTENSION, 'getDriverStartOptionRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.8': ('2.16.840.1.113719.1.14.100.8', OID_EXTENSION, 'getDriverStartOptionResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.9': ('2.16.840.1.113719.1.14.100.9', OID_EXTENSION, 'setDriverStartOptionRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.10': ('2.16.840.1.113719.1.14.100.10', OID_EXTENSION, 'setDriverStartOptionResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.11': ('2.16.840.1.113719.1.14.100.11', OID_EXTENSION, 'getVersionRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.12': ('2.16.840.1.113719.1.14.100.12', OID_EXTENSION, 'getVersionResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.13': ('2.16.840.1.113719.1.14.100.13', OID_EXTENSION, 'getDriverStateRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.14': ('2.16.840.1.113719.1.14.100.14', OID_EXTENSION, 'getDriverStateResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.15': ('2.16.840.1.113719.1.14.100.15', OID_EXTENSION, 'startDriverRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.16': ('2.16.840.1.113719.1.14.100.16', OID_EXTENSION, 'startDriverResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.17': ('2.16.840.1.113719.1.14.100.17', OID_EXTENSION, 'stopDriverRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.18': ('2.16.840.1.113719.1.14.100.18', OID_EXTENSION, 'stopDriverResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.19': ('2.16.840.1.113719.1.14.100.19', OID_EXTENSION, 'getDriverStatsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.20': ('2.16.840.1.113719.1.14.100.20', OID_EXTENSION, 'getDriverStatsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.21': ('2.16.840.1.113719.1.14.100.21', OID_EXTENSION, 'driverGetSchemaRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.22': ('2.16.840.1.113719.1.14.100.22', OID_EXTENSION, 'driverGetSchemaResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.23': ('2.16.840.1.113719.1.14.100.23', OID_EXTENSION, 'driverResyncRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.24': ('2.16.840.1.113719.1.14.100.24', OID_EXTENSION, 'driverResyncResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.25': ('2.16.840.1.113719.1.14.100.25', OID_EXTENSION, 'migrateAppRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.26': ('2.16.840.1.113719.1.14.100.26', OID_EXTENSION, 'migrateAppResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.27': ('2.16.840.1.113719.1.14.100.27', OID_EXTENSION, 'queueEventRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.28': ('2.16.840.1.113719.1.14.100.28', OID_EXTENSION, 'queueEventResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.29': ('2.16.840.1.113719.1.14.100.29', OID_EXTENSION, 'submitCommandRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.30': ('2.16.840.1.113719.1.14.100.30', OID_EXTENSION, 'submitCommandResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.31': ('2.16.840.1.113719.1.14.100.31', OID_EXTENSION, 'submitEventRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.32': ('2.16.840.1.113719.1.14.100.32', OID_EXTENSION, 'submitEventResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.33': ('2.16.840.1.113719.1.14.100.33', OID_EXTENSION, 'getChunkedResultRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.34': ('2.16.840.1.113719.1.14.100.34', OID_EXTENSION, 'getChunkedResultResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.35': ('2.16.840.1.113719.1.14.100.35', OID_EXTENSION, 'closeChunkedResultRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.36': ('2.16.840.1.113719.1.14.100.36', OID_EXTENSION, 'closeChunkedResultResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.37': ('2.16.840.1.113719.1.14.100.37', OID_EXTENSION, 'checkObjectPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.38': ('2.16.840.1.113719.1.14.100.38', OID_EXTENSION, 'checkObjectPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.39': ('2.16.840.1.113719.1.14.100.39', OID_EXTENSION, 'initDriverObjectRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.40': ('2.16.840.1.113719.1.14.100.40', OID_EXTENSION, 'initDriverObjectResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.41': ('2.16.840.1.113719.1.14.100.41', OID_EXTENSION, 'viewCacheEntriesRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.42': ('2.16.840.1.113719.1.14.100.42', OID_EXTENSION, 'viewCacheEntriesResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.43': ('2.16.840.1.113719.1.14.100.43', OID_EXTENSION, 'deleteCacheEntriesRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.44': ('2.16.840.1.113719.1.14.100.44', OID_EXTENSION, 'deleteCacheEntriesResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.45': ('2.16.840.1.113719.1.14.100.45', OID_EXTENSION, 'getPasswordsStateRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.46': ('2.16.840.1.113719.1.14.100.46', OID_EXTENSION, 'getPasswordsStateResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.47': ('2.16.840.1.113719.1.14.100.47', OID_EXTENSION, 'regenerateKeyRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.48': ('2.16.840.1.113719.1.14.100.48', OID_EXTENSION, 'regenerateKeyResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.49': ('2.16.840.1.113719.1.14.100.49', OID_EXTENSION, 'getServerCertRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.50': ('2.16.840.1.113719.1.14.100.50', OID_EXTENSION, 'getServerCertResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.51': ('2.16.840.1.113719.1.14.100.51', OID_EXTENSION, 'discoverJobsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.52': ('2.16.840.1.113719.1.14.100.52', OID_EXTENSION, 'discoverJobsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.53': ('2.16.840.1.113719.1.14.100.53', OID_EXTENSION, 'notifyJobUpdateRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.54': ('2.16.840.1.113719.1.14.100.54', OID_EXTENSION, 'notifyJobUpdateResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.55': ('2.16.840.1.113719.1.14.100.55', OID_EXTENSION, 'startJobRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.56': ('2.16.840.1.113719.1.14.100.56', OID_EXTENSION, 'startJobResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.57': ('2.16.840.1.113719.1.14.100.57', OID_EXTENSION, 'abortJobRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.58': ('2.16.840.1.113719.1.14.100.58', OID_EXTENSION, 'abortJobresponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.59': ('2.16.840.1.113719.1.14.100.59', OID_EXTENSION, 'getJobStateRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.60': ('2.16.840.1.113719.1.14.100.60', OID_EXTENSION, 'getJobStateResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.61': ('2.16.840.1.113719.1.14.100.61', OID_EXTENSION, 'checkJobConfigRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.62': ('2.16.840.1.113719.1.14.100.62', OID_EXTENSION, 'checkJobConfigResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.63': ('2.16.840.1.113719.1.14.100.63', OID_EXTENSION, 'setLogEventsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.64': ('2.16.840.1.113719.1.14.100.64', OID_EXTENSION, 'setLogEventsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.65': ('2.16.840.1.113719.1.14.100.65', OID_EXTENSION, 'clearLogEventsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.66': ('2.16.840.1.113719.1.14.100.66', OID_EXTENSION, 'clearLogEventsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.67': ('2.16.840.1.113719.1.14.100.67', OID_EXTENSION, 'setAppPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.68': ('2.16.840.1.113719.1.14.100.68', OID_EXTENSION, 'setAppPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.69': ('2.16.840.1.113719.1.14.100.69', OID_EXTENSION, 'clearAppPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.70': ('2.16.840.1.113719.1.14.100.70', OID_EXTENSION, 'clearAppPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.71': ('2.16.840.1.113719.1.14.100.71', OID_EXTENSION, 'setRemoteLoaderPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.72': ('2.16.840.1.113719.1.14.100.72', OID_EXTENSION, 'setRemoteLoaderPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.73': ('2.16.840.1.113719.1.14.100.73', OID_EXTENSION, 'clearRemoteLoaderPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.74': ('2.16.840.1.113719.1.14.100.74', OID_EXTENSION, 'clearRemoteLoaderPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.75': ('2.16.840.1.113719.1.14.100.75', OID_EXTENSION, 'setNamedPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.76': ('2.16.840.1.113719.1.14.100.76', OID_EXTENSION, 'setNamedPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.77': ('2.16.840.1.113719.1.14.100.77', OID_EXTENSION, 'removeNamedPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.78': ('2.16.840.1.113719.1.14.100.78', OID_EXTENSION, 'removeNamedPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.79': ('2.16.840.1.113719.1.14.100.79', OID_EXTENSION, 'removeAllNamedPasswordsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.80': ('2.16.840.1.113719.1.14.100.80', OID_EXTENSION, 'removeAllNamedPasswordsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.81': ('2.16.840.1.113719.1.14.100.81', OID_EXTENSION, 'listNamedPasswordsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.82': ('2.16.840.1.113719.1.14.100.82', OID_EXTENSION, 'listNamedPasswordsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.83': ('2.16.840.1.113719.1.14.100.83', OID_EXTENSION, 'getDefaultReciprocalAttrsMapRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.84': ('2.16.840.1.113719.1.14.100.84', OID_EXTENSION, 'getDefaultReciprocalAttrsMapResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.85': ('2.16.840.1.113719.1.14.100.85', OID_EXTENSION, 'resetDriverStatsRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.86': ('2.16.840.1.113719.1.14.100.86', OID_EXTENSION, 'resetDriverStatsResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.87': ('2.16.840.1.113719.1.14.100.87', OID_EXTENSION, 'regenerateAllKeysRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.88': ('2.16.840.1.113719.1.14.100.88', OID_EXTENSION, 'regenerateAllKeysResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.89': ('2.16.840.1.113719.1.14.100.89', OID_EXTENSION, 'getDriverGCVRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.90': ('2.16.840.1.113719.1.14.100.90', OID_EXTENSION, 'getDriverGCVResponse', 'NOVELL'), + '2.16.840.1.113719.1.14.100.91': ('2.16.840.1.113719.1.14.100.91', OID_EXTENSION, 'getNamedPasswordRequest', 'NOVELL'), + '2.16.840.1.113719.1.14.100.92': ('2.16.840.1.113719.1.14.100.92', OID_EXTENSION, 'getNamedPasswordResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.1': ('2.16.840.1.113719.1.27.100.1', OID_EXTENSION, 'ndsToLdapResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.2': ('2.16.840.1.113719.1.27.100.2', OID_EXTENSION, 'ndsToLdapRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.3': ('2.16.840.1.113719.1.27.100.3', OID_EXTENSION, 'splitPartitionRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.4': ('2.16.840.1.113719.1.27.100.4', OID_EXTENSION, 'splitPartitionResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.5': ('2.16.840.1.113719.1.27.100.5', OID_EXTENSION, 'mergePartitionRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.6': ('2.16.840.1.113719.1.27.100.6', OID_EXTENSION, 'mergePartitionResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.7': ('2.16.840.1.113719.1.27.100.7', OID_EXTENSION, 'addReplicaRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.8': ('2.16.840.1.113719.1.27.100.8', OID_EXTENSION, 'addReplicaResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.9': ('2.16.840.1.113719.1.27.100.9', OID_EXTENSION, 'refreshLDAPServerRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.10': ('2.16.840.1.113719.1.27.100.10', OID_EXTENSION, 'refreshLDAPServerResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.11': ('2.16.840.1.113719.1.27.100.11', OID_EXTENSION, 'removeReplicaRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.12': ('2.16.840.1.113719.1.27.100.12', OID_EXTENSION, 'removeReplicaResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.13': ('2.16.840.1.113719.1.27.100.13', OID_EXTENSION, 'partitionEntryCountRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.14': ('2.16.840.1.113719.1.27.100.14', OID_EXTENSION, 'partitionEntryCountResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.15': ('2.16.840.1.113719.1.27.100.15', OID_EXTENSION, 'changeReplicaTypeRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.16': ('2.16.840.1.113719.1.27.100.16', OID_EXTENSION, 'changeReplicaTypeResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.17': ('2.16.840.1.113719.1.27.100.17', OID_EXTENSION, 'getReplicaInfoRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.18': ('2.16.840.1.113719.1.27.100.18', OID_EXTENSION, 'getReplicaInfoResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.19': ('2.16.840.1.113719.1.27.100.19', OID_EXTENSION, 'listReplicaRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.20': ('2.16.840.1.113719.1.27.100.20', OID_EXTENSION, 'listReplicaResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.21': ('2.16.840.1.113719.1.27.100.21', OID_EXTENSION, 'receiveAllUpdatesRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.22': ('2.16.840.1.113719.1.27.100.22', OID_EXTENSION, 'receiveAllUpdatesResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.23': ('2.16.840.1.113719.1.27.100.23', OID_EXTENSION, 'sendAllUpdatesRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.24': ('2.16.840.1.113719.1.27.100.24', OID_EXTENSION, 'sendAllUpdatesResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.25': ('2.16.840.1.113719.1.27.100.25', OID_EXTENSION, 'requestPartitionSyncRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.26': ('2.16.840.1.113719.1.27.100.26', OID_EXTENSION, 'requestPartitionSyncResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.27': ('2.16.840.1.113719.1.27.100.27', OID_EXTENSION, 'requestSchemaSyncRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.28': ('2.16.840.1.113719.1.27.100.28', OID_EXTENSION, 'requestSchemaSyncResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.29': ('2.16.840.1.113719.1.27.100.29', OID_EXTENSION, 'abortPartitionOperationRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.30': ('2.16.840.1.113719.1.27.100.30', OID_EXTENSION, 'abortPartitionOperationResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.31': ('2.16.840.1.113719.1.27.100.31', OID_EXTENSION, 'getBindDNRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.32': ('2.16.840.1.113719.1.27.100.32', OID_EXTENSION, 'getBindDNResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.33': ('2.16.840.1.113719.1.27.100.33', OID_EXTENSION, 'getEffectivePrivilegesRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.34': ('2.16.840.1.113719.1.27.100.34', OID_EXTENSION, 'getEffectivePrivilegesResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.35': ('2.16.840.1.113719.1.27.100.35', OID_EXTENSION, 'setReplicationFilterRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.36': ('2.16.840.1.113719.1.27.100.36', OID_EXTENSION, 'setReplicationFilterResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.37': ('2.16.840.1.113719.1.27.100.37', OID_EXTENSION, 'getReplicationFilterRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.38': ('2.16.840.1.113719.1.27.100.38', OID_EXTENSION, 'getReplicationFilterResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.39': ('2.16.840.1.113719.1.27.100.39', OID_EXTENSION, 'splitOrphanPartitionRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.40': ('2.16.840.1.113719.1.27.100.40', OID_EXTENSION, 'splitOrphanPartitionResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.41': ('2.16.840.1.113719.1.27.100.41', OID_EXTENSION, 'removeOrphanPartitionRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.42': ('2.16.840.1.113719.1.27.100.42', OID_EXTENSION, 'removeOrphanPartitionResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.43': ('2.16.840.1.113719.1.27.100.43', OID_EXTENSION, 'triggerBKLinkerRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.44': ('2.16.840.1.113719.1.27.100.44', OID_EXTENSION, 'triggerBKLinkerResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.45': ('2.16.840.1.113719.1.27.100.45', OID_EXTENSION, 'triggerDRLProcessRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.46': ('2.16.840.1.113719.1.27.100.46', OID_EXTENSION, 'triggerDRLProcessResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.47': ('2.16.840.1.113719.1.27.100.47', OID_EXTENSION, 'triggerJanitorRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.48': ('2.16.840.1.113719.1.27.100.48', OID_EXTENSION, 'triggerJanitorResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.49': ('2.16.840.1.113719.1.27.100.49', OID_EXTENSION, 'triggerLimberRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.50': ('2.16.840.1.113719.1.27.100.50', OID_EXTENSION, 'triggerLimberResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.51': ('2.16.840.1.113719.1.27.100.51', OID_EXTENSION, 'triggerSkulkerRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.52': ('2.16.840.1.113719.1.27.100.52', OID_EXTENSION, 'triggerSkulkerResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.53': ('2.16.840.1.113719.1.27.100.53', OID_EXTENSION, 'triggerSchemaSyncRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.54': ('2.16.840.1.113719.1.27.100.54', OID_EXTENSION, 'triggerSchemaSyncResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.55': ('2.16.840.1.113719.1.27.100.55', OID_EXTENSION, 'triggerPartitionPurgeRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.56': ('2.16.840.1.113719.1.27.100.56', OID_EXTENSION, 'triggerPartitionPurgeResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.79': ('2.16.840.1.113719.1.27.100.79', OID_EXTENSION, 'eventMonitorRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.80': ('2.16.840.1.113719.1.27.100.80', OID_EXTENSION, 'eventMonitorResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.81': ('2.16.840.1.113719.1.27.100.81', OID_EXTENSION, 'nldapEventNotification', 'NOVELL'), + '2.16.840.1.113719.1.27.100.84': ('2.16.840.1.113719.1.27.100.84', OID_EXTENSION, 'filteredEventMonitorRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.85': ('2.16.840.1.113719.1.27.100.85', OID_EXTENSION, 'filteredEventMonitorResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.96': ('2.16.840.1.113719.1.27.100.96', OID_EXTENSION, 'ldapBackupRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.97': ('2.16.840.1.113719.1.27.100.97', OID_EXTENSION, 'ldapBackupResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.98': ('2.16.840.1.113719.1.27.100.98', OID_EXTENSION, 'ldapRestoreRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.99': ('2.16.840.1.113719.1.27.100.99', OID_EXTENSION, 'ldapRestoreResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.101': ('2.16.840.1.113719.1.27.100.101', OID_EXTENSION, 'LDAPDNStoX500DNRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.102': ('2.16.840.1.113719.1.27.100.102', OID_EXTENSION, 'LDAPDNStoX500DNResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.100.103': ('2.16.840.1.113719.1.27.100.103', OID_EXTENSION, 'getPrivilegesListRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.100.104': ('2.16.840.1.113719.1.27.100.104', OID_EXTENSION, 'getPrivilegesListResponse', 'NOVELL'), + '2.16.840.1.113719.1.27.103.1': ('2.16.840.1.113719.1.27.103.1', OID_EXTENSION, 'createGroupingRequest', 'NOVELL'), + '2.16.840.1.113719.1.27.103.2': ('2.16.840.1.113719.1.27.103.2', OID_EXTENSION, 'endGroupingRequest', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.1': ('2.16.840.1.113719.1.39.42.100.1', OID_EXTENSION, 'NMAS Put Login Configuration', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.3': ('2.16.840.1.113719.1.39.42.100.3', OID_EXTENSION, 'NMAS Get Login Configuration', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.5': ('2.16.840.1.113719.1.39.42.100.5', OID_EXTENSION, 'NMAS Delete Login Configuration', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.7': ('2.16.840.1.113719.1.49.42.100.7', OID_EXTENSION, 'NMAS Put Login Secret', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.9': ('2.16.840.1.113719.1.39.42.100.9', OID_EXTENSION, 'NMAS Delete Login Secret', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.11': ('2.16.840.1.113719.1.39.42.100.11', OID_EXTENSION, 'NMAS Set Universal Password Request', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.12': ('2.16.840.1.113719.1.39.42.100.12', OID_EXTENSION, 'NMAS Set Universal Password Response', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.13': ('2.16.840.1.113719.1.39.42.100.13', OID_EXTENSION, 'NMAS Get Universal Password Request', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.14': ('2.16.840.1.113719.1.39.42.100.14', OID_EXTENSION, 'NMAS Get Universal Password Response', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.15': ('2.16.840.1.113719.1.39.42.100.15', OID_EXTENSION, 'NMAS Delete Universal Password', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.17': ('2.16.840.1.113719.1.39.42.100.17', OID_EXTENSION, 'NMAS Check password against password policy', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.19': ('2.16.840.1.113719.1.39.42.100.19', OID_EXTENSION, 'NMAS Get password policy information', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.21': ('2.16.840.1.113719.1.39.42.100.21', OID_EXTENSION, 'NMAS Change Universal Password', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.23': ('2.16.840.1.113719.1.39.42.100.23', OID_EXTENSION, 'NMAS Graded Authentication management', 'NOVELL'), + '2.16.840.1.113719.1.39.42.100.25': ('2.16.840.1.113719.1.39.42.100.25', OID_EXTENSION, 'NMAS management (new with NMAS 3.1.0)', 'NOVELL'), + '2.16.840.1.113719.1.142.1.4.1': ('2.16.840.1.113719.1.142.1.4.1', OID_EXTENSION, 'LBURPIncUpdate', 'NOVELL'), + '2.16.840.1.113719.1.142.1.4.2': ('2.16.840.1.113719.1.142.1.4.2', OID_EXTENSION, 'LBURPFullUpdate', 'NOVELL'), + '2.16.840.1.113719.1.142.100.1': ('2.16.840.1.113719.1.142.100.1', OID_EXTENSION, 'LBURPStartReplRequest', 'NOVELL'), + '2.16.840.1.113719.1.142.100.2': ('2.16.840.1.113719.1.142.100.2', OID_EXTENSION, 'LBURPStartReplResponse', 'NOVELL'), + '2.16.840.1.113719.1.142.100.4': ('2.16.840.1.113719.1.142.100.4', OID_EXTENSION, 'LBURPEndReplRequest', 'NOVELL'), + '2.16.840.1.113719.1.142.100.5': ('2.16.840.1.113719.1.142.100.5', OID_EXTENSION, 'LBURPEndReplResponse', 'NOVELL'), + '2.16.840.1.113719.1.142.100.6': ('2.16.840.1.113719.1.142.100.6', OID_EXTENSION, 'LBURPOperationRequest', 'NOVELL'), + '2.16.840.1.113719.1.142.100.7': ('2.16.840.1.113719.1.142.100.7', OID_EXTENSION, 'LBURPOperationResponse', 'NOVELL'), + '2.16.840.1.113719.1.148.100.1': ('2.16.840.1.113719.1.148.100.1', OID_EXTENSION, 'SSLDAP_GET_SERVICE_INFO_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.2': ('2.16.840.1.113719.1.148.100.2', OID_EXTENSION, 'SSLDAP_GET_SERVICE_INFO_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.3': ('2.16.840.1.113719.1.148.100.3', OID_EXTENSION, 'SSLDAP_READ_SECRET_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.4': ('2.16.840.1.113719.1.148.100.4', OID_EXTENSION, 'SSLDAP_READ_SECRET_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.5': ('2.16.840.1.113719.1.148.100.5', OID_EXTENSION, 'SSLDAP_WRITE_SECRET_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.6': ('2.16.840.1.113719.1.148.100.6', OID_EXTENSION, 'SSLDAP_WRITE_SECRET_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.7': ('2.16.840.1.113719.1.148.100.7', OID_EXTENSION, 'SSLDAP_ADD_SECRET_ID_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.8': ('2.16.840.1.113719.1.148.100.8', OID_EXTENSION, 'SSLDAP_ADD_SECRET_ID_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.9': ('2.16.840.1.113719.1.148.100.9', OID_EXTENSION, 'SSLDAP_REMOVE_SECRET_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.10': ('2.16.840.1.113719.1.148.100.10', OID_EXTENSION, 'SSLDAP_REMOVE_SECRET_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.11': ('2.16.840.1.113719.1.148.100.11', OID_EXTENSION, 'SSLDAP_REMOVE_SECRET_STORE_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.12': ('2.16.840.1.113719.1.148.100.12', OID_EXTENSION, 'SSLDAP_REMOVE_SECRET_STORE_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.13': ('2.16.840.1.113719.1.148.100.13', OID_EXTENSION, 'SSLDAP_ENUMERATE_SECRET_IDS_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.14': ('2.16.840.1.113719.1.148.100.14', OID_EXTENSION, 'SSLDAP_ENUMERATE_SECRET_IDS_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.15': ('2.16.840.1.113719.1.148.100.15', OID_EXTENSION, 'SSLDAP_UNLOCK_SECRETS_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.16': ('2.16.840.1.113719.1.148.100.16', OID_EXTENSION, 'SSLDAP_UNLOCK_SECRETS_REPLY', 'NOVELL'), + '2.16.840.1.113719.1.148.100.17': ('2.16.840.1.113719.1.148.100.17', OID_EXTENSION, 'SSLDAP_SET_EP_MASTER_PASSWORD_REQUEST', 'NOVELL'), + '2.16.840.1.113719.1.148.100.18': ('2.16.840.1.113719.1.148.100.18', OID_EXTENSION, 'SSLDAP_SET_EP_MASTER_PASSWORD_REPLY', 'NOVELL'), + '2.16.840.1.113730.3.5.1': ('2.16.840.1.113730.3.5.1', OID_EXTENSION, 'Transaction Request Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.2': ('2.16.840.1.113730.3.5.2', OID_EXTENSION, 'Transaction Response Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.3': ('2.16.840.1.113730.3.5.3', OID_EXTENSION, 'Transaction Response Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.4': ('2.16.840.1.113730.3.5.4', OID_EXTENSION, 'iPlanet Replication Response Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.5': ('2.16.840.1.113730.3.5.5', OID_EXTENSION, 'iPlanet End Replication Request Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.6': ('2.16.840.1.113730.3.5.6', OID_EXTENSION, 'iPlanet Replication Entry Request Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.7': ('2.16.840.1.113730.3.5.7', OID_EXTENSION, 'iPlanet Bulk Import Start Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.8': ('2.16.840.1.113730.3.5.8', OID_EXTENSION, 'iPlanet Bulk Import Finished Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.9': ('2.16.840.1.113730.3.5.9', OID_EXTENSION, 'iPlanet Digest Authentication Calculation Extended Operation', 'Netscape'), + '2.16.840.1.113730.3.5.10': ('2.16.840.1.113730.3.5.10', OID_EXTENSION, 'Distributed Numeric Assignment Extended Request', 'Netscape'), + '2.16.840.1.113730.3.5.11': ('2.16.840.1.113730.3.5.11', OID_EXTENSION, 'Distributed Numeric Assignment Extended Response', 'Netscape'), + '2.16.840.1.113730.3.5.12': ('2.16.840.1.113730.3.5.12', OID_EXTENSION, 'Start replication request', 'Netscape'), + '2.16.840.1.113730.3.5.13': ('2.16.840.1.113730.3.5.13', OID_EXTENSION, 'Start replication response', 'Netscape'), + '2.16.840.1.113730.3.6.5': ('2.16.840.1.113730.3.6.5', OID_EXTENSION, 'Replication CleanAllRUV', 'Netscape'), + '2.16.840.1.113730.3.6.6': ('2.16.840.1.113730.3.6.6', OID_EXTENSION, 'Replication Abort CleanAllRUV', 'Netscape'), + '2.16.840.1.113730.3.6.7': ('2.16.840.1.113730.3.6.7', OID_EXTENSION, 'Replication CleanAllRUV Retrieve MaxCSN', 'Netscape'), + '2.16.840.1.113730.3.6.8': ('2.16.840.1.113730.3.6.8', OID_EXTENSION, 'Replication CleanAllRUV Check Status', 'Netscape'), + '2.16.840.1.113730.3.8.10.1': ('2.16.840.1.113730.3.8.10.1', OID_EXTENSION, 'KeyTab set', 'FreeIPA'), + '2.16.840.1.113730.3.8.10.2': ('2.16.840.1.113730.3.8.10.2', OID_EXTENSION, 'KeyTab ret', 'FreeIPA'), + '2.16.840.1.113730.3.8.10.3': ('2.16.840.1.113730.3.8.10.3', OID_EXTENSION, 'Enrollment join', 'FreeIPA'), + '2.16.840.1.113730.3.8.10.5': ('2.16.840.1.113730.3.8.10.5', OID_EXTENSION, 'KeyTab get', 'FreeIPA'), + + # features (capabilities) + '1.2.840.113556.1.4.800': ('1.2.840.113556.1.4.800', OID_FEATURE, 'Active directory', 'MICROSOFT'), + '1.2.840.113556.1.4.1670': ('1.2.840.113556.1.4.1670', OID_FEATURE, 'Active directory V51', 'MICROSOFT'), + '1.2.840.113556.1.4.1791': ('1.2.840.113556.1.4.1791', OID_FEATURE, 'Active directory LDAP Integration', 'MICROSOFT'), + '1.2.840.113556.1.4.1880': ('1.2.840.113556.1.4.1880', OID_FEATURE, 'Active directory ADAM digest', 'MICROSOFT'), + '1.2.840.113556.1.4.1851': ('1.2.840.113556.1.4.1851', OID_FEATURE, 'Active directory ADAM', 'MICROSOFT'), + '1.2.840.113556.1.4.1920': ('1.2.840.113556.1.4.1920', OID_FEATURE, 'Active directory partial secrets', 'MICROSOFT'), + '1.2.840.113556.1.4.1935': ('1.2.840.113556.1.4.1935', OID_FEATURE, 'Active directory V60', 'MICROSOFT'), + '1.2.840.113556.1.4.2080': ('1.2.840.113556.1.4.2080', OID_FEATURE, 'Active directory V61 R2', 'MICROSOFT'), + '1.2.840.113556.1.4.2237': ('1.2.840.113556.1.4.2237', OID_FEATURE, 'Active directory W8', 'MICROSOFT'), + '1.3.6.1.1.14': ('1.3.6.1.1.14', OID_FEATURE, 'Modify-Increment', 'RFC4525'), + '1.3.6.1.1.17.7': ('1.3.6.1.1.17.7', OID_FEATURE, 'LBURP Incremental Update style OID', 'RFC4373'), + '1.3.6.1.4.1.4203.1.5.1': ('1.3.6.1.4.1.4203.1.5.1', OID_FEATURE, 'All Op Attrs', 'RFC3673'), + '1.3.6.1.4.1.4203.1.5.2': ('1.3.6.1.4.1.4203.1.5.2', OID_FEATURE, 'OC AD Lists', 'RFC4529'), + '1.3.6.1.4.1.4203.1.5.3': ('1.3.6.1.4.1.4203.1.5.3', OID_FEATURE, 'True/False filters', 'RFC4526'), + '1.3.6.1.4.1.4203.1.5.4': ('1.3.6.1.4.1.4203.1.5.4', OID_FEATURE, 'Language Tag Options', 'RFC3866'), + '1.3.6.1.4.1.4203.1.5.5': ('1.3.6.1.4.1.4203.1.5.5', OID_FEATURE, 'language Range Options', 'RFC3866'), + '2.16.840.1.113719.1.27.99.1': ('2.16.840.1.113719.1.27.99.1', OID_FEATURE, 'Superior References', 'NOVELL'), + + # ldap syntaxes + '1.2.840.113556.1.4.903': ('1.2.840.113556.1.4.903', OID_LDAP_SYNTAX, 'Object (DN-binary)', 'MICROSOFT'), + '1.2.840.113556.1.4.904': ('1.2.840.113556.1.4.904', OID_LDAP_SYNTAX, 'Object(DN-string)', 'MICROSOFT'), + '1.2.840.113556.1.4.905': ('1.2.840.113556.1.4.905', OID_LDAP_SYNTAX, 'String (Teletex)', 'MICROSOFT'), + '1.2.840.113556.1.4.906': ('1.2.840.113556.1.4.906', OID_LDAP_SYNTAX, 'Large Integer', 'MICROSOFT'), + '1.2.840.113556.1.4.907': ('1.2.840.113556.1.4.907', OID_LDAP_SYNTAX, 'String (NT-Sec-Desc)', 'MICROSOFT'), + '1.2.840.113556.1.4.1221': ('1.2.840.113556.1.4.1221', OID_LDAP_SYNTAX, 'Object (OR-Name)', 'MICROSOFT'), + '1.2.840.113556.1.4.1362': ('1.2.840.113556.1.4.1362', OID_LDAP_SYNTAX, 'String (Case)', 'MICROSOFT'), + '1.3.6.1.1.16.1': ('1.3.6.1.1.16.1', OID_LDAP_SYNTAX, 'Universally Unique Identifier (UUID)', 'RFC4530'), + '1.3.6.1.4.1.1466.115.121.1.1': ('1.3.6.1.4.1.1466.115.121.1.1', OID_LDAP_SYNTAX, 'ACI item [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.2': ('1.3.6.1.4.1.1466.115.121.1.2', OID_LDAP_SYNTAX, 'Access point [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.3': ('1.3.6.1.4.1.1466.115.121.1.3', OID_LDAP_SYNTAX, 'Attribute Type Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.4': ('1.3.6.1.4.1.1466.115.121.1.4', OID_LDAP_SYNTAX, 'Audio [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.5': ('1.3.6.1.4.1.1466.115.121.1.5', OID_LDAP_SYNTAX, 'Binary [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.6': ('1.3.6.1.4.1.1466.115.121.1.6', OID_LDAP_SYNTAX, 'Bit String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.7': ('1.3.6.1.4.1.1466.115.121.1.7', OID_LDAP_SYNTAX, 'Boolean', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.8': ('1.3.6.1.4.1.1466.115.121.1.8', OID_LDAP_SYNTAX, 'Certificate [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.9': ('1.3.6.1.4.1.1466.115.121.1.9', OID_LDAP_SYNTAX, 'Certificate List [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.10': ('1.3.6.1.4.1.1466.115.121.1.10', OID_LDAP_SYNTAX, 'Certificate Pair [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.11': ('1.3.6.1.4.1.1466.115.121.1.11', OID_LDAP_SYNTAX, 'Country String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.12': ('1.3.6.1.4.1.1466.115.121.1.12', OID_LDAP_SYNTAX, 'DN', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.13': ('1.3.6.1.4.1.1466.115.121.1.13', OID_LDAP_SYNTAX, 'Data Quality Syntax [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.14': ('1.3.6.1.4.1.1466.115.121.1.14', OID_LDAP_SYNTAX, 'Delivery Method', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.15': ('1.3.6.1.4.1.1466.115.121.1.15', OID_LDAP_SYNTAX, 'Directory String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.16': ('1.3.6.1.4.1.1466.115.121.1.16', OID_LDAP_SYNTAX, 'DIT Content Rule Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.17': ('1.3.6.1.4.1.1466.115.121.1.17', OID_LDAP_SYNTAX, 'DIT Structure Rule Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.18': ('1.3.6.1.4.1.1466.115.121.1.18', OID_LDAP_SYNTAX, 'DL Submit Permission [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.19': ('1.3.6.1.4.1.1466.115.121.1.19', OID_LDAP_SYNTAX, 'DSA Quality Syntax [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.20': ('1.3.6.1.4.1.1466.115.121.1.20', OID_LDAP_SYNTAX, 'DSE Type [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.21': ('1.3.6.1.4.1.1466.115.121.1.21', OID_LDAP_SYNTAX, 'Enhanced Guide', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.22': ('1.3.6.1.4.1.1466.115.121.1.22', OID_LDAP_SYNTAX, 'Facsimile Telephone Number', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.23': ('1.3.6.1.4.1.1466.115.121.1.23', OID_LDAP_SYNTAX, 'Fax', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.24': ('1.3.6.1.4.1.1466.115.121.1.24', OID_LDAP_SYNTAX, 'Generalized Time', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.25': ('1.3.6.1.4.1.1466.115.121.1.25', OID_LDAP_SYNTAX, 'Guide [OBSOLETE]', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.26': ('1.3.6.1.4.1.1466.115.121.1.26', OID_LDAP_SYNTAX, 'IA5 String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.27': ('1.3.6.1.4.1.1466.115.121.1.27', OID_LDAP_SYNTAX, 'Integer', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.28': ('1.3.6.1.4.1.1466.115.121.1.28', OID_LDAP_SYNTAX, 'JPEG', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.29': ('1.3.6.1.4.1.1466.115.121.1.29', OID_LDAP_SYNTAX, 'Master and Shadow Access Points [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.30': ('1.3.6.1.4.1.1466.115.121.1.30', OID_LDAP_SYNTAX, 'Matching Rule Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.31': ('1.3.6.1.4.1.1466.115.121.1.31', OID_LDAP_SYNTAX, 'Matching Rule Use Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.32': ('1.3.6.1.4.1.1466.115.121.1.32', OID_LDAP_SYNTAX, 'Mail Preference [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.33': ('1.3.6.1.4.1.1466.115.121.1.33', OID_LDAP_SYNTAX, 'MHS OR Address [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.34': ('1.3.6.1.4.1.1466.115.121.1.34', OID_LDAP_SYNTAX, 'Name And Optional UID', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.35': ('1.3.6.1.4.1.1466.115.121.1.35', OID_LDAP_SYNTAX, 'Name Form Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.36': ('1.3.6.1.4.1.1466.115.121.1.36', OID_LDAP_SYNTAX, 'Numeric String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.37': ('1.3.6.1.4.1.1466.115.121.1.37', OID_LDAP_SYNTAX, 'Object Class Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.38': ('1.3.6.1.4.1.1466.115.121.1.38', OID_LDAP_SYNTAX, 'OID', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.39': ('1.3.6.1.4.1.1466.115.121.1.39', OID_LDAP_SYNTAX, 'Other Mailbox', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.40': ('1.3.6.1.4.1.1466.115.121.1.40', OID_LDAP_SYNTAX, 'Octet String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.41': ('1.3.6.1.4.1.1466.115.121.1.41', OID_LDAP_SYNTAX, 'Postal Address', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.42': ('1.3.6.1.4.1.1466.115.121.1.42', OID_LDAP_SYNTAX, 'Protocol Information [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.43': ('1.3.6.1.4.1.1466.115.121.1.43', OID_LDAP_SYNTAX, 'Presentation Address [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.44': ('1.3.6.1.4.1.1466.115.121.1.44', OID_LDAP_SYNTAX, 'Printable String', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.45': ('1.3.6.1.4.1.1466.115.121.1.45', OID_LDAP_SYNTAX, 'Subtree specification [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.46': ('1.3.6.1.4.1.1466.115.121.1.46', OID_LDAP_SYNTAX, 'Supplier Information [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.47': ('1.3.6.1.4.1.1466.115.121.1.47', OID_LDAP_SYNTAX, 'Supplier Or Consumer [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.48': ('1.3.6.1.4.1.1466.115.121.1.48', OID_LDAP_SYNTAX, 'Supplier And Consumer [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.49': ('1.3.6.1.4.1.1466.115.121.1.49', OID_LDAP_SYNTAX, 'Supported Algorithm [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.50': ('1.3.6.1.4.1.1466.115.121.1.50', OID_LDAP_SYNTAX, 'Telephone Number', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.51': ('1.3.6.1.4.1.1466.115.121.1.51', OID_LDAP_SYNTAX, 'Teletex Terminal Identifier', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.52': ('1.3.6.1.4.1.1466.115.121.1.52', OID_LDAP_SYNTAX, 'Telex Number', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.53': ('1.3.6.1.4.1.1466.115.121.1.53', OID_LDAP_SYNTAX, 'UTC Time [DEPRECATED]', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.54': ('1.3.6.1.4.1.1466.115.121.1.54', OID_LDAP_SYNTAX, 'LDAP Syntax Description', 'RFC4517'), + '1.3.6.1.4.1.1466.115.121.1.55': ('1.3.6.1.4.1.1466.115.121.1.55', OID_LDAP_SYNTAX, 'Modify rights [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.56': ('1.3.6.1.4.1.1466.115.121.1.56', OID_LDAP_SYNTAX, 'LDAP Schema Definition [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.57': ('1.3.6.1.4.1.1466.115.121.1.57', OID_LDAP_SYNTAX, 'LDAP Schema Description [OBSOLETE]', 'RFC2252'), + '1.3.6.1.4.1.1466.115.121.1.58': ('1.3.6.1.4.1.1466.115.121.1.58', OID_LDAP_SYNTAX, 'Substring Assertion', 'RFC4517'), + '2.16.840.1.113719.1.1.5.1.0': ('2.16.840.1.113719.1.1.5.1.0', OID_LDAP_SYNTAX, 'Unknown', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.6': ('2.16.840.1.113719.1.1.5.1.6', OID_LDAP_SYNTAX, 'Case Ignore List', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.12': ('2.16.840.1.113719.1.1.5.1.12', OID_LDAP_SYNTAX, 'Tagged Data', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.13': ('2.16.840.1.113719.1.1.5.1.13', OID_LDAP_SYNTAX, 'Octet List', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.14': ('2.16.840.1.113719.1.1.5.1.14', OID_LDAP_SYNTAX, 'Tagged String', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.15': ('2.16.840.1.113719.1.1.5.1.15', OID_LDAP_SYNTAX, 'Tagged Name And String', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.16': ('2.16.840.1.113719.1.1.5.1.16', OID_LDAP_SYNTAX, 'NDS Replica Pointer', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.17': ('2.16.840.1.113719.1.1.5.1.17', OID_LDAP_SYNTAX, 'NDS ACL', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.19': ('2.16.840.1.113719.1.1.5.1.19', OID_LDAP_SYNTAX, 'NDS Timestamp', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.22': ('2.16.840.1.113719.1.1.5.1.22', OID_LDAP_SYNTAX, 'Counter', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.23': ('2.16.840.1.113719.1.1.5.1.23', OID_LDAP_SYNTAX, 'Tagged Name', 'NOVELL'), + '2.16.840.1.113719.1.1.5.1.25': ('2.16.840.1.113719.1.1.5.1.25', OID_LDAP_SYNTAX, 'Typed Name', 'NOVELL'), + + # ldap url extensions + + # matching rules + '1.2.36.79672281.1.13.2': ('1.2.36.79672281.1.13.2', OID_MATCHING_RULE, 'componentFilterMatch', 'RFC3687'), + '1.2.36.79672281.1.13.3': ('1.2.36.79672281.1.13.3', OID_MATCHING_RULE, 'rdnMatch', 'RFC3687'), + '1.2.36.79672281.1.13.5': ('1.2.36.79672281.1.13.5', OID_MATCHING_RULE, 'presentMatch', 'RFC3687'), + '1.2.36.79672281.1.13.6': ('1.2.36.79672281.1.13.6', OID_MATCHING_RULE, 'allComponentsMatch', 'RFC3687'), + '1.2.36.79672281.1.13.7': ('1.2.36.79672281.1.13.7', OID_MATCHING_RULE, 'directoryComponentsMatch', 'RFC3687'), + '1.2.840.113556.1.4.803': ('1.2.840.113556.1.4.803', OID_MATCHING_RULE, 'Bit AND', 'MICROSOFT'), + '1.2.840.113556.1.4.804': ('1.2.840.113556.1.4.804', OID_MATCHING_RULE, 'Bit OR', 'MICROSOFT'), + '1.2.840.113556.1.4.1941': ('1.2.840.113556.1.4.1941', OID_MATCHING_RULE, 'Transitive Evaluation', 'MICROSOFT'), + '1.2.840.113556.1.4.2253': ('1.2.840.113556.1.4.2253', OID_MATCHING_RULE, 'DN with data', 'MICROSOFT'), + '1.3.6.1.1.16.2': ('1.3.6.1.1.16.2', OID_MATCHING_RULE, 'uuidMatch', 'RFC4530'), + '1.3.6.1.1.16.3': ('1.3.6.1.1.16.3', OID_MATCHING_RULE, 'uuidOrderingMatch', 'RFC4530'), + '1.3.6.1.4.1.1466.109.114.1': ('1.3.6.1.4.1.1466.109.114.1', OID_MATCHING_RULE, 'caseExactIA5Match', 'RFC4517'), + '1.3.6.1.4.1.1466.109.114.2': ('1.3.6.1.4.1.1466.109.114.2', OID_MATCHING_RULE, 'caseIgnoreIA5Match', 'RFC4517'), + '1.3.6.1.4.1.1466.109.114.3': ('1.3.6.1.4.1.1466.109.114.3', OID_MATCHING_RULE, 'caseIgnoreIA5SubstringsMatch', 'RFC4517'), + '2.5.13.0': ('2.5.13.0', OID_MATCHING_RULE, 'objectIdentifierMatch', 'RFC4517'), + '2.5.13.1': ('2.5.13.1', OID_MATCHING_RULE, 'distinguishedNameMatch', 'RFC4517'), + '2.5.13.2': ('2.5.13.2', OID_MATCHING_RULE, 'caseIgnoreMatch', 'RFC4517'), + '2.5.13.3': ('2.5.13.3', OID_MATCHING_RULE, 'caseIgnoreOrderingMatch', 'RFC4517'), + '2.5.13.4': ('2.5.13.4', OID_MATCHING_RULE, 'caseIgnoreSubstringsMatch', 'RFC4517'), + '2.5.13.5': ('2.5.13.5', OID_MATCHING_RULE, 'caseExactMatch', 'RFC4517'), + '2.5.13.6': ('2.5.13.6', OID_MATCHING_RULE, 'caseExactOrderingMatch', 'RFC4517'), + '2.5.13.7': ('2.5.13.7', OID_MATCHING_RULE, 'caseExactSubstringsMatch', 'RFC4517'), + '2.5.13.8': ('2.5.13.8', OID_MATCHING_RULE, 'numericStringMatch', 'RFC4517'), + '2.5.13.9': ('2.5.13.9', OID_MATCHING_RULE, 'numericStringOrderingMatch', 'RFC4517'), + '2.5.13.10': ('2.5.13.10', OID_MATCHING_RULE, 'numericStringSubstringsMatch', 'RFC4517'), + '2.5.13.11': ('2.5.13.11', OID_MATCHING_RULE, 'caseIgnoreListMatch', 'RFC4517'), + '2.5.13.12': ('2.5.13.12', OID_MATCHING_RULE, 'caseIgnoreListSubstringsMatch', 'RFC4517'), + '2.5.13.13': ('2.5.13.13', OID_MATCHING_RULE, 'booleanMatch', 'RFC4517'), + '2.5.13.14': ('2.5.13.14', OID_MATCHING_RULE, 'integerMatch', 'RFC4517'), + '2.5.13.15': ('2.5.13.15', OID_MATCHING_RULE, 'integerOrderingMatch', 'RFC4517'), + '2.5.13.16': ('2.5.13.16', OID_MATCHING_RULE, 'bitStringMatch', 'RFC4517'), + '2.5.13.17': ('2.5.13.17', OID_MATCHING_RULE, 'octetStringMatch', 'RFC4517'), + '2.5.13.18': ('2.5.13.18', OID_MATCHING_RULE, 'octetStringOrderingMatch', 'RFC4517'), + '2.5.13.20': ('2.5.13.20', OID_MATCHING_RULE, 'telephoneNumberMatch', 'RFC4517'), + '2.5.13.21': ('2.5.13.21', OID_MATCHING_RULE, 'telephoneNumberSubstringsMatch', 'RFC4517'), + '2.5.13.22': ('2.5.13.22', OID_MATCHING_RULE, 'presentationAddressMatch', 'RFC2252'), + '2.5.13.23': ('2.5.13.23', OID_MATCHING_RULE, 'uniqueMemberMatch', 'RFC4517'), + '2.5.13.24': ('2.5.13.24', OID_MATCHING_RULE, 'protocolInformationMatch', 'RFC2252'), + '2.5.13.27': ('2.5.13.27', OID_MATCHING_RULE, 'generalizedTimeMatch', 'RFC4517'), + '2.5.13.28': ('2.5.13.28', OID_MATCHING_RULE, 'generalizedTimeOrderingMatch', 'RFC4517'), + '2.5.13.29': ('2.5.13.29', OID_MATCHING_RULE, 'integerFirstComponentMatch', 'RFC4517'), + '2.5.13.30': ('2.5.13.30', OID_MATCHING_RULE, 'objectIdentifierFirstComponentMatch', 'RFC4517'), + '2.5.13.31': ('2.5.13.31', OID_MATCHING_RULE, 'directoryStringFirstComponentMatch', 'RFC4517'), + '2.5.13.32': ('2.5.13.32', OID_MATCHING_RULE, 'wordMatch', 'RFC4517'), + '2.5.13.33': ('2.5.13.33', OID_MATCHING_RULE, 'keywordMatch', 'RFC4517'), + '2.5.13.34': ('2.5.13.34', OID_MATCHING_RULE, 'certificateExactMatch', 'RFC4523'), + '2.5.13.35': ('2.5.13.35', OID_MATCHING_RULE, 'certificateMatch', 'RFC4523'), + '2.5.13.36': ('2.5.13.36', OID_MATCHING_RULE, 'certificatePairExactMatch', 'RFC4523'), + '2.5.13.37': ('2.5.13.37', OID_MATCHING_RULE, 'certificatePairMatch', 'RFC4523'), + '2.5.13.38': ('2.5.13.38', OID_MATCHING_RULE, 'certificateListExactMatch', 'RFC4523'), + '2.5.13.39': ('2.5.13.39', OID_MATCHING_RULE, 'certificateListMatch', 'RFC4523'), + '2.5.13.40': ('2.5.13.40', OID_MATCHING_RULE, 'algorithmIdentifierMatch', 'RFC4523'), + '2.5.13.41': ('2.5.13.41', OID_MATCHING_RULE, 'storedPrefixMatch', 'RFC3698'), + + # name forms + '1.3.6.1.1.10.15.1': ('1.3.6.1.1.10.15.1', OID_NAME_FORM, 'uddiBusinessEntityNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.2': ('1.3.6.1.1.10.15.2', OID_NAME_FORM, 'uddiContactNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.3': ('1.3.6.1.1.10.15.3', OID_NAME_FORM, 'uddiAddressNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.4': ('1.3.6.1.1.10.15.4', OID_NAME_FORM, 'uddiBusinessServiceNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.5': ('1.3.6.1.1.10.15.5', OID_NAME_FORM, 'uddiBindingTemplateNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.6': ('1.3.6.1.1.10.15.6', OID_NAME_FORM, 'uddiTModelInstanceInfoNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.7': ('1.3.6.1.1.10.15.7', OID_NAME_FORM, 'uddiTModelNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.8': ('1.3.6.1.1.10.15.8', OID_NAME_FORM, 'uddiPublisherAssertionNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.9': ('1.3.6.1.1.10.15.9', OID_NAME_FORM, 'uddiv3SubscriptionNameForm', 'RFC4403'), + '1.3.6.1.1.10.15.10': ('1.3.6.1.1.10.15.10', OID_NAME_FORM, 'uddiv3EntityObituaryNameForm', 'RFC4403'), + '1.3.6.1.4.1.1466.345': ('1.3.6.1.4.1.1466.345', OID_NAME_FORM, 'domainNameForm', 'RFC2247'), + + # object classes + '0.9.2342.19200300.100.4.3': ('0.9.2342.19200300.100.4.3', OID_OBJECT_CLASS, 'pilotObject', 'RFC1274'), + '0.9.2342.19200300.100.4.4': ('0.9.2342.19200300.100.4.4', OID_OBJECT_CLASS, 'pilotPerson', 'RFC1274'), + '0.9.2342.19200300.100.4.5': ('0.9.2342.19200300.100.4.5', OID_OBJECT_CLASS, 'account', 'RFC4524'), + '0.9.2342.19200300.100.4.6': ('0.9.2342.19200300.100.4.6', OID_OBJECT_CLASS, 'document', 'RFC4524'), + '0.9.2342.19200300.100.4.7': ('0.9.2342.19200300.100.4.7', OID_OBJECT_CLASS, 'room', 'RFC4524'), + '0.9.2342.19200300.100.4.8': ('0.9.2342.19200300.100.4.8', OID_OBJECT_CLASS, 'documentSeries', 'RFC4524'), + '0.9.2342.19200300.100.4.13': ('0.9.2342.19200300.100.4.13', OID_OBJECT_CLASS, 'domain', 'RFC4524'), + '0.9.2342.19200300.100.4.14': ('0.9.2342.19200300.100.4.14', OID_OBJECT_CLASS, 'RFC822LocalPart', 'RFC4524'), + '0.9.2342.19200300.100.4.15': ('0.9.2342.19200300.100.4.15', OID_OBJECT_CLASS, 'dNSDomain', 'RFC1274'), + '0.9.2342.19200300.100.4.17': ('0.9.2342.19200300.100.4.17', OID_OBJECT_CLASS, 'domainRelatedObject', 'RFC4524'), + '0.9.2342.19200300.100.4.18': ('0.9.2342.19200300.100.4.18', OID_OBJECT_CLASS, 'friendlyCountry', 'RFC4524'), + '0.9.2342.19200300.100.4.19': ('0.9.2342.19200300.100.4.19', OID_OBJECT_CLASS, 'simpleSecurityObject', 'RFC4524'), + '0.9.2342.19200300.100.4.20': ('0.9.2342.19200300.100.4.20', OID_OBJECT_CLASS, 'pilotOrganization', 'RFC1274'), + '0.9.2342.19200300.100.4.21': ('0.9.2342.19200300.100.4.21', OID_OBJECT_CLASS, 'pilotDSA', 'RFC1274'), + '0.9.2342.19200300.100.4.22': ('0.9.2342.19200300.100.4.22', OID_OBJECT_CLASS, 'qualityLabelledData', 'RFC1274'), + '1.2.840.113556.1.5.87': ('1.2.840.113556.1.5.87', OID_OBJECT_CLASS, 'calEntry', 'RFC2739'), + '1.3.18.0.2.6.253': ('1.3.18.0.2.6.253', OID_OBJECT_CLASS, 'printerLPR', 'RFC3712'), + '1.3.18.0.2.6.254': ('1.3.18.0.2.6.254', OID_OBJECT_CLASS, 'slpServicePrinter', 'RFC3712'), + '1.3.18.0.2.6.255': ('1.3.18.0.2.6.255', OID_OBJECT_CLASS, 'printerService', 'RFC3712'), + '1.3.18.0.2.6.256': ('1.3.18.0.2.6.256', OID_OBJECT_CLASS, 'printerIPP', 'RFC3712'), + '1.3.18.0.2.6.257': ('1.3.18.0.2.6.257', OID_OBJECT_CLASS, 'printerServiceAuxClass', 'RFC3712'), + '1.3.18.0.2.6.258': ('1.3.18.0.2.6.258', OID_OBJECT_CLASS, 'printerAbstract', 'RFC3712'), + '1.3.6.1.1.10.6.1': ('1.3.6.1.1.10.6.1', OID_OBJECT_CLASS, 'uddiBusinessEntity', 'RFC4403'), + '1.3.6.1.1.10.6.2': ('1.3.6.1.1.10.6.2', OID_OBJECT_CLASS, 'uddiContact', 'RFC4403'), + '1.3.6.1.1.10.6.3': ('1.3.6.1.1.10.6.3', OID_OBJECT_CLASS, 'uddiAddress', 'RFC4403'), + '1.3.6.1.1.10.6.4': ('1.3.6.1.1.10.6.4', OID_OBJECT_CLASS, 'uddiBusinessService', 'RFC4403'), + '1.3.6.1.1.10.6.5': ('1.3.6.1.1.10.6.5', OID_OBJECT_CLASS, 'uddiBindingTemplate', 'RFC4403'), + '1.3.6.1.1.10.6.6': ('1.3.6.1.1.10.6.6', OID_OBJECT_CLASS, 'uddiTModelInstanceInfo', 'RFC4403'), + '1.3.6.1.1.10.6.7': ('1.3.6.1.1.10.6.7', OID_OBJECT_CLASS, 'uddiTModel', 'RFC4403'), + '1.3.6.1.1.10.6.8': ('1.3.6.1.1.10.6.8', OID_OBJECT_CLASS, 'uddiPublisherAssertion', 'RFC4403'), + '1.3.6.1.1.10.6.9': ('1.3.6.1.1.10.6.9', OID_OBJECT_CLASS, 'uddiv3Subscription', 'RFC4403'), + '1.3.6.1.1.10.6.10': ('1.3.6.1.1.10.6.10', OID_OBJECT_CLASS, 'uddiv3EntityObituary', 'RFC4403'), + '1.3.6.1.1.11.1.1': ('1.3.6.1.1.11.1.1', OID_OBJECT_CLASS, 'vPIMUser', 'RFC4237'), + '1.3.6.1.1.3.1': ('1.3.6.1.1.3.1', OID_OBJECT_CLASS, 'uidObject', 'RFC4519'), + '1.3.6.1.1.6.1.1': ('1.3.6.1.1.6.1.1', OID_OBJECT_CLASS, 'pcimPolicy', 'RFC3703'), + '1.3.6.1.1.6.1.2': ('1.3.6.1.1.6.1.2', OID_OBJECT_CLASS, 'pcimGroup', 'RFC3703'), + '1.3.6.1.1.6.1.3': ('1.3.6.1.1.6.1.3', OID_OBJECT_CLASS, 'pcimGroupAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.4': ('1.3.6.1.1.6.1.4', OID_OBJECT_CLASS, 'pcimGroupInstance', 'RFC3703'), + '1.3.6.1.1.6.1.5': ('1.3.6.1.1.6.1.5', OID_OBJECT_CLASS, 'pcimRule', 'RFC3703'), + '1.3.6.1.1.6.1.6': ('1.3.6.1.1.6.1.6', OID_OBJECT_CLASS, 'pcimRuleAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.7': ('1.3.6.1.1.6.1.7', OID_OBJECT_CLASS, 'pcimRuleInstance', 'RFC3703'), + '1.3.6.1.1.6.1.8': ('1.3.6.1.1.6.1.8', OID_OBJECT_CLASS, 'pcimRuleConditionAssociation', 'RFC3703'), + '1.3.6.1.1.6.1.9': ('1.3.6.1.1.6.1.9', OID_OBJECT_CLASS, 'pcimRuleValidityAssociation', 'RFC3703'), + '1.3.6.1.1.6.1.10': ('1.3.6.1.1.6.1.10', OID_OBJECT_CLASS, 'pcimRuleActionAssociation', 'RFC3703'), + '1.3.6.1.1.6.1.11': ('1.3.6.1.1.6.1.11', OID_OBJECT_CLASS, 'pcimConditionAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.12': ('1.3.6.1.1.6.1.12', OID_OBJECT_CLASS, 'pcimTPCAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.13': ('1.3.6.1.1.6.1.13', OID_OBJECT_CLASS, 'pcimConditionVendorAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.14': ('1.3.6.1.1.6.1.14', OID_OBJECT_CLASS, 'pcimActionAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.15': ('1.3.6.1.1.6.1.15', OID_OBJECT_CLASS, 'pcimActionVendorAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.16': ('1.3.6.1.1.6.1.16', OID_OBJECT_CLASS, 'pcimPolicyInstance', 'RFC3703'), + '1.3.6.1.1.6.1.17': ('1.3.6.1.1.6.1.17', OID_OBJECT_CLASS, 'pcimElementAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.18': ('1.3.6.1.1.6.1.18', OID_OBJECT_CLASS, 'pcimRepository', 'RFC3703'), + '1.3.6.1.1.6.1.19': ('1.3.6.1.1.6.1.19', OID_OBJECT_CLASS, 'pcimRepositoryAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.20': ('1.3.6.1.1.6.1.20', OID_OBJECT_CLASS, 'pcimRepositoryInstance', 'RFC3703'), + '1.3.6.1.1.6.1.21': ('1.3.6.1.1.6.1.21', OID_OBJECT_CLASS, 'pcimSubtreesPtrAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.22': ('1.3.6.1.1.6.1.22', OID_OBJECT_CLASS, 'pcimGroupContainmentAuxClass', 'RFC3703'), + '1.3.6.1.1.6.1.23': ('1.3.6.1.1.6.1.23', OID_OBJECT_CLASS, 'pcimRuleContainmentAuxClass', 'RFC3703'), + '1.3.6.1.1.9.1.1': ('1.3.6.1.1.9.1.1', OID_OBJECT_CLASS, 'pcelsPolicySet', 'RFC4104'), + '1.3.6.1.1.9.1.2': ('1.3.6.1.1.9.1.2', OID_OBJECT_CLASS, 'pcelsPolicySetAssociation', 'RFC4104'), + '1.3.6.1.1.9.1.3': ('1.3.6.1.1.9.1.3', OID_OBJECT_CLASS, 'pcelsGroup', 'RFC4104'), + '1.3.6.1.1.9.1.4': ('1.3.6.1.1.9.1.4', OID_OBJECT_CLASS, 'pcelsGroupAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.5': ('1.3.6.1.1.9.1.5', OID_OBJECT_CLASS, 'pcelsGroupInstance', 'RFC4104'), + '1.3.6.1.1.9.1.6': ('1.3.6.1.1.9.1.6', OID_OBJECT_CLASS, 'pcelsRule', 'RFC4104'), + '1.3.6.1.1.9.1.7': ('1.3.6.1.1.9.1.7', OID_OBJECT_CLASS, 'pcelsRuleAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.8': ('1.3.6.1.1.9.1.8', OID_OBJECT_CLASS, 'pcelsRuleInstance', 'RFC4104'), + '1.3.6.1.1.9.1.9': ('1.3.6.1.1.9.1.9', OID_OBJECT_CLASS, 'pcelsConditionAssociation', 'RFC4104'), + '1.3.6.1.1.9.1.10': ('1.3.6.1.1.9.1.10', OID_OBJECT_CLASS, 'pcelsActionAssociation', 'RFC4104'), + '1.3.6.1.1.9.1.11': ('1.3.6.1.1.9.1.11', OID_OBJECT_CLASS, 'pcelsSimpleConditionAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.12': ('1.3.6.1.1.9.1.12', OID_OBJECT_CLASS, 'pcelsCompoundConditionAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.13': ('1.3.6.1.1.9.1.13', OID_OBJECT_CLASS, 'pcelsCompoundFilterConditionAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.14': ('1.3.6.1.1.9.1.14', OID_OBJECT_CLASS, 'pcelsSimpleActionAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.15': ('1.3.6.1.1.9.1.15', OID_OBJECT_CLASS, 'pcelsCompoundActionAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.16': ('1.3.6.1.1.9.1.16', OID_OBJECT_CLASS, 'pcelsVariable', 'RFC4104'), + '1.3.6.1.1.9.1.17': ('1.3.6.1.1.9.1.17', OID_OBJECT_CLASS, 'pcelsExplicitVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.18': ('1.3.6.1.1.9.1.18', OID_OBJECT_CLASS, 'pcelsImplicitVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.19': ('1.3.6.1.1.9.1.19', OID_OBJECT_CLASS, 'pcelsSourceIPv4VariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.20': ('1.3.6.1.1.9.1.20', OID_OBJECT_CLASS, 'pcelsSourceIPv6VariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.21': ('1.3.6.1.1.9.1.21', OID_OBJECT_CLASS, 'pcelsDestinationIPv4VariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.22': ('1.3.6.1.1.9.1.22', OID_OBJECT_CLASS, 'pcelsDestinationIPv6VariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.23': ('1.3.6.1.1.9.1.23', OID_OBJECT_CLASS, 'pcelsSourcePortVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.24': ('1.3.6.1.1.9.1.24', OID_OBJECT_CLASS, 'pcelsDestinationPortVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.25': ('1.3.6.1.1.9.1.25', OID_OBJECT_CLASS, 'pcelsIPProtocolVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.26': ('1.3.6.1.1.9.1.26', OID_OBJECT_CLASS, 'pcelsIPVersionVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.27': ('1.3.6.1.1.9.1.27', OID_OBJECT_CLASS, 'pcelsIPToSVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.28': ('1.3.6.1.1.9.1.28', OID_OBJECT_CLASS, 'pcelsDSCPVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.29': ('1.3.6.1.1.9.1.29', OID_OBJECT_CLASS, 'pcelsFlowIdVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.30': ('1.3.6.1.1.9.1.30', OID_OBJECT_CLASS, 'pcelsSourceMACVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.31': ('1.3.6.1.1.9.1.31', OID_OBJECT_CLASS, 'pcelsDestinationMACVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.32': ('1.3.6.1.1.9.1.32', OID_OBJECT_CLASS, 'pcelsVLANVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.33': ('1.3.6.1.1.9.1.33', OID_OBJECT_CLASS, 'pcelsCoSVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.34': ('1.3.6.1.1.9.1.34', OID_OBJECT_CLASS, 'pcelsEthertypeVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.35': ('1.3.6.1.1.9.1.35', OID_OBJECT_CLASS, 'pcelsSourceSAPVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.36': ('1.3.6.1.1.9.1.36', OID_OBJECT_CLASS, 'pcelsDestinationSAPVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.37': ('1.3.6.1.1.9.1.37', OID_OBJECT_CLASS, 'pcelsSNAPOUIVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.38': ('1.3.6.1.1.9.1.38', OID_OBJECT_CLASS, 'pcelsSNAPTypeVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.39': ('1.3.6.1.1.9.1.39', OID_OBJECT_CLASS, 'pcelsFlowDirectionVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.40': ('1.3.6.1.1.9.1.40', OID_OBJECT_CLASS, 'pcelsValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.41': ('1.3.6.1.1.9.1.41', OID_OBJECT_CLASS, 'pcelsIPv4AddrValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.42': ('1.3.6.1.1.9.1.42', OID_OBJECT_CLASS, 'pcelsIPv6AddrValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.43': ('1.3.6.1.1.9.1.43', OID_OBJECT_CLASS, 'pcelsMACAddrValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.44': ('1.3.6.1.1.9.1.44', OID_OBJECT_CLASS, 'pcelsStringValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.45': ('1.3.6.1.1.9.1.45', OID_OBJECT_CLASS, 'pcelsBitStringValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.46': ('1.3.6.1.1.9.1.46', OID_OBJECT_CLASS, 'pcelsIntegerValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.47': ('1.3.6.1.1.9.1.47', OID_OBJECT_CLASS, 'pcelsBooleanValueAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.48': ('1.3.6.1.1.9.1.48', OID_OBJECT_CLASS, 'pcelsReusableContainer', 'RFC4104'), + '1.3.6.1.1.9.1.49': ('1.3.6.1.1.9.1.49', OID_OBJECT_CLASS, 'pcelsReusableContainerAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.50': ('1.3.6.1.1.9.1.50', OID_OBJECT_CLASS, 'pcelsReusableContainerInstance', 'RFC4104'), + '1.3.6.1.1.9.1.51': ('1.3.6.1.1.9.1.51', OID_OBJECT_CLASS, 'pcelsRoleCollection', 'RFC4104'), + '1.3.6.1.1.9.1.52': ('1.3.6.1.1.9.1.52', OID_OBJECT_CLASS, 'pcelsFilterEntryBase', 'RFC4104'), + '1.3.6.1.1.9.1.53': ('1.3.6.1.1.9.1.53', OID_OBJECT_CLASS, 'pcelsIPHeadersFilter', 'RFC4104'), + '1.3.6.1.1.9.1.54': ('1.3.6.1.1.9.1.54', OID_OBJECT_CLASS, 'pcels8021Filter', 'RFC4104'), + '1.3.6.1.1.9.1.55': ('1.3.6.1.1.9.1.55', OID_OBJECT_CLASS, 'pcelsFilterListAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.56': ('1.3.6.1.1.9.1.56', OID_OBJECT_CLASS, 'pcelsVendorVariableAuxClass', 'RFC4104'), + '1.3.6.1.1.9.1.57': ('1.3.6.1.1.9.1.57', OID_OBJECT_CLASS, 'pcelsVendorValueAuxClass', 'RFC4104'), + '1.3.6.1.4.1.11.1.3.1.2.5': ('1.3.6.1.4.1.11.1.3.1.2.5', OID_OBJECT_CLASS, 'DUAConfigProfile', 'RFC4876'), + '1.3.6.1.4.1.1466.101.119.2': ('1.3.6.1.4.1.1466.101.119.2', OID_OBJECT_CLASS, 'dynamicObject', 'RFC2589'), + '1.3.6.1.4.1.1466.101.120.111': ('1.3.6.1.4.1.1466.101.120.111', OID_OBJECT_CLASS, 'extensibleObject', 'RFC4512'), + '1.3.6.1.4.1.1466.344': ('1.3.6.1.4.1.1466.344', OID_OBJECT_CLASS, 'dcObject', 'RFC4519'), + '1.3.6.1.4.1.16572.2.1.1': ('1.3.6.1.4.1.16572.2.1.1', OID_OBJECT_CLASS, 'LDIFLocationURLObject', 'RFC6109'), + '1.3.6.1.4.1.16572.2.1.2': ('1.3.6.1.4.1.16572.2.1.2', OID_OBJECT_CLASS, 'provider', 'RFC6109'), + '1.3.6.1.4.1.250.3.15': ('1.3.6.1.4.1.250.3.15', OID_OBJECT_CLASS, 'labeledURIObject', 'RFC2079'), + '1.3.6.1.4.1.31103.1.1001': ('1.3.6.1.4.1.31103.1.1001', OID_OBJECT_CLASS, 'fedfsNsdbContainerInfo', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.1002': ('1.3.6.1.4.1.31103.1.1002', OID_OBJECT_CLASS, 'fedfsFsn', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.1003': ('1.3.6.1.4.1.31103.1.1003', OID_OBJECT_CLASS, 'fedfsFsl', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.31103.1.1004': ('1.3.6.1.4.1.31103.1.1004', OID_OBJECT_CLASS, 'fedfsNfsFsl', 'RFC-ietf-nfsv4-federated-fs-protocol-15'), + '1.3.6.1.4.1.453.7.1.1': ('1.3.6.1.4.1.453.7.1.1', OID_OBJECT_CLASS, ['rFC822ToX400Mapping', 'subtree'], 'RFC2164-RFC2293'), + '1.3.6.1.4.1.453.7.1.2': ('1.3.6.1.4.1.453.7.1.2', OID_OBJECT_CLASS, ['x400ToRFC822Mapping', 'table'], 'RFC2164-RFC2293'), + '1.3.6.1.4.1.453.7.1.3': ('1.3.6.1.4.1.453.7.1.3', OID_OBJECT_CLASS, ['omittedORAddressComponent', 'tableEntry'], 'RFC2164-RFC2293'), + '1.3.6.1.4.1.453.7.1.4': ('1.3.6.1.4.1.453.7.1.4', OID_OBJECT_CLASS, ['mixerGateway', 'textTableEntry'], 'RFC2164-RFC2293'), + '1.3.6.1.4.1.453.7.1.5': ('1.3.6.1.4.1.453.7.1.5', OID_OBJECT_CLASS, 'distinguishedNameTableEntry', 'RFC2293'), + '2.16.840.1.113730.3.2.6': ('2.16.840.1.113730.3.2.6', OID_OBJECT_CLASS, 'referral', 'RFC3296'), + '2.5.17.0': ('2.5.17.0', OID_OBJECT_CLASS, 'subentry', 'RFC3672'), + '2.5.20.1': ('2.5.20.1', OID_OBJECT_CLASS, 'subschema', 'RFC4512'), + '2.5.20.2': ('2.5.20.2', OID_OBJECT_CLASS, 'collectiveAttributeSubentry', 'RFC3671'), + '2.5.6.0': ('2.5.6.0', OID_OBJECT_CLASS, 'top', 'RFC4512'), + '2.5.6.1': ('2.5.6.1', OID_OBJECT_CLASS, 'alias', 'RFC4512'), + '2.5.6.2': ('2.5.6.2', OID_OBJECT_CLASS, 'country', 'RFC4519'), + '2.5.6.3': ('2.5.6.3', OID_OBJECT_CLASS, 'locality', 'RFC4519'), + '2.5.6.4': ('2.5.6.4', OID_OBJECT_CLASS, 'organization', 'RFC4519'), + '2.5.6.5': ('2.5.6.5', OID_OBJECT_CLASS, 'organizationalUnit', 'RFC4519'), + '2.5.6.6': ('2.5.6.6', OID_OBJECT_CLASS, 'person', 'RFC4519'), + '2.5.6.7': ('2.5.6.7', OID_OBJECT_CLASS, 'organizationalPerson', 'RFC4519'), + '2.5.6.8': ('2.5.6.8', OID_OBJECT_CLASS, 'organizationalRole', 'RFC4519'), + '2.5.6.9': ('2.5.6.9', OID_OBJECT_CLASS, 'groupOfNames', 'RFC4519'), + '2.5.6.10': ('2.5.6.10', OID_OBJECT_CLASS, 'residentialPerson', 'RFC4519'), + '2.5.6.11': ('2.5.6.11', OID_OBJECT_CLASS, 'applicationProcess', 'RFC4519'), + '2.5.6.12': ('2.5.6.12', OID_OBJECT_CLASS, 'applicationEntity', 'RFC2256'), + '2.5.6.13': ('2.5.6.13', OID_OBJECT_CLASS, 'dSA', 'RFC2256'), + '2.5.6.14': ('2.5.6.14', OID_OBJECT_CLASS, 'device', 'RFC4519'), + '2.5.6.15': ('2.5.6.15', OID_OBJECT_CLASS, 'strongAuthenticationUser', 'RFC4523'), + '2.5.6.16': ('2.5.6.16', OID_OBJECT_CLASS, 'certificationAuthority', 'RFC4523'), + '2.5.6.16.2': ('2.5.6.16.2', OID_OBJECT_CLASS, 'certificationAuthority-V2', 'RFC4523'), + '2.5.6.17': ('2.5.6.17', OID_OBJECT_CLASS, 'groupOfUniqueNames', 'RFC4519'), + '2.5.6.18': ('2.5.6.18', OID_OBJECT_CLASS, 'userSecurityInformation', 'RFC4523'), + '2.5.6.19': ('2.5.6.19', OID_OBJECT_CLASS, 'cRLDistributionPoint', 'RFC4523'), + '2.5.6.20': ('2.5.6.20', OID_OBJECT_CLASS, 'dmd', 'RFC2256'), + '2.5.6.21': ('2.5.6.21', OID_OBJECT_CLASS, 'pkiUser', 'RFC4523'), + '2.5.6.22': ('2.5.6.22', OID_OBJECT_CLASS, 'pkiCA', 'RFC4523'), + '2.5.6.23': ('2.5.6.23', OID_OBJECT_CLASS, 'deltaCRL', 'RFC4523'), + + # unsolicited notices + '1.3.6.1.1.21.4': ('1.3.6.1.1.21.4', OID_UNSOLICITED_NOTICE, 'Aborted Transaction Notice', 'RFC5805'), '1.3.6.1.4.1.1466.20036': ('1.3.6.1.4.1.1466.20036', OID_UNSOLICITED_NOTICE, 'Notice of Disconnection', 'RFC4511')} diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/persistentSearch.py b/python/user_packages/Python313/site-packages/ldap3/protocol/persistentSearch.py new file mode 100644 index 0000000000000000000000000000000000000000..cb79aa2f2ba6e718e262f9fdac01fb43debf1f12 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/persistentSearch.py @@ -0,0 +1,85 @@ +""" +""" + +# Created on 2016.07.09 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1.type.namedtype import NamedTypes, NamedType, OptionalNamedType +from pyasn1.type.namedval import NamedValues +from pyasn1.type.univ import Sequence, Integer, Boolean, Enumerated +from .rfc4511 import LDAPDN +from .controls import build_control + + +class PersistentSearchControl(Sequence): + # PersistentSearch ::= SEQUENCE { + # changeTypes INTEGER, + # changesOnly BOOLEAN, + # returnECs BOOLEAN + # } + + componentType = NamedTypes(NamedType('changeTypes', Integer()), + NamedType('changesOnly', Boolean()), + NamedType('returnECs', Boolean()) + ) + + +class ChangeType(Enumerated): + # changeType ENUMERATED { + # add (1), + # delete (2), + # modify (4), + # modDN (8) + # } + + namedValues = NamedValues(('add', 1), + ('delete', 2), + ('modify', 4), + ('modDN', 8)) + + +class EntryChangeNotificationControl(Sequence): + # EntryChangeNotification ::= SEQUENCE { + # changeType ENUMERATED { + # add (1), + # delete (2), + # modify (4), + # modDN (8) + # }, + # previousDN LDAPDN OPTIONAL, -- modifyDN ops. only + # changeNumber INTEGER OPTIONAL -- if supported + # } + + # tagSet = TagSet() + # tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatConstructed, 16)) + componentType = NamedTypes(NamedType('changeType', ChangeType()), + OptionalNamedType('previousDN', LDAPDN()), + OptionalNamedType('changeNumber', Integer()) + ) + + +def persistent_search_control(change_types, changes_only=True, return_ecs=True, criticality=False): + control_value = PersistentSearchControl() + control_value.setComponentByName('changeTypes', Integer(change_types)) + control_value.setComponentByName('changesOnly', Boolean(changes_only)) + control_value.setComponentByName('returnECs', Boolean(return_ecs)) + return build_control('2.16.840.1.113730.3.4.3', criticality, control_value) diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/rfc2696.py b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc2696.py new file mode 100644 index 0000000000000000000000000000000000000000..66b647bba755e42377b40e2db53798e974a6d3d3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc2696.py @@ -0,0 +1,70 @@ +""" +""" + +# Created on 2013.10.15 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1.type.univ import OctetString, Integer, Sequence +from pyasn1.type.namedtype import NamedTypes, NamedType +from pyasn1.type.constraint import ValueRangeConstraint +from .controls import build_control + +# constants +# maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- + +MAXINT = Integer(2147483647) + +# constraints +rangeInt0ToMaxConstraint = ValueRangeConstraint(0, MAXINT) + + +class Integer0ToMax(Integer): + subtypeSpec = Integer.subtypeSpec + rangeInt0ToMaxConstraint + + +class Size(Integer0ToMax): + # Size INTEGER (0..maxInt) + pass + + +class Cookie(OctetString): + # cookie OCTET STRING + pass + + +class RealSearchControlValue(Sequence): + # realSearchControlValue ::= SEQUENCE { + # size INTEGER (0..maxInt), + # -- requested page size from client + # -- result set size estimate from server + # cookie OCTET STRING + + componentType = NamedTypes(NamedType('size', Size()), + NamedType('cookie', Cookie())) + + +def paged_search_control(criticality=False, size=10, cookie=None): + control_value = RealSearchControlValue() + control_value.setComponentByName('size', Size(size)) + control_value.setComponentByName('cookie', Cookie(cookie if cookie else '')) + + return build_control('1.2.840.113556.1.4.319', criticality, control_value) diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/rfc2849.py b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc2849.py new file mode 100644 index 0000000000000000000000000000000000000000..01d7e05686b02c442d4a778669b72fe0460c8235 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc2849.py @@ -0,0 +1,295 @@ +""" +""" + +# Created on 2013.12.08 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from base64 import b64encode +from datetime import datetime + +from .. import STRING_TYPES +from ..core.exceptions import LDAPLDIFError, LDAPExtensionError +from ..protocol.persistentSearch import EntryChangeNotificationControl +from ..utils.asn1 import decoder +from ..utils.config import get_config_parameter + +# LDIF converter RFC 2849 compliant + +conf_ldif_line_length = get_config_parameter('LDIF_LINE_LENGTH') + + +def safe_ldif_string(bytes_value): + if not bytes_value: + return True + + # check SAFE-INIT-CHAR: < 127, not NUL, LF, CR, SPACE, COLON, LESS-THAN + if bytes_value[0] > 127 or bytes_value[0] in [0, 10, 13, 32, 58, 60]: + return False + + # check SAFE-CHAR: < 127 not NUL, LF, CR + if 0 in bytes_value or 10 in bytes_value or 13 in bytes_value: + return False + + # check last char for SPACE + if bytes_value[-1] == 32: + return False + + for byte in bytes_value: + if byte > 127: + return False + + return True + + +def _convert_to_ldif(descriptor, value, base64): + if not value: + value = '' + if isinstance(value, STRING_TYPES): + value = bytearray(value, encoding='utf-8') + + if base64 or not safe_ldif_string(value): + try: + encoded = b64encode(value) + except TypeError: + encoded = b64encode(str(value)) # patch for Python 2.6 + if not isinstance(encoded, str): # in Python 3 b64encode returns bytes in Python 2 returns str + encoded = str(encoded, encoding='ascii') # Python 3 + line = descriptor + ':: ' + encoded + else: + if str is not bytes: # Python 3 + value = str(value, encoding='ascii') + else: # Python 2 + value = str(value) + line = descriptor + ': ' + value + + return line + + +def add_controls(controls, all_base64): + lines = [] + if controls: + for control in controls: + line = 'control: ' + control[0] + line += ' ' + ('true' if control[1] else 'false') + if control[2]: + lines.append(_convert_to_ldif(line, control[2], all_base64)) + + return lines + + +def add_attributes(attributes, all_base64): + lines = [] + oc_attr = None + # objectclass first, even if this is not specified in the RFC + for attr in attributes: + if attr.lower() == 'objectclass': + for val in attributes[attr]: + lines.append(_convert_to_ldif(attr, val, all_base64)) + oc_attr = attr + break + + # remaining attributes + for attr in attributes: + if attr != oc_attr and attr in attributes: + for val in attributes[attr]: + lines.append(_convert_to_ldif(attr, val, all_base64)) + + return lines + + +def sort_ldif_lines(lines, sort_order): + # sort lines as per custom sort_order + # sort order is a list of descriptors, lines will be sorted following the same sequence + return sorted(lines, key=lambda x: ldif_sort(x, sort_order)) if sort_order else lines + + +def search_response_to_ldif(entries, all_base64, sort_order=None): + lines = [] + if entries: + for entry in entries: + if not entry or entry['type'] != 'searchResEntry': + continue + if 'dn' in entry: + lines.append(_convert_to_ldif('dn', entry['dn'], all_base64)) + lines.extend(add_attributes(entry['raw_attributes'], all_base64)) + else: + raise LDAPLDIFError('unable to convert to LDIF-CONTENT - missing DN') + if sort_order: + lines = sort_ldif_lines(lines, sort_order) + lines.append('') + + if lines: + lines.append('# total number of entries: ' + str(len(entries))) + + return lines + + +def add_request_to_ldif(entry, all_base64, sort_order=None): + lines = [] + if 'entry' in entry: + lines.append(_convert_to_ldif('dn', entry['entry'], all_base64)) + control_lines = add_controls(entry['controls'], all_base64) + if control_lines: + lines.extend(control_lines) + lines.append('changetype: add') + lines.extend(add_attributes(entry['attributes'], all_base64)) + if sort_order: + lines = sort_ldif_lines(lines, sort_order) + + else: + raise LDAPLDIFError('unable to convert to LDIF-CHANGE-ADD - missing DN ') + + return lines + + +def delete_request_to_ldif(entry, all_base64, sort_order=None): + lines = [] + if 'entry' in entry: + lines.append(_convert_to_ldif('dn', entry['entry'], all_base64)) + control_lines = add_controls(entry['controls'], all_base64) + if control_lines: + lines.extend(control_lines) + lines.append('changetype: delete') + if sort_order: + lines = sort_ldif_lines(lines, sort_order) + else: + raise LDAPLDIFError('unable to convert to LDIF-CHANGE-DELETE - missing DN ') + + return lines + + +def modify_request_to_ldif(entry, all_base64, sort_order=None): + lines = [] + if 'entry' in entry: + lines.append(_convert_to_ldif('dn', entry['entry'], all_base64)) + control_lines = add_controls(entry['controls'], all_base64) + if control_lines: + lines.extend(control_lines) + lines.append('changetype: modify') + if 'changes' in entry: + for change in entry['changes']: + lines.append(['add', 'delete', 'replace', 'increment'][change['operation']] + ': ' + change['attribute']['type']) + for value in change['attribute']['value']: + lines.append(_convert_to_ldif(change['attribute']['type'], value, all_base64)) + lines.append('-') + if sort_order: + lines = sort_ldif_lines(lines, sort_order) + return lines + + +def modify_dn_request_to_ldif(entry, all_base64, sort_order=None): + lines = [] + if 'entry' in entry: + lines.append(_convert_to_ldif('dn', entry['entry'], all_base64)) + control_lines = add_controls(entry['controls'], all_base64) + if control_lines: + lines.extend(control_lines) + lines.append('changetype: modrdn') if 'newSuperior' in entry and entry['newSuperior'] else lines.append('changetype: moddn') + lines.append(_convert_to_ldif('newrdn', entry['newRdn'], all_base64)) + lines.append('deleteoldrdn: ' + ('1' if entry['deleteOldRdn'] else '0')) + if 'newSuperior' in entry and entry['newSuperior']: + lines.append(_convert_to_ldif('newsuperior', entry['newSuperior'], all_base64)) + if sort_order: + lines = sort_ldif_lines(lines, sort_order) + else: + raise LDAPLDIFError('unable to convert to LDIF-CHANGE-MODDN - missing DN ') + + return lines + + +def operation_to_ldif(operation_type, entries, all_base64=False, sort_order=None): + if operation_type == 'searchResponse': + lines = search_response_to_ldif(entries, all_base64, sort_order) + elif operation_type == 'addRequest': + lines = add_request_to_ldif(entries, all_base64, sort_order) + elif operation_type == 'delRequest': + lines = delete_request_to_ldif(entries, all_base64, sort_order) + elif operation_type == 'modifyRequest': + lines = modify_request_to_ldif(entries, all_base64, sort_order) + elif operation_type == 'modDNRequest': + lines = modify_dn_request_to_ldif(entries, all_base64, sort_order) + else: + lines = [] + + ldif_record = [] + # check max line length and split as per note 2 of RFC 2849 + for line in lines: + if line: + ldif_record.append(line[0:conf_ldif_line_length]) + ldif_record.extend([' ' + line[i: i + conf_ldif_line_length - 1] for i in range(conf_ldif_line_length, len(line), conf_ldif_line_length - 1)] if len(line) > conf_ldif_line_length else []) + else: + ldif_record.append('') + + return ldif_record + + +def add_ldif_header(ldif_lines): + if ldif_lines: + ldif_lines.insert(0, 'version: 1') + + return ldif_lines + + +def ldif_sort(line, sort_order): + for i, descriptor in enumerate(sort_order): + + if line and line.startswith(descriptor): + return i + + return len(sort_order) + 1 + + +def decode_persistent_search_control(change): + if 'controls' in change and '2.16.840.1.113730.3.4.7' in change['controls']: + decoded = dict() + decoded_control, unprocessed = decoder.decode(change['controls']['2.16.840.1.113730.3.4.7']['value'], asn1Spec=EntryChangeNotificationControl()) + if unprocessed: + raise LDAPExtensionError('unprocessed value in EntryChangeNotificationControl') + if decoded_control['changeType'] == 1: # add + decoded['changeType'] = 'add' + elif decoded_control['changeType'] == 2: # delete + decoded['changeType'] = 'delete' + elif decoded_control['changeType'] == 4: # modify + decoded['changeType'] = 'modify' + elif decoded_control['changeType'] == 8: # modify_dn + decoded['changeType'] = 'modify dn' + else: + raise LDAPExtensionError('unknown Persistent Search changeType ' + str(decoded_control['changeType'])) + decoded['changeNumber'] = decoded_control['changeNumber'] if 'changeNumber' in decoded_control and decoded_control['changeNumber'] is not None and decoded_control['changeNumber'].hasValue() else None + decoded['previousDN'] = decoded_control['previousDN'] if 'previousDN' in decoded_control and decoded_control['previousDN'] is not None and decoded_control['previousDN'].hasValue() else None + return decoded + + return None + + +def persistent_search_response_to_ldif(change): + ldif_lines = ['# ' + datetime.now().isoformat()] + control = decode_persistent_search_control(change) + if control: + if control['changeNumber']: + ldif_lines.append('# change number: ' + str(control['changeNumber'])) + ldif_lines.append(control['changeType']) + if control['previousDN']: + ldif_lines.append('# previous dn: ' + str(control['previousDN'])) + ldif_lines += operation_to_ldif('searchResponse', [change]) + + return ldif_lines[:-1] # removes "total number of entries" diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/rfc3062.py b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc3062.py new file mode 100644 index 0000000000000000000000000000000000000000..c720984b637bb1f8f04463bb42f80395041e8ab6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc3062.py @@ -0,0 +1,91 @@ +""" +""" + +# Created on 2014.04.28 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1.type.univ import OctetString, Sequence +from pyasn1.type.namedtype import NamedTypes, OptionalNamedType +from pyasn1.type.tag import Tag, tagClassContext, tagFormatSimple + +# Modify password extended operation +# passwdModifyOID OBJECT IDENTIFIER ::= 1.3.6.1.4.1.4203.1.11.1 +# PasswdModifyRequestValue ::= SEQUENCE { +# userIdentity [0] OCTET STRING OPTIONAL +# oldPasswd [1] OCTET STRING OPTIONAL +# newPasswd [2] OCTET STRING OPTIONAL } +# +# PasswdModifyResponseValue ::= SEQUENCE { +# genPasswd [0] OCTET STRING OPTIONAL } + + +class UserIdentity(OctetString): + """ + userIdentity [0] OCTET STRING OPTIONAL + """ + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + encoding = 'utf-8' + + +class OldPasswd(OctetString): + """ + oldPasswd [1] OCTET STRING OPTIONAL + """ + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 1)) + encoding = 'utf-8' + + +class NewPasswd(OctetString): + """ + newPasswd [2] OCTET STRING OPTIONAL + """ + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 2)) + encoding = 'utf-8' + + +class GenPasswd(OctetString): + """ + newPasswd [2] OCTET STRING OPTIONAL + """ + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + encoding = 'utf-8' + + +class PasswdModifyRequestValue(Sequence): + """ + PasswdModifyRequestValue ::= SEQUENCE { + userIdentity [0] OCTET STRING OPTIONAL + oldPasswd [1] OCTET STRING OPTIONAL + newPasswd [2] OCTET STRING OPTIONAL } + """ + componentType = NamedTypes(OptionalNamedType('userIdentity', UserIdentity()), + OptionalNamedType('oldPasswd', OldPasswd()), + OptionalNamedType('newPasswd', NewPasswd())) + + +class PasswdModifyResponseValue(Sequence): + """ + PasswdModifyResponseValue ::= SEQUENCE { + genPasswd [0] OCTET STRING OPTIONAL } + """ + + componentType = NamedTypes(OptionalNamedType('genPasswd', GenPasswd())) diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4511.py b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4511.py new file mode 100644 index 0000000000000000000000000000000000000000..07f67be2be7ab7858d8c43ee85fd020110dd1ba4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4511.py @@ -0,0 +1,1007 @@ +""" +""" + +# Created on 2013.05.15 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +####################### +# ldap ASN.1 Definition +# from RFC4511 - Appendix B +# extended with result codes from IANA ldap-parameters as of 2013.08.21 +# extended with modify_increment from RFC4525 + +######################################################### +# Lightweight-Directory-Access-Protocol-V3 {1 3 6 1 1 18} +# -- Copyright (C) The Internet Society (2006). This version of +# -- this ASN.1 module is part of RFC 4511; see the RFC itself +# -- for full legal notices. +# DEFINITIONS +# IMPLICIT TAGS +# EXTENSIBILITY IMPLIED + +from pyasn1.type.univ import OctetString, Integer, Sequence, Choice, SequenceOf, Boolean, Null, Enumerated, SetOf +from pyasn1.type.namedtype import NamedTypes, NamedType, OptionalNamedType, DefaultedNamedType +from pyasn1.type.constraint import ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint +from pyasn1.type.namedval import NamedValues +from pyasn1.type.tag import tagClassApplication, tagFormatConstructed, Tag, tagClassContext, tagFormatSimple + + +# constants +# maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- +LDAP_MAX_INT = 2147483647 +MAXINT = Integer(LDAP_MAX_INT) + +# constraints +rangeInt0ToMaxConstraint = ValueRangeConstraint(0, MAXINT) +rangeInt1To127Constraint = ValueRangeConstraint(1, 127) +size1ToMaxConstraint = ValueSizeConstraint(1, MAXINT) +responseValueConstraint = SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 32, 33, 34, 36, 48, 49, 50, 51, 52, 53, 54, 64, 65, 66, 67, 68, 69, 71, 80, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 4096) + +# custom constraints +numericOIDConstraint = None # TODO +distinguishedNameConstraint = None # TODO +nameComponentConstraint = None # TODO +attributeDescriptionConstraint = None # TODO +uriConstraint = None # TODO +attributeSelectorConstraint = None # TODO + + +class Integer0ToMax(Integer): + subtypeSpec = Integer.subtypeSpec + rangeInt0ToMaxConstraint + + +class LDAPString(OctetString): + # LDAPString ::= OCTET STRING -- UTF-8 encoded, -- [ISO10646] characters + encoding = 'utf-8' + + +class MessageID(Integer0ToMax): + # MessageID ::= INTEGER (0 .. maxInt) + pass + + +class LDAPOID(OctetString): + # LDAPOID ::= OCTET STRING -- Constrained to + # -- [RFC4512] + + # subtypeSpec = numericOIDConstraint + pass + + +class LDAPDN(LDAPString): + # LDAPDN ::= LDAPString -- Constrained to + # -- [RFC4514] + + # subtypeSpec = distinguishedName + pass + + +class RelativeLDAPDN(LDAPString): + # RelativeLDAPDN ::= LDAPString -- Constrained to + # -- [RFC4514] + + # subtypeSpec = LDAPString.subtypeSpec + nameComponentConstraint + pass + + +class AttributeDescription(LDAPString): + # AttributeDescription ::= LDAPString -- Constrained to + # -- [RFC4512] + + # subtypeSpec = LDAPString.subtypeSpec + attributeDescriptionConstraint + pass + + +class AttributeValue(OctetString): + # AttributeValue ::= OCTET STRING + encoding = 'utf-8' + + +class AssertionValue(OctetString): + # AssertionValue ::= OCTET STRING + encoding = 'utf-8' + + +class AttributeValueAssertion(Sequence): + # AttributeValueAssertion ::= SEQUENCE { + # attributeDesc AttributeDescription, + # assertionValue AssertionValue } + componentType = NamedTypes(NamedType('attributeDesc', AttributeDescription()), + NamedType('assertionValue', AssertionValue())) + + +class MatchingRuleId(LDAPString): + # MatchingRuleId ::= LDAPString + pass + + +class Vals(SetOf): + # vals SET OF value AttributeValue } + componentType = AttributeValue() + + +class ValsAtLeast1(SetOf): + # vals SET OF value AttributeValue } + componentType = AttributeValue() + subtypeSpec = SetOf.subtypeSpec + size1ToMaxConstraint + + +class PartialAttribute(Sequence): + # PartialAttribute ::= SEQUENCE { + # type AttributeDescription, + # vals SET OF value AttributeValue } + componentType = NamedTypes(NamedType('type', AttributeDescription()), + NamedType('vals', Vals())) + + +class Attribute(Sequence): + # Attribute ::= PartialAttribute(WITH COMPONENTS { + # ..., + # vals (SIZE(1..MAX))}) + componentType = NamedTypes(NamedType('type', AttributeDescription()), + # NamedType('vals', ValsAtLeast1())) + NamedType('vals', Vals())) # changed from ValsAtLeast1() to allow empty member values in groups - this should not be as per rfc4511 4.1.7, but openldap accept it + + +class AttributeList(SequenceOf): + # AttributeList ::= SEQUENCE OF attribute Attribute + componentType = Attribute() + + +class Simple(OctetString): + # simple [0] OCTET STRING, + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + encoding = 'utf-8' + + +class Credentials(OctetString): + # credentials OCTET STRING + encoding = 'utf-8' + + +class SaslCredentials(Sequence): + # SaslCredentials ::= SEQUENCE { + # mechanism LDAPString, + # credentials OCTET STRING OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 3)) + componentType = NamedTypes(NamedType('mechanism', LDAPString()), + OptionalNamedType('credentials', Credentials())) + + +# not in RFC4511 but used by Microsoft to embed the NTLM protocol in the BindRequest (Sicily Protocol) +class SicilyPackageDiscovery(OctetString): + # sicilyPackageDiscovery [9] OCTET STRING, + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 9)) + encoding = 'utf-8' + + +# not in RFC4511 but used by Microsoft to embed the NTLM protocol in the BindRequest (Sicily Protocol) +class SicilyNegotiate(OctetString): + # sicilyNegotiate [10] OCTET STRING, + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 10)) + encoding = 'utf-8' + + +# not in RFC4511 but used by Microsoft to embed the NTLM protocol in the BindRequest (Sicily Protocol) +class SicilyResponse(OctetString): + # sicilyResponse [11] OCTET STRING, + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 11)) + encoding = 'utf-8' + + +class AuthenticationChoice(Choice): + # AuthenticationChoice ::= CHOICE { + # simple [0] OCTET STRING, + # -- 1 and 2 reserved + # sasl [3] SaslCredentials, + # ... } + + # from https://msdn.microsoft.com/en-us/library/cc223498.aspx # legacy NTLM authentication for Windows Active Directory + # sicilyPackageDiscovery [9] OCTET STRING + # sicilyNegotiate [10] OCTET STRING + # sicilyResponse [11] OCTET STRING } + + componentType = NamedTypes(NamedType('simple', Simple()), + NamedType('sasl', SaslCredentials()), + NamedType('sicilyPackageDiscovery', SicilyPackageDiscovery()), + NamedType('sicilyNegotiate', SicilyNegotiate()), + NamedType('sicilyResponse', SicilyResponse()), + ) + + +class Version(Integer): + # version INTEGER (1 .. 127), + subtypeSpec = Integer.subtypeSpec + rangeInt1To127Constraint + + +class ResultCode(Enumerated): + # resultCode ENUMERATED { + # success (0), + # operationsError (1), + # protocolError (2), + # timeLimitExceeded (3), + # sizeLimitExceeded (4), + # compareFalse (5), + # compareTrue (6), + # authMethodNotSupported (7), + # strongerAuthRequired (8), + # -- 9 reserved -- + # referral (10), + # adminLimitExceeded (11), + # unavailableCriticalExtension (12), + # confidentialityRequired (13), + # saslBindInProgress (14), + # noSuchAttribute (16), + # undefinedAttributeType (17), + # inappropriateMatching (18), + # constraintViolation (19), + # attributeOrValueExists (20), + # invalidAttributeSyntax (21), + # -- 22-31 unused -- + # noSuchObject (32), + # aliasProblem (33), + # invalidDNSyntax (34), + # -- 35 reserved for undefined isLeaf -- + # aliasDereferencingProblem (36), + # -- 37-47 unused -- + # inappropriateAuthentication (48), + # invalidCredentials (49), + # insufficientAccessRights (50), + # busy (51), + # unavailable (52), + # unwillingToPerform (53), + # loopDetect (54), + # -- 55-63 unused -- + # namingViolation (64), + # objectClassViolation (65), + # notAllowedOnNonLeaf (66), + # notAllowedOnRDN (67), + # entryAlreadyExists (68), + # objectClassModsProhibited (69), + # -- 70 reserved for CLDAP -- + # affectsMultipleDSAs (71), + # -- 72-79 unused -- + # other (80), + # ... } + # + # from IANA ldap-parameters: + # lcupResourcesExhausted 113 IESG [RFC3928] + # lcupSecurityViolation 114 IESG [RFC3928] + # lcupInvalidData 115 IESG [RFC3928] + # lcupUnsupportedScheme 116 IESG [RFC3928] + # lcupReloadRequired 117 IESG [RFC3928] + # canceled 118 IESG [RFC3909] + # noSuchOperation 119 IESG [RFC3909] + # tooLate 120 IESG [RFC3909] + # cannotCancel 121 IESG [RFC3909] + # assertionFailed 122 IESG [RFC4528] + # authorizationDenied 123 WELTMAN [RFC4370] + # e-syncRefreshRequired 4096 [Kurt_Zeilenga] [Jong_Hyuk_Choi] [RFC4533] + namedValues = NamedValues(('success', 0), + ('operationsError', 1), + ('protocolError', 2), + ('timeLimitExceeded', 3), + ('sizeLimitExceeded', 4), + ('compareFalse', 5), + ('compareTrue', 6), + ('authMethodNotSupported', 7), + ('strongerAuthRequired', 8), + ('referral', 10), + ('adminLimitExceeded', 11), + ('unavailableCriticalExtension', 12), + ('confidentialityRequired', 13), + ('saslBindInProgress', 14), + ('noSuchAttribute', 16), + ('undefinedAttributeType', 17), + ('inappropriateMatching', 18), + ('constraintViolation', 19), + ('attributeOrValueExists', 20), + ('invalidAttributeSyntax', 21), + ('noSuchObject', 32), + ('aliasProblem', 33), + ('invalidDNSyntax', 34), + ('aliasDereferencingProblem', 36), + ('inappropriateAuthentication', 48), + ('invalidCredentials', 49), + ('insufficientAccessRights', 50), + ('busy', 51), + ('unavailable', 52), + ('unwillingToPerform', 53), + ('loopDetected', 54), + ('namingViolation', 64), + ('objectClassViolation', 65), + ('notAllowedOnNonLeaf', 66), + ('notAllowedOnRDN', 67), + ('entryAlreadyExists', 68), + ('objectClassModsProhibited', 69), + ('affectMultipleDSAs', 71), + ('other', 80), + ('lcupResourcesExhausted', 113), + ('lcupSecurityViolation', 114), + ('lcupInvalidData', 115), + ('lcupUnsupportedScheme', 116), + ('lcupReloadRequired', 117), + ('canceled', 118), + ('noSuchOperation', 119), + ('tooLate', 120), + ('cannotCancel', 121), + ('assertionFailed', 122), + ('authorizationDenied', 123), + ('e-syncRefreshRequired', 4096)) + + subTypeSpec = Enumerated.subtypeSpec + responseValueConstraint + + +class URI(LDAPString): + # URI ::= LDAPString -- limited to characters permitted in + # -- URIs + + # subtypeSpec = LDAPString.subTypeSpec + uriConstrain + pass + + +class Referral(SequenceOf): + # Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI + tagSet = SequenceOf.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 3)) + componentType = URI() + + +class ServerSaslCreds(OctetString): + # serverSaslCreds [7] OCTET STRING OPTIONAL + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 7)) + encoding = 'utf-8' + + +class LDAPResult(Sequence): + # LDAPResult ::= SEQUENCE { + # resultCode ENUMERATED { + # success (0), + # operationsError (1), + # protocolError (2), + # timeLimitExceeded (3), + # sizeLimitExceeded (4), + # compareFalse (5), + # compareTrue (6), + # authMethodNotSupported (7), + # strongerAuthRequired (8), + # -- 9 reserved -- + # referral (10), + # adminLimitExceeded (11), + # unavailableCriticalExtension (12), + # confidentialityRequired (13), + # saslBindInProgress (14), + # noSuchAttribute (16), + # undefinedAttributeType (17), + # inappropriateMatching (18), + # constraintViolation (19), + # attributeOrValueExists (20), + # invalidAttributeSyntax (21), + # -- 22-31 unused -- + # noSuchObject (32), + # aliasProblem (33), + # invalidDNSyntax (34), + # -- 35 reserved for undefined isLeaf -- + # aliasDereferencingProblem (36), + # -- 37-47 unused -- + # inappropriateAuthentication (48), + # invalidCredentials (49), + # insufficientAccessRights (50), + # busy (51), + # unavailable (52), + # unwillingToPerform (53), + # loopDetect (54), + # -- 55-63 unused -- + # namingViolation (64), + # objectClassViolation (65), + # notAllowedOnNonLeaf (66), + # notAllowedOnRDN (67), + # entryAlreadyExists (68), + # objectClassModsProhibited (69), + # -- 70 reserved for CLDAP -- + # affectsMultipleDSAs (71), + # -- 72-79 unused -- + # other (80), + # ... }, + # matchedDN LDAPDN, + # diagnosticMessage LDAPString, + # referral [3] Referral OPTIONAL } + componentType = NamedTypes(NamedType('resultCode', ResultCode()), + NamedType('matchedDN', LDAPDN()), + NamedType('diagnosticMessage', LDAPString()), + OptionalNamedType('referral', Referral())) + + +class Criticality(Boolean): + # criticality BOOLEAN DEFAULT FALSE + defaultValue = False + + +class ControlValue(OctetString): + # controlValue OCTET STRING + encoding = 'utf-8' + + +class Control(Sequence): + # Control ::= SEQUENCE { + # controlType LDAPOID, + # criticality BOOLEAN DEFAULT FALSE, + # controlValue OCTET STRING OPTIONAL } + componentType = NamedTypes(NamedType('controlType', LDAPOID()), + DefaultedNamedType('criticality', Criticality()), + OptionalNamedType('controlValue', ControlValue())) + + +class Controls(SequenceOf): + # Controls ::= SEQUENCE OF control Control + tagSet = SequenceOf.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 0)) + componentType = Control() + + +class Scope(Enumerated): + # scope ENUMERATED { + # baseObject (0), + # singleLevel (1), + # wholeSubtree (2), + namedValues = NamedValues(('baseObject', 0), + ('singleLevel', 1), + ('wholeSubtree', 2)) + + +class DerefAliases(Enumerated): + # derefAliases ENUMERATED { + # neverDerefAliases (0), + # derefInSearching (1), + # derefFindingBaseObj (2), + # derefAlways (3) }, + namedValues = NamedValues(('neverDerefAliases', 0), + ('derefInSearching', 1), + ('derefFindingBaseObj', 2), + ('derefAlways', 3)) + + +class TypesOnly(Boolean): + # typesOnly BOOLEAN + pass + + +class Selector(LDAPString): + # -- The LDAPString is constrained to + # -- in Section 4.5.1.8 + + # subtypeSpec = LDAPString.subtypeSpec + attributeSelectorConstraint + pass + + +class AttributeSelection(SequenceOf): + # AttributeSelection ::= SEQUENCE OF selector LDAPString + # -- The LDAPString is constrained to + # -- in Section 4.5.1.8 + componentType = Selector() + + +class MatchingRule(MatchingRuleId): + # matchingRule [1] MatchingRuleId + tagSet = MatchingRuleId.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 1)) + + +class Type(AttributeDescription): + # type [2] AttributeDescription + tagSet = AttributeDescription.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 2)) + + +class MatchValue(AssertionValue): + # matchValue [3] AssertionValue, + tagSet = AssertionValue.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 3)) + + +class DnAttributes(Boolean): + # dnAttributes [4] BOOLEAN DEFAULT FALSE } + tagSet = Boolean.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 4)) + defaultValue = Boolean(False) + + +class MatchingRuleAssertion(Sequence): + # MatchingRuleAssertion ::= SEQUENCE { + # matchingRule [1] MatchingRuleId OPTIONAL, + # type [2] AttributeDescription OPTIONAL, + # matchValue [3] AssertionValue, + # dnAttributes [4] BOOLEAN DEFAULT FALSE } + componentType = NamedTypes(OptionalNamedType('matchingRule', MatchingRule()), + OptionalNamedType('type', Type()), + NamedType('matchValue', MatchValue()), + DefaultedNamedType('dnAttributes', DnAttributes())) + + +class Initial(AssertionValue): + # initial [0] AssertionValue, -- can occur at most once + tagSet = AssertionValue.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + + +class Any(AssertionValue): + # any [1] AssertionValue, + tagSet = AssertionValue.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 1)) + + +class Final(AssertionValue): + # final [1] AssertionValue, -- can occur at most once + tagSet = AssertionValue.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 2)) + + +class Substring(Choice): + # substring CHOICE { + # initial [0] AssertionValue, -- can occur at most once + # any [1] AssertionValue, + # final [2] AssertionValue } -- can occur at most once + # } + componentType = NamedTypes(NamedType('initial', Initial()), + NamedType('any', Any()), + NamedType('final', Final())) + + +class Substrings(SequenceOf): + # substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { + # ... + # } + subtypeSpec = SequenceOf.subtypeSpec + size1ToMaxConstraint + componentType = Substring() + + +class SubstringFilter(Sequence): + # SubstringFilter ::= SEQUENCE { + # type AttributeDescription, + # substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { + # initial [0] AssertionValue, -- can occur at most once + # any [1] AssertionValue, + # final [2] AssertionValue } -- can occur at most once + # } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 4)) + componentType = NamedTypes(NamedType('type', AttributeDescription()), + NamedType('substrings', Substrings())) + + +class And(SetOf): + # and [0] SET SIZE (1..MAX) OF filter Filter + tagSet = SetOf.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 0)) + subtypeSpec = SetOf.subtypeSpec + size1ToMaxConstraint + + +class Or(SetOf): + # or [1] SET SIZE (1..MAX) OF filter Filter + tagSet = SetOf.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 1)) + subtypeSpec = SetOf.subtypeSpec + size1ToMaxConstraint + + +class Not(Choice): + # not [2] Filter + pass # defined after Filter definition to allow recursion + + +class EqualityMatch(AttributeValueAssertion): + # equalityMatch [3] AttributeValueAssertion + tagSet = AttributeValueAssertion.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 3)) + + +class GreaterOrEqual(AttributeValueAssertion): + # greaterOrEqual [5] AttributeValueAssertion + tagSet = AttributeValueAssertion.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 5)) + + +class LessOrEqual(AttributeValueAssertion): + # lessOrEqual [6] AttributeValueAssertion + tagSet = AttributeValueAssertion.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 6)) + + +class Present(AttributeDescription): + # present [7] AttributeDescription + tagSet = AttributeDescription.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 7)) + + +class ApproxMatch(AttributeValueAssertion): + # approxMatch [8] AttributeValueAssertion + tagSet = AttributeValueAssertion.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 8)) + + +class ExtensibleMatch(MatchingRuleAssertion): + # extensibleMatch [9] MatchingRuleAssertion + tagSet = MatchingRuleAssertion.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 9)) + + +class Filter(Choice): + # Filter ::= CHOICE { + # and [0] SET SIZE (1..MAX) OF filter Filter, + # or [1] SET SIZE (1..MAX) OF filter Filter, + # not [2] Filter, + # equalityMatch [3] AttributeValueAssertion, + # substrings [4] SubstringFilter, + # greaterOrEqual [5] AttributeValueAssertion, + # lessOrEqual [6] AttributeValueAssertion, + # present [7] AttributeDescription, + # approxMatch [8] AttributeValueAssertion, + # extensibleMatch [9] MatchingRuleAssertion, + # ... } + componentType = NamedTypes(NamedType('and', And()), + NamedType('or', Or()), + NamedType('notFilter', Not()), + NamedType('equalityMatch', EqualityMatch()), + NamedType('substringFilter', SubstringFilter()), + NamedType('greaterOrEqual', GreaterOrEqual()), + NamedType('lessOrEqual', LessOrEqual()), + NamedType('present', Present()), + NamedType('approxMatch', ApproxMatch()), + NamedType('extensibleMatch', ExtensibleMatch())) + + +And.componentType = Filter() +Or.componentType = Filter() +Not.componentType = NamedTypes(NamedType('innerNotFilter', Filter())) +Not.tagSet = Filter.tagSet.tagExplicitly(Tag(tagClassContext, tagFormatConstructed, 2)) # as per RFC4511 page 23 + + +class PartialAttributeList(SequenceOf): + # PartialAttributeList ::= SEQUENCE OF + # partialAttribute PartialAttribute + componentType = PartialAttribute() + + +class Operation(Enumerated): + # operation ENUMERATED { + # add (0), + # delete (1), + # replace (2), + # ... } + namedValues = NamedValues(('add', 0), + ('delete', 1), + ('replace', 2), + ('increment', 3)) + + +class Change(Sequence): + # change SEQUENCE { + # operation ENUMERATED { + # add (0), + # delete (1), + # replace (2), + # ... }, + # modification PartialAttribute } } + componentType = NamedTypes(NamedType('operation', Operation()), + NamedType('modification', PartialAttribute())) + + +class Changes(SequenceOf): + # changes SEQUENCE OF change SEQUENCE + componentType = Change() + + +class DeleteOldRDN(Boolean): + # deleteoldrdn BOOLEAN + pass + + +class NewSuperior(LDAPDN): + # newSuperior [0] LDAPDN + tagSet = LDAPDN.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + + +class RequestName(LDAPOID): + # requestName [0] LDAPOID + tagSet = LDAPOID.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + + +class RequestValue(OctetString): + # requestValue [1] OCTET STRING + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 1)) + encoding = 'utf-8' + + +class ResponseName(LDAPOID): + # responseName [10] LDAPOID + tagSet = LDAPOID.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 10)) + + +class ResponseValue(OctetString): + # responseValue [11] OCTET STRING + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 11)) + encoding = 'utf-8' + + +class IntermediateResponseName(LDAPOID): + # responseName [0] LDAPOID + tagSet = LDAPOID.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0)) + + +class IntermediateResponseValue(OctetString): + # responseValue [1] OCTET STRING + tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 1)) + encoding = 'utf-8' + + +# operations +class BindRequest(Sequence): + # BindRequest ::= [APPLICATION 0] SEQUENCE { + # version INTEGER (1 .. 127), + # name LDAPDN, + # authentication AuthenticationChoice } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 0)) + componentType = NamedTypes(NamedType('version', Version()), + NamedType('name', LDAPDN()), + NamedType('authentication', AuthenticationChoice())) + + +class BindResponse(Sequence): + # BindResponse ::= [APPLICATION 1] SEQUENCE { + # COMPONENTS OF LDAPResult, + # serverSaslCreds [7] OCTET STRING OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 1)) + componentType = NamedTypes(NamedType('resultCode', ResultCode()), + NamedType('matchedDN', LDAPDN()), + NamedType('diagnosticMessage', LDAPString()), + OptionalNamedType('referral', Referral()), + OptionalNamedType('serverSaslCreds', ServerSaslCreds())) + + +class UnbindRequest(Null): + # UnbindRequest ::= [APPLICATION 2] NULL + tagSet = Null.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatSimple, 2)) + + +class SearchRequest(Sequence): + # SearchRequest ::= [APPLICATION 3] SEQUENCE { + # baseObject LDAPDN, + # scope ENUMERATED { + # baseObject (0), + # singleLevel (1), + # wholeSubtree (2), + # ... }, + # derefAliases ENUMERATED { + # neverDerefAliases (0), + # derefInSearching (1), + # derefFindingBaseObj (2), + # derefAlways (3) }, + # sizeLimit INTEGER (0 .. maxInt), + # timeLimit INTEGER (0 .. maxInt), + # typesOnly BOOLEAN, + # filter Filter, + # attributes AttributeSelection } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 3)) + componentType = NamedTypes(NamedType('baseObject', LDAPDN()), + NamedType('scope', Scope()), + NamedType('derefAliases', DerefAliases()), + NamedType('sizeLimit', Integer0ToMax()), + NamedType('timeLimit', Integer0ToMax()), + NamedType('typesOnly', TypesOnly()), + NamedType('filter', Filter()), + NamedType('attributes', AttributeSelection())) + + +class SearchResultReference(SequenceOf): + # SearchResultReference ::= [APPLICATION 19] SEQUENCE + # SIZE (1..MAX) OF uri URI + tagSet = SequenceOf.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 19)) + subtypeSpec = SequenceOf.subtypeSpec + size1ToMaxConstraint + componentType = URI() + + +class SearchResultEntry(Sequence): + # SearchResultEntry ::= [APPLICATION 4] SEQUENCE { + # objectName LDAPDN, + # attributes PartialAttributeList } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 4)) + componentType = NamedTypes(NamedType('object', LDAPDN()), + NamedType('attributes', PartialAttributeList())) + + +class SearchResultDone(LDAPResult): + # SearchResultDone ::= [APPLICATION 5] LDAPResult + tagSet = LDAPResult.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 5)) + + +class ModifyRequest(Sequence): + # ModifyRequest ::= [APPLICATION 6] SEQUENCE { + # object LDAPDN, + # changes SEQUENCE OF change SEQUENCE { + # operation ENUMERATED { + # add (0), + # delete (1), + # replace (2), + # ... }, + # modification PartialAttribute } } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 6)) + componentType = NamedTypes(NamedType('object', LDAPDN()), + NamedType('changes', Changes())) + + +class ModifyResponse(LDAPResult): + # ModifyResponse ::= [APPLICATION 7] LDAPResult + tagSet = LDAPResult.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 7)) + + +class AddRequest(Sequence): + # AddRequest ::= [APPLICATION 8] SEQUENCE { + # entry LDAPDN, + # attributes AttributeList } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 8)) + componentType = NamedTypes(NamedType('entry', LDAPDN()), + NamedType('attributes', AttributeList())) + + +class AddResponse(LDAPResult): + # AddResponse ::= [APPLICATION 9] LDAPResult + tagSet = LDAPResult.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 9)) + + +class DelRequest(LDAPDN): + # DelRequest ::= [APPLICATION 10] LDAPDN + tagSet = LDAPDN.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatSimple, 10)) + + +class DelResponse(LDAPResult): + # DelResponse ::= [APPLICATION 11] LDAPResult + tagSet = LDAPResult.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 11)) + + +class ModifyDNRequest(Sequence): + # ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { + # entry LDAPDN, + # newrdn RelativeLDAPDN, + # deleteoldrdn BOOLEAN, + # newSuperior [0] LDAPDN OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 12)) + componentType = NamedTypes(NamedType('entry', LDAPDN()), + NamedType('newrdn', RelativeLDAPDN()), + NamedType('deleteoldrdn', DeleteOldRDN()), + OptionalNamedType('newSuperior', NewSuperior())) + + +class ModifyDNResponse(LDAPResult): + # ModifyDNResponse ::= [APPLICATION 13] LDAPResult + tagSet = LDAPResult.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 13)) + + +class CompareRequest(Sequence): + # CompareRequest ::= [APPLICATION 14] SEQUENCE { + # entry LDAPDN, + # ava AttributeValueAssertion } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 14)) + componentType = NamedTypes(NamedType('entry', LDAPDN()), + NamedType('ava', AttributeValueAssertion())) + + +class CompareResponse(LDAPResult): + # CompareResponse ::= [APPLICATION 15] LDAPResult + tagSet = LDAPResult.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 15)) + + +class AbandonRequest(MessageID): + # AbandonRequest ::= [APPLICATION 16] MessageID + tagSet = MessageID.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatSimple, 16)) + + +class ExtendedRequest(Sequence): + # ExtendedRequest ::= [APPLICATION 23] SEQUENCE { + # requestName [0] LDAPOID, + # requestValue [1] OCTET STRING OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 23)) + componentType = NamedTypes(NamedType('requestName', RequestName()), + OptionalNamedType('requestValue', RequestValue())) + + +class ExtendedResponse(Sequence): + # ExtendedResponse ::= [APPLICATION 24] SEQUENCE { + # COMPONENTS OF LDAPResult, + # responseName [10] LDAPOID OPTIONAL, + # responseValue [11] OCTET STRING OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 24)) + componentType = NamedTypes(NamedType('resultCode', ResultCode()), + NamedType('matchedDN', LDAPDN()), + NamedType('diagnosticMessage', LDAPString()), + OptionalNamedType('referral', Referral()), + OptionalNamedType('responseName', ResponseName()), + OptionalNamedType('responseValue', ResponseValue())) + + +class IntermediateResponse(Sequence): + # IntermediateResponse ::= [APPLICATION 25] SEQUENCE { + # responseName [0] LDAPOID OPTIONAL, + # responseValue [1] OCTET STRING OPTIONAL } + tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassApplication, tagFormatConstructed, 25)) + componentType = NamedTypes(OptionalNamedType('responseName', IntermediateResponseName()), + OptionalNamedType('responseValue', IntermediateResponseValue())) + + +class ProtocolOp(Choice): + # protocolOp CHOICE { + # bindRequest BindRequest, + # bindResponse BindResponse, + # unbindRequest UnbindRequest, + # searchRequest SearchRequest, + # searchResEntry SearchResultEntry, + # searchResDone SearchResultDone, + # searchResRef SearchResultReference, + # modifyRequest ModifyRequest, + # modifyResponse ModifyResponse, + # addRequest AddRequest, + # addResponse AddResponse, + # delRequest DelRequest, + # delResponse DelResponse, + # modDNRequest ModifyDNRequest, + # modDNResponse ModifyDNResponse, + # compareRequest CompareRequest, + # compareResponse CompareResponse, + # abandonRequest AbandonRequest, + # extendedReq ExtendedRequest, + # extendedResp ExtendedResponse, + # ..., + # intermediateResponse IntermediateResponse } + componentType = NamedTypes(NamedType('bindRequest', BindRequest()), + NamedType('bindResponse', BindResponse()), + NamedType('unbindRequest', UnbindRequest()), + NamedType('searchRequest', SearchRequest()), + NamedType('searchResEntry', SearchResultEntry()), + NamedType('searchResDone', SearchResultDone()), + NamedType('searchResRef', SearchResultReference()), + NamedType('modifyRequest', ModifyRequest()), + NamedType('modifyResponse', ModifyResponse()), + NamedType('addRequest', AddRequest()), + NamedType('addResponse', AddResponse()), + NamedType('delRequest', DelRequest()), + NamedType('delResponse', DelResponse()), + NamedType('modDNRequest', ModifyDNRequest()), + NamedType('modDNResponse', ModifyDNResponse()), + NamedType('compareRequest', CompareRequest()), + NamedType('compareResponse', CompareResponse()), + NamedType('abandonRequest', AbandonRequest()), + NamedType('extendedReq', ExtendedRequest()), + NamedType('extendedResp', ExtendedResponse()), + NamedType('intermediateResponse', IntermediateResponse())) + + +class LDAPMessage(Sequence): + # LDAPMessage ::= SEQUENCE { + # messageID MessageID, + # protocolOp CHOICE { + # bindRequest BindRequest, + # bindResponse BindResponse, + # unbindRequest UnbindRequest, + # searchRequest SearchRequest, + # searchResEntry SearchResultEntry, + # searchResDone SearchResultDone, + # searchResRef SearchResultReference, + # modifyRequest ModifyRequest, + # modifyResponse ModifyResponse, + # addRequest AddRequest, + # addResponse AddResponse, + # delRequest DelRequest, + # delResponse DelResponse, + # modDNRequest ModifyDNRequest, + # modDNResponse ModifyDNResponse, + # compareRequest CompareRequest, + # compareResponse CompareResponse, + # abandonRequest AbandonRequest, + # extendedReq ExtendedRequest, + # extendedResp ExtendedResponse, + # ..., + # intermediateResponse IntermediateResponse }, + # controls [0] Controls OPTIONAL } + componentType = NamedTypes(NamedType('messageID', MessageID()), + NamedType('protocolOp', ProtocolOp()), + OptionalNamedType('controls', Controls())) diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4512.py b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4512.py new file mode 100644 index 0000000000000000000000000000000000000000..407b2d17b8e9ea4d51753dc87bab24514f785dd7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4512.py @@ -0,0 +1,850 @@ +""" +""" + +# Created on 2013.09.11 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from os import linesep +import re +import json + +from .oid import CLASS_ABSTRACT, CLASS_STRUCTURAL, CLASS_AUXILIARY, ATTRIBUTE_USER_APPLICATION, \ + ATTRIBUTE_DIRECTORY_OPERATION, ATTRIBUTE_DISTRIBUTED_OPERATION, ATTRIBUTE_DSA_OPERATION +from .. import SEQUENCE_TYPES, STRING_TYPES, get_config_parameter +from ..utils.conv import escape_bytes, json_hook, check_json_dict, format_json, to_unicode +from ..utils.ciDict import CaseInsensitiveWithAliasDict +from ..protocol.formatters.standard import format_attribute_values +from .oid import Oids, decode_oids, decode_syntax, oid_to_string +from ..core.exceptions import LDAPSchemaError, LDAPDefinitionError + + +def constant_to_class_kind(value): + if value == CLASS_STRUCTURAL: + return 'Structural' + elif value == CLASS_ABSTRACT: + return 'Abstract' + elif value == CLASS_AUXILIARY: + return 'Auxiliary' + else: + return '' + + +def constant_to_attribute_usage(value): + if value == ATTRIBUTE_USER_APPLICATION: + return 'User Application' + elif value == ATTRIBUTE_DIRECTORY_OPERATION: + return "Directory operation" + elif value == ATTRIBUTE_DISTRIBUTED_OPERATION: + return 'Distributed operation' + elif value == ATTRIBUTE_DSA_OPERATION: + return 'DSA operation' + else: + return 'unknown' + + +def attribute_usage_to_constant(value): + if value == 'userApplications': + return ATTRIBUTE_USER_APPLICATION + elif value == 'directoryOperation': + return ATTRIBUTE_DIRECTORY_OPERATION + elif value == 'distributedOperation': + return ATTRIBUTE_DISTRIBUTED_OPERATION + elif value == 'dSAOperation': + return ATTRIBUTE_DSA_OPERATION + else: + return 'unknown' + + +def quoted_string_to_list(quoted_string): + string = quoted_string.strip() + if not string: + return list() + + if string[0] == '(' and string[-1] == ')': + string = string[1:-1] + elements = string.split("'") + # return [check_escape(element.strip("'").strip()) for element in elements if element.strip()] + return [element.strip("'").strip() for element in elements if element.strip()] + + +def oids_string_to_list(oid_string): + string = oid_string.strip() + if string[0] == '(' and string[-1] == ')': + string = string[1:-1] + elements = string.split('$') + return [element.strip() for element in elements if element.strip()] + + +def extension_to_tuple(extension_string): + string = extension_string.strip() + name, _, values = string.partition(' ') + return name, quoted_string_to_list(values) + + +def list_to_string(list_object): + if not isinstance(list_object, SEQUENCE_TYPES): + return list_object + + r = '' + for element in list_object: + r += (list_to_string(element) if isinstance(element, SEQUENCE_TYPES) else str(element)) + ', ' + + return r[:-2] if r else '' + + +class BaseServerInfo(object): + def __init__(self, raw_attributes): + self.raw = dict(raw_attributes) + + @classmethod + def from_json(cls, json_definition, schema=None, custom_formatter=None): + conf_case_insensitive_schema = get_config_parameter('CASE_INSENSITIVE_SCHEMA_NAMES') + definition = json.loads(json_definition, object_hook=json_hook) + if 'raw' not in definition or 'type' not in definition: + raise LDAPDefinitionError('invalid JSON definition') + + if conf_case_insensitive_schema: + attributes = CaseInsensitiveWithAliasDict() + else: + attributes = dict() + + if schema: + for attribute in definition['raw']: + # attributes[attribute] = format_attribute_values(schema, check_escape(attribute), [check_escape(value) for value in definition['raw'][attribute]], custom_formatter) + attributes[attribute] = format_attribute_values(schema, attribute, [value for value in definition['raw'][attribute]], custom_formatter) + else: + for attribute in definition['raw']: + # attributes[attribute] = [check_escape(value) for value in definition['raw'][attribute]] + attributes[attribute] = [value for value in definition['raw'][attribute]] + + if cls.__name__ != definition['type']: + raise LDAPDefinitionError('JSON info not of type ' + cls.__name__) + + if definition['type'] == 'DsaInfo': + return DsaInfo(attributes, definition['raw']) + elif definition['type'] == 'SchemaInfo': + if 'schema_entry' not in definition: + raise LDAPDefinitionError('invalid schema in JSON') + return SchemaInfo(definition['schema_entry'], attributes, definition['raw']) + + raise LDAPDefinitionError('invalid Info type ' + str(definition['type']) + ' in JSON definition') + + @classmethod + def from_file(cls, target, schema=None, custom_formatter=None): + if isinstance(target, STRING_TYPES): + target = open(target, 'r') + + new = cls.from_json(target.read(), schema=schema, custom_formatter=custom_formatter) + target.close() + return new + + def to_file(self, + target, + indent=4, + sort=True): + if isinstance(target, STRING_TYPES): + target = open(target, 'w+') + + target.writelines(self.to_json(indent=indent, sort=sort)) + target.close() + + def __str__(self): + return self.__repr__() + + def to_json(self, + indent=4, + sort=True): + json_dict = dict() + json_dict['type'] = self.__class__.__name__ + json_dict['raw'] = self.raw + + if isinstance(self, SchemaInfo): + json_dict['schema_entry'] = self.schema_entry + elif isinstance(self, DsaInfo): + pass + else: + raise LDAPDefinitionError('unable to convert ' + str(self) + ' to JSON') + + if str is bytes: # Python 2 + check_json_dict(json_dict) + + return json.dumps(json_dict, ensure_ascii=False, sort_keys=sort, indent=indent, check_circular=True, default=format_json, separators=(',', ': ')) + + +class DsaInfo(BaseServerInfo): + """ + This class contains info about the ldap server (DSA) read from DSE + as defined in RFC4512 and RFC3045. Unknown attributes are stored in the "other" dict + """ + + def __init__(self, attributes, raw_attributes): + BaseServerInfo.__init__(self, raw_attributes) + self.alt_servers = attributes.pop('altServer', None) + self.naming_contexts = attributes.pop('namingContexts', None) + self.supported_controls = decode_oids(attributes.pop('supportedControl', None)) + self.supported_extensions = decode_oids(attributes.pop('supportedExtension', None)) + self.supported_features = decode_oids(attributes.pop('supportedFeatures', None)) + decode_oids(attributes.pop('supportedCapabilities', None)) + self.supported_ldap_versions = attributes.pop('supportedLDAPVersion', None) + self.supported_sasl_mechanisms = attributes.pop('supportedSASLMechanisms', None) + self.vendor_name = attributes.pop('vendorName', None) + self.vendor_version = attributes.pop('vendorVersion', None) + self.schema_entry = attributes.pop('subschemaSubentry', None) + self.other = attributes # remaining schema definition attributes not in RFC4512 + + def __repr__(self): + r = 'DSA info (from DSE):' + linesep + if self.supported_ldap_versions: + if isinstance(self.supported_ldap_versions, SEQUENCE_TYPES): + r += (' Supported LDAP versions: ' + ', '.join([str(s) for s in self.supported_ldap_versions])) if self.supported_ldap_versions else '' + else: + r += (' Supported LDAP versions: ' + str(self.supported_ldap_versions)) + r += linesep + if self.naming_contexts: + if isinstance(self.naming_contexts, SEQUENCE_TYPES): + r += (' Naming contexts: ' + linesep + linesep.join([' ' + str(s) for s in self.naming_contexts])) if self.naming_contexts else '' + else: + r += (' Naming contexts: ' + str(self.naming_contexts)) + r += linesep + if self.alt_servers: + if isinstance(self.alt_servers, SEQUENCE_TYPES): + r += (' Alternative servers: ' + linesep + linesep.join([' ' + str(s) for s in self.alt_servers])) if self.alt_servers else '' + else: + r += (' Alternative servers: ' + str(self.alt_servers)) + r += linesep + if self.supported_controls: + if isinstance(self.supported_controls, SEQUENCE_TYPES): + r += (' Supported controls: ' + linesep + linesep.join([' ' + oid_to_string(s) for s in self.supported_controls])) if self.supported_controls else '' + else: + r += (' Supported controls: ' + str(self.supported_controls)) + r += linesep + if self.supported_extensions: + if isinstance(self.supported_extensions, SEQUENCE_TYPES): + r += (' Supported extensions: ' + linesep + linesep.join([' ' + oid_to_string(s) for s in self.supported_extensions])) if self.supported_extensions else '' + else: + r += (' Supported extensions: ' + str(self.supported_extensions)) + r += linesep + if self.supported_features: + if self.supported_features: + if isinstance(self.supported_features, SEQUENCE_TYPES): + r += (' Supported features: ' + linesep + linesep.join([' ' + oid_to_string(s) for s in self.supported_features])) if self.supported_features else '' + else: + r += (' Supported features: ' + str(self.supported_features)) + r += linesep + if self.supported_sasl_mechanisms: + if isinstance(self.supported_sasl_mechanisms, SEQUENCE_TYPES): + r += (' Supported SASL mechanisms: ' + linesep + ' ' + ', '.join([str(s) for s in self.supported_sasl_mechanisms])) if self.supported_sasl_mechanisms else '' + else: + r += (' Supported SASL mechanisms: ' + str(self.supported_sasl_mechanisms)) + r += linesep + if self.schema_entry: + if isinstance(self.schema_entry, SEQUENCE_TYPES): + r += (' Schema entry: ' + linesep + linesep.join([' ' + str(s) for s in self.schema_entry])) if self.schema_entry else '' + else: + r += (' Schema entry: ' + str(self.schema_entry)) + r += linesep + if self.vendor_name: + if isinstance(self.vendor_name, SEQUENCE_TYPES) and len(self.vendor_name) == 1: + r += 'Vendor name: ' + self.vendor_name[0] + else: + r += 'Vendor name: ' + str(self.vendor_name) + r += linesep + if self.vendor_version: + if isinstance(self.vendor_version, SEQUENCE_TYPES) and len(self.vendor_version) == 1: + r += 'Vendor version: ' + self.vendor_version[0] + else: + r += 'Vendor version: ' + str(self.vendor_version) + r += linesep + r += 'Other:' + linesep + for k, v in self.other.items(): + r += ' ' + str(k) + ': ' + linesep + try: + r += (linesep.join([' ' + str(s) for s in v])) if isinstance(v, SEQUENCE_TYPES) else str(v) + except UnicodeDecodeError: + r += (linesep.join([' ' + str(escape_bytes(s)) for s in v])) if isinstance(v, SEQUENCE_TYPES) else str(escape_bytes(v)) + r += linesep + return r + + +class SchemaInfo(BaseServerInfo): + """ + This class contains info about the ldap server schema read from an entry (default entry is DSE) + as defined in RFC4512. Unknown attributes are stored in the "other" dict + """ + + def __init__(self, schema_entry, attributes, raw_attributes): + BaseServerInfo.__init__(self, raw_attributes) + self.schema_entry = schema_entry + self.create_time_stamp = attributes.pop('createTimestamp', None) + self.modify_time_stamp = attributes.pop('modifyTimestamp', None) + self.attribute_types = AttributeTypeInfo.from_definition(attributes.pop('attributeTypes', [])) + self.object_classes = ObjectClassInfo.from_definition(attributes.pop('objectClasses', [])) + self.matching_rules = MatchingRuleInfo.from_definition(attributes.pop('matchingRules', [])) + self.matching_rule_uses = MatchingRuleUseInfo.from_definition(attributes.pop('matchingRuleUse', [])) + self.dit_content_rules = DitContentRuleInfo.from_definition(attributes.pop('dITContentRules', [])) + self.dit_structure_rules = DitStructureRuleInfo.from_definition(attributes.pop('dITStructureRules', [])) + self.name_forms = NameFormInfo.from_definition(attributes.pop('nameForms', [])) + self.ldap_syntaxes = LdapSyntaxInfo.from_definition(attributes.pop('ldapSyntaxes', [])) + self.other = attributes # remaining schema definition attributes not in RFC4512 + + # links attributes to class objects + if self.object_classes and self.attribute_types: + for object_class in self.object_classes: # CaseInsensitiveDict return keys while iterating + for attribute in self.object_classes[object_class].must_contain: + try: + self.attribute_types[attribute].mandatory_in.append(object_class) + except KeyError: + pass + for attribute in self.object_classes[object_class].may_contain: + try: + self.attribute_types[attribute].optional_in.append(object_class) + except KeyError: + pass + + def is_valid(self): + if self.object_classes or self.attribute_types or self.matching_rules or self.matching_rule_uses or self.dit_content_rules or self.dit_structure_rules or self.name_forms or self.ldap_syntaxes: + return True + return False + + def __repr__(self): + r = 'DSA Schema from: ' + self.schema_entry + r += linesep + if isinstance(self.attribute_types, SEQUENCE_TYPES): + r += (' Attribute types:' + linesep + ' ' + ', '.join([str(self.attribute_types[s]) for s in self.attribute_types])) if self.attribute_types else '' + else: + r += (' Attribute types:' + str(self.attribute_types)) + r += linesep + if isinstance(self.object_classes, SEQUENCE_TYPES): + r += (' Object classes:' + linesep + ' ' + ', '.join([str(self.object_classes[s]) for s in self.object_classes])) if self.object_classes else '' + else: + r += (' Object classes:' + str(self.object_classes)) + r += linesep + if isinstance(self.matching_rules, SEQUENCE_TYPES): + r += (' Matching rules:' + linesep + ' ' + ', '.join([str(self.matching_rules[s]) for s in self.matching_rules])) if self.matching_rules else '' + else: + r += (' Matching rules:' + str(self.matching_rules)) + r += linesep + if isinstance(self.matching_rule_uses, SEQUENCE_TYPES): + r += (' Matching rule uses:' + linesep + ' ' + ', '.join([str(self.matching_rule_uses[s]) for s in self.matching_rule_uses])) if self.matching_rule_uses else '' + else: + r += (' Matching rule uses:' + str(self.matching_rule_uses)) + r += linesep + if isinstance(self.dit_content_rules, SEQUENCE_TYPES): + r += (' DIT content rules:' + linesep + ' ' + ', '.join([str(self.dit_content_rules[s]) for s in self.dit_content_rules])) if self.dit_content_rules else '' + else: + r += (' DIT content rules:' + str(self.dit_content_rules)) + r += linesep + if isinstance(self.dit_structure_rules, SEQUENCE_TYPES): + r += (' DIT structure rules:' + linesep + ' ' + ', '.join([str(self.dit_structure_rules[s]) for s in self.dit_structure_rules])) if self.dit_structure_rules else '' + else: + r += (' DIT structure rules:' + str(self.dit_structure_rules)) + r += linesep + if isinstance(self.name_forms, SEQUENCE_TYPES): + r += (' Name forms:' + linesep + ' ' + ', '.join([str(self.name_forms[s]) for s in self.name_forms])) if self.name_forms else '' + else: + r += (' Name forms:' + str(self.name_forms)) + r += linesep + if isinstance(self.ldap_syntaxes, SEQUENCE_TYPES): + r += (' LDAP syntaxes:' + linesep + ' ' + ', '.join([str(self.ldap_syntaxes[s]) for s in self.ldap_syntaxes])) if self.ldap_syntaxes else '' + else: + r += (' LDAP syntaxes:' + str(self.ldap_syntaxes)) + r += linesep + r += 'Other:' + linesep + + for k, v in self.other.items(): + r += ' ' + str(k) + ': ' + linesep + try: + r += (linesep.join([' ' + str(s) for s in v])) if isinstance(v, SEQUENCE_TYPES) else str(v) + except UnicodeDecodeError: + r += (linesep.join([' ' + str(escape_bytes(s)) for s in v])) if isinstance(v, SEQUENCE_TYPES) else str(escape_bytes(v)) + r += linesep + return r + + +class BaseObjectInfo(object): + """ + Base class for objects defined in the schema as per RFC4512 + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + extensions=None, + experimental=None, + definition=None): + + self.oid = oid + self.name = name + self.description = description + self.obsolete = obsolete + self.extensions = extensions + self.experimental = experimental + self.raw_definition = definition + self._oid_info = None + + @property + def oid_info(self): + if self._oid_info is None and self.oid: + self._oid_info = Oids.get(self.oid, '') + + return self._oid_info if self._oid_info else None + + def __str__(self): + return self.__repr__() + + def __repr__(self): + r = ': ' + self.oid + r += ' [OBSOLETE]' if self.obsolete else '' + r += (linesep + ' Short name: ' + list_to_string(self.name)) if self.name else '' + r += (linesep + ' Description: ' + self.description) if self.description else '' + r += '<__desc__>' + r += (linesep + ' Extensions:' + linesep + linesep.join([' ' + s[0] + ': ' + list_to_string(s[1]) for s in self.extensions])) if self.extensions else '' + r += (linesep + ' Experimental:' + linesep + linesep.join([' ' + s[0] + ': ' + list_to_string(s[1]) for s in self.experimental])) if self.experimental else '' + r += (linesep + ' OidInfo: ' + str(self.oid_info)) if self.oid_info else '' + r += linesep + return r + + @classmethod + def from_definition(cls, definitions): + conf_case_insensitive_schema = get_config_parameter('CASE_INSENSITIVE_SCHEMA_NAMES') + conf_ignore_malformed_schema = get_config_parameter('IGNORE_MALFORMED_SCHEMA') + + ret_dict = CaseInsensitiveWithAliasDict() if conf_case_insensitive_schema else dict() + + if not definitions: + return ret_dict + + for object_definition in definitions: + object_definition = to_unicode(object_definition.strip(), from_server=True) + if object_definition[0] == '(' and object_definition[-1] == ')': + if cls is MatchingRuleInfo: + pattern = '| SYNTAX ' + elif cls is ObjectClassInfo: + pattern = '| SUP | ABSTRACT| STRUCTURAL| AUXILIARY| MUST | MAY ' + elif cls is AttributeTypeInfo: + pattern = '| SUP | EQUALITY | ORDERING | SUBSTR | SYNTAX | SINGLE-VALUE| COLLECTIVE| NO-USER-MODIFICATION| USAGE ' + elif cls is MatchingRuleUseInfo: + pattern = '| APPLIES ' + elif cls is LdapSyntaxInfo: + pattern = '' + elif cls is DitContentRuleInfo: + pattern = '| AUX | MUST | MAY | NOT ' + elif cls is DitStructureRuleInfo: + pattern = '| FORM | SUP ' + elif cls is NameFormInfo: + pattern = '| OC | MUST | MAY ' + else: + raise LDAPSchemaError('unknown schema definition class') + + splitted = re.split('( NAME | DESC | OBSOLETE| X-| E-' + pattern + ')', object_definition[1:-1]) + values = splitted[::2] + separators = splitted[1::2] + separators.insert(0, 'OID') + defs = list(zip(separators, values)) + object_def = cls() + for d in defs: + key = d[0].strip() + value = d[1].strip() + if key == 'OID': + object_def.oid = value + elif key == 'NAME': + object_def.name = quoted_string_to_list(value) + elif key == 'DESC': + object_def.description = value.strip("'") + elif key == 'OBSOLETE': + object_def.obsolete = True + elif key == 'SYNTAX': + object_def.syntax = oids_string_to_list(value) + elif key == 'SUP': + object_def.superior = oids_string_to_list(value) + elif key == 'ABSTRACT': + object_def.kind = CLASS_ABSTRACT + elif key == 'STRUCTURAL': + object_def.kind = CLASS_STRUCTURAL + elif key == 'AUXILIARY': + object_def.kind = CLASS_AUXILIARY + elif key == 'MUST': + object_def.must_contain = oids_string_to_list(value) + elif key == 'MAY': + object_def.may_contain = oids_string_to_list(value) + elif key == 'EQUALITY': + object_def.equality = oids_string_to_list(value) + elif key == 'ORDERING': + object_def.ordering = oids_string_to_list(value) + elif key == 'SUBSTR': + object_def.substr = oids_string_to_list(value) + elif key == 'SINGLE-VALUE': + object_def.single_value = True + elif key == 'COLLECTIVE': + object_def.collective = True + elif key == 'NO-USER-MODIFICATION': + object_def.no_user_modification = True + elif key == 'USAGE': + object_def.usage = attribute_usage_to_constant(value) + elif key == 'APPLIES': + object_def.apply_to = oids_string_to_list(value) + elif key == 'AUX': + object_def.auxiliary_classes = oids_string_to_list(value) + elif key == 'FORM': + object_def.name_form = oids_string_to_list(value) + elif key == 'OC': + object_def.object_class = oids_string_to_list(value) + elif key == 'NOT': + object_def.not_contains = oids_string_to_list(value) + elif key == 'X-': + if not object_def.extensions: + object_def.extensions = [] + object_def.extensions.append(extension_to_tuple('X-' + value)) + elif key == 'E-': + if not object_def.experimental: + object_def.experimental = [] + object_def.experimental.append(extension_to_tuple('E-' + value)) + else: + if not conf_ignore_malformed_schema: + raise LDAPSchemaError('malformed schema definition key:' + key + ' - use get_info=NONE in Server definition') + else: + return CaseInsensitiveWithAliasDict() if conf_case_insensitive_schema else dict() + object_def.raw_definition = object_definition + if hasattr(object_def, 'syntax') and object_def.syntax and len(object_def.syntax) == 1: + object_def.min_length = None + if object_def.syntax[0].endswith('}'): + try: + object_def.min_length = int(object_def.syntax[0][object_def.syntax[0].index('{') + 1:-1]) + object_def.syntax[0] = object_def.syntax[0][:object_def.syntax[0].index('{')] + except Exception: + pass + else: + object_def.min_length = None + object_def.syntax[0] = object_def.syntax[0].strip("'") + object_def.syntax = object_def.syntax[0] + if hasattr(object_def, 'name') and object_def.name: + if conf_case_insensitive_schema: + ret_dict[object_def.name[0]] = object_def + ret_dict.set_alias(object_def.name[0], object_def.name[1:] + [object_def.oid], ignore_duplicates=True) + else: + for name in object_def.name: + ret_dict[name] = object_def + else: + ret_dict[object_def.oid] = object_def + + else: + if not conf_ignore_malformed_schema: + raise LDAPSchemaError('malformed schema definition, use get_info=NONE in Server definition') + else: + return CaseInsensitiveWithAliasDict() if conf_case_insensitive_schema else dict() + return ret_dict + + +class MatchingRuleInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.3) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + syntax=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + self.syntax = syntax + + def __repr__(self): + r = (linesep + ' Syntax: ' + list_to_string(self.syntax)) if self.syntax else '' + return 'Matching rule' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) + + +class MatchingRuleUseInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.4) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + apply_to=None, + extensions=None, + experimental=None, + definition=None): + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + self.apply_to = apply_to + + def __repr__(self): + r = (linesep + ' Apply to: ' + list_to_string(self.apply_to)) if self.apply_to else '' + return 'Matching rule use' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) + + +class ObjectClassInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.1) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + superior=None, + kind=None, + must_contain=None, + may_contain=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + self.superior = superior + self.kind = kind + self.must_contain = must_contain or [] + self.may_contain = may_contain or [] + + def __repr__(self): + r = '' + r += (linesep + ' Type: ' + constant_to_class_kind(self.kind)) if self.kind else '' + r += (linesep + ' Superior: ' + list_to_string(self.superior)) if self.superior else '' + r += (linesep + ' Must contain attributes: ' + list_to_string(self.must_contain)) if self.must_contain else '' + r += (linesep + ' May contain attributes: ' + list_to_string(self.may_contain)) if self.may_contain else '' + return 'Object class' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) + + +class AttributeTypeInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.2) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + superior=None, + equality=None, + ordering=None, + substring=None, + syntax=None, + min_length=None, + single_value=False, + collective=False, + no_user_modification=False, + usage=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + self.superior = superior + self.equality = equality + self.ordering = ordering + self.substring = substring + self.syntax = syntax + self.min_length = min_length + self.single_value = single_value + self.collective = collective + self.no_user_modification = no_user_modification + self.usage = usage + self.mandatory_in = [] + self.optional_in = [] + + def __repr__(self): + r = '' + r += linesep + ' Single value: ' + str(self.single_value) + r += linesep + ' Collective: True' if self.collective else '' + r += (linesep + ' Superior: ' + list_to_string(self.superior)) if self.superior else '' + r += linesep + ' No user modification: True' if self.no_user_modification else '' + r += (linesep + ' Usage: ' + constant_to_attribute_usage(self.usage)) if self.usage else '' + r += (linesep + ' Equality rule: ' + list_to_string(self.equality)) if self.equality else '' + r += (linesep + ' Ordering rule: ' + list_to_string(self.ordering)) if self.ordering else '' + r += (linesep + ' Substring rule: ' + list_to_string(self.substring)) if self.substring else '' + r += (linesep + ' Syntax: ' + (self.syntax + (' [' + str(decode_syntax(self.syntax)))) + ']') if self.syntax else '' + r += (linesep + ' Minimum length: ' + str(self.min_length)) if isinstance(self.min_length, int) else '' + r += linesep + ' Mandatory in: ' + list_to_string(self.mandatory_in) if self.mandatory_in else '' + r += linesep + ' Optional in: ' + list_to_string(self.optional_in) if self.optional_in else '' + return 'Attribute type' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) + + +class LdapSyntaxInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.5) + """ + + def __init__(self, + oid=None, + description=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=None, + description=description, + obsolete=False, + extensions=extensions, + experimental=experimental, + definition=definition) + + def __repr__(self): + return 'LDAP syntax' + BaseObjectInfo.__repr__(self).replace('<__desc__>', '') + + +class DitContentRuleInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.6) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + auxiliary_classes=None, + must_contain=None, + may_contain=None, + not_contains=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + + self.auxiliary_classes = auxiliary_classes + self.must_contain = must_contain + self.may_contain = may_contain + self.not_contains = not_contains + + def __repr__(self): + r = (linesep + ' Auxiliary classes: ' + list_to_string(self.auxiliary_classes)) if self.auxiliary_classes else '' + r += (linesep + ' Must contain: ' + list_to_string(self.must_contain)) if self.must_contain else '' + r += (linesep + ' May contain: ' + list_to_string(self.may_contain)) if self.may_contain else '' + r += (linesep + ' Not contains: ' + list_to_string(self.not_contains)) if self.not_contains else '' + return 'DIT content rule' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) + + +class DitStructureRuleInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.7.1) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + name_form=None, + superior=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + self.superior = superior + self.name_form = name_form + + def __repr__(self): + r = (linesep + ' Superior rules: ' + list_to_string(self.superior)) if self.superior else '' + r += (linesep + ' Name form: ' + list_to_string(self.name_form)) if self.name_form else '' + return 'DIT content rule' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) + + +class NameFormInfo(BaseObjectInfo): + """ + As per RFC 4512 (4.1.7.2) + """ + + def __init__(self, + oid=None, + name=None, + description=None, + obsolete=False, + object_class=None, + must_contain=None, + may_contain=None, + extensions=None, + experimental=None, + definition=None): + + BaseObjectInfo.__init__(self, + oid=oid, + name=name, + description=description, + obsolete=obsolete, + extensions=extensions, + experimental=experimental, + definition=definition) + self.object_class = object_class + self.must_contain = must_contain + self.may_contain = may_contain + + def __repr__(self): + r = (linesep + ' Object class: ' + list_to_string(self.object_class)) if self.object_class else '' + r += (linesep + ' Must contain: ' + list_to_string(self.must_contain)) if self.must_contain else '' + r += (linesep + ' May contain: ' + list_to_string(self.may_contain)) if self.may_contain else '' + return 'DIT content rule' + BaseObjectInfo.__repr__(self).replace('<__desc__>', r) diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4527.py b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4527.py new file mode 100644 index 0000000000000000000000000000000000000000..6213daaf67411bac36a941431b080e78dff4b4a4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/rfc4527.py @@ -0,0 +1,57 @@ +""" +""" + +# Created on 2016.12.23 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import NO_ATTRIBUTES, ALL_ATTRIBUTES, STRING_TYPES +from ..operation.search import build_attribute_selection +from .controls import build_control + + +def _read_control(oid, attributes, criticality=False): + if not attributes: + attributes = [NO_ATTRIBUTES] + elif attributes == ALL_ATTRIBUTES: + attributes = [ALL_ATTRIBUTES] + + if isinstance(attributes, STRING_TYPES): + attributes = [attributes] + value = build_attribute_selection(attributes, None) + return build_control(oid, criticality, value) + + +def pre_read_control(attributes, criticality=False): + """Create a pre-read control for a request. + When passed as a control to the controls parameter of an operation, it will + return the value in `Connection.result` before the operation took place. + """ + return _read_control('1.3.6.1.1.13.1', attributes, criticality) + + +def post_read_control(attributes, criticality=False): + """Create a post-read control for a request. + When passed as a control to the controls parameter of an operation, it will + return the value in `Connection.result` after the operation took place. + """ + return _read_control('1.3.6.1.1.13.2', attributes, criticality) + diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__init__.py b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42020dc5c79ea72cf00505f668e0c7fbec9ec753 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/digestMd5.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/digestMd5.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdc5519a6647e78bcff7231a8e0d07d0e5b42d19 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/digestMd5.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/external.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/external.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..635e537adfee538222a61abd472157dae2d786fb Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/external.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/kerberos.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/kerberos.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a64d5e255f542089f0f321f8e2827bc2238516c Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/kerberos.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/plain.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/plain.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bebe58b7d0e4edca20ca9ecfd3a1f4933c836c40 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/plain.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/sasl.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/sasl.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..549fce724158728e5a619baac3fee785ea9740c4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/__pycache__/sasl.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/digestMd5.py b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/digestMd5.py new file mode 100644 index 0000000000000000000000000000000000000000..9fa4ae82cee8c60ef5a656cfc18f502f59c33bad --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/digestMd5.py @@ -0,0 +1,159 @@ +""" +""" + +# Created on 2014.01.04 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from binascii import hexlify +import hashlib +import hmac + +from ... import SEQUENCE_TYPES +from ...protocol.sasl.sasl import abort_sasl_negotiation, send_sasl_negotiation, random_hex_string + + +STATE_KEY = 0 +STATE_VALUE = 1 + + +def md5_h(value): + if not isinstance(value, bytes): + value = value.encode() + + return hashlib.md5(value).digest() + + +def md5_kd(k, s): + if not isinstance(k, bytes): + k = k.encode() + + if not isinstance(s, bytes): + s = s.encode() + + return md5_h(k + b':' + s) + + +def md5_hex(value): + if not isinstance(value, bytes): + value = value.encode() + + return hexlify(value) + + +def md5_hmac(k, s): + if not isinstance(k, bytes): + k = k.encode() + + if not isinstance(s, bytes): + s = s.encode() + + return hmac.new(k, s, digestmod=hashlib.md5).hexdigest() + + +def sasl_digest_md5(connection, controls): + # sasl_credential must be a tuple made up of the following elements: (realm, user, password, authorization_id) or (realm, user, password, authorization_id, enable_signing) + # if realm is None will be used the realm received from the server, if available + if not isinstance(connection.sasl_credentials, SEQUENCE_TYPES) or not len(connection.sasl_credentials) in (4, 5): + return None + + # step One of RFC2831 + result = send_sasl_negotiation(connection, controls, None) + if 'saslCreds' in result and result['saslCreds'] is not None: + server_directives = decode_directives(result['saslCreds']) + else: + return None + + if 'realm' not in server_directives or 'nonce' not in server_directives or 'algorithm' not in server_directives: # mandatory directives, as per RFC2831 + abort_sasl_negotiation(connection, controls) + return None + + # step Two of RFC2831 + charset = server_directives['charset'] if 'charset' in server_directives and server_directives['charset'].lower() == 'utf-8' else 'iso8859-1' + user = connection.sasl_credentials[1].encode(charset) + realm = (connection.sasl_credentials[0] if connection.sasl_credentials[0] else (server_directives['realm'] if 'realm' in server_directives else '')).encode(charset) + password = connection.sasl_credentials[2].encode(charset) + authz_id = connection.sasl_credentials[3].encode(charset) if connection.sasl_credentials[3] else b'' + nonce = server_directives['nonce'].encode(charset) + cnonce = random_hex_string(16).encode(charset) + uri = b'ldap/' + connection.server.host.encode(charset) + qop = b'auth' + if len(connection.sasl_credentials) == 5 and connection.sasl_credentials[4] == 'sign' and not connection.server.ssl: + qop = b'auth-int' + connection._digest_md5_sec_num = 0 + + digest_response = b'username="' + user + b'",' + digest_response += b'realm="' + realm + b'",' + digest_response += (b'authzid="' + authz_id + b'",') if authz_id else b'' + digest_response += b'nonce="' + nonce + b'",' + digest_response += b'cnonce="' + cnonce + b'",' + digest_response += b'digest-uri="' + uri + b'",' + digest_response += b'qop=' + qop + b',' + digest_response += b'nc=00000001' + b',' + if charset == 'utf-8': + digest_response += b'charset="utf-8",' + + a0 = md5_h(b':'.join([user, realm, password])) + a1 = b':'.join([a0, nonce, cnonce, authz_id]) if authz_id else b':'.join([a0, nonce, cnonce]) + a2 = b'AUTHENTICATE:' + uri + (b':00000000000000000000000000000000' if qop in [b'auth-int', b'auth-conf'] else b'') + + if qop == b'auth-int': + connection._digest_md5_kis = md5_h(md5_h(a1) + b"Digest session key to server-to-client signing key magic constant") + connection._digest_md5_kic = md5_h(md5_h(a1) + b"Digest session key to client-to-server signing key magic constant") + + digest_response += b'response="' + md5_hex(md5_kd(md5_hex(md5_h(a1)), b':'.join([nonce, b'00000001', cnonce, qop, md5_hex(md5_h(a2))]))) + b'"' + + result = send_sasl_negotiation(connection, controls, digest_response) + return result + + +def decode_directives(directives_string): + """ + converts directives to dict, unquote values + """ + + # old_directives = dict((attr[0], attr[1].strip('"')) for attr in [line.split('=') for line in directives_string.split(',')]) + state = STATE_KEY + tmp_buffer = '' + quoting = False + key = '' + directives = dict() + for c in directives_string.decode('utf-8'): + if state == STATE_KEY and c == '=': + key = tmp_buffer + tmp_buffer = '' + state = STATE_VALUE + elif state == STATE_VALUE and c == '"' and not quoting and not tmp_buffer: + quoting = True + elif state == STATE_VALUE and c == '"' and quoting: + quoting = False + elif state == STATE_VALUE and c == ',' and not quoting: + directives[key] = tmp_buffer + tmp_buffer = '' + key = '' + state = STATE_KEY + else: + tmp_buffer += c + + if key and tmp_buffer: + directives[key] = tmp_buffer + + return directives diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/external.py b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/external.py new file mode 100644 index 0000000000000000000000000000000000000000..7bb8bc1cae8ea01ed8144a2aabf2c1abe4b30008 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/external.py @@ -0,0 +1,32 @@ +""" +""" + +# Created on 2014.01.04 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ...protocol.sasl.sasl import send_sasl_negotiation + + +def sasl_external(connection, controls): + result = send_sasl_negotiation(connection, controls, connection.sasl_credentials) + + return result diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/kerberos.py b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/kerberos.py new file mode 100644 index 0000000000000000000000000000000000000000..05ce363b5537aba05be2090bcd11b72c2d29c524 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/kerberos.py @@ -0,0 +1,302 @@ +""" +""" + +# Created on 2015.04.08 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +# original code by Hugh Cole-Baker, modified by Peter Foley, modified again by Azaria Zornberg +# it needs the gssapi package +import base64 +import socket + +from ...core.exceptions import LDAPPackageUnavailableError, LDAPCommunicationError +from ...core.rdns import ReverseDnsSetting, get_hostname_by_addr, is_ip_addr + +posix_gssapi_unavailable = True +try: + # noinspection PyPackageRequirements,PyUnresolvedReferences + import gssapi + from gssapi.raw import ChannelBindings + posix_gssapi_unavailable = False +except ImportError: + pass + +windows_gssapi_unavailable = True +# only attempt to import winkerberos if gssapi is unavailable +if posix_gssapi_unavailable: + try: + import winkerberos + windows_gssapi_unavailable = False + except ImportError: + raise LDAPPackageUnavailableError('package gssapi (or winkerberos) missing') + +from .sasl import send_sasl_negotiation, abort_sasl_negotiation + + +NO_SECURITY_LAYER = 1 +INTEGRITY_PROTECTION = 2 +CONFIDENTIALITY_PROTECTION = 4 + + +def get_channel_bindings(ssl_socket): + try: + server_certificate = ssl_socket.getpeercert(True) + except: + # it is not SSL socket + return None + try: + from cryptography import x509 + from cryptography.hazmat.backends import default_backend + from cryptography.hazmat.primitives import hashes + except ImportError: + raise LDAPPackageUnavailableError('package cryptography missing') + cert = x509.load_der_x509_certificate(server_certificate, default_backend()) + hash_algorithm = cert.signature_hash_algorithm + # According to https://tools.ietf.org/html/rfc5929#section-4.1, we have to convert the the hash function for md5 and sha1 + if hash_algorithm.name in ('md5', 'sha1'): + digest = hashes.Hash(hashes.SHA256(), default_backend()) + else: + digest = hashes.Hash(hash_algorithm, default_backend()) + digest.update(server_certificate) + application_data = b'tls-server-end-point:' + digest.finalize() + # posix gssapi and windows winkerberos use different channel bindings classes + if not posix_gssapi_unavailable: + return ChannelBindings(application_data=application_data) + else: + return winkerberos.channelBindings(application_data=application_data) + + +def sasl_gssapi(connection, controls): + """ + Performs a bind using the Kerberos v5 ("GSSAPI") SASL mechanism + from RFC 4752. Does not support any security layers, only authentication! + + sasl_credentials can be empty or a tuple with one or two elements. + The first element determines which service principal to request a ticket for and can be one of the following: + + - None or False, to use the hostname from the Server object + - True to perform a reverse DNS lookup to retrieve the canonical hostname for the hosts IP address + - A string containing the hostname + + The optional second element is what authorization ID to request. + + - If omitted or None, the authentication ID is used as the authorization ID + - If a string, the authorization ID to use. Should start with "dn:" or "user:". + + The optional third element is a raw gssapi credentials structure which can be used over + the implicit use of a krb ccache. + """ + if not posix_gssapi_unavailable: + return _posix_sasl_gssapi(connection, controls) + else: + return _windows_sasl_gssapi(connection, controls) + + +def _common_determine_target_name(connection): + """ Common logic for determining our target name for kerberos negotiation, regardless of whether we are using + gssapi on a posix system or winkerberos on windows. + Returns a string in the form "ldap@" + a target hostname. + The hostname can either be user specified, come from the connection, or resolved using reverse DNS based + on parameters set in sasl_credentials. + The default if no sasl_credentials are specified is to use the host in the connection server object. + """ + # if we don't have any sasl_credentials specified, or the first entry is False (which is the legacy equivalent + # to ReverseDnsSetting.OFF that has value 0) then our gssapi name is just + if (not connection.sasl_credentials or len(connection.sasl_credentials) == 0 + or not connection.sasl_credentials[0]): + return 'ldap@' + connection.server.host + # older code will still be using a boolean True for the equivalent of + # ReverseDnsSetting.REQUIRE_RESOLVE_ALL_ADDRESSES + if connection.sasl_credentials[0] is True: + hostname = get_hostname_by_addr(connection.socket.getpeername()[0]) + target_name = 'ldap@' + hostname + elif connection.sasl_credentials[0] in ReverseDnsSetting.SUPPORTED_VALUES: + rdns_setting = connection.sasl_credentials[0] + # if the rdns_setting is OFF then we won't enter any branch here and will leave hostname as server host, + # so we'll just use the server host, whatever it is + peer_ip = connection.socket.getpeername()[0] + hostname = connection.server.host + if rdns_setting == ReverseDnsSetting.REQUIRE_RESOLVE_ALL_ADDRESSES: + # resolve our peer ip and use it as our target name + hostname = get_hostname_by_addr(peer_ip) + elif rdns_setting == ReverseDnsSetting.REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: + # resolve our peer ip (if the server host is an ip address) and use it as our target name + if is_ip_addr(hostname): + hostname = get_hostname_by_addr(peer_ip) + elif rdns_setting == ReverseDnsSetting.OPTIONAL_RESOLVE_ALL_ADDRESSES: + # try to resolve our peer ip in dns and if we can, use it as our target name. + # if not, just use the server host + resolved_hostname = get_hostname_by_addr(peer_ip, success_required=False) + if resolved_hostname is not None: + hostname = resolved_hostname + elif rdns_setting == ReverseDnsSetting.OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: + # try to resolve our peer ip in dns if our server host is an ip. if we can, use it as our target + # name. if not, just use the server host + if is_ip_addr(hostname): + resolved_hostname = get_hostname_by_addr(peer_ip, success_required=False) + if resolved_hostname is not None: + hostname = resolved_hostname + # construct our target name + target_name = 'ldap@' + hostname + else: # string hostname directly provided + target_name = 'ldap@' + connection.sasl_credentials[0] + return target_name + + +def _common_determine_authz_id_and_creds(connection): + """ Given our connection, figure out the authorization id (i.e. the kerberos principal) and kerberos credentials + being used for our SASL bind. + On posix systems, we can actively negotiate with raw credentials and receive a kerberos client ticket during our + SASL bind. So credentials can be specified. + However, on windows systems, winkerberos expects to use the credentials cached by the system because windows + machines are generally domain-joined. So no initiation is supported, as the TGT must already be valid prior + to beginning the SASL bind, and the windows system credentials will be used as needed with that. + """ + authz_id = b"" + creds = None + # the default value for credentials is only something we should instantiate on systems using the + # posix GSSAPI, as windows kerberos expects that a tgt already exists (i.e. the machine is domain-joined) + # and does not support initiation from raw credentials + if not posix_gssapi_unavailable: + creds = gssapi.Credentials(name=gssapi.Name(connection.user), usage='initiate', store=connection.cred_store) if connection.user else None + if connection.sasl_credentials: + if len(connection.sasl_credentials) >= 2 and connection.sasl_credentials[1]: + authz_id = connection.sasl_credentials[1].encode("utf-8") + if len(connection.sasl_credentials) >= 3 and connection.sasl_credentials[2]: + if posix_gssapi_unavailable: + raise LDAPPackageUnavailableError('The winkerberos package does not support specifying raw credentials' + 'to initiate GSSAPI Kerberos communication. A ticket granting ticket ' + 'must have already been obtained for the user before beginning a ' + 'SASL bind.') + raw_creds = connection.sasl_credentials[2] + creds = gssapi.Credentials(base=raw_creds, usage='initiate', store=connection.cred_store) + return authz_id, creds + + +def _common_process_end_token_get_security_layers(negotiated_token): + """ Process the response we got at the end of our SASL negotiation wherein the server told us what + minimum security layers we need, and return a bytearray for the client security layers we want. + This function throws an error on a malformed token from the server. + The ldap3 library does not support security layers, and only supports authentication with kerberos, + so an error will be thrown for any tokens that indicate a security layer requirement. + """ + if len(negotiated_token) != 4: + raise LDAPCommunicationError("Incorrect response from server") + + server_security_layers = negotiated_token[0] + if not isinstance(server_security_layers, int): + server_security_layers = ord(server_security_layers) + if server_security_layers in (0, NO_SECURITY_LAYER): + if negotiated_token[1:] != '\x00\x00\x00': + raise LDAPCommunicationError("Server max buffer size must be 0 if no security layer") + if not (server_security_layers & NO_SECURITY_LAYER): + raise LDAPCommunicationError("Server requires a security layer, but this is not implemented") + + # this is here to encourage anyone implementing client security layers to do it + # for both windows and posix + client_security_layers = bytearray([NO_SECURITY_LAYER, 0, 0, 0]) + return client_security_layers + +def _posix_sasl_gssapi(connection, controls): + """ Performs a bind using the Kerberos v5 ("GSSAPI") SASL mechanism + from RFC 4752 using the gssapi package that works natively on most + posix operating systems. + """ + target_name = gssapi.Name(_common_determine_target_name(connection), gssapi.NameType.hostbased_service) + authz_id, creds = _common_determine_authz_id_and_creds(connection) + + ctx = gssapi.SecurityContext(name=target_name, mech=gssapi.MechType.kerberos, creds=creds, + channel_bindings=get_channel_bindings(connection.socket)) + in_token = None + try: + while True: + out_token = ctx.step(in_token) + if out_token is None: + out_token = '' + result = send_sasl_negotiation(connection, controls, out_token) + in_token = result['saslCreds'] + try: + # This raised an exception in gssapi<1.1.2 if the context was + # incomplete, but was fixed in + # https://github.com/pythongssapi/python-gssapi/pull/70 + if ctx.complete: + break + except gssapi.exceptions.MissingContextError: + pass + + unwrapped_token = ctx.unwrap(in_token) + client_security_layers = _common_process_end_token_get_security_layers(unwrapped_token.message) + out_token = ctx.wrap(bytes(client_security_layers)+authz_id, False) + return send_sasl_negotiation(connection, controls, out_token.message) + except (gssapi.exceptions.GSSError, LDAPCommunicationError): + abort_sasl_negotiation(connection, controls) + raise + + +def _windows_sasl_gssapi(connection, controls): + """ Performs a bind using the Kerberos v5 ("GSSAPI") SASL mechanism + from RFC 4752 using the winkerberos package that works natively on most + windows operating systems. + """ + target_name = _common_determine_target_name(connection) + # initiation happens before beginning the SASL bind when using windows kerberos + authz_id, _ = _common_determine_authz_id_and_creds(connection) + gssflags = ( + winkerberos.GSS_C_MUTUAL_FLAG | + winkerberos.GSS_C_SEQUENCE_FLAG | + winkerberos.GSS_C_INTEG_FLAG | + winkerberos.GSS_C_CONF_FLAG + ) + _, ctx = winkerberos.authGSSClientInit(target_name, gssflags=gssflags) + + in_token = b'' + try: + negotiation_complete = False + while not negotiation_complete: + # GSSAPI is a "client goes first" SASL mechanism. Send the first "response" to the server and + # recieve its first challenge. + # Despite this, we can get channel binding, which includes CBTs for windows environments computed from + # the peer certificate, before starting. + status = winkerberos.authGSSClientStep(ctx, base64.b64encode(in_token).decode('utf-8'), + channel_bindings=get_channel_bindings(connection.socket)) + # figure out if we're done with our sasl negotiation + negotiation_complete = (status == winkerberos.AUTH_GSS_COMPLETE) + out_token = winkerberos.authGSSClientResponse(ctx) or '' + out_token_bytes = base64.b64decode(out_token) + result = send_sasl_negotiation(connection, controls, out_token_bytes) + in_token = result['saslCreds'] or b'' + + winkerberos.authGSSClientUnwrap( ctx,base64.b64encode(in_token).decode('utf-8')) + negotiated_token = '' + if winkerberos.authGSSClientResponse(ctx): + negotiated_token = base64.standard_b64decode(winkerberos.authGSSClientResponse(ctx)) + client_security_layers = _common_process_end_token_get_security_layers(negotiated_token) + # manually construct a message indicating use of authorization-only layer + # see winkerberos example: https://github.com/mongodb/winkerberos/blob/master/test/test_winkerberos.py + authz_only_msg = base64.b64encode(bytes(client_security_layers) + authz_id).decode('utf-8') + winkerberos.authGSSClientWrap(ctx, authz_only_msg) + out_token = winkerberos.authGSSClientResponse(ctx) or '' + + return send_sasl_negotiation(connection, controls, base64.b64decode(out_token)) + except (winkerberos.GSSError, LDAPCommunicationError): + abort_sasl_negotiation(connection, controls) + raise diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/plain.py b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/plain.py new file mode 100644 index 0000000000000000000000000000000000000000..f7f745691a17c855759eaa6d1a27b92ce0957319 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/plain.py @@ -0,0 +1,70 @@ +""" +""" + +# Created on 2014.01.04 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +# payload for PLAIN mechanism +# message = [authzid] UTF8NUL authcid UTF8NUL passwd +# authcid = 1*SAFE ; MUST accept up to 255 octets +# authzid = 1*SAFE ; MUST accept up to 255 octets +# passwd = 1*SAFE ; MUST accept up to 255 octets +# UTF8NUL = %x00 ; UTF-8 encoded NUL character +# +# SAFE = UTF1 / UTF2 / UTF3 / UTF4 +# ;; any UTF-8 encoded Unicode character except NUL +# +# UTF1 = %x01-7F ;; except NUL +# UTF2 = %xC2-DF UTF0 +# UTF3 = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) / +# %xED %x80-9F UTF0 / %xEE-EF 2(UTF0) +# UTF4 = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) / +# %xF4 %x80-8F 2(UTF0) +# UTF0 = %x80-BF + +from ...protocol.sasl.sasl import send_sasl_negotiation +from .sasl import sasl_prep +from ...utils.conv import to_raw, to_unicode + + +def sasl_plain(connection, controls): + authzid = connection.sasl_credentials[0] + authcid = connection.sasl_credentials[1] + passwd = connection.sasl_credentials[2] + + payload = b'' + if authzid: + payload += to_raw(sasl_prep(to_unicode(authzid))) + + payload += b'\0' + + if authcid: + payload += to_raw(sasl_prep(to_unicode(authcid))) + + payload += b'\0' + + if passwd: + payload += to_raw(sasl_prep(to_unicode(passwd))) + + result = send_sasl_negotiation(connection, controls, payload) + + return result diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/sasl.py b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/sasl.py new file mode 100644 index 0000000000000000000000000000000000000000..30fe0e9fbc43b2809f7065ad1395b820689aa124 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/sasl/sasl.py @@ -0,0 +1,171 @@ +""" +""" + +# Created on 2013.09.11 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import stringprep +from unicodedata import ucd_3_2_0 as unicode32 +from os import urandom +from binascii import hexlify + +from ... import SASL +from ...core.results import RESULT_AUTH_METHOD_NOT_SUPPORTED +from ...core.exceptions import LDAPSASLPrepError, LDAPPasswordIsMandatoryError + + +def sasl_prep(data): + """ + implement SASLPrep profile as per RFC4013: + it defines the "SASLprep" profile of the "stringprep" algorithm [StringPrep]. + The profile is designed for use in Simple Authentication and Security + Layer ([SASL]) mechanisms, such as [PLAIN], [CRAM-MD5], and + [DIGEST-MD5]. It may be applicable where simple user names and + passwords are used. This profile is not intended for use in + preparing identity strings that are not simple user names (e.g., + email addresses, domain names, distinguished names), or where + identity or password strings that are not character data, or require + different handling (e.g., case folding). + """ + + # mapping + prepared_data = '' + for c in data: + if stringprep.in_table_c12(c): + # non-ASCII space characters [StringPrep, C.1.2] that can be mapped to SPACE (U+0020) + prepared_data += ' ' + elif stringprep.in_table_b1(c): + # the "commonly mapped to nothing" characters [StringPrep, B.1] that can be mapped to nothing. + pass + else: + prepared_data += c + + # normalizing + # This profile specifies using Unicode normalization form KC + # The repertoire is Unicode 3.2 as per RFC 4013 (2) + + prepared_data = unicode32.normalize('NFKC', prepared_data) + + if not prepared_data: + raise LDAPSASLPrepError('SASLprep error: unable to normalize string') + + # prohibit + for c in prepared_data: + if stringprep.in_table_c12(c): + # Non-ASCII space characters [StringPrep, C.1.2] + raise LDAPSASLPrepError('SASLprep error: non-ASCII space character present') + elif stringprep.in_table_c21(c): + # ASCII control characters [StringPrep, C.2.1] + raise LDAPSASLPrepError('SASLprep error: ASCII control character present') + elif stringprep.in_table_c22(c): + # Non-ASCII control characters [StringPrep, C.2.2] + raise LDAPSASLPrepError('SASLprep error: non-ASCII control character present') + elif stringprep.in_table_c3(c): + # Private Use characters [StringPrep, C.3] + raise LDAPSASLPrepError('SASLprep error: private character present') + elif stringprep.in_table_c4(c): + # Non-character code points [StringPrep, C.4] + raise LDAPSASLPrepError('SASLprep error: non-character code point present') + elif stringprep.in_table_c5(c): + # Surrogate code points [StringPrep, C.5] + raise LDAPSASLPrepError('SASLprep error: surrogate code point present') + elif stringprep.in_table_c6(c): + # Inappropriate for plain text characters [StringPrep, C.6] + raise LDAPSASLPrepError('SASLprep error: inappropriate for plain text character present') + elif stringprep.in_table_c7(c): + # Inappropriate for canonical representation characters [StringPrep, C.7] + raise LDAPSASLPrepError('SASLprep error: inappropriate for canonical representation character present') + elif stringprep.in_table_c8(c): + # Change display properties or deprecated characters [StringPrep, C.8] + raise LDAPSASLPrepError('SASLprep error: change display property or deprecated character present') + elif stringprep.in_table_c9(c): + # Tagging characters [StringPrep, C.9] + raise LDAPSASLPrepError('SASLprep error: tagging character present') + + # check bidi + # if a string contains any r_and_al_cat character, the string MUST NOT contain any l_cat character. + flag_r_and_al_cat = False + flag_l_cat = False + for c in prepared_data: + if stringprep.in_table_d1(c): + flag_r_and_al_cat = True + elif stringprep.in_table_d2(c): + flag_l_cat = True + + if flag_r_and_al_cat and flag_l_cat: + raise LDAPSASLPrepError('SASLprep error: string cannot contain (R or AL) and L bidirectional chars') + + # If a string contains any r_and_al_cat character, a r_and_al_cat character MUST be the first character of the string + # and a r_and_al_cat character MUST be the last character of the string. + if flag_r_and_al_cat and not stringprep.in_table_d1(prepared_data[0]) and not stringprep.in_table_d2(prepared_data[-1]): + raise LDAPSASLPrepError('r_and_al_cat character present, must be first and last character of the string') + + return prepared_data + + +def validate_simple_password(password, accept_empty=False): + """ + validate simple password as per RFC4013 using sasl_prep: + """ + + if accept_empty and not password: + return password + elif not password: + raise LDAPPasswordIsMandatoryError("simple password can't be empty") + + if not isinstance(password, bytes): # bytes are returned raw, as per RFC (4.2) + password = sasl_prep(password) + if not isinstance(password, bytes): + password = password.encode('utf-8') + + return password + + +def abort_sasl_negotiation(connection, controls): + from ...operation.bind import bind_operation + + request = bind_operation(connection.version, SASL, None, None, '', None) + response = connection.post_send_single_response(connection.send('bindRequest', request, controls)) + if connection.strategy.sync: + result = connection.result + else: + result = connection.get_response(response)[0][0] + + return True if result['result'] == RESULT_AUTH_METHOD_NOT_SUPPORTED else False + + +def send_sasl_negotiation(connection, controls, payload): + from ...operation.bind import bind_operation + + request = bind_operation(connection.version, SASL, None, None, connection.sasl_mechanism, payload) + response = connection.post_send_single_response(connection.send('bindRequest', request, controls)) + + if connection.strategy.sync: + result = connection.result + else: + _, result = connection.get_response(response) + + return result + + +def random_hex_string(size): + return str(hexlify(urandom(size)).decode('ascii')) # str fix for Python 2 diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/__init__.py b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b24950ab1fbb98c40a6de84c7d8deca2484c1d4e Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/ad2012R2.py b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/ad2012R2.py new file mode 100644 index 0000000000000000000000000000000000000000..1712613a1e3d5f82b15b0c1886f1c295f0b808c9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/ad2012R2.py @@ -0,0 +1,2232 @@ +""" +""" + +# Created on 2014.10.21 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +ad_2012_r2_schema = """ +{ + "raw": { + "attributeTypes": [ + "( 1.2.840.113556.1.4.149 NAME 'attributeSecurityGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1703 NAME 'msDS-FilterContainers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.655 NAME 'legacyExchangeDN' SYNTAX '1.2.840.113556.1.4.905' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.21 NAME 'cOMProgID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2147 NAME 'msDNS-PropagationTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.301 NAME 'msSFU30KeyAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.686 NAME 'domainID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.23 NAME 'msDFSR-ReplicationGroupGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.818 NAME 'productCode' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.18 NAME 'oncRpcNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.221 NAME 'sAMAccountName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.375 NAME 'systemFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.814 NAME 'msiScript' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.880 NAME 'fRSTimeLastCommand' SYNTAX '1.3.6.1.4.1.1466.115.121.1.53' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1850 NAME 'msDS-TopQuotaUsage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2052 NAME 'msDS-OIDToGroupLinkBl' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.965 NAME 'mSMQSiteName' SYNTAX '1.2.840.113556.1.4.905' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1373 NAME 'mS-SQL-Clustered' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.624 NAME 'ipsecOwnersReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1353 NAME 'localizationDisplayId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1637 NAME 'msWMI-StringValidValues' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2103 NAME 'msDS-MembersOfResourcePropertyList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.480 NAME 'defaultGroup' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.55 NAME 'dBCSPwd' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1330 NAME 'pKICriticalExtensions' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.93 NAME 'pwdProperties' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1840 NAME 'msDS-ObjectReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.7 NAME 'subRefs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.845 NAME 'msiScriptName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2242 NAME 'msDS-MaximumRegistrationInactivityPeriod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.7 NAME 'photo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.713 NAME 'optionsLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.942 NAME 'mSMQVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2138 NAME 'msDNS-NSEC3Iterations' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.471 NAME 'trustParent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1237 NAME 'mSMQRoutingService' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.649 NAME 'primaryInternationalISDNNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1627 NAME 'msWMI-ID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2006 NAME 'msTSExpireDate4' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2003 NAME 'msTSExpireDate3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2000 NAME 'msTSExpireDate2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.12 NAME 'documentTitle' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113549.1.9.8 NAME 'unstructuredAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.18.1.340 NAME 'msSFU30Domains' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.2069 NAME 'msDS-EnabledFeatureBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.3.6.1.1.1.1.6 NAME 'shadowMin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1412 NAME 'primaryGroupToken' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.358 NAME 'netbootInitialization' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2136 NAME 'msDNS-NSEC3HashAlgorithm' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.1 NAME 'instanceType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.846 NAME 'msiScriptSize' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.20 NAME 'msDFSR-RdcMinFileSizeInKb' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.663 NAME 'partialAttributeDeletionList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2078 NAME 'msTSSecondaryDesktopBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1995 NAME 'msTSManagingLS' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.371 NAME 'rIDAllocationPool' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.677 NAME 'replTopologyStayOfExecution' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.3 NAME 'replPropertyMetaData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2036 NAME 'msDFS-Commentv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.329 NAME 'versionNumberLo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.234 NAME 'printEndTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1673 NAME 'msPKI-OID-User-Notice' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.684 NAME 'certificateAuthorityObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.290 NAME 'printNumberUp' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1625 NAME 'msWMI-ClassDefinition' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1784 NAME 'msDS-LogonTimeSyncInterval' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1910 NAME 'unixUserPassword' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.129 NAME 'trustAuthIncoming' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1319 NAME 'aCSNonReservedTokenSize' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1628 NAME 'msWMI-IntDefault' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1249 NAME 'proxiedObjectName' SYNTAX '1.2.840.113556.1.4.903' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2173 NAME 'msKds-PublicKeyLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 2.5.4.27 NAME 'destinationIndicator' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.2187 NAME 'msDS-ValueTypeReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.897 NAME 'aCSMaxAggregatePeakRatePerUser' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1335 NAME 'pKIEnrollmentAccess' SYNTAX '1.2.840.113556.1.4.907' )", + "( 1.2.840.113556.1.4.1708 NAME 'msDS-ReplValueMetaData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1690 NAME 'adminMultiselectPropertyPages' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.35 NAME 'userPassword' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2200 NAME 'msDS-GroupMSAMembership' SYNTAX '1.2.840.113556.1.4.907' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.500 NAME 'fRSServiceCommand' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.16.840.1.113730.3.1.1 NAME 'carLicense' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2038 NAME 'msDFS-TargetListv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.27 NAME 'msDFSR-DeletedSizeInMb' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1648 NAME 'msWMI-TargetPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.5 NAME 'shadowLastChange' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1793 NAME 'msDS-NonMembers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.3.6.1.1.1.1.22 NAME 'macAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.265 NAME 'notes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2274 NAME 'msDS-CloudIssuerPublicCertificates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1982 NAME 'msTSMaxConnectionTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1959 NAME 'msDS-isGC' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1424 NAME 'msCOM-PartitionSetLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.516 NAME 'serverReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1977 NAME 'msTSHomeDirectory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1369 NAME 'mS-SQL-ServiceAccount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.530 NAME 'nonSecurityMember' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.506 NAME 'objectCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1386 NAME 'mS-SQL-GPSLongitude' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1437 NAME 'msPKI-Supersede-Templates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1707 NAME 'msDS-ReplAttributeMetaData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.652 NAME 'assistant' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1644 NAME 'msWMI-SourceOrganization' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1443 NAME 'msDS-Site-Affinity' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.286 NAME 'printRateUnit' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1444 NAME 'msDS-Preferred-GC-Site' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.589 NAME 'meetingBandwidth' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.1706 NAME 'msDS-NCReplOutboundNeighbors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1709 NAME 'msDS-HasInstantiatedNCs' SYNTAX '1.2.840.113556.1.4.903' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.79 NAME 'minPwdLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1952 NAME 'ms-net-ieee-80211-GP-PolicyData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.865 NAME 'pekList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 2.5.4.26 NAME 'registeredAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2179 NAME 'msKds-CreateTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2149 NAME 'msDNS-NSEC3CurrentSalt' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1815 NAME 'msDS-TasksForAzRoleBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2148 NAME 'msDNS-NSEC3UserSalt' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2197 NAME 'msDS-ManagedPasswordId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1407 NAME 'mS-SQL-ThirdParty' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.510 NAME 'serviceBindingInformation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1416 NAME 'mSMQSiteNameEx' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1426 NAME 'msCOM-UserPartitionSetLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1303 NAME 'tokenGroupsNoGCAcceptable' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.596 NAME 'msExchHouseIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2233 NAME 'msDS-cloudExtensionAttribute20' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.335 NAME 'currentLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.20 NAME 'homePhone' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1441 NAME 'msDS-Cached-Membership' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.14 NAME 'msDFSR-Schedule' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.622 NAME 'ipsecDataType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.645 NAME 'userCert' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.367 NAME 'rpcNsCodeset' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.223 NAME 'serverName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.950 NAME 'mSMQServices' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2250 NAME 'msDS-DeviceOSVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.332 NAME 'birthLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1440 NAME 'msDs-Schema-Extensions' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1348 NAME 'gPCMachineExtensionNames' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1833 NAME 'msDS-ExternalKey' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.858 NAME 'netbootTools' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1717 NAME 'msDS-AdditionalDnsHostName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.770 NAME 'aCSEnableACSService' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.170 NAME 'systemOnly' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.32 NAME 'domainPolicyObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.766 NAME 'aCSAllocableRSVPBandwidth' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.9 NAME 'helpData32' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1805 NAME 'msDS-AzGenerateAudits' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.276 NAME 'driverVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1317 NAME 'aCSMinimumDelayVariation' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.302 NAME 'sAMAccountType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.610 NAME 'employeeNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.30 NAME 'attributeID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.3.6.1.4.1.1466.101.119.3 NAME 'entryTTL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1843 NAME 'msDRM-IdentityCertificate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.6.13.3.103 NAME 'msDFSR-ComputerReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1989 NAME 'msTSWorkDirectory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1674 NAME 'msPKI-Certificate-Application-Policy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.716 NAME 'mscopeId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.514 NAME 'physicalLocationObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.570 NAME 'meetingProtocol' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.2.370 NAME 'objectClassCategory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.15 NAME 'msDFSR-Keywords' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.812 NAME 'createWizardExt' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.61 NAME 'lockOutObservationWindow' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.750 NAME 'groupType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1459 NAME 'msDS-Behavior-Version' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.937 NAME 'mSMQSignKey' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.913 NAME 'allowedAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.120 NAME 'uSNChanged' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.340 NAME 'rightsGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.277 NAME 'otherHomePhone' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1309 NAME 'mSMQInterval2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1439 NAME 'msPKI-Certificate-Policy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1308 NAME 'mSMQInterval1' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1383 NAME 'mS-SQL-ConnectionURL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2176 NAME 'msKds-Version' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.859 NAME 'netbootLocallyInstalledOSes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.967 NAME 'mSMQSignCertificatesMig' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2232 NAME 'msDS-cloudExtensionAttribute19' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2231 NAME 'msDS-cloudExtensionAttribute18' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2230 NAME 'msDS-cloudExtensionAttribute17' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2229 NAME 'msDS-cloudExtensionAttribute16' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2228 NAME 'msDS-cloudExtensionAttribute15' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2227 NAME 'msDS-cloudExtensionAttribute14' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2226 NAME 'msDS-cloudExtensionAttribute13' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2225 NAME 'msDS-cloudExtensionAttribute12' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2142 NAME 'msDNS-SecureDelegationPollingPeriod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2224 NAME 'msDS-cloudExtensionAttribute11' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.718 NAME 'dhcpProperties' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2223 NAME 'msDS-cloudExtensionAttribute10' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.157 NAME 'serverRole' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1394 NAME 'mS-SQL-AllowAnonymousSubscription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.563 NAME 'shellPropertyPages' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1315 NAME 'aCSMinimumPolicedSize' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.273 NAME 'printStatus' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.644 NAME 'showInAddressBook' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.626 NAME 'ipsecISAKMPReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1925 NAME 'msDS-hasFullReplicaNCs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.940 NAME 'mSMQCSPName' SYNTAX '1.2.840.113556.1.4.905' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.30 NAME 'msDFSR-MinDurationCacheInMin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.243 NAME 'printColor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2193 NAME 'msDS-TDOIngressBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.3.6.1.1.1.1.1 NAME 'gidNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1993 NAME 'msTSExpireDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE )", + "( 2.5.4.2 NAME 'knowledgeInformation' SYNTAX '1.2.840.113556.1.4.905' )", + "( 1.2.840.113556.1.4.908 NAME 'extendedClassInfo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.953 NAME 'mSMQSiteID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2040 NAME 'msDFS-LinkSecurityDescriptorv2' SYNTAX '1.2.840.113556.1.4.907' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1343 NAME 'dSUIAdminNotification' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1700 NAME 'msTAPI-ConferenceBlob' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.486 NAME 'fRSWorkingPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.62 NAME 'scriptPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1810 NAME 'msDS-TasksForAzTask' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.6.13.3.31 NAME 'msDFSR-MaxAgeInCacheInMin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.19 NAME 'cOMClassID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.108 NAME 'remoteSourceType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.704 NAME 'dhcpServers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.876 NAME 'fRSMemberReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2261 NAME 'msDS-DeviceLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.82 NAME 'moniker' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.289 NAME 'printMediaReady' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.3.6.1.1.1.1.17 NAME 'ipProtocolNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1209 NAME 'shortServerName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.910 NAME 'fromEntry' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.636 NAME 'privilegeAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2025 NAME 'msDS-IsUserCachableAtRodc' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1715 NAME 'msDS-SPNSuffixes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.562 NAME 'adminPropertyPages' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 0.9.2342.19200300.100.1.10 NAME 'manager' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 2.5.4.49 NAME 'distinguishedName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1356 NAME 'validAccesses' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2053 NAME 'msImaging-PSPIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.459 NAME 'machineWidePolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1403 NAME 'mS-SQL-AllowKnownPullSubscription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.283 NAME 'assetNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.885 NAME 'terminalServer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2012 NAME 'msDS-MinimumPasswordAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.7 NAME 'msDFSR-ConflictPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1831 NAME 'msDS-ByteArray' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.135 NAME 'trustAuthOutgoing' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2258 NAME 'msDS-RegisteredOwner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.608 NAME 'queryPolicyBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.109 NAME 'replicaSource' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2296 NAME 'msDS-AssignedAuthNPolicyBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.402 NAME 'helpData16' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.232 NAME 'defaultPriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1388 NAME 'mS-SQL-Version' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.364 NAME 'operatingSystemVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2284 NAME 'msDS-ServiceTGTLifetime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1460 NAME 'msDS-User-Account-Control-Computed' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.75 NAME 'maxRenewAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.285 NAME 'printRate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.911 NAME 'allowedChildClasses' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.615 NAME 'personalTitle' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1225 NAME 'mSMQPrevSiteGates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.2131 NAME 'msDNS-SignWithNSEC3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2007 NAME 'msTSLicenseVersion4' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.13 NAME 'documentVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 0.9.2342.19200300.100.1.3 NAME 'mail' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2004 NAME 'msTSLicenseVersion3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2001 NAME 'msTSLicenseVersion2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.507 NAME 'volumeCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.137 NAME 'uNCName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2022 NAME 'msDS-ResultantPSO' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.168 NAME 'modifiedCount' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1809 NAME 'msDS-OperationsForAzTaskBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.328 NAME 'versionNumberHi' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2099 NAME 'msDS-ClaimAttributeSource' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.754 NAME 'rpcNsEntryFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.778 NAME 'aCSDSBMDeadTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.917 NAME 'mSMQQueueType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.326 NAME 'packageName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.422 NAME 'domainPolicyReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2241 NAME 'msDS-RegistrationQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.3 NAME 'msDFSR-RootPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1817 NAME 'msDS-AzApplicationVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.436 NAME 'directReports' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.240 NAME 'printOrientationsSupported' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.574 NAME 'meetingLanguage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.43 NAME 'fRSVersionGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 2.5.4.30 NAME 'supportedApplicationContext' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.26 NAME 'rDNAttID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1409 NAME 'masteredBy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.752 NAME 'userSharedFolderOther' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2199 NAME 'msDS-ManagedPasswordInterval' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1932 NAME 'msDS-IsFullReplicaFor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.22 NAME 'msDFSR-RootFence' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.789 NAME 'transportDLLName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.499 NAME 'contextMenu' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.202 NAME 'auditingPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.11 NAME 'msDFSR-TombstoneExpiryInMin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1364 NAME 'mS-SQL-RegisteredOwner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.8 NAME 'userClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.775 NAME 'aCSMaxSizeOfRSVPLogFile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.144 NAME 'operatorCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1238 NAME 'mSMQDsService' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1984 NAME 'msTSReconnectionAction' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2286 NAME 'msDS-AssignedAuthNPolicySiloBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2180 NAME 'msImaging-ThumbprintHash' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.68 NAME 'machineArchitecture' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.1311 NAME 'printDuplexSupported' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1795 NAME 'msDS-AzDomainTimeout' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1992 NAME 'msTSProperty02' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.583 NAME 'meetingURL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1991 NAME 'msTSProperty01' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.635 NAME 'privilegeValue' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2100 NAME 'msDS-ClaimTypeAppliesToClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.115 NAME 'invocationId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2288 NAME 'msDS-AuthNPolicySiloMembersBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1681 NAME 'msWMI-intFlags4' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1680 NAME 'msWMI-intFlags3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1679 NAME 'msWMI-intFlags2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1678 NAME 'msWMI-intFlags1' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.100 NAME 'msDFSR-MemberReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.100 NAME 'priorValue' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1379 NAME 'mS-SQL-Vines' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1377 NAME 'mS-SQL-TCPIP' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2172 NAME 'msKds-SecretAgreementParam' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2222 NAME 'msDS-cloudExtensionAttribute9' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2221 NAME 'msDS-cloudExtensionAttribute8' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2220 NAME 'msDS-cloudExtensionAttribute7' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2219 NAME 'msDS-cloudExtensionAttribute6' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2218 NAME 'msDS-cloudExtensionAttribute5' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.661 NAME 'isDefunct' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2217 NAME 'msDS-cloudExtensionAttribute4' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.653 NAME 'managedBy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2216 NAME 'msDS-cloudExtensionAttribute3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2215 NAME 'msDS-cloudExtensionAttribute2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2214 NAME 'msDS-cloudExtensionAttribute1' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.588 NAME 'meetingEndTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.53' )", + "( 1.2.840.113556.1.4.498 NAME 'creationWizard' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1915 NAME 'msRADIUS-FramedIpv6Prefix' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.12 NAME 'msDFSR-FileFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.24 NAME 'x121Address' SYNTAX '1.3.6.1.4.1.1466.115.121.1.36' )", + "( 1.2.840.113556.1.4.637 NAME 'privilegeHolder' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.214 NAME 'originalDisplayTableMSDOS' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.211 NAME 'schedule' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1228 NAME 'mSMQDsServices' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.64 NAME 'logonHours' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.883 NAME 'msRRASVendorAttributeEntry' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.58 NAME 'localeID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.97 NAME 'preferredOU' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2033 NAME 'msDFS-NamespaceIdentityGUIDv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1334 NAME 'pKIDefaultCSPs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1411 NAME 'ms-DS-MachineAccountQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.891 NAME 'gPLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.617 NAME 'homePostalAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.320 NAME 'implementedCategories' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.19 NAME 'uSNCreated' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.651 NAME 'otherMailbox' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.18.1.345 NAME 'msSFU30NSMAPFieldPosition' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.618 NAME 'wellKnownObjects' SYNTAX '1.2.840.113556.1.4.903' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2160 NAME 'msDS-ClaimIsSingleValued' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.1 NAME 'msDFSR-Version' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.874 NAME 'fRSFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1713 NAME 'MSMQ-SecuredSource' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.825 NAME 'enrollmentProviders' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.666 NAME 'syncAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.665 NAME 'syncMembership' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.48 NAME 'keywords' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2169 NAME 'msKds-KDFAlgorithmID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.370 NAME 'rIDAvailablePool' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.214 NAME 'nextLevelStore' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1145 NAME 'msRADIUSCallbackNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.303 NAME 'msSFU30IntraFieldSeparator' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.346 NAME 'desktopProfile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.20 NAME 'cOMInterfaceID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.279 NAME 'printMinXExtent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1213 NAME 'assocNTAccount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.671 NAME 'msiFileList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2032 NAME 'msDFS-GenerationGUIDv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2279 NAME 'msDS-UserTGTLifetime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.10 NAME 'msDFSR-ReplicationGroupType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1790 NAME 'msDS-PerUserTrustTombstonesQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1124 NAME 'msNPCallingStationID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 0.9.2342.19200300.100.1.2 NAME 'textEncodedORAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.487 NAME 'fRSRootPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1807 NAME 'msDS-MembersForAzRoleBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1823 NAME 'msieee80211-ID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.791 NAME 'transportType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.674 NAME 'rootTrust' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1641 NAME 'msWMI-PropertyName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.25 NAME 'mayContain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' )", + "( 1.2.840.113556.1.4.1438 NAME 'msPKI-RA-Policies' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.769 NAME 'aCSEventLogLevel' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.0 NAME 'uidNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.9 NAME 'shadowInactive' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.945 NAME 'mSMQSiteGates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 2.5.4.25 NAME 'internationalISDNNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.36' )", + "( 1.2.840.113556.1.4.1979 NAME 'msTSAllowLogon' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.274 NAME 'printSpooling' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.242 NAME 'printCollate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1345 NAME 'dSUIShellMaximum' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.693 NAME 'pendingCACertificates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2257 NAME 'msDS-DeviceObjectVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.852 NAME 'netbootCurrentClientCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.534 NAME 'fRSLevelLimit' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1685 NAME 'msWMI-Parm4' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1684 NAME 'msWMI-Parm3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1988 NAME 'msTSDefaultToMainPrinter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1913 NAME 'msRADIUS-FramedInterfaceId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.353 NAME 'displayNamePrintable' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1696 NAME 'lastLogonTimestamp' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1683 NAME 'msWMI-Parm2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.330 NAME 'lastUpdateSequence' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.696 NAME 'currentParentCA' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.689 NAME 'cRLObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1682 NAME 'msWMI-Parm1' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.22 NAME 'governsID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1632 NAME 'msWMI-Int8Default' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.169 NAME 'logonCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.772 NAME 'aCSPolicyName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.38 NAME 'authorityRevocationList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1212 NAME 'isEphemeral' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.324 NAME 'packageType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1435 NAME 'msPKI-Template-Minor-Revision' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2010 NAME 'msTSLSProperty02' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1961 NAME 'msDS-SiteName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2009 NAME 'msTSLSProperty01' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1336 NAME 'replInterval' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2066 NAME 'msDS-RequiredDomainBehaviorVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2185 NAME 'msDS-GeoCoordinatesLongitude' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2182 NAME 'msDS-AllowedToActOnBehalfOfOtherIdentity' SYNTAX '1.2.840.113556.1.4.907' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.3.6.1.1.1.1.11 NAME 'shadowFlag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.8 NAME 'msDFSR-ConflictSizeInMb' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.357 NAME 'nTMixedDomain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2191 NAME 'msDS-IngressClaimsTransformationPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1892 NAME 'msPKIRoamingTimeStamp' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2174 NAME 'msKds-PrivateKeyLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.324 NAME 'addressEntryDisplayTable' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.218 NAME 'applicationName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1318 NAME 'aCSNonReservedPeakRate' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2023 NAME 'msDS-PasswordSettingsPrecedence' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.99 NAME 'priorSetTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.914 NAME 'allowedAttributesEffective' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.271 NAME 'printOwner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1996 NAME 'msDS-UserPasswordExpiryTimeComputed' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.930 NAME 'mSMQServiceType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1780 NAME 'hideFromAB' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.578 NAME 'meetingContactInfo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2020 NAME 'msDS-PSOAppliesTo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1944 NAME 'msDS-PhoneticDepartment' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1792 NAME 'msDS-AzLDAPQuery' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.251 NAME 'cOMTreatAsClassId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.14 NAME 'builtinModifiedCount' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.7 NAME 'shadowMax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.325 NAME 'setupCommand' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1647 NAME 'msWMI-TargetObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.420 NAME 'publicKeyPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1714 NAME 'MSMQ-MulticastAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1677 NAME 'msWMI-Genus' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2281 NAME 'msDS-ComputerTGTLifetime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1671 NAME 'msPKI-OID-Attribute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.36 NAME 'dMDLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.810 NAME 'createDialog' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2140 NAME 'msDNS-DSRecordSetTTL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1358 NAME 'schemaInfo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1624 NAME 'msWMI-ChangeDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1975 NAME 'msDS-RevealedListBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1962 NAME 'msDS-PromotionSettings' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.229 NAME 'driverName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.378 NAME 'dnsAllowDynamic' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1246 NAME 'interSiteTopologyGenerator' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.817 NAME 'localizedDescription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2235 NAME 'msDS-ReplValueMetaDataExt' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1933 NAME 'msDS-IsDomainFor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2213 NAME 'msDS-RIDPoolAllocationEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.73 NAME 'lockoutThreshold' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.50 NAME 'lastContentIndexed' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.824 NAME 'signatureAlgorithms' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.860 NAME 'netbootServer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.40 NAME 'msDFSR-StagingCleanupTriggerInPercent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1695 NAME 'msMQ-Recipient-FormatName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1966 NAME 'msTPM-OwnerInformation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.156 NAME 'comment' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.650 NAME 'mhsORAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.929 NAME 'mSMQInRoutingServers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1787 NAME 'msDS-AllowedToDelegateTo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1389 NAME 'mS-SQL-Language' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.18 NAME 'msDFSR-ContentSetGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.8 NAME 'possSuperiors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' )", + "( 1.2.840.113556.1.4.912 NAME 'allowedChildClassesEffective' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2132 NAME 'msDNS-NSEC3OptOut' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.136 NAME 'trustType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1879 NAME 'msDS-SourceObjectDN' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.533 NAME 'fRSReplicaSetGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1434 NAME 'msPKI-Template-Schema-Version' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.241 NAME 'printMaxCopies' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.961 NAME 'mSMQSiteForeign' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' )", + "( 1.2.840.113556.1.4.1808 NAME 'msDS-OperationsForAzTask' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1242 NAME 'dNReferenceUpdate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 0.9.2342.19200300.100.1.5 NAME 'drink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1923 NAME 'msDS-KrbTgtLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1402 NAME 'mS-SQL-Publisher' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2018 NAME 'msDS-LockoutDuration' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.688 NAME 'cAWEBURL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.23 NAME 'bootParameter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.536 NAME 'fRSExtensions' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.233 NAME 'printStartTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1788 NAME 'msDS-PerUserTrustQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.159 NAME 'accountExpires' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.14 NAME 'nisNetgroupTriple' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1390 NAME 'mS-SQL-Description' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.224 NAME 'defaultSecurityDescriptor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113549.1.9.2 NAME 'unstructuredName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.695 NAME 'pendingParentCA' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1375 NAME 'mS-SQL-MultiProtocol' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2152 NAME 'msAuthz-LastEffectiveSecurityPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.56 NAME 'localPolicyFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1392 NAME 'mS-SQL-InformationDirectory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2159 NAME 'msDS-ClaimIsValueSpaceRestricted' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.708 NAME 'dhcpSites' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.717 NAME 'dhcpState' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.762 NAME 'aCSServiceType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.132 NAME 'trustDirection' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.312 NAME 'rpcNsObjectID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1395 NAME 'mS-SQL-Alias' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.18.2 NAME 'modifyTimeStamp' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2145 NAME 'msDNS-DNSKEYRecords' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.301 NAME 'wbemPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.0 NAME 'objectClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.21 NAME 'msDFSR-DfsPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1429 NAME 'msPKI-RA-Signature' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1699 NAME 'msTAPI-ProtocolId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2086 NAME 'msSPP-PhoneLicense' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.120 NAME 'schemaFlagsEx' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1945 NAME 'msDS-PhoneticCompanyName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.916 NAME 'canonicalName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.702 NAME 'dhcpObjName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2238 NAME 'msds-memberTransitive' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.133 NAME 'trustPartner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.927 NAME 'mSMQSites' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.867 NAME 'altSecurityIdentities' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.615 NAME 'shellContextMenu' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.866 NAME 'pekKeyChangeInterval' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2046 NAME 'addressBookRoots2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.27 NAME 'currentValue' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.166 NAME 'groupMembershipSAM' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1926 NAME 'msDS-NeverRevealGroup' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.6.13.3.28 NAME 'msDFSR-ReadOnly' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1314 NAME 'aCSMaximumSDUSize' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.457 NAME 'localPolicyReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1189 NAME 'msRASSavedCallbackNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1918 NAME 'msRADIUS-SavedFramedIpv6Route' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 2.5.21.2 NAME 'dITContentRules' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.895 NAME 'transportAddressAttribute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1418 NAME 'tokenGroupsGlobalAndUniversal' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.850 NAME 'netbootLimitClients' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 2.16.840.1.113730.3.1.2 NAME 'departmentNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.944 NAME 'mSMQSite2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.943 NAME 'mSMQSite1' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1664 NAME 'msDS-Replication-Notify-Subsequent-DSA-Delay' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.537 NAME 'dynamicLDAPServer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2249 NAME 'msDS-DeviceOSType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.35 NAME 'employeeID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2137 NAME 'msDNS-NSEC3RandomSaltLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2151 NAME 'msAuthz-ProposedSecurityPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.267 NAME 'uSNDSALastObjRemoved' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.963 NAME 'mSMQQueueJournalQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.607 NAME 'queryPolicyObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1978 NAME 'msTSHomeDrive' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.593 NAME 'msExchLabeledURI' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1329 NAME 'pKIMaxIssuingDepth' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2061 NAME 'msDS-EnabledFeature' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.278 NAME 'printMaxYExtent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.16 NAME 'codePage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1802 NAME 'msDS-AzBizRuleLanguage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.363 NAME 'operatingSystem' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.761 NAME 'aCSMaxDurationPerFlow' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.921 NAME 'mSMQJournalQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2106 NAME 'msSPP-CSVLKPartialProductKey' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1190 NAME 'msRASSavedFramedIPAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2171 NAME 'msKds-SecretAgreementAlgorithmID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.703 NAME 'dhcpObjDescription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.890 NAME 'uPNSuffixes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1720 NAME 'msDS-ReplicationEpoch' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.24 NAME 'bootFile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.614 NAME 'adminContextMenu' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.2.231 NAME 'oMSyntax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.8 NAME 'userAccountControl' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.621 NAME 'ipsecID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.511 NAME 'flatName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.784 NAME 'aCSIdentityName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.15 NAME 'msiScriptPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.125 NAME 'supplementalCredentials' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2287 NAME 'msDS-AuthNPolicySiloMembers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.199 NAME 'serviceInstanceVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1347 NAME 'sPNMappings' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.933 NAME 'mSMQComputerType' SYNTAX '1.2.840.113556.1.4.905' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.780 NAME 'aCSNonReservedTxLimit' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1227 NAME 'mSMQRoutingServices' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2074 NAME 'msTSPrimaryDesktopBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 2.5.18.1 NAME 'createTimeStamp' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.3.6.1.1.1.1.19 NAME 'ipHostNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1130 NAME 'msNPSavedCallingStationID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.700 NAME 'dhcpFlags' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.629 NAME 'ipsecFilterReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.40 NAME 'fromServer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.568 NAME 'meetingKeyword' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2178 NAME 'msKds-UseStartTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1321 NAME 'aCSNonReservedMinPolicedSize' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.246 NAME 'printLanguage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.2.54 NAME 'tombstoneLifetime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.765 NAME 'aCSPermissionBits' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.8 NAME 'shadowWarning' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1398 NAME 'mS-SQL-LastBackupDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2 NAME 'objectGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.146 NAME 'company' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1710 NAME 'msDS-AllowedDNSSuffixes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1841 NAME 'msDS-ObjectReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 2.5.4.8 NAME 'st' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.341 NAME 'msSFU30YpServers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 2.5.4.4 NAME 'sn' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.707 NAME 'dhcpRanges' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.282 NAME 'printMemory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.924 NAME 'mSMQPrivacyLevel' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.333 NAME 'oMTIndxGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.205 NAME 'pKTGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2251 NAME 'msDS-DevicePhysicalIDs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1410 NAME 'mS-DS-CreatorSID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.345 NAME 'groupPriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2030 NAME 'msDFS-SchemaMajorVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.513 NAME 'siteObjectBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.87 NAME 'nETBIOSName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2175 NAME 'msKds-RootKeyData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.24 NAME 'mustContain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' )", + "( 2.5.4.51 NAME 'houseIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.3.6.1.1.1.1.26 NAME 'nisMapName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1917 NAME 'msRADIUS-FramedIpv6Route' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.6.18.1.307 NAME 'msSFU30MasterServerName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.98 NAME 'primaryGroupID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1837 NAME 'msDs-masteredBy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.200 NAME 'controlAccessRights' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1158 NAME 'msRADIUSFramedRoute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.107 NAME 'remoteSource' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1971 NAME 'msDS-LastFailedInteractiveLogonTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1958 NAME 'msDS-AuthenticatedAtDC' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 2.5.4.5 NAME 'serialNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.509 NAME 'serviceClassName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2050 NAME 'msPKI-CredentialRoamingTokens' SYNTAX '1.2.840.113556.1.4.903' )", + "( 1.2.840.113556.1.4.2008 NAME 'msTSManagingLS4' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2005 NAME 'msTSManagingLS3' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2002 NAME 'msTSManagingLS2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1363 NAME 'mS-SQL-Name' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.41 NAME 'mobile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2108 NAME 'msTPM-OwnerInformationTemp' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.886 NAME 'purportedSearch' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1384 NAME 'mS-SQL-PublicationURL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2271 NAME 'msDS-CloudIsManaged' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.41 NAME 'generatedConnection' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.864 NAME 'netbootSCPBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1396 NAME 'mS-SQL-Size' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.115 NAME 'rpcNsInterfaceID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.56 NAME 'documentPublisher' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.619 NAME 'dNSHostName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2273 NAME 'msDS-CloudAnchor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.939 NAME 'mSMQNameStyle' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.882 NAME 'fRSVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.777 NAME 'aCSDSBMRefresh' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.80 NAME 'minTicketAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1310 NAME 'mSMQSiteGatesMig' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.83 NAME 'monikerDisplayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2150 NAME 'msAuthz-EffectiveSecurityPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.15 NAME 'hasPartialReplicaNCs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2194 NAME 'msDS-TDOEgressBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1811 NAME 'msDS-TasksForAzTaskBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1987 NAME 'msTSConnectPrinterDrives' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1953 NAME 'ms-net-ieee-80211-GP-PolicyReserved' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1313 NAME 'aCSMaxTokenBucketPerFlow' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.579 NAME 'meetingOwner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.12 NAME 'badPwdCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.39 NAME 'forceLogoff' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.326 NAME 'perRecipDialogDisplayTable' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.51 NAME 'lastLogoff' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1796 NAME 'msDS-AzScriptEngineCacheMax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2269 NAME 'msDS-IssuerPublicCertificates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1639 NAME 'msWMI-Name' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.4 NAME 'replUpToDateVector' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.470 NAME 'trustAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.515 NAME 'serverReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.308 NAME 'msSFU30OrderNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1669 NAME 'msDS-Approx-Immed-Subordinates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2141 NAME 'msDNS-SignatureInceptionOffset' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2186 NAME 'msDS-IsPossibleValuesPresent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.78 NAME 'minPwdAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.339 NAME 'msSFU30NisDomain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1701 NAME 'msTAPI-IpAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.249 NAME 'cOMCLSID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.774 NAME 'aCSMaxNoOfLogFiles' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.494 NAME 'siteServer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.849 NAME 'netbootAllowNewClients' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1931 NAME 'msDS-KrbTgtLinkBl' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1789 NAME 'msDS-AllUsersTrustQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2156 NAME 'msAuthz-MemberRulesInCentralAccessPolicyBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.721 NAME 'ipPhone' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.613 NAME 'employeeType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1634 NAME 'msWMI-Int8Min' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2248 NAME 'msDS-IsEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1950 NAME 'msDS-AzGenericData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1646 NAME 'msWMI-TargetNameSpace' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.816 NAME 'fileExtPriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.712 NAME 'optionDescription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.321 NAME 'requiredCategories' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.255 NAME 'addressSyntax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2110 NAME 'msTPM-TpmInformationForComputerBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1785 NAME 'msIIS-FTPRoot' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.518 NAME 'defaultHidingValue' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.946 NAME 'mSMQCost' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 2.5.4.44 NAME 'generationQualifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.681 NAME 'indexedScopes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.3.6.1.1.1.1.27 NAME 'nisMapEntry' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1865 NAME 'msDS-PrincipalName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2073 NAME 'msTSPrimaryDesktop' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.697 NAME 'cACertificateDN' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1354 NAME 'scopeFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1942 NAME 'msDS-PhoneticFirstName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.21 NAME 'ipNetmaskNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1997 NAME 'msDS-HABSeniorityIndex' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1307 NAME 'accountNameHistory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.893 NAME 'gPCFunctionalityVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2203 NAME 'msDS-parentdistname' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1687 NAME 'extraColumns' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1834 NAME 'msDS-ExternalStore' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1983 NAME 'msTSMaxIdleTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.687 NAME 'cAConnect' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2048 NAME 'templateRoots2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.154 NAME 'serverState' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1224 NAME 'parentGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.926 NAME 'mSMQTransactional' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.925 NAME 'mSMQOwnerID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2035 NAME 'msDFS-Ttlv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.150 NAME 'adminCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2041 NAME 'msDFS-LinkIdentityGUIDv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.490 NAME 'fRSDSPoll' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2015 NAME 'msDS-PasswordComplexityEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.105 NAME 'remoteServerName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.531 NAME 'nonSecurityMemberBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 2.16.840.1.113730.3.1.36 NAME 'thumbnailLogo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.586 NAME 'meetingRecurrence' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1643 NAME 'msWMI-QueryLanguage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.962 NAME 'mSMQQueueQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1415 NAME 'mSMQLabelEx' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.16 NAME 'nCName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2170 NAME 'msKds-KDFParam' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.567 NAME 'meetingDescription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1704 NAME 'msDS-NCReplCursors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.23 NAME 'facsimileTelephoneNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.851 NAME 'netbootMaxClients' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2016 NAME 'msDS-PasswordReversibleEncryptionEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1635 NAME 'msWMI-Int8ValidValues' SYNTAX '1.2.840.113556.1.4.906' )", + "( 1.2.840.113556.1.4.719 NAME 'dhcpMaxKey' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1835 NAME 'msDS-Integer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.1208 NAME 'aNR' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1393 NAME 'mS-SQL-Database' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.42 NAME 'pager' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1914 NAME 'msRADIUS-SavedFramedInterfaceId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1391 NAME 'mS-SQL-Type' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.566 NAME 'meetingName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.123 NAME 'serviceClassInfo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.26 NAME 'creationTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.103 NAME 'proxyLifetime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.660 NAME 'treeName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.892 NAME 'gPOptions' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.923 NAME 'mSMQAuthenticate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1432 NAME 'msPKI-Certificate-Name-Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.206 NAME 'pKT' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.287 NAME 'printNetworkAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1431 NAME 'msPKI-Private-Key-Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1346 NAME 'templateRoots' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.657 NAME 'serviceDNSName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.868 NAME 'isCriticalSystemObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.301 NAME 'garbageCollPeriod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.288 NAME 'printMACAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1304 NAME 'sDRightsEffective' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.380 NAME 'extendedCharsAllowed' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.86 NAME 'userWorkstations' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1360 NAME 'mS-DS-ConsistencyGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1712 NAME 'msPKI-OIDLocalizedName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.21.5 NAME 'attributeTypes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.31 NAME 'fRSReplicaSetType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.341 NAME 'appliesTo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.11 NAME 'ou' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2293 NAME 'msDS-ServiceAuthNPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.346 NAME 'msSFU30PosixMember' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1973 NAME 'msDS-FailedInteractiveLogonCountAtLastSuccessfulLogon' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 2.5.18.10 NAME 'subSchemaSubEntry' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2262 NAME 'msDS-ApproximateLastLogonTimeStamp' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.222 NAME 'location' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.854 NAME 'netbootAnswerOnlyValidClients' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1949 NAME 'msDS-AzObjectGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 2.16.840.1.113730.3.1.34 NAME 'middleName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2158 NAME 'msDS-ClaimSourceType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.706 NAME 'dhcpMask' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.2109 NAME 'msTPM-TpmInformationForComputer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.623 NAME 'ipsecData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1171 NAME 'msRADIUSServiceType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.705 NAME 'dhcpSubnets' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.1999 NAME 'msFVE-KeyPackage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1968 NAME 'msDS-NC-RO-Replica-Locations-BL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.36 NAME 'enabledConnection' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.472 NAME 'domainCrossRef' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.52 NAME 'lastLogon' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.28 NAME 'dnsRoot' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.966 NAME 'mSMQDigestsMig' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.878 NAME 'fRSPrimaryMember' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1848 NAME 'msDS-QuotaEffective' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1372 NAME 'mS-SQL-UnicodeSortOrder' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.639 NAME 'isMemberOfPartialAttributeSet' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.464 NAME 'wWWHomePage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.711 NAME 'superScopeDescription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1631 NAME 'msWMI-IntValidValues' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.3.6.1.1.1.1.2 NAME 'gecos' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2063 NAME 'msDS-OptionalFeatureFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.38 NAME 'flags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1240 NAME 'netbootSIFFile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.690 NAME 'cAUsages' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 0.9.2342.19200300.100.1.60 NAME 'jpegPhoto' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2104 NAME 'msDS-MembersOfResourcePropertyListBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.66 NAME 'lSACreationTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.709 NAME 'dhcpReservations' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.4.934 NAME 'mSMQForeign' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1963 NAME 'msDS-SupportedEncryptionTypes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1401 NAME 'mS-SQL-Keywords' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1705 NAME 'msDS-NCReplInboundNeighbors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2128 NAME 'msDNS-KeymasterZones' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.19 NAME 'physicalDeliveryOfficeName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1694 NAME 'gPCWQLFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.195 NAME 'systemPossSuperiors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.218 NAME 'oMObjectClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1226 NAME 'mSMQDependentClientServices' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1676 NAME 'msWMI-Class' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2144 NAME 'msDNS-SigningKeys' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1630 NAME 'msWMI-IntMin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.372 NAME 'rIDPreviousAllocationPool' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.848 NAME 'appSchemaVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1981 NAME 'msTSMaxDisconnectionTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1645 NAME 'msWMI-TargetClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.535 NAME 'fRSRootSecurity' SYNTAX '1.2.840.113556.1.4.907' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1423 NAME 'msCOM-PartitionLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 2.5.4.32 NAME 'owner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1436 NAME 'msPKI-Cert-Template-OID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1716 NAME 'msDS-IntId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.18.1.309 NAME 'msSFU30Name' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.254 NAME 'cOMTypelibId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1642 NAME 'msWMI-Query' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.155 NAME 'uASCompat' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1623 NAME 'msWMI-Author' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1964 NAME 'msFVE-RecoveryPassword' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.37 NAME 'associatedDomain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.764 NAME 'aCSPriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.571 NAME 'meetingType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.783 NAME 'defaultObjectCategory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1365 NAME 'mS-SQL-Contact' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.679 NAME 'creator' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.39 NAME 'certificateRevocationList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.699 NAME 'dhcpType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1405 NAME 'mS-SQL-AllowQueuedUpdatingSubscription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.915 NAME 'possibleInferiors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2234 NAME 'netbootDUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.899 NAME 'aCSEnableRSVPAccounting' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.881 NAME 'fRSTimeLastConfigChange' SYNTAX '1.3.6.1.4.1.1466.115.121.1.53' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.55 NAME 'audio' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.3.6.1.1.1.1.13 NAME 'memberNisNetgroup' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.898 NAME 'aCSNonReservedTxSize' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.771 NAME 'servicePrincipalName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1820 NAME 'msDS-HasDomainNCs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2070 NAME 'msTSEndpointData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.620 NAME 'ipsecName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.458 NAME 'qualityOfService' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2042 NAME 'msDFS-ShortNameLinkPathv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1688 NAME 'msDS-Security-Group-Extra-Classes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2289 NAME 'msDS-UserAuthNPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.83 NAME 'repsTo' SYNTAX 'OctetString' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1357 NAME 'dSCorePropagationData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2196 NAME 'msDS-ManagedPassword' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.647 NAME 'otherMobile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2072 NAME 'msTSEndpointPlugin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.749 NAME 'url' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.701 NAME 'dhcpIdentification' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.122 NAME 'serviceClassID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2058 NAME 'isRecycled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.213 NAME 'defaultClassStore' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.2252 NAME 'msDS-DeviceID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.633 NAME 'policyReplicationFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1693 NAME 'msFRS-Hub-Member' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1328 NAME 'pKIKeyUsage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.459 NAME 'networkAddress' SYNTAX '1.2.840.113556.1.4.905' )", + "( 1.2.840.113556.1.4.1786 NAME 'msIIS-FTPDir' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.806 NAME 'treatAsLeaf' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.820 NAME 'bridgeheadServerListBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 0.9.2342.19200300.100.1.15 NAME 'documentLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.13.3.36 NAME 'msDFSR-OnDemandExclusionDirectoryFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.640 NAME 'partialAttributeSet' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.853 NAME 'netbootAnswerRequests' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 2.5.4.31 NAME 'member' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.6.18.1.323 NAME 'msSFU30Aliases' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1243 NAME 'mSMQQueueNameExt' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1370 NAME 'mS-SQL-CharacterSet' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1622 NAME 'msDS-Entry-Time-To-Die' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.460 NAME 'lDAPDisplayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2031 NAME 'msDFS-SchemaMinorVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.12 NAME 'memberUid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1800 NAME 'msDS-AzOperationID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.322 NAME 'categoryId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.60 NAME 'lockoutDuration' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.870 NAME 'frsComputerReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 2.5.4.45 NAME 'x500uniqueIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.6.13.3.25 NAME 'msDFSR-Priority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.847 NAME 'installUiLevel' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1842 NAME 'msDs-MaxValues' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 2.5.4.9 NAME 'street' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2154 NAME 'msAuthz-CentralAccessPolicyID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.3 NAME 'whenChanged' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1433 NAME 'msPKI-Minimal-Key-Size' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1814 NAME 'msDS-TasksForAzRole' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.6.13.3.101 NAME 'msDFSR-ComputerReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.580 NAME 'meetingIP' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.539 NAME 'initialAuthIncoming' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.356 NAME 'foreignIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.565 NAME 'meetingID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.3 NAME 'unixHomeDirectory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1721 NAME 'msDS-UpdateScript' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.557 NAME 'parentCA' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.255 NAME 'vendor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.900 NAME 'aCSRSVPAccountFilesLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1320 NAME 'aCSNonReservedMaxSDUSize' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1956 NAME 'ms-net-ieee-8023-GP-PolicyReserved' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.773 NAME 'aCSRSVPLogFilesLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.951 NAME 'mSMQQMID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.102 NAME 'memberOf' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1397 NAME 'mS-SQL-CreationDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2146 NAME 'msDNS-ParentHasSecureDelegation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.113 NAME 'rpcNsBindings' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.656 NAME 'userPrincipalName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1934 NAME 'msDS-IsPartialReplicaFor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2167 NAME 'msDS-PrimaryComputer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.469 NAME 'USNIntersite' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1803 NAME 'msDS-AzLastImportedBizRulePath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2295 NAME 'msDS-AssignedAuthNPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 2.5.4.13 NAME 'description' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.922 NAME 'mSMQLabel' SYNTAX '1.2.840.113556.1.4.905' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2024 NAME 'msDS-NcType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2011 NAME 'msDS-MaximumPasswordAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2291 NAME 'msDS-ComputerAuthNPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1832 NAME 'msDS-DateTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' )", + "( 1.2.840.113556.1.2.281 NAME 'nTSecurityDescriptor' SYNTAX '1.2.840.113556.1.4.907' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.722 NAME 'otherIpPhone' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1368 NAME 'mS-SQL-Build' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.219 NAME 'iconPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1417 NAME 'mSMQComputerTypeEx' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.38 NAME 'associatedName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1986 NAME 'msTSConnectClientDrives' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2285 NAME 'msDS-AssignedAuthNPolicySilo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1638 NAME 'msWMI-Mof' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.314 NAME 'rpcNsTransferSyntax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1702 NAME 'msDS-TrustForestTrustInfo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.557 NAME 'Enabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.21 NAME 'subClassOf' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 0.9.2342.19200300.100.1.44 NAME 'uniqueIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1845 NAME 'msDS-QuotaAmount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1119 NAME 'msNPAllowDialin' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.33 NAME 'isSingleValued' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.782 NAME 'objectCategory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2177 NAME 'msKds-DomainID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2195 NAME 'msDS-AppliesToResourceTypes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.152 NAME 'groupAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.334 NAME 'volTableIdxGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.272 NAME 'printNotify' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.334 NAME 'searchFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2298 NAME 'msDS-AuthNPolicySiloEnforced' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1428 NAME 'msCOM-ObjectId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.400 NAME 'addressEntryDisplayTableMSDOS' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.81 NAME 'modifiedCountAtLastProm' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.71 NAME 'machineRole' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1123 NAME 'msNPCalledStationID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.654 NAME 'managedObjects' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.638 NAME 'isPrivilegeHolder' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.197 NAME 'systemMustContain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.91 NAME 'otherLoginWorkstations' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.13.3.32 NAME 'msDFSR-DisablePacketPrivacy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2297 NAME 'msDS-AuthNPolicyEnforced' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.576 NAME 'meetingMaxParticipants' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.4 NAME 'loginShell' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.779 NAME 'aCSCacheTimeout' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.751 NAME 'userSharedFolder' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.342 NAME 'msSFU30MaxGidNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1380 NAME 'mS-SQL-Status' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.13 NAME 'builtinCreationTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.277 NAME 'printMaxXExtent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.230 NAME 'printSeparatorFile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1387 NAME 'mS-SQL-GPSHeight' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2054 NAME 'msImaging-PSPString' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.235 NAME 'printFormName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.20 NAME 'telephoneNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1621 NAME 'msDS-Other-Settings' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.18.1.304 NAME 'msSFU30SearchAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.21.9 NAME 'structuralObjectClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' )", + "( 1.2.840.113556.1.4.659 NAME 'serviceDNSNameType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.902 NAME 'aCSMaxSizeOfRSVPAccountFile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.569 NAME 'meetingLocation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.261 NAME 'division' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1640 NAME 'msWMI-NormalizedClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.300 NAME 'printerName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1960 NAME 'msDS-isRODC' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.268 NAME 'eFSPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1824 NAME 'msDS-AzMajorVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2134 NAME 'msDNS-DSRecordAlgorithms' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.270 NAME 'printShareName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1400 NAME 'mS-SQL-Applications' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1312 NAME 'aCSServerList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1376 NAME 'mS-SQL-SPX' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.368 NAME 'rIDManagerReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1371 NAME 'mS-SQL-SortOrder' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.118 NAME 'otherPager' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1894 NAME 'msPKIAccountCredentials' SYNTAX '1.2.840.113556.1.4.903' )", + "( 1.2.840.113556.1.6.13.3.16 NAME 'msDFSR-Flags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1301 NAME 'tokenGroups' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1626 NAME 'msWMI-CreationDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.14 NAME 'hasMasterNCs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.153 NAME 'rid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2084 NAME 'msSPP-ConfirmationId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.2 NAME 'msDFSR-Extension' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1846 NAME 'msDS-DefaultQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.35 NAME 'rangeUpper' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1633 NAME 'msWMI-Int8Max' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.48 NAME 'isDeleted' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1327 NAME 'pKIDefaultKeySpec' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1408 NAME 'mS-DS-ReplicatesNCReason' SYNTAX '1.2.840.113556.1.4.903' )", + "( 1.2.840.113556.1.4.1816 NAME 'msDS-AzClassId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2088 NAME 'msSPP-IssuanceLicense' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1672 NAME 'msPKI-OID-CPS' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.590 NAME 'meetingBlob' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.72 NAME 'marshalledInterface' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1385 NAME 'mS-SQL-GPSLatitude' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2097 NAME 'msDS-ClaimPossibleValues' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.26 NAME 'msDFSR-DeletedPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1826 NAME 'msDS-RetiredReplNCSignatures' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2143 NAME 'msDNS-SigningKeyDescriptors' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.491 NAME 'fRSFaultCondition' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2278 NAME 'msDS-UserAllowedToAuthenticateFrom' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2017 NAME 'msDS-LockoutObservationWindow' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2130 NAME 'msDNS-IsSigned' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2057 NAME 'msDS-HostServiceAccountBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.683 NAME 'cRLPartitionedRevocationList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.481 NAME 'schemaUpdate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1332 NAME 'pKIOverlapPeriod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.692 NAME 'previousCACertificates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.573 NAME 'meetingApplication' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1849 NAME 'msDS-QuotaUsed' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.20 NAME 'ipNetworkNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.517 NAME 'ipsecPolicyReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1822 NAME 'msieee80211-DataType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.664 NAME 'syncWithObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2183 NAME 'msDS-GeoCoordinatesAltitude' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.284 NAME 'bytesPerMinute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.139 NAME 'profilePath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.40 NAME 'crossCertificatePair' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1929 NAME 'msDS-SecondaryKrbTgtNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2294 NAME 'msDS-ServiceAuthNPolicyBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1414 NAME 'dNSTombstoned' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.104 NAME 'ownerBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1930 NAME 'msDS-RevealedDSAs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2240 NAME 'msDS-IssuerCertificates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1692 NAME 'msFRS-Topology-Pref' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.158 NAME 'domainReplica' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.2 NAME 'whenCreated' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.76 NAME 'maxStorage' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.484 NAME 'fRSDirectoryFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1916 NAME 'msRADIUS-SavedFramedIpv6Prefix' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2087 NAME 'msSPP-ConfigLicense' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.627 NAME 'ipsecNFAReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.351 NAME 'auxiliaryClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' )", + "( 1.2.840.113556.1.2.50 NAME 'linkID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1718 NAME 'msDS-AdditionalSamAccountName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.35 NAME 'msDFSR-OnDemandExclusionFileFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.577 NAME 'meetingOriginator' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.169 NAME 'showInAdvancedViewOnly' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.582 NAME 'meetingAdvertiseScope' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.48 NAME 'buildingName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2181 NAME 'msImaging-HashAlgorithm' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2101 NAME 'msDS-ClaimSharesPossibleValuesWith' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.24 NAME 'contentIndexingAllowed' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.39 NAME 'msDFSR-CommonStagingSizeInMb' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2135 NAME 'msDNS-RFC5011KeyRollovers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.682 NAME 'friendlyNames' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2071 NAME 'msTSEndpointType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2263 NAME 'msDS-RegisteredUsers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2062 NAME 'msDS-OptionalFeatureGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.767 NAME 'aCSMaxPeakBandwidth' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 2.5.4.28 NAME 'preferredDeliveryMethod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.919 NAME 'mSMQQuota' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.327 NAME 'packageFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.382 NAME 'dnsRecord' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.755 NAME 'domainIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.872 NAME 'fRSControlInboundBacklog' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.928 NAME 'mSMQOutRoutingServers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.768 NAME 'aCSEnableRSVPMessageLogging' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.585 NAME 'meetingIsEncrypted' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.34 NAME 'rangeLower' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1361 NAME 'mS-DS-ConsistencyChildCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2192 NAME 'msDS-EgressClaimsTransformationPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2292 NAME 'msDS-ComputerAuthNPolicyBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.843 NAME 'lDAPAdminLimits' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1847 NAME 'msDS-TombstoneQuotaFactor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1355 NAME 'queryFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.16 NAME 'postalAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.307 NAME 'options' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.74 NAME 'dSASignature' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.380 NAME 'dnsSecureSecondaries' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.634 NAME 'privilegeDisplayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.598 NAME 'dmdName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1399 NAME 'mS-SQL-LastDiagnosticDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2280 NAME 'msDS-ComputerAllowedToAuthenticateTo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.350 NAME 'addressType' SYNTAX '1.2.840.113556.1.4.905' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.38 NAME 'msDFSR-CommonStagingPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.672 NAME 'categories' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1675 NAME 'msPKI-RA-Application-Policies' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1244 NAME 'addressBookRoots' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.336 NAME 'volTableGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.65 NAME 'logonWorkstation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2153 NAME 'msAuthz-ResourceCondition' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.34 NAME 'msDFSR-DefaultCompressionExclusionFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.756 NAME 'aCSTimeOfDay' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2276 NAME 'msDS-SyncServerUrl' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.710 NAME 'superScopes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.44' )", + "( 1.2.840.113556.1.2.210 NAME 'proxyAddresses' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.18.1.348 NAME 'msSFU30NetgroupHostAtDomain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1306 NAME 'dNSProperty' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.141 NAME 'department' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.871 NAME 'fRSControlDataCreation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.253 NAME 'cOMOtherProgId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1337 NAME 'mSMQUserSid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 0.9.2342.19200300.100.1.14 NAME 'documentAuthor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 2.5.4.37 NAME 'cACertificate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.698 NAME 'dhcpUniqueKey' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1980 NAME 'msTSRemoteControl' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.9 NAME 'host' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2081 NAME 'msSPP-CSVLKSkuId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.483 NAME 'fRSFileFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2168 NAME 'msDS-IsPrimaryComputerFor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.74 NAME 'maxPwdAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1374 NAME 'mS-SQL-NamedPipe' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1972 NAME 'msDS-FailedInteractiveLogonCount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1649 NAME 'msWMI-TargetType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.668 NAME 'domainCAs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.2021 NAME 'msDS-PSOApplied' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.25 NAME 'countryCode' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.160 NAME 'lmPwdHistory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.275 NAME 'printKeepPrintedJobs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2014 NAME 'msDS-PasswordHistoryLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1836 NAME 'msDS-hasMasterNCs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1813 NAME 'msDS-OperationsForAzRoleBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.212 NAME 'dSHeuristics' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.877 NAME 'fRSPartnerAuthLevel' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.13 NAME 'displayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.269 NAME 'linkTrackSecret' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1239 NAME 'mSMQDependentClientService' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.238 NAME 'printMaxResolutionSupported' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.325 NAME 'perMsgDialogDisplayTable' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.819 NAME 'bridgeheadTransportList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.540 NAME 'initialAuthOutgoing' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.523 NAME 'proxyGenerationEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.760 NAME 'aCSAggregateTokenRatePerUser' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.381 NAME 'dnsNotifySecondaries' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 2.5.4.21 NAME 'telexNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.117 NAME 'rpcNsPriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.6.18.1.300 NAME 'msSFU30SearchContainer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.960 NAME 'mSMQNt4Stub' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.4.844 NAME 'lDAPIPDenyList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.918 NAME 'mSMQJournal' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.343 NAME 'msSFU30MaxUidNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1442 NAME 'msDS-Cached-Membership-Time-Stamp' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1458 NAME 'msDS-Auxiliary-Classes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.821 NAME 'siteList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1782 NAME 'msDS-KeyVersionNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 2.5.4.50 NAME 'uniqueMember' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1797 NAME 'msDS-AzScriptTimeout' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1812 NAME 'msDS-OperationsForAzRole' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.809 NAME 'remoteStorageGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.231 NAME 'priority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.37 NAME 'msDFSR-Options2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2083 NAME 'msSPP-InstallationId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.58 NAME 'attributeCertificateAttribute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.6.18.1.302 NAME 'msSFU30FieldSeparator' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.532 NAME 'superiorDNSRoot' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.822 NAME 'siteLinkList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1366 NAME 'mS-SQL-Location' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.94 NAME 'ntPwdHistory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1 NAME 'name' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1629 NAME 'msWMI-IntMax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.118 NAME 'rpcNsProfileEntry' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2049 NAME 'msDS-BridgeHeadServersUsed' SYNTAX '1.2.840.113556.1.4.903' )", + "( 1.2.840.113556.1.4.1969 NAME 'samDomainUpdates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.889 NAME 'additionalTrustedServiceNames' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.77 NAME 'maxTicketAge' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1661 NAME 'msDS-NC-Replica-Locations' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1783 NAME 'msDS-ExecuteScriptPassword' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.49 NAME 'mAPIID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.9 NAME 'msDFSR-Enabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.250 NAME 'cOMUniqueLIBID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.18 NAME 'postOfficeBox' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2067 NAME 'msDS-LastKnownRDN' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1344 NAME 'dSUIAdminMaximum' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1153 NAME 'msRADIUSFramedIPAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1799 NAME 'msDS-AzScopeName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2013 NAME 'msDS-MinimumPasswordLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.114 NAME 'rpcNsGroup' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.146 NAME 'objectSid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.6 NAME 'msDFSR-StagingSizeInMb' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.365 NAME 'operatingSystemServicePack' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.21.6 NAME 'objectClasses' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1698 NAME 'msTAPI-uid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.256 NAME 'streetAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1191 NAME 'msRASSavedFramedRoute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1965 NAME 'msFVE-RecoveryGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2166 NAME 'msDS-GenerationId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1359 NAME 'otherWellKnownObjects' SYNTAX '1.2.840.113556.1.4.903' )", + "( 1.2.840.113556.1.4.1940 NAME 'msDS-RevealedList' SYNTAX '1.2.840.113556.1.4.904' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2282 NAME 'msDS-ServiceAllowedToAuthenticateTo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.379 NAME 'dnsAllowXFR' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.628 NAME 'ipsecNegotiationPolicyReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1976 NAME 'msTSProfilePath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2076 NAME 'msPKI-Enrollment-Servers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.53 NAME 'deltaRevocationList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.18 NAME 'otherTelephone' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2077 NAME 'msPKI-Site-Name' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1316 NAME 'aCSMinimumLatency' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2157 NAME 'msDS-ClaimSource' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1970 NAME 'msDS-LastSuccessfulInteractiveLogonTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.280 NAME 'printMinYExtent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.415 NAME 'operatingSystemHotfix' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.306 NAME 'msSFU30MapFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.610 NAME 'classDisplayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1381 NAME 'mS-SQL-LastUpdatedDate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1957 NAME 'msDS-AuthenticatedToAccountlist' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1825 NAME 'msDS-AzMinorVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2198 NAME 'msDS-ManagedPasswordPreviousId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2068 NAME 'msDS-DeletedObjectLifetime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2095 NAME 'msDS-IsUsedAsResourceSecurityAttribute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.786 NAME 'mailAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.373 NAME 'rIDUsedPool' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.19 NAME 'msDFSR-RdcEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.44 NAME 'homeDirectory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.538 NAME 'prefixMap' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2034 NAME 'msDFS-LastModifiedv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2155 NAME 'msAuthz-MemberRulesInCentralAccessPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.947 NAME 'mSMQSignCertificates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.714 NAME 'dhcpOptions' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2060 NAME 'msDS-LocalEffectiveRecycleTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.675 NAME 'catalogs' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.134 NAME 'trustPosixOffset' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1404 NAME 'mS-SQL-AllowImmediateUpdatingSubscription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2047 NAME 'globalAddressList2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.135 NAME 'cost' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1331 NAME 'pKIExpirationPeriod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.45 NAME 'organizationalStatus' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.5.4.15 NAME 'businessCategory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.13.3.4 NAME 'msDFSR-RootSizeInMb' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.869 NAME 'frsComputerReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1893 NAME 'msPKIDPAPIMasterKeys' SYNTAX '1.2.840.113556.1.4.903' )", + "( 1.2.840.113556.1.4.1430 NAME 'msPKI-Enrollment-Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.45 NAME 'homeDrive' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2085 NAME 'msSPP-OnlineLicense' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.196 NAME 'systemMayContain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.90 NAME 'unicodePwd' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.763 NAME 'aCSTotalNoOfFlows' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1806 NAME 'msDS-MembersForAzRole' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.873 NAME 'fRSControlOutboundBacklog' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.89 NAME 'nTGroupMembers' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.815 NAME 'canUpgradeScript' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.96 NAME 'pwdLastSet' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.228 NAME 'portName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1821 NAME 'msieee80211-Data' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.720 NAME 'dhcpUpdateTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 2.5.4.33 NAME 'roleOccupant' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1818 NAME 'msDS-AzTaskIsRoleDefinition' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.16 NAME 'ipServiceProtocol' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.488 NAME 'fRSStagingPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.25 NAME 'dc' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.502 NAME 'timeVolChange' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.303 NAME 'notificationList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.952 NAME 'mSMQMigrated' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2290 NAME 'msDS-UserAuthNPolicyBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.53 NAME 'lastSetTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.894 NAME 'gPCFileSysPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.22 NAME 'teletexTerminalIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.471 NAME 'schemaVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' )", + "( 1.2.840.113556.1.2.91 NAME 'repsFrom' SYNTAX 'OctetString' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.5 NAME 'msDFSR-StagingPath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.15 NAME 'ipServicePort' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.781 NAME 'lastKnownParent' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 2.5.4.43 NAME 'initials' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.901 NAME 'aCSMaxNoOfAccountFiles' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1928 NAME 'msDS-RevealOnDemandGroup' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1689 NAME 'msDS-Non-Security-Group-Extra-Classes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.344 NAME 'groupsToIgnore' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.896 NAME 'uSNSource' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.964 NAME 'mSMQNt4Flags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2102 NAME 'msDS-ClaimSharesPossibleValuesWithBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 2.5.4.29 NAME 'presentationAddress' SYNTAX '1.3.6.1.4.1.1466.115.121.1.43' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2051 NAME 'msDS-OIDToGroupLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.369 NAME 'fSMORoleOwner' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1954 NAME 'ms-net-ieee-8023-GP-PolicyGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.648 NAME 'primaryTelexNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2283 NAME 'msDS-ServiceAllowedToAuthenticateFrom' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 2.5.4.12 NAME 'title' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.1 NAME 'uid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1247 NAME 'interSiteTopologyRenew' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1697 NAME 'msDS-Settings' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.247 NAME 'printAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2188 NAME 'msDS-ValueTypeReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2133 NAME 'msDNS-MaintainTrustAnchor' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.324 NAME 'msSFU30KeyValues' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.1378 NAME 'mS-SQL-AppleTalk' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1663 NAME 'msDS-Replication-Notify-First-DSA-Delay' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.121 NAME 'securityIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.748 NAME 'attributeDisplayNames' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.16.840.1.113730.3.1.35 NAME 'thumbnailPhoto' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2082 NAME 'msSPP-KMSIds' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.758 NAME 'aCSMaxTokenRatePerFlow' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.121 NAME 'uSNLastObjRem' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.875 NAME 'fRSMemberReference' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1349 NAME 'gPCUserExtensionNames' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.138 NAME 'userParameters' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.36 NAME 'userCertificate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.6.13.3.102 NAME 'msDFSR-MemberReferenceBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.131 NAME 'co' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.3 NAME 'cn' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.936 NAME 'mSMQEncryptKey' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.226 NAME 'adminDescription' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.34 NAME 'seeAlso' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.444 NAME 'msExchAssistantName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.667 NAME 'syncWithSID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1998 NAME 'msFVE-VolumeGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2107 NAME 'msTPM-SrkPubThumbprint' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.81 NAME 'info' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1686 NAME 'msWMI-ScopeGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.151 NAME 'oEMInformation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.935 NAME 'mSMQOSType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.374 NAME 'rIDNextRID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2039 NAME 'msDFS-LinkPathv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.141 NAME 'versionNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.505 NAME 'oMTGuid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.88 NAME 'nextRid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2037 NAME 'msDFS-Propertiesv2' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1994 NAME 'msTSLicenseVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.16.840.1.113730.3.140 NAME 'userSMIMECertificate' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1985 NAME 'msTSBrokenConnectionAction' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.281 NAME 'printStaplingSupported' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.17 NAME 'msDFSR-Options' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.485 NAME 'fRSUpdateTimeout' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1967 NAME 'msDS-NC-RO-Replica-Locations' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1819 NAME 'msDS-AzApplicationData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.347 NAME 'msSFU30PosixMemberOf' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1425 NAME 'msCOM-UserLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.6.13.3.24 NAME 'msDFSR-DfsLinkTarget' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.512 NAME 'siteObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.584 NAME 'meetingRating' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1794 NAME 'msDS-NonMembersBL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.776 NAME 'aCSDSBMPriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.520 NAME 'machinePasswordChangeInterval' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.669 NAME 'rIDSetReferences' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.941 NAME 'mSMQLongLived' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1241 NAME 'netbootMirrorDataFile' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.18.1.305 NAME 'msSFU30ResultAttributes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2236 NAME 'msds-memberOfTransitive' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1427 NAME 'msCOM-DefaultPartitionLink' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.519 NAME 'lastBackupRestorationTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.337 NAME 'currMachineId' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.32 NAME 'attributeSyntax' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.362 NAME 'siteGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.823 NAME 'certificateTemplates' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 2.16.840.1.113730.3.1.39 NAME 'preferredLanguage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.352 NAME 'msSFU30CryptMethod' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1946 NAME 'msDS-PhoneticDisplayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.14 NAME 'searchGuide' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2270 NAME 'msDS-IsManaged' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.581 NAME 'meetingScope' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.673 NAME 'retiredReplDSASignatures' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.855 NAME 'netbootNewMachineNamingPolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1245 NAME 'globalAddressList' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.2.227 NAME 'extensionName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.884 NAME 'msRRASAttribute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.6.18.1.349 NAME 'msSFU30NetgroupUserAtDomain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.26' )", + "( 1.2.840.113556.1.4.680 NAME 'queryPoint' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.888 NAME 'iPSECNegotiationPolicyAction' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.29 NAME 'msDFSR-CachePolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.299 NAME 'printMediaSupported' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.503 NAME 'timeRefresh' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.11 NAME 'authenticationOptions' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.198 NAME 'systemAuxiliaryClass' SYNTAX '1.3.6.1.4.1.1466.115.121.1.38' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.857 NAME 'netbootIntelliMirrorOSes' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1406 NAME 'mS-SQL-AllowSnapshotFilesFTPDownloading' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1333 NAME 'pKIExtendedKeyUsage' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.2019 NAME 'msDS-LockoutThreshold' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1844 NAME 'msDS-QuotaTrustee' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.18.1.350 NAME 'msSFU30IsValidContainer' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.359 NAME 'netbootGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1719 NAME 'msDS-DnsRootAlias' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.909 NAME 'extendedAttributeInfo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' NO-USER-MODIFICATION )", + "( 1.3.6.1.1.1.1.10 NAME 'shadowExpire' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1248 NAME 'interSiteTopologyFailover' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2275 NAME 'msDS-CloudIsEnabled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.7' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.887 NAME 'iPSECNegotiationPolicyType' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2059 NAME 'msDS-LocalEffectiveDeletionTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.24' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.587 NAME 'meetingStartTime' SYNTAX '1.3.6.1.4.1.1466.115.121.1.53' )", + "( 2.5.4.17 NAME 'postalCode' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.2.445 NAME 'originalDisplayTable' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1990 NAME 'msTSInitialProgram' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.662 NAME 'lockoutTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.21 NAME 'secretary' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.95 NAME 'pwdHistoryLength' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.759 NAME 'aCSMaxPeakBandwidthPerFlow' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.753 NAME 'nameServiceFlags' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.694 NAME 'previousParentCA' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.142 NAME 'winsockAddresses' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.2075 NAME 'msTSSecondaryDesktops' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.2105 NAME 'msSPP-CSVLKPid' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.49 NAME 'badPasswordTime' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2184 NAME 'msDS-GeoCoordinatesLatitude' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2079 NAME 'msDS-RequiredForestBehaviorVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1955 NAME 'ms-net-ieee-8023-GP-PolicyData' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.237 NAME 'printBinNames' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1382 NAME 'mS-SQL-InformationURL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.6.13.3.13 NAME 'msDFSR-DirectoryFilter' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.148 NAME 'schemaIDGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.2189 NAME 'msDS-TransformationRules' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 2.5.4.10 NAME 'o' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.504 NAME 'seqNotification' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 2.5.4.7 NAME 'l' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.57 NAME 'defaultLocalPolicyObject' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1801 NAME 'msDS-AzBizRule' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.948 NAME 'mSMQDigests' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.2.327 NAME 'helpFileName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.421 NAME 'domainWidePolicy' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 2.5.4.6 NAME 'c' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2139 NAME 'msDNS-DNSKEYRecordSetTTL' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.11 NAME 'documentIdentifier' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.609 NAME 'sIDHistory' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1711 NAME 'msDS-SDReferenceDomain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1367 NAME 'mS-SQL-Memory' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.715 NAME 'dhcpClasses' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1305 NAME 'moveTreeState' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.757 NAME 'aCSDirection' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.631 NAME 'printPagesPerMinute' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.145 NAME 'revision' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.646 NAME 'otherFacsimileTelephoneNumber' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )", + "( 1.2.840.113556.1.4.1798 NAME 'msDS-AzApplicationName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.366 NAME 'rpcNsAnnotation' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2190 NAME 'msDS-TransformationRulesCompiled' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.4.1636 NAME 'msWMI-StringDefault' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.813 NAME 'upgradeProductCode' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' )", + "( 1.2.840.113556.1.4.1951 NAME 'ms-net-ieee-80211-GP-PolicyGUID' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2098 NAME 'msDS-ClaimValueType' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.194 NAME 'adminDisplayName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.879 NAME 'fRSServiceCommandStatus' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.361 NAME 'netbootMachineFilePath' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.67 NAME 'lSAModifiedCount' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.920 NAME 'mSMQBasePriority' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2277 NAME 'msDS-UserAllowedToAuthenticateTo' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2056 NAME 'msDS-HostServiceAccount' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' )", + "( 1.2.840.113556.1.4.1943 NAME 'msDS-PhoneticLastName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.2055 NAME 'msDS-USNLastSyncSuccess' SYNTAX '1.2.840.113556.1.4.906' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.101 NAME 'privateKey' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 2.5.4.42 NAME 'givenName' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.685 NAME 'parentCACertificateChain' SYNTAX '1.3.6.1.4.1.1466.115.121.1.40' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.1924 NAME 'msDS-RevealedUsers' SYNTAX '1.2.840.113556.1.4.903' NO-USER-MODIFICATION )", + "( 1.2.840.113556.1.2.76 NAME 'objectVersion' SYNTAX '1.3.6.1.4.1.1466.115.121.1.27' SINGLE-VALUE )", + "( 1.2.840.113556.1.4.856 NAME 'netbootNewMachineOU' SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' SINGLE-VALUE )" + ], + "cn": [ + "Aggregate" + ], + "dITContentRules": [ + "( 1.2.840.113556.1.6.13.4.6 NAME 'msDFSR-Content' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.14 NAME 'device' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MAY (uid $ manager $ ipHostNumber $ macAddress $ bootParameter $ bootFile ))", + "( 1.2.840.113556.1.5.205 NAME 'msWMI-IntRangeParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.5 NAME 'samServer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.196 NAME 'msPKI-Enterprise-Oid' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.7000.53 NAME 'crossRefContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.7 NAME 'ipNetwork' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.5 NAME 'organizationalUnit' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.152 NAME 'intellimirrorGroup' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.253 NAME 'msFVE-RecoveryInformation' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.262 NAME 'msImaging-PSPs' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.251 NAME 'ms-net-ieee-80211-GroupPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.138 NAME 'aCSSubnet' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.43 NAME 'fTDfs' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.27 NAME 'rpcEntry')", + "( 1.2.840.113556.1.5.85 NAME 'dnsZone' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.4.2163 NAME 'msAuthz-CentralAccessRule' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.194 NAME 'msCOM-PartitionSet' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.242 NAME 'msDS-QuotaContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.281 NAME 'msDS-ClaimsTransformationPolicies' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.146 NAME 'remoteStorageServicePoint' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.2 NAME 'samDomainBase')", + "( 1.2.840.113556.1.5.132 NAME 'dHCPClass' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.283 NAME 'msDS-CloudExtensions')", + "( 1.2.840.113556.1.5.89 NAME 'nTFRSSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.24 NAME 'remoteMailRecipient' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (cn ) MAY (telephoneNumber $ userCertificate $ info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ showInAddressBook $ userCert $ legacyExchangeDN $ msDS-PhoneticDisplayName $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ userSMIMECertificate $ textEncodedORAddress $ secretary $ labeledURI ))", + "( 1.2.840.113556.1.5.221 NAME 'msTAPI-RtConference' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.201 NAME 'msWMI-SimplePolicyTemplate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.18.2.212 NAME 'msSFU30NetId' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.49 NAME 'packageRegistration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.139 NAME 'lostAndFound' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.14 NAME 'connectionPoint')", + "( 1.2.840.113556.1.5.6 NAME 'securityPrincipal')", + "( 1.2.840.113556.1.5.147 NAME 'siteLink' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.255 NAME 'msDS-PasswordSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.4.2162 NAME 'msAuthz-CentralAccessRules' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.30 NAME 'serviceInstance' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.156 NAME 'rRASAdministrationDictionary' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.4.2164 NAME 'msAuthz-CentralAccessPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (objectSid $ sAMAccountName ) MAY (info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 $ textEncodedORAddress $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag ))", + "( 1.2.840.113556.1.5.52 NAME 'fileLinkTracking' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.18 NAME 'domainPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.18.2.216 NAME 'msSFU30NetworkUser' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject')", + "( 1.2.840.113556.1.5.177 NAME 'pKICertificateTemplate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.293 NAME 'msDS-AuthNPolicies' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.2 NAME 'msDFSR-Subscriber' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.31 NAME 'site' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.222 NAME 'msTAPI-RtPerson' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.68 NAME 'applicationSiteSettings')", + "( 1.2.840.113556.1.3.14 NAME 'attributeSchema' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.267 NAME 'msSPP-ActivationObject' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.220 NAME 'msDS-App-Configuration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.23 NAME 'container' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.10 NAME 'msDFSR-Connection' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.207 NAME 'msWMI-UintRangeParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.23 NAME 'printQueue' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.260 NAME 'msDFS-DeletedLinkv2' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.140 NAME 'interSiteTransportContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.130 NAME 'indexServerCatalog' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.98 NAME 'ipsecPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.0 NAME 'top')", + "( 1.2.840.113556.1.5.36 NAME 'volume' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.236 NAME 'msDS-AzOperation' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.9 NAME 'groupOfNames' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.12 NAME 'configuration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.78 NAME 'licensingSiteSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.69 NAME 'nTDSSiteSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.269 NAME 'msDS-ClaimTypePropertyBase')", + "( 1.2.840.113556.1.5.273 NAME 'msDS-ResourceProperty' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.239 NAME 'msDS-AzRole' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.12 NAME 'bootableDevice')", + "( 1.2.840.113556.1.5.294 NAME 'msDS-AuthNPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.86 NAME 'dnsNode' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.210 NAME 'msWMI-StringSetParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.264 NAME 'msDS-ManagedServiceAccount' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (objectSid $ sAMAccountName ) MAY (info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 $ textEncodedORAddress $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipHostNumber ))", + "( 1.2.840.113556.1.5.15 NAME 'contact' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MAY (userCertificate $ info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ showInAddressBook $ userCert $ legacyExchangeDN $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ userSMIMECertificate $ textEncodedORAddress $ secretary $ labeledURI ))", + "( 1.3.6.1.1.1.2.0 NAME 'posixAccount')", + "( 1.2.840.113556.1.5.266 NAME 'msSPP-ActivationObjectsContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.217 NAME 'msWMI-ObjectEncoding' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.33 NAME 'storage' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.67 NAME 'domainDNS' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MAY (cACertificate $ builtinCreationTime $ builtinModifiedCount $ creationTime $ domainPolicyObject $ forceLogoff $ defaultLocalPolicyObject $ lockoutDuration $ lockOutObservationWindow $ lSACreationTime $ lSAModifiedCount $ lockoutThreshold $ maxPwdAge $ minPwdAge $ minPwdLength $ modifiedCountAtLastProm $ nETBIOSName $ nextRid $ pwdProperties $ pwdHistoryLength $ privateKey $ replicaSource $ objectSid $ oEMInformation $ serverState $ uASCompat $ serverRole $ domainReplica $ modifiedCount $ controlAccessRights $ auditingPolicy $ eFSPolicy $ desktopProfile $ nTMixedDomain $ rIDManagerReference $ treeName $ pekList $ pekKeyChangeInterval $ gPLink $ gPOptions $ ms-DS-MachineAccountQuota $ msDS-LogonTimeSyncInterval $ msDS-PerUserTrustQuota $ msDS-AllUsersTrustQuota $ msDS-PerUserTrustTombstonesQuota ))", + "( 1.2.840.113556.1.5.92 NAME 'linkTrackVolEntry' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.11 NAME 'ieee802Device')", + "( 0.9.2342.19200300.100.4.17 NAME 'domainRelatedObject')", + "( 1.2.840.113556.1.5.235 NAME 'msDS-AzApplication' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.107 NAME 'sitesContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.263 NAME 'msImaging-PostScanProcess' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.240 NAME 'msieee80211-Policy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.95 NAME 'subnetContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 0.9.2342.19200300.100.4.6 NAME 'document' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.6 NAME 'person' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.274 NAME 'msDS-ResourcePropertyList' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.270 NAME 'msDS-ClaimTypes' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.1 NAME 'shadowAccount')", + "( 1.2.840.113556.1.5.179 NAME 'mSMQMigratedUser' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.185 NAME 'mS-SQL-OLAPServer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.4.1.1466.101.119.2 NAME 'dynamicObject')", + "( 1.2.840.113556.1.5.155 NAME 'nTFRSSubscriber' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.129 NAME 'rIDSet' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.58 NAME 'addressTemplate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.154 NAME 'nTFRSSubscriptions' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.7000.47 NAME 'nTDSDSA' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.175 NAME 'infrastructureUpdate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.18.2.215 NAME 'msSFU30DomainInfo' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.213 NAME 'msWMI-Som' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.82 NAME 'rpcProfile' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.164 NAME 'mSMQSiteLink' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.184 NAME 'mS-SQL-SQLServer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.106 NAME 'queryPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.162 NAME 'mSMQConfiguration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.257 NAME 'msDFS-NamespaceAnchor' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.7 NAME 'msDFSR-ContentSet' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.276 NAME 'msTPM-InformationObjectsContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.209 NAME 'msWMI-RealRangeParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.7 NAME 'organizationalPerson' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.176 NAME 'msExchConfigurationContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.278 NAME 'msKds-ProvRootKey' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.238 NAME 'msDS-AzTask' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.282 NAME 'msDS-GroupManagedServiceAccount' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (objectSid $ sAMAccountName ) MAY (info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 $ textEncodedORAddress $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipHostNumber ))", + "( 1.3.6.1.1.1.2.9 NAME 'nisMap' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.10 NAME 'nisObject' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.277 NAME 'msKds-ProvServerConfiguration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.18.2.217 NAME 'msSFU30NISMapConfig' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.7000.48 NAME 'serversContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.90 NAME 'linkTrackVolumeTable' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.188 NAME 'mS-SQL-SQLDatabase' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.211 NAME 'msWMI-PolicyType' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.183 NAME 'dSUISettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.157 NAME 'groupPolicyContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.3 NAME 'samDomain' MAY (forceLogoff $ objectSid $ oEMInformation $ serverState $ uASCompat $ serverRole $ domainReplica $ modifiedCount ))", + "( 1.2.840.113556.1.5.234 NAME 'msDS-AzAdminManager' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.214 NAME 'msWMI-Rule' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.254 NAME 'nTDSDSARO' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.286 NAME 'msDS-Device' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.34 NAME 'trustedDomain' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 0.9.2342.19200300.100.4.7 NAME 'room' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.4 NAME 'organization' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.272 NAME 'msDS-ClaimType' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.3 NAME 'ipService' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.4 NAME 'ipProtocol' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.80 NAME 'rpcGroup' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.17 NAME 'server' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.28 NAME 'secret' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.163 NAME 'mSMQEnterpriseSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.202 NAME 'msWMI-MergeablePolicyTemplate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.195 NAME 'msPKI-Key-Recovery-Agent' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (objectSid $ sAMAccountName ) MAY (info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 $ textEncodedORAddress $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag ))", + "( 0.9.2342.19200300.100.4.18 NAME 'friendlyCountry' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.258 NAME 'msDFS-Namespacev2' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.96 NAME 'subnet' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.216 NAME 'applicationVersion' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.10 NAME 'residentialPerson' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.19 NAME 'cRLDistributionPoint' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.137 NAME 'aCSPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.77 NAME 'controlAccessRight' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.219 NAME 'msMQ-Group' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.8 NAME 'group' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (cn $ objectSid $ sAMAccountName ) MAY (telephoneNumber $ userPassword $ userCertificate $ info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-PhoneticDisplayName $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ userSMIMECertificate $ textEncodedORAddress $ secretary $ labeledURI $ gidNumber $ memberUid ))", + "( 1.2.840.113556.1.6.23.2 NAME 'msPrint-ConnectionPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.11 NAME 'crossRef' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.9 NAME 'msDFSR-Member' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.59 NAME 'displayTemplate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.13 NAME 'classSchema' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.200 NAME 'msWMI-PolicyTemplate' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.165 NAME 'mSMQSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.5 NAME 'oncRpc' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.126 NAME 'serviceConnectionPoint' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.4 NAME 'builtinDomain' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MAY (creationTime $ forceLogoff $ lockoutDuration $ lockOutObservationWindow $ lockoutThreshold $ maxPwdAge $ minPwdAge $ minPwdLength $ modifiedCountAtLastProm $ nextRid $ pwdProperties $ pwdHistoryLength $ objectSid $ oEMInformation $ serverState $ uASCompat $ serverRole $ domainReplica $ modifiedCount ))", + "( 1.2.840.113556.1.5.241 NAME 'msDS-AppData' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.73 NAME 'rpcServerElement' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.150 NAME 'rRASAdministrationConnectionPoint' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.191 NAME 'aCSResourceLimits' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.3 NAME 'locality' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.6 NAME 'ipHost')", + "( 1.2.840.113556.1.5.275 NAME 'msTPM-InformationObject' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.289 NAME 'msDS-DeviceContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.4.2129 NAME 'msDNS-ServerSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.76 NAME 'foreignSecurityPrincipal' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.44 NAME 'classStore' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 0.9.2342.19200300.100.4.5 NAME 'account' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.26 NAME 'rpcProfileElement' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.215 NAME 'msWMI-WMIGPO' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.243 NAME 'msDS-QuotaControl' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.256 NAME 'msDS-PasswordSettingsContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.187 NAME 'mS-SQL-SQLPublication' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.9 NAME 'user' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (objectSid $ sAMAccountName ) MAY (info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 $ textEncodedORAddress $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag ))", + "( 1.2.840.113556.1.5.259 NAME 'msDFS-Linkv2' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.141 NAME 'interSiteTransport' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.4 NAME 'msDFSR-GlobalSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.29 NAME 'serviceClass' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.189 NAME 'mS-SQL-OLAPDatabase' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.16 NAME 'certificationAuthority' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.104 NAME 'meeting' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.287 NAME 'msDS-DeviceRegistrationServiceContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.71 NAME 'nTDSConnection' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.291 NAME 'msDS-AuthNPolicySilos' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.218 NAME 'msMQ-Custom-Recipient' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.72 NAME 'nTDSService' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.9 NAME 'dMD' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.280 NAME 'msDS-ClaimsTransformationPolicyType' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 0.9.2342.19200300.100.4.14 NAME 'rFC822LocalPart' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.190 NAME 'mS-SQL-OLAPCube' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.208 NAME 'msWMI-UintSetParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.3.6.1.1.1.2.2 NAME 'posixGroup')", + "( 2.5.6.17 NAME 'groupOfUniqueNames' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.252 NAME 'ms-net-ieee-8023-GroupPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.119 NAME 'ipsecNegotiationPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.292 NAME 'msDS-AuthNPolicySilo' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.121 NAME 'ipsecNFA' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.42 NAME 'dfsConfiguration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 0.9.2342.19200300.100.4.9 NAME 'documentSeries' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.271 NAME 'msDS-ResourceProperties' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.91 NAME 'linkTrackObjectMoveTable' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.136 NAME 'rpcContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.83 NAME 'rIDManager' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.206 NAME 'msWMI-IntSetParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.5 NAME 'msDFSR-ReplicationGroup' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.125 NAME 'addressBookContainer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.7000.49 NAME 'applicationSettings')", + "( 1.2.840.113556.1.5.265 NAME 'msDS-OptionalFeature' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.94 NAME 'serviceAdministrationPoint' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.102 NAME 'nTFRSReplicaSet' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.203 NAME 'msWMI-RangeParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.7000.56 NAME 'ipsecBase')", + "( 1.2.840.113556.1.6.13.4.3 NAME 'msDFSR-Subscription' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.223 NAME 'msPKI-PrivateKeyRecoveryAgent' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.178 NAME 'pKIEnrollmentService' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.18.2.211 NAME 'msSFU30MailAliases' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.53 NAME 'typeLibrary' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.8 NAME 'msDFSR-Topology' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.237 NAME 'msDS-AzScope' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.74 NAME 'categoryRegistration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.11 NAME 'comConnectionPoint' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.93 NAME 'linkTrackOMTEntry' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.10 NAME 'classRegistration' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.148 NAME 'siteLinkBridge' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.81 NAME 'rpcServer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.46 NAME 'mailRecipient')", + "( 1.2.840.113556.1.5.1 NAME 'securityObject')", + "( 1.2.840.113556.1.5.20 NAME 'leaf')", + "( 1.2.840.113556.1.5.151 NAME 'intellimirrorSCP' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.6.13.4.1 NAME 'msDFSR-LocalSettings' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.186 NAME 'mS-SQL-SQLRepository' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.8 NAME 'organizationalRole' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.20.1 NAME 'subSchema' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.284 NAME 'msDS-DeviceRegistrationService' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.84 NAME 'displaySpecifier' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.212 NAME 'msWMI-ShadowObject' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.59 NAME 'fileLinkTrackingEntry' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.4.2161 NAME 'msAuthz-CentralAccessPolicies' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.161 NAME 'mSMQQueue' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.193 NAME 'msCOM-Partition' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.118 NAME 'ipsecFilter' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.2 NAME 'country' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.97 NAME 'physicalLocation' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.3.30 NAME 'computer' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ) MUST (objectSid $ sAMAccountName ) MAY (info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ showInAddressBook $ userCert $ legacyExchangeDN $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber $ unixUserPassword $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 $ textEncodedORAddress $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipHostNumber ))", + "( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.153 NAME 'nTFRSMember' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.12 NAME 'applicationEntity' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 2.5.6.11 NAME 'applicationProcess' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.279 NAME 'msDS-ValueType' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.204 NAME 'msWMI-UnknownRangeParam' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.66 NAME 'domain')", + "( 2.5.6.13 NAME 'dSA' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))", + "( 1.2.840.113556.1.5.120 NAME 'ipsecISAKMPPolicy' AUX ( mailRecipient $ posixGroup $ ipHost $ samDomain $ dynamicObject $ shadowAccount $ domainRelatedObject $ ieee802Device $ posixAccount $ bootableDevice $ simpleSecurityObject $ securityPrincipal $ msDS-CloudExtensions $ samDomainBase ))" + ], + "dSCorePropagationData": [ + "16010101000000.0Z" + ], + "distinguishedName": [ + "CN=Aggregate,CN=Schema,CN=Configuration,DC=FOREST,DC=LAB" + ], + "instanceType": [ + "4" + ], + "modifyTimeStamp": [ + "20141006121949.0Z" + ], + "name": [ + "Aggregate" + ], + "objectCategory": [ + "CN=SubSchema,CN=Schema,CN=Configuration,DC=FOREST,DC=LAB" + ], + "objectClass": [ + "top", + "subSchema" + ], + "objectClasses": [ + "( 1.2.840.113556.1.6.13.4.6 NAME 'msDFSR-Content' SUP top STRUCTURAL MAY (msDFSR-Extension $ msDFSR-Flags $ msDFSR-Options $ msDFSR-Options2 ) )", + "( 2.5.6.14 NAME 'device' SUP top STRUCTURAL MUST (cn ) MAY (serialNumber $ l $ o $ ou $ owner $ seeAlso $ msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ nisMapName ) )", + "( 1.2.840.113556.1.5.205 NAME 'msWMI-IntRangeParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-IntDefault ) MAY (msWMI-IntMax $ msWMI-IntMin ) )", + "( 1.2.840.113556.1.5.5 NAME 'samServer' SUP securityObject STRUCTURAL MAY (samDomainUpdates ) )", + "( 1.2.840.113556.1.5.196 NAME 'msPKI-Enterprise-Oid' SUP top STRUCTURAL MAY (msPKI-Cert-Template-OID $ msPKI-OID-Attribute $ msPKI-OID-CPS $ msPKI-OID-User-Notice $ msPKI-OIDLocalizedName $ msDS-OIDToGroupLink ) )", + "( 1.2.840.113556.1.5.7000.53 NAME 'crossRefContainer' SUP top STRUCTURAL MAY (uPNSuffixes $ msDS-Behavior-Version $ msDS-SPNSuffixes $ msDS-UpdateScript $ msDS-ExecuteScriptPassword $ msDS-EnabledFeature ) )", + "( 1.3.6.1.1.1.2.7 NAME 'ipNetwork' SUP top STRUCTURAL MUST (cn $ ipNetworkNumber ) MAY (l $ description $ uid $ manager $ msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ ipNetmaskNumber $ nisMapName ) )", + "( 2.5.6.5 NAME 'organizationalUnit' SUP top STRUCTURAL MUST (ou ) MAY (c $ l $ st $ street $ searchGuide $ businessCategory $ postalAddress $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ telephoneNumber $ telexNumber $ teletexTerminalIdentifier $ facsimileTelephoneNumber $ x121Address $ internationalISDNNumber $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ seeAlso $ userPassword $ co $ countryCode $ desktopProfile $ defaultGroup $ managedBy $ uPNSuffixes $ gPLink $ gPOptions $ msCOM-UserPartitionSetLink $ thumbnailLogo ) )", + "( 1.2.840.113556.1.5.152 NAME 'intellimirrorGroup' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.253 NAME 'msFVE-RecoveryInformation' SUP top STRUCTURAL MUST (msFVE-RecoveryPassword $ msFVE-RecoveryGuid ) MAY (msFVE-VolumeGuid $ msFVE-KeyPackage ) )", + "( 1.2.840.113556.1.5.262 NAME 'msImaging-PSPs' SUP container STRUCTURAL )", + "( 1.2.840.113556.1.5.251 NAME 'ms-net-ieee-80211-GroupPolicy' SUP top STRUCTURAL MAY (ms-net-ieee-80211-GP-PolicyGUID $ ms-net-ieee-80211-GP-PolicyData $ ms-net-ieee-80211-GP-PolicyReserved ) )", + "( 1.2.840.113556.1.5.138 NAME 'aCSSubnet' SUP top STRUCTURAL MAY (aCSMaxTokenRatePerFlow $ aCSMaxPeakBandwidthPerFlow $ aCSMaxDurationPerFlow $ aCSAllocableRSVPBandwidth $ aCSMaxPeakBandwidth $ aCSEnableRSVPMessageLogging $ aCSEventLogLevel $ aCSEnableACSService $ aCSRSVPLogFilesLocation $ aCSMaxNoOfLogFiles $ aCSMaxSizeOfRSVPLogFile $ aCSDSBMPriority $ aCSDSBMRefresh $ aCSDSBMDeadTime $ aCSCacheTimeout $ aCSNonReservedTxLimit $ aCSNonReservedTxSize $ aCSEnableRSVPAccounting $ aCSRSVPAccountFilesLocation $ aCSMaxNoOfAccountFiles $ aCSMaxSizeOfRSVPAccountFile $ aCSServerList $ aCSNonReservedPeakRate $ aCSNonReservedTokenSize $ aCSNonReservedMaxSDUSize $ aCSNonReservedMinPolicedSize ) )", + "( 1.2.840.113556.1.5.43 NAME 'fTDfs' SUP top STRUCTURAL MUST (remoteServerName $ pKTGuid $ pKT ) MAY (keywords $ uNCName $ managedBy ) )", + "( 1.2.840.113556.1.5.27 NAME 'rpcEntry' SUP connectionPoint ABSTRACT )", + "( 1.2.840.113556.1.5.85 NAME 'dnsZone' SUP top STRUCTURAL MUST (dc ) MAY (dnsAllowDynamic $ dnsAllowXFR $ dnsSecureSecondaries $ dnsNotifySecondaries $ managedBy $ dNSProperty $ msDNS-IsSigned $ msDNS-SignWithNSEC3 $ msDNS-NSEC3OptOut $ msDNS-MaintainTrustAnchor $ msDNS-DSRecordAlgorithms $ msDNS-RFC5011KeyRollovers $ msDNS-NSEC3HashAlgorithm $ msDNS-NSEC3RandomSaltLength $ msDNS-NSEC3Iterations $ msDNS-DNSKEYRecordSetTTL $ msDNS-DSRecordSetTTL $ msDNS-SignatureInceptionOffset $ msDNS-SecureDelegationPollingPeriod $ msDNS-SigningKeyDescriptors $ msDNS-SigningKeys $ msDNS-DNSKEYRecords $ msDNS-ParentHasSecureDelegation $ msDNS-PropagationTime $ msDNS-NSEC3UserSalt $ msDNS-NSEC3CurrentSalt ) )", + "( 1.2.840.113556.1.4.2163 NAME 'msAuthz-CentralAccessRule' SUP top STRUCTURAL MAY (Enabled $ msAuthz-EffectiveSecurityPolicy $ msAuthz-ProposedSecurityPolicy $ msAuthz-LastEffectiveSecurityPolicy $ msAuthz-ResourceCondition $ msAuthz-MemberRulesInCentralAccessPolicyBL ) )", + "( 1.2.840.113556.1.5.194 NAME 'msCOM-PartitionSet' SUP top STRUCTURAL MAY (msCOM-PartitionLink $ msCOM-DefaultPartitionLink $ msCOM-ObjectId ) )", + "( 1.2.840.113556.1.5.242 NAME 'msDS-QuotaContainer' SUP top STRUCTURAL MUST (cn ) MAY (msDS-DefaultQuota $ msDS-TombstoneQuotaFactor $ msDS-QuotaEffective $ msDS-QuotaUsed $ msDS-TopQuotaUsage ) )", + "( 1.2.840.113556.1.5.281 NAME 'msDS-ClaimsTransformationPolicies' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.146 NAME 'remoteStorageServicePoint' SUP serviceAdministrationPoint STRUCTURAL MAY (remoteStorageGUID ) )", + "( 1.2.840.113556.1.5.2 NAME 'samDomainBase' SUP top AUXILIARY MAY (nTSecurityDescriptor $ creationTime $ forceLogoff $ lockoutDuration $ lockOutObservationWindow $ lockoutThreshold $ maxPwdAge $ minPwdAge $ minPwdLength $ modifiedCountAtLastProm $ nextRid $ pwdProperties $ pwdHistoryLength $ revision $ objectSid $ oEMInformation $ serverState $ uASCompat $ serverRole $ domainReplica $ modifiedCount ) )", + "( 1.2.840.113556.1.5.132 NAME 'dHCPClass' SUP top STRUCTURAL MUST (dhcpUniqueKey $ dhcpType $ dhcpFlags $ dhcpIdentification ) MAY (networkAddress $ dhcpObjName $ dhcpObjDescription $ dhcpServers $ dhcpSubnets $ dhcpMask $ dhcpRanges $ dhcpSites $ dhcpReservations $ superScopes $ superScopeDescription $ optionDescription $ optionsLocation $ dhcpOptions $ dhcpClasses $ mscopeId $ dhcpState $ dhcpProperties $ dhcpMaxKey $ dhcpUpdateTime ) )", + "( 1.2.840.113556.1.5.283 NAME 'msDS-CloudExtensions' SUP top AUXILIARY MAY (msDS-cloudExtensionAttribute1 $ msDS-cloudExtensionAttribute2 $ msDS-cloudExtensionAttribute3 $ msDS-cloudExtensionAttribute4 $ msDS-cloudExtensionAttribute5 $ msDS-cloudExtensionAttribute6 $ msDS-cloudExtensionAttribute7 $ msDS-cloudExtensionAttribute8 $ msDS-cloudExtensionAttribute9 $ msDS-cloudExtensionAttribute10 $ msDS-cloudExtensionAttribute11 $ msDS-cloudExtensionAttribute12 $ msDS-cloudExtensionAttribute13 $ msDS-cloudExtensionAttribute14 $ msDS-cloudExtensionAttribute15 $ msDS-cloudExtensionAttribute16 $ msDS-cloudExtensionAttribute17 $ msDS-cloudExtensionAttribute18 $ msDS-cloudExtensionAttribute19 $ msDS-cloudExtensionAttribute20 ) )", + "( 1.2.840.113556.1.5.89 NAME 'nTFRSSettings' SUP applicationSettings STRUCTURAL MAY (fRSExtensions $ managedBy ) )", + "( 1.2.840.113556.1.5.24 NAME 'remoteMailRecipient' SUP top STRUCTURAL MAY (remoteSource $ remoteSourceType $ managedBy ) )", + "( 1.2.840.113556.1.5.221 NAME 'msTAPI-RtConference' SUP top STRUCTURAL MUST (msTAPI-uid ) MAY (msTAPI-ProtocolId $ msTAPI-ConferenceBlob ) )", + "( 1.2.840.113556.1.5.201 NAME 'msWMI-SimplePolicyTemplate' SUP msWMI-PolicyTemplate STRUCTURAL MUST (msWMI-TargetObject ) )", + "( 1.2.840.113556.1.6.18.2.212 NAME 'msSFU30NetId' SUP top STRUCTURAL MAY (msSFU30Name $ msSFU30KeyValues $ msSFU30NisDomain $ nisMapName ) )", + "( 1.2.840.113556.1.5.49 NAME 'packageRegistration' SUP top STRUCTURAL MAY (msiScriptPath $ cOMClassID $ cOMInterfaceID $ cOMProgID $ localeID $ machineArchitecture $ iconPath $ cOMTypelibId $ vendor $ packageType $ setupCommand $ packageName $ packageFlags $ versionNumberHi $ versionNumberLo $ lastUpdateSequence $ managedBy $ msiFileList $ categories $ upgradeProductCode $ msiScript $ canUpgradeScript $ fileExtPriority $ productCode $ msiScriptName $ msiScriptSize $ installUiLevel ) )", + "( 1.2.840.113556.1.5.139 NAME 'lostAndFound' SUP top STRUCTURAL MAY (moveTreeState ) )", + "( 1.2.840.113556.1.5.14 NAME 'connectionPoint' SUP leaf ABSTRACT MUST (cn ) MAY (keywords $ managedBy $ msDS-Settings ) )", + "( 1.2.840.113556.1.5.6 NAME 'securityPrincipal' SUP top AUXILIARY MUST (objectSid $ sAMAccountName ) MAY (nTSecurityDescriptor $ securityIdentifier $ supplementalCredentials $ rid $ sAMAccountType $ sIDHistory $ altSecurityIdentities $ tokenGroups $ tokenGroupsNoGCAcceptable $ accountNameHistory $ tokenGroupsGlobalAndUniversal $ msDS-KeyVersionNumber ) )", + "( 1.2.840.113556.1.5.147 NAME 'siteLink' SUP top STRUCTURAL MUST (siteList ) MAY (cost $ schedule $ options $ replInterval ) )", + "( 1.2.840.113556.1.5.255 NAME 'msDS-PasswordSettings' SUP top STRUCTURAL MUST (msDS-MaximumPasswordAge $ msDS-MinimumPasswordAge $ msDS-MinimumPasswordLength $ msDS-PasswordHistoryLength $ msDS-PasswordComplexityEnabled $ msDS-PasswordReversibleEncryptionEnabled $ msDS-LockoutObservationWindow $ msDS-LockoutDuration $ msDS-LockoutThreshold $ msDS-PasswordSettingsPrecedence ) MAY (msDS-PSOAppliesTo ) )", + "( 1.2.840.113556.1.4.2162 NAME 'msAuthz-CentralAccessRules' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.30 NAME 'serviceInstance' SUP connectionPoint STRUCTURAL MUST (displayName $ serviceClassID ) MAY (winsockAddresses $ serviceInstanceVersion ) )", + "( 1.2.840.113556.1.5.156 NAME 'rRASAdministrationDictionary' SUP top STRUCTURAL MAY (msRRASVendorAttributeEntry ) )", + "( 1.2.840.113556.1.4.2164 NAME 'msAuthz-CentralAccessPolicy' SUP top STRUCTURAL MAY (msAuthz-CentralAccessPolicyID $ msAuthz-MemberRulesInCentralAccessPolicy ) )", + "( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' SUP user STRUCTURAL MAY (o $ businessCategory $ userCertificate $ givenName $ initials $ x500uniqueIdentifier $ displayName $ employeeNumber $ employeeType $ homePostalAddress $ userSMIMECertificate $ uid $ mail $ roomNumber $ photo $ manager $ homePhone $ secretary $ mobile $ pager $ audio $ jpegPhoto $ carLicense $ departmentNumber $ preferredLanguage $ userPKCS12 $ labeledURI ) )", + "( 1.2.840.113556.1.5.52 NAME 'fileLinkTracking' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.18 NAME 'domainPolicy' SUP leaf STRUCTURAL MAY (authenticationOptions $ forceLogoff $ defaultLocalPolicyObject $ lockoutDuration $ lockOutObservationWindow $ lockoutThreshold $ maxPwdAge $ maxRenewAge $ maxTicketAge $ minPwdAge $ minPwdLength $ minTicketAge $ pwdProperties $ pwdHistoryLength $ proxyLifetime $ eFSPolicy $ publicKeyPolicy $ domainWidePolicy $ domainPolicyReference $ qualityOfService $ ipsecPolicyReference $ managedBy $ domainCAs ) )", + "( 1.2.840.113556.1.6.18.2.216 NAME 'msSFU30NetworkUser' SUP top STRUCTURAL MAY (msSFU30Name $ msSFU30KeyValues $ msSFU30NisDomain $ nisMapName ) )", + "( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject' SUP top AUXILIARY MAY (userPassword ) )", + "( 1.2.840.113556.1.5.177 NAME 'pKICertificateTemplate' SUP top STRUCTURAL MAY (displayName $ flags $ pKIDefaultKeySpec $ pKIKeyUsage $ pKIMaxIssuingDepth $ pKICriticalExtensions $ pKIExpirationPeriod $ pKIOverlapPeriod $ pKIExtendedKeyUsage $ pKIDefaultCSPs $ pKIEnrollmentAccess $ msPKI-RA-Signature $ msPKI-Enrollment-Flag $ msPKI-Private-Key-Flag $ msPKI-Certificate-Name-Flag $ msPKI-Minimal-Key-Size $ msPKI-Template-Schema-Version $ msPKI-Template-Minor-Revision $ msPKI-Cert-Template-OID $ msPKI-Supersede-Templates $ msPKI-RA-Policies $ msPKI-Certificate-Policy $ msPKI-Certificate-Application-Policy $ msPKI-RA-Application-Policies ) )", + "( 1.2.840.113556.1.5.293 NAME 'msDS-AuthNPolicies' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.6.13.4.2 NAME 'msDFSR-Subscriber' SUP top STRUCTURAL MUST (msDFSR-ReplicationGroupGuid $ msDFSR-MemberReference ) MAY (msDFSR-Extension $ msDFSR-Flags $ msDFSR-Options $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.5.31 NAME 'site' SUP top STRUCTURAL MAY (location $ notificationList $ managedBy $ gPLink $ gPOptions $ mSMQSiteID $ mSMQNt4Stub $ mSMQSiteForeign $ mSMQInterval1 $ mSMQInterval2 $ msDS-BridgeHeadServersUsed ) )", + "( 1.2.840.113556.1.5.222 NAME 'msTAPI-RtPerson' SUP top STRUCTURAL MAY (msTAPI-uid $ msTAPI-IpAddress ) )", + "( 1.2.840.113556.1.5.68 NAME 'applicationSiteSettings' SUP top ABSTRACT MAY (applicationName $ notificationList ) )", + "( 1.2.840.113556.1.3.14 NAME 'attributeSchema' SUP top STRUCTURAL MUST (cn $ attributeID $ attributeSyntax $ isSingleValued $ oMSyntax $ lDAPDisplayName $ schemaIDGUID ) MAY (rangeLower $ rangeUpper $ mAPIID $ linkID $ oMObjectClass $ searchFlags $ extendedCharsAllowed $ schemaFlagsEx $ attributeSecurityGUID $ systemOnly $ classDisplayName $ isMemberOfPartialAttributeSet $ isDefunct $ isEphemeral $ msDs-Schema-Extensions $ msDS-IntId ) )", + "( 1.2.840.113556.1.5.267 NAME 'msSPP-ActivationObject' SUP top STRUCTURAL MUST (msSPP-CSVLKSkuId $ msSPP-KMSIds $ msSPP-CSVLKPid $ msSPP-CSVLKPartialProductKey ) MAY (msSPP-InstallationId $ msSPP-ConfirmationId $ msSPP-OnlineLicense $ msSPP-PhoneLicense $ msSPP-ConfigLicense $ msSPP-IssuanceLicense ) )", + "( 1.2.840.113556.1.5.220 NAME 'msDS-App-Configuration' SUP applicationSettings STRUCTURAL MAY (owner $ keywords $ managedBy $ msDS-ByteArray $ msDS-DateTime $ msDS-Integer $ msDS-ObjectReference ) )", + "( 1.2.840.113556.1.3.23 NAME 'container' SUP top STRUCTURAL MUST (cn ) MAY (schemaVersion $ defaultClassStore $ msDS-ObjectReference ) )", + "( 1.2.840.113556.1.6.13.4.10 NAME 'msDFSR-Connection' SUP top STRUCTURAL MUST (fromServer ) MAY (msDFSR-Extension $ msDFSR-Enabled $ msDFSR-Schedule $ msDFSR-Keywords $ msDFSR-Flags $ msDFSR-Options $ msDFSR-RdcEnabled $ msDFSR-RdcMinFileSizeInKb $ msDFSR-Priority $ msDFSR-DisablePacketPrivacy $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.5.207 NAME 'msWMI-UintRangeParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-IntDefault ) MAY (msWMI-IntMax $ msWMI-IntMin ) )", + "( 1.2.840.113556.1.5.23 NAME 'printQueue' SUP connectionPoint STRUCTURAL MUST (uNCName $ versionNumber $ serverName $ printerName $ shortServerName ) MAY (location $ portName $ driverName $ printSeparatorFile $ priority $ defaultPriority $ printStartTime $ printEndTime $ printFormName $ printBinNames $ printMaxResolutionSupported $ printOrientationsSupported $ printMaxCopies $ printCollate $ printColor $ printLanguage $ printAttributes $ printShareName $ printOwner $ printNotify $ printStatus $ printSpooling $ printKeepPrintedJobs $ driverVersion $ printMaxXExtent $ printMaxYExtent $ printMinXExtent $ printMinYExtent $ printStaplingSupported $ printMemory $ assetNumber $ bytesPerMinute $ printRate $ printRateUnit $ printNetworkAddress $ printMACAddress $ printMediaReady $ printNumberUp $ printMediaSupported $ operatingSystem $ operatingSystemVersion $ operatingSystemServicePack $ operatingSystemHotfix $ physicalLocationObject $ printPagesPerMinute $ printDuplexSupported ) )", + "( 1.2.840.113556.1.5.260 NAME 'msDFS-DeletedLinkv2' SUP top STRUCTURAL MUST (msDFS-NamespaceIdentityGUIDv2 $ msDFS-LastModifiedv2 $ msDFS-LinkPathv2 $ msDFS-LinkIdentityGUIDv2 ) MAY (msDFS-Commentv2 $ msDFS-ShortNameLinkPathv2 ) )", + "( 1.2.840.113556.1.5.140 NAME 'interSiteTransportContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.130 NAME 'indexServerCatalog' SUP connectionPoint STRUCTURAL MUST (creator ) MAY (uNCName $ queryPoint $ indexedScopes $ friendlyNames ) )", + "( 1.2.840.113556.1.5.98 NAME 'ipsecPolicy' SUP ipsecBase STRUCTURAL MAY (ipsecISAKMPReference $ ipsecNFAReference ) )", + "( 2.5.6.0 NAME 'top' ABSTRACT MUST (objectClass $ instanceType $ nTSecurityDescriptor $ objectCategory ) MAY (cn $ description $ distinguishedName $ whenCreated $ whenChanged $ subRefs $ displayName $ uSNCreated $ isDeleted $ dSASignature $ objectVersion $ repsTo $ repsFrom $ memberOf $ ownerBL $ uSNChanged $ uSNLastObjRem $ showInAdvancedViewOnly $ adminDisplayName $ proxyAddresses $ adminDescription $ extensionName $ uSNDSALastObjRemoved $ displayNamePrintable $ directReports $ wWWHomePage $ USNIntersite $ name $ objectGUID $ replPropertyMetaData $ replUpToDateVector $ flags $ revision $ wbemPath $ fSMORoleOwner $ systemFlags $ siteObjectBL $ serverReferenceBL $ nonSecurityMemberBL $ queryPolicyBL $ wellKnownObjects $ isPrivilegeHolder $ partialAttributeSet $ managedObjects $ partialAttributeDeletionList $ url $ lastKnownParent $ bridgeheadServerListBL $ netbootSCPBL $ isCriticalSystemObject $ frsComputerReferenceBL $ fRSMemberReferenceBL $ uSNSource $ fromEntry $ allowedChildClasses $ allowedChildClassesEffective $ allowedAttributes $ allowedAttributesEffective $ possibleInferiors $ canonicalName $ proxiedObjectName $ sDRightsEffective $ dSCorePropagationData $ otherWellKnownObjects $ mS-DS-ConsistencyGuid $ mS-DS-ConsistencyChildCount $ masteredBy $ msCOM-PartitionSetLink $ msCOM-UserLink $ msDS-Approx-Immed-Subordinates $ msDS-NCReplCursors $ msDS-NCReplInboundNeighbors $ msDS-NCReplOutboundNeighbors $ msDS-ReplAttributeMetaData $ msDS-ReplValueMetaData $ msDS-NonMembersBL $ msDS-MembersForAzRoleBL $ msDS-OperationsForAzTaskBL $ msDS-TasksForAzTaskBL $ msDS-OperationsForAzRoleBL $ msDS-TasksForAzRoleBL $ msDs-masteredBy $ msDS-ObjectReferenceBL $ msDS-PrincipalName $ msDS-RevealedDSAs $ msDS-KrbTgtLinkBl $ msDS-IsFullReplicaFor $ msDS-IsDomainFor $ msDS-IsPartialReplicaFor $ msDS-AuthenticatedToAccountlist $ msDS-NC-RO-Replica-Locations-BL $ msDS-RevealedListBL $ msDS-PSOApplied $ msDS-NcType $ msDS-OIDToGroupLinkBl $ msDS-HostServiceAccountBL $ isRecycled $ msDS-LocalEffectiveDeletionTime $ msDS-LocalEffectiveRecycleTime $ msDS-LastKnownRDN $ msDS-EnabledFeatureBL $ msDS-ClaimSharesPossibleValuesWithBL $ msDS-MembersOfResourcePropertyListBL $ msDS-IsPrimaryComputerFor $ msDS-ValueTypeReferenceBL $ msDS-TDOIngressBL $ msDS-TDOEgressBL $ msDS-parentdistname $ msDS-ReplValueMetaDataExt $ msds-memberOfTransitive $ msds-memberTransitive $ structuralObjectClass $ createTimeStamp $ modifyTimeStamp $ subSchemaSubEntry $ msSFU30PosixMemberOf $ msDFSR-MemberReferenceBL $ msDFSR-ComputerReferenceBL ) )", + "( 1.2.840.113556.1.5.36 NAME 'volume' SUP connectionPoint STRUCTURAL MUST (uNCName ) MAY (contentIndexingAllowed $ lastContentIndexed ) )", + "( 1.2.840.113556.1.5.236 NAME 'msDS-AzOperation' SUP top STRUCTURAL MUST (msDS-AzOperationID ) MAY (description $ msDS-AzApplicationData $ msDS-AzObjectGuid $ msDS-AzGenericData ) )", + "( 2.5.6.9 NAME 'groupOfNames' SUP top STRUCTURAL MUST (cn $ member ) MAY (o $ ou $ businessCategory $ owner $ seeAlso ) )", + "( 1.2.840.113556.1.5.12 NAME 'configuration' SUP top STRUCTURAL MUST (cn ) MAY (gPLink $ gPOptions $ msDS-USNLastSyncSuccess ) )", + "( 1.2.840.113556.1.5.78 NAME 'licensingSiteSettings' SUP applicationSiteSettings STRUCTURAL MAY (siteServer ) )", + "( 1.2.840.113556.1.5.69 NAME 'nTDSSiteSettings' SUP applicationSiteSettings STRUCTURAL MAY (schedule $ options $ queryPolicyObject $ managedBy $ interSiteTopologyGenerator $ interSiteTopologyRenew $ interSiteTopologyFailover $ msDS-Preferred-GC-Site ) )", + "( 1.2.840.113556.1.5.269 NAME 'msDS-ClaimTypePropertyBase' SUP top ABSTRACT MAY (Enabled $ msDS-ClaimPossibleValues $ msDS-ClaimSharesPossibleValuesWith ) )", + "( 1.2.840.113556.1.5.273 NAME 'msDS-ResourceProperty' SUP msDS-ClaimTypePropertyBase STRUCTURAL MUST (msDS-ValueTypeReference ) MAY (msDS-IsUsedAsResourceSecurityAttribute $ msDS-AppliesToResourceTypes ) )", + "( 1.2.840.113556.1.5.239 NAME 'msDS-AzRole' SUP top STRUCTURAL MAY (description $ msDS-MembersForAzRole $ msDS-OperationsForAzRole $ msDS-TasksForAzRole $ msDS-AzApplicationData $ msDS-AzObjectGuid $ msDS-AzGenericData ) )", + "( 1.3.6.1.1.1.2.12 NAME 'bootableDevice' SUP top AUXILIARY MAY (cn $ bootParameter $ bootFile ) )", + "( 1.2.840.113556.1.5.294 NAME 'msDS-AuthNPolicy' SUP top STRUCTURAL MAY (msDS-UserAllowedToAuthenticateTo $ msDS-UserAllowedToAuthenticateFrom $ msDS-UserTGTLifetime $ msDS-ComputerAllowedToAuthenticateTo $ msDS-ComputerTGTLifetime $ msDS-ServiceAllowedToAuthenticateTo $ msDS-ServiceAllowedToAuthenticateFrom $ msDS-ServiceTGTLifetime $ msDS-UserAuthNPolicyBL $ msDS-ComputerAuthNPolicyBL $ msDS-ServiceAuthNPolicyBL $ msDS-AssignedAuthNPolicyBL $ msDS-AuthNPolicyEnforced ) )", + "( 1.2.840.113556.1.5.86 NAME 'dnsNode' SUP top STRUCTURAL MUST (dc ) MAY (dnsRecord $ dNSProperty $ dNSTombstoned ) )", + "( 1.2.840.113556.1.5.210 NAME 'msWMI-StringSetParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-StringDefault ) MAY (msWMI-StringValidValues ) )", + "( 1.2.840.113556.1.5.264 NAME 'msDS-ManagedServiceAccount' SUP computer STRUCTURAL )", + "( 1.2.840.113556.1.5.15 NAME 'contact' SUP organizationalPerson STRUCTURAL MUST (cn ) MAY (notes $ msDS-SourceObjectDN ) )", + "( 1.3.6.1.1.1.2.0 NAME 'posixAccount' SUP top AUXILIARY MAY (cn $ description $ userPassword $ homeDirectory $ unixUserPassword $ uid $ uidNumber $ gidNumber $ gecos $ unixHomeDirectory $ loginShell ) )", + "( 1.2.840.113556.1.5.266 NAME 'msSPP-ActivationObjectsContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.217 NAME 'msWMI-ObjectEncoding' SUP top STRUCTURAL MUST (msWMI-ID $ msWMI-TargetObject $ msWMI-Class $ msWMI-Genus $ msWMI-intFlags1 $ msWMI-intFlags2 $ msWMI-intFlags3 $ msWMI-intFlags4 $ msWMI-Parm1 $ msWMI-Parm2 $ msWMI-Parm3 $ msWMI-Parm4 $ msWMI-ScopeGuid ) )", + "( 1.2.840.113556.1.5.33 NAME 'storage' SUP connectionPoint STRUCTURAL MAY (moniker $ monikerDisplayName $ iconPath ) )", + "( 1.2.840.113556.1.5.67 NAME 'domainDNS' SUP domain STRUCTURAL MAY (managedBy $ msDS-Behavior-Version $ msDS-AllowedDNSSuffixes $ msDS-USNLastSyncSuccess $ msDS-EnabledFeature ) )", + "( 1.2.840.113556.1.5.92 NAME 'linkTrackVolEntry' SUP leaf STRUCTURAL MAY (linkTrackSecret $ volTableIdxGUID $ volTableGUID $ currMachineId $ timeVolChange $ timeRefresh $ seqNotification $ objectCount ) )", + "( 1.3.6.1.1.1.2.11 NAME 'ieee802Device' SUP top AUXILIARY MAY (cn $ macAddress ) )", + "( 0.9.2342.19200300.100.4.17 NAME 'domainRelatedObject' SUP top AUXILIARY MAY (associatedDomain ) )", + "( 1.2.840.113556.1.5.235 NAME 'msDS-AzApplication' SUP top STRUCTURAL MAY (description $ msDS-AzApplicationName $ msDS-AzGenerateAudits $ msDS-AzClassId $ msDS-AzApplicationVersion $ msDS-AzApplicationData $ msDS-AzObjectGuid $ msDS-AzGenericData ) )", + "( 1.2.840.113556.1.5.107 NAME 'sitesContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.263 NAME 'msImaging-PostScanProcess' SUP top STRUCTURAL MUST (displayName $ msImaging-PSPIdentifier ) MAY (serverName $ msImaging-PSPString ) )", + "( 1.2.840.113556.1.5.240 NAME 'msieee80211-Policy' SUP top STRUCTURAL MAY (msieee80211-Data $ msieee80211-DataType $ msieee80211-ID ) )", + "( 1.2.840.113556.1.5.95 NAME 'subnetContainer' SUP top STRUCTURAL )", + "( 0.9.2342.19200300.100.4.6 NAME 'document' SUP top STRUCTURAL MAY (cn $ l $ o $ ou $ description $ seeAlso $ documentIdentifier $ documentTitle $ documentVersion $ documentAuthor $ documentLocation $ documentPublisher ) )", + "( 2.5.6.6 NAME 'person' SUP top STRUCTURAL MUST (cn ) MAY (sn $ serialNumber $ telephoneNumber $ seeAlso $ userPassword $ attributeCertificateAttribute ) )", + "( 1.2.840.113556.1.5.274 NAME 'msDS-ResourcePropertyList' SUP top STRUCTURAL MAY (msDS-MembersOfResourcePropertyList ) )", + "( 1.2.840.113556.1.5.270 NAME 'msDS-ClaimTypes' SUP top STRUCTURAL )", + "( 1.3.6.1.1.1.2.1 NAME 'shadowAccount' SUP top AUXILIARY MAY (description $ userPassword $ uid $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag ) )", + "( 1.2.840.113556.1.5.179 NAME 'mSMQMigratedUser' SUP top STRUCTURAL MAY (objectSid $ mSMQSignCertificates $ mSMQDigests $ mSMQDigestsMig $ mSMQSignCertificatesMig $ mSMQUserSid ) )", + "( 1.2.840.113556.1.5.185 NAME 'mS-SQL-OLAPServer' SUP serviceConnectionPoint STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-RegisteredOwner $ mS-SQL-Contact $ mS-SQL-Build $ mS-SQL-ServiceAccount $ mS-SQL-Status $ mS-SQL-InformationURL $ mS-SQL-PublicationURL $ mS-SQL-Version $ mS-SQL-Language $ mS-SQL-Keywords ) )", + "( 1.3.6.1.4.1.1466.101.119.2 NAME 'dynamicObject' SUP top AUXILIARY MAY (msDS-Entry-Time-To-Die $ entryTTL ) )", + "( 1.2.840.113556.1.5.155 NAME 'nTFRSSubscriber' SUP top STRUCTURAL MUST (fRSRootPath $ fRSStagingPath ) MAY (schedule $ fRSUpdateTimeout $ fRSFaultCondition $ fRSServiceCommand $ fRSExtensions $ fRSFlags $ fRSMemberReference $ fRSServiceCommandStatus $ fRSTimeLastCommand $ fRSTimeLastConfigChange ) )", + "( 1.2.840.113556.1.5.129 NAME 'rIDSet' SUP top STRUCTURAL MUST (rIDAllocationPool $ rIDPreviousAllocationPool $ rIDUsedPool $ rIDNextRID ) )", + "( 1.2.840.113556.1.3.58 NAME 'addressTemplate' SUP displayTemplate STRUCTURAL MUST (displayName ) MAY (addressSyntax $ perMsgDialogDisplayTable $ perRecipDialogDisplayTable $ addressType $ proxyGenerationEnabled ) )", + "( 1.2.840.113556.1.5.154 NAME 'nTFRSSubscriptions' SUP top STRUCTURAL MAY (fRSWorkingPath $ fRSExtensions $ fRSVersion ) )", + "( 1.2.840.113556.1.5.7000.47 NAME 'nTDSDSA' SUP applicationSettings STRUCTURAL MAY (hasMasterNCs $ hasPartialReplicaNCs $ dMDLocation $ invocationId $ networkAddress $ options $ fRSRootPath $ serverReference $ lastBackupRestorationTime $ queryPolicyObject $ managedBy $ retiredReplDSASignatures $ msDS-Behavior-Version $ msDS-HasInstantiatedNCs $ msDS-ReplicationEpoch $ msDS-HasDomainNCs $ msDS-RetiredReplNCSignatures $ msDS-hasMasterNCs $ msDS-RevealedUsers $ msDS-hasFullReplicaNCs $ msDS-NeverRevealGroup $ msDS-RevealOnDemandGroup $ msDS-isGC $ msDS-isRODC $ msDS-SiteName $ msDS-IsUserCachableAtRodc $ msDS-EnabledFeature ) )", + "( 1.2.840.113556.1.5.175 NAME 'infrastructureUpdate' SUP top STRUCTURAL MAY (dNReferenceUpdate ) )", + "( 1.2.840.113556.1.6.18.2.215 NAME 'msSFU30DomainInfo' SUP top STRUCTURAL MAY (msSFU30SearchContainer $ msSFU30MasterServerName $ msSFU30OrderNumber $ msSFU30Domains $ msSFU30YpServers $ msSFU30MaxGidNumber $ msSFU30MaxUidNumber $ msSFU30IsValidContainer $ msSFU30CryptMethod ) )", + "( 1.2.840.113556.1.5.213 NAME 'msWMI-Som' SUP top STRUCTURAL MUST (msWMI-ID $ msWMI-Name ) MAY (msWMI-Author $ msWMI-ChangeDate $ msWMI-CreationDate $ msWMI-SourceOrganization $ msWMI-intFlags1 $ msWMI-intFlags2 $ msWMI-intFlags3 $ msWMI-intFlags4 $ msWMI-Parm1 $ msWMI-Parm2 $ msWMI-Parm3 $ msWMI-Parm4 ) )", + "( 1.2.840.113556.1.5.82 NAME 'rpcProfile' SUP rpcEntry STRUCTURAL )", + "( 1.2.840.113556.1.5.164 NAME 'mSMQSiteLink' SUP top STRUCTURAL MUST (mSMQSite1 $ mSMQSite2 $ mSMQCost ) MAY (mSMQSiteGates $ mSMQSiteGatesMig ) )", + "( 1.2.840.113556.1.5.184 NAME 'mS-SQL-SQLServer' SUP serviceConnectionPoint STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-RegisteredOwner $ mS-SQL-Contact $ mS-SQL-Location $ mS-SQL-Memory $ mS-SQL-Build $ mS-SQL-ServiceAccount $ mS-SQL-CharacterSet $ mS-SQL-SortOrder $ mS-SQL-UnicodeSortOrder $ mS-SQL-Clustered $ mS-SQL-NamedPipe $ mS-SQL-MultiProtocol $ mS-SQL-SPX $ mS-SQL-TCPIP $ mS-SQL-AppleTalk $ mS-SQL-Vines $ mS-SQL-Status $ mS-SQL-LastUpdatedDate $ mS-SQL-InformationURL $ mS-SQL-GPSLatitude $ mS-SQL-GPSLongitude $ mS-SQL-GPSHeight $ mS-SQL-Keywords ) )", + "( 1.2.840.113556.1.5.106 NAME 'queryPolicy' SUP top STRUCTURAL MAY (lDAPAdminLimits $ lDAPIPDenyList ) )", + "( 1.2.840.113556.1.5.162 NAME 'mSMQConfiguration' SUP top STRUCTURAL MAY (mSMQQuota $ mSMQJournalQuota $ mSMQOwnerID $ mSMQSites $ mSMQOutRoutingServers $ mSMQInRoutingServers $ mSMQServiceType $ mSMQComputerType $ mSMQForeign $ mSMQOSType $ mSMQEncryptKey $ mSMQSignKey $ mSMQDependentClientServices $ mSMQRoutingServices $ mSMQDsServices $ mSMQComputerTypeEx ) )", + "( 1.2.840.113556.1.5.257 NAME 'msDFS-NamespaceAnchor' SUP top STRUCTURAL MUST (msDFS-SchemaMajorVersion ) )", + "( 1.2.840.113556.1.6.13.4.7 NAME 'msDFSR-ContentSet' SUP top STRUCTURAL MAY (description $ msDFSR-Extension $ msDFSR-RootSizeInMb $ msDFSR-StagingSizeInMb $ msDFSR-ConflictSizeInMb $ msDFSR-FileFilter $ msDFSR-DirectoryFilter $ msDFSR-Flags $ msDFSR-Options $ msDFSR-DfsPath $ msDFSR-Priority $ msDFSR-DeletedSizeInMb $ msDFSR-DefaultCompressionExclusionFilter $ msDFSR-OnDemandExclusionFileFilter $ msDFSR-OnDemandExclusionDirectoryFilter $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.5.276 NAME 'msTPM-InformationObjectsContainer' SUP top STRUCTURAL MUST (cn ) )", + "( 1.2.840.113556.1.5.209 NAME 'msWMI-RealRangeParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-Int8Default ) MAY (msWMI-Int8Max $ msWMI-Int8Min ) )", + "( 2.5.6.7 NAME 'organizationalPerson' SUP person STRUCTURAL MAY (c $ l $ st $ street $ o $ ou $ title $ postalAddress $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ telexNumber $ teletexTerminalIdentifier $ facsimileTelephoneNumber $ x121Address $ internationalISDNNumber $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ givenName $ initials $ generationQualifier $ houseIdentifier $ otherTelephone $ otherPager $ co $ department $ company $ streetAddress $ otherHomePhone $ msExchHouseIdentifier $ personalTitle $ homePostalAddress $ countryCode $ employeeID $ comment $ division $ otherFacsimileTelephoneNumber $ otherMobile $ primaryTelexNumber $ primaryInternationalISDNNumber $ mhsORAddress $ otherMailbox $ assistant $ ipPhone $ otherIpPhone $ msDS-AllowedToDelegateTo $ msDS-PhoneticFirstName $ msDS-PhoneticLastName $ msDS-PhoneticDepartment $ msDS-PhoneticCompanyName $ msDS-PhoneticDisplayName $ msDS-HABSeniorityIndex $ msDS-AllowedToActOnBehalfOfOtherIdentity $ mail $ manager $ homePhone $ mobile $ pager $ middleName $ thumbnailPhoto $ thumbnailLogo ) )", + "( 1.2.840.113556.1.5.176 NAME 'msExchConfigurationContainer' SUP container STRUCTURAL MAY (addressBookRoots $ globalAddressList $ templateRoots $ addressBookRoots2 $ globalAddressList2 $ templateRoots2 ) )", + "( 1.2.840.113556.1.5.278 NAME 'msKds-ProvRootKey' SUP top STRUCTURAL MUST (cn $ msKds-KDFAlgorithmID $ msKds-SecretAgreementAlgorithmID $ msKds-PublicKeyLength $ msKds-PrivateKeyLength $ msKds-RootKeyData $ msKds-Version $ msKds-DomainID $ msKds-UseStartTime $ msKds-CreateTime ) MAY (msKds-KDFParam $ msKds-SecretAgreementParam ) )", + "( 1.2.840.113556.1.5.238 NAME 'msDS-AzTask' SUP top STRUCTURAL MAY (description $ msDS-AzBizRule $ msDS-AzBizRuleLanguage $ msDS-AzLastImportedBizRulePath $ msDS-OperationsForAzTask $ msDS-TasksForAzTask $ msDS-AzTaskIsRoleDefinition $ msDS-AzApplicationData $ msDS-AzObjectGuid $ msDS-AzGenericData ) )", + "( 1.2.840.113556.1.5.282 NAME 'msDS-GroupManagedServiceAccount' SUP computer STRUCTURAL MUST (msDS-ManagedPasswordInterval ) MAY (msDS-ManagedPassword $ msDS-ManagedPasswordId $ msDS-ManagedPasswordPreviousId $ msDS-GroupMSAMembership ) )", + "( 1.3.6.1.1.1.2.9 NAME 'nisMap' SUP top STRUCTURAL MUST (cn $ nisMapName ) MAY (description ) )", + "( 1.3.6.1.1.1.2.10 NAME 'nisObject' SUP top STRUCTURAL MUST (cn $ nisMapName $ nisMapEntry ) MAY (description $ msSFU30Name $ msSFU30NisDomain ) )", + "( 1.2.840.113556.1.5.277 NAME 'msKds-ProvServerConfiguration' SUP top STRUCTURAL MUST (msKds-Version ) MAY (msKds-KDFAlgorithmID $ msKds-KDFParam $ msKds-SecretAgreementAlgorithmID $ msKds-SecretAgreementParam $ msKds-PublicKeyLength $ msKds-PrivateKeyLength ) )", + "( 1.2.840.113556.1.6.18.2.217 NAME 'msSFU30NISMapConfig' SUP top STRUCTURAL MAY (msSFU30KeyAttributes $ msSFU30FieldSeparator $ msSFU30IntraFieldSeparator $ msSFU30SearchAttributes $ msSFU30ResultAttributes $ msSFU30MapFilter $ msSFU30NSMAPFieldPosition ) )", + "( 1.2.840.113556.1.5.7000.48 NAME 'serversContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.90 NAME 'linkTrackVolumeTable' SUP fileLinkTracking STRUCTURAL )", + "( 1.2.840.113556.1.5.188 NAME 'mS-SQL-SQLDatabase' SUP top STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-Contact $ mS-SQL-Status $ mS-SQL-InformationURL $ mS-SQL-Description $ mS-SQL-Alias $ mS-SQL-Size $ mS-SQL-CreationDate $ mS-SQL-LastBackupDate $ mS-SQL-LastDiagnosticDate $ mS-SQL-Applications $ mS-SQL-Keywords ) )", + "( 1.2.840.113556.1.5.211 NAME 'msWMI-PolicyType' SUP top STRUCTURAL MUST (msWMI-ID $ msWMI-TargetObject ) MAY (msWMI-Author $ msWMI-ChangeDate $ msWMI-CreationDate $ msWMI-SourceOrganization $ msWMI-intFlags1 $ msWMI-intFlags2 $ msWMI-intFlags3 $ msWMI-intFlags4 $ msWMI-Parm1 $ msWMI-Parm2 $ msWMI-Parm3 $ msWMI-Parm4 ) )", + "( 1.2.840.113556.1.5.183 NAME 'dSUISettings' SUP top STRUCTURAL MAY (dSUIAdminNotification $ dSUIAdminMaximum $ dSUIShellMaximum $ msDS-Security-Group-Extra-Classes $ msDS-Non-Security-Group-Extra-Classes $ msDS-FilterContainers ) )", + "( 1.2.840.113556.1.5.157 NAME 'groupPolicyContainer' SUP container STRUCTURAL MAY (flags $ versionNumber $ gPCFunctionalityVersion $ gPCFileSysPath $ gPCMachineExtensionNames $ gPCUserExtensionNames $ gPCWQLFilter ) )", + "( 1.2.840.113556.1.5.3 NAME 'samDomain' SUP top AUXILIARY MAY (description $ cACertificate $ builtinCreationTime $ builtinModifiedCount $ creationTime $ domainPolicyObject $ defaultLocalPolicyObject $ lockoutDuration $ lockOutObservationWindow $ lSACreationTime $ lSAModifiedCount $ lockoutThreshold $ maxPwdAge $ minPwdAge $ minPwdLength $ modifiedCountAtLastProm $ nETBIOSName $ nextRid $ pwdProperties $ pwdHistoryLength $ privateKey $ replicaSource $ controlAccessRights $ auditingPolicy $ eFSPolicy $ desktopProfile $ nTMixedDomain $ rIDManagerReference $ treeName $ pekList $ pekKeyChangeInterval $ gPLink $ gPOptions $ ms-DS-MachineAccountQuota $ msDS-LogonTimeSyncInterval $ msDS-PerUserTrustQuota $ msDS-AllUsersTrustQuota $ msDS-PerUserTrustTombstonesQuota ) )", + "( 1.2.840.113556.1.5.234 NAME 'msDS-AzAdminManager' SUP top STRUCTURAL MAY (description $ msDS-AzDomainTimeout $ msDS-AzScriptEngineCacheMax $ msDS-AzScriptTimeout $ msDS-AzGenerateAudits $ msDS-AzApplicationData $ msDS-AzMajorVersion $ msDS-AzMinorVersion $ msDS-AzObjectGuid $ msDS-AzGenericData ) )", + "( 1.2.840.113556.1.5.214 NAME 'msWMI-Rule' SUP top STRUCTURAL MUST (msWMI-Query $ msWMI-QueryLanguage $ msWMI-TargetNameSpace ) )", + "( 1.2.840.113556.1.5.254 NAME 'nTDSDSARO' SUP nTDSDSA STRUCTURAL )", + "( 1.2.840.113556.1.5.286 NAME 'msDS-Device' SUP top STRUCTURAL MUST (displayName $ altSecurityIdentities $ msDS-IsEnabled $ msDS-DeviceID ) MAY (msDS-DeviceOSType $ msDS-DeviceOSVersion $ msDS-DevicePhysicalIDs $ msDS-DeviceObjectVersion $ msDS-RegisteredOwner $ msDS-ApproximateLastLogonTimeStamp $ msDS-RegisteredUsers $ msDS-IsManaged $ msDS-CloudIsManaged $ msDS-CloudAnchor ) )", + "( 1.2.840.113556.1.5.34 NAME 'trustedDomain' SUP leaf STRUCTURAL MAY (securityIdentifier $ trustAuthIncoming $ trustDirection $ trustPartner $ trustPosixOffset $ trustAuthOutgoing $ trustType $ trustAttributes $ domainCrossRef $ flatName $ initialAuthIncoming $ initialAuthOutgoing $ domainIdentifier $ additionalTrustedServiceNames $ mS-DS-CreatorSID $ msDS-TrustForestTrustInfo $ msDS-SupportedEncryptionTypes $ msDS-IngressClaimsTransformationPolicy $ msDS-EgressClaimsTransformationPolicy ) )", + "( 0.9.2342.19200300.100.4.7 NAME 'room' SUP top STRUCTURAL MUST (cn ) MAY (description $ telephoneNumber $ seeAlso $ location $ roomNumber ) )", + "( 2.5.6.4 NAME 'organization' SUP top STRUCTURAL MUST (o ) MAY (l $ st $ street $ searchGuide $ businessCategory $ postalAddress $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ telephoneNumber $ telexNumber $ teletexTerminalIdentifier $ facsimileTelephoneNumber $ x121Address $ internationalISDNNumber $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ seeAlso $ userPassword ) )", + "( 1.2.840.113556.1.5.272 NAME 'msDS-ClaimType' SUP msDS-ClaimTypePropertyBase STRUCTURAL MAY (msDS-ClaimValueType $ msDS-ClaimAttributeSource $ msDS-ClaimTypeAppliesToClass $ msDS-ClaimSource $ msDS-ClaimSourceType $ msDS-ClaimIsValueSpaceRestricted $ msDS-ClaimIsSingleValued ) )", + "( 1.3.6.1.1.1.2.3 NAME 'ipService' SUP top STRUCTURAL MUST (cn $ ipServicePort $ ipServiceProtocol ) MAY (description $ msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ nisMapName ) )", + "( 1.3.6.1.1.1.2.4 NAME 'ipProtocol' SUP top STRUCTURAL MUST (cn $ ipProtocolNumber ) MAY (description $ msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ nisMapName ) )", + "( 1.2.840.113556.1.5.80 NAME 'rpcGroup' SUP rpcEntry STRUCTURAL MAY (rpcNsGroup $ rpcNsObjectID ) )", + "( 1.2.840.113556.1.5.17 NAME 'server' SUP top STRUCTURAL MAY (serialNumber $ serverReference $ dNSHostName $ managedBy $ mailAddress $ bridgeheadTransportList $ msDS-isGC $ msDS-isRODC $ msDS-SiteName $ msDS-IsUserCachableAtRodc ) )", + "( 1.2.840.113556.1.5.28 NAME 'secret' SUP leaf STRUCTURAL MAY (currentValue $ lastSetTime $ priorSetTime $ priorValue ) )", + "( 1.2.840.113556.1.5.163 NAME 'mSMQEnterpriseSettings' SUP top STRUCTURAL MAY (mSMQNameStyle $ mSMQCSPName $ mSMQLongLived $ mSMQVersion $ mSMQInterval1 $ mSMQInterval2 ) )", + "( 1.2.840.113556.1.5.202 NAME 'msWMI-MergeablePolicyTemplate' SUP msWMI-PolicyTemplate STRUCTURAL )", + "( 1.2.840.113556.1.5.195 NAME 'msPKI-Key-Recovery-Agent' SUP user STRUCTURAL )", + "( 0.9.2342.19200300.100.4.18 NAME 'friendlyCountry' SUP country STRUCTURAL MUST (co ) )", + "( 1.2.840.113556.1.5.258 NAME 'msDFS-Namespacev2' SUP top STRUCTURAL MUST (msDFS-SchemaMajorVersion $ msDFS-SchemaMinorVersion $ msDFS-GenerationGUIDv2 $ msDFS-NamespaceIdentityGUIDv2 $ msDFS-LastModifiedv2 $ msDFS-Ttlv2 $ msDFS-Propertiesv2 $ msDFS-TargetListv2 ) MAY (msDFS-Commentv2 ) )", + "( 1.2.840.113556.1.5.96 NAME 'subnet' SUP top STRUCTURAL MAY (location $ siteObject $ physicalLocationObject ) )", + "( 1.2.840.113556.1.5.216 NAME 'applicationVersion' SUP applicationSettings STRUCTURAL MAY (owner $ keywords $ versionNumber $ vendor $ versionNumberHi $ versionNumberLo $ managedBy $ appSchemaVersion ) )", + "( 2.5.6.10 NAME 'residentialPerson' SUP person STRUCTURAL MAY (l $ st $ street $ ou $ title $ businessCategory $ postalAddress $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ telexNumber $ teletexTerminalIdentifier $ facsimileTelephoneNumber $ x121Address $ internationalISDNNumber $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod ) )", + "( 2.5.6.19 NAME 'cRLDistributionPoint' SUP top STRUCTURAL MUST (cn ) MAY (authorityRevocationList $ certificateRevocationList $ deltaRevocationList $ cRLPartitionedRevocationList $ certificateAuthorityObject ) )", + "( 1.2.840.113556.1.5.137 NAME 'aCSPolicy' SUP top STRUCTURAL MAY (aCSTimeOfDay $ aCSDirection $ aCSMaxTokenRatePerFlow $ aCSMaxPeakBandwidthPerFlow $ aCSAggregateTokenRatePerUser $ aCSMaxDurationPerFlow $ aCSServiceType $ aCSTotalNoOfFlows $ aCSPriority $ aCSPermissionBits $ aCSIdentityName $ aCSMaxAggregatePeakRatePerUser $ aCSMaxTokenBucketPerFlow $ aCSMaximumSDUSize $ aCSMinimumPolicedSize $ aCSMinimumLatency $ aCSMinimumDelayVariation ) )", + "( 1.2.840.113556.1.5.77 NAME 'controlAccessRight' SUP top STRUCTURAL MAY (rightsGuid $ appliesTo $ localizationDisplayId $ validAccesses ) )", + "( 1.2.840.113556.1.5.219 NAME 'msMQ-Group' SUP top STRUCTURAL MUST (member ) )", + "( 1.2.840.113556.1.5.8 NAME 'group' SUP top STRUCTURAL MUST (groupType ) MAY (member $ nTGroupMembers $ operatorCount $ adminCount $ groupAttributes $ groupMembershipSAM $ controlAccessRights $ desktopProfile $ nonSecurityMember $ managedBy $ primaryGroupToken $ msDS-AzLDAPQuery $ msDS-NonMembers $ msDS-AzBizRule $ msDS-AzBizRuleLanguage $ msDS-AzLastImportedBizRulePath $ msDS-AzApplicationData $ msDS-AzObjectGuid $ msDS-AzGenericData $ msDS-PrimaryComputer $ mail $ msSFU30Name $ msSFU30NisDomain $ msSFU30PosixMember ) )", + "( 1.2.840.113556.1.6.23.2 NAME 'msPrint-ConnectionPolicy' SUP top STRUCTURAL MUST (cn ) MAY (uNCName $ serverName $ printAttributes $ printerName ) )", + "( 1.2.840.113556.1.3.11 NAME 'crossRef' SUP top STRUCTURAL MUST (cn $ nCName $ dnsRoot ) MAY (Enabled $ nETBIOSName $ nTMixedDomain $ trustParent $ superiorDNSRoot $ rootTrust $ msDS-Behavior-Version $ msDS-NC-Replica-Locations $ msDS-Replication-Notify-First-DSA-Delay $ msDS-Replication-Notify-Subsequent-DSA-Delay $ msDS-SDReferenceDomain $ msDS-DnsRootAlias $ msDS-NC-RO-Replica-Locations ) )", + "( 1.2.840.113556.1.6.13.4.9 NAME 'msDFSR-Member' SUP top STRUCTURAL MUST (msDFSR-ComputerReference ) MAY (serverReference $ msDFSR-Extension $ msDFSR-Keywords $ msDFSR-Flags $ msDFSR-Options $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.3.59 NAME 'displayTemplate' SUP top STRUCTURAL MUST (cn ) MAY (helpData32 $ originalDisplayTableMSDOS $ addressEntryDisplayTable $ helpFileName $ addressEntryDisplayTableMSDOS $ helpData16 $ originalDisplayTable ) )", + "( 1.2.840.113556.1.3.13 NAME 'classSchema' SUP top STRUCTURAL MUST (cn $ subClassOf $ governsID $ objectClassCategory $ schemaIDGUID $ defaultObjectCategory ) MAY (possSuperiors $ mustContain $ mayContain $ rDNAttID $ auxiliaryClass $ lDAPDisplayName $ schemaFlagsEx $ systemOnly $ systemPossSuperiors $ systemMayContain $ systemMustContain $ systemAuxiliaryClass $ defaultSecurityDescriptor $ defaultHidingValue $ classDisplayName $ isDefunct $ msDs-Schema-Extensions $ msDS-IntId ) )", + "( 1.2.840.113556.1.5.200 NAME 'msWMI-PolicyTemplate' SUP top STRUCTURAL MUST (msWMI-ID $ msWMI-Name $ msWMI-NormalizedClass $ msWMI-TargetClass $ msWMI-TargetNameSpace $ msWMI-TargetPath ) MAY (msWMI-Author $ msWMI-ChangeDate $ msWMI-CreationDate $ msWMI-SourceOrganization $ msWMI-TargetType $ msWMI-intFlags1 $ msWMI-intFlags2 $ msWMI-intFlags3 $ msWMI-intFlags4 $ msWMI-Parm1 $ msWMI-Parm2 $ msWMI-Parm3 $ msWMI-Parm4 ) )", + "( 1.2.840.113556.1.5.165 NAME 'mSMQSettings' SUP top STRUCTURAL MAY (mSMQOwnerID $ mSMQServices $ mSMQQMID $ mSMQMigrated $ mSMQNt4Flags $ mSMQSiteName $ mSMQRoutingService $ mSMQDsService $ mSMQDependentClientService $ mSMQSiteNameEx ) )", + "( 1.3.6.1.1.1.2.5 NAME 'oncRpc' SUP top STRUCTURAL MUST (cn $ oncRpcNumber ) MAY (description $ msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ nisMapName ) )", + "( 1.2.840.113556.1.5.126 NAME 'serviceConnectionPoint' SUP connectionPoint STRUCTURAL MAY (versionNumber $ vendor $ versionNumberHi $ versionNumberLo $ serviceClassName $ serviceBindingInformation $ serviceDNSName $ serviceDNSNameType $ appSchemaVersion ) )", + "( 1.2.840.113556.1.5.4 NAME 'builtinDomain' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.241 NAME 'msDS-AppData' SUP applicationSettings STRUCTURAL MAY (owner $ keywords $ managedBy $ msDS-ByteArray $ msDS-DateTime $ msDS-Integer $ msDS-ObjectReference ) )", + "( 1.2.840.113556.1.5.73 NAME 'rpcServerElement' SUP rpcEntry STRUCTURAL MUST (rpcNsBindings $ rpcNsInterfaceID $ rpcNsTransferSyntax ) )", + "( 1.2.840.113556.1.5.150 NAME 'rRASAdministrationConnectionPoint' SUP serviceAdministrationPoint STRUCTURAL MAY (msRRASAttribute ) )", + "( 1.2.840.113556.1.5.191 NAME 'aCSResourceLimits' SUP top STRUCTURAL MAY (aCSMaxTokenRatePerFlow $ aCSMaxPeakBandwidthPerFlow $ aCSServiceType $ aCSAllocableRSVPBandwidth $ aCSMaxPeakBandwidth ) )", + "( 2.5.6.3 NAME 'locality' SUP top STRUCTURAL MUST (l ) MAY (st $ street $ searchGuide $ seeAlso ) )", + "( 1.3.6.1.1.1.2.6 NAME 'ipHost' SUP top AUXILIARY MAY (cn $ l $ description $ uid $ manager $ ipHostNumber ) )", + "( 1.2.840.113556.1.5.275 NAME 'msTPM-InformationObject' SUP top STRUCTURAL MUST (msTPM-OwnerInformation ) MAY (msTPM-SrkPubThumbprint $ msTPM-OwnerInformationTemp ) )", + "( 1.2.840.113556.1.5.289 NAME 'msDS-DeviceContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.4.2129 NAME 'msDNS-ServerSettings' SUP top STRUCTURAL MAY (msDNS-KeymasterZones ) )", + "( 1.2.840.113556.1.5.76 NAME 'foreignSecurityPrincipal' SUP top STRUCTURAL MUST (objectSid ) MAY (foreignIdentifier ) )", + "( 1.2.840.113556.1.5.44 NAME 'classStore' SUP top STRUCTURAL MAY (versionNumber $ nextLevelStore $ lastUpdateSequence $ appSchemaVersion ) )", + "( 0.9.2342.19200300.100.4.5 NAME 'account' SUP top STRUCTURAL MAY (l $ o $ ou $ description $ seeAlso $ uid $ host ) )", + "( 1.2.840.113556.1.5.26 NAME 'rpcProfileElement' SUP rpcEntry STRUCTURAL MUST (rpcNsInterfaceID $ rpcNsPriority ) MAY (rpcNsProfileEntry $ rpcNsAnnotation ) )", + "( 1.2.840.113556.1.5.215 NAME 'msWMI-WMIGPO' SUP top STRUCTURAL MUST (msWMI-TargetClass ) MAY (msWMI-intFlags1 $ msWMI-intFlags2 $ msWMI-intFlags3 $ msWMI-intFlags4 $ msWMI-Parm1 $ msWMI-Parm2 $ msWMI-Parm3 $ msWMI-Parm4 ) )", + "( 1.2.840.113556.1.5.243 NAME 'msDS-QuotaControl' SUP top STRUCTURAL MUST (cn $ msDS-QuotaTrustee $ msDS-QuotaAmount ) )", + "( 1.2.840.113556.1.5.256 NAME 'msDS-PasswordSettingsContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.187 NAME 'mS-SQL-SQLPublication' SUP top STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-Status $ mS-SQL-Description $ mS-SQL-Type $ mS-SQL-Database $ mS-SQL-AllowAnonymousSubscription $ mS-SQL-Publisher $ mS-SQL-AllowKnownPullSubscription $ mS-SQL-AllowImmediateUpdatingSubscription $ mS-SQL-AllowQueuedUpdatingSubscription $ mS-SQL-AllowSnapshotFilesFTPDownloading $ mS-SQL-ThirdParty ) )", + "( 1.2.840.113556.1.5.9 NAME 'user' SUP organizationalPerson STRUCTURAL MAY (o $ businessCategory $ userCertificate $ givenName $ initials $ x500uniqueIdentifier $ displayName $ networkAddress $ employeeNumber $ employeeType $ homePostalAddress $ userAccountControl $ badPwdCount $ codePage $ homeDirectory $ homeDrive $ badPasswordTime $ lastLogoff $ lastLogon $ dBCSPwd $ localeID $ scriptPath $ logonHours $ logonWorkstation $ maxStorage $ userWorkstations $ unicodePwd $ otherLoginWorkstations $ ntPwdHistory $ pwdLastSet $ preferredOU $ primaryGroupID $ userParameters $ profilePath $ operatorCount $ adminCount $ accountExpires $ lmPwdHistory $ groupMembershipSAM $ logonCount $ controlAccessRights $ defaultClassStore $ groupsToIgnore $ groupPriority $ desktopProfile $ dynamicLDAPServer $ userPrincipalName $ lockoutTime $ userSharedFolder $ userSharedFolderOther $ servicePrincipalName $ aCSPolicyName $ terminalServer $ mSMQSignCertificates $ mSMQDigests $ mSMQDigestsMig $ mSMQSignCertificatesMig $ msNPAllowDialin $ msNPCallingStationID $ msNPSavedCallingStationID $ msRADIUSCallbackNumber $ msRADIUSFramedIPAddress $ msRADIUSFramedRoute $ msRADIUSServiceType $ msRASSavedCallbackNumber $ msRASSavedFramedIPAddress $ msRASSavedFramedRoute $ mS-DS-CreatorSID $ msCOM-UserPartitionSetLink $ msDS-Cached-Membership $ msDS-Cached-Membership-Time-Stamp $ msDS-Site-Affinity $ msDS-User-Account-Control-Computed $ lastLogonTimestamp $ msIIS-FTPRoot $ msIIS-FTPDir $ msDRM-IdentityCertificate $ msDS-SourceObjectDN $ msPKIRoamingTimeStamp $ msPKIDPAPIMasterKeys $ msPKIAccountCredentials $ msRADIUS-FramedInterfaceId $ msRADIUS-SavedFramedInterfaceId $ msRADIUS-FramedIpv6Prefix $ msRADIUS-SavedFramedIpv6Prefix $ msRADIUS-FramedIpv6Route $ msRADIUS-SavedFramedIpv6Route $ msDS-SecondaryKrbTgtNumber $ msDS-AuthenticatedAtDC $ msDS-SupportedEncryptionTypes $ msDS-LastSuccessfulInteractiveLogonTime $ msDS-LastFailedInteractiveLogonTime $ msDS-FailedInteractiveLogonCount $ msDS-FailedInteractiveLogonCountAtLastSuccessfulLogon $ msTSProfilePath $ msTSHomeDirectory $ msTSHomeDrive $ msTSAllowLogon $ msTSRemoteControl $ msTSMaxDisconnectionTime $ msTSMaxConnectionTime $ msTSMaxIdleTime $ msTSReconnectionAction $ msTSBrokenConnectionAction $ msTSConnectClientDrives $ msTSConnectPrinterDrives $ msTSDefaultToMainPrinter $ msTSWorkDirectory $ msTSInitialProgram $ msTSProperty01 $ msTSProperty02 $ msTSExpireDate $ msTSLicenseVersion $ msTSManagingLS $ msDS-UserPasswordExpiryTimeComputed $ msTSExpireDate2 $ msTSLicenseVersion2 $ msTSManagingLS2 $ msTSExpireDate3 $ msTSLicenseVersion3 $ msTSManagingLS3 $ msTSExpireDate4 $ msTSLicenseVersion4 $ msTSManagingLS4 $ msTSLSProperty01 $ msTSLSProperty02 $ msDS-ResultantPSO $ msPKI-CredentialRoamingTokens $ msTSPrimaryDesktop $ msTSSecondaryDesktops $ msDS-PrimaryComputer $ msDS-SyncServerUrl $ msDS-AssignedAuthNPolicySilo $ msDS-AuthNPolicySiloMembersBL $ msDS-AssignedAuthNPolicy $ userSMIMECertificate $ uid $ mail $ roomNumber $ photo $ manager $ homePhone $ secretary $ mobile $ pager $ audio $ jpegPhoto $ carLicense $ departmentNumber $ preferredLanguage $ userPKCS12 $ labeledURI $ msSFU30Name $ msSFU30NisDomain ) )", + "( 1.2.840.113556.1.5.259 NAME 'msDFS-Linkv2' SUP top STRUCTURAL MUST (msDFS-GenerationGUIDv2 $ msDFS-NamespaceIdentityGUIDv2 $ msDFS-LastModifiedv2 $ msDFS-Ttlv2 $ msDFS-Propertiesv2 $ msDFS-TargetListv2 $ msDFS-LinkPathv2 $ msDFS-LinkIdentityGUIDv2 ) MAY (msDFS-Commentv2 $ msDFS-LinkSecurityDescriptorv2 $ msDFS-ShortNameLinkPathv2 ) )", + "( 1.2.840.113556.1.5.141 NAME 'interSiteTransport' SUP top STRUCTURAL MUST (transportDLLName $ transportAddressAttribute ) MAY (options $ replInterval ) )", + "( 1.2.840.113556.1.6.13.4.4 NAME 'msDFSR-GlobalSettings' SUP top STRUCTURAL MAY (msDFSR-Extension $ msDFSR-Flags $ msDFSR-Options $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.5.29 NAME 'serviceClass' SUP leaf STRUCTURAL MUST (displayName $ serviceClassID ) MAY (serviceClassInfo ) )", + "( 1.2.840.113556.1.5.189 NAME 'mS-SQL-OLAPDatabase' SUP top STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-Contact $ mS-SQL-Status $ mS-SQL-LastUpdatedDate $ mS-SQL-InformationURL $ mS-SQL-ConnectionURL $ mS-SQL-PublicationURL $ mS-SQL-Description $ mS-SQL-Type $ mS-SQL-Size $ mS-SQL-LastBackupDate $ mS-SQL-Applications $ mS-SQL-Keywords ) )", + "( 2.5.6.16 NAME 'certificationAuthority' SUP top STRUCTURAL MUST (cn $ cACertificate $ authorityRevocationList $ certificateRevocationList ) MAY (searchGuide $ teletexTerminalIdentifier $ supportedApplicationContext $ crossCertificatePair $ deltaRevocationList $ domainPolicyObject $ parentCA $ dNSHostName $ parentCACertificateChain $ domainID $ cAConnect $ cAWEBURL $ cRLObject $ cAUsages $ previousCACertificates $ pendingCACertificates $ previousParentCA $ pendingParentCA $ currentParentCA $ cACertificateDN $ certificateTemplates $ signatureAlgorithms $ enrollmentProviders ) )", + "( 1.2.840.113556.1.5.104 NAME 'meeting' SUP top STRUCTURAL MUST (meetingName ) MAY (meetingID $ meetingDescription $ meetingKeyword $ meetingLocation $ meetingProtocol $ meetingType $ meetingApplication $ meetingLanguage $ meetingMaxParticipants $ meetingOriginator $ meetingContactInfo $ meetingOwner $ meetingIP $ meetingScope $ meetingAdvertiseScope $ meetingURL $ meetingRating $ meetingIsEncrypted $ meetingRecurrence $ meetingStartTime $ meetingEndTime $ meetingBandwidth $ meetingBlob ) )", + "( 1.2.840.113556.1.5.287 NAME 'msDS-DeviceRegistrationServiceContainer' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.71 NAME 'nTDSConnection' SUP leaf STRUCTURAL MUST (enabledConnection $ fromServer $ options ) MAY (generatedConnection $ schedule $ transportType $ mS-DS-ReplicatesNCReason ) )", + "( 1.2.840.113556.1.5.291 NAME 'msDS-AuthNPolicySilos' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.218 NAME 'msMQ-Custom-Recipient' SUP top STRUCTURAL MAY (msMQ-Recipient-FormatName ) )", + "( 1.2.840.113556.1.5.72 NAME 'nTDSService' SUP top STRUCTURAL MAY (tombstoneLifetime $ dSHeuristics $ garbageCollPeriod $ replTopologyStayOfExecution $ sPNMappings $ msDS-Other-Settings $ msDS-DeletedObjectLifetime ) )", + "( 1.2.840.113556.1.3.9 NAME 'dMD' SUP top STRUCTURAL MUST (cn ) MAY (dmdName $ schemaUpdate $ prefixMap $ schemaInfo $ msDs-Schema-Extensions $ msDS-IntId $ msDS-USNLastSyncSuccess ) )", + "( 1.2.840.113556.1.5.280 NAME 'msDS-ClaimsTransformationPolicyType' SUP top STRUCTURAL MAY (msDS-TransformationRules $ msDS-TransformationRulesCompiled ) )", + "( 0.9.2342.19200300.100.4.14 NAME 'rFC822LocalPart' SUP domain STRUCTURAL MAY (cn $ sn $ street $ description $ postalAddress $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ telephoneNumber $ telexNumber $ teletexTerminalIdentifier $ facsimileTelephoneNumber $ x121Address $ internationalISDNNumber $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ seeAlso ) )", + "( 1.2.840.113556.1.5.190 NAME 'mS-SQL-OLAPCube' SUP top STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-Contact $ mS-SQL-Status $ mS-SQL-LastUpdatedDate $ mS-SQL-InformationURL $ mS-SQL-PublicationURL $ mS-SQL-Description $ mS-SQL-Size $ mS-SQL-Keywords ) )", + "( 1.2.840.113556.1.5.208 NAME 'msWMI-UintSetParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-IntDefault ) MAY (msWMI-IntValidValues ) )", + "( 1.3.6.1.1.1.2.2 NAME 'posixGroup' SUP top AUXILIARY MAY (cn $ description $ userPassword $ unixUserPassword $ gidNumber $ memberUid ) )", + "( 2.5.6.17 NAME 'groupOfUniqueNames' SUP top STRUCTURAL MUST (cn $ uniqueMember ) MAY (o $ ou $ description $ businessCategory $ owner $ seeAlso ) )", + "( 1.2.840.113556.1.5.252 NAME 'ms-net-ieee-8023-GroupPolicy' SUP top STRUCTURAL MAY (ms-net-ieee-8023-GP-PolicyGUID $ ms-net-ieee-8023-GP-PolicyData $ ms-net-ieee-8023-GP-PolicyReserved ) )", + "( 1.2.840.113556.1.5.119 NAME 'ipsecNegotiationPolicy' SUP ipsecBase STRUCTURAL MAY (iPSECNegotiationPolicyType $ iPSECNegotiationPolicyAction ) )", + "( 1.2.840.113556.1.5.292 NAME 'msDS-AuthNPolicySilo' SUP top STRUCTURAL MAY (msDS-AssignedAuthNPolicySiloBL $ msDS-AuthNPolicySiloMembers $ msDS-UserAuthNPolicy $ msDS-ComputerAuthNPolicy $ msDS-ServiceAuthNPolicy $ msDS-AuthNPolicySiloEnforced ) )", + "( 1.2.840.113556.1.5.121 NAME 'ipsecNFA' SUP ipsecBase STRUCTURAL MAY (ipsecNegotiationPolicyReference $ ipsecFilterReference ) )", + "( 1.2.840.113556.1.5.42 NAME 'dfsConfiguration' SUP top STRUCTURAL )", + "( 0.9.2342.19200300.100.4.9 NAME 'documentSeries' SUP top STRUCTURAL MUST (cn ) MAY (l $ o $ ou $ description $ telephoneNumber $ seeAlso ) )", + "( 1.2.840.113556.1.5.271 NAME 'msDS-ResourceProperties' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.91 NAME 'linkTrackObjectMoveTable' SUP fileLinkTracking STRUCTURAL )", + "( 1.2.840.113556.1.5.136 NAME 'rpcContainer' SUP container STRUCTURAL MAY (nameServiceFlags ) )", + "( 1.2.840.113556.1.5.83 NAME 'rIDManager' SUP top STRUCTURAL MUST (rIDAvailablePool ) MAY (msDS-RIDPoolAllocationEnabled ) )", + "( 1.2.840.113556.1.5.206 NAME 'msWMI-IntSetParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-IntDefault ) MAY (msWMI-IntValidValues ) )", + "( 1.2.840.113556.1.6.13.4.5 NAME 'msDFSR-ReplicationGroup' SUP top STRUCTURAL MUST (msDFSR-ReplicationGroupType ) MAY (description $ msDFSR-Version $ msDFSR-Extension $ msDFSR-RootSizeInMb $ msDFSR-StagingSizeInMb $ msDFSR-ConflictSizeInMb $ msDFSR-TombstoneExpiryInMin $ msDFSR-FileFilter $ msDFSR-DirectoryFilter $ msDFSR-Schedule $ msDFSR-Flags $ msDFSR-Options $ msDFSR-DeletedSizeInMb $ msDFSR-DefaultCompressionExclusionFilter $ msDFSR-OnDemandExclusionFileFilter $ msDFSR-OnDemandExclusionDirectoryFilter $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.5.125 NAME 'addressBookContainer' SUP top STRUCTURAL MUST (displayName ) MAY (purportedSearch ) )", + "( 1.2.840.113556.1.5.7000.49 NAME 'applicationSettings' SUP top ABSTRACT MAY (applicationName $ notificationList $ msDS-Settings ) )", + "( 1.2.840.113556.1.5.265 NAME 'msDS-OptionalFeature' SUP top STRUCTURAL MUST (msDS-OptionalFeatureGUID $ msDS-OptionalFeatureFlags ) MAY (msDS-RequiredDomainBehaviorVersion $ msDS-RequiredForestBehaviorVersion ) )", + "( 1.2.840.113556.1.5.94 NAME 'serviceAdministrationPoint' SUP serviceConnectionPoint STRUCTURAL )", + "( 1.2.840.113556.1.5.102 NAME 'nTFRSReplicaSet' SUP top STRUCTURAL MAY (fRSReplicaSetType $ fRSVersionGUID $ schedule $ fRSFileFilter $ fRSDirectoryFilter $ fRSDSPoll $ fRSServiceCommand $ fRSReplicaSetGUID $ fRSLevelLimit $ fRSRootSecurity $ fRSExtensions $ managedBy $ fRSFlags $ fRSPartnerAuthLevel $ fRSPrimaryMember $ msFRS-Topology-Pref $ msFRS-Hub-Member ) )", + "( 1.2.840.113556.1.5.203 NAME 'msWMI-RangeParam' SUP top STRUCTURAL MUST (msWMI-PropertyName $ msWMI-TargetClass $ msWMI-TargetType ) )", + "( 1.2.840.113556.1.5.7000.56 NAME 'ipsecBase' SUP top ABSTRACT MAY (ipsecName $ ipsecID $ ipsecDataType $ ipsecData $ ipsecOwnersReference ) )", + "( 1.2.840.113556.1.6.13.4.3 NAME 'msDFSR-Subscription' SUP top STRUCTURAL MUST (msDFSR-ContentSetGuid $ msDFSR-ReplicationGroupGuid ) MAY (msDFSR-Extension $ msDFSR-RootPath $ msDFSR-RootSizeInMb $ msDFSR-StagingPath $ msDFSR-StagingSizeInMb $ msDFSR-ConflictPath $ msDFSR-ConflictSizeInMb $ msDFSR-Enabled $ msDFSR-Flags $ msDFSR-Options $ msDFSR-RootFence $ msDFSR-DfsLinkTarget $ msDFSR-DeletedPath $ msDFSR-DeletedSizeInMb $ msDFSR-ReadOnly $ msDFSR-CachePolicy $ msDFSR-MinDurationCacheInMin $ msDFSR-MaxAgeInCacheInMin $ msDFSR-OnDemandExclusionFileFilter $ msDFSR-OnDemandExclusionDirectoryFilter $ msDFSR-Options2 $ msDFSR-StagingCleanupTriggerInPercent ) )", + "( 1.2.840.113556.1.5.223 NAME 'msPKI-PrivateKeyRecoveryAgent' SUP top STRUCTURAL MUST (userCertificate ) )", + "( 1.2.840.113556.1.5.178 NAME 'pKIEnrollmentService' SUP top STRUCTURAL MAY (cACertificate $ dNSHostName $ cACertificateDN $ certificateTemplates $ signatureAlgorithms $ enrollmentProviders $ msPKI-Enrollment-Servers $ msPKI-Site-Name ) )", + "( 1.2.840.113556.1.6.18.2.211 NAME 'msSFU30MailAliases' SUP top STRUCTURAL MAY (msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ nisMapName ) )", + "( 1.2.840.113556.1.5.53 NAME 'typeLibrary' SUP top STRUCTURAL MAY (cOMClassID $ cOMInterfaceID $ cOMUniqueLIBID ) )", + "( 1.2.840.113556.1.6.13.4.8 NAME 'msDFSR-Topology' SUP top STRUCTURAL MAY (msDFSR-Extension $ msDFSR-Flags $ msDFSR-Options $ msDFSR-Options2 ) )", + "( 1.2.840.113556.1.5.237 NAME 'msDS-AzScope' SUP top STRUCTURAL MUST (msDS-AzScopeName ) MAY (description $ msDS-AzApplicationData $ msDS-AzObjectGuid $ msDS-AzGenericData ) )", + "( 1.2.840.113556.1.5.74 NAME 'categoryRegistration' SUP leaf STRUCTURAL MAY (localeID $ categoryId $ managedBy $ localizedDescription ) )", + "( 1.2.840.113556.1.5.11 NAME 'comConnectionPoint' SUP connectionPoint STRUCTURAL MUST (cn ) MAY (marshalledInterface $ moniker $ monikerDisplayName ) )", + "( 1.2.840.113556.1.5.93 NAME 'linkTrackOMTEntry' SUP leaf STRUCTURAL MAY (birthLocation $ oMTIndxGuid $ currentLocation $ timeRefresh $ oMTGuid ) )", + "( 1.2.840.113556.1.5.10 NAME 'classRegistration' SUP leaf STRUCTURAL MAY (cOMInterfaceID $ cOMProgID $ cOMCLSID $ cOMTreatAsClassId $ cOMOtherProgId $ implementedCategories $ requiredCategories $ managedBy ) )", + "( 1.2.840.113556.1.5.148 NAME 'siteLinkBridge' SUP top STRUCTURAL MUST (siteLinkList ) )", + "( 1.2.840.113556.1.5.81 NAME 'rpcServer' SUP rpcEntry STRUCTURAL MAY (rpcNsObjectID $ rpcNsCodeset $ rpcNsEntryFlags ) )", + "( 1.2.840.113556.1.3.46 NAME 'mailRecipient' SUP top AUXILIARY MUST (cn ) MAY (telephoneNumber $ userCertificate $ info $ garbageCollPeriod $ msExchAssistantName $ msExchLabeledURI $ showInAddressBook $ userCert $ legacyExchangeDN $ msDS-PhoneticDisplayName $ msDS-GeoCoordinatesAltitude $ msDS-GeoCoordinatesLatitude $ msDS-GeoCoordinatesLongitude $ userSMIMECertificate $ textEncodedORAddress $ secretary $ labeledURI ) )", + "( 1.2.840.113556.1.5.1 NAME 'securityObject' SUP top ABSTRACT MUST (cn ) )", + "( 1.2.840.113556.1.5.20 NAME 'leaf' SUP top ABSTRACT )", + "( 1.2.840.113556.1.5.151 NAME 'intellimirrorSCP' SUP serviceAdministrationPoint STRUCTURAL MAY (netbootMachineFilePath $ netbootAllowNewClients $ netbootLimitClients $ netbootMaxClients $ netbootCurrentClientCount $ netbootAnswerRequests $ netbootAnswerOnlyValidClients $ netbootNewMachineNamingPolicy $ netbootNewMachineOU $ netbootIntelliMirrorOSes $ netbootTools $ netbootLocallyInstalledOSes $ netbootServer ) )", + "( 1.2.840.113556.1.6.13.4.1 NAME 'msDFSR-LocalSettings' SUP top STRUCTURAL MAY (msDFSR-Version $ msDFSR-Extension $ msDFSR-Flags $ msDFSR-Options $ msDFSR-Options2 $ msDFSR-CommonStagingPath $ msDFSR-CommonStagingSizeInMb $ msDFSR-StagingCleanupTriggerInPercent ) )", + "( 1.2.840.113556.1.5.186 NAME 'mS-SQL-SQLRepository' SUP top STRUCTURAL MAY (mS-SQL-Name $ mS-SQL-Contact $ mS-SQL-Build $ mS-SQL-Status $ mS-SQL-Version $ mS-SQL-Description $ mS-SQL-InformationDirectory ) )", + "( 2.5.6.8 NAME 'organizationalRole' SUP top STRUCTURAL MUST (cn ) MAY (l $ st $ street $ ou $ postalAddress $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ telephoneNumber $ telexNumber $ teletexTerminalIdentifier $ facsimileTelephoneNumber $ x121Address $ internationalISDNNumber $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ roleOccupant $ seeAlso ) )", + "( 2.5.20.1 NAME 'subSchema' SUP top STRUCTURAL MAY (extendedClassInfo $ extendedAttributeInfo $ dITContentRules $ attributeTypes $ objectClasses $ modifyTimeStamp ) )", + "( 1.2.840.113556.1.5.284 NAME 'msDS-DeviceRegistrationService' SUP top STRUCTURAL MUST (msDS-IsEnabled $ msDS-DeviceLocation ) MAY (msDS-IssuerCertificates $ msDS-RegistrationQuota $ msDS-MaximumRegistrationInactivityPeriod $ msDS-IssuerPublicCertificates $ msDS-CloudIssuerPublicCertificates $ msDS-CloudIsEnabled ) )", + "( 1.2.840.113556.1.5.84 NAME 'displaySpecifier' SUP top STRUCTURAL MAY (iconPath $ creationWizard $ contextMenu $ adminPropertyPages $ shellPropertyPages $ classDisplayName $ adminContextMenu $ shellContextMenu $ attributeDisplayNames $ treatAsLeaf $ createDialog $ createWizardExt $ scopeFlags $ queryFilter $ extraColumns $ adminMultiselectPropertyPages ) )", + "( 1.2.840.113556.1.5.212 NAME 'msWMI-ShadowObject' SUP top STRUCTURAL MUST (msWMI-TargetObject ) )", + "( 1.2.840.113556.1.5.59 NAME 'fileLinkTrackingEntry' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.4.2161 NAME 'msAuthz-CentralAccessPolicies' SUP top STRUCTURAL )", + "( 1.2.840.113556.1.5.161 NAME 'mSMQQueue' SUP top STRUCTURAL MAY (mSMQQueueType $ mSMQJournal $ mSMQBasePriority $ mSMQLabel $ mSMQAuthenticate $ mSMQPrivacyLevel $ mSMQOwnerID $ mSMQTransactional $ mSMQQueueQuota $ mSMQQueueJournalQuota $ mSMQQueueNameExt $ mSMQLabelEx $ MSMQ-SecuredSource $ MSMQ-MulticastAddress ) )", + "( 1.2.840.113556.1.5.193 NAME 'msCOM-Partition' SUP top STRUCTURAL MAY (msCOM-ObjectId ) )", + "( 1.2.840.113556.1.5.118 NAME 'ipsecFilter' SUP ipsecBase STRUCTURAL )", + "( 2.5.6.2 NAME 'country' SUP top STRUCTURAL MUST (c ) MAY (searchGuide $ co ) )", + "( 1.2.840.113556.1.5.97 NAME 'physicalLocation' SUP locality STRUCTURAL MAY (managedBy ) )", + "( 1.2.840.113556.1.3.30 NAME 'computer' SUP user STRUCTURAL MAY (cn $ networkAddress $ localPolicyFlags $ defaultLocalPolicyObject $ machineRole $ location $ netbootInitialization $ netbootGUID $ netbootMachineFilePath $ siteGUID $ operatingSystem $ operatingSystemVersion $ operatingSystemServicePack $ operatingSystemHotfix $ volumeCount $ physicalLocationObject $ dNSHostName $ policyReplicationFlags $ managedBy $ rIDSetReferences $ catalogs $ netbootSIFFile $ netbootMirrorDataFile $ msDS-AdditionalDnsHostName $ msDS-AdditionalSamAccountName $ msDS-ExecuteScriptPassword $ msDS-KrbTgtLink $ msDS-RevealedUsers $ msDS-NeverRevealGroup $ msDS-RevealOnDemandGroup $ msDS-RevealedList $ msDS-AuthenticatedAtDC $ msDS-isGC $ msDS-isRODC $ msDS-SiteName $ msDS-PromotionSettings $ msTPM-OwnerInformation $ msTSProperty01 $ msTSProperty02 $ msDS-IsUserCachableAtRodc $ msDS-HostServiceAccount $ msTSEndpointData $ msTSEndpointType $ msTSEndpointPlugin $ msTSPrimaryDesktopBL $ msTSSecondaryDesktopBL $ msTPM-TpmInformationForComputer $ msDS-GenerationId $ msImaging-ThumbprintHash $ msImaging-HashAlgorithm $ netbootDUID $ msSFU30Name $ msSFU30Aliases $ msSFU30NisDomain $ nisMapName ) )", + "( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup' SUP top STRUCTURAL MUST (cn ) MAY (description $ msSFU30Name $ msSFU30NisDomain $ msSFU30NetgroupHostAtDomain $ msSFU30NetgroupUserAtDomain $ memberNisNetgroup $ nisNetgroupTriple $ nisMapName ) )", + "( 1.2.840.113556.1.5.153 NAME 'nTFRSMember' SUP top STRUCTURAL MAY (fRSUpdateTimeout $ fRSServiceCommand $ serverReference $ fRSRootSecurity $ fRSExtensions $ frsComputerReference $ fRSControlDataCreation $ fRSControlInboundBacklog $ fRSControlOutboundBacklog $ fRSFlags $ fRSPartnerAuthLevel ) )", + "( 2.5.6.12 NAME 'applicationEntity' SUP top STRUCTURAL MUST (cn $ presentationAddress ) MAY (l $ o $ ou $ supportedApplicationContext $ seeAlso ) )", + "( 2.5.6.11 NAME 'applicationProcess' SUP top STRUCTURAL MUST (cn ) MAY (l $ ou $ seeAlso ) )", + "( 1.2.840.113556.1.5.279 NAME 'msDS-ValueType' SUP top STRUCTURAL MUST (msDS-ClaimValueType $ msDS-ClaimIsValueSpaceRestricted $ msDS-ClaimIsSingleValued $ msDS-IsPossibleValuesPresent ) )", + "( 1.2.840.113556.1.5.204 NAME 'msWMI-UnknownRangeParam' SUP msWMI-RangeParam STRUCTURAL MUST (msWMI-NormalizedClass $ msWMI-TargetObject ) )", + "( 1.2.840.113556.1.5.66 NAME 'domain' SUP top ABSTRACT MUST (dc ) )", + "( 2.5.6.13 NAME 'dSA' SUP applicationEntity STRUCTURAL MAY (knowledgeInformation ) )", + "( 1.2.840.113556.1.5.120 NAME 'ipsecISAKMPPolicy' SUP ipsecBase STRUCTURAL )" + ], + "objectGUID": [ + { + "encoded": "sr4GScorekOq9Mmm+aY8Ow==", + "encoding": "base64" + } + ], + "systemFlags": [ + "134217728" + ], + "uSNChanged": [ + "5" + ], + "uSNCreated": [ + "5" + ], + "whenChanged": [ + "20130521164433.0Z" + ], + "whenCreated": [ + "20130521164433.0Z" + ] + }, + "schema_entry": "CN=Aggregate,CN=Schema,CN=Configuration,DC=AD2012,DC=LAB", + "type": "SchemaInfo" +} +""" +ad_2012_r2_dsa_info = """ +{ + "raw": { + "configurationNamingContext": [ + "CN=Configuration,DC=AD2012,DC=LAB" + ], + "currentTime": [ + "20141111080100.0Z" + ], + "defaultNamingContext": [ + "DC=AD2012,DC=LAB" + ], + "dnsHostName": [ + "WIN1.AD2012.LAB" + ], + "domainControllerFunctionality": [ + "6" + ], + "domainFunctionality": [ + "6" + ], + "dsServiceName": [ + "CN=NTDS Settings,CN=WIN1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=AD2012,DC=LAB" + ], + "forestFunctionality": [ + "6" + ], + "highestCommittedUSN": [ + "22591" + ], + "isGlobalCatalogReady": [ + "TRUE" + ], + "isSynchronized": [ + "TRUE" + ], + "ldapServiceName": [ + "AD2012.LAB:win1$@AD2012.LAB" + ], + "namingContexts": [ + "DC=AD2012,DC=LAB", + "CN=Configuration,DC=AD2012,DC=LAB", + "CN=Schema,CN=Configuration,DC=AD2012,DC=LAB", + "DC=DomainDnsZones,DC=AD2012,DC=LAB", + "DC=ForestDnsZones,DC=AD2012,DC=LAB" + ], + "rootDomainNamingContext": [ + "DC=AD2012,DC=LAB" + ], + "schemaNamingContext": [ + "CN=Schema,CN=Configuration,DC=AD2012,DC=LAB" + ], + "serverName": [ + "CN=WIN1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=AD2012,DC=LAB" + ], + "subschemaSubentry": [ + "CN=Aggregate,CN=Schema,CN=Configuration,DC=AD2012,DC=LAB" + ], + "supportedCapabilities": [ + "1.2.840.113556.1.4.800", + "1.2.840.113556.1.4.1670", + "1.2.840.113556.1.4.1791", + "1.2.840.113556.1.4.1935", + "1.2.840.113556.1.4.2080", + "1.2.840.113556.1.4.2237" + ], + "supportedControl": [ + "1.2.840.113556.1.4.319", + "1.2.840.113556.1.4.801", + "1.2.840.113556.1.4.473", + "1.2.840.113556.1.4.528", + "1.2.840.113556.1.4.417", + "1.2.840.113556.1.4.619", + "1.2.840.113556.1.4.841", + "1.2.840.113556.1.4.529", + "1.2.840.113556.1.4.805", + "1.2.840.113556.1.4.521", + "1.2.840.113556.1.4.970", + "1.2.840.113556.1.4.1338", + "1.2.840.113556.1.4.474", + "1.2.840.113556.1.4.1339", + "1.2.840.113556.1.4.1340", + "1.2.840.113556.1.4.1413", + "2.16.840.1.113730.3.4.9", + "2.16.840.1.113730.3.4.10", + "1.2.840.113556.1.4.1504", + "1.2.840.113556.1.4.1852", + "1.2.840.113556.1.4.802", + "1.2.840.113556.1.4.1907", + "1.2.840.113556.1.4.1948", + "1.2.840.113556.1.4.1974", + "1.2.840.113556.1.4.1341", + "1.2.840.113556.1.4.2026", + "1.2.840.113556.1.4.2064", + "1.2.840.113556.1.4.2065", + "1.2.840.113556.1.4.2066", + "1.2.840.113556.1.4.2090", + "1.2.840.113556.1.4.2205", + "1.2.840.113556.1.4.2204", + "1.2.840.113556.1.4.2206", + "1.2.840.113556.1.4.2211", + "1.2.840.113556.1.4.2239", + "1.2.840.113556.1.4.2255", + "1.2.840.113556.1.4.2256" + ], + "supportedExtension": [ + "1.3.6.1.4.1.1466.20037", + "1.3.6.1.4.1.1466.101.119.1", + "1.2.840.113556.1.4.1781", + "1.3.6.1.4.1.4203.1.11.3", + "1.2.840.113556.1.4.2212" + ], + "supportedLDAPPolicies": [ + "MaxPoolThreads", + "MaxPercentDirSyncRequests", + "MaxDatagramRecv", + "MaxReceiveBuffer", + "InitRecvTimeout", + "MaxConnections", + "MaxConnIdleTime", + "MaxPageSize", + "MaxBatchReturnMessages", + "MaxQueryDuration", + "MaxTempTableSize", + "MaxResultSetSize", + "MinResultSets", + "MaxResultSetsPerConn", + "MaxNotificationPerConn", + "MaxValRange", + "MaxValRangeTransitive", + "ThreadMemoryLimit", + "SystemMemoryLimitPercent" + ], + "supportedLDAPVersion": [ + "3", + "2" + ], + "supportedSASLMechanisms": [ + "GSSAPI", + "GSS-SPNEGO", + "EXTERNAL", + "DIGEST-MD5" + ] + }, + "type": "DsaInfo" +} +""" diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/ds389.py b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/ds389.py new file mode 100644 index 0000000000000000000000000000000000000000..f0e19dc6fc8894e3b90b568526e70e6c154e5af1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/ds389.py @@ -0,0 +1,1715 @@ +""" +""" + +# Created on 2014.11.11 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +ds389_1_3_3_schema = """ +{ + "raw": { + "aci": [ + "(target=\\"ldap:///cn=schema\\")(targetattr !=\\"aci\\")(version 3.0;acl \\"anonymous, no acis\\"; allow (read, search, compare) userdn = \\"ldap:///anyone\\";)" + ], + "attributeTypes": [ + "( 2.16.840.1.113730.3.1.582 NAME 'nsDS5ReplicaCredentials' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.15953.9.1.1 NAME 'sudoUser' DESC 'User(s) who may run sudo' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( 2.16.840.1.113730.3.1.2274 NAME 'nsslapd-instancedir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.532 NAME 'ntUserCountryCode' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.18.0.2.4.1139 NAME 'printer-info' DESC 'Descriptive information about this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.34 NAME 'ref' DESC 'LDAP referrals attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'LDAPv3 referrals Internet Draft' )", + "( 1.3.6.1.4.1.13769.2.4 NAME ( 'nsAIMid' 'nscpaimscreenname' ) EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'Mozilla Address Book' )", + "( sslVersionMin-oid NAME 'sslVersionMin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.204 NAME 'replicaNickName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2243 NAME 'nsslapd-securelistenhost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2108 NAME 'nsPagedLookThroughLimit' DESC 'Binder-based simple paged search operation look through limit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN '389' )", + "( 1.3.6.1.4.1.6981.11.3.7 NAME 'FTPStatus' DESC 'Account status: enabled or disabled' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.2091 NAME 'nsslapd-suffix' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.5.4.51 NAME 'houseIdentifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( nsUserRDNComponent-oid NAME 'nsUserRDNComponent' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.18.0.2.4.1117 NAME 'printer-media-local-supported' DESC 'Site-specific names of media supported by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2301 NAME 'nsslapd-plugin-logging' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.3 NAME ( 'mail' 'rfc822mailbox' ) EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 4524' X-DEPRECATED 'rfc822mailbox' )", + "( 2.16.840.1.113730.3.1.607 NAME 'nsDS5Flags' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsTaskLabel-oid NAME 'nsTaskLabel' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2068 NAME 'pamExcludeSuffix' DESC 'Suffixes to exclude from PAM authentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.2157 NAME 'dnaRemoteBindCred' DESC 'Remote bind credentials' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( nsBindDN-oid NAME 'nsBindDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.5.4.18 NAME 'postOfficeBox' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2261 NAME 'nsslapd-attribute-name-exceptions' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.250.1.2 NAME 'multiLineDescription' DESC 'Pilot attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Internet White Pages Pilot' )", + "( 2.16.840.1.113730.3.1.102 NAME ( 'passwordChange' 'pwdAllowUserChange' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.527 NAME 'ntUserLastLogoff' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.6.1.1.1.1.10 NAME 'shadowExpire' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.21 NAME 'mailQuota' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 1.2.840.113556.1.4.482 NAME 'calOtherCalURIs' DESC 'RFC2739: multi-value URI for snapshots of other calendars' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.2238 NAME 'nsslapd-security' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.42.2.27.4.1.6 NAME 'javaClassName' DESC 'Fully qualified name of distinguished Java class or interface' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2713' )", + "( 2.16.840.1.113730.3.1.240 NAME 'replicatedattributelist' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2175 NAME 'nsslapd-accesslog-logrotationsync-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsRevisionNumber-oid NAME 'nsRevisionNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2207 NAME 'nsslapd-rootdn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsHelpRef-oid NAME 'nsHelpRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.43 NAME 'ntUserDeleteAccount' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.217 NAME 'replicaCFUpdated' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.6 NAME 'targetDn' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.5.4.25 NAME 'internationalISDNNumber' EQUALITY numericStringMatch SUBSTR numericStringSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.998 NAME ( 'passwordGraceUserTime' 'pwdGraceUserTime' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2225 NAME 'nsslapd-workingdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.5 NAME 'shadowLastChange' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 0.9.2342.19200300.100.1.11 NAME 'documentIdentifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.65 NAME 'ntUserLogonServer' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.781 NAME 'mgrpAddHeader' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.2295 NAME 'nsslapd-allowed-sasl-mechanisms' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2162 NAME 'winSyncDirectoryFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.15953.9.1.9 NAME 'sudoNotAfter' DESC 'End of time interval for which the entry is valid' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 X-ORIGIN 'SUDO' )", + "( 1.3.18.0.2.4.1121 NAME 'printer-resolution-supported' DESC 'List of resolutions supported for printing documents by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2139 NAME 'winSyncMoveAction' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsExpirationDate-oid NAME 'nsExpirationDate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.5923.1.1.1.1 NAME 'eduPersonAffiliation' DESC 'Affiliation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( nsVendor-oid NAME 'nsVendor' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.87 NAME 'cirUpdateSchedule' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.32 NAME 'owner' SUP distinguishedName EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.253 NAME 'nsValueSyntax' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape servers - value item' )", + "( nsLdapSchemaVersion-oid NAME 'nsLdapSchemaVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2100 NAME 'autoMemberInclusiveRegex' DESC 'Auto Membership inclusive regex rule' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2089 NAME 'mepMappedAttr' DESC 'Managed Entries mapped attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2212 NAME 'nsslapd-useroc' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2282 NAME 'nsslapd-rundir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.3.3 NAME 'mozillaHomeLocalityName' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.5.4.10 NAME ( 'o' 'organizationname' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'organizationname' )", + "( 2.16.840.1.113730.3.1.2259 NAME 'nsslapd-return-exact-case' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsAdminAccessAddresses-oid NAME 'nsAdminAccessAddresses' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 0.9.2342.19200300.100.1.45 NAME 'organizationalStatus' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( nsAdminUsers-oid NAME 'nsAdminUsers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.1.1.1.18 NAME 'oncRpcNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.19 NAME 'mailMessageStore' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.221 NAME 'passwordStorageScheme' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2126 NAME 'dnaHostname' DESC 'DNA hostname of replica to get new range of values' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2230 NAME 'nsslapd-ldapiautobind' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2196 NAME 'nsslapd-accesslog-logexpirationtime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.576 NAME 'nsRoleFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.70 NAME 'serverRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 5.3.6.1.1.1.1.0 NAME 'trustModel' DESC 'Access scheme' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'nss_ldap/pam_ldap' )", + "( 2.16.840.1.113730.3.1.248 NAME 'nsValueDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape servers - value item' )", + "( 1.3.6.1.4.1.1466.101.120.41 NAME 'parentOrganization' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.15953.9.1.4 NAME 'sudoRunAs' DESC 'User(s) impersonated by sudo' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( nsAdminEnableDSGW-oid NAME 'nsAdminEnableDSGW' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.18.0.2.4.1132 NAME 'printer-multiple-document-jobs-supported' DESC 'Indicates whether or not this printer supports more than one document per job.' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 1.3.6.1.4.1.13769.2.1 NAME ( 'mozillaNickname' 'xmozillanickname' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Mozilla Address Book' )", + "( 2.5.18.2 NAME 'modifyTimestamp' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.92 NAME ( 'passwordExpWarned' 'pwdExpirationWarned' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2246 NAME 'nsslapd-maxdescriptors' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2113 NAME 'internalModifiersName' DESC 'plugin dn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2094 NAME 'nsslapd-parent-suffix' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.692 NAME 'inetUserStatus' DESC '\\"active\\", \\"inactive\\", or \\"deleted\\" status of a user' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape subscriber interoperability' )", + "( 1.3.18.0.2.4.1110 NAME 'printer-job-priority-supported' DESC 'Indicates the number of job priority levels supported by this printer.' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2183 NAME 'nsslapd-audit-logrotationsyncmin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2304 NAME 'nsslapd-dynamic-plugins' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.789 NAME 'mgrpNoDuplicateChecks' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.602 NAME 'entrydn' DESC 'internal server defined attribute type' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113730.3.1.1098 NAME 'nsds5replicaSessionPauseTime' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2073 NAME 'pamSecure' DESC 'Require secure (TLS/SSL) connection for PAM auth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.2264 NAME 'nsslapd-max-filter-nest-level' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.21.2 NAME 'dITContentRules' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 0.9.2342.19200300.100.1.56 NAME 'documentPublisher' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.522 NAME 'ntUserComment' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.18.0.2.4.1129 NAME 'printer-color-supported' DESC 'Indicates whether this printer is capable of any type of color printing at all, including highlight color.' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.24 NAME 'mailRoutingAddress' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( nsmsgDisallowAccess-oid NAME 'nsmsgDisallowAccess' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 1.2.840.113556.1.4.485 NAME 'calOtherCalAdrURIs' DESC 'RFC2739: multi-value URI to other request destinations' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.2131 NAME 'pamFilter' DESC 'Filter to match entries that should use PAM authentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.234 NAME 'nsSNMPLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.15 NAME 'supportedLDAPVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( 1.3.6.1.4.1.5923.1.1.1.9 NAME 'eduPersonScopedAffiliation' DESC 'Scoped Affiliation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( nsHostLocation-oid NAME 'nsHostLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.590 NAME 'nsDS5ReplicaName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2178 NAME 'nsslapd-accesslog-logrotationsynchour' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2081 NAME ( 'passwordMaxRepeats' 'pwdMaxRepeats' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.687 NAME 'nsds5replicaChangesSentSinceStartup' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1107 NAME 'printer-xri-supported' DESC 'The unordered list of XRI (extended resource identifiers) supported by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.46 NAME 'ntGroupDeleteGroup' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.9 NAME 'newRdn' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.16.840.1.113730.3.1.2147 NAME 'rootdn-allow-host' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2251 NAME 'nsslapd-accesscontrol' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( 2.5.4.28 NAME 'preferredDeliveryMethod' SYNTAX 1.3.6.1.4.1.1466.115.121.1.14 SINGLE-VALUE X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.11 NAME 'newSuperior' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.16.840.1.113730.3.1.229 NAME 'nsslapd-pluginVendor' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2228 NAME 'nsslapd-ldapifilepath' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.8 NAME 'shadowWarning' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.5.4.47 NAME 'enhancedSearchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.21 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.68 NAME 'ntUserPasswordExpired' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2298 NAME 'nsslapd-enable-turbo-mode' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.585 NAME 'nsDS5ReplicatedAttributeList' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2165 NAME 'schemaUpdateObjectclassAccept' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2277 NAME 'nsslapd-tmpdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.1002 NAME 'nsds7NewWinUserSyncEnabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.23 NAME 'lastModifiedTime' DESC 'old variant of modifyTimestamp' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 1274' )", + "( 2.16.840.1.113730.3.1.110 NAME 'ntGroupId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.535 NAME 'ntUserHomeDirDrive' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.33 NAME 'mgrpModerator' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.207 NAME 'vlvBase' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )", + "( nsServerMigrationClassname-oid NAME 'nsServerMigrationClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( nsSSLPersonalitySSL-oid NAME 'nsSSLPersonalitySSL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.5.4.35 NAME 'userPassword' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4519' )", + "( 1.3.6.1.1.4 NAME 'vendorName' EQUALITY 1.3.6.1.4.1.1466.109.114.1 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation X-ORIGIN 'RFC 3045' )", + "( 1.3.6.1.4.1.6981.11.3.4 NAME 'FTPDownloadRatio' DESC 'Ratio (compared with FTPRatioUp) for downloaded files' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.801 NAME 'mgrpRemoveHeader' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.2215 NAME 'nsslapd-allow-unauthenticated-binds' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1118 NAME 'printer-copies-supported' DESC 'The maximum number of copies of a document that may be printed as a single job on this printer.' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.55 NAME 'aci' DESC 'Netscape defined access control information attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2285 NAME 'nsslapd-hash-filters' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.5.4.7 NAME ( 'l' 'locality' 'localityname' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'locality localityname' )", + "( nsSSL3SessionTimeout-oid NAME 'nsSSL3SessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2152 NAME 'nsds5ReplicaProtocolTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.105 NAME ( 'passwordLockout' 'pwdLockOut' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.15 NAME 'ipServicePort' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2129 NAME 'dnaNextRange' DESC 'DNA range of values to get from replica' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( nsSSL3-oid NAME 'nsSSL3' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2199 NAME 'nsslapd-accesslog-logexpirationtimeunit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.571 NAME 'nsSizeLimit' DESC 'Binder-based search operation size limit (entries)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.77 NAME 'changeTime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.243 NAME 'nsValueCIS' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape servers - value item' )", + "( 2.16.840.1.113730.3.1.2170 NAME 'nsslapd-accesslog-level' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2202 NAME 'nsslapd-accesslog-logging-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.33 NAME 'automountInformation' DESC 'Information used by the autofs automounter' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'draft-howard-rfc2307bis' )", + "( 2.16.840.1.113730.3.1.1 NAME 'carLicense' DESC 'vehicle license or registration plate' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2798' )", + "( nsCertConfig-oid NAME 'nsCertConfig' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Certificate Management System' )", + "( 2.16.840.1.113730.3.1.99 NAME ( 'passwordMinLength' 'pwdMinLength' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2249 NAME 'nsslapd-idletimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.20 NAME 'telephoneNumber' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2116 NAME 'dnaPrefix' DESC 'DNA string prefix for dna value' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2220 NAME 'nsslapd-minssf-exclude-rootdse' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.0 NAME 'uidNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2186 NAME 'nsslapd-auditlog-logrotationtime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.12 NAME 'documentTitle' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.60 NAME 'ntUserAuthFlags' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2290 NAME 'nsslapd-disk-monitoring-threshold' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2076 NAME ( 'passwordMinAlphas' 'pwdMinAlphas' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.406 NAME 'nsSynchUserIDFormat' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.21.5 NAME 'attributeTypes' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 1.3.18.0.2.4.1122 NAME 'printer-media-supported' DESC 'The standard names/types/sizes (and optional color suffixes) of the media supported by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( nsAdminEnableEnduser-oid NAME 'nsAdminEnableEnduser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.1.1.1.26 NAME 'nisMapName' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2134 NAME 'nsds5ReplicaStripAttrs' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.544 NAME 'nsParentUniqueId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.5923.1.1.1.4 NAME 'eduPersonOrgUnitDN' DESC 'Organizational Unit DN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 2.16.840.1.113730.3.1.82 NAME 'cirBindDn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.60 NAME 'jpegPhoto' DESC 'a JPEG image' SYNTAX 1.3.6.1.4.1.1466.115.121.1.28 X-ORIGIN 'RFC 2798' )", + "( 1.3.6.1.4.1.42.2.27.4.1.13 NAME 'javaClassNames' DESC 'Fully qualified Java class or interface name' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2713' )", + "( 2.16.840.1.113730.3.1.2103 NAME 'autoMemberDisabled' DESC 'Auto Membership disabled attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.809 NAME 'nsds5replicaLastInitStatus' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2084 NAME 'nsSymmetricKey' DESC 'A symmetric key - currently used by attribute encryption' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-ORIGIN 'attribute encryption' )", + "( 2.16.840.1.113730.3.1.682 NAME 'nsds5ReplicaPurgeDelay' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 X-ORIGIN 'RFC 4524' )", + "( nsTLS1-oid NAME 'nsTLS1' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2063 NAME 'nsEncryptionAlgorithm' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.3.4 NAME 'mozillaHomeState' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.5.4.13 NAME 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2254 NAME 'nsslapd-pwpolicy-local' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2121 NAME 'dnaScope' DESC 'DNA base DN for finding entries' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.14 NAME 'mailAutoReplyMode' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.224 NAME 'nsslapd-pluginPath' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.11.1.3.2.1.2 NAME 'acctPolicySubentry' DESC 'Account policy pointer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Account Policy Plugin' )", + "( 2.16.840.1.113730.3.1.2191 NAME 'nsslapd-errorlog-logmaxdiskspace' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2233 NAME 'nsslapd-ldapiuidnumbertype' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.579 NAME 'nsDS5ReplicaPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.610 NAME 'nsAccountLock' DESC 'Operational attribute for Account Inactivation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.707 NAME 'vacationstartdate' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.580 NAME 'nsDS5ReplicaTransportInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2168 NAME 'schemaUpdateAttributeReject' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.15953.9.1.3 NAME 'sudoCommand' DESC 'Command(s) to be executed by sudo' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( 1.3.18.0.2.4.1137 NAME 'printer-generated-natural-language-supported' DESC 'Natural language(s) supported for this directory entry.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.1005 NAME 'nsds7DirsyncCookie' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.24 NAME 'lastModifiedBy' DESC 'old variant of modifiersName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 1274' )", + "( 2.16.840.1.113730.3.1.530 NAME 'ntUserLogonHours' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.36 NAME 'nsLicensedFor' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.202 NAME 'replicaCredentials' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.2.2 NAME ( 'mozillaSecondEmail' 'xmozillasecondemail' ) EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.3023 NAME 'nsViewFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( nsSSL2Ciphers-oid NAME 'nsSSL2Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( nsServerAddress-oid NAME 'nsServerAddress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.91 NAME 'passwordExpirationTime' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2241 NAME 'nsslapd-errorlog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsProductName-oid NAME 'nsProductName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2027 NAME 'nsruvReplicaLastModified' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.38 NAME 'authorityRevocationList' DESC 'X.509 authority revocation list' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( 2.16.840.1.113730.3.1.2097 NAME 'autoMemberScope' DESC 'Auto Membership scope criteria' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.695 NAME 'inetSubscriberChallenge' DESC 'Used to confirm subscriberIdentity. This attribute holds the challenge phrase and is used in conjunction with the inetSubscriberResponse' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape subscriber interoperability' )", + "( 2.16.840.1.113730.3.1.2218 NAME 'nsslapd-localssf' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1115 NAME 'printer-stacking-order-supported' DESC 'The possible stacking order of pages as they are printed and ejected from this printer.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 1.2.840.113556.1.4.479 NAME 'calFBURL' DESC 'RFC2739: URI to the users default freebusy data' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.2307 NAME 'nsslapd-allow-hashed-passwords' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.58 NAME 'replicaBindDn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.605 NAME 'entryid' DESC 'internal server defined attribute type' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113730.3.1.2288 NAME 'nsslapd-defaultnamingcontext' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.3.9 NAME 'mozillaWorkUrl' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2155 NAME 'nsds5ReplicaBackoffMax' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2267 NAME 'nsslapd-certmap-basedn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.100 NAME 'passwordKeepHistory' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.525 NAME 'ntUserWorkstations' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.23 NAME 'mgrpAllowedDomain' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 1.2.840.113556.1.4.480 NAME 'calCAPURI' DESC 'RFC2739: URI used to communicate with the users calendar' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.237 NAME 'nsSNMPMasterHost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsDefaultAcceptLanguage-oid NAME 'nsDefaultAcceptLanguage' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.593 NAME 'nsSNMPName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2205 NAME 'nsslapd-auditlog-logging-hide-unhashed-pw' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1108 NAME 'printer-aliases' DESC 'List of site-specific administrative names of this printer in addition to the value specified for printer-name.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.45 NAME 'ntGroupCreateNewGroup' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.215 NAME 'oid' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2142 NAME 'nsSaslMapPriority' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.4 NAME 'employeeType' DESC 'type of employment for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2798' )", + "( 2.16.840.1.113730.3.1.2119 NAME 'dnaMagicRegen' DESC 'DNA value that will trigger regeneration of attribute value' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.5.4.42 NAME 'givenName' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2189 NAME 'nsslapd-auditlog-logrotationtimeunit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.67 NAME 'ntUserProfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2079 NAME ( 'passwordMinSpecials' 'pwdMinSpecials' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.588 NAME 'nsDS5ReplicaId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2160 NAME 'dnaRemoteBindMethod' DESC 'Remote bind method: SIMPLE, SSL, SASL/DIGEST-MD5, or SASL/GSSAPI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 1.3.6.1.4.1.13769.4.3 NAME 'mozillaCustom3' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2272 NAME 'nsslapd-plugin-binddn-tracking' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.21.8 NAME 'matchingRuleUse' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 1.3.6.1.4.1.250.1.57 NAME ( 'labeledURI' 'labeledurl' ) EQUALITY caseExactMatch SUBSTR caseExactSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2079' X-DEPRECATED 'labeledurl' )", + "( 1.3.6.1.1.1.1.23 NAME 'bootParameter' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.89 NAME 'cirSyncInterval' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.251 NAME 'nsValueFlags' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape servers - value item' )", + "( 2.16.840.1.113730.3.1.2106 NAME 'nsIDListScanLimit' DESC 'Binder-based search operation ID list scan limit (candidate entries)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN '389' )", + "( 1.3.6.1.4.1.6981.11.3.1 NAME 'FTPQuotaFiles' DESC 'Quota (in number of files) for an FTP user' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.804 NAME 'nsSchemaCSN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( nsServerSecurity-oid NAME 'nsServerSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2210 NAME 'nsslapd-auditlog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.5 NAME ( 'drink' 'favouriteDrink' ) EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' X-DEPRECATED 'favouriteDrink' )", + "( 2.16.840.1.113730.3.1.50 NAME 'replicaBeginOrc' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2280 NAME 'nsslapd-bakdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.4 NAME ( 'sn' 'surName' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'surName' )", + "( 2.16.840.1.113730.3.1.2066 NAME 'nsSaslMapFilterTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.3.1 NAME 'mozillaHomeStreet' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.198 NAME 'memberURL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.16 NAME 'postalAddress' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.108 NAME 'passwordUnlock' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.16 NAME 'ipServiceProtocol' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2307' )", + "( nsSSLClientAuth-oid NAME 'nsSSLClientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2124 NAME 'dnaRemainingValues' DESC 'DNA remaining values left to assign' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2236 NAME 'nsslapd-anonlimitsdn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2194 NAME 'nsslapd-errorlog-logminfreediskspace' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.574 NAME 'nsRole' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( nsAdminGroupName-oid NAME 'nsAdminGroupName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.72 NAME 'serverVersionNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.246 NAME 'nsValueInt' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Netscape servers - value item' )", + "( 1.3.6.1.4.1.1466.101.120.43 NAME 'preferredTimeZone' DESC 'preferred time zone for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2173 NAME 'nsslapd-errorlog-maxlogsize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.15953.9.1.6 NAME 'sudoRunAsUser' DESC 'User(s) impersonated by sudo' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( 1.3.18.0.2.4.1130 NAME 'printer-document-format-supported' DESC 'The possible source document formats which may be interpreted and printed by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.552 NAME 'costargettree' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.94 NAME 'retryCountResetTime' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.23 NAME ( 'facsimileTelephoneNumber' 'fax' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 X-ORIGIN 'RFC 4519' X-DEPRECATED 'fax' )", + "( 2.16.840.1.113730.3.1.2244 NAME 'nnslapd-threadnumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.2.840.113556.1.2.102 NAME 'memberOf' DESC 'Group that the entry belongs to' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Delegated Administrator' )", + "( 2.16.840.1.113730.3.1.2111 NAME 'tombstoneNumSubordinates' DESC 'count of immediate subordinates for tombstone entries' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN '389 directory server' )", + "( nsDirectoryURL-oid NAME 'nsDirectoryURL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.690 NAME 'inetDomainBaseDN' DESC 'Base DN of user subtree for a DNS domain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape subscriber interoperability' )", + "( 2.16.840.1.113730.3.1.2223 NAME 'nsslapd-localhost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.3 NAME 'homeDirectory' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2181 NAME 'nsslapd-accesslog-logrotationsyncmin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.569 NAME 'cosPriority' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsOsVersion-oid NAME 'nsOsVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( nsJarfilename-oid NAME 'nsJarfilename' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2293 NAME 'nsslapd-ndn-cache-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2071 NAME 'pamIDAttr' DESC 'Name of attribute holding PAM ID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.2158 NAME 'dnaRemoteBindDN' DESC 'Remote bind DN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 1.3.18.0.2.4.1127 NAME 'printer-pages-per-minute' DESC 'The nominal number of pages per minute which may be output by this printer.' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 0.9.2342.19200300.100.1.54 NAME 'ditRedirect' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 1274' )", + "( 2.16.840.1.113730.3.1.520 NAME 'nswmExtendedUserPrefs' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.26 NAME 'mgrpErrorsTo' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 1.3.6.1.4.1.4203.1.3.5 NAME 'supportedFeatures' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.232 NAME 'nsSNMPEnabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2137 NAME 'nsds5ReplicaAbortCleanRUV' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.17 NAME 'ldapSchemas' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 2927' )", + "( 1.3.6.1.4.1.5923.1.1.1.7 NAME 'eduPersonEntitlement' DESC 'Entitlement' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 2.16.840.1.113730.3.1.81 NAME 'cirPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.6981.11.3.9 NAME 'FTPgid' DESC 'System uid (overrides gidNumber if present)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.2087 NAME 'mepManagedEntry' DESC 'Managed Entries pointer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.685 NAME 'nsds5replicaLastUpdateStart' DESC 'Netscape defined attribute type' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( nsAdminSIEDN-oid NAME 'nsAdminSIEDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2208 NAME 'nsslapd-rootdnpw' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.48 NAME 'replicaPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.210 NAME 'vlvSort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2145 NAME 'rootdn-close-time' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2257 NAME 'nsslapd-accesslog-logbuffering' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.43 NAME ( 'co' 'friendlycountryname' ) EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' X-DEPRECATED 'friendlycountryname' )", + "( 2.16.840.1.113730.3.1.13 NAME 'mailAlternateAddress' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.227 NAME 'nsslapd-pluginId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.45 NAME 'x500UniqueIdentifier' EQUALITY bitStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.613 NAME 'copiedFrom' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( nsServerPort-oid NAME 'nsServerPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.42.2.27.4.1.8 NAME 'javaSerializedData' DESC 'Serialized form of a Java object' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-ORIGIN 'RFC 2713' )", + "( 2.16.840.1.113730.3.1.583 NAME 'nsDS5ReplicaBindMethod' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2275 NAME 'nsslapd-schemadir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsSSLActivation-oid NAME 'nsSSLActivation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.1000 NAME 'nsds7WindowsReplicaSubtree' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.21 NAME 'secretary' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.533 NAME 'ntUserCodePage' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.18.0.2.4.1138 NAME 'printer-make-and-model' DESC 'Make and model of this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.35 NAME 'changeLog' DESC 'the distinguished name of the entry which contains the set of entries comprising this servers changelog' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.16.840.1.113730.3.1.205 NAME 'changeLogMaximumConcurrentWrites' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( nsDirectoryInfoRef-oid NAME 'nsDirectoryInfoRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.6981.11.3.6 NAME 'FTPDownloadBandwidth' DESC 'Bandwidth (in KB/s) to limit download speeds to' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.2109 NAME 'nsPagedIDListScanLimit' DESC 'Binder-based simple paged search operation ID list scan limit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN '389' )", + "( 2.16.840.1.113730.3.1.2092 NAME 'nsslapd-ldapiautodnsuffix' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.5.4.52 NAME 'supportedAlgorithms' DESC 'X.509 supported algorithms' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( 1.3.18.0.2.4.1116 NAME 'printer-output-features-supported' DESC 'The possible output features supported by this printer.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2302 NAME 'nsslapd-listen-backlog-size' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.57 NAME 'replicaRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.608 NAME 'nsDS5Task' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.9 NAME ( 'street' 'streetaddress' ) EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'streetaddress' )", + "( 2.16.840.1.113730.3.1.2069 NAME 'pamMissingSuffix' DESC 'How to handle missing include or exclude suffixes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.2150 NAME 'rootdn-deny-ip' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( nsGroupRDNComponent-oid NAME 'nsGroupRDNComponent' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.2262 NAME 'nsslapd-maxbersize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.19 NAME 'physicalDeliveryOfficeName' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.528 NAME 'ntUserAcctExpires' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.103 NAME ( 'passwordCheckSyntax' 'pwdCheckSyntax' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.13 NAME 'memberNisNetgroup' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2307' )", + "( 1.2.840.113556.1.4.483 NAME 'calOtherFBURLs' DESC 'RFC2739: multi-value URI for other free/busy data' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.2239 NAME 'nsslapd-SSL3ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.79 NAME 'cirReplicaRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.241 NAME 'displayName' DESC 'preferred name of a person to be used when displaying entries' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2798' )", + "( nsProductVersion-oid NAME 'nsProductVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2176 NAME 'nsslapd-errorlog-logrotationsync-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2200 NAME 'nsslapd-errorlog-logexpirationtimeunit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.40 NAME 'userSMIMECertificate' DESC 'signed message used to support S/MIME' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 X-ORIGIN 'RFC 2798' )", + "( nsSecureServerPort-oid NAME 'nsSecureServerPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.218 NAME 'replicaAbandonedChanges' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.7 NAME 'changeType' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.5.4.26 NAME 'registeredAddress' SUP postalAddress EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.999 NAME ( 'passwordGraceLimit' 'pwdGraceLoginLimit' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2114 NAME 'internalCreatorsName' DESC 'plugin dn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN '389 Directory Server' )", + "( nsBindPassword-oid NAME 'nsBindPassword' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.812 NAME 'netscapeReversiblePassword' DESC 'password for HTTP Digest/MD5 authentication' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'Netscape Web Server' )", + "( 2.16.840.1.113730.3.1.2226 NAME 'nsslapd-listenhost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.6 NAME 'shadowMin' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2184 NAME 'nsslapd-accesslog-logrotationtime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.10 NAME 'manager' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.62 NAME 'ntUserParms' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2296 NAME 'nsslapd-ignore-virtual-attrs' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2074 NAME 'pamService' DESC 'Service name to pass to pam_start' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.2163 NAME 'winSyncWindowsFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.4.4 NAME 'mozillaCustom4' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 1.3.18.0.2.4.1120 NAME 'printer-print-quality-supported' DESC 'List of print qualities supported for printing documents on this printer.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 1.3.6.1.1.1.1.24 NAME 'bootFile' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.4.1.5923.1.1.1.2 NAME 'eduPersonNickName' DESC 'NickName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 2.16.840.1.113730.3.1.542 NAME 'nsUniqueId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.84 NAME 'cirUseSsl' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.33 NAME 'roleOccupant' SUP distinguishedName EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4519' )", + "( nsServerID-oid NAME 'nsServerID' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.254 NAME 'nsValueHelpURL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape servers - value item' )", + "( 2.16.840.1.113730.3.1.807 NAME 'nsds5replicaLastInitStart' DESC 'Netscape defined attribute type' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2101 NAME 'autoMemberDefaultGroup' DESC 'Auto Membership default group' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2213 NAME 'nsslapd-userat' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2283 NAME 'nsslapd-SSLclientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.8 NAME 'userClass' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.5.4.1 NAME 'aliasedObjectName' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'RFC 4512' )", + "( 1.3.6.1.4.1.13769.3.2 NAME 'mozillaHomeStreet2' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2148 NAME 'rootdn-deny-host' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'organizationalUnitName' )", + "( 0.9.2342.19200300.100.1.44 NAME 'uniqueIdentifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.16 NAME 'mailDeliveryOption' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.2127 NAME 'dnaPortNum' DESC 'DNA port number of replica to get new range of values' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.222 NAME ( 'passwordMinAge' 'pwdMinAge' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113719.1.1.4.1.35 NAME 'lastLoginTime' DESC 'Last login time' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Account Policy Plugin' )", + "( 2.16.840.1.113730.3.1.2231 NAME 'nsslapd-ldapimaprootdn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2197 NAME 'nsslapd-errorlog-logexpirationtime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.577 NAME 'cosIndirectSpecifier' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.71 NAME 'serverProductName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 5.3.6.1.1.1.1.1 NAME 'accessTo' DESC 'Access to which servers user is allowed' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'nss_ldap/pam_ldap' )", + "( 2.16.840.1.113730.3.1.249 NAME 'nsValueType' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape servers - value item' )", + "( 1.3.6.1.4.1.15953.9.1.5 NAME 'sudoOption' DESC 'Options(s) followed by sudo' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( 2.16.840.1.113730.3.1.2278 NAME 'nsslapd-certdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1135 NAME 'printer-name' DESC 'The site-specific administrative name of this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.38 NAME 'nsLicenseEndTime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.200 NAME 'changeLogMaximumAge' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.18.3 NAME 'creatorsName' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.93 NAME 'passwordRetryCount' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2247 NAME 'nsslapd-conntablesize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2095 NAME 'connection' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( nsSuiteSpotUser-oid NAME 'nsSuiteSpotUser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.693 NAME 'inetUserHttpURL' DESC 'A users Web addresses' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape subscriber interoperability' )", + "( 1.3.18.0.2.4.1113 NAME 'printer-service-person' DESC 'The identity of the current human service person responsible for servicing this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2305 NAME 'nsslapd-moddn-aci' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.603 NAME 'dncomp' DESC 'internal server defined attribute type' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113730.3.1.1099 NAME 'winSyncInterval' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsBaseDN-oid NAME 'nsBaseDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2265 NAME 'nsslapd-versionstring' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.523 NAME 'ntUserFlags' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.18.0.2.4.1128 NAME 'printer-compression-supported' DESC 'Compression algorithms supported by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2132 NAME 'nsds5ReplicaEnabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsExecRef-oid NAME 'nsExecRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.25 NAME 'mgrpDeliverTo' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.235 NAME 'nsSNMPContact' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.591 NAME 'nsDS5ReplicaReferral' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2179 NAME 'nsslapd-errorlog-logrotationsynchour' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2082 NAME ( 'passwordMinCategories' 'pwdMinCategories' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.688 NAME 'nsds5replicaLastUpdateStatus' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.37 NAME 'associatedDomain' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.213 NAME 'vlvEnabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2140 NAME 'passwordTrackUpdateTime' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2252 NAME 'nsslapd-groupevalnestlevel' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.9 NAME 'shadowInactive' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2229 NAME 'nsslapd-ldapilisten' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.40 NAME 'crossCertificatePair' DESC 'X.509 cross certificate pair' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( 0.9.2342.19200300.100.1.15 NAME 'documentLocation' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.69 NAME 'subtreeACI' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server 1.0' )", + "( 2.16.840.1.113730.3.1.2299 NAME 'nsslapd-connection-buffer' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2166 NAME 'schemaUpdateObjectclassReject' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.586 NAME 'nsDS5ReplicaUpdateSchedule' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.4.1 NAME 'mozillaCustom1' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2270 NAME 'nsslapd-auditlog-list' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.1003 NAME 'nsds7NewWinGroupSyncEnabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.111 NAME 'ntUniqueId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.536 NAME 'ntGroupAttributes' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.6.1.1.1.1.21 NAME 'ipNetmaskNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.30 NAME 'mgrpRFC822MailMember' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.208 NAME 'vlvScope' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Netscape Directory Server' )", + "( nsNickName-oid NAME 'nsNickName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.5.4.36 NAME 'userCertificate' DESC 'X.509 user certificate' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( 2.16.840.1.113730.3.1.2104 NAME 'nsslapd-pluginConfigArea' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.5 NAME 'vendorVersion' EQUALITY 1.3.6.1.4.1.1466.109.114.1 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation X-ORIGIN 'RFC 3045' )", + "( 1.3.6.1.4.1.6981.11.3.3 NAME 'FTPUploadRatio' DESC 'Ratio (compared with FTPRatioDown) for uploaded files' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.802 NAME 'nsds5ReplicaLegacyConsumer' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2216 NAME 'nsslapd-require-secure-binds' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsKeyfile-oid NAME 'nsKeyfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.52 NAME 'replicaUpdateSchedule' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.7 NAME 'photo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.23 X-ORIGIN 'RFC 1274' )", + "( 2.5.4.6 NAME ( 'c' 'countryName' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.11 SINGLE-VALUE X-ORIGIN 'RFC 4519' X-DEPRECATED 'countryName' )", + "( 2.16.840.1.113730.3.1.2064 NAME 'nsSaslMapRegexString' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2286 NAME 'nsslapd-outbound-ldap-io-timeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2153 NAME ( 'passwordAdminDN' 'pwdAdminDN' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.14 NAME 'searchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.106 NAME ( 'passwordMaxFailure' 'pwdMaxFailure' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.14 NAME 'nisNetgroupTriple' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2234 NAME 'nsslapd-ldapigidnumbertype' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.572 NAME 'nsTimeLimit' DESC 'Binder-based search operation time limit (seconds)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.74 NAME 'administratorContactInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( nsClassname-oid NAME 'nsClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.244 NAME 'nsValueCES' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape servers - value item' )", + "( 1.3.6.1.4.1.5322.17.2.1 NAME 'authorizedService' DESC 'IANA GSS-API authorized service name' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'NSS LDAP schema' )", + "( 2.16.840.1.113730.3.1.2171 NAME 'nsslapd-accesslog-maxlogsperdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2203 NAME 'nsslapd-errorlog-logging-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsDeleteclassname-oid NAME 'nsDeleteclassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( nsmsgNumMsgQuota-oid NAME 'nsmsgNumMsgQuota' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( nsAdminCgiWaitPid-oid NAME 'nsAdminCgiWaitPid' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.2 NAME 'departmentNumber' DESC 'identifies a department within an organization' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2798' )", + "( 2.16.840.1.113730.3.1.550 NAME 'cosAttribute' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.96 NAME ( 'passwordHistory' 'pwdHistory' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.21 NAME 'telexNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.52 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2117 NAME 'dnaNextValue' DESC 'DNA next available value for assignment' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2098 NAME 'autoMemberFilter' DESC 'Auto Membership filter criteria' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 1.3.6.1.1.1.1.1 NAME 'gidNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2187 NAME 'nsslapd-accesslog-logrotationtimeunit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2221 NAME 'nsslapd-validate-cert' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2308 NAME 'nstombstonecsn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.61 NAME 'ntUserUsrComment' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2291 NAME 'nsslapd-disk-monitoring-grace-period' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2077 NAME ( 'passwordMinUppers' 'pwdMinUppers' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.407 NAME 'nsSynchUniqueAttribute' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2268 NAME 'nsslapd-accesslog-list' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1125 NAME 'printer-finishings-supported' DESC 'The possible finishing operations supported by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.5.21.6 NAME 'objectClasses' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.28 NAME 'mgrpMsgRejectAction' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.230 NAME 'nsslapd-pluginDescription' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2135 NAME 'nsds5ReplicaCleanRUV' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( nsAdminCacheLifetime-oid NAME 'nsAdminCacheLifetime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.327 NAME 'nsIndexType' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.545 NAME 'nscpEntryDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.5923.1.1.1.5 NAME 'eduPersonPrimaryAffiliation' DESC 'Primary Affiliation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 2.16.840.1.113730.3.1.83 NAME 'cirUsePersistentSearch' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.42.2.27.4.1.10 NAME 'javaFactory' DESC 'Fully qualified Java class name of a JNDI object factory' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2713' )", + "( 2.5.18.10 NAME 'subschemaSubentry' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.2085 NAME 'isReplicated' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.683 NAME 'nsds5ReplicaTombstonePurgeInterval' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.38 NAME 'associatedName' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.1100 NAME 'oneWaySync' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsConfigRoot-oid NAME 'nsConfigRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.13769.3.7 NAME 'mozillaHomeUrl' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2255 NAME 'passwordIsGlobalPolicy' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.41 NAME ( 'mobile' 'mobileTelephoneNumber' ) EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 4524' X-DEPRECATED 'mobileTelephoneNumber' )", + "( 2.16.840.1.113730.3.1.2122 NAME 'dnaMaxValue' DESC 'DNA maximum value to assign' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( nsAdminDomainName-oid NAME 'nsAdminDomainName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.15 NAME 'mailAutoReplyText' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.225 NAME 'nsslapd-pluginInitfunc' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsAdminEndUserHTMLIndex-oid NAME 'nsAdminEndUserHTMLIndex' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.4.1.11.1.3.2.1.3 NAME 'accountInactivityLimit' DESC 'Account inactivity limit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Account Policy Plugin' )", + "( 2.16.840.1.113730.3.1.2192 NAME 'nsslapd-auditlog-logmaxdiskspace' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsBuildSecurity-oid NAME 'nsBuildSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.708 NAME 'vacationenddate' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.581 NAME 'nsDS5ReplicaBindDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2169 NAME 'nsslapd-pagedsizelimit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( mgrpApprovePassword-oid NAME 'mgrpApprovePassword' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 1.3.18.0.2.4.1136 NAME 'printer-location' DESC 'The physical location of this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.531 NAME 'ntUserBadPwCount' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.37 NAME 'nsLicenseStartTime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.203 NAME 'replicaEntryFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2242 NAME 'nsslapd-securePort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.39 NAME 'certificateRevocationList' DESC 'X.509 certificate revocation list' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( nsAdminAccountInfo-oid NAME 'nsAdminAccountInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.2090 NAME 'mepRDNAttr' DESC 'Managed Entries RDN attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.696 NAME 'inetSubscriberResponse' DESC 'Used to confirm subscriberIdentity. This attribute holds the response phrase and is used in conjunction with the inetSubscriberChallenge' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape subscriber interoperability' )", + "( 2.5.4.50 NAME 'uniqueMember' EQUALITY uniqueMemberMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2219 NAME 'nsslapd-minssf' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1114 NAME 'printer-delivery-orientation-supported' DESC 'The possible delivery orientations of pages as they are printed and ejected from this printer.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 1.3.6.1.4.1.250.1.60 NAME ( 'ttl' 'timeToLive' ) DESC 'time to live in seconds for cached objects' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'LDAP Caching Internet Draft' )", + "( 2.16.840.1.113730.3.1.2300 NAME 'nsslapd-connection-nocanon' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.59 NAME 'ntUserPriv' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2289 NAME 'nsslapd-disk-monitoring' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsDefaultObjectClass-oid NAME 'nsDefaultObjectClass' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.4.1.13769.3.8 NAME 'mozillaWorkStreet2' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2156 NAME 'nsslapd-sasl-max-buffer-size' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2260 NAME 'nsslapd-result-tweak' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.101 NAME ( 'passwordInHistory' 'pwdInHistory' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.526 NAME 'ntUserLastLogon' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.6.1.1.1.1.11 NAME 'shadowFlag' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.20 NAME 'mailProgramDeliveryInfo' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 1.2.840.113556.1.4.481 NAME 'calCalAdrURI' DESC 'RFC2739: URI for event equests destination' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.238 NAME 'nsSNMPMasterPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.15953.9.1.10 NAME 'sudoOrder' DESC 'an integer to order the sudoRole entries' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'SUDO' )", + "( 1.3.6.1.4.1.42.2.27.4.1.7 NAME 'javaCodebase' DESC 'URL(s) specifying the location of class definition' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2713' )", + "( 2.16.840.1.113730.3.1.594 NAME 'nsDS5ReplicatedAttributeListTotal' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2174 NAME 'nsslapd-auditlog-maxlogsize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2206 NAME 'nsslapd-unhashed-pw-switch' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.42 NAME 'ntUserCreateNewAccount' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' DESC 'PKCS #12 PFX PDU for exchange of personal identity information' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 X-ORIGIN 'RFC 2798' )", + "( 2.16.840.1.113730.3.1.2143 NAME 'nsslapd-sasl-mapping-fallback' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.5 NAME 'changeNumber' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.5.18.9 NAME 'hasSubordinates' DESC 'if TRUE, subordinate entries may exist' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'numSubordinates Internet Draft' )", + "( 2.5.4.24 NAME 'x121Address' EQUALITY numericStringMatch SUBSTR numericStringSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.997 NAME 'pwdpolicysubentry' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.43 NAME 'initials' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2224 NAME 'nsslapd-port' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.4 NAME 'loginShell' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.64 NAME 'ntUserNumLogons' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2294 NAME 'nsslapd-ndn-cache-max-size' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2161 NAME 'nsIndexIDListScanLimit' DESC 'fine grained idlistscanlimit - per index/type/value' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.589 NAME 'nsDS5ReplicaType' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.4.2 NAME 'mozillaCustom2' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 1.3.6.1.4.1.15953.9.1.8 NAME 'sudoNotBefore' DESC 'Start of time interval for which the entry is valid' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 X-ORIGIN 'SUDO' )", + "( 2.16.840.1.113730.3.1.2273 NAME 'nsslapd-config' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.21.9 NAME 'structuralObjectClass' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( nsDisplayName-oid NAME 'nsDisplayName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.1.1.1.22 NAME 'macAddress' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2138 NAME 'nsslapd-readonly' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.86 NAME 'cirLastUpdateApplied' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.31 NAME 'member' SUP distinguishedName EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4519' )", + "( sslVersionMax-oid NAME 'sslVersionMax' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.252 NAME 'nsValueDescription' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape servers - value item' )", + "( 2.16.840.1.113730.3.1.2107 NAME 'nsPagedSizeLimit' DESC 'Binder-based simple paged search operation size limit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN '389' )", + "( 2.16.840.1.113730.3.1.805 NAME 'nsds5replicaTimeout' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2088 NAME 'mepStaticAttr' DESC 'Managed Entries static attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2211 NAME 'nsslapd-dynamicconf' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.51 NAME 'replicaUpdateReplayed' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2281 NAME 'nsslapd-saslpath' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.3 NAME ( 'cn' 'commonName' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'commonName' )", + "( 2.16.840.1.113730.3.1.2067 NAME 'pamIncludeSuffix' DESC 'Suffixes to include for PAM authentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.199 NAME 'memberCertificateDescription' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.2312.4.3.3.1 NAME 'sabayonProfileURL' DESC 'The URL of a sabayon profile' SUP labeledURI EQUALITY caseExactMatch SUBSTR caseExactSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Sabayon' )", + "( 2.5.4.17 NAME 'postalCode' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2258 NAME 'nsslapd-csnlogging' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsSSL2-oid NAME 'nsSSL2' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.109 NAME ( 'passwordLockoutDuration' 'pwdLockoutDuration' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.19 NAME 'ipHostNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.18 NAME 'mailHost' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.220 NAME ( 'passwordMustChange' 'pwdMustChange' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2125 NAME 'dnaThreshold' DESC 'DNA threshold for getting next range of values' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2237 NAME 'nsslapd-counters' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2195 NAME 'nsslapd-auditlog-logminfreediskspace' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.575 NAME 'nsRoleDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.73 NAME 'installationTimeStamp' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.247 NAME 'nsValueBin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 X-ORIGIN 'Netscape servers - value item' )", + "( 1.3.6.1.4.1.15953.9.1.7 NAME 'sudoRunAsGroup' DESC 'Group(s) impersonated by sudo' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( 1.3.18.0.2.4.1133 NAME 'printer-ipp-versions-supported' DESC 'IPP protocol version(s) that this printer supports.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.5.18.1 NAME 'createTimestamp' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.553 NAME 'costemplatedn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.95 NAME 'accountUnlockTime' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2245 NAME 'nsslapd-maxthreadsperconn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2112 NAME 'ntGroupType' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.691 NAME 'inetDomainStatus' DESC '\\"active\\", \\"inactive\\", or \\"deleted\\" status of a domain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape subscriber interoperability' )", + "( 1.3.18.0.2.4.1111 NAME 'printer-job-k-octets-supported' DESC 'The maximum size in kilobytes (1,024 octets actually) incoming print job that this printer will accept.' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2182 NAME 'nsslapd-errorlog-logrotationsyncmin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.788 NAME 'mgrpBroadcasterPolicy' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.601 NAME 'adminRole' DESC 'Administrative role' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Delegated Administrator' )", + "( 2.16.840.1.113730.3.1.2072 NAME 'pamFallback' DESC 'Fallback to regular LDAP BIND if PAM auth fails' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.2159 NAME 'dnaRemoteConnProtocol' DESC 'Connection protocol: LDAP, TLS, or SSL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( nsLogSuppress-oid NAME 'nsLogSuppress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.5.21.1 NAME 'dITStructureRules' EQUALITY integerFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.521 NAME 'ntUserHomeDir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 1.3.18.0.2.4.1126 NAME 'printer-pages-per-minute-color' DESC 'The nominal number of color pages per minute which may be output by this printer.' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 1.2.840.113556.1.4.484 NAME 'calOtherCAPURIs' DESC 'RFC2739: multi-value URI to other calendars' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.2130 NAME 'dnaRangeRequestTimeout' DESC 'DNA timeout for querying replica for next range of values' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.233 NAME 'nsSNMPOrganization' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.14 NAME 'supportedSASLMechanisms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( 1.3.6.1.4.1.5923.1.1.1.8 NAME 'eduPersonPrimaryOrgUnitDN' DESC 'Primary Organizational Unit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( nsHardwarePlatform-oid NAME 'nsHardwarePlatform' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.6981.11.3.8 NAME 'FTPuid' DESC 'System uid (overrides uidNumber if present)' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.686 NAME 'nsds5replicaLastUpdateEnd' DESC 'Netscape defined attribute type' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2080 NAME ( 'passwordMin8bit' 'pwdMin8bit' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2209 NAME 'nsslapd-rootpwstoragescheme' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.49 NAME 'replicaUpdateFailedAt' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.8 NAME 'changes' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.16.840.1.113730.3.1.2146 NAME 'rootdn-days-allowed' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2250 NAME 'nsslapd-ioblocktimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.7 NAME 'supportedExtension' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( 0.9.2342.19200300.100.1.42 NAME ( 'pager' 'pagerTelephoneNumber' ) EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 4524' X-DEPRECATED 'pagerTelephoneNumber' )", + "( 2.16.840.1.113730.3.1.10 NAME 'deleteOldRdn' DESC 'Changelog attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 X-ORIGIN 'Changelog Internet Draft' )", + "( 2.16.840.1.113730.3.1.228 NAME 'nsslapd-pluginVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.46 NAME 'dnQualifier' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.614 NAME 'copyingFrom' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( nsSSLToken-oid NAME 'nsSSLToken' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.584 NAME 'nsDS5ReplicaRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2164 NAME 'winSyncSubtreePair' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2276 NAME 'nsslapd-lockdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.1001 NAME 'nsds7DirectoryReplicaSubtree' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.534 NAME 'ntUserPrimaryGroupId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 0.9.2342.19200300.100.1.20 NAME ( 'homePhone' 'homeTelephoneNumber' ) EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 4524' X-DEPRECATED 'homeTelephoneNumber' )", + "( 2.16.840.1.113730.3.1.32 NAME 'mgrpMsgMaxSize' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.206 NAME 'filterInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1140 NAME 'printer-uri' DESC 'A URI supported by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.5.4.34 NAME 'seeAlso' SUP distinguishedName EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4519' )", + "( nsSSL3Ciphers-oid NAME 'nsSSL3Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.6981.11.3.5 NAME 'FTPUploadBandwidth' DESC 'Bandwidth (in KB/s) to limit upload speeds to' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.2093 NAME 'nsslapd-changelogsuffix' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2214 NAME 'nsslapd-svrtab' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.53 NAME 'deltaRevocationList' DESC 'X.509 delta revocation list' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( nsUniqueAttribute-oid NAME 'nsUniqueAttribute' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.18.0.2.4.1119 NAME 'printer-natural-language-configured' DESC 'The configured natural language in which error and status messages will be generated (by default) by this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2303 NAME 'nsslapd-ignore-time-skew' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.54 NAME 'replicaUseSSL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userid' ) EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'userid' )", + "( 2.16.840.1.113730.3.1.609 NAME 'nsds5BeginReplicaRefresh' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2284 NAME 'nsslapd-ssl-check-hostname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' ) SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' X-DEPRECATED 'stateOrProvinceName' )", + "( 2.16.840.1.113730.3.1.1097 NAME 'nsds5replicaBusyWaitTime' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2151 NAME 'nsslapd-plugin-depends-on-type' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( nsViewConfiguration-oid NAME 'nsViewConfiguration' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.2263 NAME 'nsslapd-maxsasliosize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.529 NAME 'ntUserMaxStorage' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.104 NAME ( 'passwordWarning' 'pwdExpireWarning' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.12 NAME 'memberUid' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2307' )", + "( nsAccessLog-oid NAME 'nsAccessLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2128 NAME 'dnaSecurePortNum' DESC 'DNA secure port number of replica to get new range of values' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( nsPidLog-oid NAME 'nsPidLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2198 NAME 'nsslapd-auditlog-logexpirationtime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.570 NAME 'nsLookThroughLimit' DESC 'Binder-based search operation look through limit (candidate entries)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( nsCertfile-oid NAME 'nsCertfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.76 NAME 'serverHostName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.242 NAME 'nsSystemIndex' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2177 NAME 'nsslapd-auditlog-logrotationsync-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2201 NAME 'nsslapd-auditlog-logexpirationtimeunit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsServerCreationClassname-oid NAME 'nsServerCreationClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.41 NAME 'ntUserDomainId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.219 NAME 'vlvUses' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.973 NAME 'nsds5ReplConflict' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.18.4 NAME 'modifiersName' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.98 NAME 'passwordExp' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.27 NAME 'destinationIndicator' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2248 NAME 'nsslapd-reservedescriptors' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2115 NAME 'dnaType' DESC 'DNA attribute type to maintain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.2227 NAME 'nsslapd-snmp-index' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.7 NAME 'shadowMax' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2185 NAME 'nsslapd-errorlog-logrotationtime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.13 NAME 'documentVersion' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.63 NAME 'ntUserUnitsPerWeek' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2297 NAME 'nsslapd-search-return-original-type-switch' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2075 NAME ( 'passwordMinDigits' 'pwdMinDigits' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.21.4 NAME 'matchingRules' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 1.3.18.0.2.4.1123 NAME 'printer-sides-supported' DESC 'The number of impression sides (one or two) and the two-sided impression rotations supported by this printer.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 1.3.6.1.1.1.1.27 NAME 'nisMapEntry' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.4.1.5923.1.1.1.3 NAME 'eduPersonOrgDN' DESC 'Organization DN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 2.16.840.1.113730.3.1.543 NAME 'nsState' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.85 NAME 'cirBindCredentials' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.42.2.27.4.1.12 NAME 'javaDoc' DESC 'The Java documentation for the class' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'RFC 2713' )", + "( 2.16.840.1.113730.3.1.2102 NAME 'autoMemberGroupingAttr' DESC 'Auto Membership grouping attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.808 NAME 'nsds5replicaLastInitEnd' DESC 'Netscape defined attribute type' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( nsUserIDFormat-oid NAME 'nsUserIDFormat' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 0.9.2342.19200300.100.1.9 NAME 'host' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.5.4.0 NAME 'objectClass' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 X-ORIGIN 'RFC 4512' )", + "( nsAdminOneACLDir-oid NAME 'nsAdminOneACLDir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( nsBuildNumber-oid NAME 'nsBuildNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.13769.3.5 NAME 'mozillaHomePostalCode' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2149 NAME 'rootdn-allow-ip' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.2312.4.3.3.2 NAME 'sabayonProfileName' DESC 'The Name of a sabayon profile' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Sabayon' )", + "( 2.5.4.12 NAME 'title' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.17 NAME 'mailForwardingAddress' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.2120 NAME 'dnaFilter' DESC 'DNA filter for finding entries' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.223 NAME ( 'passwordResetFailureCount' 'pwdFailureCountInterval' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.49 NAME ( 'distinguishedName' 'dn' ) EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4519' X-DEPRECATED 'dn' )", + "( 2.16.840.1.113730.3.1.578 NAME 'nsDS5ReplicaHost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2190 NAME 'nsslapd-accesslog-logmaxdiskspace' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2232 NAME 'nsslapd-ldapimaptoentries' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.21.10 NAME 'governingStructureRule' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 1.3.6.1.4.1.15953.9.1.2 NAME 'sudoHost' DESC 'Host(s) who may run sudo' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'SUDO' )", + "( 2.16.840.1.113730.3.1.2279 NAME 'nsslapd-ldifdir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1134 NAME 'printer-more-info' DESC 'A URI for more information about this specific printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 0.9.2342.19200300.100.1.25 NAME ( 'dc' 'domaincomponent' ) EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'RFC 4519' X-DEPRECATED 'domaincomponent' )", + "( 2.16.840.1.113730.3.1.1004 NAME 'nsds7WindowsDomain' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.39 NAME 'preferredLanguage' DESC 'preferred written or spoken language for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2798' )", + "( 2.16.840.1.113730.3.1.201 NAME 'changeLogMaximumSize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.13769.2.3 NAME ( 'mozillaUseHtmlMail' 'xmozillausehtmlmail' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( nsSerialNumber-oid NAME 'nsSerialNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.90 NAME 'cirBeginORC' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2240 NAME 'nsslapd-accesslog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2096 NAME 'entryusn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.694 NAME 'inetSubscriberAccountId' DESC 'A unique attribute linking the subscriber to a billing system' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape subscriber interoperability' )", + "( 1.3.18.0.2.4.1112 NAME 'printer-current-operator' DESC 'The identity of the current human operator responsible for operating this printer.' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.2306 NAME 'nsslapd-return-default-opattr' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 1.2.840.113556.1.4.478 NAME 'calCalURI' DESC 'RFC2739: URI of entire default calendar' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'rfc2739' )", + "( 2.16.840.1.113730.3.1.604 NAME 'parentid' DESC 'internal server defined attribute type' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113730.3.1.2154 NAME 'nsds5ReplicaBackoffMin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2266 NAME 'nsslapd-enquote-sup-oc' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.524 NAME 'ntUserScriptPath' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2133 NAME 'pwdUpdateTime' DESC 'Last password update time' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.22 NAME 'mgrpAllowedBroadcaster' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.236 NAME 'nsSNMPDescription' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.13 NAME 'supportedControl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( nsPreference-oid NAME 'nsPreference' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.592 NAME 'nsDS5ReplicaAutoReferral' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2083 NAME ( 'passwordMinTokenLength' 'pwdMinTokenLength' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.689 NAME 'nsds5replicaUpdateInProgress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE NO-USER-MODIFICATION X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2204 NAME 'nsslapd-auditlog-logging-enabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1109 NAME 'printer-charset-configured' DESC 'The configured charset in which error and status messages will be generated (by default) by this printer.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.44 NAME 'ntGroupDomainId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.214 NAME 'passwordAllowChangeTime' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2141 NAME 'dsOnlyMemberUid' DESC 'Elements from a memberuid attribute created to reflect dynamic group membership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Red Hat Directory Server' )", + "( nsDirectoryFailoverList-oid NAME 'nsDirectoryFailoverList' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape' )", + "( nsSSLSessionTimeout-oid NAME 'nsSSLSessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2253 NAME 'nsslapd-nagle' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2118 NAME 'dnaInterval' DESC 'DNA interval between values' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.5.4.41 NAME 'name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2188 NAME 'nsslapd-errorlog-logrotationtimeunit' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.14 NAME 'documentAuthor' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.66 NAME 'ntUserUniqueId' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.1.2078 NAME ( 'passwordMinLowers' 'pwdMinLowers' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.587 NAME 'nsds50ruv' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2167 NAME 'schemaUpdateAttributeAccept' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2271 NAME 'nsslapd-rewrite-rfc1274' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.1.1.1.20 NAME 'ipNetworkNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.31 NAME 'mailEnhancedUniqueMember' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.209 NAME 'vlvFilter' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' )", + "( nsErrorLog-oid NAME 'nsErrorLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.88 NAME 'cirUpdateFailedat' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.250 NAME 'nsValueDefault' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape servers - value item' )", + "( 2.5.4.37 NAME 'cACertificate' DESC 'X.509 CA certificate' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 4523' )", + "( 2.16.840.1.113730.3.1.2105 NAME 'autoMemberTargetGroup' DESC 'Auto Membership target group' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 1.3.6.1.4.1.6981.11.3.2 NAME 'FTPQuotaMBytes' DESC 'Quota (in megabytes) for an FTP user' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Pure-FTPd' )", + "( 2.16.840.1.113730.3.1.803 NAME 'nsBackendSuffix' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2217 NAME 'nsslapd-allow-anonymous-access' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.53 NAME 'replicaBindMethod' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.4 NAME 'info' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.2065 NAME 'nsSaslMapBaseDNTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsSSLSupportedCiphers-oid NAME 'nsSSLSupportedCiphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.2287 NAME 'nsslapd-force-sasl-external' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.5 NAME 'serialNumber' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.197 NAME 'replicaHost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.15 NAME 'businessCategory' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.107 NAME 'passwordResetDuration' DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 0.9.2342.19200300.100.1.48 NAME 'buildingName' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 1.3.6.1.1.1.1.17 NAME 'ipProtocolNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2235 NAME 'nsslapd-ldapientrysearchbase' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( nsInstalledLocation-oid NAME 'nsInstalledLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.1.573 NAME 'nsIdleTimeout' DESC 'Binder-based connection idle timeout (seconds)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.75 NAME 'adminUrl' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.245 NAME 'nsValueTel' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'Netscape servers - value item' )", + "( 1.3.6.1.4.1.1466.101.120.42 NAME 'preferredLocale' DESC 'preferred locale for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape' )", + "( nsNYR-oid NAME 'nsNYR' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.1.2172 NAME 'nsslapd-accesslog-maxlogsize' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1131 NAME 'printer-charset-supported' DESC 'Set of charsets supported for the attribute values of syntax DirectoryString for this directory entry.' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'rfc3712' )", + "( 2.16.840.1.113730.3.1.3 NAME 'employeeNumber' DESC 'numerically identifies an employee within an organization' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2798' )", + "( 2.16.840.1.113730.3.1.551 NAME 'cosspecifier' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.97 NAME ( 'passwordMaxAge' 'pwdMaxAge' ) DESC 'Netscape defined password policy attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.4.22 NAME 'teletexTerminalIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.51 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2099 NAME 'autoMemberExclusiveRegex' DESC 'Auto Membership exclusive regex rule' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN '389 Directory Server' )", + "( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.1.2180 NAME 'nsslapd-auditlog-logrotationsynchour' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2222 NAME 'nsslapd-localuser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2309 NAME 'nsds5ReplicaPreciseTombstonePurging' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2292 NAME 'nsslapd-disk-monitoring-logging-critical' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2070 NAME 'pamIDMapMethod' DESC 'How to map BIND DN to PAM identity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.1.408 NAME 'replicaLastRelevantChange' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2269 NAME 'nsslapd-errorlog-list' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.18.0.2.4.1124 NAME 'printer-number-up-supported' DESC 'The possible numbers of print-stream pages to impose upon a single side of an instance of a selected medium.' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'rfc3712' )", + "( 2.5.21.7 NAME 'nameForms' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 0.9.2342.19200300.100.1.55 NAME 'audio' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 X-ORIGIN 'RFC 1274' )", + "( 2.16.840.1.113730.3.1.29 NAME 'mgrpMsgRejectText' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.231 NAME 'nsslapd-pluginEnabled' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2136 NAME 'nsds5ReplicaCleanRUVNotified' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-ORIGIN 'Netscape Directory Server' )", + "( nsWellKnownJarfiles-oid NAME 'nsWellKnownJarfiles' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.4.1.1466.101.120.16 NAME 'ldapSyntaxes' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE directoryOperation X-ORIGIN 'RFC 4512' )", + "( 2.16.840.1.113730.3.1.328 NAME 'nsMatchingRule' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( nsAdminAccessHosts-oid NAME 'nsAdminAccessHosts' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )", + "( 1.3.6.1.4.1.5923.1.1.1.6 NAME 'eduPersonPrincipalName' DESC 'Principal Name' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 2.16.840.1.113730.3.1.80 NAME 'cirHost' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.42.2.27.4.1.11 NAME 'javaReferenceAddress' DESC 'Addresses associated with a JNDI Reference' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 2713' )", + "( 2.16.840.1.113730.3.1.2086 NAME 'mepManagedBy' DESC 'Managed Entries backpointer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.1.684 NAME 'nsds5ReplicaChangeCount' DESC 'Netscape defined attribute type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.1101 NAME 'nsRoleScopeDN' DESC 'Scope of a role' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 1.3.1.1.4.1.453.16.2.103 NAME 'numSubordinates' DESC 'count of immediate subordinates' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'numSubordinates Internet Draft' )", + "( 1.3.6.1.4.1.13769.3.6 NAME 'mozillaHomeCountryName' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Mozilla Address Book' )", + "( 2.16.840.1.113730.3.1.2144 NAME 'rootdn-open-time' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.9999999 NAME 'nsds5debugreplicatimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2256 NAME 'passwordLegacyPolicy' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.1466.101.120.5 NAME 'namingContexts' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE dSAOperation X-ORIGIN 'RFC 4512' )", + "( 0.9.2342.19200300.100.1.40 NAME 'personalTitle' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.1.12 NAME 'mailAccessDomain' DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.1.226 NAME 'nsslapd-pluginType' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.2123 NAME 'dnaSharedCfgDN' DESC 'DNA shared configuration entry DN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN '389 Directory Server' )", + "( 2.5.4.44 NAME 'generationQualifier' SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113730.3.1.2193 NAME 'nsslapd-accesslog-logminfreediskspace' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.1.612 NAME 'generation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server' )" + ], + "cn": [ + "schema" + ], + "ldapSyntaxes": [ + "( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' )", + "( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )", + "( 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' )", + "( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5String' )", + "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'DirectoryString' )", + "( 1.3.6.1.4.1.1466.115.121.1.11 DESC 'Country String' )", + "( 1.3.6.1.4.1.1466.115.121.1.14 DESC 'Delivery Method' )", + "( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'DN' )", + "( 1.3.6.1.4.1.1466.115.121.1.21 DESC 'Enhanced Guide' )", + "( 1.3.6.1.4.1.1466.115.121.1.22 DESC 'Facsimile Telephone Number' )", + "( 1.3.6.1.4.1.1466.115.121.1.23 DESC 'FAX' )", + "( 1.3.6.1.4.1.1466.115.121.1.24 DESC 'GeneralizedTime' )", + "( 1.3.6.1.4.1.1466.115.121.1.25 DESC 'Guide' )", + "( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'INTEGER' )", + "( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' )", + "( 1.3.6.1.4.1.1466.115.121.1.34 DESC 'Name And Optional UID' )", + "( 1.3.6.1.4.1.1466.115.121.1.36 DESC 'Numeric String' )", + "( 1.3.6.1.4.1.1466.115.121.1.40 DESC 'OctetString' )", + "( 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' )", + "( 1.3.6.1.4.1.1466.115.121.1.41 DESC 'Postal Address' )", + "( 1.3.6.1.4.1.1466.115.121.1.44 DESC 'Printable String' )", + "( 1.3.6.1.4.1.1466.115.121.1.50 DESC 'TelephoneNumber' )", + "( 1.3.6.1.4.1.1466.115.121.1.51 DESC 'Teletex Terminal Identifier' )", + "( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' )" + ], + "matchingRules": [ + "( 2.5.13.17 NAME 'octetStringMatch' DESC 'The octetStringMatch rule compares an assertion value of the Octet String syntax to an attribute value of a syntax (e.g., the Octet String or JPEG syntax) whose corresponding ASN.1 type is the OCTET STRING ASN.1 type. The rule evaluates to TRUE if and only if the attribute value and the assertion value are the same length and corresponding octets (by position) are the same.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )", + "( 2.5.13.18 NAME 'octetStringOrderingMatch' DESC 'The octetStringOrderingMatch rule compares an assertion value of the Octet String syntax to an attribute value of a syntax (e.g., the Octet String or JPEG syntax) whose corresponding ASN.1 type is the OCTET STRING ASN.1 type. The rule evaluates to TRUE if and only if the attribute value appears earlier in the collation order than the assertion value. The rule compares octet strings from the first octet to the last octet, and from the most significant bit to the least significant bit within the octet. The first occurrence of a different bit determines the ordering of the strings. A zero bit precedes a one bit. If the strings contain different numbers of octets but the longer string is identical to the shorter string up to the length of the shorter string, then the shorter string precedes the longer string.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )", + "( 2.5.13.16 NAME 'bitStringMatch' DESC 'The bitStringMatch rule compares an assertion value of the Bit String syntax to an attribute value of a syntax (e.g., the Bit String syntax) whose corresponding ASN.1 type is BIT STRING. If the corresponding ASN.1 type of the attribute syntax does not have a named bit list [ASN.1] (which is the case for the Bit String syntax), then the rule evaluates to TRUE if and only if the attribute value has the same number of bits as the assertion value and the bits match on a bitwise basis. If the corresponding ASN.1 type does have a named bit list, then bitStringMatch operates as above, except that trailing zero bits in the attribute and assertion values are treated as absent.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )", + "( 1.3.6.1.4.1.1466.109.114.1 NAME 'caseExactIA5Match' DESC 'The caseExactIA5Match rule compares an assertion value of the IA5 String syntax to an attribute value of a syntax (e.g., the IA5 String syntax) whose corresponding ASN.1 type is IA5String. The rule evaluates to TRUE if and only if the prepared attribute value character string and the prepared assertion value character string have the same number of characters and corresponding characters have the same code point. In preparing the attribute value and assertion value for comparison, characters are not case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 2.5.13.5 NAME 'caseExactMatch' DESC 'The caseExactMatch rule compares an assertion value of the Directory String syntax to an attribute value of a syntax (e.g., the Directory String, Printable String, Country String, or Telephone Number syntax) whose corresponding ASN.1 type is DirectoryString or one of the alternative string types of DirectoryString, such as PrintableString (the other alternatives do not correspond to any syntax defined in this document). The rule evaluates to TRUE if and only if the prepared attribute value character string and the prepared assertion value character string have the same number of characters and corresponding characters have the same code point. In preparing the attribute value and assertion value for comparison, characters are not case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.6 NAME 'caseExactOrderingMatch' DESC 'The caseExactOrderingMatch rule compares an assertion value of the Directory String syntax to an attribute value of a syntax (e.g., the Directory String, Printable String, Country String, or Telephone Number syntax) whose corresponding ASN.1 type is DirectoryString or one of its alternative string types. The rule evaluates to TRUE if and only if, in the code point collation order, the prepared attribute value character string appears earlier than the prepared assertion value character string; i.e., the attribute value is \\"less than\\" the assertion value. In preparing the attribute value and assertion value for comparison, characters are not case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.7 NAME 'caseExactSubstringsMatch' DESC 'The caseExactSubstringsMatch rule compares an assertion value of the Substring Assertion syntax to an attribute value of a syntax (e.g., the Directory String, Printable String, Country String, or Telephone Number syntax) whose corresponding ASN.1 type is DirectoryString or one of its alternative string types. The rule evaluates to TRUE if and only if (1) the prepared substrings of the assertion value match disjoint portions of the prepared attribute value character string in the order of the substrings in the assertion value, (2) an substring, if present, matches the beginning of the prepared attribute value character string, and (3) a substring, if present, matches the end of the prepared attribute value character string. A prepared substring matches a portion of the prepared attribute value character string if corresponding characters have the same code point. In preparing the attribute value and assertion value substrings for comparison, characters are not case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.16.840.1.113730.3.3.1 NAME 'caseExactIA5SubstringsMatch' DESC 'The caseExactIA5SubstringsMatch rule compares an assertion value of the Substring Assertion syntax to an attribute value of a syntax (e.g., the IA5 syntax) whose corresponding ASN.1 type is IA5 String or one of its alternative string types. The rule evaluates to TRUE if and only if (1) the prepared substrings of the assertion value match disjoint portions of the prepared attribute value character string in the order of the substrings in the assertion value, (2) an substring, if present, matches the beginning of the prepared attribute value character string, and (3) a substring, if present, matches the end of the prepared attribute value character string. A prepared substring matches a portion of the prepared attribute value character string if corresponding characters have the same code point. In preparing the attribute value and assertion value substrings for comparison, characters are not case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.27 NAME 'generalizedTimeMatch' DESC 'The rule evaluates to TRUE if and only if the attribute value represents the same universal coordinated time as the assertion value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )", + "( 2.5.13.28 NAME 'generalizedTimeOrderingMatch' DESC 'The rule evaluates to TRUE if and only if the attribute value represents a universal coordinated time that is earlier than the universal coordinated time represented by the assertion value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )", + "( 2.5.13.13 NAME 'booleanMatch' DESC 'The booleanMatch rule compares an assertion value of the Boolean syntax to an attribute value of a syntax (e.g., the Boolean syntax) whose corresponding ASN.1 type is BOOLEAN. The rule evaluates to TRUE if and only if the attribute value and the assertion value are both TRUE or both FALSE.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )", + "( 1.3.6.1.4.1.1466.109.114.2 NAME 'caseIgnoreIA5Match' DESC 'The caseIgnoreIA5Match rule compares an assertion value of the IA5 String syntax to an attribute value of a syntax (e.g., the IA5 String syntax) whose corresponding ASN.1 type is IA5String. The rule evaluates to TRUE if and only if the prepared attribute value character string and the prepared assertion value character string have the same number of characters and corresponding characters have the same code point. In preparing the attribute value and assertion value for comparison, characters are case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch' DESC 'The caseIgnoreIA5SubstringsMatch rule compares an assertion value of the Substring Assertion syntax to an attribute value of a syntax (e.g., the IA5 String syntax) whose corresponding ASN.1 type is IA5String. The rule evaluates to TRUE if and only if (1) the prepared substrings of the assertion value match disjoint portions of the prepared attribute value character string in the order of the substrings in the assertion value, (2) an substring, if present, matches the beginning of the prepared attribute value character string, and (3) a substring, if present, matches the end of the prepared attribute value character string. A prepared substring matches a portion of the prepared attribute value character string if corresponding characters have the same code point. In preparing the attribute value and assertion value substrings for comparison, characters are case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.2 NAME 'caseIgnoreMatch' DESC 'The caseIgnoreMatch rule compares an assertion value of the Directory String syntax to an attribute value of a syntax (e.g., the Directory String, Printable String, Country String, or Telephone Number syntax) whose corresponding ASN.1 type is DirectoryString or one of its alternative string types. The rule evaluates to TRUE if and only if the prepared attribute value character string and the prepared assertion value character string have the same number of characters and corresponding characters have the same code point. In preparing the attribute value and assertion value for comparison, characters are case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.3 NAME 'caseIgnoreOrderingMatch' DESC 'The caseIgnoreOrderingMatch rule compares an assertion value of the Directory String syntax to an attribute value of a syntax (e.g., the Directory String, Printable String, Country String, or Telephone Number syntax) whose corresponding ASN.1 type is DirectoryString or one of its alternative string types. The rule evaluates to TRUE if and only if, in the code point collation order, the prepared attribute value character string appears earlier than the prepared assertion value character string; i.e., the attribute value is \\"less than\\" the assertion value. In preparing the attribute value and assertion value for comparison, characters are case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.4 NAME 'caseIgnoreSubstringsMatch' DESC 'The caseIgnoreSubstringsMatch rule compares an assertion value of the Substring Assertion syntax to an attribute value of a syntax (e.g., the Directory String, Printable String, Country String, or Telephone Number syntax) whose corresponding ASN.1 type is DirectoryString or one of its alternative string types. The rule evaluates to TRUE if and only if (1) the prepared substrings of the assertion value match disjoint portions of the prepared attribute value character string in the order of the substrings in the assertion value, (2) an substring, if present, matches the beginning of the prepared attribute value character string, and (3) a substring, if present, matches the end of the prepared attribute value character string. A prepared substring matches a portion of the prepared attribute value character string if corresponding characters have the same code point. In preparing the attribute value and assertion value substrings for comparison, characters are case folded in the Map preparation step, and only Insignificant Space Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.11 NAME 'caseIgnoreListMatch' DESC 'The caseIgnoreListMatch rule compares an assertion value that is a sequence of strings to an attribute value of a syntax (e.g., the Postal Address syntax) whose corresponding ASN.1 type is a SEQUENCE OF the DirectoryString ASN.1 type. The rule evaluates to TRUE if and only if the attribute value and the assertion value have the same number of strings and corresponding strings (by position) match according to the caseIgnoreMatch matching rule. In [X.520], the assertion syntax for this matching rule is defined to be: SEQUENCE OF DirectoryString {ub-match} That is, it is different from the corresponding type for the Postal Address syntax. The choice of the Postal Address syntax for the assertion syntax of the caseIgnoreListMatch in LDAP should not be seen as limiting the matching rule to apply only to attributes with the Postal Address syntax.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )", + "( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch' DESC 'The caseIgnoreListSubstringsMatch rule compares an assertion value of the Substring Assertion syntax to an attribute value of a syntax (e.g., the Postal Address syntax) whose corresponding ASN.1 type is a SEQUENCE OF the DirectoryString ASN.1 type. The rule evaluates to TRUE if and only if the assertion value matches, per the caseIgnoreSubstringsMatch rule, the character string formed by concatenating the strings of the attribute value, except that none of the , , or substrings of the assertion value are considered to match a substring of the concatenated string which spans more than one of the original strings of the attribute value. Note that, in terms of the LDAP-specific encoding of the Postal Address syntax, the concatenated string omits the line separator and the escaping of \\"\\\\\\" and \\"$\\" characters.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.0 NAME 'objectIdentifierMatch' DESC 'The objectIdentifierMatch rule compares an assertion value of the OID syntax to an attribute value of a syntax (e.g., the OID syntax) whose corresponding ASN.1 type is OBJECT IDENTIFIER. The rule evaluates to TRUE if and only if the assertion value and the attribute value represent the same object identifier; that is, the same sequence of integers, whether represented explicitly in the form of or implicitly in the form (see [RFC4512]). If an LDAP client supplies an assertion value in the form and the chosen descriptor is not recognized by the server, then the objectIdentifierMatch rule evaluates to Undefined.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", + "( 2.5.13.31 NAME 'directoryStringFirstComponentMatch' DESC 'The directoryStringFirstComponentMatch rule compares an assertion value of the Directory String syntax to an attribute value of a syntax whose corresponding ASN.1 type is a SEQUENCE with a mandatory first component of the DirectoryString ASN.1 type. Note that the assertion syntax of this matching rule differs from the attribute syntax of attributes for which this is the equality matching rule. The rule evaluates to TRUE if and only if the assertion value matches the first component of the attribute value using the rules of caseIgnoreMatch.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.30 NAME 'objectIdentifierFirstComponentMatch' DESC 'The objectIdentifierFirstComponentMatch rule compares an assertion value of the OID syntax to an attribute value of a syntax (e.g., the Attribute Type Description, DIT Content Rule Description, LDAP Syntax Description, Matching Rule Description, Matching Rule Use Description, Name Form Description, or Object Class Description syntax) whose corresponding ASN.1 type is a SEQUENCE with a mandatory first component of the OBJECT IDENTIFIER ASN.1 type. Note that the assertion syntax of this matching rule differs from the attribute syntax of attributes for which this is the equality matching rule. The rule evaluates to TRUE if and only if the assertion value matches the first component of the attribute value using the rules of objectIdentifierMatch.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", + "( 2.5.13.1 NAME 'distinguishedNameMatch' DESC 'The distinguishedNameMatch rule compares an assertion value of the DN syntax to an attribute value of a syntax (e.g., the DN syntax) whose corresponding ASN.1 type is DistinguishedName. The rule evaluates to TRUE if and only if the attribute value and the assertion value have the same number of relative distinguished names and corresponding relative distinguished names (by position) are the same. A relative distinguished name (RDN) of the assertion value is the same as an RDN of the attribute value if and only if they have the same number of attribute value assertions and each attribute value assertion (AVA) of the first RDN is the same as the AVA of the second RDN with the same attribute type. The order of the AVAs is not significant. Also note that a particular attribute type may appear in at most one AVA in an RDN. Two AVAs with the same attribute type are the same if their values are equal according to the equality matching rule of the attribute type. If one or more of the AVA comparisons evaluate to Undefined and the remaining AVA comparisons return TRUE then the distinguishedNameMatch rule evaluates to Undefined.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.5.13.14 NAME 'integerMatch' DESC 'The rule evaluates to TRUE if and only if the attribute value and the assertion value are the same integer value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 2.5.13.15 NAME 'integerOrderingMatch' DESC 'The rule evaluates to TRUE if and only if the integer value of the attribute value is less than the integer value of the assertion value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 2.5.13.29 NAME 'integerFirstComponentMatch' DESC 'The integerFirstComponentMatch rule compares an assertion value of the Integer syntax to an attribute value of a syntax (e.g., the DIT Structure Rule Description syntax) whose corresponding ASN.1 type is a SEQUENCE with a mandatory first component of the INTEGER ASN.1 type. Note that the assertion syntax of this matching rule differs from the attribute syntax of attributes for which this is the equality matching rule. The rule evaluates to TRUE if and only if the assertion value and the first component of the attribute value are the same integer value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 2.16.840.1.113730.3.3.2.0.1 NAME 'caseIgnoreOrderingMatch-default' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.0.1.6 NAME 'caseIgnoreSubstringMatch-default' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.1.1 NAME 'caseIgnoreOrderingMatch-ar' DESC 'ar' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.1.1.6 NAME 'caseIgnoreSubstringMatch-ar' DESC 'ar' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.2.1 NAME 'caseIgnoreOrderingMatch-be' DESC 'be' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.2.1.6 NAME 'caseIgnoreSubstringMatch-be' DESC 'be' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.3.1 NAME 'caseIgnoreOrderingMatch-bg' DESC 'bg' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.3.1.6 NAME 'caseIgnoreSubstringMatch-bg' DESC 'bg' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.4.1 NAME 'caseIgnoreOrderingMatch-ca' DESC 'ca' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.4.1.6 NAME 'caseIgnoreSubstringMatch-ca' DESC 'ca' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.5.1 NAME 'caseIgnoreOrderingMatch-cs' DESC 'cs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.5.1.6 NAME 'caseIgnoreSubstringMatch-cs' DESC 'cs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.6.1 NAME 'caseIgnoreOrderingMatch-da' DESC 'da' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.6.1.6 NAME 'caseIgnoreSubstringMatch-da' DESC 'da' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.7.1 NAME 'caseIgnoreOrderingMatch-de' DESC 'de' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.7.1.6 NAME 'caseIgnoreSubstringMatch-de' DESC 'de' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.8.1 NAME 'caseIgnoreOrderingMatch-de-AT' DESC 'de-AT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.8.1.6 NAME 'caseIgnoreSubstringMatch-de-AT' DESC 'de-AT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.9.1 NAME 'caseIgnoreOrderingMatch-de-CH' DESC 'de-CH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.9.1.6 NAME 'caseIgnoreSubstringMatch-de-CH' DESC 'de-CH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.10.1 NAME 'caseIgnoreOrderingMatch-el' DESC 'el' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.10.1.6 NAME 'caseIgnoreSubstringMatch-el' DESC 'el' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.11.1 NAME 'caseIgnoreOrderingMatch-en' DESC 'en' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.11.1.6 NAME 'caseIgnoreSubstringMatch-en' DESC 'en' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.12.1 NAME 'caseIgnoreOrderingMatch-en-CA' DESC 'en-CA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.12.1.6 NAME 'caseIgnoreSubstringMatch-en-CA' DESC 'en-CA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.13.1 NAME 'caseIgnoreOrderingMatch-en-GB' DESC 'en-GB' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.13.1.6 NAME 'caseIgnoreSubstringMatch-en-GB' DESC 'en-GB' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.14.1 NAME 'caseIgnoreOrderingMatch-en-IE' DESC 'en-IE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.14.1.6 NAME 'caseIgnoreSubstringMatch-en-IE' DESC 'en-IE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.15.1 NAME 'caseIgnoreOrderingMatch-es' DESC 'es' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.15.1.6 NAME 'caseIgnoreSubstringMatch-es' DESC 'es' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.16.1 NAME 'caseIgnoreOrderingMatch-et' DESC 'et' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.16.1.6 NAME 'caseIgnoreSubstringMatch-et' DESC 'et' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.17.1 NAME 'caseIgnoreOrderingMatch-fi' DESC 'fi' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.17.1.6 NAME 'caseIgnoreSubstringMatch-fi' DESC 'fi' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.18.1 NAME 'caseIgnoreOrderingMatch-fr' DESC 'fr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.18.1.6 NAME 'caseIgnoreSubstringMatch-fr' DESC 'fr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.19.1 NAME 'caseIgnoreOrderingMatch-fr-BE' DESC 'fr-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.19.1.6 NAME 'caseIgnoreSubstringMatch-fr-BE' DESC 'fr-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.20.1 NAME 'caseIgnoreOrderingMatch-fr-CA' DESC 'fr-CA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.20.1.6 NAME 'caseIgnoreSubstringMatch-fr-CA' DESC 'fr-CA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.21.1 NAME 'caseIgnoreOrderingMatch-fr-CH' DESC 'fr-CH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.21.1.6 NAME 'caseIgnoreSubstringMatch-fr-CH' DESC 'fr-CH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.22.1 NAME 'caseIgnoreOrderingMatch-hr' DESC 'hr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.22.1.6 NAME 'caseIgnoreSubstringMatch-hr' DESC 'hr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.23.1 NAME 'caseIgnoreOrderingMatch-hu' DESC 'hu' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.23.1.6 NAME 'caseIgnoreSubstringMatch-hu' DESC 'hu' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.24.1 NAME 'caseIgnoreOrderingMatch-is' DESC 'is' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.24.1.6 NAME 'caseIgnoreSubstringMatch-is' DESC 'is' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.25.1 NAME 'caseIgnoreOrderingMatch-it' DESC 'it' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.25.1.6 NAME 'caseIgnoreSubstringMatch-it' DESC 'it' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.26.1 NAME 'caseIgnoreOrderingMatch-it-CH' DESC 'it-CH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.26.1.6 NAME 'caseIgnoreSubstringMatch-it-CH' DESC 'it-CH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.27.1 NAME 'caseIgnoreOrderingMatch-iw' DESC 'iw' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.27.1.6 NAME 'caseIgnoreSubstringMatch-iw' DESC 'iw' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.28.1 NAME 'caseIgnoreOrderingMatch-ja' DESC 'ja' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.28.1.6 NAME 'caseIgnoreSubstringMatch-ja' DESC 'ja' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.29.1 NAME 'caseIgnoreOrderingMatch-ko' DESC 'ko' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.29.1.6 NAME 'caseIgnoreSubstringMatch-ko' DESC 'ko' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.30.1 NAME 'caseIgnoreOrderingMatch-lt' DESC 'lt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.30.1.6 NAME 'caseIgnoreSubstringMatch-lt' DESC 'lt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.31.1 NAME 'caseIgnoreOrderingMatch-lv' DESC 'lv' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.31.1.6 NAME 'caseIgnoreSubstringMatch-lv' DESC 'lv' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.32.1 NAME 'caseIgnoreOrderingMatch-mk' DESC 'mk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.32.1.6 NAME 'caseIgnoreSubstringMatch-mk' DESC 'mk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.33.1 NAME 'caseIgnoreOrderingMatch-nl' DESC 'nl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.33.1.6 NAME 'caseIgnoreSubstringMatch-nl' DESC 'nl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.34.1 NAME 'caseIgnoreOrderingMatch-nl-BE' DESC 'nl-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.34.1.6 NAME 'caseIgnoreSubstringMatch-nl-BE' DESC 'nl-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.35.1 NAME 'caseIgnoreOrderingMatch-no' DESC 'no' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.35.1.6 NAME 'caseIgnoreSubstringMatch-no' DESC 'no' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.36.1 NAME 'caseIgnoreOrderingMatch-no-NO-B' DESC 'no-NO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.36.1.6 NAME 'caseIgnoreSubstringMatch-no-NO-B' DESC 'no-NO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.37.1 NAME 'caseIgnoreOrderingMatch-no-NO-NY' DESC 'no-NO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.37.1.6 NAME 'caseIgnoreSubstringMatch-no-NO-NY' DESC 'no-NO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.38.1 NAME 'caseIgnoreOrderingMatch-pl' DESC 'pl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.38.1.6 NAME 'caseIgnoreSubstringMatch-pl' DESC 'pl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.39.1 NAME 'caseIgnoreOrderingMatch-ro' DESC 'ro' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.39.1.6 NAME 'caseIgnoreSubstringMatch-ro' DESC 'ro' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.40.1 NAME 'caseIgnoreOrderingMatch-ru' DESC 'ru' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.40.1.6 NAME 'caseIgnoreSubstringMatch-ru' DESC 'ru' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.41.1 NAME 'caseIgnoreOrderingMatch-sh' DESC 'sh' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.41.1.6 NAME 'caseIgnoreSubstringMatch-sh' DESC 'sh' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.42.1 NAME 'caseIgnoreOrderingMatch-sk' DESC 'sk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.42.1.6 NAME 'caseIgnoreSubstringMatch-sk' DESC 'sk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.43.1 NAME 'caseIgnoreOrderingMatch-sl' DESC 'sl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.43.1.6 NAME 'caseIgnoreSubstringMatch-sl' DESC 'sl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.44.1 NAME 'caseIgnoreOrderingMatch-sq' DESC 'sq' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.44.1.6 NAME 'caseIgnoreSubstringMatch-sq' DESC 'sq' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.45.1 NAME 'caseIgnoreOrderingMatch-sr' DESC 'sr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.45.1.6 NAME 'caseIgnoreSubstringMatch-sr' DESC 'sr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.46.1 NAME 'caseIgnoreOrderingMatch-sv' DESC 'sv' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.46.1.6 NAME 'caseIgnoreSubstringMatch-sv' DESC 'sv' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.47.1 NAME 'caseIgnoreOrderingMatch-tr' DESC 'tr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.47.1.6 NAME 'caseIgnoreSubstringMatch-tr' DESC 'tr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.48.1 NAME 'caseIgnoreOrderingMatch-uk' DESC 'uk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.48.1.6 NAME 'caseIgnoreSubstringMatch-uk' DESC 'uk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.49.1 NAME 'caseIgnoreOrderingMatch-zh' DESC 'zh' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.49.1.6 NAME 'caseIgnoreSubstringMatch-zh' DESC 'zh' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.50.1 NAME 'caseIgnoreOrderingMatch-zh-TW' DESC 'zh-TW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.50.1.6 NAME 'caseIgnoreSubstringMatch-zh-TW' DESC 'zh-TW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.51.1 NAME 'caseIgnoreOrderingMatch-af' DESC 'af' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.51.1.6 NAME 'caseIgnoreSubstringMatch-af' DESC 'af' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.52.1 NAME 'caseIgnoreOrderingMatch-af-NA' DESC 'af-NA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.52.1.6 NAME 'caseIgnoreSubstringMatch-af-NA' DESC 'af-NA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.53.1 NAME 'caseIgnoreOrderingMatch-af-ZA' DESC 'af-ZA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.53.1.6 NAME 'caseIgnoreSubstringMatch-af-ZA' DESC 'af-ZA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.54.1 NAME 'caseIgnoreOrderingMatch-ar-AE' DESC 'ar-AE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.54.1.6 NAME 'caseIgnoreSubstringMatch-ar-AE' DESC 'ar-AE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.55.1 NAME 'caseIgnoreOrderingMatch-ar-BH' DESC 'ar-BH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.55.1.6 NAME 'caseIgnoreSubstringMatch-ar-BH' DESC 'ar-BH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.56.1 NAME 'caseIgnoreOrderingMatch-ar-DZ' DESC 'ar-DZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.56.1.6 NAME 'caseIgnoreSubstringMatch-ar-DZ' DESC 'ar-DZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.57.1 NAME 'caseIgnoreOrderingMatch-ar-EG' DESC 'ar-EG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.57.1.6 NAME 'caseIgnoreSubstringMatch-ar-EG' DESC 'ar-EG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.58.1 NAME 'caseIgnoreOrderingMatch-ar-IQ' DESC 'ar-IQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.58.1.6 NAME 'caseIgnoreSubstringMatch-ar-IQ' DESC 'ar-IQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.59.1 NAME 'caseIgnoreOrderingMatch-ar-JO' DESC 'ar-JO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.59.1.6 NAME 'caseIgnoreSubstringMatch-ar-JO' DESC 'ar-JO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.60.1 NAME 'caseIgnoreOrderingMatch-ar-KW' DESC 'ar-KW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.60.1.6 NAME 'caseIgnoreSubstringMatch-ar-KW' DESC 'ar-KW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.61.1 NAME 'caseIgnoreOrderingMatch-ar-LB' DESC 'ar-LB' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.61.1.6 NAME 'caseIgnoreSubstringMatch-ar-LB' DESC 'ar-LB' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.62.1 NAME 'caseIgnoreOrderingMatch-ar-LY' DESC 'ar-LY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.62.1.6 NAME 'caseIgnoreSubstringMatch-ar-LY' DESC 'ar-LY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.63.1 NAME 'caseIgnoreOrderingMatch-ar-MA' DESC 'ar-MA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.63.1.6 NAME 'caseIgnoreSubstringMatch-ar-MA' DESC 'ar-MA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.64.1 NAME 'caseIgnoreOrderingMatch-ar-OM' DESC 'ar-OM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.64.1.6 NAME 'caseIgnoreSubstringMatch-ar-OM' DESC 'ar-OM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.65.1 NAME 'caseIgnoreOrderingMatch-ar-QA' DESC 'ar-QA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.65.1.6 NAME 'caseIgnoreSubstringMatch-ar-QA' DESC 'ar-QA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.66.1 NAME 'caseIgnoreOrderingMatch-ar-SA' DESC 'ar-SA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.66.1.6 NAME 'caseIgnoreSubstringMatch-ar-SA' DESC 'ar-SA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.67.1 NAME 'caseIgnoreOrderingMatch-ar-SD' DESC 'ar-SD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.67.1.6 NAME 'caseIgnoreSubstringMatch-ar-SD' DESC 'ar-SD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.68.1 NAME 'caseIgnoreOrderingMatch-ar-SY' DESC 'ar-SY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.68.1.6 NAME 'caseIgnoreSubstringMatch-ar-SY' DESC 'ar-SY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.69.1 NAME 'caseIgnoreOrderingMatch-ar-TN' DESC 'ar-TN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.69.1.6 NAME 'caseIgnoreSubstringMatch-ar-TN' DESC 'ar-TN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.70.1 NAME 'caseIgnoreOrderingMatch-ar-YE' DESC 'ar-YE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.70.1.6 NAME 'caseIgnoreSubstringMatch-ar-YE' DESC 'ar-YE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.71.1 NAME 'caseIgnoreOrderingMatch-as' DESC 'as' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.71.1.6 NAME 'caseIgnoreSubstringMatch-as' DESC 'as' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.72.1 NAME 'caseIgnoreOrderingMatch-as-IN' DESC 'as-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.72.1.6 NAME 'caseIgnoreSubstringMatch-as-IN' DESC 'as-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.73.1 NAME 'caseIgnoreOrderingMatch-az' DESC 'az' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.73.1.6 NAME 'caseIgnoreSubstringMatch-az' DESC 'az' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.74.1 NAME 'caseIgnoreOrderingMatch-az-Latn' DESC 'az-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.74.1.6 NAME 'caseIgnoreSubstringMatch-az-Latn' DESC 'az-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.75.1 NAME 'caseIgnoreOrderingMatch-az-Latn-AZ' DESC 'az-Latn_AZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.75.1.6 NAME 'caseIgnoreSubstringMatch-az-Latn-AZ' DESC 'az-Latn_AZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.76.1 NAME 'caseIgnoreOrderingMatch-bn' DESC 'bn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.76.1.6 NAME 'caseIgnoreSubstringMatch-bn' DESC 'bn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.77.1 NAME 'caseIgnoreOrderingMatch-bn-BD' DESC 'bn-BD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.77.1.6 NAME 'caseIgnoreSubstringMatch-bn-BD' DESC 'bn-BD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.78.1 NAME 'caseIgnoreOrderingMatch-bn-IN' DESC 'bn-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.78.1.6 NAME 'caseIgnoreSubstringMatch-bn-IN' DESC 'bn-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.79.1 NAME 'caseIgnoreOrderingMatch-bs' DESC 'bs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.79.1.6 NAME 'caseIgnoreSubstringMatch-bs' DESC 'bs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.80.1 NAME 'caseIgnoreOrderingMatch-chr' DESC 'chr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.80.1.6 NAME 'caseIgnoreSubstringMatch-chr' DESC 'chr' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.81.1 NAME 'caseIgnoreOrderingMatch-chr-US' DESC 'chr-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.81.1.6 NAME 'caseIgnoreSubstringMatch-chr-US' DESC 'chr-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.82.1 NAME 'caseIgnoreOrderingMatch-cy' DESC 'cy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.82.1.6 NAME 'caseIgnoreSubstringMatch-cy' DESC 'cy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.83.1 NAME 'caseIgnoreOrderingMatch-de-BE' DESC 'de-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.83.1.6 NAME 'caseIgnoreSubstringMatch-de-BE' DESC 'de-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.84.1 NAME 'caseIgnoreOrderingMatch-de-LI' DESC 'de-LI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.84.1.6 NAME 'caseIgnoreSubstringMatch-de-LI' DESC 'de-LI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.85.1 NAME 'caseIgnoreOrderingMatch-de-LU' DESC 'de-LU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.85.1.6 NAME 'caseIgnoreSubstringMatch-de-LU' DESC 'de-LU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.86.1 NAME 'caseIgnoreOrderingMatch-el-CY' DESC 'el-CY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.86.1.6 NAME 'caseIgnoreSubstringMatch-el-CY' DESC 'el-CY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.87.1 NAME 'caseIgnoreOrderingMatch-el-GR' DESC 'el-GR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.87.1.6 NAME 'caseIgnoreSubstringMatch-el-GR' DESC 'el-GR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.88.1 NAME 'caseIgnoreOrderingMatch-en-AS' DESC 'en-AS' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.88.1.6 NAME 'caseIgnoreSubstringMatch-en-AS' DESC 'en-AS' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.89.1 NAME 'caseIgnoreOrderingMatch-en-AU' DESC 'en-AU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.89.1.6 NAME 'caseIgnoreSubstringMatch-en-AU' DESC 'en-AU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.90.1 NAME 'caseIgnoreOrderingMatch-en-BE' DESC 'en-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.90.1.6 NAME 'caseIgnoreSubstringMatch-en-BE' DESC 'en-BE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.91.1 NAME 'caseIgnoreOrderingMatch-en-BW' DESC 'en-BW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.91.1.6 NAME 'caseIgnoreSubstringMatch-en-BW' DESC 'en-BW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.92.1 NAME 'caseIgnoreOrderingMatch-en-BZ' DESC 'en-BZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.92.1.6 NAME 'caseIgnoreSubstringMatch-en-BZ' DESC 'en-BZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.93.1 NAME 'caseIgnoreOrderingMatch-en-GU' DESC 'en-GU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.93.1.6 NAME 'caseIgnoreSubstringMatch-en-GU' DESC 'en-GU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.94.1 NAME 'caseIgnoreOrderingMatch-en-GY' DESC 'en-GY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.94.1.6 NAME 'caseIgnoreSubstringMatch-en-GY' DESC 'en-GY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.95.1 NAME 'caseIgnoreOrderingMatch-en-HK' DESC 'en-HK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.95.1.6 NAME 'caseIgnoreSubstringMatch-en-HK' DESC 'en-HK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.96.1 NAME 'caseIgnoreOrderingMatch-en-IN' DESC 'en-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.96.1.6 NAME 'caseIgnoreSubstringMatch-en-IN' DESC 'en-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.97.1 NAME 'caseIgnoreOrderingMatch-en-JM' DESC 'en-JM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.97.1.6 NAME 'caseIgnoreSubstringMatch-en-JM' DESC 'en-JM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.98.1 NAME 'caseIgnoreOrderingMatch-en-MH' DESC 'en-MH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.98.1.6 NAME 'caseIgnoreSubstringMatch-en-MH' DESC 'en-MH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.99.1 NAME 'caseIgnoreOrderingMatch-en-MP' DESC 'en-MP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.99.1.6 NAME 'caseIgnoreSubstringMatch-en-MP' DESC 'en-MP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.100.1 NAME 'caseIgnoreOrderingMatch-en-MT' DESC 'en-MT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.100.1.6 NAME 'caseIgnoreSubstringMatch-en-MT' DESC 'en-MT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.101.1 NAME 'caseIgnoreOrderingMatch-en-MU' DESC 'en-MU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.101.1.6 NAME 'caseIgnoreSubstringMatch-en-MU' DESC 'en-MU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.102.1 NAME 'caseIgnoreOrderingMatch-en-NA' DESC 'en-NA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.102.1.6 NAME 'caseIgnoreSubstringMatch-en-NA' DESC 'en-NA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.103.1 NAME 'caseIgnoreOrderingMatch-en-NZ' DESC 'en-NZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.103.1.6 NAME 'caseIgnoreSubstringMatch-en-NZ' DESC 'en-NZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.104.1 NAME 'caseIgnoreOrderingMatch-en-PH' DESC 'en-PH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.104.1.6 NAME 'caseIgnoreSubstringMatch-en-PH' DESC 'en-PH' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.105.1 NAME 'caseIgnoreOrderingMatch-en-PK' DESC 'en-PK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.105.1.6 NAME 'caseIgnoreSubstringMatch-en-PK' DESC 'en-PK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.106.1 NAME 'caseIgnoreOrderingMatch-en-SG' DESC 'en-SG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.106.1.6 NAME 'caseIgnoreSubstringMatch-en-SG' DESC 'en-SG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.107.1 NAME 'caseIgnoreOrderingMatch-en-TT' DESC 'en-TT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.107.1.6 NAME 'caseIgnoreSubstringMatch-en-TT' DESC 'en-TT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.108.1 NAME 'caseIgnoreOrderingMatch-en-UM' DESC 'en-UM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.108.1.6 NAME 'caseIgnoreSubstringMatch-en-UM' DESC 'en-UM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.109.1 NAME 'caseIgnoreOrderingMatch-en-US' DESC 'en-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.109.1.6 NAME 'caseIgnoreSubstringMatch-en-US' DESC 'en-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.110.1 NAME 'caseIgnoreOrderingMatch-en-US-POSIX' DESC 'en-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.110.1.6 NAME 'caseIgnoreSubstringMatch-en-US-POSIX' DESC 'en-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.111.1 NAME 'caseIgnoreOrderingMatch-en-VI' DESC 'en-VI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.111.1.6 NAME 'caseIgnoreSubstringMatch-en-VI' DESC 'en-VI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.112.1 NAME 'caseIgnoreOrderingMatch-en-ZA' DESC 'en-ZA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.112.1.6 NAME 'caseIgnoreSubstringMatch-en-ZA' DESC 'en-ZA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.113.1 NAME 'caseIgnoreOrderingMatch-en-ZW' DESC 'en-ZW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.113.1.6 NAME 'caseIgnoreSubstringMatch-en-ZW' DESC 'en-ZW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.114.1 NAME 'caseIgnoreOrderingMatch-es-AR' DESC 'es-AR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.114.1.6 NAME 'caseIgnoreSubstringMatch-es-AR' DESC 'es-AR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.115.1 NAME 'caseIgnoreOrderingMatch-es-BO' DESC 'es-BO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.115.1.6 NAME 'caseIgnoreSubstringMatch-es-BO' DESC 'es-BO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.116.1 NAME 'caseIgnoreOrderingMatch-es-CL' DESC 'es-CL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.116.1.6 NAME 'caseIgnoreSubstringMatch-es-CL' DESC 'es-CL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.117.1 NAME 'caseIgnoreOrderingMatch-es-CO' DESC 'es-CO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.117.1.6 NAME 'caseIgnoreSubstringMatch-es-CO' DESC 'es-CO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.118.1 NAME 'caseIgnoreOrderingMatch-es-CR' DESC 'es-CR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.118.1.6 NAME 'caseIgnoreSubstringMatch-es-CR' DESC 'es-CR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.119.1 NAME 'caseIgnoreOrderingMatch-es-DO' DESC 'es-DO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.119.1.6 NAME 'caseIgnoreSubstringMatch-es-DO' DESC 'es-DO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.120.1 NAME 'caseIgnoreOrderingMatch-es-EC' DESC 'es-EC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.120.1.6 NAME 'caseIgnoreSubstringMatch-es-EC' DESC 'es-EC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.121.1 NAME 'caseIgnoreOrderingMatch-es-ES' DESC 'es-ES' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.121.1.6 NAME 'caseIgnoreSubstringMatch-es-ES' DESC 'es-ES' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.122.1 NAME 'caseIgnoreOrderingMatch-es-GQ' DESC 'es-GQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.122.1.6 NAME 'caseIgnoreSubstringMatch-es-GQ' DESC 'es-GQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.123.1 NAME 'caseIgnoreOrderingMatch-es-GT' DESC 'es-GT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.123.1.6 NAME 'caseIgnoreSubstringMatch-es-GT' DESC 'es-GT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.124.1 NAME 'caseIgnoreOrderingMatch-es-HN' DESC 'es-HN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.124.1.6 NAME 'caseIgnoreSubstringMatch-es-HN' DESC 'es-HN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.125.1 NAME 'caseIgnoreOrderingMatch-es-MX' DESC 'es-MX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.125.1.6 NAME 'caseIgnoreSubstringMatch-es-MX' DESC 'es-MX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.126.1 NAME 'caseIgnoreOrderingMatch-es-NI' DESC 'es-NI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.126.1.6 NAME 'caseIgnoreSubstringMatch-es-NI' DESC 'es-NI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.127.1 NAME 'caseIgnoreOrderingMatch-es-PA' DESC 'es-PA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.127.1.6 NAME 'caseIgnoreSubstringMatch-es-PA' DESC 'es-PA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.128.1 NAME 'caseIgnoreOrderingMatch-es-PE' DESC 'es-PE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.128.1.6 NAME 'caseIgnoreSubstringMatch-es-PE' DESC 'es-PE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.129.1 NAME 'caseIgnoreOrderingMatch-es-PR' DESC 'es-PR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.129.1.6 NAME 'caseIgnoreSubstringMatch-es-PR' DESC 'es-PR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.130.1 NAME 'caseIgnoreOrderingMatch-es-PY' DESC 'es-PY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.130.1.6 NAME 'caseIgnoreSubstringMatch-es-PY' DESC 'es-PY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.131.1 NAME 'caseIgnoreOrderingMatch-es-SV' DESC 'es-SV' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.131.1.6 NAME 'caseIgnoreSubstringMatch-es-SV' DESC 'es-SV' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.132.1 NAME 'caseIgnoreOrderingMatch-es-US' DESC 'es-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.132.1.6 NAME 'caseIgnoreSubstringMatch-es-US' DESC 'es-US' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.133.1 NAME 'caseIgnoreOrderingMatch-es-UY' DESC 'es-UY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.133.1.6 NAME 'caseIgnoreSubstringMatch-es-UY' DESC 'es-UY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.134.1 NAME 'caseIgnoreOrderingMatch-es-VE' DESC 'es-VE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.134.1.6 NAME 'caseIgnoreSubstringMatch-es-VE' DESC 'es-VE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.135.1 NAME 'caseIgnoreOrderingMatch-fa' DESC 'fa' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.135.1.6 NAME 'caseIgnoreSubstringMatch-fa' DESC 'fa' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.136.1 NAME 'caseIgnoreOrderingMatch-fil' DESC 'fil' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.136.1.6 NAME 'caseIgnoreSubstringMatch-fil' DESC 'fil' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.137.1 NAME 'caseIgnoreOrderingMatch-fo' DESC 'fo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.137.1.6 NAME 'caseIgnoreSubstringMatch-fo' DESC 'fo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.138.1 NAME 'caseIgnoreOrderingMatch-fr-BF' DESC 'fr-BF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.138.1.6 NAME 'caseIgnoreSubstringMatch-fr-BF' DESC 'fr-BF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.139.1 NAME 'caseIgnoreOrderingMatch-fr-BI' DESC 'fr-BI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.139.1.6 NAME 'caseIgnoreSubstringMatch-fr-BI' DESC 'fr-BI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.140.1 NAME 'caseIgnoreOrderingMatch-fr-BJ' DESC 'fr-BJ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.140.1.6 NAME 'caseIgnoreSubstringMatch-fr-BJ' DESC 'fr-BJ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.141.1 NAME 'caseIgnoreOrderingMatch-fr-BL' DESC 'fr-BL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.141.1.6 NAME 'caseIgnoreSubstringMatch-fr-BL' DESC 'fr-BL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.142.1 NAME 'caseIgnoreOrderingMatch-fr-CD' DESC 'fr-CD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.142.1.6 NAME 'caseIgnoreSubstringMatch-fr-CD' DESC 'fr-CD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.143.1 NAME 'caseIgnoreOrderingMatch-fr-CF' DESC 'fr-CF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.143.1.6 NAME 'caseIgnoreSubstringMatch-fr-CF' DESC 'fr-CF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.144.1 NAME 'caseIgnoreOrderingMatch-fr-CG' DESC 'fr-CG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.144.1.6 NAME 'caseIgnoreSubstringMatch-fr-CG' DESC 'fr-CG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.145.1 NAME 'caseIgnoreOrderingMatch-fr-CI' DESC 'fr-CI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.145.1.6 NAME 'caseIgnoreSubstringMatch-fr-CI' DESC 'fr-CI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.146.1 NAME 'caseIgnoreOrderingMatch-fr-CM' DESC 'fr-CM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.146.1.6 NAME 'caseIgnoreSubstringMatch-fr-CM' DESC 'fr-CM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.147.1 NAME 'caseIgnoreOrderingMatch-fr-DJ' DESC 'fr-DJ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.147.1.6 NAME 'caseIgnoreSubstringMatch-fr-DJ' DESC 'fr-DJ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.148.1 NAME 'caseIgnoreOrderingMatch-fr-GA' DESC 'fr-GA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.148.1.6 NAME 'caseIgnoreSubstringMatch-fr-GA' DESC 'fr-GA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.149.1 NAME 'caseIgnoreOrderingMatch-fr-GN' DESC 'fr-GN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.149.1.6 NAME 'caseIgnoreSubstringMatch-fr-GN' DESC 'fr-GN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.150.1 NAME 'caseIgnoreOrderingMatch-fr-GP' DESC 'fr-GP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.150.1.6 NAME 'caseIgnoreSubstringMatch-fr-GP' DESC 'fr-GP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.151.1 NAME 'caseIgnoreOrderingMatch-fr-GQ' DESC 'fr-GQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.151.1.6 NAME 'caseIgnoreSubstringMatch-fr-GQ' DESC 'fr-GQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.152.1 NAME 'caseIgnoreOrderingMatch-fr-KM' DESC 'fr-KM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.152.1.6 NAME 'caseIgnoreSubstringMatch-fr-KM' DESC 'fr-KM' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.153.1 NAME 'caseIgnoreOrderingMatch-fr-LU' DESC 'fr-LU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.153.1.6 NAME 'caseIgnoreSubstringMatch-fr-LU' DESC 'fr-LU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.154.1 NAME 'caseIgnoreOrderingMatch-fr-MC' DESC 'fr-MC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.154.1.6 NAME 'caseIgnoreSubstringMatch-fr-MC' DESC 'fr-MC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.155.1 NAME 'caseIgnoreOrderingMatch-fr-MF' DESC 'fr-MF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.155.1.6 NAME 'caseIgnoreSubstringMatch-fr-MF' DESC 'fr-MF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.156.1 NAME 'caseIgnoreOrderingMatch-fr-MG' DESC 'fr-MG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.156.1.6 NAME 'caseIgnoreSubstringMatch-fr-MG' DESC 'fr-MG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.157.1 NAME 'caseIgnoreOrderingMatch-fr-ML' DESC 'fr-ML' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.157.1.6 NAME 'caseIgnoreSubstringMatch-fr-ML' DESC 'fr-ML' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.158.1 NAME 'caseIgnoreOrderingMatch-fr-MQ' DESC 'fr-MQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.158.1.6 NAME 'caseIgnoreSubstringMatch-fr-MQ' DESC 'fr-MQ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.159.1 NAME 'caseIgnoreOrderingMatch-fr-NE' DESC 'fr-NE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.159.1.6 NAME 'caseIgnoreSubstringMatch-fr-NE' DESC 'fr-NE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.160.1 NAME 'caseIgnoreOrderingMatch-fr-RE' DESC 'fr-RE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.160.1.6 NAME 'caseIgnoreSubstringMatch-fr-RE' DESC 'fr-RE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.161.1 NAME 'caseIgnoreOrderingMatch-fr-RW' DESC 'fr-RW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.161.1.6 NAME 'caseIgnoreSubstringMatch-fr-RW' DESC 'fr-RW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.162.1 NAME 'caseIgnoreOrderingMatch-fr-SN' DESC 'fr-SN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.162.1.6 NAME 'caseIgnoreSubstringMatch-fr-SN' DESC 'fr-SN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.163.1 NAME 'caseIgnoreOrderingMatch-fr-TD' DESC 'fr-TD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.163.1.6 NAME 'caseIgnoreSubstringMatch-fr-TD' DESC 'fr-TD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.164.1 NAME 'caseIgnoreOrderingMatch-fr-TG' DESC 'fr-TG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.164.1.6 NAME 'caseIgnoreSubstringMatch-fr-TG' DESC 'fr-TG' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.165.1 NAME 'caseIgnoreOrderingMatch-ga' DESC 'ga' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.165.1.6 NAME 'caseIgnoreSubstringMatch-ga' DESC 'ga' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.166.1 NAME 'caseIgnoreOrderingMatch-ga-IE' DESC 'ga-IE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.166.1.6 NAME 'caseIgnoreSubstringMatch-ga-IE' DESC 'ga-IE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.167.1 NAME 'caseIgnoreOrderingMatch-ga-IN' DESC 'ga-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.167.1.6 NAME 'caseIgnoreSubstringMatch-ga-IN' DESC 'ga-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.168.1 NAME 'caseIgnoreOrderingMatch-ha' DESC 'ha' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.168.1.6 NAME 'caseIgnoreSubstringMatch-ha' DESC 'ha' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.169.1 NAME 'caseIgnoreOrderingMatch-ha-Latn' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.169.1.6 NAME 'caseIgnoreSubstringMatch-ha-Latn' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.170.1 NAME 'caseIgnoreOrderingMatch-ha-Latn-GH' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.170.1.6 NAME 'caseIgnoreSubstringMatch-ha-Latn-GH' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.171.1 NAME 'caseIgnoreOrderingMatch-ha-Latn-NE' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.171.1.6 NAME 'caseIgnoreSubstringMatch-ha-Latn-NE' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.172.1 NAME 'caseIgnoreOrderingMatch-ha-Latn-NG' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.172.1.6 NAME 'caseIgnoreSubstringMatch-ha-Latn-NG' DESC 'ha-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.173.1 NAME 'caseIgnoreOrderingMatch-he' DESC 'he' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.173.1.6 NAME 'caseIgnoreSubstringMatch-he' DESC 'he' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.174.1 NAME 'caseIgnoreOrderingMatch-hi' DESC 'hi' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.174.1.6 NAME 'caseIgnoreSubstringMatch-hi' DESC 'hi' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.175.1 NAME 'caseIgnoreOrderingMatch-hy' DESC 'hy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.175.1.6 NAME 'caseIgnoreSubstringMatch-hy' DESC 'hy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.176.1 NAME 'caseIgnoreOrderingMatch-id-ID' DESC 'id' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.176.1.6 NAME 'caseIgnoreSubstringMatch-id-ID' DESC 'id' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.177.1 NAME 'caseIgnoreOrderingMatch-ig-NG' DESC 'id-ID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.177.1.6 NAME 'caseIgnoreSubstringMatch-ig-NG' DESC 'id-ID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.178.1 NAME 'caseIgnoreOrderingMatch-it-IT' DESC 'it-IT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.178.1.6 NAME 'caseIgnoreSubstringMatch-it-IT' DESC 'it-IT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.179.1 NAME 'caseIgnoreOrderingMatch-ka' DESC 'ka' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.179.1.6 NAME 'caseIgnoreSubstringMatch-ka' DESC 'ka' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.180.1 NAME 'caseIgnoreOrderingMatch-ka-GE' DESC 'ka-GE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.180.1.6 NAME 'caseIgnoreSubstringMatch-ka-GE' DESC 'ka-GE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.181.1 NAME 'caseIgnoreOrderingMatch-kk' DESC 'kk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.181.1.6 NAME 'caseIgnoreSubstringMatch-kk' DESC 'kk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.182.1 NAME 'caseIgnoreOrderingMatch-kl' DESC 'kl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.182.1.6 NAME 'caseIgnoreSubstringMatch-kl' DESC 'kl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.183.1 NAME 'caseIgnoreOrderingMatch-kn' DESC 'kn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.183.1.6 NAME 'caseIgnoreSubstringMatch-kn' DESC 'kn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.184.1 NAME 'caseIgnoreOrderingMatch-kok' DESC 'kok' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.184.1.6 NAME 'caseIgnoreSubstringMatch-kok' DESC 'kok' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.185.1 NAME 'caseIgnoreOrderingMatch-ml' DESC 'ml' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.185.1.6 NAME 'caseIgnoreSubstringMatch-ml' DESC 'ml' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.186.1 NAME 'caseIgnoreOrderingMatch-ms' DESC 'ms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.186.1.6 NAME 'caseIgnoreSubstringMatch-ms' DESC 'ms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.187.1 NAME 'caseIgnoreOrderingMatch-ms-BN' DESC 'ms-BN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.187.1.6 NAME 'caseIgnoreSubstringMatch-ms-BN' DESC 'ms-BN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.188.1 NAME 'caseIgnoreOrderingMatch-ms-MY' DESC 'ms-MY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.188.1.6 NAME 'caseIgnoreSubstringMatch-ms-MY' DESC 'ms-MY' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.189.1 NAME 'caseIgnoreOrderingMatch-mt' DESC 'mt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.189.1.6 NAME 'caseIgnoreSubstringMatch-mt' DESC 'mt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.190.1 NAME 'caseIgnoreOrderingMatch-nl-NL' DESC 'nl-NL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.190.1.6 NAME 'caseIgnoreSubstringMatch-nl-NL' DESC 'nl-NL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.191.1 NAME 'caseIgnoreOrderingMatch-nn' DESC 'nn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.191.1.6 NAME 'caseIgnoreSubstringMatch-nn' DESC 'nn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.192.1 NAME 'caseIgnoreOrderingMatch-om' DESC 'om' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.192.1.6 NAME 'caseIgnoreSubstringMatch-om' DESC 'om' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.193.1 NAME 'caseIgnoreOrderingMatch-om-ET' DESC 'om-ET' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.193.1.6 NAME 'caseIgnoreSubstringMatch-om-ET' DESC 'om-ET' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.194.1 NAME 'caseIgnoreOrderingMatch-om-KE' DESC 'om-KE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.194.1.6 NAME 'caseIgnoreSubstringMatch-om-KE' DESC 'om-KE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.195.1 NAME 'caseIgnoreOrderingMatch-or' DESC 'or' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.195.1.6 NAME 'caseIgnoreSubstringMatch-or' DESC 'or' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.196.1 NAME 'caseIgnoreOrderingMatch-pa' DESC 'pa' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.196.1.6 NAME 'caseIgnoreSubstringMatch-pa' DESC 'pa' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.197.1 NAME 'caseIgnoreOrderingMatch-pa-Arab' DESC 'pa-Arab' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.197.1.6 NAME 'caseIgnoreSubstringMatch-pa-Arab' DESC 'pa-Arab' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.198.1 NAME 'caseIgnoreOrderingMatch-pa-Arab-PK' DESC 'pa-Arab' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.198.1.6 NAME 'caseIgnoreSubstringMatch-pa-Arab-PK' DESC 'pa-Arab' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.199.1 NAME 'caseIgnoreOrderingMatch-pa-Guru' DESC 'pa-Guru' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.199.1.6 NAME 'caseIgnoreSubstringMatch-pa-Guru' DESC 'pa-Guru' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.200.1 NAME 'caseIgnoreOrderingMatch-pa-Guru-IN' DESC 'pa-Guru' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.200.1.6 NAME 'caseIgnoreSubstringMatch-pa-Guru-IN' DESC 'pa-Guru' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.201.1 NAME 'caseIgnoreOrderingMatch-ps' DESC 'ps' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.201.1.6 NAME 'caseIgnoreSubstringMatch-ps' DESC 'ps' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.202.1 NAME 'caseIgnoreOrderingMatch-pt' DESC 'pt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.202.1.6 NAME 'caseIgnoreSubstringMatch-pt' DESC 'pt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.203.1 NAME 'caseIgnoreOrderingMatch-pt-BR' DESC 'pt-BR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.203.1.6 NAME 'caseIgnoreSubstringMatch-pt-BR' DESC 'pt-BR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.204.1 NAME 'caseIgnoreOrderingMatch-pt-PT' DESC 'pt-PT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.204.1.6 NAME 'caseIgnoreSubstringMatch-pt-PT' DESC 'pt-PT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.205.1 NAME 'caseIgnoreOrderingMatch-ro-MD' DESC 'ro-MD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.205.1.6 NAME 'caseIgnoreSubstringMatch-ro-MD' DESC 'ro-MD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.206.1 NAME 'caseIgnoreOrderingMatch-ro-RO' DESC 'ro-RO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.206.1.6 NAME 'caseIgnoreSubstringMatch-ro-RO' DESC 'ro-RO' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.207.1 NAME 'caseIgnoreOrderingMatch-ru-MD' DESC 'ru-MD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.207.1.6 NAME 'caseIgnoreSubstringMatch-ru-MD' DESC 'ru-MD' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.208.1 NAME 'caseIgnoreOrderingMatch-ru-RU' DESC 'ru-RU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.208.1.6 NAME 'caseIgnoreSubstringMatch-ru-RU' DESC 'ru-RU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.209.1 NAME 'caseIgnoreOrderingMatch-ru-UA' DESC 'ru-UA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.209.1.6 NAME 'caseIgnoreSubstringMatch-ru-UA' DESC 'ru-UA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.210.1 NAME 'caseIgnoreOrderingMatch-si' DESC 'si' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.210.1.6 NAME 'caseIgnoreSubstringMatch-si' DESC 'si' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.211.1 NAME 'caseIgnoreOrderingMatch-sk' DESC 'sk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.211.1.6 NAME 'caseIgnoreSubstringMatch-sk' DESC 'sk' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.212.1 NAME 'caseIgnoreOrderingMatch-sl' DESC 'sl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.212.1.6 NAME 'caseIgnoreSubstringMatch-sl' DESC 'sl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.213.1 NAME 'caseIgnoreOrderingMatch-sq' DESC 'sq' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.213.1.6 NAME 'caseIgnoreSubstringMatch-sq' DESC 'sq' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.214.1 NAME 'caseIgnoreOrderingMatch-sr-Cyrl' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.214.1.6 NAME 'caseIgnoreSubstringMatch-sr-Cyrl' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.215.1 NAME 'caseIgnoreOrderingMatch-sr-Cyrl-BA' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.215.1.6 NAME 'caseIgnoreSubstringMatch-sr-Cyrl-BA' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.216.1 NAME 'caseIgnoreOrderingMatch-sr-Cyrl-ME' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.216.1.6 NAME 'caseIgnoreSubstringMatch-sr-Cyrl-ME' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.217.1 NAME 'caseIgnoreOrderingMatch-sr-Cyrl-RS' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.217.1.6 NAME 'caseIgnoreSubstringMatch-sr-Cyrl-RS' DESC 'sr-Cyrl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.218.1 NAME 'caseIgnoreOrderingMatch-sr-Latn' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.218.1.6 NAME 'caseIgnoreSubstringMatch-sr-Latn' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.219.1 NAME 'caseIgnoreOrderingMatch-sr-Latn-BA' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.219.1.6 NAME 'caseIgnoreSubstringMatch-sr-Latn-BA' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.220.1 NAME 'caseIgnoreOrderingMatch-sr-Latn-ME' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.220.1.6 NAME 'caseIgnoreSubstringMatch-sr-Latn-ME' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.221.1 NAME 'caseIgnoreOrderingMatch-sr-Latn-RS' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.221.1.6 NAME 'caseIgnoreSubstringMatch-sr-Latn-RS' DESC 'sr-Latn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.222.1 NAME 'caseIgnoreOrderingMatch-sv-FI' DESC 'sv-FI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.222.1.6 NAME 'caseIgnoreSubstringMatch-sv-FI' DESC 'sv-FI' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.223.1 NAME 'caseIgnoreOrderingMatch-sv-SE' DESC 'sv-SE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.223.1.6 NAME 'caseIgnoreSubstringMatch-sv-SE' DESC 'sv-SE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.224.1 NAME 'caseIgnoreOrderingMatch-sw' DESC 'sw' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.224.1.6 NAME 'caseIgnoreSubstringMatch-sw' DESC 'sw' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.225.1 NAME 'caseIgnoreOrderingMatch-sw-KE' DESC 'sw-KE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.225.1.6 NAME 'caseIgnoreSubstringMatch-sw-KE' DESC 'sw-KE' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.226.1 NAME 'caseIgnoreOrderingMatch-sw-TZ' DESC 'sw-TZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.226.1.6 NAME 'caseIgnoreSubstringMatch-sw-TZ' DESC 'sw-TZ' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.227.1 NAME 'caseIgnoreOrderingMatch-ta' DESC 'ta' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.227.1.6 NAME 'caseIgnoreSubstringMatch-ta' DESC 'ta' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.228.1 NAME 'caseIgnoreOrderingMatch-ta-IN' DESC 'ta-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.228.1.6 NAME 'caseIgnoreSubstringMatch-ta-IN' DESC 'ta-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.229.1 NAME 'caseIgnoreOrderingMatch-ta-LK' DESC 'ta-LK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.229.1.6 NAME 'caseIgnoreSubstringMatch-ta-LK' DESC 'ta-LK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.230.1 NAME 'caseIgnoreOrderingMatch-te' DESC 'te' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.230.1.6 NAME 'caseIgnoreSubstringMatch-te' DESC 'te' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.231.1 NAME 'caseIgnoreOrderingMatch-th' DESC 'th' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.231.1.6 NAME 'caseIgnoreSubstringMatch-th' DESC 'th' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.232.1 NAME 'caseIgnoreOrderingMatch-ur' DESC 'ur' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.232.1.6 NAME 'caseIgnoreSubstringMatch-ur' DESC 'ur' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.233.1 NAME 'caseIgnoreOrderingMatch-ur-IN' DESC 'ur-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.233.1.6 NAME 'caseIgnoreSubstringMatch-ur-IN' DESC 'ur-IN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.234.1 NAME 'caseIgnoreOrderingMatch-ur-PK' DESC 'ur-PK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.234.1.6 NAME 'caseIgnoreSubstringMatch-ur-PK' DESC 'ur-PK' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.235.1 NAME 'caseIgnoreOrderingMatch-vi' DESC 'vi' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.235.1.6 NAME 'caseIgnoreSubstringMatch-vi' DESC 'vi' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.236.1 NAME 'caseIgnoreOrderingMatch-yo' DESC 'yo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.236.1.6 NAME 'caseIgnoreSubstringMatch-yo' DESC 'yo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.237.1 NAME 'caseIgnoreOrderingMatch-zh-Hans' DESC 'zh-Hans' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.237.1.6 NAME 'caseIgnoreSubstringMatch-zh-Hans' DESC 'zh-Hans' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.238.1 NAME 'caseIgnoreOrderingMatch-zh-Hans-CN' DESC 'zh-Hans' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.238.1.6 NAME 'caseIgnoreSubstringMatch-zh-Hans-CN' DESC 'zh-Hans' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.239.1 NAME 'caseIgnoreOrderingMatch-zh-Hans-SG' DESC 'zh-Hans' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.239.1.6 NAME 'caseIgnoreSubstringMatch-zh-Hans-SG' DESC 'zh-Hans' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.240.1 NAME 'caseIgnoreOrderingMatch-zh-Hant-HK' DESC 'zh-Hant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.240.1.6 NAME 'caseIgnoreSubstringMatch-zh-Hant-HK' DESC 'zh-Hant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.241.1 NAME 'caseIgnoreOrderingMatch-zh-Hant-MO' DESC 'zh-Hant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.241.1.6 NAME 'caseIgnoreSubstringMatch-zh-Hant-MO' DESC 'zh-Hant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.242.1 NAME 'caseIgnoreOrderingMatch-zh-Hant-TW' DESC 'zh-Hant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.242.1.6 NAME 'caseIgnoreSubstringMatch-zh-Hant-TW' DESC 'zh-Hant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.243.1 NAME 'caseIgnoreOrderingMatch-zu' DESC 'zu' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.243.1.6 NAME 'caseIgnoreSubstringMatch-zu' DESC 'zu' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.244.1 NAME 'caseIgnoreOrderingMatch-zu-ZA' DESC 'zu-ZA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.244.1.6 NAME 'caseIgnoreSubstringMatch-zu-ZA' DESC 'zu-ZA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.0.3 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.0.3.6 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.11.3 NAME 'caseExactOrderingMatch-en' DESC 'en' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.3.2.11.3.6 NAME 'caseExactSubstringMatch-en' DESC 'en' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.23 NAME 'uniqueMemberMatch' DESC 'The uniqueMemberMatch rule compares an assertion value of the Name And Optional UID syntax to an attribute value of a syntax (e.g., the Name And Optional UID syntax) whose corresponding ASN.1 type is NameAndOptionalUID. The rule evaluates to TRUE if and only if the components of the assertion value and attribute value match according to the distinguishedNameMatch rule and either, (1) the component is absent from both the attribute value and assertion value, or (2) the component is present in both the attribute value and the assertion value and the component of the assertion value matches the component of the attribute value according to the bitStringMatch rule. Note that this matching rule has been altered from its description in X.520 [X.520] in order to make the matching rule commutative. Server implementors should consider using the original X.520 semantics (where the matching was less exact) for approximate matching of attributes with uniqueMemberMatch as the equality matching rule.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )", + "( 2.5.13.8 NAME 'numericStringMatch' DESC 'The rule evaluates to TRUE if and only if the prepared attribute value character string and the prepared assertion value character string have the same number of characters and corresponding characters have the same code point.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )", + "( 2.5.13.9 NAME 'numericStringOrderingMatch' DESC 'The rule evaluates to TRUE if and only if, in the code point collation order, the prepared attribute value character string appears earlier than the prepared assertion value character string; i.e., the attribute value is less than the assertion value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )", + "( 2.5.13.10 NAME 'numericStringSubstringsMatch' DESC 'The rule evaluates to TRUE if and only if (1) the prepared substrings of the assertion value match disjoint portions of the prepared attribute value, (2) an initial substring, if present, matches the beginning of the prepared attribute value character string, and (3) a final substring, if present, matches the end of the prepared attribute value character string.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.20 NAME 'telephoneNumberMatch' DESC 'The telephoneNumberMatch rule compares an assertion value of the Telephone Number syntax to an attribute value of a syntax (e.g., the Telephone Number syntax) whose corresponding ASN.1 type is a PrintableString representing a telephone number. The rule evaluates to TRUE if and only if the prepared attribute value character string and the prepared assertion value character string have the same number of characters and corresponding characters have the same code point. In preparing the attribute value and assertion value for comparison, characters are case folded in the Map preparation step, and only telephoneNumber Insignificant Character Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )", + "( 2.5.13.21 NAME 'telephoneNumberSubstringsMatch' DESC 'The telephoneNumberSubstringsMatch rule compares an assertion value of the Substring Assertion syntax to an attribute value of a syntax (e.g., the Telephone Number syntax) whose corresponding ASN.1 type is a PrintableString representing a telephone number. The rule evaluates to TRUE if and only if (1) the prepared substrings of the assertion value match disjoint portions of the prepared attribute value character string in the order of the substrings in the assertion value, (2) an substring, if present, matches the beginning of the prepared attribute value character string, and (3) a substring, if present, matches the end of the prepared attribute value character string. A prepared substring matches a portion of the prepared attribute value character string if corresponding characters have the same code point. In preparing the attribute value and assertion value substrings for comparison, characters are case folded in the Map preparation step, and only telephoneNumber Insignificant Character Handling is applied in the Insignificant Character Handling step.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )" + ], + "objectClass": [ + "top", + "ldapSubentry", + "subschema" + ], + "objectClasses": [ + "( 2.5.6.0 NAME 'top' ABSTRACT MUST objectClass X-ORIGIN 'RFC 4512' )", + "( 2.5.6.1 NAME 'alias' SUP top STRUCTURAL MUST aliasedObjectName X-ORIGIN 'RFC 4512' )", + "( 2.5.20.1 NAME 'subschema' AUXILIARY MAY ( dITStructureRules $ nameForms $ dITContentRules $ objectClasses $ attributeTypes $ matchingRules $ matchingRuleUse ) X-ORIGIN 'RFC 4512' )", + "( 1.3.6.1.4.1.1466.101.120.111 NAME 'extensibleObject' SUP top AUXILIARY X-ORIGIN 'RFC 4512' )", + "( 2.5.6.11 NAME 'applicationProcess' SUP top STRUCTURAL MUST cn MAY ( seeAlso $ ou $ l $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.2 NAME 'country' SUP top STRUCTURAL MUST c MAY ( searchGuide $ description ) X-ORIGIN 'RFC 4519' )", + "( 1.3.6.1.4.1.1466.344 NAME 'dcObject' SUP top AUXILIARY MUST dc X-ORIGIN 'RFC 4519' )", + "( 2.5.6.14 NAME 'device' SUP top STRUCTURAL MUST cn MAY ( serialNumber $ seeAlso $ owner $ ou $ o $ l $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.9 NAME 'groupOfNames' SUP top STRUCTURAL MUST cn MAY ( member $ businessCategory $ seeAlso $ owner $ ou $ o $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.17 NAME 'groupOfUniqueNames' SUP top STRUCTURAL MUST cn MAY ( uniqueMember $ businessCategory $ seeAlso $ owner $ ou $ o $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.3 NAME 'locality' SUP top STRUCTURAL MAY ( street $ seeAlso $ searchGuide $ st $ l $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.4 NAME 'organization' SUP top STRUCTURAL MUST o MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationalISDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.6 NAME 'person' SUP top STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.7 NAME 'organizationalPerson' SUP person STRUCTURAL MAY ( title $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationalISDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.8 NAME 'organizationalRole' SUP top STRUCTURAL MUST cn MAY ( x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationalISDNNumber $ facsimileTelephoneNumber $ seeAlso $ roleOccupant $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l $ description ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.5 NAME 'organizationalUnit' SUP top STRUCTURAL MUST ou MAY ( businessCategory $ description $ destinationIndicator $ facsimileTelephoneNumber $ internationalISDNNumber $ l $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ preferredDeliveryMethod $ registeredAddress $ searchGuide $ seeAlso $ st $ street $ telephoneNumber $ teletexTerminalIdentifier $ telexNumber $ userPassword $ x121Address ) X-ORIGIN 'RFC 4519' )", + "( 2.5.6.10 NAME 'residentialPerson' SUP person STRUCTURAL MUST l MAY ( businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationalISDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l ) X-ORIGIN 'RFC 4519' )", + "( 1.3.6.1.1.3.1 NAME 'uidObject' SUP top AUXILIARY MUST uid X-ORIGIN 'RFC 4519' )", + "( 2.16.840.1.113719.2.142.6.1.1 NAME 'ldapSubEntry' DESC 'LDAP Subentry class, version 1' SUP top STRUCTURAL MAY cn X-ORIGIN 'LDAP Subentry Internet Draft' )", + "( 2.16.840.1.113730.3.2.40 NAME 'directoryServerFeature' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY ( oid $ cn $ multiLineDescription ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.41 NAME 'nsslapdPlugin' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsslapd-pluginPath $ nsslapd-pluginInitfunc $ nsslapd-pluginType $ nsslapd-pluginId $ nsslapd-pluginVersion $ nsslapd-pluginVendor $ nsslapd-pluginDescription $ nsslapd-pluginEnabled ) MAY ( nsslapd-pluginConfigArea $ nsslapd-plugin-depends-on-type ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.44 NAME 'nsIndex' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsSystemIndex ) MAY ( description $ nsIndexType $ nsMatchingRule $ nsIndexIDListScanLimit ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.109 NAME 'nsBackendInstance' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.110 NAME 'nsMappingTree' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.104 NAME 'nsContainer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.108 NAME 'nsDS5Replica' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( nsDS5ReplicaRoot $ nsDS5ReplicaId ) MAY ( cn $ nsds5ReplicaPreciseTombstonePurging $ nsds5ReplicaCleanRUV $ nsds5ReplicaAbortCleanRUV $ nsDS5ReplicaType $ nsDS5ReplicaBindDN $ nsState $ nsDS5ReplicaName $ nsDS5Flags $ nsDS5Task $ nsDS5ReplicaReferral $ nsDS5ReplicaAutoReferral $ nsds5ReplicaPurgeDelay $ nsds5ReplicaTombstonePurgeInterval $ nsds5ReplicaChangeCount $ nsds5ReplicaLegacyConsumer $ nsds5ReplicaProtocolTimeout $ nsds5ReplicaBackoffMin $ nsds5ReplicaBackoffMax ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.113 NAME 'nsTombstone' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY ( nstombstonecsn $ nsParentUniqueId $ nscpEntryDN ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.103 NAME 'nsDS5ReplicationAgreement' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsds5ReplicaCleanRUVNotified $ nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicatedAttributeListTotal $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5replicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5ReplicaEnabled $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5ReplicaStripAttrs $ nsds5replicaSessionPauseTime $ nsds5ReplicaProtocolTimeout ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.39 NAME 'nsslapdConfig' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY cn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ nsSaslMapFilterTemplate ) MAY nsSaslMapPriority X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.43 NAME 'nsSNMP' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsSNMPEnabled ) MAY ( nsSNMPOrganization $ nsSNMPLocation $ nsSNMPContact $ nsSNMPDescription $ nsSNMPName $ nsSNMPMasterHost $ nsSNMPMasterPort ) X-ORIGIN 'Netscape Directory Server' )", + "( nsEncryptionConfig-oid NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsTLS1 $ sslVersionMin $ sslVersionMax $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers ) X-ORIGIN 'Netscape' )", + "( nsEncryptionModule-oid NAME 'nsEncryptionModule' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsSSLToken $ nsSSLPersonalitySSL $ nsSSLActivation ) X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.2.327 NAME 'rootDNPluginConfig' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( rootdn-open-time $ rootdn-close-time $ rootdn-days-allowed $ rootdn-allow-host $ rootdn-deny-host $ rootdn-allow-ip $ rootdn-deny-ip ) X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.2.328 NAME 'nsSchemaPolicy' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY ( cn $ schemaUpdateObjectclassAccept $ schemaUpdateObjectclassReject $ schemaUpdateAttributeAccept $ schemaUpdateAttributeReject ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.31 NAME 'groupOfCertificates' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( memberCertificateDescription $ businessCategory $ description $ o $ ou $ owner $ seeAlso ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.33 NAME 'groupOfURLs' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( memberURL $ businessCategory $ description $ o $ ou $ owner $ seeAlso ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.35 NAME 'LDAPServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( description $ l $ ou $ seeAlso $ generation $ changeLogMaximumAge $ changeLogMaximumSize ) X-ORIGIN 'Netscape Directory Server' )", + "( 1.3.6.1.4.1.250.3.18 NAME 'cacheObject' DESC 'object that contains the TTL (time to live) attribute type' SUP top STRUCTURAL MAY ttl X-ORIGIN 'LDAP Caching Internet Draft' )", + "( 2.16.840.1.113730.3.2.10 NAME 'netscapeServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( description $ serverRoot $ serverProductName $ serverVersionNumber $ installationTimeStamp $ administratorContactInfo $ userPassword $ adminUrl $ serverHostName ) X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.2.7 NAME 'nsLicenseUser' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY ( nsLicensedFor $ nsLicenseStartTime $ nsLicenseEndTime ) X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.2.1 NAME 'changeLogEntry' DESC 'LDAP changelog objectclass' SUP top STRUCTURAL MUST ( targetDn $ changeTime $ changeNumber $ changeType ) MAY ( changes $ newRdn $ deleteOldRdn $ newSuperior ) X-ORIGIN 'Changelog Internet Draft' )", + "( 2.16.840.1.113730.3.2.6 NAME 'referral' DESC 'LDAP referrals objectclass' SUP top STRUCTURAL MAY ref X-ORIGIN 'LDAPv3 referrals Internet Draft' )", + "( 2.16.840.1.113730.3.2.12 NAME 'passwordObject' DESC 'Netscape defined password policy objectclass' SUP top STRUCTURAL MAY ( pwdpolicysubentry $ passwordExpirationTime $ passwordExpWarned $ passwordRetryCount $ retryCountResetTime $ accountUnlockTime $ passwordHistory $ passwordAllowChangeTime $ passwordGraceUserTime ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.13 NAME 'passwordPolicy' DESC 'Netscape defined password policy objectclass' SUP top STRUCTURAL MAY ( passwordMaxAge $ passwordExp $ passwordMinLength $ passwordKeepHistory $ passwordInHistory $ passwordChange $ passwordWarning $ passwordLockout $ passwordMaxFailure $ passwordResetDuration $ passwordUnlock $ passwordLockoutDuration $ passwordCheckSyntax $ passwordMustChange $ passwordStorageScheme $ passwordMinAge $ passwordResetFailureCount $ passwordGraceLimit $ passwordMinDigits $ passwordMinAlphas $ passwordMinUppers $ passwordMinLowers $ passwordMinSpecials $ passwordMin8bit $ passwordMaxRepeats $ passwordMinCategories $ passwordMinTokenLength $ passwordTrackUpdateTime $ passwordAdminDN ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.30 NAME 'glue' DESC 'Netscape defined objectclass' SUP top STRUCTURAL X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.32 NAME 'netscapeMachineData' DESC 'Netscape defined objectclass' SUP top STRUCTURAL X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.38 NAME 'vlvSearch' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ vlvBase $ vlvScope $ vlvFilter ) MAY multiLineDescription X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.42 NAME 'vlvIndex' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ vlvSort ) MAY ( vlvEnabled $ vlvUses ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.84 NAME 'cosDefinition' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY ( costargettree $ costemplatedn $ cosspecifier $ cosAttribute $ aci $ cn $ uid ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.93 NAME 'nsRoleDefinition' DESC 'Netscape defined objectclass' SUP ldapSubEntry STRUCTURAL MAY ( description $ nsRoleScopeDN ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.94 NAME 'nsSimpleRoleDefinition' DESC 'Netscape defined objectclass' SUP nsRoleDefinition STRUCTURAL X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.95 NAME 'nsComplexRoleDefinition' DESC 'Netscape defined objectclass' SUP nsRoleDefinition STRUCTURAL X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.96 NAME 'nsManagedRoleDefinition' DESC 'Netscape defined objectclass' SUP nsSimpleRoleDefinition STRUCTURAL X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.97 NAME 'nsFilteredRoleDefinition' DESC 'Netscape defined objectclass' SUP nsComplexRoleDefinition STRUCTURAL MUST nsRoleFilter X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.98 NAME 'nsNestedRoleDefinition' DESC 'Netscape defined objectclass' SUP nsComplexRoleDefinition STRUCTURAL MUST nsRoleDN X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.99 NAME 'cosSuperDefinition' DESC 'Netscape defined objectclass' SUP ldapSubEntry STRUCTURAL MUST cosAttribute MAY description X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.100 NAME 'cosClassicDefinition' DESC 'Netscape defined objectclass' SUP cosSuperDefinition STRUCTURAL MAY ( costemplatedn $ cosspecifier ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.101 NAME 'cosPointerDefinition' DESC 'Netscape defined objectclass' SUP cosSuperDefinition STRUCTURAL MAY costemplatedn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.102 NAME 'cosIndirectDefinition' DESC 'Netscape defined objectclass' SUP cosSuperDefinition STRUCTURAL MAY cosIndirectSpecifier X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.503 NAME 'nsDSWindowsReplicationAgreement' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsDS5ReplicaHost $ nsDS5ReplicaPort $ nsDS5ReplicaTransportInfo $ nsDS5ReplicaBindDN $ nsDS5ReplicaCredentials $ nsDS5ReplicaBindMethod $ nsDS5ReplicaRoot $ nsDS5ReplicatedAttributeList $ nsDS5ReplicaUpdateSchedule $ nsds5BeginReplicaRefresh $ description $ nsds50ruv $ nsruvReplicaLastModified $ nsds5replicaTimeout $ nsds5replicaChangesSentSinceStartup $ nsds5replicaLastUpdateEnd $ nsds5replicaLastUpdateStart $ nsds5replicaLastUpdateStatus $ nsds5replicaUpdateInProgress $ nsds5replicaLastInitEnd $ nsds5replicaLastInitStart $ nsds5replicaLastInitStatus $ nsds5debugreplicatimeout $ nsds5replicaBusyWaitTime $ nsds5replicaSessionPauseTime $ nsds7WindowsReplicaSubtree $ nsds7DirectoryReplicaSubtree $ nsds7NewWinUserSyncEnabled $ nsds7NewWinGroupSyncEnabled $ nsds7WindowsDomain $ nsds7DirsyncCookie $ winSyncInterval $ oneWaySync $ winSyncMoveAction $ nsds5ReplicaEnabled $ winSyncDirectoryFilter $ winSyncWindowsFilter $ winSyncSubtreePair ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.128 NAME 'costemplate' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY ( cn $ cosPriority ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.304 NAME 'nsView' DESC 'Netscape defined objectclass' SUP top AUXILIARY MAY ( nsViewFilter $ description ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.316 NAME 'nsAttributeEncryption' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsEncryptionAlgorithm ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.5.6.21 NAME 'pkiUser' DESC 'X.509 PKI User' SUP top AUXILIARY MAY userCertificate X-ORIGIN 'RFC 4523' )", + "( 2.5.6.22 NAME 'pkiCA' DESC 'X.509 PKI Certificate Authority' SUP top AUXILIARY MAY ( cACertificate $ certificateRevocationList $ authorityRevocationList $ crossCertificatePair ) X-ORIGIN 'RFC 4523' )", + "( 2.5.6.19 NAME 'cRLDistributionPoint' DESC 'X.509 CRL distribution point' SUP top STRUCTURAL MUST cn MAY ( certificateRevocationList $ authorityRevocationList $ deltaRevocationList ) X-ORIGIN 'RFC 4523' )", + "( 2.5.6.23 NAME 'deltaCRL' DESC 'X.509 delta CRL' SUP top AUXILIARY MAY deltaRevocationList X-ORIGIN 'RFC 4523' )", + "( 2.5.6.15 NAME 'strongAuthenticationUser' DESC 'X.521 strong authentication user' SUP top AUXILIARY MUST userCertificate X-ORIGIN 'RFC 4523' )", + "( 2.5.6.18 NAME 'userSecurityInformation' DESC 'X.521 user security information' SUP top AUXILIARY MAY supportedAlgorithms X-ORIGIN 'RFC 4523' )", + "( 2.5.6.16 NAME 'certificationAuthority' DESC 'X.509 certificate authority' SUP top AUXILIARY MUST ( authorityRevocationList $ certificateRevocationList $ cACertificate ) MAY crossCertificatePair X-ORIGIN 'RFC 4523' )", + "( 2.5.6.16.2 NAME 'certificationAuthority-V2' DESC 'X.509 certificate authority, version 2' SUP certificationAuthority AUXILIARY MAY deltaRevocationList X-ORIGIN 'RFC 4523' )", + "( 0.9.2342.19200300.100.4.5 NAME 'account' SUP top STRUCTURAL MUST uid MAY ( description $ seeAlso $ l $ o $ ou $ host ) X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.6 NAME 'document' SUP top STRUCTURAL MUST documentIdentifier MAY ( cn $ description $ seeAlso $ l $ o $ ou $ documentTitle $ documentVersion $ documentAuthor $ documentLocation $ documentPublisher ) X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.9 NAME 'documentSeries' SUP top STRUCTURAL MUST cn MAY ( description $ l $ o $ ou $ seeAlso $ telephoneNumber ) X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.13 NAME 'domain' SUP top STRUCTURAL MUST dc MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationalISDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description $ o $ associatedName ) X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.17 NAME 'domainRelatedObject' SUP top AUXILIARY MUST associatedDomain X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.18 NAME 'friendlyCountry' SUP country STRUCTURAL MUST co X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.14 NAME 'rFC822localPart' SUP domain STRUCTURAL MAY ( cn $ sn ) X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.7 NAME 'room' SUP top STRUCTURAL MUST cn MAY ( roomNumber $ description $ seeAlso $ telephoneNumber ) X-ORIGIN 'RFC 4524' )", + "( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject' SUP top AUXILIARY MUST userPassword X-ORIGIN 'RFC 4524' )", + "( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' SUP organizationalPerson STRUCTURAL MAY ( audio $ businessCategory $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ givenName $ homePhone $ homePostalAddress $ initials $ jpegPhoto $ labeledURI $ mail $ manager $ mobile $ o $ pager $ photo $ roomNumber $ secretary $ uid $ userCertificate $ x500UniqueIdentifier $ preferredLanguage $ userSMIMECertificate $ userPKCS12 ) X-ORIGIN 'RFC 2798' )", + "( 2.16.840.1.113730.3.2.322 NAME 'autoMemberDefinition' DESC 'Auto Membership Config Definition Entry' SUP top STRUCTURAL MUST ( cn $ autoMemberScope $ autoMemberFilter $ autoMemberGroupingAttr ) MAY ( autoMemberDefaultGroup $ autoMemberDisabled ) X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.2.323 NAME 'autoMemberRegexRule' DESC 'Auto Membership Regex Rule Entry' SUP top STRUCTURAL MUST ( cn $ autoMemberTargetGroup ) MAY ( autoMemberExclusiveRegex $ autoMemberInclusiveRegex $ description ) X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.2.324 NAME 'dnaPluginConfig' DESC 'DNA plugin configuration' SUP top AUXILIARY MAY ( dnaType $ dnaPrefix $ dnaNextValue $ dnaMaxValue $ dnaInterval $ dnaMagicRegen $ dnaFilter $ dnaScope $ dnaSharedCfgDN $ dnaThreshold $ dnaNextRange $ dnaRangeRequestTimeout $ dnaRemoteBindDN $ dnaRemoteBindCred $ cn ) X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.2.325 NAME 'dnaSharedConfig' DESC 'DNA Shared Configuration' SUP top AUXILIARY MAY ( dnaHostname $ dnaPortNum $ dnaSecurePortNum $ dnaRemoteBindMethod $ dnaRemoteConnProtocol $ dnaRemainingValues ) X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.2.319 NAME 'mepManagedEntry' DESC 'Managed Entries Managed Entry' SUP top AUXILIARY MAY mepManagedBy X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.2.320 NAME 'mepOriginEntry' DESC 'Managed Entries Origin Entry' SUP top AUXILIARY MAY mepManagedEntry X-ORIGIN '389 Directory Server' )", + "( 2.16.840.1.113730.3.2.321 NAME 'mepTemplateEntry' DESC 'Managed Entries Template Entry' SUP top AUXILIARY MAY ( cn $ mepStaticAttr $ mepMappedAttr $ mepRDNAttr ) X-ORIGIN '389 Directory Server' )", + "( 1.3.6.1.1.1.2.0 NAME 'posixAccount' DESC 'Standard LDAP objectclass' SUP top AUXILIARY MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $ description ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.1 NAME 'shadowAccount' DESC 'Standard LDAP objectclass' SUP top AUXILIARY MUST uid MAY ( userPassword $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ description ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.2 NAME 'posixGroup' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST ( cn $ gidNumber ) MAY ( userPassword $ memberUid $ description ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.3 NAME 'ipService' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST ( cn $ ipServicePort $ ipServiceProtocol ) MAY description X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.4 NAME 'ipProtocol' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST ( cn $ ipProtocolNumber ) MAY description X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.5 NAME 'oncRpc' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST ( cn $ oncRpcNumber ) MAY description X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.6 NAME 'ipHost' DESC 'Standard LDAP objectclass' SUP top AUXILIARY MUST ( ipHostNumber $ cn ) MAY ( manager $ description $ l $ o $ ou $ owner $ seeAlso $ serialNumber ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.7 NAME 'ipNetwork' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST ( ipNetworkNumber $ cn ) MAY ( ipNetmaskNumber $ manager $ l $ description ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST cn MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.10 NAME 'nisObject' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST ( cn $ nisMapEntry $ nisMapName ) MAY description X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.11 NAME 'ieee802Device' DESC 'Standard LDAP objectclass' SUP top AUXILIARY MUST cn MAY ( macAddress $ description $ l $ o $ ou $ owner $ seeAlso $ serialNumber ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.12 NAME 'bootableDevice' DESC 'Standard LDAP objectclass' SUP top AUXILIARY MUST cn MAY ( bootFile $ bootParameter $ description $ l $ o $ ou $ owner $ seeAlso $ serialNumber ) X-ORIGIN 'RFC 2307' )", + "( 1.3.6.1.1.1.2.13 NAME 'nisMap' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MUST nisMapName MAY description X-ORIGIN 'RFC 2307' )", + "( 2.16.840.1.113730.3.2.129 NAME 'inetDomain' DESC 'Auxiliary class for virtual domain nodes' SUP top AUXILIARY MAY ( inetDomainBaseDN $ inetDomainStatus ) X-ORIGIN 'Netscape subscriber interoperability' )", + "( 2.16.840.1.113730.3.2.130 NAME 'inetUser' DESC 'Auxiliary class which must be present in an entry for delivery of subscriber services' SUP top AUXILIARY MAY ( uid $ inetUserStatus $ inetUserHttpURL $ userPassword $ memberOf ) X-ORIGIN 'Netscape subscriber interoperability' )", + "( 1.3.6.1.4.1.1466.101.120.141 NAME 'NetscapeLinkedOrganization' AUXILIARY MAY parentOrganization X-ORIGIN 'Netscape' )", + "( 1.3.6.1.4.1.1466.101.120.142 NAME 'NetscapePreferences' AUXILIARY MAY ( preferredLanguage $ preferredLocale $ preferredTimeZone ) X-ORIGIN 'Netscape' )", + "( 2.16.840.1.113730.3.2.134 NAME 'inetSubscriber' SUP top AUXILIARY MAY ( inetSubscriberAccountId $ inetSubscriberChallenge $ inetSubscriberResponse ) X-ORIGIN 'Netscape subscriber interoperability' )", + "( 2.16.840.1.113730.3.2.112 NAME 'inetAdmin' DESC 'Marker for an administrative group or user' SUP top AUXILIARY MAY ( aci $ memberOf $ adminRole ) X-ORIGIN 'Netscape Delegated Administrator' )", + "( 1.3.6.1.4.1.42.2.27.4.2.1 NAME 'javaContainer' DESC 'Container for a Java object' SUP top STRUCTURAL MUST cn X-ORIGIN 'RFC 2713' )", + "( 1.3.6.1.4.1.42.2.27.4.2.4 NAME 'javaObject' DESC 'Java object representation' SUP top ABSTRACT MUST javaClassName MAY ( javaClassNames $ javaCodebase $ javaDoc $ description ) X-ORIGIN 'RFC 2713' )", + "( 1.3.6.1.4.1.42.2.27.4.2.5 NAME 'javaSerializedObject' DESC 'Java serialized object' SUP javaObject AUXILIARY MUST javaSerializedData X-ORIGIN 'RFC 2713' )", + "( 1.3.6.1.4.1.42.2.27.4.2.7 NAME 'javaNamingReference' DESC 'JNDI reference' SUP javaObject AUXILIARY MAY ( javaReferenceAddress $ javaFactory ) X-ORIGIN 'RFC 2713' )", + "( 1.3.6.1.4.1.42.2.27.4.2.8 NAME 'javaMarshalledObject' DESC 'Java marshalled object' SUP javaObject AUXILIARY MUST javaSerializedData X-ORIGIN 'RFC 2713' )", + "( 0.9.2342.19200300.100.4.3 NAME 'pilotObject' DESC 'Standard LDAP objectclass' SUP top STRUCTURAL MAY ( audio $ ditRedirect $ info $ jpegPhoto $ lastModifiedBy $ lastModifiedTime $ manager $ photo $ uniqueIdentifier ) X-ORIGIN 'RFC 1274' )", + "( nsAdminDomain-oid NAME 'nsAdminDomain' DESC 'Netscape defined objectclass' SUP organizationalUnit STRUCTURAL MAY nsAdminDomainName X-ORIGIN 'Netscape' )", + "( nsHost-oid NAME 'nsHost' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( serverHostName $ description $ l $ nsHostLocation $ nsHardwarePlatform $ nsOsVersion ) X-ORIGIN 'Netscape' )", + "( nsAdminGroup-oid NAME 'nsAdminGroup' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsAdminGroupName $ description $ nsConfigRoot $ nsAdminSIEDN ) X-ORIGIN 'Netscape' )", + "( nsApplication-oid NAME 'nsApplication' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsVendor $ description $ nsProductName $ nsNickName $ nsProductVersion $ nsBuildNumber $ nsRevisionNumber $ nsSerialNumber $ nsInstalledLocation $ installationTimeStamp $ nsExpirationDate $ nsBuildSecurity $ nsLdapSchemaVersion $ nsServerMigrationClassname $ nsServerCreationClassname ) X-ORIGIN 'Netscape' )", + "( nsResourceRef-oid NAME 'nsResourceRef' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY seeAlso X-ORIGIN 'Netscape' )", + "( nsTask-oid NAME 'nsTask' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsTaskLabel $ nsHelpRef $ nsExecRef $ nsLogSuppress ) X-ORIGIN 'Netscape' )", + "( nsTaskGroup-oid NAME 'nsTaskGroup' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY nsTaskLabel X-ORIGIN 'Netscape' )", + "( nsAdminObject-oid NAME 'nsAdminObject' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsJarfilename $ nsClassname ) X-ORIGIN 'Netscape' )", + "( nsConfig-oid NAME 'nsConfig' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( description $ nsServerPort $ nsServerAddress $ nsSuiteSpotUser $ nsErrorLog $ nsPidLog $ nsAccessLog $ nsDefaultAcceptLanguage $ nsServerSecurity ) X-ORIGIN 'Netscape' )", + "( nsDirectoryInfo-oid NAME 'nsDirectoryInfo' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsBindDN $ nsBindPassword $ nsDirectoryURL $ nsDirectoryFailoverList $ nsDirectoryInfoRef ) X-ORIGIN 'Netscape' )", + "( nsAdminServer-oid NAME 'nsAdminServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsServerID ) MAY description X-ORIGIN 'Netscape Administration Services' )", + "( nsAdminConfig-oid NAME 'nsAdminConfig' DESC 'Netscape defined objectclass' SUP nsConfig STRUCTURAL MAY ( nsAdminCgiWaitPid $ nsAdminUsers $ nsAdminAccessHosts $ nsAdminAccessAddresses $ nsAdminOneACLDir $ nsAdminEnableDSGW $ nsAdminEnableEnduser $ nsAdminCacheLifetime ) X-ORIGIN 'Netscape Administration Services' )", + "( nsAdminResourceEditorExtension-oid NAME 'nsAdminResourceEditorExtension' DESC 'Netscape defined objectclass' SUP nsAdminObject STRUCTURAL MAY ( nsAdminAccountInfo $ nsDeleteclassname ) X-ORIGIN 'Netscape Administration Services' )", + "( nsAdminGlobalParameters-oid NAME 'nsAdminGlobalParameters' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsAdminEndUserHTMLIndex $ nsNickName ) X-ORIGIN 'Netscape Administration Services' )", + "( nsGlobalParameters-oid NAME 'nsGlobalParameters' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsUniqueAttribute $ nsUserIDFormat $ nsUserRDNComponent $ nsGroupRDNComponent $ nsWellKnownJarfiles $ nsNYR ) X-ORIGIN 'Netscape Administration Services' )", + "( nsDefaultObjectClasses-oid NAME 'nsDefaultObjectClasses' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY nsDefaultObjectClass X-ORIGIN 'Netscape Administration Services' )", + "( nsAdminConsoleUser-oid NAME 'nsAdminConsoleUser' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY nsPreference X-ORIGIN 'Netscape Administration Services' )", + "( nsCustomView-oid NAME 'nsCustomView' DESC 'Netscape defined objectclass' SUP nsAdminObject STRUCTURAL MAY nsDisplayName X-ORIGIN 'Netscape Administration Services' )", + "( nsTopologyCustomView-oid NAME 'nsTopologyCustomView' DESC 'Netscape defined objectclass' SUP nsCustomView STRUCTURAL MAY nsViewConfiguration X-ORIGIN 'Netscape Administration Services' )", + "( nsTopologyPlugin-oid NAME 'nsTopologyPlugin' DESC 'Netscape defined objectclass' SUP nsAdminObject STRUCTURAL X-ORIGIN 'Netscape Administration Services' )", + "( 2.16.840.1.113730.3.2.18 NAME 'netscapeCertificateServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL X-ORIGIN 'Netscape Certificate Management System' )", + "( nsCertificateServer-oid NAME 'nsCertificateServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST nsServerID MAY ( serverHostName $ nsServerPort $ nsCertConfig ) X-ORIGIN 'Netscape Certificate Management System' )", + "( 2.16.840.1.113730.3.2.23 NAME 'netscapeDirectoryServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL X-ORIGIN 'Netscape Directory Server' )", + "( nsDirectoryServer-oid NAME 'nsDirectoryServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST nsServerID MAY ( serverHostName $ nsServerPort $ nsSecureServerPort $ nsBindPassword $ nsBindDN $ nsBaseDN ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.8 NAME 'ntUser' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ntUserDomainId MAY ( description $ l $ ou $ seeAlso $ ntUserPriv $ ntUserHomeDir $ ntUserComment $ ntUserFlags $ ntUserScriptPath $ ntUserAuthFlags $ ntUserUsrComment $ ntUserParms $ ntUserWorkstations $ ntUserLastLogon $ ntUserLastLogoff $ ntUserAcctExpires $ ntUserMaxStorage $ ntUserUnitsPerWeek $ ntUserLogonHours $ ntUserBadPwCount $ ntUserNumLogons $ ntUserLogonServer $ ntUserCountryCode $ ntUserCodePage $ ntUserUniqueId $ ntUserPrimaryGroupId $ ntUserProfile $ ntUserHomeDirDrive $ ntUserPasswordExpired $ ntUserCreateNewAccount $ ntUserDeleteAccount $ ntUniqueId ) X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.2.9 NAME 'ntGroup' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ntUserDomainId MAY ( description $ l $ ou $ seeAlso $ ntGroupId $ ntGroupAttributes $ ntGroupCreateNewGroup $ ntGroupDeleteGroup $ ntGroupType $ ntUniqueId $ mail ) X-ORIGIN 'Netscape NT Synchronization' )", + "( 2.16.840.1.113730.3.2.82 NAME 'nsChangelog4Config' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY cn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.114 NAME 'nsConsumer4Config' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MAY cn X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.36 NAME 'LDAPReplica' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( description $ l $ ou $ seeAlso $ replicaRoot $ replicaHost $ replicaPort $ replicaBindDn $ replicaCredentials $ replicaBindMethod $ replicaUseSSL $ replicaUpdateSchedule $ replicaUpdateReplayed $ replicaUpdateFailedAt $ replicaBeginOrc $ replicaNickName $ replicaEntryFilter $ replicatedattributelist $ replicaCFUpdated $ replicaAbandonedChanges $ replicaLastRelevantChange ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.11 NAME 'cirReplicaSource' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( cirReplicaRoot $ cirHost $ cirPort $ cirBindDn $ cirUsePersistentSearch $ cirUseSsl $ cirBindCredentials $ cirLastUpdateApplied $ cirUpdateSchedule $ cirSyncInterval $ cirUpdateFailedat $ cirBeginORC $ replicaNickName $ replicaEntryFilter $ replicatedattributelist ) X-ORIGIN 'Netscape Directory Server' )", + "( 2.16.840.1.113730.3.2.3 NAME 'mailRecipient' DESC 'Netscape Messaging Server 4.x defined objectclass' SUP top AUXILIARY MAY ( cn $ mail $ mailAlternateAddress $ mailHost $ mailRoutingAddress $ mailAccessDomain $ mailAutoReplyMode $ mailAutoReplyText $ mailDeliveryOption $ mailForwardingAddress $ mailMessageStore $ mailProgramDeliveryInfo $ mailQuota $ multiLineDescription $ uid $ userPassword ) X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.113730.3.2.37 NAME 'nsMessagingServerUser' DESC 'Netscape Messaging Server 4.x defined objectclass' SUP top AUXILIARY MAY ( cn $ mailAccessDomain $ mailAutoReplyMode $ mailAutoReplyText $ mailDeliveryOption $ mailForwardingAddress $ mailMessageStore $ mailProgramDeliveryInfo $ mailQuota $ nsmsgDisallowAccess $ nsmsgNumMsgQuota $ nswmExtendedUserPrefs $ vacationstartdate $ vacationenddate ) X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.2.4 NAME 'mailGroup' DESC 'Netscape Messaging Server 4.x defined objectclass' SUP top AUXILIARY MAY ( cn $ mail $ mailAlternateAddress $ mailHost $ mailRoutingAddress $ mgrpAddHeader $ mgrpAllowedBroadcaster $ mgrpAllowedDomain $ mgrpApprovePassword $ mgrpBroadcasterPolicy $ mgrpDeliverTo $ mgrpErrorsTo $ mgrpModerator $ mgrpMsgMaxSize $ mgrpMsgRejectAction $ mgrpMsgRejectText $ mgrpNoDuplicateChecks $ mgrpRemoveHeader $ mgrpRFC822MailMember $ owner ) X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.2.5 NAME 'groupOfMailEnhancedUniqueNames' DESC 'Netscape Messaging Server 4.x defined objectclass' SUP top AUXILIARY MUST cn MAY ( businessCategory $ description $ mailEnhancedUniqueMember $ o $ ou $ owner $ seeAlso ) X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.2.24 NAME 'netscapeMailServer' DESC 'Netscape Messaging Server 4.x defined objectclass' SUP top AUXILIARY X-ORIGIN 'Netscape Messaging Server 4.x' )", + "( 2.16.840.1.113730.3.2.45 NAME 'nsValueItem' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsValueCIS $ nsValueCES $ nsValueTel $ nsValueInt $ nsValueBin $ nsValueDN $ nsValueType $ nsValueSyntax $ nsValueDescription $ nsValueHelpURL $ nsValueFlags $ nsValueDefault ) X-ORIGIN 'Netscape servers - value item' )", + "( 2.16.840.1.113730.3.2.29 NAME 'netscapeWebServer' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST ( cn $ nsServerID ) MAY ( description $ nsServerPort ) X-ORIGIN 'Netscape Web Server' )", + "( 2.16.840.1.113730.3.2.154 NAME 'netscapeReversiblePasswordObject' DESC 'object that contains an netscapeReversiblePassword' AUXILIARY MAY netscapeReversiblePassword X-ORIGIN 'Netscape Web Server' )", + "( 1.3.6.1.4.1.11.1.3.2.2.1 NAME 'accountPolicy' DESC 'Account policy entry' SUP top AUXILIARY MAY accountInactivityLimit X-ORIGIN 'Account Policy Plugin' )", + "( 1.3.6.1.1.1.2.17 NAME 'automount' DESC 'An entry in an automounter map' SUP top STRUCTURAL MUST ( cn $ automountInformation ) MAY description X-ORIGIN 'draft-howard-rfc2307bis' )", + "( 1.3.6.1.1.1.2.16 NAME 'automountMap' DESC 'An group of related automount objects' SUP top STRUCTURAL MUST ou X-ORIGIN 'draft-howard-rfc2307bis' )", + "( 1.3.6.1.4.1.5923.1.1.2 NAME 'eduPerson' AUXILIARY MAY ( eduPersonAffiliation $ eduPersonNickName $ eduPersonOrgDN $ eduPersonOrgUnitDN $ eduPersonPrimaryAffiliation $ eduPersonPrincipalName $ eduPersonEntitlement $ eduPersonPrimaryOrgUnitDN $ eduPersonScopedAffiliation ) X-ORIGIN 'http://middleware.internet2.edu/eduperson/' )", + "( 1.3.6.1.4.1.13769.9.1 NAME 'mozillaAbPersonAlpha' SUP top AUXILIARY MUST cn MAY ( c $ description $ displayName $ facsimileTelephoneNumber $ givenName $ homePhone $ l $ mail $ mobile $ mozillaCustom1 $ mozillaCustom2 $ mozillaCustom3 $ mozillaCustom4 $ mozillaHomeCountryName $ mozillaHomeLocalityName $ mozillaHomePostalCode $ mozillaHomeState $ mozillaHomeStreet $ mozillaHomeStreet2 $ mozillaHomeUrl $ mozillaNickname $ mozillaSecondEmail $ mozillaUseHtmlMail $ mozillaWorkStreet2 $ mozillaWorkUrl $ nsAIMid $ o $ ou $ pager $ postalCode $ postOfficeBox $ sn $ st $ street $ telephoneNumber $ title ) X-ORIGIN 'Mozilla Address Book' )", + "( 1.3.6.1.4.1.5322.17.1.1 NAME 'authorizedServiceObject' DESC 'Auxiliary object class for adding authorizedService attribute' SUP top AUXILIARY MAY authorizedService X-ORIGIN 'NSS LDAP schema' )", + "( 1.3.6.1.4.1.5322.17.1.2 NAME 'hostObject' DESC 'Auxiliary object class for adding host attribute' SUP top AUXILIARY MAY host X-ORIGIN 'NSS LDAP schema' )", + "( 2.16.840.1.113730.3.2.318 NAME 'pamConfig' DESC 'PAM plugin configuration' SUP top AUXILIARY MAY ( cn $ pamMissingSuffix $ pamExcludeSuffix $ pamIncludeSuffix $ pamIDAttr $ pamIDMapMethod $ pamFallback $ pamSecure $ pamService $ pamFilter ) X-ORIGIN 'Red Hat Directory Server' )", + "( 2.16.840.1.113730.3.2.326 NAME 'dynamicGroup' DESC 'Group containing internal dynamically-generated members' SUP posixGroup AUXILIARY MAY dsOnlyMemberUid X-ORIGIN 'Red Hat Directory Server' )", + "( 1.3.6.1.4.1.6981.11.2.3 NAME 'PureFTPdUser' DESC 'PureFTPd user with optional quota, throttling and ratio' STRUCTURAL MAY ( FTPStatus $ FTPQuotaFiles $ FTPQuotaMBytes $ FTPUploadRatio $ FTPDownloadRatio $ FTPUploadBandwidth $ FTPDownloadBandwidth $ FTPuid $ FTPgid ) X-ORIGIN 'Pure-FTPd' )", + "( 1.2.840.113556.1.5.87 NAME 'calEntry' DESC 'RFC2739: Calendar Entry' SUP top AUXILIARY MAY ( calCalURI $ calFBURL $ calOtherCalURIs $ calOtherFBURLs $ calCAPURI $ calOtherCAPURIs ) X-ORIGIN 'rfc2739' )", + "( 1.3.18.0.2.6.258 NAME 'printerAbstract' DESC 'Printer related information.' SUP top ABSTRACT MAY ( printer-name $ printer-natural-language-configured $ printer-location $ printer-info $ printer-more-info $ printer-make-and-model $ printer-multiple-document-jobs-supported $ printer-charset-configured $ printer-charset-supported $ printer-generated-natural-language-supported $ printer-document-format-supported $ printer-color-supported $ printer-compression-supported $ printer-pages-per-minute $ printer-pages-per-minute-color $ printer-finishings-supported $ printer-number-up-supported $ printer-sides-supported $ printer-media-supported $ printer-media-local-supported $ printer-resolution-supported $ printer-print-quality-supported $ printer-job-priority-supported $ printer-copies-supported $ printer-job-k-octets-supported $ printer-current-operator $ printer-service-person $ printer-delivery-orientation-supported $ printer-stacking-order-supported $ printer-output-features-supported ) X-ORIGIN 'rfc3712' )", + "( 1.3.18.0.2.6.255 NAME 'printerService' DESC 'Printer information.' SUP printerAbstract STRUCTURAL MAY ( printer-uri $ printer-xri-supported ) X-ORIGIN 'rfc3712' )", + "( 1.3.18.0.2.6.257 NAME 'printerServiceAuxClass' DESC 'Printer information.' SUP printerAbstract AUXILIARY MAY ( printer-uri $ printer-xri-supported ) X-ORIGIN 'rfc3712' )", + "( 1.3.18.0.2.6.256 NAME 'printerIPP' DESC 'Internet Printing Protocol (IPP) information.' SUP top AUXILIARY MAY ( printer-ipp-versions-supported $ printer-multiple-document-jobs-supported ) X-ORIGIN 'rfc3712' )", + "( 1.3.18.0.2.6.253 NAME 'printerLPR' DESC 'LPR information.' SUP top AUXILIARY MUST printer-name MAY printer-aliases X-ORIGIN 'rfc3712' )", + "( 1.3.6.1.4.1.2312.4.3.4.1 NAME 'sabayonProfile' DESC 'sabayon profile' SUP top STRUCTURAL MUST cn MAY ( sabayonProfileURL $ description ) X-ORIGIN 'Sabayon' )", + "( 1.3.6.1.4.1.2312.4.3.4.2 NAME 'sabayonProfileNameObject' DESC 'contains sabayon profile name' SUP top AUXILIARY MUST sabayonProfileName X-ORIGIN 'Sabayon' )", + "( 1.3.6.1.4.1.2312.4.3.4.3 NAME 'sabayonProfileURLObject' DESC 'contains sabayon profile' SUP top AUXILIARY MUST cn MAY sabayonProfileURL X-ORIGIN 'Sabayon' )", + "( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' DESC 'Sudoer Entries' SUP top STRUCTURAL MUST cn MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoRunAsUser $ sudoRunAsGroup $ sudoOption $ sudoNotBefore $ sudoNotAfter $ sudoOrder $ description ) X-ORIGIN 'SUDO' )", + "( 5.3.6.1.1.1.2.0 NAME 'trustAccount' DESC 'Sets trust accounts information' SUP top AUXILIARY MUST trustModel MAY accessTo X-ORIGIN 'nss_ldap/pam_ldap' )" + ] + }, + "schema_entry": "cn=schema", + "type": "SchemaInfo" +} +""" + +ds389_1_3_3_dsa_info = """ +{ + "raw": { + "aci": [ + "(targetattr != \\"aci\\")(version 3.0; aci \\"rootdse anon read access\\"; allow(read,search,compare) userdn=\\"ldap:///anyone\\";)" + ], + "dataversion": [ + "020141110230816" + ], + "defaultnamingcontext": [ + "dc=labldap06,dc=a3,dc=internal,dc=cloudapp,dc=net" + ], + "namingContexts": [ + "dc=labldap06,dc=a3,dc=internal,dc=cloudapp,dc=net" + ], + "netscapemdsuffix": [ + "cn=ldap://dc=DS3891,dc=labldap06,dc=a3,dc=internal,dc=cloudapp,dc=net:389" + ], + "objectClass": [ + "top" + ], + "subschemaSubentry": [ + "cn=schema" + ], + "supportedControl": [ + "2.16.840.1.113730.3.4.2", + "2.16.840.1.113730.3.4.3", + "2.16.840.1.113730.3.4.4", + "2.16.840.1.113730.3.4.5", + "1.2.840.113556.1.4.473", + "2.16.840.1.113730.3.4.9", + "2.16.840.1.113730.3.4.16", + "2.16.840.1.113730.3.4.15", + "2.16.840.1.113730.3.4.17", + "2.16.840.1.113730.3.4.19", + "1.3.6.1.1.13.1", + "1.3.6.1.1.13.2", + "1.3.6.1.4.1.42.2.27.8.5.1", + "1.3.6.1.4.1.42.2.27.9.5.2", + "1.2.840.113556.1.4.319", + "1.3.6.1.4.1.42.2.27.9.5.8", + "1.3.6.1.4.1.4203.666.5.16", + "2.16.840.1.113730.3.4.14", + "2.16.840.1.113730.3.4.20", + "1.3.6.1.4.1.1466.29539.12", + "2.16.840.1.113730.3.4.12", + "2.16.840.1.113730.3.4.18", + "2.16.840.1.113730.3.4.13" + ], + "supportedExtension": [ + "2.16.840.1.113730.3.5.7", + "2.16.840.1.113730.3.5.8", + "2.16.840.1.113730.3.5.3", + "2.16.840.1.113730.3.5.12", + "2.16.840.1.113730.3.5.5", + "2.16.840.1.113730.3.5.6", + "2.16.840.1.113730.3.5.9", + "2.16.840.1.113730.3.5.4", + "2.16.840.1.113730.3.6.5", + "2.16.840.1.113730.3.6.6", + "2.16.840.1.113730.3.6.7", + "2.16.840.1.113730.3.6.8", + "1.3.6.1.4.1.4203.1.11.3", + "1.3.6.1.4.1.4203.1.11.1" + ], + "supportedLdapVersion": [ + "2", + "3" + ], + "supportedSASLMechanisms": [ + "EXTERNAL", + "PLAIN", + "DIGEST-MD5", + "ANONYMOUS", + "GSSAPI", + "LOGIN" + ], + "vendorName": [ + "389 Project" + ], + "vendorVersion": [ + "389-Directory/1.3.3.0 B2014.289.2022" + ] + }, + "type": "DsaInfo" +} +""" diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/edir888.py b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/edir888.py new file mode 100644 index 0000000000000000000000000000000000000000..8243a7ee71344b6282581f50bf6efe416f578e6d --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/edir888.py @@ -0,0 +1,1127 @@ +""" +""" + +# Created on 2014.10.21 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +edir_8_8_8_schema = """ +{ + "raw": { + "attributeTypes": [ + "( 2.5.4.35 NAME 'userPassword' DESC 'Internal NDS policy forces this to be single-valued' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} USAGE directoryOperation )", + "( 2.5.18.1 NAME 'createTimestamp' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.2 NAME 'modifyTimestamp' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.10 NAME 'subschemaSubentry' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation )", + "( 2.5.21.9 NAME 'structuralObjectClass' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.27.4.49 NAME 'subordinateCount' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.27.4.48 NAME 'entryFlags' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.27.4.51 NAME 'federationBoundary' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.21.5 NAME 'attributeTypes' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.3 USAGE directoryOperation )", + "( 2.5.21.6 NAME 'objectClasses' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.37 USAGE directoryOperation )", + "( 1.3.6.1.1.20 NAME 'entryDN' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.1.4.1.2 NAME 'ACL' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.5.4.1 NAME 'aliasedObjectName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Aliased Object Name' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.16.840.1.113719.1.1.4.1.6 NAME 'backLink' SYNTAX 2.16.840.1.113719.1.1.5.1.23 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Back Link' X-NDS_SERVER_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.8 NAME 'binderyProperty' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Bindery Property' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.7 NAME 'binderyObjectRestriction' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Bindery Object Restriction' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.9 NAME 'binderyType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Bindery Type' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.11 NAME 'cAPrivateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'CA Private Key' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.12 NAME 'cAPublicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'CA Public Key' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.10 NAME 'Cartridge' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.3 NAME ( 'cn' 'commonName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'CN' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.78 NAME 'printerConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5{64512} SINGLE-VALUE X-NDS_NAME 'Printer Configuration' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.15 NAME 'Convergence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{1} SINGLE-VALUE X-NDS_UPPER_BOUND '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.6 NAME ( 'c' 'countryName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{2} SINGLE-VALUE X-NDS_NAME 'C' X-NDS_LOWER_BOUND '2' X-NDS_UPPER_BOUND '2' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.18 NAME 'defaultQueue' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Default Queue' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.13 NAME ( 'description' 'multiLineDescription' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} X-NDS_NAME 'Description' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '1024' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.64 NAME 'partitionCreationTime' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Partition Creation Time' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.23 NAME 'facsimileTelephoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.22{64512} X-NDS_NAME 'Facsimile Telephone Number' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.117 NAME 'highConvergenceSyncInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'High Convergence Sync Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.25 NAME 'groupMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Group Membership' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.26 NAME 'ndsHomeDirectory' SYNTAX 2.16.840.1.113719.1.1.5.1.15{255} SINGLE-VALUE X-NDS_NAME 'Home Directory' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '255' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.27 NAME 'hostDevice' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Host Device' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.28 NAME 'hostResourceName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'Host Resource Name' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.29 NAME 'hostServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Host Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.30 NAME 'inheritedACL' SYNTAX 2.16.840.1.113719.1.1.5.1.17 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Inherited ACL' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.7 NAME ( 'l' 'localityname' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'L' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.39 NAME 'loginAllowedTimeMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5{42} SINGLE-VALUE X-NDS_NAME 'Login Allowed Time Map' X-NDS_LOWER_BOUND '42' X-NDS_UPPER_BOUND '42' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.40 NAME 'loginDisabled' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Login Disabled' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.41 NAME 'loginExpirationTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Login Expiration Time' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.42 NAME 'loginGraceLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Login Grace Limit' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.43 NAME 'loginGraceRemaining' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_NAME 'Login Grace Remaining' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.44 NAME 'loginIntruderAddress' SYNTAX 2.16.840.1.113719.1.1.5.1.12 SINGLE-VALUE X-NDS_NAME 'Login Intruder Address' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.45 NAME 'loginIntruderAttempts' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_NAME 'Login Intruder Attempts' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.46 NAME 'loginIntruderLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Login Intruder Limit' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.31 NAME 'intruderAttemptResetInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Intruder Attempt Reset Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.47 NAME 'loginIntruderResetTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Login Intruder Reset Time' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.48 NAME 'loginMaximumSimultaneous' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Login Maximum Simultaneous' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.49 NAME 'loginScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Login Script' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.50 NAME 'loginTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Login Time' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.31 NAME ( 'member' 'uniqueMember' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Member' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.52 NAME 'Memory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.22 NAME 'eMailAddress' SYNTAX 2.16.840.1.113719.1.1.5.1.14{64512} X-NDS_NAME 'EMail Address' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.55 NAME 'networkAddress' SYNTAX 2.16.840.1.113719.1.1.5.1.12 X-NDS_NAME 'Network Address' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.56 NAME 'networkAddressRestriction' SYNTAX 2.16.840.1.113719.1.1.5.1.12 X-NDS_NAME 'Network Address Restriction' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.57 NAME 'notify' SYNTAX 2.16.840.1.113719.1.1.5.1.25 X-NDS_NAME 'Notify' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.114 NAME 'Obituary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.0 NAME 'objectClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 X-NDS_NAME 'Object Class' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.16.840.1.113719.1.1.4.1.59 NAME 'operator' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Operator' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'OU' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.10 NAME ( 'o' 'organizationname' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'O' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.32 NAME 'owner' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Owner' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.63 NAME 'pageDescriptionLanguage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} X-NDS_NAME 'Page Description Language' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.65 NAME 'passwordsUsed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'Passwords Used' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.66 NAME 'passwordAllowChange' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Password Allow Change' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.67 NAME 'passwordExpirationInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Password Expiration Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.68 NAME 'passwordExpirationTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Password Expiration Time' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.69 NAME 'passwordMinimumLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Password Minimum Length' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.70 NAME 'passwordRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Password Required' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.71 NAME 'passwordUniqueRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Password Unique Required' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.72 NAME 'path' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'Path' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.19 NAME 'physicalDeliveryOfficeName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'Physical Delivery Office Name' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.16 NAME 'postalAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41{64512} X-NDS_NAME 'Postal Address' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.17 NAME 'postalCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} X-NDS_NAME 'Postal Code' X-NDS_UPPER_BOUND '40' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.18 NAME 'postOfficeBox' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} X-NDS_NAME 'Postal Office Box' X-NDS_UPPER_BOUND '40' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.80 NAME 'printJobConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Print Job Configuration' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.79 NAME 'printerControl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Printer Control' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.82 NAME 'privateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Private Key' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.83 NAME 'Profile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.84 NAME 'publicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Public Key' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_OPERATIONAL '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.85 NAME 'queue' SYNTAX 2.16.840.1.113719.1.1.5.1.25 X-NDS_NAME 'Queue' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.86 NAME 'queueDirectory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE X-NDS_NAME 'Queue Directory' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '255' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.115 NAME 'Reference' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.88 NAME 'Replica' SYNTAX 2.16.840.1.113719.1.1.5.1.16{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.89 NAME 'Resource' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.33 NAME 'roleOccupant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Role Occupant' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.116 NAME 'higherPrivileges' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Higher Privileges' X-NDS_SERVER_READ '1' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.92 NAME 'securityEquals' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Security Equals' X-NDS_SERVER_READ '1' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.5.4.34 NAME 'seeAlso' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'See Also' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.5 NAME 'serialNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} X-NDS_NAME 'Serial Number' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.95 NAME 'server' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Server' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'S' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.98 NAME 'status' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Status' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_OPERATIONAL '1' )", + "( 2.5.4.9 NAME 'street' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'SA' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.102 NAME 'supportedTypefaces' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Supported Typefaces' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.101 NAME 'supportedServices' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Supported Services' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.4 NAME ( 'sn' 'surname' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Surname' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.20 NAME 'telephoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} X-NDS_NAME 'Telephone Number' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.12 NAME 'title' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Title' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.111 NAME 'User' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.112 NAME 'Version' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} SINGLE-VALUE X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.1 NAME 'accountBalance' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_NAME 'Account Balance' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.4 NAME 'allowUnlimitedCredit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Allow Unlimited Credit' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.118 NAME 'lowConvergenceResetTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Low Convergence Reset Time' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.54 NAME 'minimumAccountBalance' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Minimum Account Balance' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.104 NAME 'lowConvergenceSyncInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Low Convergence Sync Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.21 NAME 'Device' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.53 NAME 'messageServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Message Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.34 NAME 'Language' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.100 NAME 'supportedConnections' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Supported Connections' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.107 NAME 'typeCreatorMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Type Creator Map' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.108 NAME 'ndsUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'UID' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.24 NAME 'groupID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'GID' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.110 NAME 'unknownBaseClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Unknown Base Class' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.87 NAME 'receivedUpTo' SYNTAX 2.16.840.1.113719.1.1.5.1.19 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Received Up To' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.33 NAME 'synchronizedUpTo' SYNTAX 2.16.840.1.113719.1.1.5.1.19 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Synchronized Up To' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.5 NAME 'authorityRevocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Authority Revocation' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.13 NAME 'certificateRevocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Certificate Revocation' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.17 NAME 'ndsCrossCertificatePair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5{64512} X-NDS_NAME 'Cross Certificate Pair' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.37 NAME 'lockedByIntruder' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Locked By Intruder' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.77 NAME 'printer' SYNTAX 2.16.840.1.113719.1.1.5.1.25 X-NDS_NAME 'Printer' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.20 NAME 'detectIntruder' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Detect Intruder' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.38 NAME 'lockoutAfterDetection' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Lockout After Detection' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.32 NAME 'intruderLockoutResetInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Intruder Lockout Reset Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.96 NAME 'serverHolds' SYNTAX 2.16.840.1.113719.1.1.5.1.23 X-NDS_NAME 'Server Holds' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.91 NAME 'sAPName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{47} SINGLE-VALUE X-NDS_NAME 'SAP Name' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '47' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.113 NAME 'Volume' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.35 NAME 'lastLoginTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Last Login Time' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.81 NAME 'printServer' SYNTAX 2.16.840.1.113719.1.1.5.1.25 SINGLE-VALUE X-NDS_NAME 'Print Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.119 NAME 'nNSDomain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'NNS Domain' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.120 NAME 'fullName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} X-NDS_NAME 'Full Name' X-NDS_UPPER_BOUND '127' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.121 NAME 'partitionControl' SYNTAX 2.16.840.1.113719.1.1.5.1.25 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Partition Control' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.122 NAME 'revision' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Revision' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_SCHED_SYNC_NEVER '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.123 NAME 'certificateValidityInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'Certificate Validity Interval' X-NDS_LOWER_BOUND '60' X-NDS_UPPER_BOUND '-1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.124 NAME 'externalSynchronizer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'External Synchronizer' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.125 NAME 'messagingDatabaseLocation' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NAME 'Messaging Database Location' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.126 NAME 'messageRoutingGroup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Message Routing Group' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.127 NAME 'messagingServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Messaging Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.128 NAME 'Postmaster' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.162 NAME 'mailboxLocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Mailbox Location' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.163 NAME 'mailboxID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8} SINGLE-VALUE X-NDS_NAME 'Mailbox ID' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '8' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.164 NAME 'externalName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'External Name' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.165 NAME 'securityFlags' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Security Flags' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.166 NAME 'messagingServerType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} SINGLE-VALUE X-NDS_NAME 'Messaging Server Type' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.167 NAME 'lastReferencedTime' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Last Referenced Time' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.42 NAME 'givenName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} X-NDS_NAME 'Given Name' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.43 NAME 'initials' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8} X-NDS_NAME 'Initials' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '8' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.44 NAME 'generationQualifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8} SINGLE-VALUE X-NDS_NAME 'Generational Qualifier' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '8' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.171 NAME 'profileMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Profile Membership' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.172 NAME 'dsRevision' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'DS Revision' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_OPERATIONAL '1' )", + "( 2.16.840.1.113719.1.1.4.1.173 NAME 'supportedGateway' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{4096} X-NDS_NAME 'Supported Gateway' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '4096' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.174 NAME 'equivalentToMe' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Equivalent To Me' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.16.840.1.113719.1.1.4.1.175 NAME 'replicaUpTo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Replica Up To' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.176 NAME 'partitionStatus' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Partition Status' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.177 NAME 'permanentConfigParms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'Permanent Config Parms' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.178 NAME 'Timezone' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.179 NAME 'binderyRestrictionLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Bindery Restriction Level' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.180 NAME 'transitiveVector' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Transitive Vector' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_SCHED_SYNC_NEVER '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.181 NAME 'T' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.183 NAME 'purgeVector' SYNTAX 2.16.840.1.113719.1.1.5.1.19 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Purge Vector' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_SCHED_SYNC_NEVER '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.184 NAME 'synchronizationTolerance' SYNTAX 2.16.840.1.113719.1.1.5.1.19 USAGE directoryOperation X-NDS_NAME 'Synchronization Tolerance' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.185 NAME 'passwordManagement' SYNTAX 2.16.840.1.113719.1.1.5.1.0 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Password Management' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.186 NAME 'usedBy' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Used By' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.187 NAME 'Uses' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.500 NAME 'obituaryNotify' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Obituary Notify' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.501 NAME 'GUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{16} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_LOWER_BOUND '16' X-NDS_UPPER_BOUND '16' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.502 NAME 'otherGUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{16} USAGE directoryOperation X-NDS_NAME 'Other GUID' X-NDS_LOWER_BOUND '16' X-NDS_UPPER_BOUND '16' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.503 NAME 'auxiliaryClassFlag' SYNTAX 2.16.840.1.113719.1.1.5.1.0 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Auxiliary Class Flag' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.504 NAME 'unknownAuxiliaryClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} USAGE directoryOperation X-NDS_NAME 'Unknown Auxiliary Class' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userId' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'uniqueID' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 0.9.2342.19200300.100.1.25 NAME 'dc' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} X-NDS_NAME 'dc' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.507 NAME 'auxClassObjectClassBackup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'AuxClass Object Class Backup' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.508 NAME 'localReceivedUpTo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Local Received Up To' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.4 NAME 'federationControl' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.2 NAME 'federationSearchPath' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.3 NAME 'federationDNSName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.1 NAME 'federationBoundaryType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.14.4.1.4 NAME 'DirXML-Associations' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.5.18.3 NAME 'creatorsName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.18.4 NAME 'modifiersName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.300 NAME 'languageId' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.35 NAME 'ndsPredicate' SYNTAX 2.16.840.1.113719.1.1.5.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.36 NAME 'ndsPredicateState' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.37 NAME 'ndsPredicateFlush' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.38 NAME 'ndsPredicateTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_UPPER_BOUND '2147483647' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.40 NAME 'ndsPredicateStatsDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.39 NAME 'ndsPredicateUseValues' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.601 NAME 'syncPanePoint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.600 NAME 'syncWindowVector' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.602 NAME 'objectVersion' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.27.4.52 NAME 'memberQueryURL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'memberQuery' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.302 NAME 'excludedMember' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.525 NAME 'auxClassCompatibility' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.518 NAME 'ndsAgentPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.519 NAME 'ndsOperationCheckpoint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.520 NAME 'localReferral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.521 NAME 'treeReferral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.522 NAME 'schemaResetLock' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.523 NAME 'modifiedACLEntry' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.524 NAME 'monitoredConnection' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.526 NAME 'localFederationBoundary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.527 NAME 'replicationFilter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.296 NAME 'loginActivationTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.687 NAME 'UpdateInProgress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.400.1 NAME 'edirSchemaFlagVersion' SYNTAX 2.16.840.1.113719.1.1.5.1.0 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.512 NAME 'indexDefinition' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.513 NAME 'ndsStatusRepair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.514 NAME 'ndsStatusExternalReference' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.515 NAME 'ndsStatusObituary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.516 NAME 'ndsStatusSchema' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.517 NAME 'ndsStatusLimber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.511 NAME 'authoritative' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113730.3.1.34 NAME 'ref' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.546 NAME 'CachedAttrsOnExtRefs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.1.4.1.547 NAME 'ExtRefLastUpdatedTime' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.688 NAME 'NCPKeyMaterialName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.1.4.713 NAME 'UTF8LoginScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.714 NAME 'loginScriptCharset' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.1.192 NAME 'lDAPLogLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_NAME 'LDAP Log Level' X-NDS_UPPER_BOUND '32768' )", + "( 2.16.840.1.113719.1.27.4.12 NAME 'lDAPUDPPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{65535} SINGLE-VALUE X-NDS_NAME 'LDAP UDP Port' X-NDS_UPPER_BOUND '65535' )", + "( 2.16.840.1.113719.1.1.4.1.204 NAME 'lDAPLogFilename' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Log Filename' )", + "( 2.16.840.1.113719.1.1.4.1.205 NAME 'lDAPBackupLogFilename' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Backup Log Filename' )", + "( 2.16.840.1.113719.1.1.4.1.206 NAME 'lDAPLogSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'LDAP Log Size Limit' X-NDS_LOWER_BOUND '2048' X-NDS_UPPER_BOUND '-1' )", + "( 2.16.840.1.113719.1.1.4.1.194 NAME 'lDAPSearchSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_NAME 'LDAP Search Size Limit' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.1.4.1.195 NAME 'lDAPSearchTimeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_NAME 'LDAP Search Time Limit' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.1.4.1.207 NAME 'lDAPSuffix' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'LDAP Suffix' )", + "( 2.16.840.1.113719.1.27.4.70 NAME 'ldapConfigVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.14 NAME 'ldapReferral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Referral' )", + "( 2.16.840.1.113719.1.27.4.73 NAME 'ldapDefaultReferralBehavior' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.23 NAME 'ldapSearchReferralUsage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'LDAP:searchReferralUsage' )", + "( 2.16.840.1.113719.1.27.4.24 NAME 'lDAPOtherReferralUsage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'LDAP:otherReferralUsage' )", + "( 2.16.840.1.113719.1.27.4.1 NAME 'ldapHostServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'LDAP Host Server' )", + "( 2.16.840.1.113719.1.27.4.2 NAME 'ldapGroupDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'LDAP Group' )", + "( 2.16.840.1.113719.1.27.4.3 NAME 'ldapTraceLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_NAME 'LDAP Screen Level' X-NDS_UPPER_BOUND '32768' )", + "( 2.16.840.1.113719.1.27.4.4 NAME 'searchSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.27.4.5 NAME 'searchTimeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.27.4.6 NAME 'ldapServerBindLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'LDAP Server Bind Limit' X-NDS_UPPER_BOUND '-1' )", + "( 2.16.840.1.113719.1.27.4.7 NAME 'ldapServerIdleTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'LDAP Server Idle Timeout' X-NDS_UPPER_BOUND '-1' )", + "( 2.16.840.1.113719.1.27.4.8 NAME 'ldapEnableTCP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'LDAP Enable TCP' )", + "( 2.16.840.1.113719.1.27.4.10 NAME 'ldapEnableSSL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'LDAP Enable SSL' )", + "( 2.16.840.1.113719.1.27.4.11 NAME 'ldapTCPPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{65535} SINGLE-VALUE X-NDS_NAME 'LDAP TCP Port' X-NDS_UPPER_BOUND '65535' )", + "( 2.16.840.1.113719.1.27.4.13 NAME 'ldapSSLPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{65535} SINGLE-VALUE X-NDS_NAME 'LDAP SSL Port' X-NDS_UPPER_BOUND '65535' )", + "( 2.16.840.1.113719.1.27.4.21 NAME 'filteredReplicaUsage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.22 NAME 'ldapKeyMaterialName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP:keyMaterialName' )", + "( 2.16.840.1.113719.1.27.4.42 NAME 'extensionInfo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.27.4.45 NAME 'nonStdClientSchemaCompatMode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.46 NAME 'sslEnableMutualAuthentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.62 NAME 'ldapEnablePSearch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.63 NAME 'ldapMaximumPSearchOperations' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.64 NAME 'ldapIgnorePSearchLimitsForEvents' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.65 NAME 'ldapTLSTrustedRootContainer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.27.4.66 NAME 'ldapEnableMonitorEvents' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.67 NAME 'ldapMaximumMonitorEventsLoad' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.68 NAME 'ldapTLSRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.69 NAME 'ldapTLSVerifyClientCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.71 NAME 'ldapDerefAlias' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.72 NAME 'ldapNonStdAllUserAttrsMode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.75 NAME 'ldapBindRestrictions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.79 NAME 'ldapInterfaces' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.27.4.80 NAME 'ldapChainSecureRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.82 NAME 'ldapStdCompliance' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.83 NAME 'ldapDerefAliasOnAuth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.84 NAME 'ldapGeneralizedTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.85 NAME 'ldapPermissiveModify' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.15 NAME 'ldapServerList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'LDAP Server List' )", + "( 2.16.840.1.113719.1.27.4.16 NAME 'ldapAttributeMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Attribute Map v11' )", + "( 2.16.840.1.113719.1.27.4.17 NAME 'ldapClassMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Class Map v11' )", + "( 2.16.840.1.113719.1.27.4.18 NAME 'ldapAllowClearTextPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'LDAP Allow Clear Text Password' )", + "( 2.16.840.1.113719.1.27.4.19 NAME 'ldapAnonymousIdentity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'LDAP Anonymous Identity' )", + "( 2.16.840.1.113719.1.27.4.52 NAME 'ldapAttributeList' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} )", + "( 2.16.840.1.113719.1.27.4.53 NAME 'ldapClassList' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} )", + "( 2.16.840.1.113719.1.27.4.56 NAME 'transitionGroupDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.74 NAME 'ldapTransitionBackLink' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.78 NAME 'ldapLBURPNumWriterThreads' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.20 NAME 'ldapServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'LDAP Server' )", + "( 0.9.2342.19200300.100.1.3 NAME 'mail' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NAME 'Internet EMail Address' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113730.3.1.3 NAME 'employeeNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NAME 'NSCP:employeeNumber' )", + "( 2.16.840.1.113719.1.27.4.76 NAME 'referralExcludeFilter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.27.4.77 NAME 'referralIncludeFilter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.5.4.36 NAME 'userCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5{64512} X-NDS_NAME 'userCertificate' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.37 NAME 'cACertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5{64512} X-NDS_NAME 'cACertificate' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.40 NAME 'crossCertificatePair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5{64512} X-NDS_NAME 'crossCertificatePair' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.58 NAME 'attributeCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.2 NAME 'knowledgeInformation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32768' )", + "( 2.5.4.14 NAME 'searchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.25{64512} X-NDS_NAME 'searchGuide' )", + "( 2.5.4.15 NAME 'businessCategory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' )", + "( 2.5.4.21 NAME 'telexNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.52{64512} X-NDS_NAME 'telexNumber' )", + "( 2.5.4.22 NAME 'teletexTerminalIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.51{64512} X-NDS_NAME 'teletexTerminalIdentifier' )", + "( 2.5.4.24 NAME 'x121Address' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{15} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '15' )", + "( 2.5.4.25 NAME 'internationaliSDNNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '16' )", + "( 2.5.4.26 NAME 'registeredAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41{64512} X-NDS_NAME 'registeredAddress' )", + "( 2.5.4.27 NAME 'destinationIndicator' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' )", + "( 2.5.4.28 NAME 'preferredDeliveryMethod' SYNTAX 1.3.6.1.4.1.1466.115.121.1.14{64512} SINGLE-VALUE X-NDS_NAME 'preferredDeliveryMethod' )", + "( 2.5.4.29 NAME 'presentationAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.43{64512} SINGLE-VALUE X-NDS_NAME 'presentationAddress' )", + "( 2.5.4.30 NAME 'supportedApplicationContext' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38{64512} X-NDS_NAME 'supportedApplicationContext' )", + "( 2.5.4.45 NAME 'x500UniqueIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.6{64512} X-NDS_NAME 'x500UniqueIdentifier' )", + "( 2.5.4.46 NAME 'dnQualifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64512} )", + "( 2.5.4.47 NAME 'enhancedSearchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.21{64512} X-NDS_NAME 'enhancedSearchGuide' )", + "( 2.5.4.48 NAME 'protocolInformation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.42{64512} X-NDS_NAME 'protocolInformation' )", + "( 2.5.4.51 NAME 'houseIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32768' )", + "( 2.5.4.52 NAME 'supportedAlgorithms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.49{64512} X-NDS_NAME 'supportedAlgorithms' )", + "( 2.5.4.54 NAME 'dmdName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32768' )", + "( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.38 NAME 'associatedName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.5.4.49 NAME 'dn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.1 NAME 'httpServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.3.4.2 NAME 'httpHostServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.3 NAME 'httpThreadsPerCPU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.4 NAME 'httpIOBufferSize' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.5 NAME 'httpRequestTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.6 NAME 'httpKeepAliveRequestTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.7 NAME 'httpSessionTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.8 NAME 'httpKeyMaterialObject' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.9 NAME 'httpTraceLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.10 NAME 'httpAuthRequiresTLS' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.11 NAME 'httpDefaultClearPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.12 NAME 'httpDefaultTLSPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.13 NAME 'httpBindRestrictions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.295 NAME 'emboxConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.54.4.1.1 NAME 'trusteesOfNewObject' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NAME 'Trustees Of New Object' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.55.4.1.1 NAME 'newObjectSDSRights' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NAME 'New Object's DS Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.56.4.1.1 NAME 'newObjectSFSRights' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'New Object's FS Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.57.4.1.1 NAME 'setupScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Setup Script' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.58.4.1.1 NAME 'runSetupScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Run Setup Script' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.59.4.1.1 NAME 'membersOfTemplate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Members Of Template' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.60.4.1.1 NAME 'volumeSpaceRestrictions' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'Volume Space Restrictions' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.61.4.1.1 NAME 'setPasswordAfterCreate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Set Password After Create' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.62.4.1.1 NAME 'homeDirectoryRights' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_NAME 'Home Directory Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.63.4.1.1 NAME 'newObjectSSelfRights' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NAME 'New Object's Self Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.8.4.1 NAME 'digitalMeID' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.8.4.2 NAME 'assistant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.8.4.3 NAME 'assistantPhone' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.4 NAME 'city' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.5 NAME 'company' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.43 NAME 'co' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.6 NAME 'directReports' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.10 NAME 'manager' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.8.4.7 NAME 'mailstop' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.41 NAME 'mobile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 0.9.2342.19200300.100.1.40 NAME 'personalTitle' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.42 NAME 'pager' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.8 NAME 'workforceID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.9 NAME 'instantMessagingID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.10 NAME 'preferredName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.7 NAME 'photo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.8.4.11 NAME 'jobCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.12 NAME 'siteLocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.13 NAME 'employeeStatus' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113730.3.1.4 NAME 'employeeType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.14 NAME 'costCenter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.15 NAME 'costCenterDescription' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.16 NAME 'tollFreePhoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.17 NAME 'otherPhoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.18 NAME 'managerWorkforceID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.19 NAME 'jackNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113730.3.1.2 NAME 'departmentNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.20 NAME 'vehicleInformation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.21 NAME 'accessCardNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.32 NAME 'isManager' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.8.4.22 NAME 'homeCity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.23 NAME 'homeEmailAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 1.3.6.1.4.1.1466.101.120.31 NAME 'homeFax' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 0.9.2342.19200300.100.1.20 NAME 'homePhone' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.24 NAME 'homeState' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41{64512} )", + "( 2.16.840.1.113719.1.8.4.25 NAME 'homeZipCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.26 NAME 'personalMobile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.27 NAME 'children' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.28 NAME 'spouse' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.29 NAME 'vendorName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.30 NAME 'vendorAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.31 NAME 'vendorPhoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.1.4.1.303 NAME 'dgIdentity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME_VALUE_ACCESS '1' )", + "( 2.16.840.1.113719.1.1.4.1.304 NAME 'dgTimeOut' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.305 NAME 'dgAllowUnknown' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.306 NAME 'dgAllowDuplicates' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.546 NAME 'allowAliasToAncestor' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.39.4.1.1 NAME 'sASSecurityDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Security DN' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.4.1.2 NAME 'sASServiceDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Service DN' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.4.1.3 NAME 'sASSecretStore' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'SAS:SecretStore' )", + "( 2.16.840.1.113719.1.39.4.1.4 NAME 'sASSecretStoreKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'SAS:SecretStore:Key' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.4.1.5 NAME 'sASSecretStoreData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'SAS:SecretStore:Data' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.4.1.6 NAME 'sASPKIStoreKeys' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'SAS:PKIStore:Keys' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.48.4.1.1 NAME 'nDSPKIPublicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Public Key' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.2 NAME 'nDSPKIPrivateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Private Key' )", + "( 2.16.840.1.113719.1.48.4.1.3 NAME 'nDSPKIPublicKeyCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Public Key Certificate' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.4 NAME 'nDSPKICertificateChain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'NDSPKI:Certificate Chain' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.5 NAME 'nDSPKIParentCA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Parent CA' )", + "( 2.16.840.1.113719.1.48.4.1.6 NAME 'nDSPKIParentCADN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'NDSPKI:Parent CA DN' )", + "( 2.16.840.1.113719.1.48.4.1.7 NAME 'nDSPKIKeyFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Key File' )", + "( 2.16.840.1.113719.1.48.4.1.8 NAME 'nDSPKISubjectName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Subject Name' )", + "( 2.16.840.1.113719.1.48.4.1.11 NAME 'nDSPKIGivenName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Given Name' )", + "( 2.16.840.1.113719.1.48.4.1.9 NAME 'nDSPKIKeyMaterialDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'NDSPKI:Key Material DN' )", + "( 2.16.840.1.113719.1.48.4.1.10 NAME 'nDSPKITreeCADN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'NDSPKI:Tree CA DN' )", + "( 2.16.840.1.113719.1.48.4.1.12 NAME 'nDSPKIUserCertificateInfo' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'NDSPKI:userCertificateInfo' )", + "( 2.16.840.1.113719.1.48.4.1.13 NAME 'nDSPKITrustedRootCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Trusted Root Certificate' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.14 NAME 'nDSPKINotBefore' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Not Before' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.15 NAME 'nDSPKINotAfter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Not After' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.101 NAME 'nDSPKISDKeyServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'NDSPKI:SD Key Server DN' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.102 NAME 'nDSPKISDKeyStruct' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'NDSPKI:SD Key Struct' )", + "( 2.16.840.1.113719.1.48.4.1.103 NAME 'nDSPKISDKeyCert' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:SD Key Cert' )", + "( 2.16.840.1.113719.1.48.4.1.104 NAME 'nDSPKISDKeyID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:SD Key ID' )", + "( 2.16.840.1.113719.1.39.4.1.105 NAME 'nDSPKIKeystore' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'NDSPKI:Keystore' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.4.1.106 NAME 'ndspkiAdditionalRoots' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.3 NAME 'masvLabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.4 NAME 'masvProposedLabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.5 NAME 'masvDefaultRange' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.6 NAME 'masvAuthorizedRange' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.7 NAME 'masvDomainPolicy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.8 NAME 'masvClearanceNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.9 NAME 'masvLabelNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.10 NAME 'masvLabelSecrecyLevelNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.11 NAME 'masvLabelSecrecyCategoryNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.12 NAME 'masvLabelIntegrityLevelNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.13 NAME 'masvLabelIntegrityCategoryNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.14 NAME 'masvPolicyUpdate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.31.4.1.16 NAME 'masvNDSAttributeLabels' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.15 NAME 'masvPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.2 NAME 'sASLoginSequence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NAME 'SAS:Login Sequence' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.8 NAME 'sASLoginPolicyUpdate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:Login Policy Update' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.38 NAME 'sasNMASProductOptions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.74 NAME 'sasAuditConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.14 NAME 'sASNDSPasswordWindow' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:NDS Password Window' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.15 NAME 'sASPolicyCredentials' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Policy Credentials' X-NDS_SERVER_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.16 NAME 'sASPolicyMethods' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Methods' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.17 NAME 'sASPolicyObjectVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:Policy Object Version' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.18 NAME 'sASPolicyServiceSubtypes' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Service Subtypes' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.19 NAME 'sASPolicyServices' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Services' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.20 NAME 'sASPolicyUsers' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Users' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.21 NAME 'sASAllowNDSPasswordWindow' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'SAS:Allow NDS Password Window' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.9 NAME 'sASMethodIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Method Identifier' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.10 NAME 'sASMethodVendor' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Method Vendor' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.11 NAME 'sASAdvisoryMethodGrade' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Advisory Method Grade' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.12 NAME 'sASVendorSupport' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Vendor Support' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.13 NAME 'sasCertificateSearchContainers' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.70 NAME 'sasNMASMethodConfigData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.22 NAME 'sASLoginClientMethodNetWare' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Client Method NetWare' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.23 NAME 'sASLoginServerMethodNetWare' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Server Method NetWare' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.24 NAME 'sASLoginClientMethodWINNT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Client Method WINNT' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.25 NAME 'sASLoginServerMethodWINNT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Server Method WINNT' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.26 NAME 'sasLoginClientMethodSolaris' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.27 NAME 'sasLoginServerMethodSolaris' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.28 NAME 'sasLoginClientMethodLinux' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.29 NAME 'sasLoginServerMethodLinux' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.30 NAME 'sasLoginClientMethodTru64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.31 NAME 'sasLoginServerMethodTru64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.32 NAME 'sasLoginClientMethodAIX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.33 NAME 'sasLoginServerMethodAIX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.34 NAME 'sasLoginClientMethodHPUX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.35 NAME 'sasLoginServerMethodHPUX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1000 NAME 'sasLoginClientMethods390' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1001 NAME 'sasLoginServerMethods390' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1002 NAME 'sasLoginClientMethodLinuxX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1003 NAME 'sasLoginServerMethodLinuxX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1004 NAME 'sasLoginClientMethodWinX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1005 NAME 'sasLoginServerMethodWinX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1006 NAME 'sasLoginClientMethodSolaris64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1007 NAME 'sasLoginServerMethodSolaris64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1008 NAME 'sasLoginClientMethodAIX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1009 NAME 'sasLoginServerMethodAIX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1011 NAME 'sasLoginServerMethodSolarisi386' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1012 NAME 'sasLoginClientMethodSolarisi386' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.78 NAME 'sasUnsignedMethodModules' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.79 NAME 'sasServerModuleName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.80 NAME 'sasServerModuleEntryPointName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.81 NAME 'sasSASLMechanismName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.82 NAME 'sasSASLMechanismEntryPointName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.83 NAME 'sasClientModuleName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.84 NAME 'sasClientModuleEntryPointName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.36 NAME 'sASLoginMethodContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Login Method Container DN' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.37 NAME 'sASLoginPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Login Policy DN' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.63 NAME 'sasPostLoginMethodContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.38 NAME 'rADIUSActiveConnections' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Active Connections' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.39 NAME 'rADIUSAgedInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Aged Interval' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.40 NAME 'rADIUSAttributeList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Attribute List' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.41 NAME 'rADIUSAttributeLists' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Attribute Lists' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.42 NAME 'rADIUSClient' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Client' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.43 NAME 'rADIUSCommonNameResolution' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Common Name Resolution' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.44 NAME 'rADIUSConcurrentLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Concurrent Limit' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.45 NAME 'rADIUSConnectionHistory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Connection History' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.46 NAME 'rADIUSDASVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:DAS Version' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.47 NAME 'rADIUSDefaultProfile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Default Profile' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.48 NAME 'rADIUSDialAccessGroup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'RADIUS:Dial Access Group' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.49 NAME 'rADIUSEnableCommonNameLogin' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'RADIUS:Enable Common Name Login' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.50 NAME 'rADIUSEnableDialAccess' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'RADIUS:Enable Dial Access' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.51 NAME 'rADIUSInterimAcctingTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Interim Accting Timeout' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.52 NAME 'rADIUSLookupContexts' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'RADIUS:Lookup Contexts' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.53 NAME 'rADIUSMaxDASHistoryRecord' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Max DAS History Record' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.54 NAME 'rADIUSMaximumHistoryRecord' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Maximum History Record' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.55 NAME 'rADIUSPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Password' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.56 NAME 'rADIUSPasswordPolicy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Password Policy' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.57 NAME 'rADIUSPrivateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Private Key' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.58 NAME 'rADIUSProxyContext' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'RADIUS:Proxy Context' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.59 NAME 'rADIUSProxyDomain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Proxy Domain' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.60 NAME 'rADIUSProxyTarget' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Proxy Target' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.61 NAME 'rADIUSPublicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Public Key' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.62 NAME 'rADIUSServiceList' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'RADIUS:Service List' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.3 NAME 'sASLoginSecret' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Secret' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.4 NAME 'sASLoginSecretKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Secret Key' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.5 NAME 'sASEncryptionType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:Encryption Type' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.6 NAME 'sASLoginConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Configuration' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.7 NAME 'sASLoginConfigurationKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Configuration Key' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.73 NAME 'sasDefaultLoginSequence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.64 NAME 'sasAuthorizedLoginSequences' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.69 NAME 'sasAllowableSubjectNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.71 NAME 'sasLoginFailureDelay' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.72 NAME 'sasMethodVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1010 NAME 'sasUpdateLoginInfo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1011 NAME 'sasOTPEnabled' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1012 NAME 'sasOTPCounter' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1013 NAME 'sasOTPLookAheadWindow' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1014 NAME 'sasOTPDigits' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1015 NAME 'sasOTPReSync' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1016 NAME 'sasUpdateLoginTimeInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.6.4.1 NAME 'snmpGroupDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.2 NAME 'snmpServerList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.6.4.3 NAME 'snmpTrapConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.4 NAME 'snmpTrapDescription' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.5 NAME 'snmpTrapInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.6 NAME 'snmpTrapDisable' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.528 NAME 'ndapPartitionPasswordMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.529 NAME 'ndapClassPasswordMgmt' SYNTAX 2.16.840.1.113719.1.1.5.1.0 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.530 NAME 'ndapPasswordMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.537 NAME 'ndapPartitionLoginMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.538 NAME 'ndapClassLoginMgmt' SYNTAX 2.16.840.1.113719.1.1.5.1.0 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.539 NAME 'ndapLoginMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.1 NAME 'nspmPasswordKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.2 NAME 'nspmPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.3 NAME 'nspmDistributionPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.4 NAME 'nspmPasswordHistory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.5 NAME 'nspmAdministratorChangeCount' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.6 NAME 'nspmPasswordPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.7 NAME 'nspmPreviousDistributionPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.8 NAME 'nspmDoNotExpirePassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.42.2.27.8.1.16 NAME 'pwdChangedTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.17 NAME 'pwdAccountLockedTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.19 NAME 'pwdFailureTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.39.43.4.100 NAME 'nspmConfigurationOptions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.102 NAME 'nspmChangePasswordMessage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.103 NAME 'nspmPasswordHistoryLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.104 NAME 'nspmPasswordHistoryExpiration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 1.3.6.1.4.1.42.2.27.8.1.4 NAME 'pwdInHistory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.105 NAME 'nspmMinPasswordLifetime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.106 NAME 'nspmAdminsDoNotExpirePassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.107 NAME 'nspmPasswordACL' SYNTAX 2.16.840.1.113719.1.1.5.1.17 )", + "( 2.16.840.1.113719.1.39.43.4.200 NAME 'nspmMaximumLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.201 NAME 'nspmMinUpperCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.202 NAME 'nspmMaxUpperCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.203 NAME 'nspmMinLowerCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.204 NAME 'nspmMaxLowerCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.205 NAME 'nspmNumericCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.206 NAME 'nspmNumericAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.207 NAME 'nspmNumericAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.208 NAME 'nspmMinNumericCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.209 NAME 'nspmMaxNumericCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.210 NAME 'nspmSpecialCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.211 NAME 'nspmSpecialAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.212 NAME 'nspmSpecialAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.213 NAME 'nspmMinSpecialCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.214 NAME 'nspmMaxSpecialCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.215 NAME 'nspmMaxRepeatedCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.216 NAME 'nspmMaxConsecutiveCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.217 NAME 'nspmMinUniqueCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.218 NAME 'nspmDisallowedAttributeValues' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.219 NAME 'nspmExcludeList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.220 NAME 'nspmCaseSensitive' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.221 NAME 'nspmPolicyPrecedence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.222 NAME 'nspmExtendedCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.223 NAME 'nspmExtendedAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.224 NAME 'nspmExtendedAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.225 NAME 'nspmMinExtendedCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.226 NAME 'nspmMaxExtendedCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.227 NAME 'nspmUpperAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.228 NAME 'nspmUpperAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.229 NAME 'nspmLowerAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.230 NAME 'nspmLowerAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.231 NAME 'nspmComplexityRules' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.233 NAME 'nspmAD2K8Syntax' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.234 NAME 'nspmAD2K8maxViolation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.235 NAME 'nspmXCharLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.236 NAME 'nspmXCharHistoryLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.237 NAME 'nspmUnicodeAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.238 NAME 'nspmNonAlphaCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.239 NAME 'nspmMinNonAlphaCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.240 NAME 'nspmMaxNonAlphaCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.241 NAME 'nspmGraceLoginHistoryLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.300 NAME 'nspmPolicyAgentContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.301 NAME 'nspmPolicyAgentNetWare' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.302 NAME 'nspmPolicyAgentWINNT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.303 NAME 'nspmPolicyAgentSolaris' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.304 NAME 'nspmPolicyAgentLinux' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.305 NAME 'nspmPolicyAgentAIX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.306 NAME 'nspmPolicyAgentHPUX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 0.9.2342.19200300.100.1.55 NAME 'audio' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113730.3.1.1 NAME 'carLicense' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113730.3.1.241 NAME 'displayName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.60 NAME 'jpegPhoto' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 1.3.6.1.4.1.250.1.57 NAME 'labeledUri' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.7 NAME 'ldapPhoto' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113730.3.1.39 NAME 'preferredLanguage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.21 NAME 'secretary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113730.3.1.40 NAME 'userSMIMECertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.12.4.1.0 NAME 'auditAEncryptionKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:A Encryption Key' )", + "( 2.16.840.1.113719.1.12.4.2.0 NAME 'auditBEncryptionKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:B Encryption Key' )", + "( 2.16.840.1.113719.1.12.4.3.0 NAME 'auditContents' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Audit:Contents' )", + "( 2.16.840.1.113719.1.12.4.4.0 NAME 'auditType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Audit:Type' )", + "( 2.16.840.1.113719.1.12.4.5.0 NAME 'auditCurrentEncryptionKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:Current Encryption Key' )", + "( 2.16.840.1.113719.1.12.4.6.0 NAME 'auditFileLink' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Audit:File Link' )", + "( 2.16.840.1.113719.1.12.4.7.0 NAME 'auditLinkList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Audit:Link List' )", + "( 2.16.840.1.113719.1.12.4.8.0 NAME 'auditPath' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NAME 'Audit:Path' )", + "( 2.16.840.1.113719.1.12.4.9.0 NAME 'auditPolicy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:Policy' )", + "( 2.16.840.1.113719.1.38.4.1.1 NAME 'wANMANWANPolicy' SYNTAX 2.16.840.1.113719.1.1.5.1.13{64512} X-NDS_NAME 'WANMAN:WAN Policy' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.38.4.1.2 NAME 'wANMANLANAreaMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'WANMAN:LAN Area Membership' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.38.4.1.3 NAME 'wANMANCost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'WANMAN:Cost' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.38.4.1.4 NAME 'wANMANDefaultCost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'WANMAN:Default Cost' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.135.4.30 NAME 'rbsAssignedRoles' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.31 NAME 'rbsContent' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.32 NAME 'rbsContentMembership' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.33 NAME 'rbsEntryPoint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.34 NAME 'rbsMember' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.35 NAME 'rbsOwnedCollections' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.135.4.36 NAME 'rbsPath' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.37 NAME 'rbsParameters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} )", + "( 2.16.840.1.113719.1.135.4.38 NAME 'rbsTaskRights' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.135.4.39 NAME 'rbsTrusteeOf' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.40 NAME 'rbsType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} SINGLE-VALUE X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '256' )", + "( 2.16.840.1.113719.1.135.4.41 NAME 'rbsURL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.42 NAME 'rbsTaskTemplates' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.135.4.43 NAME 'rbsTaskTemplatesURL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.44 NAME 'rbsGALabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.45 NAME 'rbsPageMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} )", + "( 2.16.840.1.113719.1.135.4.46 NAME 'rbsTargetObjectType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.135.4.47 NAME 'rbsContext' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.48 NAME 'rbsXMLInfo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.51 NAME 'rbsAssignedRoles2' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.52 NAME 'rbsOwnedCollections2' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.1.4.1.540 NAME 'prSyncPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.1.4.1.541 NAME 'prSyncAttributes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.1.4.1.542 NAME 'dsEncryptedReplicationConfig' SYNTAX 2.16.840.1.113719.1.1.5.1.19 )", + "( 2.16.840.1.113719.1.1.4.1.543 NAME 'encryptionPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.544 NAME 'attrEncryptionRequiresSecure' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.545 NAME 'attrEncryptionDefinition' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.48.4.1.16 NAME 'ndspkiCRLFileName' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.17 NAME 'ndspkiStatus' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.18 NAME 'ndspkiIssueTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.19 NAME 'ndspkiNextIssueTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.20 NAME 'ndspkiAttemptTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.21 NAME 'ndspkiTimeInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.22 NAME 'ndspkiCRLMaxProcessingInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.23 NAME 'ndspkiCRLNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.24 NAME 'ndspkiDistributionPoints' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.25 NAME 'ndspkiCRLProcessData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.26 NAME 'ndspkiCRLConfigurationDNList' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.27 NAME 'ndspkiCADN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.28 NAME 'ndspkiCRLContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.29 NAME 'ndspkiIssuedCertContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.30 NAME 'ndspkiDistributionPointDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.31 NAME 'ndspkiCRLConfigurationDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.32 NAME 'ndspkiDirectory' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} )", + "( 2.5.4.38 NAME 'authorityRevocationList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'ndspkiAuthorityRevocationList' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.39 NAME 'certificateRevocationList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'ndspkiCertificateRevocationList' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.53 NAME 'deltaRevocationList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'ndspkiDeltaRevocationList' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.36 NAME 'ndspkiTrustedRootList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.37 NAME 'ndspkiSecurityRightsLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.48.4.1.38 NAME 'ndspkiKMOExport' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.7.4.1 NAME 'notfSMTPEmailHost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.2 NAME 'notfSMTPEmailFrom' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.3 NAME 'notfSMTPEmailUserName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.5 NAME 'notfMergeTemplateData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.6 NAME 'notfMergeTemplateSubject' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.1 NAME 'nsimRequiredQuestions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.2 NAME 'nsimRandomQuestions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.3 NAME 'nsimNumberRandomQuestions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.4 NAME 'nsimMinResponseLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.5 NAME 'nsimMaxResponseLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.6 NAME 'nsimForgottenLoginConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.7 NAME 'nsimForgottenAction' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.8 NAME 'nsimAssignments' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.9 NAME 'nsimChallengeSetDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.10 NAME 'nsimChallengeSetGUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.11 NAME 'nsimPwdRuleEnforcement' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.12 NAME 'nsimHint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.44.4.13 NAME 'nsimPasswordReminder' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.4 NAME 'sssProxyStoreKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.266.4.5 NAME 'sssProxyStoreSecrets' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.266.4.6 NAME 'sssActiveServerList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.266.4.7 NAME 'sssCacheRefreshInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.8 NAME 'sssAdminList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.266.4.9 NAME 'sssAdminGALabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.10 NAME 'sssEnableReadTimestamps' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.11 NAME 'sssDisableMasterPasswords' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.12 NAME 'sssEnableAdminAccess' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.13 NAME 'sssReadSecretPolicies' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.266.4.14 NAME 'sssServerPolicyOverrideDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.531 NAME 'eDirCloneSource' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.532 NAME 'eDirCloneKeys' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.1.4.1.533 NAME 'eDirCloneLock' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.711 NAME 'groupMember' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.1.4.712 NAME 'nestedConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.717 NAME 'xdasDSConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.1.4.718 NAME 'xdasConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.1.4.719 NAME 'xdasVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_UPPER_BOUND '32768' )", + "( 2.16.840.1.113719.1.347.4.79 NAME 'NAuditInstrumentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.347.4.2 NAME 'NAuditLoggingServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.135.4.53 NAME 'rbsRoleMember' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.135.4.54 NAME 'rbsCategoryMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )" + ], + "ldapSyntaxes": [ + "( 1.3.6.1.4.1.1466.115.121.1.1 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.2 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.3 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.4 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.5 X-NDS_SYNTAX '21' )", + "( 1.3.6.1.4.1.1466.115.121.1.6 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.7 X-NDS_SYNTAX '7' )", + "( 2.16.840.1.113719.1.1.5.1.6 X-NDS_SYNTAX '6' )", + "( 1.3.6.1.4.1.1466.115.121.1.8 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.9 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.10 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.22 X-NDS_SYNTAX '22' )", + "( 1.3.6.1.4.1.1466.115.121.1.11 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_SYNTAX '1' )", + "( 1.3.6.1.4.1.1466.115.121.1.13 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.14 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.15 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.16 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.17 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.18 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.19 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.20 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.21 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.22 X-NDS_SYNTAX '11' )", + "( 1.3.6.1.4.1.1466.115.121.1.23 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.24 X-NDS_SYNTAX '24' )", + "( 1.3.6.1.4.1.1466.115.121.1.25 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.26 X-NDS_SYNTAX '2' )", + "( 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_SYNTAX '8' )", + "( 1.3.6.1.4.1.1466.115.121.1.28 X-NDS_SYNTAX '9' )", + "( 1.2.840.113556.1.4.906 X-NDS_SYNTAX '29' )", + "( 1.3.6.1.4.1.1466.115.121.1.54 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.56 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.57 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.29 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.30 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.31 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.32 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.33 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.55 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.34 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.35 X-NDS_SYNTAX '3' )", + "( 2.16.840.1.113719.1.1.5.1.19 X-NDS_SYNTAX '19' )", + "( 1.3.6.1.4.1.1466.115.121.1.36 X-NDS_SYNTAX '5' )", + "( 2.16.840.1.113719.1.1.5.1.17 X-NDS_SYNTAX '17' )", + "( 1.3.6.1.4.1.1466.115.121.1.37 X-NDS_SYNTAX '3' )", + "( 2.16.840.1.113719.1.1.5.1.13 X-NDS_SYNTAX '13' )", + "( 1.3.6.1.4.1.1466.115.121.1.40 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.38 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.39 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.41 X-NDS_SYNTAX '18' )", + "( 1.3.6.1.4.1.1466.115.121.1.43 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.44 X-NDS_SYNTAX '4' )", + "( 1.3.6.1.4.1.1466.115.121.1.42 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.16 X-NDS_SYNTAX '16' )", + "( 1.3.6.1.4.1.1466.115.121.1.58 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.45 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.46 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.47 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.48 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.49 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.12 X-NDS_SYNTAX '12' )", + "( 2.16.840.1.113719.1.1.5.1.23 X-NDS_SYNTAX '23' )", + "( 2.16.840.1.113719.1.1.5.1.15 X-NDS_SYNTAX '15' )", + "( 2.16.840.1.113719.1.1.5.1.14 X-NDS_SYNTAX '14' )", + "( 1.3.6.1.4.1.1466.115.121.1.50 X-NDS_SYNTAX '10' )", + "( 1.3.6.1.4.1.1466.115.121.1.51 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.52 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.25 X-NDS_SYNTAX '25' )", + "( 1.3.6.1.4.1.1466.115.121.1.53 X-NDS_SYNTAX '9' )" + ], + "modifyTimestamp": [ + "20141014222353Z" + ], + "objectClass": [ + "top", + "subschema" + ], + "objectClasses": [ + "( 2.5.6.0 NAME 'Top' STRUCTURAL MUST objectClass MAY ( cAPublicKey $ cAPrivateKey $ certificateValidityInterval $ authorityRevocation $ lastReferencedTime $ equivalentToMe $ ACL $ backLink $ binderyProperty $ Obituary $ Reference $ revision $ ndsCrossCertificatePair $ certificateRevocation $ usedBy $ GUID $ otherGUID $ DirXML-Associations $ creatorsName $ modifiersName $ objectVersion $ auxClassCompatibility $ unknownBaseClass $ unknownAuxiliaryClass $ masvProposedLabel $ masvDefaultRange $ masvAuthorizedRange $ auditFileLink $ rbsAssignedRoles $ rbsOwnedCollections $ rbsAssignedRoles2 $ rbsOwnedCollections2 ) X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '16#subtree#[Creator]#[Entry Rights]' )", + "( 1.3.6.1.4.1.42.2.27.1.2.1 NAME 'aliasObject' SUP Top STRUCTURAL MUST aliasedObjectName X-NDS_NAME 'Alias' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.2 NAME 'Country' SUP Top STRUCTURAL MUST c MAY ( description $ searchGuide $ sssActiveServerList $ sssServerPolicyOverrideDN ) X-NDS_NAMING 'c' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'domain' ) X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.3 NAME 'Locality' SUP Top STRUCTURAL MAY ( description $ l $ seeAlso $ st $ street $ searchGuide $ sssActiveServerList $ sssServerPolicyOverrideDN ) X-NDS_NAMING ( 'l' 'st' ) X-NDS_CONTAINMENT ( 'Country' 'organizationalUnit' 'Locality' 'Organization' 'domain' ) X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.4 NAME 'Organization' SUP ( ndsLoginProperties $ ndsContainerLoginProperties ) STRUCTURAL MUST o MAY ( description $ facsimileTelephoneNumber $ l $ loginScript $ eMailAddress $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ printJobConfiguration $ printerControl $ seeAlso $ st $ street $ telephoneNumber $ loginIntruderLimit $ intruderAttemptResetInterval $ detectIntruder $ lockoutAfterDetection $ intruderLockoutResetInterval $ nNSDomain $ mailboxLocation $ mailboxID $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationaliSDNNumber $ businessCategory $ searchGuide $ rADIUSAttributeLists $ rADIUSDefaultProfile $ rADIUSDialAccessGroup $ rADIUSEnableDialAccess $ rADIUSServiceList $ sssActiveServerList $ sssServerPolicyOverrideDN $ userPassword ) X-NDS_NAMING 'o' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'Country' 'Locality' 'domain' ) X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Self]#loginScript' '2#entry#[Self]#printJobConfiguration') )", + "( 2.5.6.5 NAME 'organizationalUnit' SUP ( ndsLoginProperties $ ndsContainerLoginProperties ) STRUCTURAL MUST ou MAY ( description $ facsimileTelephoneNumber $ l $ loginScript $ eMailAddress $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ printJobConfiguration $ printerControl $ seeAlso $ st $ street $ telephoneNumber $ loginIntruderLimit $ intruderAttemptResetInterval $ detectIntruder $ lockoutAfterDetection $ intruderLockoutResetInterval $ nNSDomain $ mailboxLocation $ mailboxID $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationaliSDNNumber $ businessCategory $ searchGuide $ rADIUSAttributeLists $ rADIUSDefaultProfile $ rADIUSDialAccessGroup $ rADIUSEnableDialAccess $ rADIUSServiceList $ sssActiveServerList $ sssServerPolicyOverrideDN $ userPassword ) X-NDS_NAMING 'ou' X-NDS_CONTAINMENT ( 'Locality' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Organizational Unit' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Self]#loginScript' '2#entry#[Self]#printJobConfiguration') )", + "( 2.5.6.8 NAME 'organizationalRole' SUP Top STRUCTURAL MUST cn MAY ( description $ facsimileTelephoneNumber $ l $ eMailAddress $ ou $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ roleOccupant $ seeAlso $ st $ street $ telephoneNumber $ mailboxLocation $ mailboxID $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationaliSDNNumber ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Organizational Role' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.9 NAME ( 'groupOfNames' 'group' 'groupOfUniqueNames' ) SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ ou $ o $ owner $ seeAlso $ groupID $ fullName $ eMailAddress $ mailboxLocation $ mailboxID $ Profile $ profileMembership $ loginScript $ businessCategory $ nspmPasswordPolicyDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Group' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.6 NAME 'Person' SUP ndsLoginProperties STRUCTURAL MUST ( cn $ sn ) MAY ( description $ seeAlso $ telephoneNumber $ fullName $ givenName $ initials $ generationQualifier $ uid $ assistant $ assistantPhone $ city $ st $ company $ co $ directReports $ manager $ mailstop $ mobile $ personalTitle $ pager $ workforceID $ instantMessagingID $ preferredName $ photo $ jobCode $ siteLocation $ employeeStatus $ employeeType $ costCenter $ costCenterDescription $ tollFreePhoneNumber $ otherPhoneNumber $ managerWorkforceID $ roomNumber $ jackNumber $ departmentNumber $ vehicleInformation $ accessCardNumber $ isManager $ userPassword ) X-NDS_NAMING ( 'cn' 'uid' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.7 NAME 'organizationalPerson' SUP Person STRUCTURAL MAY ( facsimileTelephoneNumber $ l $ eMailAddress $ ou $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ st $ street $ title $ mailboxLocation $ mailboxID $ uid $ mail $ employeeNumber $ destinationIndicator $ internationaliSDNNumber $ preferredDeliveryMethod $ registeredAddress $ teletexTerminalIdentifier $ telexNumber $ x121Address $ businessCategory $ roomNumber $ x500UniqueIdentifier ) X-NDS_NAMING ( 'cn' 'ou' 'uid' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Organizational Person' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' SUP organizationalPerson STRUCTURAL MAY ( groupMembership $ ndsHomeDirectory $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginGraceLimit $ loginGraceRemaining $ loginIntruderAddress $ loginIntruderAttempts $ loginIntruderResetTime $ loginMaximumSimultaneous $ loginScript $ loginTime $ networkAddressRestriction $ networkAddress $ passwordsUsed $ passwordAllowChange $ passwordExpirationInterval $ passwordExpirationTime $ passwordMinimumLength $ passwordRequired $ passwordUniqueRequired $ printJobConfiguration $ privateKey $ Profile $ publicKey $ securityEquals $ accountBalance $ allowUnlimitedCredit $ minimumAccountBalance $ messageServer $ Language $ ndsUID $ lockedByIntruder $ serverHolds $ lastLoginTime $ typeCreatorMap $ higherPrivileges $ printerControl $ securityFlags $ profileMembership $ Timezone $ sASServiceDN $ sASSecretStore $ sASSecretStoreKey $ sASSecretStoreData $ sASPKIStoreKeys $ userCertificate $ nDSPKIUserCertificateInfo $ nDSPKIKeystore $ rADIUSActiveConnections $ rADIUSAttributeLists $ rADIUSConcurrentLimit $ rADIUSConnectionHistory $ rADIUSDefaultProfile $ rADIUSDialAccessGroup $ rADIUSEnableDialAccess $ rADIUSPassword $ rADIUSServiceList $ audio $ businessCategory $ carLicense $ departmentNumber $ employeeNumber $ employeeType $ displayName $ givenName $ homePhone $ homePostalAddress $ initials $ jpegPhoto $ labeledUri $ mail $ manager $ mobile $ o $ pager $ ldapPhoto $ preferredLanguage $ roomNumber $ secretary $ uid $ userSMIMECertificate $ x500UniqueIdentifier $ userPKCS12 $ sssProxyStoreKey $ sssProxyStoreSecrets $ sssServerPolicyOverrideDN ) X-NDS_NAME 'User' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#subtree#[Self]#[All Attributes Rights]' '6#entry#[Self]#loginScript' '1#subtree#[Root Template]#[Entry Rights]' '2#entry#[Public]#messageServer' '2#entry#[Root Template]#groupMembership' '6#entry#[Self]#printJobConfiguration' '2#entry#[Root Template]#networkAddress') )", + "( 2.5.6.14 NAME 'Device' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ networkAddress $ ou $ o $ owner $ seeAlso $ serialNumber ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.4 NAME 'Computer' SUP Device STRUCTURAL MAY ( operator $ server $ status ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.17 NAME 'Printer' SUP Device STRUCTURAL MAY ( Cartridge $ printerConfiguration $ defaultQueue $ hostDevice $ printServer $ Memory $ networkAddressRestriction $ notify $ operator $ pageDescriptionLanguage $ queue $ status $ supportedTypefaces ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.21 NAME 'Resource' SUP Top ABSTRACT MUST cn MAY ( description $ hostResourceName $ l $ ou $ o $ seeAlso $ Uses ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.20 NAME 'Queue' SUP Resource STRUCTURAL MUST queueDirectory MAY ( Device $ operator $ server $ User $ networkAddress $ Volume $ hostServer ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#subtree#[Root Template]#[All Attributes Rights]' )", + "( 2.16.840.1.113719.1.1.6.1.3 NAME 'binderyQueue' SUP Queue STRUCTURAL MUST binderyType X-NDS_NAMING ( 'cn' 'binderyType' ) X-NDS_NAME 'Bindery Queue' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#subtree#[Root Template]#[All Attributes Rights]' )", + "( 2.16.840.1.113719.1.1.6.1.26 NAME 'Volume' SUP Resource STRUCTURAL MUST hostServer MAY status X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Root Template]#hostResourceName' '2#entry#[Root Template]#hostServer') )", + "( 2.16.840.1.113719.1.1.6.1.7 NAME 'directoryMap' SUP Resource STRUCTURAL MUST hostServer MAY path X-NDS_NAME 'Directory Map' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.19 NAME 'Profile' SUP Top STRUCTURAL MUST ( cn $ loginScript ) MAY ( description $ l $ ou $ o $ seeAlso $ fullName ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.22 NAME 'Server' SUP Top ABSTRACT MUST cn MAY ( description $ hostDevice $ l $ ou $ o $ privateKey $ publicKey $ Resource $ seeAlso $ status $ User $ Version $ networkAddress $ accountBalance $ allowUnlimitedCredit $ minimumAccountBalance $ fullName $ securityEquals $ securityFlags $ Timezone $ ndapClassPasswordMgmt $ ndapClassLoginMgmt ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Public]#networkAddress' '16#subtree#[Self]#[Entry Rights]') )", + "( 2.16.840.1.113719.1.1.6.1.10 NAME 'ncpServer' SUP Server STRUCTURAL MAY ( operator $ supportedServices $ messagingServer $ dsRevision $ permanentConfigParms $ ndsPredicateStatsDN $ languageId $ indexDefinition $ CachedAttrsOnExtRefs $ NCPKeyMaterialName $ ldapServerDN $ httpServerDN $ emboxConfig $ sASServiceDN $ cACertificate $ nDSPKIPublicKey $ nDSPKIPrivateKey $ nDSPKICertificateChain $ nDSPKIParentCADN $ nDSPKISDKeyID $ nDSPKISDKeyStruct $ snmpGroupDN $ wANMANWANPolicy $ wANMANLANAreaMembership $ wANMANCost $ wANMANDefaultCost $ encryptionPolicyDN $ eDirCloneSource $ eDirCloneLock $ xdasDSConfiguration $ xdasConfiguration $ xdasVersion $ NAuditLoggingServer $ NAuditInstrumentation ) X-NDS_NAME 'NCP Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Public]#messagingServer' )", + "( 2.16.840.1.113719.1.1.6.1.18 NAME 'printServer' SUP Server STRUCTURAL MAY ( operator $ printer $ sAPName ) X-NDS_NAME 'Print Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#subtree#[Root Template]#[All Attributes Rights]' )", + "( 2.16.840.1.113719.1.1.6.1.31 NAME 'CommExec' SUP Server STRUCTURAL MAY networkAddressRestriction X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.2 NAME 'binderyObject' SUP Top STRUCTURAL MUST ( binderyObjectRestriction $ binderyType $ cn ) X-NDS_NAMING ( 'cn' 'binderyType' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Bindery Object' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.15 NAME 'Partition' AUXILIARY MAY ( Convergence $ partitionCreationTime $ Replica $ inheritedACL $ lowConvergenceSyncInterval $ receivedUpTo $ synchronizedUpTo $ authorityRevocation $ certificateRevocation $ cAPrivateKey $ cAPublicKey $ ndsCrossCertificatePair $ lowConvergenceResetTime $ highConvergenceSyncInterval $ partitionControl $ replicaUpTo $ partitionStatus $ transitiveVector $ purgeVector $ synchronizationTolerance $ obituaryNotify $ localReceivedUpTo $ federationControl $ syncPanePoint $ syncWindowVector $ authoritative $ allowAliasToAncestor $ sASSecurityDN $ masvLabel $ ndapPartitionPasswordMgmt $ ndapPartitionLoginMgmt $ prSyncPolicyDN $ dsEncryptedReplicationConfig ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.0 NAME 'aFPServer' SUP Server STRUCTURAL MAY ( serialNumber $ supportedConnections ) X-NDS_NAME 'AFP Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.27 NAME 'messagingServer' SUP Server STRUCTURAL MAY ( messagingDatabaseLocation $ messageRoutingGroup $ Postmaster $ supportedServices $ messagingServerType $ supportedGateway ) X-NDS_NAME 'Messaging Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '1#subtree#[Self]#[Entry Rights]' '2#subtree#[Self]#[All Attributes Rights]' '6#entry#[Self]#status' '2#entry#[Public]#messagingServerType' '2#entry#[Public]#messagingDatabaseLocation') )", + "( 2.16.840.1.113719.1.1.6.1.28 NAME 'messageRoutingGroup' SUP groupOfNames STRUCTURAL X-NDS_NAME 'Message Routing Group' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '1#subtree#[Self]#[Entry Rights]' '2#subtree#[Self]#[All Attributes Rights]') )", + "( 2.16.840.1.113719.1.1.6.1.29 NAME 'externalEntity' SUP Top STRUCTURAL MUST cn MAY ( description $ seeAlso $ facsimileTelephoneNumber $ l $ eMailAddress $ ou $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ st $ street $ title $ externalName $ mailboxLocation $ mailboxID ) X-NDS_NAMING ( 'cn' 'ou' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'External Entity' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Public]#externalName' )", + "( 2.16.840.1.113719.1.1.6.1.30 NAME 'List' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ ou $ o $ eMailAddress $ mailboxLocation $ mailboxID $ owner $ seeAlso $ fullName ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Root Template]#member' )", + "( 2.16.840.1.113719.1.1.6.1.32 NAME 'treeRoot' SUP Top STRUCTURAL MUST T MAY sssActiveServerList X-NDS_NAMING 'T' X-NDS_NAME 'Tree Root' X-NDS_NONREMOVABLE '1' )", + "( 0.9.2342.19200300.100.4.13 NAME 'domain' SUP ( Top $ ndsLoginProperties $ ndsContainerLoginProperties ) STRUCTURAL MUST dc MAY ( searchGuide $ o $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ l $ associatedName $ description $ sssActiveServerList $ sssServerPolicyOverrideDN $ userPassword ) X-NDS_NAMING 'dc' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'Country' 'Locality' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NONREMOVABLE '1' )", + "( 1.3.6.1.4.1.1466.344 NAME 'dcObject' AUXILIARY MUST dc X-NDS_NAMING 'dc' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.33 NAME 'ndsLoginProperties' SUP Top ABSTRACT MAY ( groupMembership $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginGraceLimit $ loginGraceRemaining $ loginIntruderAddress $ loginIntruderAttempts $ loginIntruderResetTime $ loginMaximumSimultaneous $ loginScript $ loginTime $ networkAddressRestriction $ networkAddress $ passwordsUsed $ passwordAllowChange $ passwordExpirationInterval $ passwordExpirationTime $ passwordMinimumLength $ passwordRequired $ passwordUniqueRequired $ privateKey $ Profile $ publicKey $ securityEquals $ accountBalance $ allowUnlimitedCredit $ minimumAccountBalance $ Language $ lockedByIntruder $ serverHolds $ lastLoginTime $ higherPrivileges $ securityFlags $ profileMembership $ Timezone $ loginActivationTime $ UTF8LoginScript $ loginScriptCharset $ sASNDSPasswordWindow $ sASLoginSecret $ sASLoginSecretKey $ sASEncryptionType $ sASLoginConfiguration $ sASLoginConfigurationKey $ sasLoginFailureDelay $ sasDefaultLoginSequence $ sasAuthorizedLoginSequences $ sasAllowableSubjectNames $ sasUpdateLoginInfo $ sasOTPEnabled $ sasOTPCounter $ sasOTPDigits $ sasOTPReSync $ sasUpdateLoginTimeInterval $ ndapPasswordMgmt $ ndapLoginMgmt $ nspmPasswordKey $ nspmPassword $ pwdChangedTime $ pwdAccountLockedTime $ pwdFailureTime $ nspmDoNotExpirePassword $ nspmDistributionPassword $ nspmPreviousDistributionPassword $ nspmPasswordHistory $ nspmAdministratorChangeCount $ nspmPasswordPolicyDN $ nsimHint $ nsimPasswordReminder $ userPassword ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.141.6.1 NAME 'federationBoundary' AUXILIARY MUST federationBoundaryType MAY ( federationControl $ federationDNSName $ federationSearchPath ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.34 NAME 'ndsContainerLoginProperties' SUP Top ABSTRACT MAY ( loginIntruderLimit $ intruderAttemptResetInterval $ detectIntruder $ lockoutAfterDetection $ intruderLockoutResetInterval $ sasLoginFailureDelay $ sasDefaultLoginSequence $ sasAuthorizedLoginSequences $ sasUpdateLoginInfo $ sasOTPEnabled $ sasOTPDigits $ sasUpdateLoginTimeInterval $ ndapPasswordMgmt $ ndapLoginMgmt $ nspmPasswordPolicyDN ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.6.3 NAME 'ndsPredicateStats' SUP Top STRUCTURAL MUST ( cn $ ndsPredicateState $ ndsPredicateFlush ) MAY ( ndsPredicate $ ndsPredicateTimeout $ ndsPredicateUseValues ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.400.1 NAME 'edirSchemaVersion' SUP Top ABSTRACT MAY edirSchemaFlagVersion X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.47 NAME 'immediateSuperiorReference' AUXILIARY MAY ref X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.27.6.1 NAME 'ldapServer' SUP Top STRUCTURAL MUST cn MAY ( ldapHostServer $ ldapGroupDN $ ldapTraceLevel $ ldapServerBindLimit $ ldapServerIdleTimeout $ lDAPUDPPort $ lDAPSearchSizeLimit $ lDAPSearchTimeLimit $ lDAPLogLevel $ lDAPLogFilename $ lDAPBackupLogFilename $ lDAPLogSizeLimit $ Version $ searchSizeLimit $ searchTimeLimit $ ldapEnableTCP $ ldapTCPPort $ ldapEnableSSL $ ldapSSLPort $ ldapKeyMaterialName $ filteredReplicaUsage $ extensionInfo $ nonStdClientSchemaCompatMode $ sslEnableMutualAuthentication $ ldapEnablePSearch $ ldapMaximumPSearchOperations $ ldapIgnorePSearchLimitsForEvents $ ldapTLSTrustedRootContainer $ ldapEnableMonitorEvents $ ldapMaximumMonitorEventsLoad $ ldapTLSRequired $ ldapTLSVerifyClientCertificate $ ldapConfigVersion $ ldapDerefAlias $ ldapNonStdAllUserAttrsMode $ ldapBindRestrictions $ ldapDefaultReferralBehavior $ ldapReferral $ ldapSearchReferralUsage $ lDAPOtherReferralUsage $ ldapLBURPNumWriterThreads $ ldapInterfaces $ ldapChainSecureRequired $ ldapStdCompliance $ ldapDerefAliasOnAuth $ ldapGeneralizedTime $ ldapPermissiveModify ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) X-NDS_NAME 'LDAP Server' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.27.6.2 NAME 'ldapGroup' SUP Top STRUCTURAL MUST cn MAY ( ldapReferral $ ldapServerList $ ldapAllowClearTextPassword $ ldapAnonymousIdentity $ lDAPSuffix $ ldapAttributeMap $ ldapClassMap $ ldapSearchReferralUsage $ lDAPOtherReferralUsage $ transitionGroupDN $ ldapAttributeList $ ldapClassList $ ldapConfigVersion $ Version $ ldapDefaultReferralBehavior $ ldapTransitionBackLink $ referralIncludeFilter $ referralExcludeFilter ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) X-NDS_NAME 'LDAP Group' X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.22 NAME 'pkiCA' AUXILIARY MAY ( cACertificate $ certificateRevocationList $ authorityRevocationList $ crossCertificatePair $ attributeCertificate $ publicKey $ privateKey $ networkAddress $ loginTime $ lastLoginTime ) X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.21 NAME 'pkiUser' AUXILIARY MAY userCertificate X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.15 NAME 'strongAuthenticationUser' AUXILIARY MAY userCertificate X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.11 NAME 'applicationProcess' SUP Top STRUCTURAL MUST cn MAY ( seeAlso $ ou $ l $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.5.6.12 NAME 'applicationEntity' SUP Top STRUCTURAL MUST ( presentationAddress $ cn ) MAY ( supportedApplicationContext $ seeAlso $ ou $ o $ l $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.5.6.13 NAME 'dSA' SUP applicationEntity STRUCTURAL MAY knowledgeInformation X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.5.6.16 NAME 'certificationAuthority' AUXILIARY MUST ( authorityRevocationList $ certificateRevocationList $ cACertificate ) MAY crossCertificatePair X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.18 NAME 'userSecurityInformation' AUXILIARY MAY supportedAlgorithms X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.20 NAME 'dmd' SUP ndsLoginProperties AUXILIARY MUST dmdName MAY ( searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ l $ description $ userPassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.16.2 NAME 'certificationAuthority-V2' AUXILIARY MUST ( authorityRevocationList $ certificateRevocationList $ cACertificate ) MAY ( crossCertificatePair $ deltaRevocationList ) X-NDS_NAME 'certificationAuthorityVer2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.3.6.1 NAME 'httpServer' SUP Top STRUCTURAL MUST cn MAY ( httpHostServerDN $ httpThreadsPerCPU $ httpIOBufferSize $ httpRequestTimeout $ httpKeepAliveRequestTimeout $ httpSessionTimeout $ httpKeyMaterialObject $ httpTraceLevel $ httpAuthRequiresTLS $ httpDefaultClearPort $ httpDefaultTLSPort $ httpBindRestrictions ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'domain' 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.64.6.1.1 NAME 'Template' SUP Top STRUCTURAL MUST cn MAY ( trusteesOfNewObject $ newObjectSDSRights $ newObjectSFSRights $ setupScript $ runSetupScript $ membersOfTemplate $ volumeSpaceRestrictions $ setPasswordAfterCreate $ homeDirectoryRights $ accountBalance $ allowUnlimitedCredit $ description $ eMailAddress $ facsimileTelephoneNumber $ groupMembership $ higherPrivileges $ ndsHomeDirectory $ l $ Language $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginGraceLimit $ loginMaximumSimultaneous $ loginScript $ mailboxID $ mailboxLocation $ member $ messageServer $ minimumAccountBalance $ networkAddressRestriction $ newObjectSSelfRights $ ou $ passwordAllowChange $ passwordExpirationInterval $ passwordExpirationTime $ passwordMinimumLength $ passwordRequired $ passwordUniqueRequired $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ Profile $ st $ street $ securityEquals $ securityFlags $ seeAlso $ telephoneNumber $ title $ assistant $ assistantPhone $ city $ company $ co $ manager $ managerWorkforceID $ mailstop $ siteLocation $ employeeType $ costCenter $ costCenterDescription $ tollFreePhoneNumber $ departmentNumber ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.8.6.1 NAME 'homeInfo' AUXILIARY MAY ( homeCity $ homeEmailAddress $ homeFax $ homePhone $ homeState $ homePostalAddress $ homeZipCode $ personalMobile $ spouse $ children ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.8.6.2 NAME 'contingentWorker' AUXILIARY MAY ( vendorName $ vendorAddress $ vendorPhoneNumber ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.45 NAME 'dynamicGroup' SUP ( groupOfNames $ ndsLoginProperties ) STRUCTURAL MAY ( memberQueryURL $ excludedMember $ dgIdentity $ dgAllowUnknown $ dgTimeOut $ dgAllowDuplicates $ userPassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.46 NAME 'dynamicGroupAux' SUP ( groupOfNames $ ndsLoginProperties ) AUXILIARY MAY ( memberQueryURL $ excludedMember $ dgIdentity $ dgAllowUnknown $ dgTimeOut $ dgAllowDuplicates $ userPassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.6.1.1 NAME 'sASSecurity' SUP Top STRUCTURAL MUST cn MAY ( nDSPKITreeCADN $ masvPolicyDN $ sASLoginPolicyDN $ sASLoginMethodContainerDN $ sasPostLoginMethodContainerDN $ nspmPolicyAgentContainerDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'Country' 'Organization' 'domain' ) X-NDS_NAME 'SAS:Security' )", + "( 2.16.840.1.113719.1.39.6.1.2 NAME 'sASService' SUP Resource STRUCTURAL MAY ( hostServer $ privateKey $ publicKey $ allowUnlimitedCredit $ fullName $ lastLoginTime $ lockedByIntruder $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginIntruderAddress $ loginIntruderAttempts $ loginIntruderResetTime $ loginMaximumSimultaneous $ loginTime $ networkAddress $ networkAddressRestriction $ notify $ operator $ owner $ path $ securityEquals $ securityFlags $ status $ Version $ nDSPKIKeyMaterialDN $ ndspkiKMOExport ) X-NDS_NAMING 'cn' X-NDS_NAME 'SAS:Service' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.1 NAME 'nDSPKICertificateAuthority' SUP Top STRUCTURAL MUST cn MAY ( hostServer $ nDSPKIPublicKey $ nDSPKIPrivateKey $ nDSPKIPublicKeyCertificate $ nDSPKICertificateChain $ nDSPKIParentCA $ nDSPKIParentCADN $ nDSPKISubjectName $ cACertificate $ ndspkiCRLContainerDN $ ndspkiIssuedCertContainerDN $ ndspkiCRLConfigurationDNList $ ndspkiSecurityRightsLevel ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'NDSPKI:Certificate Authority' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.2 NAME 'nDSPKIKeyMaterial' SUP Top STRUCTURAL MUST cn MAY ( hostServer $ nDSPKIKeyFile $ nDSPKIPrivateKey $ nDSPKIPublicKey $ nDSPKIPublicKeyCertificate $ nDSPKICertificateChain $ nDSPKISubjectName $ nDSPKIGivenName $ ndspkiAdditionalRoots $ nDSPKINotBefore $ nDSPKINotAfter ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'NDSPKI:Key Material' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.3 NAME 'nDSPKITrustedRoot' SUP Top STRUCTURAL MUST cn MAY ndspkiTrustedRootList X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'domain' ) X-NDS_NAME 'NDSPKI:Trusted Root' )", + "( 2.16.840.1.113719.1.48.6.1.4 NAME 'nDSPKITrustedRootObject' SUP Top STRUCTURAL MUST ( cn $ nDSPKITrustedRootCertificate ) MAY ( nDSPKISubjectName $ nDSPKINotBefore $ nDSPKINotAfter $ externalName $ givenName $ sn ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'nDSPKITrustedRoot' X-NDS_NAME 'NDSPKI:Trusted Root Object' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.101 NAME 'nDSPKISDKeyAccessPartition' SUP Top STRUCTURAL MUST cn X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'NDSPKI:SD Key Access Partition' )", + "( 2.16.840.1.113719.1.48.6.1.102 NAME 'nDSPKISDKeyList' SUP Top STRUCTURAL MUST cn MAY ( nDSPKISDKeyServerDN $ nDSPKISDKeyStruct $ nDSPKISDKeyCert ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'nDSPKISDKeyAccessPartition' X-NDS_NAME 'NDSPKI:SD Key List' )", + "( 2.16.840.1.113719.1.31.6.2.1 NAME 'mASVSecurityPolicy' SUP Top STRUCTURAL MUST cn MAY ( description $ masvDomainPolicy $ masvPolicyUpdate $ masvClearanceNames $ masvLabelNames $ masvLabelSecrecyLevelNames $ masvLabelSecrecyCategoryNames $ masvLabelIntegrityLevelNames $ masvLabelIntegrityCategoryNames $ masvNDSAttributeLabels ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'MASV:Security Policy' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.1 NAME 'sASLoginMethodContainer' SUP Top STRUCTURAL MUST cn MAY description X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NAME 'SAS:Login Method Container' )", + "( 2.16.840.1.113719.1.39.42.2.0.4 NAME 'sASLoginPolicy' SUP Top STRUCTURAL MUST cn MAY ( description $ privateKey $ publicKey $ sASAllowNDSPasswordWindow $ sASPolicyCredentials $ sASPolicyMethods $ sASPolicyObjectVersion $ sASPolicyServiceSubtypes $ sASPolicyServices $ sASPolicyUsers $ sASLoginSequence $ sASLoginPolicyUpdate $ sasNMASProductOptions $ sasPolicyMethods $ sasPolicyServices $ sasPolicyUsers $ sasAllowNDSPasswordWindow $ sasLoginFailureDelay $ sasDefaultLoginSequence $ sasAuthorizedLoginSequences $ sasAuditConfiguration $ sasUpdateLoginInfo $ sasOTPEnabled $ sasOTPLookAheadWindow $ sasOTPDigits $ sasUpdateLoginTimeInterval $ nspmPasswordPolicyDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'SAS:Login Policy' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.7 NAME 'sASNMASBaseLoginMethod' SUP Top ABSTRACT MUST cn MAY ( description $ sASLoginSecret $ sASLoginSecretKey $ sASEncryptionType $ sASLoginConfiguration $ sASLoginConfigurationKey $ sASMethodIdentifier $ sASMethodVendor $ sASVendorSupport $ sASAdvisoryMethodGrade $ sASLoginClientMethodNetWare $ sASLoginServerMethodNetWare $ sASLoginClientMethodWINNT $ sASLoginServerMethodWINNT $ sasCertificateSearchContainers $ sasNMASMethodConfigData $ sasMethodVersion $ sASLoginPolicyUpdate $ sasUnsignedMethodModules $ sasServerModuleName $ sasServerModuleEntryPointName $ sasSASLMechanismName $ sasSASLMechanismEntryPointName $ sasClientModuleName $ sasClientModuleEntryPointName $ sasLoginClientMethodSolaris $ sasLoginServerMethodSolaris $ sasLoginClientMethodLinux $ sasLoginServerMethodLinux $ sasLoginClientMethodTru64 $ sasLoginServerMethodTru64 $ sasLoginClientMethodAIX $ sasLoginServerMethodAIX $ sasLoginClientMethodHPUX $ sasLoginServerMethodHPUX $ sasLoginClientMethods390 $ sasLoginServerMethods390 $ sasLoginClientMethodLinuxX64 $ sasLoginServerMethodLinuxX64 $ sasLoginClientMethodWinX64 $ sasLoginServerMethodWinX64 $ sasLoginClientMethodSolaris64 $ sasLoginServerMethodSolaris64 $ sasLoginClientMethodSolarisi386 $ sasLoginServerMethodSolarisi386 $ sasLoginClientMethodAIX64 $ sasLoginServerMethodAIX64 ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASLoginMethodContainer' X-NDS_NAME 'SAS:NMAS Base Login Method' )", + "( 2.16.840.1.113719.1.39.42.2.0.8 NAME 'sASNMASLoginMethod' SUP sASNMASBaseLoginMethod STRUCTURAL X-NDS_NAME 'SAS:NMAS Login Method' )", + "( 2.16.840.1.113719.1.39.42.2.0.9 NAME 'rADIUSDialAccessSystem' SUP Top STRUCTURAL MUST cn MAY ( publicKey $ privateKey $ rADIUSAgedInterval $ rADIUSClient $ rADIUSCommonNameResolution $ rADIUSConcurrentLimit $ rADIUSDASVersion $ rADIUSEnableCommonNameLogin $ rADIUSEnableDialAccess $ rADIUSInterimAcctingTimeout $ rADIUSLookupContexts $ rADIUSMaxDASHistoryRecord $ rADIUSMaximumHistoryRecord $ rADIUSPasswordPolicy $ rADIUSPrivateKey $ rADIUSProxyContext $ rADIUSProxyDomain $ rADIUSProxyTarget $ rADIUSPublicKey $ sASLoginConfiguration $ sASLoginConfigurationKey ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NAME 'RADIUS:Dial Access System' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.10 NAME 'rADIUSProfile' SUP Top STRUCTURAL MUST cn MAY rADIUSAttributeList X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NAME 'RADIUS:Profile' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.11 NAME 'sasPostLoginMethodContainer' SUP Top STRUCTURAL MUST cn MAY description X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' )", + "( 2.16.840.1.113719.1.39.42.2.0.12 NAME 'sasPostLoginMethod' SUP Top STRUCTURAL MUST cn MAY ( description $ sASLoginSecret $ sASLoginSecretKey $ sASEncryptionType $ sASLoginConfiguration $ sASLoginConfigurationKey $ sASMethodIdentifier $ sASMethodVendor $ sASVendorSupport $ sASAdvisoryMethodGrade $ sASLoginClientMethodNetWare $ sASLoginServerMethodNetWare $ sASLoginClientMethodWINNT $ sASLoginServerMethodWINNT $ sasMethodVersion $ sASLoginPolicyUpdate $ sasUnsignedMethodModules $ sasServerModuleName $ sasServerModuleEntryPointName $ sasSASLMechanismName $ sasSASLMechanismEntryPointName $ sasClientModuleName $ sasClientModuleEntryPointName $ sasLoginClientMethodSolaris $ sasLoginServerMethodSolaris $ sasLoginClientMethodLinux $ sasLoginServerMethodLinux $ sasLoginClientMethodTru64 $ sasLoginServerMethodTru64 $ sasLoginClientMethodAIX $ sasLoginServerMethodAIX $ sasLoginClientMethodHPUX $ sasLoginServerMethodHPUX $ sasLoginClientMethods390 $ sasLoginServerMethods390 $ sasLoginClientMethodLinuxX64 $ sasLoginServerMethodLinuxX64 $ sasLoginClientMethodWinX64 $ sasLoginServerMethodWinX64 $ sasLoginClientMethodSolaris64 $ sasLoginServerMethodSolaris64 $ sasLoginClientMethodSolarisi386 $ sasLoginServerMethodSolarisi386 $ sasLoginClientMethodAIX64 $ sasLoginServerMethodAIX64 ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sasPostLoginMethodContainer' )", + "( 2.16.840.1.113719.1.6.6.1 NAME 'snmpGroup' SUP Top STRUCTURAL MUST cn MAY ( Version $ snmpServerList $ snmpTrapDisable $ snmpTrapInterval $ snmpTrapDescription $ snmpTrapConfig ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'domain' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.43.6.2 NAME 'nspmPasswordPolicyContainer' SUP Top STRUCTURAL MUST cn MAY description X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Country' 'domain' 'Locality' 'Organization' 'organizationalUnit' ) )", + "( 2.16.840.1.113719.1.39.43.6.3 NAME 'nspmPolicyAgent' SUP Top STRUCTURAL MUST cn MAY ( description $ nspmPolicyAgentNetWare $ nspmPolicyAgentWINNT $ nspmPolicyAgentSolaris $ nspmPolicyAgentLinux $ nspmPolicyAgentAIX $ nspmPolicyAgentHPUX ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'nspmPasswordPolicyContainer' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.43.6.1 NAME 'nspmPasswordPolicy' SUP Top STRUCTURAL MUST cn MAY ( description $ nspmPolicyPrecedence $ nspmConfigurationOptions $ nspmChangePasswordMessage $ passwordExpirationInterval $ loginGraceLimit $ nspmMinPasswordLifetime $ passwordUniqueRequired $ nspmPasswordHistoryLimit $ nspmPasswordHistoryExpiration $ passwordAllowChange $ passwordRequired $ passwordMinimumLength $ nspmMaximumLength $ nspmCaseSensitive $ nspmMinUpperCaseCharacters $ nspmMaxUpperCaseCharacters $ nspmMinLowerCaseCharacters $ nspmMaxLowerCaseCharacters $ nspmNumericCharactersAllowed $ nspmNumericAsFirstCharacter $ nspmNumericAsLastCharacter $ nspmMinNumericCharacters $ nspmMaxNumericCharacters $ nspmSpecialCharactersAllowed $ nspmSpecialAsFirstCharacter $ nspmSpecialAsLastCharacter $ nspmMinSpecialCharacters $ nspmMaxSpecialCharacters $ nspmMaxRepeatedCharacters $ nspmMaxConsecutiveCharacters $ nspmMinUniqueCharacters $ nspmDisallowedAttributeValues $ nspmExcludeList $ nspmExtendedCharactersAllowed $ nspmExtendedAsFirstCharacter $ nspmExtendedAsLastCharacter $ nspmMinExtendedCharacters $ nspmMaxExtendedCharacters $ nspmUpperAsFirstCharacter $ nspmUpperAsLastCharacter $ nspmLowerAsFirstCharacter $ nspmLowerAsLastCharacter $ nspmComplexityRules $ nspmAD2K8Syntax $ nspmAD2K8maxViolation $ nspmXCharLimit $ nspmXCharHistoryLimit $ nspmUnicodeAllowed $ nspmNonAlphaCharactersAllowed $ nspmMinNonAlphaCharacters $ nspmMaxNonAlphaCharacters $ pwdInHistory $ nspmAdminsDoNotExpirePassword $ nspmPasswordACL $ nsimChallengeSetDN $ nsimForgottenAction $ nsimForgottenLoginConfig $ nsimAssignments $ nsimChallengeSetGUID $ nsimPwdRuleEnforcement ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'nspmPasswordPolicyContainer' 'domain' 'Locality' 'Organization' 'organizationalUnit' 'Country' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.43.6.4 NAME 'nspmPasswordAux' AUXILIARY MAY ( publicKey $ privateKey $ loginGraceLimit $ loginGraceRemaining $ passwordExpirationTime $ passwordRequired $ nspmPasswordKey $ nspmPassword $ nspmDistributionPassword $ nspmPreviousDistributionPassword $ nspmPasswordHistory $ nspmAdministratorChangeCount $ nspmPasswordPolicyDN $ pwdChangedTime $ pwdAccountLockedTime $ pwdFailureTime $ nspmDoNotExpirePassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.12.6.1.0 NAME 'auditFileObject' SUP Top STRUCTURAL MUST ( cn $ auditPolicy $ auditContents ) MAY ( description $ auditPath $ auditLinkList $ auditType $ auditCurrentEncryptionKey $ auditAEncryptionKey $ auditBEncryptionKey ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Top' 'Country' 'Locality' 'Organization' 'organizationalUnit' 'treeRoot' 'domain' ) X-NDS_NAME 'Audit:File Object' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.38.6.1.4 NAME 'wANMANLANArea' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ o $ ou $ owner $ seeAlso $ wANMANWANPolicy $ wANMANCost $ wANMANDefaultCost ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'Organization' 'organizationalUnit' ) X-NDS_NAME 'WANMAN:LAN Area' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.37.1 NAME 'rbsCollection' SUP Top STRUCTURAL MUST cn MAY ( owner $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.16.840.1.113719.1.135.6.30.1 NAME 'rbsExternalScope' SUP Top ABSTRACT MUST cn MAY ( rbsURL $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.31.1 NAME 'rbsModule' SUP Top STRUCTURAL MUST cn MAY ( rbsURL $ rbsPath $ rbsType $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection' )", + "( 2.16.840.1.113719.1.135.6.32.1 NAME 'rbsRole' SUP Top STRUCTURAL MUST cn MAY ( rbsContent $ rbsMember $ rbsTrusteeOf $ rbsGALabel $ rbsParameters $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection' )", + "( 2.16.840.1.113719.1.135.6.33.1 NAME 'rbsTask' SUP Top STRUCTURAL MUST cn MAY ( rbsContentMembership $ rbsType $ rbsTaskRights $ rbsEntryPoint $ rbsParameters $ rbsTaskTemplates $ rbsTaskTemplatesURL $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsModule' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.34.1 NAME 'rbsBook' SUP rbsTask STRUCTURAL MAY ( rbsTargetObjectType $ rbsPageMembership ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.35.1 NAME 'rbsScope' SUP groupOfNames STRUCTURAL MAY ( rbsContext $ rbsXMLInfo ) X-NDS_CONTAINMENT 'rbsRole' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.45.1 NAME 'rbsCollection2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsParameters $ owner $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.16.840.1.113719.1.135.6.38.1 NAME 'rbsExternalScope2' SUP Top ABSTRACT MUST cn MAY ( rbsXMLInfo $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.39.1 NAME 'rbsModule2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsPath $ rbsType $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' )", + "( 2.16.840.1.113719.1.135.6.40.1 NAME 'rbsRole2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsContent $ rbsMember $ rbsTrusteeOf $ rbsParameters $ description $ rbsCategoryMembership ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' )", + "( 2.16.840.1.113719.1.135.6.41.1 NAME 'rbsTask2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsContentMembership $ rbsType $ rbsTaskRights $ rbsEntryPoint $ rbsParameters $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsModule2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.42.1 NAME 'rbsBook2' SUP rbsTask2 STRUCTURAL MAY ( rbsTargetObjectType $ rbsPageMembership ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.43.1 NAME 'rbsScope2' SUP groupOfNames STRUCTURAL MAY ( rbsContext $ rbsXMLInfo ) X-NDS_CONTAINMENT 'rbsRole2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.49 NAME 'prSyncPolicy' SUP Top STRUCTURAL MUST cn MAY prSyncAttributes X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'domain' 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.50 NAME 'encryptionPolicy' SUP Top STRUCTURAL MUST cn MAY ( attrEncryptionDefinition $ attrEncryptionRequiresSecure ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'domain' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.5 NAME 'ndspkiContainer' SUP Top STRUCTURAL MUST cn X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'ndspkiContainer' 'sASSecurity' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'nDSPKITrustedRoot' ) )", + "( 2.16.840.1.113719.1.48.6.1.6 NAME 'ndspkiCertificate' SUP Top STRUCTURAL MUST ( cn $ userCertificate ) MAY ( nDSPKISubjectName $ nDSPKINotBefore $ nDSPKINotAfter $ externalName $ givenName $ sn ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'ndspkiContainer' 'nDSPKITrustedRoot' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.7 NAME 'ndspkiCRLConfiguration' SUP Top STRUCTURAL MUST cn MAY ( ndspkiCRLFileName $ ndspkiDirectory $ ndspkiStatus $ ndspkiIssueTime $ ndspkiNextIssueTime $ ndspkiAttemptTime $ ndspkiTimeInterval $ ndspkiCRLMaxProcessingInterval $ ndspkiCRLNumber $ ndspkiDistributionPoints $ ndspkiDistributionPointDN $ ndspkiCADN $ ndspkiCRLProcessData $ nDSPKIPublicKey $ nDSPKIPrivateKey $ nDSPKIPublicKeyCertificate $ nDSPKICertificateChain $ nDSPKIParentCA $ nDSPKIParentCADN $ nDSPKISubjectName $ cACertificate $ hostServer ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'ndspkiContainer' )", + "( 2.5.6.19 NAME 'cRLDistributionPoint' SUP Top STRUCTURAL MUST cn MAY ( authorityRevocationList $ authorityRevocationList $ cACertificate $ certificateRevocationList $ certificateRevocationList $ crossCertificatePair $ deltaRevocationList $ deltaRevocationList $ ndspkiCRLConfigurationDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'sASSecurity' 'domain' 'ndspkiCRLConfiguration' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.7.6.1 NAME 'notfTemplateCollection' SUP Top STRUCTURAL MUST cn MAY ( notfSMTPEmailHost $ notfSMTPEmailFrom $ notfSMTPEmailUserName $ sASSecretStore ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' )", + "( 2.16.840.1.113719.1.7.6.2 NAME 'notfMergeTemplate' SUP Top STRUCTURAL MUST cn MAY ( notfMergeTemplateData $ notfMergeTemplateSubject ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'notfTemplateCollection' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.44.6.1 NAME 'nsimChallengeSet' SUP Top STRUCTURAL MUST cn MAY ( description $ nsimRequiredQuestions $ nsimRandomQuestions $ nsimNumberRandomQuestions $ nsimMinResponseLength $ nsimMaxResponseLength ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'nspmPasswordPolicyContainer' 'Country' 'domain' 'Locality' 'Organization' 'organizationalUnit' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.266.6.1 NAME 'sssServerPolicies' SUP Top STRUCTURAL MUST cn MAY ( sssCacheRefreshInterval $ sssEnableReadTimestamps $ sssDisableMasterPasswords $ sssEnableAdminAccess $ sssAdminList $ sssAdminGALabel $ sssReadSecretPolicies ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' )", + "( 2.16.840.1.113719.1.266.6.2 NAME 'sssServerPolicyOverride' SUP Top STRUCTURAL MUST cn MAY ( sssCacheRefreshInterval $ sssEnableReadTimestamps $ sssDisableMasterPasswords $ sssEnableAdminAccess $ sssAdminList $ sssAdminGALabel $ sssReadSecretPolicies ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sssServerPolicies' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'domain' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.91 NAME 'nestedGroupAux' AUXILIARY MAY ( groupMember $ excludedMember $ nestedConfig $ groupMembership ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.46.1 NAME 'rbsCategory2' SUP Top STRUCTURAL MUST cn MAY ( rbsRoleMember $ rbsXMLInfo $ rbsParameters $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' X-NDS_NOT_CONTAINER '1' )" + ] + }, + "schema_entry": "cn=schema", + "type": "SchemaInfo" +} +""" + +edir_8_8_8_dsa_info = """ +{ + "raw": { + "abandonOps": [ + "0" + ], + "addEntryOps": [ + "947" + ], + "altServer": [], + "bindSecurityErrors": [ + "3" + ], + "chainings": [ + "0" + ], + "compareOps": [ + "61" + ], + "directoryTreeName": [ + "EDIR-TEST" + ], + "dsaName": [ + "cn=edir1,o=services" + ], + "errors": [ + "984" + ], + "extendedOps": [ + "213" + ], + "inBytes": [ + "1253717" + ], + "inOps": [ + "14342" + ], + "listOps": [ + "0" + ], + "modifyEntryOps": [ + "121" + ], + "modifyRDNOps": [ + "63" + ], + "namingContexts": [ + "" + ], + "oneLevelSearchOps": [ + "129" + ], + "outBytes": [ + "547685251" + ], + "readOps": [ + "7427" + ], + "referralsReturned": [ + "0" + ], + "removeEntryOps": [ + "146" + ], + "repUpdatesIn": [ + "0" + ], + "repUpdatesOut": [ + "0" + ], + "searchOps": [ + "8316" + ], + "securityErrors": [ + "3" + ], + "simpleAuthBinds": [ + "1654" + ], + "strongAuthBinds": [ + "57" + ], + "subschemaSubentry": [ + "cn=schema" + ], + "supportedControl": [ + "2.16.840.1.113719.1.27.101.6", + "2.16.840.1.113719.1.27.101.5", + "1.2.840.113556.1.4.319", + "2.16.840.1.113730.3.4.3", + "2.16.840.1.113730.3.4.2", + "2.16.840.1.113719.1.27.103.7", + "2.16.840.1.113719.1.27.101.40", + "2.16.840.1.113719.1.27.101.41", + "1.2.840.113556.1.4.1413", + "1.2.840.113556.1.4.805" + ], + "supportedExtension": [ + "2.16.840.1.113719.1.148.100.1", + "2.16.840.1.113719.1.148.100.3", + "2.16.840.1.113719.1.148.100.5", + "2.16.840.1.113719.1.148.100.7", + "2.16.840.1.113719.1.148.100.9", + "2.16.840.1.113719.1.148.100.11", + "2.16.840.1.113719.1.148.100.13", + "2.16.840.1.113719.1.148.100.15", + "2.16.840.1.113719.1.148.100.17", + "2.16.840.1.113719.1.39.42.100.1", + "2.16.840.1.113719.1.39.42.100.3", + "2.16.840.1.113719.1.39.42.100.5", + "2.16.840.1.113719.1.39.42.100.7", + "2.16.840.1.113719.1.39.42.100.9", + "2.16.840.1.113719.1.39.42.100.11", + "2.16.840.1.113719.1.39.42.100.13", + "2.16.840.1.113719.1.39.42.100.15", + "2.16.840.1.113719.1.39.42.100.17", + "2.16.840.1.113719.1.39.42.100.19", + "2.16.840.1.113719.1.39.42.100.21", + "2.16.840.1.113719.1.39.42.100.23", + "2.16.840.1.113719.1.39.42.100.25", + "2.16.840.1.113719.1.39.42.100.27", + "2.16.840.1.113719.1.27.100.1", + "2.16.840.1.113719.1.27.100.3", + "2.16.840.1.113719.1.27.100.5", + "2.16.840.1.113719.1.27.100.7", + "2.16.840.1.113719.1.27.100.11", + "2.16.840.1.113719.1.27.100.13", + "2.16.840.1.113719.1.27.100.15", + "2.16.840.1.113719.1.27.100.17", + "2.16.840.1.113719.1.27.100.19", + "2.16.840.1.113719.1.27.100.21", + "2.16.840.1.113719.1.27.100.23", + "2.16.840.1.113719.1.27.100.25", + "2.16.840.1.113719.1.27.100.27", + "2.16.840.1.113719.1.27.100.29", + "2.16.840.1.113719.1.27.100.31", + "2.16.840.1.113719.1.27.100.33", + "2.16.840.1.113719.1.27.100.35", + "2.16.840.1.113719.1.27.100.37", + "2.16.840.1.113719.1.27.100.39", + "2.16.840.1.113719.1.27.100.41", + "2.16.840.1.113719.1.27.100.96", + "2.16.840.1.113719.1.27.100.98", + "2.16.840.1.113719.1.27.100.101", + "2.16.840.1.113719.1.27.100.103", + "2.16.840.1.113719.1.142.100.1", + "2.16.840.1.113719.1.142.100.4", + "2.16.840.1.113719.1.142.100.6", + "2.16.840.1.113719.1.27.100.9", + "2.16.840.1.113719.1.27.100.43", + "2.16.840.1.113719.1.27.100.45", + "2.16.840.1.113719.1.27.100.47", + "2.16.840.1.113719.1.27.100.49", + "2.16.840.1.113719.1.27.100.51", + "2.16.840.1.113719.1.27.100.53", + "2.16.840.1.113719.1.27.100.55", + "1.3.6.1.4.1.1466.20037", + "2.16.840.1.113719.1.27.100.79", + "2.16.840.1.113719.1.27.100.84", + "2.16.840.1.113719.1.27.103.1", + "2.16.840.1.113719.1.27.103.2" + ], + "supportedFeatures": [ + "1.3.6.1.4.1.4203.1.5.1", + "2.16.840.1.113719.1.27.99.1" + ], + "supportedGroupingTypes": [ + "2.16.840.1.113719.1.27.103.8" + ], + "supportedLDAPVersion": [ + "2", + "3" + ], + "supportedSASLMechanisms": [ + "NMAS_LOGIN", + "EXTERNAL", + "DIGEST-MD5", + "GSSAPI" + ], + "unAuthBinds": [ + "1897" + ], + "vendorName": [ + "NetIQ Corporation" + ], + "vendorVersion": [ + "LDAP Agent for NetIQ eDirectory 8.8 SP8 (20804.04)" + ], + "wholeSubtreeSearchOps": [ + "760" + ] + }, + "type": "DsaInfo" +} +""" diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/edir914.py b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/edir914.py new file mode 100644 index 0000000000000000000000000000000000000000..0a1d2e6a3972255183efb35b7ba92cc9c171b8f3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/edir914.py @@ -0,0 +1,1157 @@ +""" +""" + +# Created on 2019.08.31 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +edir_9_1_4_schema = """ +{ + "raw": { + "attributeTypes": [ + "( 2.5.4.35 NAME 'userPassword' DESC 'Internal NDS policy forces this to be single-valued' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} USAGE directoryOperation )", + "( 2.5.18.1 NAME 'createTimestamp' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.2 NAME 'modifyTimestamp' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.10 NAME 'subschemaSubentry' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation )", + "( 2.5.21.9 NAME 'structuralObjectClass' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.27.4.49 NAME 'subordinateCount' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.27.4.48 NAME 'entryFlags' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.27.4.51 NAME 'federationBoundary' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.21.5 NAME 'attributeTypes' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.3 USAGE directoryOperation )", + "( 2.5.21.6 NAME 'objectClasses' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.37 USAGE directoryOperation )", + "( 1.3.6.1.1.20 NAME 'entryDN' DESC 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.1.4.1.2 NAME 'ACL' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.5.4.1 NAME 'aliasedObjectName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Aliased Object Name' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.16.840.1.113719.1.1.4.1.6 NAME 'backLink' SYNTAX 2.16.840.1.113719.1.1.5.1.23 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Back Link' X-NDS_SERVER_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.8 NAME 'binderyProperty' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Bindery Property' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.7 NAME 'binderyObjectRestriction' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Bindery Object Restriction' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.9 NAME 'binderyType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Bindery Type' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.11 NAME 'cAPrivateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'CA Private Key' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.12 NAME 'cAPublicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'CA Public Key' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.10 NAME 'Cartridge' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.3 NAME ( 'cn' 'commonName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'CN' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.78 NAME 'printerConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Printer Configuration' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.15 NAME 'Convergence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{1} SINGLE-VALUE X-NDS_UPPER_BOUND '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.6 NAME ( 'c' 'countryName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{2} SINGLE-VALUE X-NDS_NAME 'C' X-NDS_LOWER_BOUND '2' X-NDS_UPPER_BOUND '2' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.18 NAME 'defaultQueue' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Default Queue' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.13 NAME ( 'description' 'multiLineDescription' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} X-NDS_NAME 'Description' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '1024' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.64 NAME 'partitionCreationTime' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Partition Creation Time' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.23 NAME 'facsimileTelephoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.22{64512} X-NDS_NAME 'Facsimile Telephone Number' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.117 NAME 'highConvergenceSyncInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27 SINGLE-VALUE X-NDS_NAME 'High Convergence Sync Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.25 NAME 'groupMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Group Membership' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.26 NAME 'ndsHomeDirectory' SYNTAX 2.16.840.1.113719.1.1.5.1.15{255} SINGLE-VALUE X-NDS_NAME 'Home Directory' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '255' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.27 NAME 'hostDevice' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Host Device' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.28 NAME 'hostResourceName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'Host Resource Name' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.29 NAME 'hostServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Host Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.30 NAME 'inheritedACL' SYNTAX 2.16.840.1.113719.1.1.5.1.17 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Inherited ACL' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.7 NAME ( 'l' 'localityname' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'L' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.39 NAME 'loginAllowedTimeMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{42} SINGLE-VALUE X-NDS_NAME 'Login Allowed Time Map' X-NDS_LOWER_BOUND '42' X-NDS_UPPER_BOUND '42' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.40 NAME 'loginDisabled' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Login Disabled' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.41 NAME 'loginExpirationTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Login Expiration Time' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.42 NAME 'loginGraceLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Login Grace Limit' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.43 NAME 'loginGraceRemaining' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_NAME 'Login Grace Remaining' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.44 NAME 'loginIntruderAddress' SYNTAX 2.16.840.1.113719.1.1.5.1.12 SINGLE-VALUE X-NDS_NAME 'Login Intruder Address' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.45 NAME 'loginIntruderAttempts' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_NAME 'Login Intruder Attempts' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.46 NAME 'loginIntruderLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Login Intruder Limit' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.31 NAME 'intruderAttemptResetInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27 SINGLE-VALUE X-NDS_NAME 'Intruder Attempt Reset Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.47 NAME 'loginIntruderResetTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Login Intruder Reset Time' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.48 NAME 'loginMaximumSimultaneous' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Login Maximum Simultaneous' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.49 NAME 'loginScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Login Script' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.50 NAME 'loginTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Login Time' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.31 NAME ( 'member' 'uniqueMember' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Member' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.52 NAME 'Memory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.22 NAME 'eMailAddress' SYNTAX 2.16.840.1.113719.1.1.5.1.14{64512} X-NDS_NAME 'EMail Address' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.55 NAME 'networkAddress' SYNTAX 2.16.840.1.113719.1.1.5.1.12 X-NDS_NAME 'Network Address' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.56 NAME 'networkAddressRestriction' SYNTAX 2.16.840.1.113719.1.1.5.1.12 X-NDS_NAME 'Network Address Restriction' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.57 NAME 'notify' SYNTAX 2.16.840.1.113719.1.1.5.1.25 X-NDS_NAME 'Notify' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.114 NAME 'Obituary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.0 NAME 'objectClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 X-NDS_NAME 'Object Class' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.16.840.1.113719.1.1.4.1.59 NAME 'operator' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Operator' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'OU' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.10 NAME ( 'o' 'organizationname' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'O' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.32 NAME 'owner' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Owner' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.63 NAME 'pageDescriptionLanguage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} X-NDS_NAME 'Page Description Language' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.65 NAME 'passwordsUsed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'Passwords Used' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.66 NAME 'passwordAllowChange' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Password Allow Change' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.67 NAME 'passwordExpirationInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27 SINGLE-VALUE X-NDS_NAME 'Password Expiration Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.68 NAME 'passwordExpirationTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NAME 'Password Expiration Time' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.69 NAME 'passwordMinimumLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Password Minimum Length' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.70 NAME 'passwordRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Password Required' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.71 NAME 'passwordUniqueRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Password Unique Required' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.72 NAME 'path' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'Path' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.19 NAME 'physicalDeliveryOfficeName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'Physical Delivery Office Name' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.16 NAME 'postalAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41{64512} X-NDS_NAME 'Postal Address' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.17 NAME 'postalCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} X-NDS_NAME 'Postal Code' X-NDS_UPPER_BOUND '40' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.18 NAME 'postOfficeBox' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} X-NDS_NAME 'Postal Office Box' X-NDS_UPPER_BOUND '40' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.80 NAME 'printJobConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Print Job Configuration' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.79 NAME 'printerControl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Printer Control' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.82 NAME 'privateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Private Key' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.83 NAME 'Profile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.84 NAME 'publicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Public Key' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_OPERATIONAL '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.85 NAME 'queue' SYNTAX 2.16.840.1.113719.1.1.5.1.25 X-NDS_NAME 'Queue' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.86 NAME 'queueDirectory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE X-NDS_NAME 'Queue Directory' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '255' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.115 NAME 'Reference' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.88 NAME 'Replica' SYNTAX 2.16.840.1.113719.1.1.5.1.16{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.89 NAME 'Resource' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.33 NAME 'roleOccupant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Role Occupant' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.116 NAME 'higherPrivileges' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Higher Privileges' X-NDS_SERVER_READ '1' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.92 NAME 'securityEquals' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Security Equals' X-NDS_SERVER_READ '1' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.5.4.34 NAME 'seeAlso' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'See Also' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.5 NAME 'serialNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} X-NDS_NAME 'Serial Number' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.95 NAME 'server' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Server' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'S' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.98 NAME 'status' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Status' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_OPERATIONAL '1' )", + "( 2.5.4.9 NAME 'street' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'SA' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.102 NAME 'supportedTypefaces' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Supported Typefaces' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.101 NAME 'supportedServices' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Supported Services' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.4 NAME ( 'sn' 'surname' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Surname' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.20 NAME 'telephoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} X-NDS_NAME 'Telephone Number' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.12 NAME 'title' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'Title' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.111 NAME 'User' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.112 NAME 'Version' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} SINGLE-VALUE X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.1 NAME 'accountBalance' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_NAME 'Account Balance' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.4 NAME 'allowUnlimitedCredit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Allow Unlimited Credit' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.118 NAME 'lowConvergenceResetTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Low Convergence Reset Time' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.54 NAME 'minimumAccountBalance' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Minimum Account Balance' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.104 NAME 'lowConvergenceSyncInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27 SINGLE-VALUE X-NDS_NAME 'Low Convergence Sync Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.21 NAME 'Device' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.53 NAME 'messageServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Message Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.34 NAME 'Language' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.100 NAME 'supportedConnections' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Supported Connections' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.107 NAME 'typeCreatorMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Type Creator Map' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.108 NAME 'ndsUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'UID' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.24 NAME 'groupID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'GID' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.110 NAME 'unknownBaseClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Unknown Base Class' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.87 NAME 'receivedUpTo' SYNTAX 2.16.840.1.113719.1.1.5.1.19 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Received Up To' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.33 NAME 'synchronizedUpTo' SYNTAX 2.16.840.1.113719.1.1.5.1.19 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Synchronized Up To' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.5 NAME 'authorityRevocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Authority Revocation' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.13 NAME 'certificateRevocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Certificate Revocation' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.17 NAME 'ndsCrossCertificatePair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'Cross Certificate Pair' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.37 NAME 'lockedByIntruder' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Locked By Intruder' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.77 NAME 'printer' SYNTAX 2.16.840.1.113719.1.1.5.1.25 X-NDS_NAME 'Printer' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.20 NAME 'detectIntruder' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Detect Intruder' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.38 NAME 'lockoutAfterDetection' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Lockout After Detection' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.32 NAME 'intruderLockoutResetInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27 SINGLE-VALUE X-NDS_NAME 'Intruder Lockout Reset Interval' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.96 NAME 'serverHolds' SYNTAX 2.16.840.1.113719.1.1.5.1.26 X-NDS_NAME 'Server Holds' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.91 NAME 'sAPName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{47} SINGLE-VALUE X-NDS_NAME 'SAP Name' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '47' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.113 NAME 'Volume' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.35 NAME 'lastLoginTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Last Login Time' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.81 NAME 'printServer' SYNTAX 2.16.840.1.113719.1.1.5.1.25 SINGLE-VALUE X-NDS_NAME 'Print Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.119 NAME 'nNSDomain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_NAME 'NNS Domain' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.120 NAME 'fullName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} X-NDS_NAME 'Full Name' X-NDS_UPPER_BOUND '127' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.121 NAME 'partitionControl' SYNTAX 2.16.840.1.113719.1.1.5.1.25 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Partition Control' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.122 NAME 'revision' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Revision' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_SCHED_SYNC_NEVER '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.123 NAME 'certificateValidityInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'Certificate Validity Interval' X-NDS_LOWER_BOUND '60' X-NDS_UPPER_BOUND '-1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.124 NAME 'externalSynchronizer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'External Synchronizer' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.125 NAME 'messagingDatabaseLocation' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NAME 'Messaging Database Location' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.126 NAME 'messageRoutingGroup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Message Routing Group' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.127 NAME 'messagingServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Messaging Server' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.128 NAME 'Postmaster' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.162 NAME 'mailboxLocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Mailbox Location' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.163 NAME 'mailboxID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8} SINGLE-VALUE X-NDS_NAME 'Mailbox ID' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '8' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.164 NAME 'externalName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'External Name' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.165 NAME 'securityFlags' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Security Flags' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.166 NAME 'messagingServerType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} SINGLE-VALUE X-NDS_NAME 'Messaging Server Type' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.167 NAME 'lastReferencedTime' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Last Referenced Time' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.4.42 NAME 'givenName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} X-NDS_NAME 'Given Name' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.43 NAME 'initials' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8} X-NDS_NAME 'Initials' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '8' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.4.44 NAME 'generationQualifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{8} SINGLE-VALUE X-NDS_NAME 'Generational Qualifier' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '8' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.171 NAME 'profileMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Profile Membership' X-NDS_NAME_VALUE_ACCESS '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.172 NAME 'dsRevision' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'DS Revision' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_OPERATIONAL '1' )", + "( 2.16.840.1.113719.1.1.4.1.173 NAME 'supportedGateway' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{4096} X-NDS_NAME 'Supported Gateway' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '4096' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.174 NAME 'equivalentToMe' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Equivalent To Me' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.16.840.1.113719.1.1.4.1.175 NAME 'replicaUpTo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Replica Up To' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.176 NAME 'partitionStatus' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Partition Status' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.177 NAME 'permanentConfigParms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'Permanent Config Parms' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.178 NAME 'Timezone' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.179 NAME 'binderyRestrictionLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Bindery Restriction Level' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.180 NAME 'transitiveVector' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Transitive Vector' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_SCHED_SYNC_NEVER '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.181 NAME 'T' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.183 NAME 'purgeVector' SYNTAX 2.16.840.1.113719.1.1.5.1.19 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Purge Vector' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_SCHED_SYNC_NEVER '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.184 NAME 'synchronizationTolerance' SYNTAX 2.16.840.1.113719.1.1.5.1.19 USAGE directoryOperation X-NDS_NAME 'Synchronization Tolerance' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.185 NAME 'passwordManagement' SYNTAX 2.16.840.1.113719.1.1.5.1.0 SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'Password Management' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.186 NAME 'usedBy' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Used By' X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.187 NAME 'Uses' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_SERVER_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.500 NAME 'obituaryNotify' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Obituary Notify' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.501 NAME 'GUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{16} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_LOWER_BOUND '16' X-NDS_UPPER_BOUND '16' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.502 NAME 'otherGUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{16} USAGE directoryOperation X-NDS_NAME 'Other GUID' X-NDS_LOWER_BOUND '16' X-NDS_UPPER_BOUND '16' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.503 NAME 'auxiliaryClassFlag' SYNTAX 2.16.840.1.113719.1.1.5.1.0 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Auxiliary Class Flag' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.504 NAME 'unknownAuxiliaryClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} USAGE directoryOperation X-NDS_NAME 'Unknown Auxiliary Class' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userId' ) SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} X-NDS_NAME 'uniqueID' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 0.9.2342.19200300.100.1.25 NAME 'dc' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} X-NDS_NAME 'dc' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '64' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.507 NAME 'auxClassObjectClassBackup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'AuxClass Object Class Backup' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.508 NAME 'localReceivedUpTo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NAME 'Local Received Up To' X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.4 NAME 'federationControl' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.2 NAME 'federationSearchPath' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.3 NAME 'federationDNSName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.141.4.1 NAME 'federationBoundaryType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.14.4.1.4 NAME 'DirXML-Associations' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' )", + "( 2.5.18.3 NAME 'creatorsName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.5.18.4 NAME 'modifiersName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_FILTERED_REQUIRED '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.300 NAME 'languageId' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.35 NAME 'ndsPredicate' SYNTAX 2.16.840.1.113719.1.1.5.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.36 NAME 'ndsPredicateState' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.37 NAME 'ndsPredicateFlush' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.38 NAME 'ndsPredicateTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_UPPER_BOUND '2147483647' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.40 NAME 'ndsPredicateStatsDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.4.39 NAME 'ndsPredicateUseValues' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.601 NAME 'syncPanePoint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.600 NAME 'syncWindowVector' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.602 NAME 'objectVersion' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.27.4.52 NAME 'memberQueryURL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'memberQuery' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.302 NAME 'excludedMember' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.1.525 NAME 'auxClassCompatibility' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.518 NAME 'ndsAgentPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.519 NAME 'ndsOperationCheckpoint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.520 NAME 'localReferral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.521 NAME 'treeReferral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.522 NAME 'schemaResetLock' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.523 NAME 'modifiedACLEntry' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.524 NAME 'monitoredConnection' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.526 NAME 'localFederationBoundary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.527 NAME 'replicationFilter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.721 NAME 'ServerEBAEnabled' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.716 NAME 'EBATreeConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.722 NAME 'EBAPartitionConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.723 NAME 'EBAServerConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.1.4.1.296 NAME 'loginActivationTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.687 NAME 'UpdateInProgress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.720 NAME 'dsContainerReadyAttrs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.4.400.1 NAME 'edirSchemaFlagVersion' SYNTAX 2.16.840.1.113719.1.1.5.1.0 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NONREMOVABLE '1' X-NDS_HIDDEN '1' X-NDS_READ_FILTERED '1' )", + "( 2.16.840.1.113719.1.1.4.1.512 NAME 'indexDefinition' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.513 NAME 'ndsStatusRepair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.514 NAME 'ndsStatusExternalReference' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.515 NAME 'ndsStatusObituary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.516 NAME 'ndsStatusSchema' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.517 NAME 'ndsStatusLimber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.511 NAME 'authoritative' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113730.3.1.34 NAME 'ref' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.546 NAME 'CachedAttrsOnExtRefs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.1.4.1.547 NAME 'ExtRefLastUpdatedTime' SYNTAX 2.16.840.1.113719.1.1.5.1.19 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-NDS_PUBLIC_READ '1' X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.688 NAME 'NCPKeyMaterialName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.1.4.713 NAME 'UTF8LoginScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.714 NAME 'loginScriptCharset' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.721 NAME 'NDSRightsToMonitor' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NEVER_SYNC '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.1.192 NAME 'lDAPLogLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_NAME 'LDAP Log Level' X-NDS_UPPER_BOUND '32768' )", + "( 2.16.840.1.113719.1.27.4.12 NAME 'lDAPUDPPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{65535} SINGLE-VALUE X-NDS_NAME 'LDAP UDP Port' X-NDS_UPPER_BOUND '65535' )", + "( 2.16.840.1.113719.1.1.4.1.204 NAME 'lDAPLogFilename' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Log Filename' )", + "( 2.16.840.1.113719.1.1.4.1.205 NAME 'lDAPBackupLogFilename' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Backup Log Filename' )", + "( 2.16.840.1.113719.1.1.4.1.206 NAME 'lDAPLogSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'LDAP Log Size Limit' X-NDS_LOWER_BOUND '2048' X-NDS_UPPER_BOUND '-1' )", + "( 2.16.840.1.113719.1.1.4.1.194 NAME 'lDAPSearchSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_NAME 'LDAP Search Size Limit' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.1.4.1.195 NAME 'lDAPSearchTimeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_NAME 'LDAP Search Time Limit' X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.1.4.1.207 NAME 'lDAPSuffix' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'LDAP Suffix' )", + "( 2.16.840.1.113719.1.27.4.70 NAME 'ldapConfigVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.14 NAME 'ldapReferral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Referral' )", + "( 2.16.840.1.113719.1.27.4.73 NAME 'ldapDefaultReferralBehavior' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.23 NAME 'ldapSearchReferralUsage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'LDAP:searchReferralUsage' )", + "( 2.16.840.1.113719.1.27.4.24 NAME 'lDAPOtherReferralUsage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'LDAP:otherReferralUsage' )", + "( 2.16.840.1.113719.1.27.4.1 NAME 'ldapHostServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'LDAP Host Server' )", + "( 2.16.840.1.113719.1.27.4.2 NAME 'ldapGroupDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'LDAP Group' )", + "( 2.16.840.1.113719.1.27.4.3 NAME 'ldapTraceLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_NAME 'LDAP Screen Level' X-NDS_UPPER_BOUND '32768' )", + "( 2.16.840.1.113719.1.27.4.4 NAME 'searchSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.27.4.5 NAME 'searchTimeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{2147483647} SINGLE-VALUE X-NDS_UPPER_BOUND '2147483647' )", + "( 2.16.840.1.113719.1.27.4.6 NAME 'ldapServerBindLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'LDAP Server Bind Limit' X-NDS_UPPER_BOUND '-1' )", + "( 2.16.840.1.113719.1.27.4.7 NAME 'ldapServerIdleTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{4294967295} SINGLE-VALUE X-NDS_NAME 'LDAP Server Idle Timeout' X-NDS_UPPER_BOUND '-1' )", + "( 2.16.840.1.113719.1.27.4.8 NAME 'ldapEnableTCP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'LDAP Enable TCP' )", + "( 2.16.840.1.113719.1.27.4.10 NAME 'ldapEnableSSL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'LDAP Enable SSL' )", + "( 2.16.840.1.113719.1.27.4.11 NAME 'ldapTCPPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{65535} SINGLE-VALUE X-NDS_NAME 'LDAP TCP Port' X-NDS_UPPER_BOUND '65535' )", + "( 2.16.840.1.113719.1.27.4.13 NAME 'ldapSSLPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{65535} SINGLE-VALUE X-NDS_NAME 'LDAP SSL Port' X-NDS_UPPER_BOUND '65535' )", + "( 2.16.840.1.113719.1.27.4.21 NAME 'filteredReplicaUsage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.22 NAME 'ldapKeyMaterialName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'LDAP:keyMaterialName' )", + "( 2.16.840.1.113719.1.27.4.42 NAME 'extensionInfo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.27.4.45 NAME 'nonStdClientSchemaCompatMode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.46 NAME 'sslEnableMutualAuthentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.62 NAME 'ldapEnablePSearch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.63 NAME 'ldapMaximumPSearchOperations' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.64 NAME 'ldapIgnorePSearchLimitsForEvents' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.65 NAME 'ldapTLSTrustedRootContainer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.27.4.66 NAME 'ldapEnableMonitorEvents' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.67 NAME 'ldapMaximumMonitorEventsLoad' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.68 NAME 'ldapTLSRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.69 NAME 'ldapTLSVerifyClientCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.71 NAME 'ldapDerefAlias' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.72 NAME 'ldapNonStdAllUserAttrsMode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.75 NAME 'ldapBindRestrictions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.79 NAME 'ldapInterfaces' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.27.4.80 NAME 'ldapChainSecureRequired' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.82 NAME 'ldapStdCompliance' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.83 NAME 'ldapDerefAliasOnAuth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.84 NAME 'ldapGeneralizedTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.85 NAME 'ldapPermissiveModify' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.86 NAME 'ldapSSLConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.27.4.15 NAME 'ldapServerList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'LDAP Server List' )", + "( 2.16.840.1.113719.1.27.4.16 NAME 'ldapAttributeMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Attribute Map v11' )", + "( 2.16.840.1.113719.1.27.4.17 NAME 'ldapClassMap' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'LDAP Class Map v11' )", + "( 2.16.840.1.113719.1.27.4.18 NAME 'ldapAllowClearTextPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'LDAP Allow Clear Text Password' )", + "( 2.16.840.1.113719.1.27.4.19 NAME 'ldapAnonymousIdentity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'LDAP Anonymous Identity' )", + "( 2.16.840.1.113719.1.27.4.52 NAME 'ldapAttributeList' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} )", + "( 2.16.840.1.113719.1.27.4.53 NAME 'ldapClassList' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} )", + "( 2.16.840.1.113719.1.27.4.56 NAME 'transitionGroupDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.74 NAME 'ldapTransitionBackLink' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.78 NAME 'ldapLBURPNumWriterThreads' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.27.4.20 NAME 'ldapServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'LDAP Server' )", + "( 0.9.2342.19200300.100.1.3 NAME 'mail' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NAME 'Internet EMail Address' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113730.3.1.3 NAME 'employeeNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NAME 'NSCP:employeeNumber' )", + "( 2.16.840.1.113719.1.27.4.76 NAME 'referralExcludeFilter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.27.4.77 NAME 'referralIncludeFilter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.5.4.36 NAME 'userCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'userCertificate' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.37 NAME 'cACertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'cACertificate' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.40 NAME 'crossCertificatePair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'crossCertificatePair' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.58 NAME 'attributeCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.2 NAME 'knowledgeInformation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32768' )", + "( 2.5.4.14 NAME 'searchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.25{64512} X-NDS_NAME 'searchGuide' )", + "( 2.5.4.15 NAME 'businessCategory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' )", + "( 2.5.4.21 NAME 'telexNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.52{64512} X-NDS_NAME 'telexNumber' )", + "( 2.5.4.22 NAME 'teletexTerminalIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.51{64512} X-NDS_NAME 'teletexTerminalIdentifier' )", + "( 2.5.4.24 NAME 'x121Address' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{15} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '15' )", + "( 2.5.4.25 NAME 'internationaliSDNNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '16' )", + "( 2.5.4.26 NAME 'registeredAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41{64512} X-NDS_NAME 'registeredAddress' )", + "( 2.5.4.27 NAME 'destinationIndicator' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '128' )", + "( 2.5.4.28 NAME 'preferredDeliveryMethod' SYNTAX 1.3.6.1.4.1.1466.115.121.1.14{64512} SINGLE-VALUE X-NDS_NAME 'preferredDeliveryMethod' )", + "( 2.5.4.29 NAME 'presentationAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.43{64512} SINGLE-VALUE X-NDS_NAME 'presentationAddress' )", + "( 2.5.4.30 NAME 'supportedApplicationContext' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38{64512} X-NDS_NAME 'supportedApplicationContext' )", + "( 2.5.4.45 NAME 'x500UniqueIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.6{64512} X-NDS_NAME 'x500UniqueIdentifier' )", + "( 2.5.4.46 NAME 'dnQualifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64512} )", + "( 2.5.4.47 NAME 'enhancedSearchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.21{64512} X-NDS_NAME 'enhancedSearchGuide' )", + "( 2.5.4.48 NAME 'protocolInformation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.42{64512} X-NDS_NAME 'protocolInformation' )", + "( 2.5.4.51 NAME 'houseIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32768' )", + "( 2.5.4.52 NAME 'supportedAlgorithms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.49{64512} X-NDS_NAME 'supportedAlgorithms' )", + "( 2.5.4.54 NAME 'dmdName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '32768' )", + "( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.38 NAME 'associatedName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.5.4.49 NAME 'dn' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.1 NAME 'httpServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.3.4.2 NAME 'httpHostServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.3 NAME 'httpThreadsPerCPU' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.4 NAME 'httpIOBufferSize' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.5 NAME 'httpRequestTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.6 NAME 'httpKeepAliveRequestTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.7 NAME 'httpSessionTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.8 NAME 'httpKeyMaterialObject' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.9 NAME 'httpTraceLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.10 NAME 'httpAuthRequiresTLS' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.11 NAME 'httpDefaultClearPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.12 NAME 'httpDefaultTLSPort' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.3.4.13 NAME 'httpBindRestrictions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.295 NAME 'emboxConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.54.4.1.1 NAME 'trusteesOfNewObject' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NAME 'Trustees Of New Object' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.55.4.1.1 NAME 'newObjectSDSRights' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NAME 'New Object's DS Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.56.4.1.1 NAME 'newObjectSFSRights' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'New Object's FS Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.57.4.1.1 NAME 'setupScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'Setup Script' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.58.4.1.1 NAME 'runSetupScript' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Run Setup Script' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.59.4.1.1 NAME 'membersOfTemplate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Members Of Template' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.60.4.1.1 NAME 'volumeSpaceRestrictions' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'Volume Space Restrictions' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.61.4.1.1 NAME 'setPasswordAfterCreate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'Set Password After Create' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.62.4.1.1 NAME 'homeDirectoryRights' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_NAME 'Home Directory Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.63.4.1.1 NAME 'newObjectSSelfRights' SYNTAX 2.16.840.1.113719.1.1.5.1.17 X-NDS_NAME 'New Object's Self Rights' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.8.4.1 NAME 'digitalMeID' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.8.4.2 NAME 'assistant' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.8.4.3 NAME 'assistantPhone' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.4 NAME 'city' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.5 NAME 'company' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.43 NAME 'co' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.6 NAME 'directReports' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.10 NAME 'manager' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.8.4.7 NAME 'mailstop' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.41 NAME 'mobile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 0.9.2342.19200300.100.1.40 NAME 'personalTitle' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.42 NAME 'pager' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.8 NAME 'workforceID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.9 NAME 'instantMessagingID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.10 NAME 'preferredName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.7 NAME 'photo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.8.4.11 NAME 'jobCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.12 NAME 'siteLocation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.13 NAME 'employeeStatus' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113730.3.1.4 NAME 'employeeType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.14 NAME 'costCenter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.15 NAME 'costCenterDescription' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.16 NAME 'tollFreePhoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.17 NAME 'otherPhoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.18 NAME 'managerWorkforceID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.19 NAME 'jackNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113730.3.1.2 NAME 'departmentNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.20 NAME 'vehicleInformation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.21 NAME 'accessCardNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.32 NAME 'isManager' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.8.4.22 NAME 'homeCity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.23 NAME 'homeEmailAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 1.3.6.1.4.1.1466.101.120.31 NAME 'homeFax' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 0.9.2342.19200300.100.1.20 NAME 'homePhone' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.24 NAME 'homeState' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41{64512} )", + "( 2.16.840.1.113719.1.8.4.25 NAME 'homeZipCode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.26 NAME 'personalMobile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.8.4.27 NAME 'children' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.28 NAME 'spouse' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.29 NAME 'vendorName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.30 NAME 'vendorAddress' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.8.4.31 NAME 'vendorPhoneNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{64512} )", + "( 2.16.840.1.113719.1.1.4.1.303 NAME 'dgIdentity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME_VALUE_ACCESS '1' )", + "( 2.16.840.1.113719.1.1.4.1.304 NAME 'dgTimeOut' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.305 NAME 'dgAllowUnknown' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.306 NAME 'dgAllowDuplicates' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.546 NAME 'allowAliasToAncestor' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.39.4.1.1 NAME 'sASSecurityDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Security DN' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.4.1.2 NAME 'sASServiceDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Service DN' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.4.1.3 NAME 'sASSecretStore' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'SAS:SecretStore' )", + "( 2.16.840.1.113719.1.39.4.1.4 NAME 'sASSecretStoreKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_NAME 'SAS:SecretStore:Key' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.4.1.5 NAME 'sASSecretStoreData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'SAS:SecretStore:Data' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.4.1.6 NAME 'sASPKIStoreKeys' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'SAS:PKIStore:Keys' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.48.4.1.1 NAME 'nDSPKIPublicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Public Key' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.2 NAME 'nDSPKIPrivateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Private Key' )", + "( 2.16.840.1.113719.1.48.4.1.3 NAME 'nDSPKIPublicKeyCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Public Key Certificate' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.4 NAME 'nDSPKICertificateChain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'NDSPKI:Certificate Chain' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.16 NAME 'nDSPKIPublicKeyEC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Public Key EC' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.17 NAME 'nDSPKIPrivateKeyEC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Private Key EC' )", + "( 2.16.840.1.113719.1.48.4.1.18 NAME 'nDSPKIPublicKeyCertificateEC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Public Key Certificate EC' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.19 NAME 'crossCertificatePairEC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'Cross Certificate Pair EC' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.20 NAME 'nDSPKICertificateChainEC' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'NDSPKI:Certificate Chain EC' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.5 NAME 'nDSPKIParentCA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Parent CA' )", + "( 2.16.840.1.113719.1.48.4.1.6 NAME 'nDSPKIParentCADN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'NDSPKI:Parent CA DN' )", + "( 2.16.840.1.113719.1.48.4.1.20 NAME 'nDSPKISuiteBMode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'NDSPKI:SuiteBMode' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.7 NAME 'nDSPKIKeyFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Key File' )", + "( 2.16.840.1.113719.1.48.4.1.8 NAME 'nDSPKISubjectName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Subject Name' )", + "( 2.16.840.1.113719.1.48.4.1.11 NAME 'nDSPKIGivenName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Given Name' )", + "( 2.16.840.1.113719.1.48.4.1.9 NAME 'nDSPKIKeyMaterialDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'NDSPKI:Key Material DN' )", + "( 2.16.840.1.113719.1.48.4.1.10 NAME 'nDSPKITreeCADN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'NDSPKI:Tree CA DN' )", + "( 2.5.4.59 NAME 'cAECCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.12 NAME 'nDSPKIUserCertificateInfo' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'NDSPKI:userCertificateInfo' )", + "( 2.16.840.1.113719.1.48.4.1.13 NAME 'nDSPKITrustedRootCertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Trusted Root Certificate' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.14 NAME 'nDSPKINotBefore' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Not Before' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.15 NAME 'nDSPKINotAfter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:Not After' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.101 NAME 'nDSPKISDKeyServerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'NDSPKI:SD Key Server DN' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.102 NAME 'nDSPKISDKeyStruct' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'NDSPKI:SD Key Struct' )", + "( 2.16.840.1.113719.1.48.4.1.103 NAME 'nDSPKISDKeyCert' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:SD Key Cert' )", + "( 2.16.840.1.113719.1.48.4.1.104 NAME 'nDSPKISDKeyID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'NDSPKI:SD Key ID' )", + "( 2.16.840.1.113719.1.39.4.1.105 NAME 'nDSPKIKeystore' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_NAME 'NDSPKI:Keystore' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.4.1.106 NAME 'ndspkiAdditionalRoots' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.3 NAME 'masvLabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.4 NAME 'masvProposedLabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.5 NAME 'masvDefaultRange' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.6 NAME 'masvAuthorizedRange' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.2.7 NAME 'masvDomainPolicy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.8 NAME 'masvClearanceNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.9 NAME 'masvLabelNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.10 NAME 'masvLabelSecrecyLevelNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.11 NAME 'masvLabelSecrecyCategoryNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.12 NAME 'masvLabelIntegrityLevelNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.13 NAME 'masvLabelIntegrityCategoryNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.14 NAME 'masvPolicyUpdate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.31.4.1.16 NAME 'masvNDSAttributeLabels' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.31.4.1.15 NAME 'masvPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.2 NAME 'sASLoginSequence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_NAME 'SAS:Login Sequence' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.8 NAME 'sASLoginPolicyUpdate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:Login Policy Update' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.38 NAME 'sasNMASProductOptions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.74 NAME 'sasAuditConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.14 NAME 'sASNDSPasswordWindow' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:NDS Password Window' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.15 NAME 'sASPolicyCredentials' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Policy Credentials' X-NDS_SERVER_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.16 NAME 'sASPolicyMethods' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Methods' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.17 NAME 'sASPolicyObjectVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:Policy Object Version' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.18 NAME 'sASPolicyServiceSubtypes' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Service Subtypes' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.19 NAME 'sASPolicyServices' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Services' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.20 NAME 'sASPolicyUsers' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'SAS:Policy Users' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.21 NAME 'sASAllowNDSPasswordWindow' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'SAS:Allow NDS Password Window' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.9 NAME 'sASMethodIdentifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Method Identifier' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.10 NAME 'sASMethodVendor' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Method Vendor' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.11 NAME 'sASAdvisoryMethodGrade' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Advisory Method Grade' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.12 NAME 'sASVendorSupport' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'SAS:Vendor Support' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.13 NAME 'sasCertificateSearchContainers' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.70 NAME 'sasNMASMethodConfigData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.22 NAME 'sASLoginClientMethodNetWare' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Client Method NetWare' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.23 NAME 'sASLoginServerMethodNetWare' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Server Method NetWare' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.24 NAME 'sASLoginClientMethodWINNT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Client Method WINNT' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.25 NAME 'sASLoginServerMethodWINNT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NAME 'SAS:Login Server Method WINNT' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.26 NAME 'sasLoginClientMethodSolaris' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.27 NAME 'sasLoginServerMethodSolaris' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.28 NAME 'sasLoginClientMethodLinux' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.29 NAME 'sasLoginServerMethodLinux' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.30 NAME 'sasLoginClientMethodTru64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.31 NAME 'sasLoginServerMethodTru64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.32 NAME 'sasLoginClientMethodAIX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.33 NAME 'sasLoginServerMethodAIX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.34 NAME 'sasLoginClientMethodHPUX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.35 NAME 'sasLoginServerMethodHPUX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1000 NAME 'sasLoginClientMethods390' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1001 NAME 'sasLoginServerMethods390' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1002 NAME 'sasLoginClientMethodLinuxX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1003 NAME 'sasLoginServerMethodLinuxX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1004 NAME 'sasLoginClientMethodWinX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1005 NAME 'sasLoginServerMethodWinX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1006 NAME 'sasLoginClientMethodSolaris64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1007 NAME 'sasLoginServerMethodSolaris64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1008 NAME 'sasLoginClientMethodAIX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1009 NAME 'sasLoginServerMethodAIX64' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1011 NAME 'sasLoginServerMethodSolarisi386' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1012 NAME 'sasLoginClientMethodSolarisi386' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.78 NAME 'sasUnsignedMethodModules' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.79 NAME 'sasServerModuleName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.80 NAME 'sasServerModuleEntryPointName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.81 NAME 'sasSASLMechanismName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.82 NAME 'sasSASLMechanismEntryPointName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.83 NAME 'sasClientModuleName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.84 NAME 'sasClientModuleEntryPointName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.36 NAME 'sASLoginMethodContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Login Method Container DN' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.37 NAME 'sASLoginPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'SAS:Login Policy DN' X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.63 NAME 'sasPostLoginMethodContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.38 NAME 'rADIUSActiveConnections' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Active Connections' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.39 NAME 'rADIUSAgedInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Aged Interval' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.40 NAME 'rADIUSAttributeList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Attribute List' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.41 NAME 'rADIUSAttributeLists' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Attribute Lists' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.42 NAME 'rADIUSClient' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Client' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.43 NAME 'rADIUSCommonNameResolution' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Common Name Resolution' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.44 NAME 'rADIUSConcurrentLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Concurrent Limit' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.45 NAME 'rADIUSConnectionHistory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Connection History' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.46 NAME 'rADIUSDASVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:DAS Version' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.47 NAME 'rADIUSDefaultProfile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Default Profile' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.48 NAME 'rADIUSDialAccessGroup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'RADIUS:Dial Access Group' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.49 NAME 'rADIUSEnableCommonNameLogin' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'RADIUS:Enable Common Name Login' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.50 NAME 'rADIUSEnableDialAccess' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NAME 'RADIUS:Enable Dial Access' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.51 NAME 'rADIUSInterimAcctingTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Interim Accting Timeout' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.52 NAME 'rADIUSLookupContexts' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'RADIUS:Lookup Contexts' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.53 NAME 'rADIUSMaxDASHistoryRecord' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Max DAS History Record' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.54 NAME 'rADIUSMaximumHistoryRecord' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Maximum History Record' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.55 NAME 'rADIUSPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Password' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.56 NAME 'rADIUSPasswordPolicy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'RADIUS:Password Policy' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.57 NAME 'rADIUSPrivateKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Private Key' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.58 NAME 'rADIUSProxyContext' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'RADIUS:Proxy Context' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.59 NAME 'rADIUSProxyDomain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Proxy Domain' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.60 NAME 'rADIUSProxyTarget' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'RADIUS:Proxy Target' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.61 NAME 'rADIUSPublicKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'RADIUS:Public Key' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.62 NAME 'rADIUSServiceList' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_NAME 'RADIUS:Service List' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.3 NAME 'sASLoginSecret' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Secret' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.4 NAME 'sASLoginSecretKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Secret Key' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.5 NAME 'sASEncryptionType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'SAS:Encryption Type' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.6 NAME 'sASLoginConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Configuration' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.7 NAME 'sASLoginConfigurationKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'SAS:Login Configuration Key' X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.73 NAME 'sasDefaultLoginSequence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.64 NAME 'sasAuthorizedLoginSequences' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.69 NAME 'sasAllowableSubjectNames' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.71 NAME 'sasLoginFailureDelay' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.72 NAME 'sasMethodVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1010 NAME 'sasUpdateLoginInfo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1011 NAME 'sasOTPEnabled' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1012 NAME 'sasOTPCounter' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1013 NAME 'sasOTPLookAheadWindow' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1014 NAME 'sasOTPDigits' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1015 NAME 'sasOTPReSync' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.39.42.1.0.1016 NAME 'sasUpdateLoginTimeInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.6.4.1 NAME 'snmpGroupDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.2 NAME 'snmpServerList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.6.4.3 NAME 'snmpTrapConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.4 NAME 'snmpTrapDescription' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.5 NAME 'snmpTrapInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.6.4.6 NAME 'snmpTrapDisable' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.528 NAME 'ndapPartitionPasswordMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.529 NAME 'ndapClassPasswordMgmt' SYNTAX 2.16.840.1.113719.1.1.5.1.0 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.530 NAME 'ndapPasswordMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.537 NAME 'ndapPartitionLoginMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.538 NAME 'ndapClassLoginMgmt' SYNTAX 2.16.840.1.113719.1.1.5.1.0 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.539 NAME 'ndapLoginMgmt' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.1 NAME 'nspmPasswordKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.2 NAME 'nspmPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.3 NAME 'nspmDistributionPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.4 NAME 'nspmPasswordHistory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.5 NAME 'nspmAdministratorChangeCount' SYNTAX 2.16.840.1.113719.1.1.5.1.22 SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.6 NAME 'nspmPasswordPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.7 NAME 'nspmPreviousDistributionPassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.39.43.4.8 NAME 'nspmDoNotExpirePassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.42.2.27.8.1.16 NAME 'pwdChangedTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.17 NAME 'pwdAccountLockedTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.19 NAME 'pwdFailureTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.16.840.1.113719.1.39.43.4.100 NAME 'nspmConfigurationOptions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.102 NAME 'nspmChangePasswordMessage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.103 NAME 'nspmPasswordHistoryLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.104 NAME 'nspmPasswordHistoryExpiration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 1.3.6.1.4.1.42.2.27.8.1.4 NAME 'pwdInHistory' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.105 NAME 'nspmMinPasswordLifetime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.106 NAME 'nspmAdminsDoNotExpirePassword' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.107 NAME 'nspmPasswordACL' SYNTAX 2.16.840.1.113719.1.1.5.1.17 )", + "( 2.16.840.1.113719.1.39.43.4.200 NAME 'nspmMaximumLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.201 NAME 'nspmMinUpperCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.202 NAME 'nspmMaxUpperCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.203 NAME 'nspmMinLowerCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.204 NAME 'nspmMaxLowerCaseCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.205 NAME 'nspmNumericCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.206 NAME 'nspmNumericAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.207 NAME 'nspmNumericAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.208 NAME 'nspmMinNumericCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.209 NAME 'nspmMaxNumericCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.210 NAME 'nspmSpecialCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.211 NAME 'nspmSpecialAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.212 NAME 'nspmSpecialAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.213 NAME 'nspmMinSpecialCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.214 NAME 'nspmMaxSpecialCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.215 NAME 'nspmMaxRepeatedCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.216 NAME 'nspmMaxConsecutiveCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.217 NAME 'nspmMinUniqueCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.218 NAME 'nspmDisallowedAttributeValues' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.219 NAME 'nspmExcludeList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.220 NAME 'nspmCaseSensitive' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.221 NAME 'nspmPolicyPrecedence' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.222 NAME 'nspmExtendedCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.223 NAME 'nspmExtendedAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.224 NAME 'nspmExtendedAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.225 NAME 'nspmMinExtendedCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.226 NAME 'nspmMaxExtendedCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.227 NAME 'nspmUpperAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.228 NAME 'nspmUpperAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.229 NAME 'nspmLowerAsFirstCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.230 NAME 'nspmLowerAsLastCharacter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.231 NAME 'nspmComplexityRules' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.233 NAME 'nspmAD2K8Syntax' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.234 NAME 'nspmAD2K8maxViolation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.235 NAME 'nspmXCharLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.236 NAME 'nspmXCharHistoryLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.237 NAME 'nspmUnicodeAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.238 NAME 'nspmNonAlphaCharactersAllowed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.239 NAME 'nspmMinNonAlphaCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.240 NAME 'nspmMaxNonAlphaCharacters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.241 NAME 'nspmGraceLoginHistoryLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.300 NAME 'nspmPolicyAgentContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.301 NAME 'nspmPolicyAgentNetWare' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.302 NAME 'nspmPolicyAgentWINNT' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.303 NAME 'nspmPolicyAgentSolaris' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.304 NAME 'nspmPolicyAgentLinux' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.305 NAME 'nspmPolicyAgentAIX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.43.4.306 NAME 'nspmPolicyAgentHPUX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 0.9.2342.19200300.100.1.55 NAME 'audio' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113730.3.1.1 NAME 'carLicense' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113730.3.1.241 NAME 'displayName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.60 NAME 'jpegPhoto' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 1.3.6.1.4.1.250.1.57 NAME 'labeledUri' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 0.9.2342.19200300.100.1.7 NAME 'ldapPhoto' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113730.3.1.39 NAME 'preferredLanguage' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.21 NAME 'secretary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113730.3.1.40 NAME 'userSMIMECertificate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.12.4.1.0 NAME 'auditAEncryptionKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:A Encryption Key' )", + "( 2.16.840.1.113719.1.12.4.2.0 NAME 'auditBEncryptionKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:B Encryption Key' )", + "( 2.16.840.1.113719.1.12.4.3.0 NAME 'auditContents' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Audit:Contents' )", + "( 2.16.840.1.113719.1.12.4.4.0 NAME 'auditType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'Audit:Type' )", + "( 2.16.840.1.113719.1.12.4.5.0 NAME 'auditCurrentEncryptionKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:Current Encryption Key' )", + "( 2.16.840.1.113719.1.12.4.6.0 NAME 'auditFileLink' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'Audit:File Link' )", + "( 2.16.840.1.113719.1.12.4.7.0 NAME 'auditLinkList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NAME 'Audit:Link List' )", + "( 2.16.840.1.113719.1.12.4.8.0 NAME 'auditPath' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NAME 'Audit:Path' )", + "( 2.16.840.1.113719.1.12.4.9.0 NAME 'auditPolicy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_NAME 'Audit:Policy' )", + "( 2.16.840.1.113719.1.38.4.1.1 NAME 'wANMANWANPolicy' SYNTAX 2.16.840.1.113719.1.1.5.1.13{64512} X-NDS_NAME 'WANMAN:WAN Policy' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.38.4.1.2 NAME 'wANMANLANAreaMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NAME 'WANMAN:LAN Area Membership' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.38.4.1.3 NAME 'wANMANCost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_NAME 'WANMAN:Cost' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.38.4.1.4 NAME 'wANMANDefaultCost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NAME 'WANMAN:Default Cost' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.135.4.30 NAME 'rbsAssignedRoles' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.31 NAME 'rbsContent' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.32 NAME 'rbsContentMembership' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.33 NAME 'rbsEntryPoint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.34 NAME 'rbsMember' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.35 NAME 'rbsOwnedCollections' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.135.4.36 NAME 'rbsPath' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.37 NAME 'rbsParameters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} )", + "( 2.16.840.1.113719.1.135.4.38 NAME 'rbsTaskRights' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.135.4.39 NAME 'rbsTrusteeOf' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.40 NAME 'rbsType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} SINGLE-VALUE X-NDS_LOWER_BOUND '1' X-NDS_UPPER_BOUND '256' )", + "( 2.16.840.1.113719.1.135.4.41 NAME 'rbsURL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.42 NAME 'rbsTaskTemplates' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.135.4.43 NAME 'rbsTaskTemplatesURL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.44 NAME 'rbsGALabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.45 NAME 'rbsPageMembership' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} )", + "( 2.16.840.1.113719.1.135.4.46 NAME 'rbsTargetObjectType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.135.4.47 NAME 'rbsContext' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.48 NAME 'rbsXMLInfo' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.135.4.51 NAME 'rbsAssignedRoles2' SYNTAX 2.16.840.1.113719.1.1.5.1.25 )", + "( 2.16.840.1.113719.1.135.4.52 NAME 'rbsOwnedCollections2' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.1.4.1.540 NAME 'prSyncPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.1.4.1.541 NAME 'prSyncAttributes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_SERVER_READ '1' )", + "( 2.16.840.1.113719.1.1.4.1.542 NAME 'dsEncryptedReplicationConfig' SYNTAX 2.16.840.1.113719.1.1.5.1.19 )", + "( 2.16.840.1.113719.1.1.4.1.543 NAME 'encryptionPolicyDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.544 NAME 'attrEncryptionRequiresSecure' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.545 NAME 'attrEncryptionDefinition' SYNTAX 2.16.840.1.113719.1.1.5.1.6{64512} X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.48.4.1.16 NAME 'ndspkiCRLFileName' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.17 NAME 'ndspkiStatus' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.18 NAME 'ndspkiIssueTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.19 NAME 'ndspkiNextIssueTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.20 NAME 'ndspkiAttemptTime' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.21 NAME 'ndspkiTimeInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.22 NAME 'ndspkiCRLMaxProcessingInterval' SYNTAX 2.16.840.1.113719.1.1.5.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.23 NAME 'ndspkiCRLNumber' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.24 NAME 'ndspkiDistributionPoints' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.25 NAME 'ndspkiCRLProcessData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.26 NAME 'ndspkiCRLConfigurationDNList' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.27 NAME 'ndspkiCADN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.28 NAME 'ndspkiCRLContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.29 NAME 'ndspkiIssuedCertContainerDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.30 NAME 'ndspkiDistributionPointDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.31 NAME 'ndspkiCRLConfigurationDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.32 NAME 'ndspkiDirectory' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} )", + "( 2.5.4.38 NAME 'authorityRevocationList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-NDS_NAME 'ndspkiAuthorityRevocationList' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.39 NAME 'certificateRevocationList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-NDS_NAME 'ndspkiCertificateRevocationList' X-NDS_PUBLIC_READ '1' )", + "( 2.5.4.53 NAME 'deltaRevocationList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-NDS_NAME 'ndspkiDeltaRevocationList' X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.36 NAME 'ndspkiTrustedRootList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.37 NAME 'ndspkiSecurityRightsLevel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.48.4.1.38 NAME 'ndspkiKMOExport' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.48.4.1.39 NAME 'ndspkiCRLECConfigurationDNList' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.40 NAME 'ndspkiCRLType' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.41 NAME 'ndspkiCRLExtendValidity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.42 NAME 'ndspkiDefaultRSAKeySize' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.43 NAME 'ndspkiDefaultECCurve' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.48.4.1.44 NAME 'ndspkiDefaultCertificateLife' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.7.4.1 NAME 'notfSMTPEmailHost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.2 NAME 'notfSMTPEmailFrom' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.3 NAME 'notfSMTPEmailUserName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.5 NAME 'notfMergeTemplateData' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.7.4.6 NAME 'notfMergeTemplateSubject' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.1 NAME 'nsimRequiredQuestions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.2 NAME 'nsimRandomQuestions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.3 NAME 'nsimNumberRandomQuestions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.4 NAME 'nsimMinResponseLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.5 NAME 'nsimMaxResponseLength' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.6 NAME 'nsimForgottenLoginConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.7 NAME 'nsimForgottenAction' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.8 NAME 'nsimAssignments' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.9 NAME 'nsimChallengeSetDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.10 NAME 'nsimChallengeSetGUID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.11 NAME 'nsimPwdRuleEnforcement' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.39.44.4.12 NAME 'nsimHint' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.39.44.4.13 NAME 'nsimPasswordReminder' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.4 NAME 'sssProxyStoreKey' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.266.4.5 NAME 'sssProxyStoreSecrets' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} USAGE directoryOperation X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.266.4.6 NAME 'sssActiveServerList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.266.4.7 NAME 'sssCacheRefreshInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.8 NAME 'sssAdminList' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.266.4.9 NAME 'sssAdminGALabel' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.10 NAME 'sssEnableReadTimestamps' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.11 NAME 'sssDisableMasterPasswords' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.12 NAME 'sssEnableAdminAccess' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.266.4.13 NAME 'sssReadSecretPolicies' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} )", + "( 2.16.840.1.113719.1.266.4.14 NAME 'sssServerPolicyOverrideDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.1.531 NAME 'eDirCloneSource' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.1.532 NAME 'eDirCloneKeys' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64512} NO-USER-MODIFICATION USAGE directoryOperation X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' X-NDS_HIDDEN '1' )", + "( 2.16.840.1.113719.1.1.4.1.533 NAME 'eDirCloneLock' SYNTAX 2.16.840.1.113719.1.1.5.1.15{64512} SINGLE-VALUE X-NDS_NOT_SCHED_SYNC_IMMEDIATE '1' )", + "( 2.16.840.1.113719.1.1.4.711 NAME 'groupMember' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.16.840.1.113719.1.1.4.712 NAME 'nestedConfig' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.16.840.1.113719.1.1.4.717 NAME 'xdasDSConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.1.4.718 NAME 'xdasConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.1.4.719 NAME 'xdasVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_UPPER_BOUND '32768' )", + "( 2.16.840.1.113719.1.347.4.79 NAME 'NAuditInstrumentation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.347.4.2 NAME 'NAuditLoggingServer' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_PUBLIC_READ '1' )", + "( 2.16.840.1.113719.1.1.4.724 NAME 'cefConfiguration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64512} )", + "( 2.16.840.1.113719.1.1.4.725 NAME 'cefVersion' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27{32768} SINGLE-VALUE X-NDS_UPPER_BOUND '32768' )" + ], + "createTimestamp": [], + "dITContentRules": [], + "dITStructureRules": [], + "ldapSyntaxes": [ + "( 1.3.6.1.4.1.1466.115.121.1.1 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.2 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.3 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.4 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.5 X-NDS_SYNTAX '21' )", + "( 1.3.6.1.4.1.1466.115.121.1.6 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.7 X-NDS_SYNTAX '7' )", + "( 2.16.840.1.113719.1.1.5.1.6 X-NDS_SYNTAX '6' )", + "( 1.3.6.1.4.1.1466.115.121.1.8 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.9 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.10 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.22 X-NDS_SYNTAX '22' )", + "( 1.3.6.1.4.1.1466.115.121.1.11 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.12 X-NDS_SYNTAX '1' )", + "( 1.3.6.1.4.1.1466.115.121.1.13 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.14 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.15 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.16 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.17 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.18 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.19 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.20 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.21 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.22 X-NDS_SYNTAX '11' )", + "( 1.3.6.1.4.1.1466.115.121.1.23 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.24 X-NDS_SYNTAX '24' )", + "( 1.3.6.1.4.1.1466.115.121.1.25 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.26 X-NDS_SYNTAX '2' )", + "( 1.3.6.1.4.1.1466.115.121.1.27 X-NDS_SYNTAX '8' )", + "( 1.3.6.1.4.1.1466.115.121.1.28 X-NDS_SYNTAX '9' )", + "( 1.2.840.113556.1.4.906 X-NDS_SYNTAX '29' )", + "( 1.3.6.1.4.1.1466.115.121.1.54 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.56 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.57 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.29 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.30 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.31 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.32 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.33 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.55 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.34 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.35 X-NDS_SYNTAX '3' )", + "( 2.16.840.1.113719.1.1.5.1.19 X-NDS_SYNTAX '19' )", + "( 1.3.6.1.4.1.1466.115.121.1.36 X-NDS_SYNTAX '5' )", + "( 2.16.840.1.113719.1.1.5.1.17 X-NDS_SYNTAX '17' )", + "( 1.3.6.1.4.1.1466.115.121.1.37 X-NDS_SYNTAX '3' )", + "( 2.16.840.1.113719.1.1.5.1.13 X-NDS_SYNTAX '13' )", + "( 1.3.6.1.4.1.1466.115.121.1.40 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.38 X-NDS_SYNTAX '20' )", + "( 1.3.6.1.4.1.1466.115.121.1.39 X-NDS_SYNTAX '3' )", + "( 1.3.6.1.4.1.1466.115.121.1.41 X-NDS_SYNTAX '18' )", + "( 1.3.6.1.4.1.1466.115.121.1.43 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.44 X-NDS_SYNTAX '4' )", + "( 1.3.6.1.4.1.1466.115.121.1.42 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.16 X-NDS_SYNTAX '16' )", + "( 1.3.6.1.4.1.1466.115.121.1.58 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.45 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.46 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.47 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.48 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.49 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.12 X-NDS_SYNTAX '12' )", + "( 2.16.840.1.113719.1.1.5.1.23 X-NDS_SYNTAX '23' )", + "( 2.16.840.1.113719.1.1.5.1.15 X-NDS_SYNTAX '15' )", + "( 2.16.840.1.113719.1.1.5.1.14 X-NDS_SYNTAX '14' )", + "( 1.3.6.1.4.1.1466.115.121.1.50 X-NDS_SYNTAX '10' )", + "( 1.3.6.1.4.1.1466.115.121.1.51 X-NDS_SYNTAX '9' )", + "( 1.3.6.1.4.1.1466.115.121.1.52 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.25 X-NDS_SYNTAX '25' )", + "( 1.3.6.1.4.1.1466.115.121.1.53 X-NDS_SYNTAX '9' )", + "( 2.16.840.1.113719.1.1.5.1.26 X-NDS_SYNTAX '26' )", + "( 2.16.840.1.113719.1.1.5.1.27 X-NDS_SYNTAX '27' )" + ], + "matchingRuleUse": [], + "matchingRules": [], + "modifyTimestamp": [ + "20190831135835Z" + ], + "nameForms": [], + "objectClass": [ + "top", + "subschema" + ], + "objectClasses": [ + "( 2.5.6.0 NAME 'Top' STRUCTURAL MUST objectClass MAY ( cAPublicKey $ cAPrivateKey $ certificateValidityInterval $ authorityRevocation $ lastReferencedTime $ equivalentToMe $ ACL $ backLink $ binderyProperty $ Obituary $ Reference $ revision $ ndsCrossCertificatePair $ certificateRevocation $ usedBy $ GUID $ otherGUID $ DirXML-Associations $ creatorsName $ modifiersName $ objectVersion $ auxClassCompatibility $ unknownBaseClass $ unknownAuxiliaryClass $ masvProposedLabel $ masvDefaultRange $ masvAuthorizedRange $ auditFileLink $ rbsAssignedRoles $ rbsOwnedCollections $ rbsAssignedRoles2 $ rbsOwnedCollections2 ) X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '16#subtree#[Creator]#[Entry Rights]' )", + "( 1.3.6.1.4.1.42.2.27.1.2.1 NAME 'aliasObject' SUP Top STRUCTURAL MUST aliasedObjectName X-NDS_NAME 'Alias' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.2 NAME 'Country' SUP Top STRUCTURAL MUST c MAY ( description $ searchGuide $ sssActiveServerList $ sssServerPolicyOverrideDN ) X-NDS_NAMING 'c' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'domain' ) X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.3 NAME 'Locality' SUP Top STRUCTURAL MAY ( description $ l $ seeAlso $ st $ street $ searchGuide $ sssActiveServerList $ sssServerPolicyOverrideDN ) X-NDS_NAMING ( 'l' 'st' ) X-NDS_CONTAINMENT ( 'Country' 'organizationalUnit' 'Locality' 'Organization' 'domain' ) X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.4 NAME 'Organization' SUP ( ndsLoginProperties $ ndsContainerLoginProperties ) STRUCTURAL MUST o MAY ( description $ facsimileTelephoneNumber $ l $ loginScript $ eMailAddress $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ printJobConfiguration $ printerControl $ seeAlso $ st $ street $ telephoneNumber $ loginIntruderLimit $ intruderAttemptResetInterval $ detectIntruder $ lockoutAfterDetection $ intruderLockoutResetInterval $ nNSDomain $ mailboxLocation $ mailboxID $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationaliSDNNumber $ businessCategory $ searchGuide $ rADIUSAttributeLists $ rADIUSDefaultProfile $ rADIUSDialAccessGroup $ rADIUSEnableDialAccess $ rADIUSServiceList $ sssActiveServerList $ sssServerPolicyOverrideDN $ userPassword ) X-NDS_NAMING 'o' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'Country' 'Locality' 'domain' ) X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Self]#loginScript' '2#entry#[Self]#printJobConfiguration') )", + "( 2.5.6.5 NAME 'organizationalUnit' SUP ( ndsLoginProperties $ ndsContainerLoginProperties ) STRUCTURAL MUST ou MAY ( description $ facsimileTelephoneNumber $ l $ loginScript $ eMailAddress $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ printJobConfiguration $ printerControl $ seeAlso $ st $ street $ telephoneNumber $ loginIntruderLimit $ intruderAttemptResetInterval $ detectIntruder $ lockoutAfterDetection $ intruderLockoutResetInterval $ nNSDomain $ mailboxLocation $ mailboxID $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationaliSDNNumber $ businessCategory $ searchGuide $ rADIUSAttributeLists $ rADIUSDefaultProfile $ rADIUSDialAccessGroup $ rADIUSEnableDialAccess $ rADIUSServiceList $ sssActiveServerList $ sssServerPolicyOverrideDN $ userPassword ) X-NDS_NAMING 'ou' X-NDS_CONTAINMENT ( 'Locality' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Organizational Unit' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Self]#loginScript' '2#entry#[Self]#printJobConfiguration') )", + "( 2.5.6.8 NAME 'organizationalRole' SUP Top STRUCTURAL MUST cn MAY ( description $ facsimileTelephoneNumber $ l $ eMailAddress $ ou $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ roleOccupant $ seeAlso $ st $ street $ telephoneNumber $ mailboxLocation $ mailboxID $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ internationaliSDNNumber ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Organizational Role' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.9 NAME ( 'groupOfNames' 'group' 'groupOfUniqueNames' ) SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ ou $ o $ owner $ seeAlso $ groupID $ fullName $ eMailAddress $ mailboxLocation $ mailboxID $ Profile $ profileMembership $ loginScript $ businessCategory $ nspmPasswordPolicyDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Group' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.6 NAME 'Person' SUP ndsLoginProperties STRUCTURAL MUST ( cn $ sn ) MAY ( description $ seeAlso $ telephoneNumber $ fullName $ givenName $ initials $ generationQualifier $ uid $ assistant $ assistantPhone $ city $ st $ company $ co $ directReports $ manager $ mailstop $ mobile $ personalTitle $ pager $ workforceID $ instantMessagingID $ preferredName $ photo $ jobCode $ siteLocation $ employeeStatus $ employeeType $ costCenter $ costCenterDescription $ tollFreePhoneNumber $ otherPhoneNumber $ managerWorkforceID $ roomNumber $ jackNumber $ departmentNumber $ vehicleInformation $ accessCardNumber $ isManager $ userPassword ) X-NDS_NAMING ( 'cn' 'uid' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.5.6.7 NAME 'organizationalPerson' SUP Person STRUCTURAL MAY ( facsimileTelephoneNumber $ l $ eMailAddress $ ou $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ st $ street $ title $ mailboxLocation $ mailboxID $ uid $ mail $ employeeNumber $ destinationIndicator $ internationaliSDNNumber $ preferredDeliveryMethod $ registeredAddress $ teletexTerminalIdentifier $ telexNumber $ x121Address $ businessCategory $ roomNumber $ x500UniqueIdentifier ) X-NDS_NAMING ( 'cn' 'ou' 'uid' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Organizational Person' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' SUP organizationalPerson STRUCTURAL MAY ( groupMembership $ ndsHomeDirectory $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginGraceLimit $ loginGraceRemaining $ loginIntruderAddress $ loginIntruderAttempts $ loginIntruderResetTime $ loginMaximumSimultaneous $ loginScript $ loginTime $ networkAddressRestriction $ networkAddress $ passwordsUsed $ passwordAllowChange $ passwordExpirationInterval $ passwordExpirationTime $ passwordMinimumLength $ passwordRequired $ passwordUniqueRequired $ printJobConfiguration $ privateKey $ Profile $ publicKey $ securityEquals $ accountBalance $ allowUnlimitedCredit $ minimumAccountBalance $ messageServer $ Language $ ndsUID $ lockedByIntruder $ serverHolds $ lastLoginTime $ typeCreatorMap $ higherPrivileges $ printerControl $ securityFlags $ profileMembership $ Timezone $ sASServiceDN $ sASSecretStore $ sASSecretStoreKey $ sASSecretStoreData $ sASPKIStoreKeys $ userCertificate $ nDSPKIUserCertificateInfo $ nDSPKIKeystore $ rADIUSActiveConnections $ rADIUSAttributeLists $ rADIUSConcurrentLimit $ rADIUSConnectionHistory $ rADIUSDefaultProfile $ rADIUSDialAccessGroup $ rADIUSEnableDialAccess $ rADIUSPassword $ rADIUSServiceList $ audio $ businessCategory $ carLicense $ departmentNumber $ employeeNumber $ employeeType $ displayName $ givenName $ homePhone $ homePostalAddress $ initials $ jpegPhoto $ labeledUri $ mail $ manager $ mobile $ o $ pager $ ldapPhoto $ preferredLanguage $ roomNumber $ secretary $ uid $ userSMIMECertificate $ x500UniqueIdentifier $ userPKCS12 $ sssProxyStoreKey $ sssProxyStoreSecrets $ sssServerPolicyOverrideDN ) X-NDS_NAME 'User' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#subtree#[Self]#[All Attributes Rights]' '6#entry#[Self]#loginScript' '1#subtree#[Root Template]#[Entry Rights]' '2#entry#[Public]#messageServer' '2#entry#[Root Template]#groupMembership' '6#entry#[Self]#printJobConfiguration' '2#entry#[Root Template]#networkAddress') )", + "( 2.5.6.14 NAME 'Device' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ networkAddress $ ou $ o $ owner $ seeAlso $ serialNumber ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.4 NAME 'Computer' SUP Device STRUCTURAL MAY ( operator $ server $ status ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.17 NAME 'Printer' SUP Device STRUCTURAL MAY ( Cartridge $ printerConfiguration $ defaultQueue $ hostDevice $ printServer $ Memory $ networkAddressRestriction $ notify $ operator $ pageDescriptionLanguage $ queue $ status $ supportedTypefaces ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.21 NAME 'Resource' SUP Top ABSTRACT MUST cn MAY ( description $ hostResourceName $ l $ ou $ o $ seeAlso $ Uses ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.20 NAME 'Queue' SUP Resource STRUCTURAL MUST queueDirectory MAY ( Device $ operator $ server $ User $ networkAddress $ Volume $ hostServer ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#subtree#[Root Template]#[All Attributes Rights]' )", + "( 2.16.840.1.113719.1.1.6.1.3 NAME 'binderyQueue' SUP Queue STRUCTURAL MUST binderyType X-NDS_NAMING ( 'cn' 'binderyType' ) X-NDS_NAME 'Bindery Queue' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#subtree#[Root Template]#[All Attributes Rights]' )", + "( 2.16.840.1.113719.1.1.6.1.26 NAME 'Volume' SUP Resource STRUCTURAL MUST hostServer MAY status X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Root Template]#hostResourceName' '2#entry#[Root Template]#hostServer') )", + "( 2.16.840.1.113719.1.1.6.1.7 NAME 'directoryMap' SUP Resource STRUCTURAL MUST hostServer MAY path X-NDS_NAME 'Directory Map' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.19 NAME 'Profile' SUP Top STRUCTURAL MUST ( cn $ loginScript ) MAY ( description $ l $ ou $ o $ seeAlso $ fullName ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.22 NAME 'Server' SUP Top ABSTRACT MUST cn MAY ( description $ hostDevice $ l $ ou $ o $ privateKey $ publicKey $ Resource $ seeAlso $ status $ User $ Version $ networkAddress $ accountBalance $ allowUnlimitedCredit $ minimumAccountBalance $ fullName $ securityEquals $ securityFlags $ Timezone $ ndapClassPasswordMgmt $ ndapClassLoginMgmt ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '2#entry#[Public]#networkAddress' '16#subtree#[Self]#[Entry Rights]') )", + "( 2.16.840.1.113719.1.1.6.1.10 NAME 'ncpServer' SUP Server STRUCTURAL MAY ( operator $ supportedServices $ messagingServer $ dsRevision $ permanentConfigParms $ ndsPredicateStatsDN $ languageId $ indexDefinition $ CachedAttrsOnExtRefs $ NCPKeyMaterialName $ NDSRightsToMonitor $ ldapServerDN $ httpServerDN $ emboxConfig $ sASServiceDN $ cACertificate $ cAECCertificate $ nDSPKIPublicKey $ nDSPKIPrivateKey $ nDSPKICertificateChain $ nDSPKIParentCADN $ nDSPKISDKeyID $ nDSPKISDKeyStruct $ snmpGroupDN $ wANMANWANPolicy $ wANMANLANAreaMembership $ wANMANCost $ wANMANDefaultCost $ encryptionPolicyDN $ eDirCloneSource $ eDirCloneLock $ xdasDSConfiguration $ xdasConfiguration $ xdasVersion $ NAuditLoggingServer $ NAuditInstrumentation $ cefConfiguration $ cefVersion ) X-NDS_NAME 'NCP Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Public]#messagingServer' )", + "( 2.16.840.1.113719.1.1.6.1.18 NAME 'printServer' SUP Server STRUCTURAL MAY ( operator $ printer $ sAPName ) X-NDS_NAME 'Print Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#subtree#[Root Template]#[All Attributes Rights]' )", + "( 2.16.840.1.113719.1.1.6.1.31 NAME 'CommExec' SUP Server STRUCTURAL MAY networkAddressRestriction X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.2 NAME 'binderyObject' SUP Top STRUCTURAL MUST ( binderyObjectRestriction $ binderyType $ cn ) X-NDS_NAMING ( 'cn' 'binderyType' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'Bindery Object' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.15 NAME 'Partition' AUXILIARY MAY ( Convergence $ partitionCreationTime $ Replica $ inheritedACL $ lowConvergenceSyncInterval $ receivedUpTo $ synchronizedUpTo $ authorityRevocation $ certificateRevocation $ cAPrivateKey $ cAPublicKey $ ndsCrossCertificatePair $ lowConvergenceResetTime $ highConvergenceSyncInterval $ partitionControl $ replicaUpTo $ partitionStatus $ transitiveVector $ purgeVector $ synchronizationTolerance $ obituaryNotify $ localReceivedUpTo $ federationControl $ syncPanePoint $ syncWindowVector $ EBAPartitionConfiguration $ authoritative $ allowAliasToAncestor $ sASSecurityDN $ masvLabel $ ndapPartitionPasswordMgmt $ ndapPartitionLoginMgmt $ prSyncPolicyDN $ dsEncryptedReplicationConfig ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.0 NAME 'aFPServer' SUP Server STRUCTURAL MAY ( serialNumber $ supportedConnections ) X-NDS_NAME 'AFP Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.27 NAME 'messagingServer' SUP Server STRUCTURAL MAY ( messagingDatabaseLocation $ messageRoutingGroup $ Postmaster $ supportedServices $ messagingServerType $ supportedGateway ) X-NDS_NAME 'Messaging Server' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '1#subtree#[Self]#[Entry Rights]' '2#subtree#[Self]#[All Attributes Rights]' '6#entry#[Self]#status' '2#entry#[Public]#messagingServerType' '2#entry#[Public]#messagingDatabaseLocation') )", + "( 2.16.840.1.113719.1.1.6.1.28 NAME 'messageRoutingGroup' SUP groupOfNames STRUCTURAL X-NDS_NAME 'Message Routing Group' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES ( '1#subtree#[Self]#[Entry Rights]' '2#subtree#[Self]#[All Attributes Rights]') )", + "( 2.16.840.1.113719.1.1.6.1.29 NAME 'externalEntity' SUP Top STRUCTURAL MUST cn MAY ( description $ seeAlso $ facsimileTelephoneNumber $ l $ eMailAddress $ ou $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ st $ street $ title $ externalName $ mailboxLocation $ mailboxID ) X-NDS_NAMING ( 'cn' 'ou' ) X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'External Entity' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Public]#externalName' )", + "( 2.16.840.1.113719.1.1.6.1.30 NAME 'List' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ ou $ o $ eMailAddress $ mailboxLocation $ mailboxID $ owner $ seeAlso $ fullName ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Root Template]#member' )", + "( 2.16.840.1.113719.1.1.6.1.32 NAME 'treeRoot' SUP Top STRUCTURAL MUST T MAY ( EBATreeConfiguration $ sssActiveServerList ) X-NDS_NAMING 'T' X-NDS_NAME 'Tree Root' X-NDS_NONREMOVABLE '1' )", + "( 0.9.2342.19200300.100.4.13 NAME 'domain' SUP ( Top $ ndsLoginProperties $ ndsContainerLoginProperties ) STRUCTURAL MUST dc MAY ( searchGuide $ o $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ l $ associatedName $ description $ sssActiveServerList $ sssServerPolicyOverrideDN $ userPassword ) X-NDS_NAMING 'dc' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'Country' 'Locality' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NONREMOVABLE '1' )", + "( 1.3.6.1.4.1.1466.344 NAME 'dcObject' AUXILIARY MUST dc X-NDS_NAMING 'dc' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.33 NAME 'ndsLoginProperties' SUP Top ABSTRACT MAY ( groupMembership $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginGraceLimit $ loginGraceRemaining $ loginIntruderAddress $ loginIntruderAttempts $ loginIntruderResetTime $ loginMaximumSimultaneous $ loginScript $ loginTime $ networkAddressRestriction $ networkAddress $ passwordsUsed $ passwordAllowChange $ passwordExpirationInterval $ passwordExpirationTime $ passwordMinimumLength $ passwordRequired $ passwordUniqueRequired $ privateKey $ Profile $ publicKey $ securityEquals $ accountBalance $ allowUnlimitedCredit $ minimumAccountBalance $ Language $ lockedByIntruder $ serverHolds $ lastLoginTime $ higherPrivileges $ securityFlags $ profileMembership $ Timezone $ loginActivationTime $ UTF8LoginScript $ loginScriptCharset $ sASNDSPasswordWindow $ sASLoginSecret $ sASLoginSecretKey $ sASEncryptionType $ sASLoginConfiguration $ sASLoginConfigurationKey $ sasLoginFailureDelay $ sasDefaultLoginSequence $ sasAuthorizedLoginSequences $ sasAllowableSubjectNames $ sasUpdateLoginInfo $ sasOTPEnabled $ sasOTPCounter $ sasOTPDigits $ sasOTPReSync $ sasUpdateLoginTimeInterval $ ndapPasswordMgmt $ ndapLoginMgmt $ nspmPasswordKey $ nspmPassword $ pwdChangedTime $ pwdAccountLockedTime $ pwdFailureTime $ nspmDoNotExpirePassword $ nspmDistributionPassword $ nspmPreviousDistributionPassword $ nspmPasswordHistory $ nspmAdministratorChangeCount $ nspmPasswordPolicyDN $ nsimHint $ nsimPasswordReminder $ userPassword ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.141.6.1 NAME 'federationBoundary' AUXILIARY MUST federationBoundaryType MAY ( federationControl $ federationDNSName $ federationSearchPath ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.34 NAME 'ndsContainerLoginProperties' SUP Top ABSTRACT MAY ( loginIntruderLimit $ intruderAttemptResetInterval $ detectIntruder $ lockoutAfterDetection $ intruderLockoutResetInterval $ sasLoginFailureDelay $ sasDefaultLoginSequence $ sasAuthorizedLoginSequences $ sasUpdateLoginInfo $ sasOTPEnabled $ sasOTPDigits $ sasUpdateLoginTimeInterval $ ndapPasswordMgmt $ ndapLoginMgmt $ nspmPasswordPolicyDN ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.27.6.3 NAME 'ndsPredicateStats' SUP Top STRUCTURAL MUST ( cn $ ndsPredicateState $ ndsPredicateFlush ) MAY ( ndsPredicate $ ndsPredicateTimeout $ ndsPredicateUseValues ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.400.1 NAME 'edirSchemaVersion' SUP Top ABSTRACT MAY edirSchemaFlagVersion X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )", + "( 2.16.840.1.113719.1.1.6.1.47 NAME 'immediateSuperiorReference' AUXILIARY MAY ref X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.27.6.1 NAME 'ldapServer' SUP Top STRUCTURAL MUST cn MAY ( ldapHostServer $ ldapGroupDN $ ldapTraceLevel $ ldapServerBindLimit $ ldapServerIdleTimeout $ lDAPUDPPort $ lDAPSearchSizeLimit $ lDAPSearchTimeLimit $ lDAPLogLevel $ lDAPLogFilename $ lDAPBackupLogFilename $ lDAPLogSizeLimit $ Version $ searchSizeLimit $ searchTimeLimit $ ldapEnableTCP $ ldapTCPPort $ ldapEnableSSL $ ldapSSLPort $ ldapKeyMaterialName $ filteredReplicaUsage $ extensionInfo $ nonStdClientSchemaCompatMode $ sslEnableMutualAuthentication $ ldapEnablePSearch $ ldapMaximumPSearchOperations $ ldapIgnorePSearchLimitsForEvents $ ldapTLSTrustedRootContainer $ ldapEnableMonitorEvents $ ldapMaximumMonitorEventsLoad $ ldapTLSRequired $ ldapTLSVerifyClientCertificate $ ldapConfigVersion $ ldapDerefAlias $ ldapNonStdAllUserAttrsMode $ ldapBindRestrictions $ ldapDefaultReferralBehavior $ ldapReferral $ ldapSearchReferralUsage $ lDAPOtherReferralUsage $ ldapLBURPNumWriterThreads $ ldapInterfaces $ ldapChainSecureRequired $ ldapStdCompliance $ ldapDerefAliasOnAuth $ ldapGeneralizedTime $ ldapPermissiveModify $ ldapSSLConfig ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) X-NDS_NAME 'LDAP Server' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.27.6.2 NAME 'ldapGroup' SUP Top STRUCTURAL MUST cn MAY ( ldapReferral $ ldapServerList $ ldapAllowClearTextPassword $ ldapAnonymousIdentity $ lDAPSuffix $ ldapAttributeMap $ ldapClassMap $ ldapSearchReferralUsage $ lDAPOtherReferralUsage $ transitionGroupDN $ ldapAttributeList $ ldapClassList $ ldapConfigVersion $ Version $ ldapDefaultReferralBehavior $ ldapTransitionBackLink $ ldapSSLConfig $ referralIncludeFilter $ referralExcludeFilter ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) X-NDS_NAME 'LDAP Group' X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.22 NAME 'pkiCA' AUXILIARY MAY ( cACertificate $ certificateRevocationList $ authorityRevocationList $ crossCertificatePair $ attributeCertificate $ publicKey $ privateKey $ networkAddress $ loginTime $ lastLoginTime $ cAECCertificate $ crossCertificatePairEC ) X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.21 NAME 'pkiUser' AUXILIARY MAY userCertificate X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.15 NAME 'strongAuthenticationUser' AUXILIARY MAY userCertificate X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.11 NAME 'applicationProcess' SUP Top STRUCTURAL MUST cn MAY ( seeAlso $ ou $ l $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.5.6.12 NAME 'applicationEntity' SUP Top STRUCTURAL MUST ( presentationAddress $ cn ) MAY ( supportedApplicationContext $ seeAlso $ ou $ o $ l $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.5.6.13 NAME 'dSA' SUP applicationEntity STRUCTURAL MAY knowledgeInformation X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.5.6.16 NAME 'certificationAuthority' AUXILIARY MUST ( authorityRevocationList $ certificateRevocationList $ cACertificate ) MAY crossCertificatePair X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.18 NAME 'userSecurityInformation' AUXILIARY MAY supportedAlgorithms X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.20 NAME 'dmd' SUP ndsLoginProperties AUXILIARY MUST dmdName MAY ( searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ l $ description $ userPassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.5.6.16.2 NAME 'certificationAuthority-V2' AUXILIARY MUST ( authorityRevocationList $ certificateRevocationList $ cACertificate ) MAY ( crossCertificatePair $ deltaRevocationList ) X-NDS_NAME 'certificationAuthorityVer2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.3.6.1 NAME 'httpServer' SUP Top STRUCTURAL MUST cn MAY ( httpHostServerDN $ httpThreadsPerCPU $ httpIOBufferSize $ httpRequestTimeout $ httpKeepAliveRequestTimeout $ httpSessionTimeout $ httpKeyMaterialObject $ httpTraceLevel $ httpAuthRequiresTLS $ httpDefaultClearPort $ httpDefaultTLSPort $ httpBindRestrictions ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'domain' 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.64.6.1.1 NAME 'Template' SUP Top STRUCTURAL MUST cn MAY ( trusteesOfNewObject $ newObjectSDSRights $ newObjectSFSRights $ setupScript $ runSetupScript $ membersOfTemplate $ volumeSpaceRestrictions $ setPasswordAfterCreate $ homeDirectoryRights $ accountBalance $ allowUnlimitedCredit $ description $ eMailAddress $ facsimileTelephoneNumber $ groupMembership $ higherPrivileges $ ndsHomeDirectory $ l $ Language $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginGraceLimit $ loginMaximumSimultaneous $ loginScript $ mailboxID $ mailboxLocation $ member $ messageServer $ minimumAccountBalance $ networkAddressRestriction $ newObjectSSelfRights $ ou $ passwordAllowChange $ passwordExpirationInterval $ passwordExpirationTime $ passwordMinimumLength $ passwordRequired $ passwordUniqueRequired $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ Profile $ st $ street $ securityEquals $ securityFlags $ seeAlso $ telephoneNumber $ title $ assistant $ assistantPhone $ city $ company $ co $ manager $ managerWorkforceID $ mailstop $ siteLocation $ employeeType $ costCenter $ costCenterDescription $ tollFreePhoneNumber $ departmentNumber ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.8.6.1 NAME 'homeInfo' AUXILIARY MAY ( homeCity $ homeEmailAddress $ homeFax $ homePhone $ homeState $ homePostalAddress $ homeZipCode $ personalMobile $ spouse $ children ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.8.6.2 NAME 'contingentWorker' AUXILIARY MAY ( vendorName $ vendorAddress $ vendorPhoneNumber ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.45 NAME 'dynamicGroup' SUP ( groupOfNames $ ndsLoginProperties ) STRUCTURAL MAY ( memberQueryURL $ excludedMember $ dgIdentity $ dgAllowUnknown $ dgTimeOut $ dgAllowDuplicates $ userPassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.46 NAME 'dynamicGroupAux' SUP ( groupOfNames $ ndsLoginProperties ) AUXILIARY MAY ( memberQueryURL $ excludedMember $ dgIdentity $ dgAllowUnknown $ dgTimeOut $ dgAllowDuplicates $ userPassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.6.1.1 NAME 'sASSecurity' SUP Top STRUCTURAL MUST cn MAY ( nDSPKITreeCADN $ masvPolicyDN $ sASLoginPolicyDN $ sASLoginMethodContainerDN $ sasPostLoginMethodContainerDN $ nspmPolicyAgentContainerDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Top' 'treeRoot' 'Country' 'Organization' 'domain' ) X-NDS_NAME 'SAS:Security' )", + "( 2.16.840.1.113719.1.39.6.1.2 NAME 'sASService' SUP Resource STRUCTURAL MAY ( hostServer $ privateKey $ publicKey $ allowUnlimitedCredit $ fullName $ lastLoginTime $ lockedByIntruder $ loginAllowedTimeMap $ loginDisabled $ loginExpirationTime $ loginIntruderAddress $ loginIntruderAttempts $ loginIntruderResetTime $ loginMaximumSimultaneous $ loginTime $ networkAddress $ networkAddressRestriction $ notify $ operator $ owner $ path $ securityEquals $ securityFlags $ status $ Version $ nDSPKIKeyMaterialDN $ ndspkiKMOExport ) X-NDS_NAMING 'cn' X-NDS_NAME 'SAS:Service' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.1 NAME 'nDSPKICertificateAuthority' SUP Top STRUCTURAL MUST cn MAY ( hostServer $ nDSPKIPublicKey $ nDSPKIPrivateKey $ nDSPKIPublicKeyCertificate $ nDSPKICertificateChain $ nDSPKICertificateChainEC $ nDSPKIParentCA $ nDSPKIParentCADN $ nDSPKISubjectName $ nDSPKIPublicKeyEC $ nDSPKIPrivateKeyEC $ nDSPKIPublicKeyCertificateEC $ crossCertificatePairEC $ nDSPKISuiteBMode $ cACertificate $ cAECCertificate $ ndspkiCRLContainerDN $ ndspkiIssuedCertContainerDN $ ndspkiCRLConfigurationDNList $ ndspkiCRLECConfigurationDNList $ ndspkiSecurityRightsLevel $ ndspkiDefaultRSAKeySize $ ndspkiDefaultECCurve $ ndspkiDefaultCertificateLife ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'NDSPKI:Certificate Authority' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.2 NAME 'nDSPKIKeyMaterial' SUP Top STRUCTURAL MUST cn MAY ( hostServer $ nDSPKIKeyFile $ nDSPKIPrivateKey $ nDSPKIPublicKey $ nDSPKIPublicKeyCertificate $ nDSPKICertificateChain $ nDSPKISubjectName $ nDSPKIGivenName $ ndspkiAdditionalRoots $ nDSPKINotBefore $ nDSPKINotAfter ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NAME 'NDSPKI:Key Material' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.3 NAME 'nDSPKITrustedRoot' SUP Top STRUCTURAL MUST cn MAY ndspkiTrustedRootList X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'domain' ) X-NDS_NAME 'NDSPKI:Trusted Root' )", + "( 2.16.840.1.113719.1.48.6.1.4 NAME 'nDSPKITrustedRootObject' SUP Top STRUCTURAL MUST ( cn $ nDSPKITrustedRootCertificate ) MAY ( nDSPKISubjectName $ nDSPKINotBefore $ nDSPKINotAfter $ externalName $ givenName $ sn ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'nDSPKITrustedRoot' X-NDS_NAME 'NDSPKI:Trusted Root Object' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.101 NAME 'nDSPKISDKeyAccessPartition' SUP Top STRUCTURAL MUST cn X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'NDSPKI:SD Key Access Partition' )", + "( 2.16.840.1.113719.1.48.6.1.102 NAME 'nDSPKISDKeyList' SUP Top STRUCTURAL MUST cn MAY ( nDSPKISDKeyServerDN $ nDSPKISDKeyStruct $ nDSPKISDKeyCert ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'nDSPKISDKeyAccessPartition' X-NDS_NAME 'NDSPKI:SD Key List' )", + "( 2.16.840.1.113719.1.31.6.2.1 NAME 'mASVSecurityPolicy' SUP Top STRUCTURAL MUST cn MAY ( description $ masvDomainPolicy $ masvPolicyUpdate $ masvClearanceNames $ masvLabelNames $ masvLabelSecrecyLevelNames $ masvLabelSecrecyCategoryNames $ masvLabelIntegrityLevelNames $ masvLabelIntegrityCategoryNames $ masvNDSAttributeLabels ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'MASV:Security Policy' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.1 NAME 'sASLoginMethodContainer' SUP Top STRUCTURAL MUST cn MAY description X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NAME 'SAS:Login Method Container' )", + "( 2.16.840.1.113719.1.39.42.2.0.4 NAME 'sASLoginPolicy' SUP Top STRUCTURAL MUST cn MAY ( description $ privateKey $ publicKey $ sASAllowNDSPasswordWindow $ sASPolicyCredentials $ sASPolicyMethods $ sASPolicyObjectVersion $ sASPolicyServiceSubtypes $ sASPolicyServices $ sASPolicyUsers $ sASLoginSequence $ sASLoginPolicyUpdate $ sasNMASProductOptions $ sasPolicyMethods $ sasPolicyServices $ sasPolicyUsers $ sasAllowNDSPasswordWindow $ sasLoginFailureDelay $ sasDefaultLoginSequence $ sasAuthorizedLoginSequences $ sasAuditConfiguration $ sasUpdateLoginInfo $ sasOTPEnabled $ sasOTPLookAheadWindow $ sasOTPDigits $ sasUpdateLoginTimeInterval $ nspmPasswordPolicyDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' X-NDS_NAME 'SAS:Login Policy' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.7 NAME 'sASNMASBaseLoginMethod' SUP Top ABSTRACT MUST cn MAY ( description $ sASLoginSecret $ sASLoginSecretKey $ sASEncryptionType $ sASLoginConfiguration $ sASLoginConfigurationKey $ sASMethodIdentifier $ sASMethodVendor $ sASVendorSupport $ sASAdvisoryMethodGrade $ sASLoginClientMethodNetWare $ sASLoginServerMethodNetWare $ sASLoginClientMethodWINNT $ sASLoginServerMethodWINNT $ sasCertificateSearchContainers $ sasNMASMethodConfigData $ sasMethodVersion $ sASLoginPolicyUpdate $ sasUnsignedMethodModules $ sasServerModuleName $ sasServerModuleEntryPointName $ sasSASLMechanismName $ sasSASLMechanismEntryPointName $ sasClientModuleName $ sasClientModuleEntryPointName $ sasLoginClientMethodSolaris $ sasLoginServerMethodSolaris $ sasLoginClientMethodLinux $ sasLoginServerMethodLinux $ sasLoginClientMethodTru64 $ sasLoginServerMethodTru64 $ sasLoginClientMethodAIX $ sasLoginServerMethodAIX $ sasLoginClientMethodHPUX $ sasLoginServerMethodHPUX $ sasLoginClientMethods390 $ sasLoginServerMethods390 $ sasLoginClientMethodLinuxX64 $ sasLoginServerMethodLinuxX64 $ sasLoginClientMethodWinX64 $ sasLoginServerMethodWinX64 $ sasLoginClientMethodSolaris64 $ sasLoginServerMethodSolaris64 $ sasLoginClientMethodSolarisi386 $ sasLoginServerMethodSolarisi386 $ sasLoginClientMethodAIX64 $ sasLoginServerMethodAIX64 ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASLoginMethodContainer' X-NDS_NAME 'SAS:NMAS Base Login Method' )", + "( 2.16.840.1.113719.1.39.42.2.0.8 NAME 'sASNMASLoginMethod' SUP sASNMASBaseLoginMethod STRUCTURAL X-NDS_NAME 'SAS:NMAS Login Method' )", + "( 2.16.840.1.113719.1.39.42.2.0.9 NAME 'rADIUSDialAccessSystem' SUP Top STRUCTURAL MUST cn MAY ( publicKey $ privateKey $ rADIUSAgedInterval $ rADIUSClient $ rADIUSCommonNameResolution $ rADIUSConcurrentLimit $ rADIUSDASVersion $ rADIUSEnableCommonNameLogin $ rADIUSEnableDialAccess $ rADIUSInterimAcctingTimeout $ rADIUSLookupContexts $ rADIUSMaxDASHistoryRecord $ rADIUSMaximumHistoryRecord $ rADIUSPasswordPolicy $ rADIUSPrivateKey $ rADIUSProxyContext $ rADIUSProxyDomain $ rADIUSProxyTarget $ rADIUSPublicKey $ sASLoginConfiguration $ sASLoginConfigurationKey ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NAME 'RADIUS:Dial Access System' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.10 NAME 'rADIUSProfile' SUP Top STRUCTURAL MUST cn MAY rADIUSAttributeList X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NAME 'RADIUS:Profile' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.42.2.0.11 NAME 'sasPostLoginMethodContainer' SUP Top STRUCTURAL MUST cn MAY description X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' )", + "( 2.16.840.1.113719.1.39.42.2.0.12 NAME 'sasPostLoginMethod' SUP Top STRUCTURAL MUST cn MAY ( description $ sASLoginSecret $ sASLoginSecretKey $ sASEncryptionType $ sASLoginConfiguration $ sASLoginConfigurationKey $ sASMethodIdentifier $ sASMethodVendor $ sASVendorSupport $ sASAdvisoryMethodGrade $ sASLoginClientMethodNetWare $ sASLoginServerMethodNetWare $ sASLoginClientMethodWINNT $ sASLoginServerMethodWINNT $ sasMethodVersion $ sASLoginPolicyUpdate $ sasUnsignedMethodModules $ sasServerModuleName $ sasServerModuleEntryPointName $ sasSASLMechanismName $ sasSASLMechanismEntryPointName $ sasClientModuleName $ sasClientModuleEntryPointName $ sasLoginClientMethodSolaris $ sasLoginServerMethodSolaris $ sasLoginClientMethodLinux $ sasLoginServerMethodLinux $ sasLoginClientMethodTru64 $ sasLoginServerMethodTru64 $ sasLoginClientMethodAIX $ sasLoginServerMethodAIX $ sasLoginClientMethodHPUX $ sasLoginServerMethodHPUX $ sasLoginClientMethods390 $ sasLoginServerMethods390 $ sasLoginClientMethodLinuxX64 $ sasLoginServerMethodLinuxX64 $ sasLoginClientMethodWinX64 $ sasLoginServerMethodWinX64 $ sasLoginClientMethodSolaris64 $ sasLoginServerMethodSolaris64 $ sasLoginClientMethodSolarisi386 $ sasLoginServerMethodSolarisi386 $ sasLoginClientMethodAIX64 $ sasLoginServerMethodAIX64 ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sasPostLoginMethodContainer' )", + "( 2.16.840.1.113719.1.6.6.1 NAME 'snmpGroup' SUP Top STRUCTURAL MUST cn MAY ( Version $ snmpServerList $ snmpTrapDisable $ snmpTrapInterval $ snmpTrapDescription $ snmpTrapConfig ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'domain' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.43.6.2 NAME 'nspmPasswordPolicyContainer' SUP Top STRUCTURAL MUST cn MAY description X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Country' 'domain' 'Locality' 'Organization' 'organizationalUnit' ) )", + "( 2.16.840.1.113719.1.39.43.6.3 NAME 'nspmPolicyAgent' SUP Top STRUCTURAL MUST cn MAY ( description $ nspmPolicyAgentNetWare $ nspmPolicyAgentWINNT $ nspmPolicyAgentSolaris $ nspmPolicyAgentLinux $ nspmPolicyAgentAIX $ nspmPolicyAgentHPUX ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'nspmPasswordPolicyContainer' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.43.6.1 NAME 'nspmPasswordPolicy' SUP Top STRUCTURAL MUST cn MAY ( description $ nspmPolicyPrecedence $ nspmConfigurationOptions $ nspmChangePasswordMessage $ passwordExpirationInterval $ loginGraceLimit $ nspmMinPasswordLifetime $ passwordUniqueRequired $ nspmPasswordHistoryLimit $ nspmPasswordHistoryExpiration $ passwordAllowChange $ passwordRequired $ passwordMinimumLength $ nspmMaximumLength $ nspmCaseSensitive $ nspmMinUpperCaseCharacters $ nspmMaxUpperCaseCharacters $ nspmMinLowerCaseCharacters $ nspmMaxLowerCaseCharacters $ nspmNumericCharactersAllowed $ nspmNumericAsFirstCharacter $ nspmNumericAsLastCharacter $ nspmMinNumericCharacters $ nspmMaxNumericCharacters $ nspmSpecialCharactersAllowed $ nspmSpecialAsFirstCharacter $ nspmSpecialAsLastCharacter $ nspmMinSpecialCharacters $ nspmMaxSpecialCharacters $ nspmMaxRepeatedCharacters $ nspmMaxConsecutiveCharacters $ nspmMinUniqueCharacters $ nspmDisallowedAttributeValues $ nspmExcludeList $ nspmExtendedCharactersAllowed $ nspmExtendedAsFirstCharacter $ nspmExtendedAsLastCharacter $ nspmMinExtendedCharacters $ nspmMaxExtendedCharacters $ nspmUpperAsFirstCharacter $ nspmUpperAsLastCharacter $ nspmLowerAsFirstCharacter $ nspmLowerAsLastCharacter $ nspmComplexityRules $ nspmAD2K8Syntax $ nspmAD2K8maxViolation $ nspmXCharLimit $ nspmXCharHistoryLimit $ nspmUnicodeAllowed $ nspmNonAlphaCharactersAllowed $ nspmMinNonAlphaCharacters $ nspmMaxNonAlphaCharacters $ pwdInHistory $ nspmAdminsDoNotExpirePassword $ nspmPasswordACL $ nsimChallengeSetDN $ nsimForgottenAction $ nsimForgottenLoginConfig $ nsimAssignments $ nsimChallengeSetGUID $ nsimPwdRuleEnforcement ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'nspmPasswordPolicyContainer' 'domain' 'Locality' 'Organization' 'organizationalUnit' 'Country' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.43.6.4 NAME 'nspmPasswordAux' AUXILIARY MAY ( publicKey $ privateKey $ loginGraceLimit $ loginGraceRemaining $ passwordExpirationTime $ passwordRequired $ nspmPasswordKey $ nspmPassword $ nspmDistributionPassword $ nspmPreviousDistributionPassword $ nspmPasswordHistory $ nspmAdministratorChangeCount $ nspmPasswordPolicyDN $ pwdChangedTime $ pwdAccountLockedTime $ pwdFailureTime $ nspmDoNotExpirePassword ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.12.6.1.0 NAME 'auditFileObject' SUP Top STRUCTURAL MUST ( cn $ auditPolicy $ auditContents ) MAY ( description $ auditPath $ auditLinkList $ auditType $ auditCurrentEncryptionKey $ auditAEncryptionKey $ auditBEncryptionKey ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Top' 'Country' 'Locality' 'Organization' 'organizationalUnit' 'treeRoot' 'domain' ) X-NDS_NAME 'Audit:File Object' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.38.6.1.4 NAME 'wANMANLANArea' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ o $ ou $ owner $ seeAlso $ wANMANWANPolicy $ wANMANCost $ wANMANDefaultCost ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'Organization' 'organizationalUnit' ) X-NDS_NAME 'WANMAN:LAN Area' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.37.1 NAME 'rbsCollection' SUP Top STRUCTURAL MUST cn MAY ( owner $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.16.840.1.113719.1.135.6.30.1 NAME 'rbsExternalScope' SUP Top ABSTRACT MUST cn MAY ( rbsURL $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.31.1 NAME 'rbsModule' SUP Top STRUCTURAL MUST cn MAY ( rbsURL $ rbsPath $ rbsType $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection' )", + "( 2.16.840.1.113719.1.135.6.32.1 NAME 'rbsRole' SUP Top STRUCTURAL MUST cn MAY ( rbsContent $ rbsMember $ rbsTrusteeOf $ rbsGALabel $ rbsParameters $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection' )", + "( 2.16.840.1.113719.1.135.6.33.1 NAME 'rbsTask' SUP Top STRUCTURAL MUST cn MAY ( rbsContentMembership $ rbsType $ rbsTaskRights $ rbsEntryPoint $ rbsParameters $ rbsTaskTemplates $ rbsTaskTemplatesURL $ description $ rbsXMLInfo ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsModule' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.34.1 NAME 'rbsBook' SUP rbsTask STRUCTURAL MAY ( rbsTargetObjectType $ rbsPageMembership ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.35.1 NAME 'rbsScope' SUP groupOfNames STRUCTURAL MAY ( rbsContext $ rbsXMLInfo ) X-NDS_CONTAINMENT 'rbsRole' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.45.1 NAME 'rbsCollection2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsParameters $ owner $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'domain' ) )", + "( 2.16.840.1.113719.1.135.6.38.1 NAME 'rbsExternalScope2' SUP Top ABSTRACT MUST cn MAY ( rbsXMLInfo $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.39.1 NAME 'rbsModule2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsPath $ rbsType $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' )", + "( 2.16.840.1.113719.1.135.6.40.1 NAME 'rbsRole2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsContent $ rbsMember $ rbsTrusteeOf $ rbsParameters $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsCollection2' )", + "( 2.16.840.1.113719.1.135.6.41.1 NAME 'rbsTask2' SUP Top STRUCTURAL MUST cn MAY ( rbsXMLInfo $ rbsContentMembership $ rbsType $ rbsTaskRights $ rbsEntryPoint $ rbsParameters $ description ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'rbsModule2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.42.1 NAME 'rbsBook2' SUP rbsTask2 STRUCTURAL MAY ( rbsTargetObjectType $ rbsPageMembership ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.135.6.43.1 NAME 'rbsScope2' SUP groupOfNames STRUCTURAL MAY ( rbsContext $ rbsXMLInfo ) X-NDS_CONTAINMENT 'rbsRole2' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.49 NAME 'prSyncPolicy' SUP Top STRUCTURAL MUST cn MAY prSyncAttributes X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'domain' 'Country' 'Locality' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.50 NAME 'encryptionPolicy' SUP Top STRUCTURAL MUST cn MAY ( attrEncryptionDefinition $ attrEncryptionRequiresSecure ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'domain' 'organizationalUnit' 'Organization' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.5 NAME 'ndspkiContainer' SUP Top STRUCTURAL MUST cn X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'ndspkiContainer' 'sASSecurity' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'nDSPKITrustedRoot' ) )", + "( 2.16.840.1.113719.1.48.6.1.6 NAME 'ndspkiCertificate' SUP Top STRUCTURAL MUST ( cn $ userCertificate ) MAY ( nDSPKISubjectName $ nDSPKINotBefore $ nDSPKINotAfter $ externalName $ givenName $ sn ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sASSecurity' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'ndspkiContainer' 'nDSPKITrustedRoot' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.48.6.1.7 NAME 'ndspkiCRLConfiguration' SUP Top STRUCTURAL MUST cn MAY ( ndspkiCRLFileName $ ndspkiDirectory $ ndspkiStatus $ ndspkiIssueTime $ ndspkiNextIssueTime $ ndspkiAttemptTime $ ndspkiTimeInterval $ ndspkiCRLMaxProcessingInterval $ ndspkiCRLNumber $ ndspkiDistributionPoints $ ndspkiDistributionPointDN $ ndspkiCADN $ ndspkiCRLProcessData $ nDSPKIPublicKey $ nDSPKIPrivateKey $ nDSPKIPublicKeyCertificate $ nDSPKICertificateChain $ nDSPKIParentCA $ nDSPKIParentCADN $ nDSPKISubjectName $ cACertificate $ hostServer $ ndspkiCRLType $ ndspkiCRLExtendValidity ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'ndspkiContainer' )", + "( 2.5.6.19 NAME 'cRLDistributionPoint' SUP Top STRUCTURAL MUST cn MAY ( authorityRevocationList $ authorityRevocationList $ cACertificate $ certificateRevocationList $ certificateRevocationList $ crossCertificatePair $ deltaRevocationList $ deltaRevocationList $ ndspkiCRLConfigurationDN ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Country' 'Locality' 'organizationalUnit' 'Organization' 'sASSecurity' 'domain' 'ndspkiCRLConfiguration' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.7.6.1 NAME 'notfTemplateCollection' SUP Top STRUCTURAL MUST cn MAY ( notfSMTPEmailHost $ notfSMTPEmailFrom $ notfSMTPEmailUserName $ sASSecretStore ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' )", + "( 2.16.840.1.113719.1.7.6.2 NAME 'notfMergeTemplate' SUP Top STRUCTURAL MUST cn MAY ( notfMergeTemplateData $ notfMergeTemplateSubject ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'notfTemplateCollection' X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.39.44.6.1 NAME 'nsimChallengeSet' SUP Top STRUCTURAL MUST cn MAY ( description $ nsimRequiredQuestions $ nsimRandomQuestions $ nsimNumberRandomQuestions $ nsimMinResponseLength $ nsimMaxResponseLength ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'nspmPasswordPolicyContainer' 'Country' 'domain' 'Locality' 'Organization' 'organizationalUnit' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.266.6.1 NAME 'sssServerPolicies' SUP Top STRUCTURAL MUST cn MAY ( sssCacheRefreshInterval $ sssEnableReadTimestamps $ sssDisableMasterPasswords $ sssEnableAdminAccess $ sssAdminList $ sssAdminGALabel $ sssReadSecretPolicies ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT 'sASSecurity' )", + "( 2.16.840.1.113719.1.266.6.2 NAME 'sssServerPolicyOverride' SUP Top STRUCTURAL MUST cn MAY ( sssCacheRefreshInterval $ sssEnableReadTimestamps $ sssDisableMasterPasswords $ sssEnableAdminAccess $ sssAdminList $ sssAdminGALabel $ sssReadSecretPolicies ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'sssServerPolicies' 'Organization' 'organizationalUnit' 'Country' 'Locality' 'domain' ) X-NDS_NOT_CONTAINER '1' )", + "( 2.16.840.1.113719.1.1.6.1.91 NAME 'nestedGroupAux' AUXILIARY MAY ( groupMember $ excludedMember $ nestedConfig $ groupMembership ) X-NDS_NOT_CONTAINER '1' )" + ] + }, + "schema_entry": "cn=schema", + "type": "SchemaInfo" +} +""" + +edir_9_1_4_dsa_info = """ +{ + "raw": { + "abandonOps": [ + "0" + ], + "addEntryOps": [ + "0" + ], + "altServer": [], + "bindSecurityErrors": [ + "0" + ], + "chainings": [ + "0" + ], + "compareOps": [ + "0" + ], + "directoryTreeName": [ + "TEST_TREE" + ], + "dsaName": [ + "cn=MYSERVER,o=resources" + ], + "errors": [ + "0" + ], + "extendedOps": [ + "0" + ], + "inBytes": [ + "293" + ], + "inOps": [ + "3" + ], + "listOps": [ + "0" + ], + "modifyEntryOps": [ + "0" + ], + "modifyRDNOps": [ + "0" + ], + "namingContexts": [ + "" + ], + "oneLevelSearchOps": [ + "0" + ], + "outBytes": [ + "14" + ], + "readOps": [ + "1" + ], + "referralsReturned": [ + "0" + ], + "removeEntryOps": [ + "0" + ], + "repUpdatesIn": [ + "0" + ], + "repUpdatesOut": [ + "0" + ], + "searchOps": [ + "1" + ], + "securityErrors": [ + "0" + ], + "simpleAuthBinds": [ + "1" + ], + "strongAuthBinds": [ + "0" + ], + "subschemaSubentry": [ + "cn=schema" + ], + "supportedCapabilities": [], + "supportedControl": [ + "2.16.840.1.113719.1.27.101.6", + "2.16.840.1.113719.1.27.101.5", + "1.2.840.113556.1.4.319", + "2.16.840.1.113730.3.4.3", + "2.16.840.1.113730.3.4.2", + "2.16.840.1.113719.1.27.101.57", + "2.16.840.1.113719.1.27.103.7", + "2.16.840.1.113719.1.27.101.40", + "2.16.840.1.113719.1.27.101.41", + "1.2.840.113556.1.4.1413", + "1.2.840.113556.1.4.805", + "2.16.840.1.113730.3.4.18", + "1.2.840.113556.1.4.529" + ], + "supportedExtension": [ + "2.16.840.1.113719.1.148.100.1", + "2.16.840.1.113719.1.148.100.3", + "2.16.840.1.113719.1.148.100.5", + "2.16.840.1.113719.1.148.100.7", + "2.16.840.1.113719.1.148.100.9", + "2.16.840.1.113719.1.148.100.11", + "2.16.840.1.113719.1.148.100.13", + "2.16.840.1.113719.1.148.100.15", + "2.16.840.1.113719.1.148.100.17", + "2.16.840.1.113719.1.39.42.100.1", + "2.16.840.1.113719.1.39.42.100.3", + "2.16.840.1.113719.1.39.42.100.5", + "2.16.840.1.113719.1.39.42.100.7", + "2.16.840.1.113719.1.39.42.100.9", + "2.16.840.1.113719.1.39.42.100.11", + "2.16.840.1.113719.1.39.42.100.13", + "2.16.840.1.113719.1.39.42.100.15", + "2.16.840.1.113719.1.39.42.100.17", + "2.16.840.1.113719.1.39.42.100.19", + "2.16.840.1.113719.1.39.42.100.21", + "2.16.840.1.113719.1.39.42.100.23", + "2.16.840.1.113719.1.39.42.100.25", + "2.16.840.1.113719.1.39.42.100.27", + "2.16.840.1.113719.1.39.42.100.29", + "1.3.6.1.4.1.4203.1.11.1", + "2.16.840.1.113719.1.27.100.1", + "2.16.840.1.113719.1.27.100.3", + "2.16.840.1.113719.1.27.100.5", + "2.16.840.1.113719.1.27.100.7", + "2.16.840.1.113719.1.27.100.11", + "2.16.840.1.113719.1.27.100.13", + "2.16.840.1.113719.1.27.100.15", + "2.16.840.1.113719.1.27.100.17", + "2.16.840.1.113719.1.27.100.19", + "2.16.840.1.113719.1.27.100.21", + "2.16.840.1.113719.1.27.100.23", + "2.16.840.1.113719.1.27.100.25", + "2.16.840.1.113719.1.27.100.27", + "2.16.840.1.113719.1.27.100.29", + "2.16.840.1.113719.1.27.100.31", + "2.16.840.1.113719.1.27.100.33", + "2.16.840.1.113719.1.27.100.35", + "2.16.840.1.113719.1.27.100.37", + "2.16.840.1.113719.1.27.100.39", + "2.16.840.1.113719.1.27.100.41", + "2.16.840.1.113719.1.27.100.96", + "2.16.840.1.113719.1.27.100.98", + "2.16.840.1.113719.1.27.100.101", + "2.16.840.1.113719.1.27.100.103", + "2.16.840.1.113719.1.142.100.1", + "2.16.840.1.113719.1.142.100.4", + "2.16.840.1.113719.1.142.100.6", + "2.16.840.1.113719.1.27.100.9", + "2.16.840.1.113719.1.27.100.43", + "2.16.840.1.113719.1.27.100.45", + "2.16.840.1.113719.1.27.100.47", + "2.16.840.1.113719.1.27.100.49", + "2.16.840.1.113719.1.27.100.51", + "2.16.840.1.113719.1.27.100.53", + "2.16.840.1.113719.1.27.100.55", + "1.3.6.1.4.1.1466.20037", + "2.16.840.1.113719.1.27.100.79", + "2.16.840.1.113719.1.27.100.84", + "2.16.840.1.113719.1.27.103.1", + "2.16.840.1.113719.1.27.103.2" + ], + "supportedFeatures": [ + "1.3.6.1.4.1.4203.1.5.1", + "2.16.840.1.113719.1.27.99.1" + ], + "supportedGroupingTypes": [ + "2.16.840.1.113719.1.27.103.8" + ], + "supportedLDAPVersion": [ + "2", + "3" + ], + "supportedSASLMechanisms": [ + "NMAS_LOGIN" + ], + "unAuthBinds": [ + "0" + ], + "vendorName": [ + "NetIQ Corporation" + ], + "vendorVersion": [ + "LDAP Agent for NetIQ eDirectory 9.1.4 (40105.09)" + ], + "wholeSubtreeSearchOps": [ + "0" + ] + }, + "type": "DsaInfo" +} +""" \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/slapd24.py b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/slapd24.py new file mode 100644 index 0000000000000000000000000000000000000000..1c6633249b3e522d5f383490f7cf52825fecac59 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/protocol/schemas/slapd24.py @@ -0,0 +1,758 @@ +""" +""" + +# Created on 2014.10.21 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +slapd_2_4_schema = """ +{ + "raw": { + "attributeTypes": [ + "( 2.5.4.0 NAME 'objectClass' DESC 'RFC4512: object classes of the entity' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", + "( 2.5.21.9 NAME 'structuralObjectClass' DESC 'RFC4512: structural object class of entry' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.1 NAME 'createTimestamp' DESC 'RFC4512: time which object was created' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.2 NAME 'modifyTimestamp' DESC 'RFC4512: time which object was last modified' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.3 NAME 'creatorsName' DESC 'RFC4512: name of creator' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.4 NAME 'modifiersName' DESC 'RFC4512: name of last modifier' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.9 NAME 'hasSubordinates' DESC 'X.501: entry has children' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 2.5.18.10 NAME 'subschemaSubentry' DESC 'RFC4512: name of controlling subschema entry' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.1.20 NAME 'entryDN' DESC 'DN of the entry' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.1.16.4 NAME 'entryUUID' DESC 'UUID of the entry' EQUALITY UUIDMatch ORDERING UUIDOrderingMatch SYNTAX 1.3.6.1.1.16.1 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' DESC 'RFC4512: alternative servers' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 USAGE dSAOperation )", + "( 1.3.6.1.4.1.1466.101.120.5 NAME 'namingContexts' DESC 'RFC4512: naming contexts' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE dSAOperation )", + "( 1.3.6.1.4.1.1466.101.120.13 NAME 'supportedControl' DESC 'RFC4512: supported controls' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )", + "( 1.3.6.1.4.1.1466.101.120.7 NAME 'supportedExtension' DESC 'RFC4512: supported extended operations' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )", + "( 1.3.6.1.4.1.1466.101.120.15 NAME 'supportedLDAPVersion' DESC 'RFC4512: supported LDAP versions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 USAGE dSAOperation )", + "( 1.3.6.1.4.1.1466.101.120.14 NAME 'supportedSASLMechanisms' DESC 'RFC4512: supported SASL mechanisms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE dSAOperation )", + "( 1.3.6.1.4.1.4203.1.3.5 NAME 'supportedFeatures' DESC 'RFC4512: features supported by the server' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )", + "( 1.3.6.1.1.4 NAME 'vendorName' DESC 'RFC3045: name of implementation vendor' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )", + "( 1.3.6.1.1.5 NAME 'vendorVersion' DESC 'RFC3045: version of implementation' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )", + "( 2.5.21.4 NAME 'matchingRules' DESC 'RFC4512: matching rules' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.30 USAGE directoryOperation )", + "( 2.5.21.5 NAME 'attributeTypes' DESC 'RFC4512: attribute types' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.3 USAGE directoryOperation )", + "( 2.5.21.6 NAME 'objectClasses' DESC 'RFC4512: object classes' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.37 USAGE directoryOperation )", + "( 2.5.21.8 NAME 'matchingRuleUse' DESC 'RFC4512: matching rule uses' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.31 USAGE directoryOperation )", + "( 1.3.6.1.4.1.1466.101.120.16 NAME 'ldapSyntaxes' DESC 'RFC4512: LDAP syntaxes' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.54 USAGE directoryOperation )", + "( 2.5.4.1 NAME ( 'aliasedObjectName' 'aliasedEntryName' ) DESC 'RFC4512: name of aliased object' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 2.16.840.1.113730.3.1.34 NAME 'ref' DESC 'RFC3296: subordinate referral URL' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE distributedOperation )", + "( 1.3.6.1.4.1.1466.101.119.3 NAME 'entryTtl' DESC 'RFC2589: entry time-to-live' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )", + "( 1.3.6.1.4.1.1466.101.119.4 NAME 'dynamicSubtrees' DESC 'RFC2589: dynamic subtrees' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE dSAOperation )", + "( 2.5.4.49 NAME 'distinguishedName' DESC 'RFC4519: common supertype of DN attributes' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.5.4.41 NAME 'name' DESC 'RFC4519: common supertype of name attributes' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )", + "( 2.5.4.3 NAME ( 'cn' 'commonName' ) DESC 'RFC4519: common name(s) for which the entity is known by' SUP name )", + "( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userid' ) DESC 'RFC4519: user identifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 1.3.6.1.1.1.1.0 NAME 'uidNumber' DESC 'RFC2307: An integer uniquely identifying a user in an administrative domain' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.1 NAME 'gidNumber' DESC 'RFC2307: An integer uniquely identifying a group in an administrative domain' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 2.5.4.35 NAME 'userPassword' DESC 'RFC4519/2307: password of user' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )", + "( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI' DESC 'RFC2079: Uniform Resource Identifier with optional label' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.4.13 NAME 'description' DESC 'RFC4519: descriptive information' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )", + "( 2.5.4.34 NAME 'seeAlso' DESC 'RFC4519: DN of related object' SUP distinguishedName )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.78 NAME 'olcConfigFile' DESC 'File for slapd configuration directives' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.79 NAME 'olcConfigDir' DESC 'Directory for slapd configuration backend' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.1 NAME 'olcAccess' DESC 'Access Control List' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.86 NAME 'olcAddContentAcl' DESC 'Check ACLs against content of Add ops' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.2 NAME 'olcAllows' DESC 'Allowed set of deprecated features' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.3 NAME 'olcArgsFile' DESC 'File for slapd command line options' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.5 NAME 'olcAttributeOptions' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.4 NAME 'olcAttributeTypes' DESC 'OpenLDAP attributeTypes' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.6 NAME 'olcAuthIDRewrite' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.7 NAME 'olcAuthzPolicy' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.8 NAME 'olcAuthzRegexp' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.9 NAME 'olcBackend' DESC 'A type of backend' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORDERED 'SIBLINGS' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.10 NAME 'olcConcurrency' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.11 NAME 'olcConnMaxPending' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.12 NAME 'olcConnMaxPendingAuth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.13 NAME 'olcDatabase' DESC 'The backend type for a database instance' SUP olcBackend SINGLE-VALUE X-ORDERED 'SIBLINGS' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.14 NAME 'olcDefaultSearchBase' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.15 NAME 'olcDisallows' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.16 NAME 'olcDitContentRules' DESC 'OpenLDAP DIT content rules' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.20 NAME 'olcExtraAttrs' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.17 NAME 'olcGentleHUP' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.17 NAME 'olcHidden' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.18 NAME 'olcIdleTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.19 NAME 'olcInclude' SUP labeledURI )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.20 NAME 'olcIndexSubstrIfMinLen' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.21 NAME 'olcIndexSubstrIfMaxLen' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.22 NAME 'olcIndexSubstrAnyLen' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.23 NAME 'olcIndexSubstrAnyStep' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.84 NAME 'olcIndexIntLen' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.4 NAME 'olcLastMod' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.85 NAME 'olcLdapSyntaxes' DESC 'OpenLDAP ldapSyntax' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.5 NAME 'olcLimits' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.93 NAME 'olcListenerThreads' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.26 NAME 'olcLocalSSF' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.27 NAME 'olcLogFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.28 NAME 'olcLogLevel' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.6 NAME 'olcMaxDerefDepth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.16 NAME 'olcMirrorMode' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.30 NAME 'olcModuleLoad' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.31 NAME 'olcModulePath' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.18 NAME 'olcMonitoring' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.32 NAME 'olcObjectClasses' DESC 'OpenLDAP object classes' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.33 NAME 'olcObjectIdentifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.34 NAME 'olcOverlay' SUP olcDatabase SINGLE-VALUE X-ORDERED 'SIBLINGS' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.35 NAME 'olcPasswordCryptSaltFormat' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.36 NAME 'olcPasswordHash' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.37 NAME 'olcPidFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.38 NAME 'olcPlugin' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.39 NAME 'olcPluginLogFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.40 NAME 'olcReadOnly' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.41 NAME 'olcReferral' SUP labeledURI SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.7 NAME 'olcReplica' SUP labeledURI EQUALITY caseIgnoreMatch X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.43 NAME 'olcReplicaArgsFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.44 NAME 'olcReplicaPidFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.45 NAME 'olcReplicationInterval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.46 NAME 'olcReplogFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.47 NAME 'olcRequires' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.48 NAME 'olcRestrict' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.49 NAME 'olcReverseLookup' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.8 NAME 'olcRootDN' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.51 NAME 'olcRootDSE' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.9 NAME 'olcRootPW' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.89 NAME 'olcSaslAuxprops' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.53 NAME 'olcSaslHost' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.54 NAME 'olcSaslRealm' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.56 NAME 'olcSaslSecProps' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.58 NAME 'olcSchemaDN' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.59 NAME 'olcSecurity' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.81 NAME 'olcServerID' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.60 NAME 'olcSizeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.61 NAME 'olcSockbufMaxIncoming' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.62 NAME 'olcSockbufMaxIncomingAuth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.83 NAME 'olcSortVals' DESC 'Attributes whose values will always be sorted' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.15 NAME 'olcSubordinate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.10 NAME 'olcSuffix' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.19 NAME 'olcSyncUseSubentry' DESC 'Store sync context in a subentry' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.11 NAME 'olcSyncrepl' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.90 NAME 'olcTCPBuffer' DESC 'Custom TCP buffer size' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.66 NAME 'olcThreads' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.67 NAME 'olcTimeLimit' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.68 NAME 'olcTLSCACertificateFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.69 NAME 'olcTLSCACertificatePath' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.70 NAME 'olcTLSCertificateFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.71 NAME 'olcTLSCertificateKeyFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.72 NAME 'olcTLSCipherSuite' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.73 NAME 'olcTLSCRLCheck' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.82 NAME 'olcTLSCRLFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.74 NAME 'olcTLSRandFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.75 NAME 'olcTLSVerifyClient' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.77 NAME 'olcTLSDHParamFile' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.87 NAME 'olcTLSProtocolMin' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.80 NAME 'olcToolThreads' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.12 NAME 'olcUpdateDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.13 NAME 'olcUpdateRef' SUP labeledURI EQUALITY caseIgnoreMatch )", + "( 1.3.6.1.4.1.4203.1.12.2.3.0.88 NAME 'olcWriteTimeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.1 NAME 'olcDbDirectory' DESC 'Directory for database content' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.11 NAME 'olcDbCacheFree' DESC 'Number of extra entries to free when max is reached' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.1 NAME 'olcDbCacheSize' DESC 'Entry cache size in entries' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.2 NAME 'olcDbCheckpoint' DESC 'Database checkpoint interval in kbytes and minutes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.16 NAME 'olcDbChecksum' DESC 'Enable database checksum validation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.13 NAME 'olcDbCryptFile' DESC 'Pathname of file containing the DB encryption key' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.14 NAME 'olcDbCryptKey' DESC 'DB encryption key' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.3 NAME 'olcDbConfig' DESC 'BerkeleyDB DB_CONFIG configuration directives' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.4 NAME 'olcDbNoSync' DESC 'Disable synchronous database writes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.15 NAME 'olcDbPageSize' DESC 'Page size of specified DB, in Kbytes' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.5 NAME 'olcDbDirtyRead' DESC 'Allow reads of uncommitted data' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.12 NAME 'olcDbDNcacheSize' DESC 'DN cache size' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.6 NAME 'olcDbIDLcacheSize' DESC 'IDL cache size in IDLs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.2 NAME 'olcDbIndex' DESC 'Attribute index parameters' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.7 NAME 'olcDbLinearIndex' DESC 'Index attributes one at a time' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.8 NAME 'olcDbLockDetect' DESC 'Deadlock detection algorithm' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.3 NAME 'olcDbMode' DESC 'Unix permissions of database files' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.9 NAME 'olcDbSearchStack' DESC 'Depth of search stack in IDLs' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.1.10 NAME 'olcDbShmKey' DESC 'Key for shared memory region' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.0.14 NAME 'olcDbURI' DESC 'URI (list) for remote DSA' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.1 NAME 'olcDbStartTLS' DESC 'StartTLS' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.2 NAME 'olcDbACLAuthcDn' DESC 'Remote ACL administrative identity' OBSOLETE SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.3 NAME 'olcDbACLPasswd' DESC 'Remote ACL administrative identity credentials' OBSOLETE SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.4 NAME 'olcDbACLBind' DESC 'Remote ACL administrative identity auth bind configuration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.5 NAME 'olcDbIDAssertAuthcDn' DESC 'Remote Identity Assertion administrative identity' OBSOLETE SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.6 NAME 'olcDbIDAssertPasswd' DESC 'Remote Identity Assertion administrative identity credentials' OBSOLETE SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.7 NAME 'olcDbIDAssertBind' DESC 'Remote Identity Assertion administrative identity auth bind configuration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.8 NAME 'olcDbIDAssertMode' DESC 'Remote Identity Assertion mode' OBSOLETE SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.9 NAME 'olcDbIDAssertAuthzFrom' DESC 'Remote Identity Assertion authz rules' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.10 NAME 'olcDbRebindAsUser' DESC 'Rebind as user' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.11 NAME 'olcDbChaseReferrals' DESC 'Chase referrals' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.12 NAME 'olcDbTFSupport' DESC 'Absolute filters support' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.13 NAME 'olcDbProxyWhoAmI' DESC 'Proxy whoAmI exop' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.14 NAME 'olcDbTimeout' DESC 'Per-operation timeouts' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.15 NAME 'olcDbIdleTimeout' DESC 'connection idle timeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.16 NAME 'olcDbConnTtl' DESC 'connection ttl' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.17 NAME 'olcDbNetworkTimeout' DESC 'connection network timeout' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.18 NAME 'olcDbProtocolVersion' DESC 'protocol version' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.19 NAME 'olcDbSingleConn' DESC 'cache a single connection per identity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.20 NAME 'olcDbCancel' DESC 'abandon/ignore/exop operations when appropriate' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.21 NAME 'olcDbQuarantine' DESC 'Quarantine database if connection fails and retry according to rule' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.22 NAME 'olcDbUseTemporaryConn' DESC 'Use temporary connections if the cached one is busy' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.23 NAME 'olcDbConnectionPoolMax' DESC 'Max size of privileged connections pool' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.25 NAME 'olcDbNoRefs' DESC 'Do not return search reference responses' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.26 NAME 'olcDbNoUndefFilter' DESC 'Do not propagate undefined search filters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.3.27 NAME 'olcDbIDAssertPassThru' DESC 'Remote Identity Assertion passthru rules' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.3.1 NAME 'olcChainingBehavior' DESC 'Chaining behavior control parameters (draft-sermersheim-ldap-chaining)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.3.2 NAME 'olcChainCacheURI' DESC 'Enables caching of URIs not present in configuration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.3.3 NAME 'olcChainMaxReferralDepth' DESC 'max referral depth' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.3.4 NAME 'olcChainReturnError' DESC 'Errors are returned instead of the original referral' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.2.5.1 NAME 'olcRelay' DESC 'Relay DN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.1 NAME 'olcAccessLogDB' DESC 'Suffix of database for log content' SUP distinguishedName SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.2 NAME 'olcAccessLogOps' DESC 'Operation types to log' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.3 NAME 'olcAccessLogPurge' DESC 'Log cleanup parameters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.4 NAME 'olcAccessLogSuccess' DESC 'Log successful ops only' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.5 NAME 'olcAccessLogOld' DESC 'Log old values when modifying entries matching the filter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.6 NAME 'olcAccessLogOldAttr' DESC 'Log old values of these attributes even if unmodified' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.4.7 NAME 'olcAccessLogBase' DESC 'Operation types to log under a specific branch' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.15.1 NAME 'olcAuditlogFile' DESC 'Filename for auditlogging' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.19.1 NAME 'olcCollectInfo' DESC 'DN of entry and attribute to distribute' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.13.1 NAME 'olcConstraintAttribute' DESC 'constraint for list of attributes' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.1 NAME 'olcDDSstate' DESC 'RFC2589 Dynamic directory services state' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.2 NAME 'olcDDSmaxTtl' DESC 'RFC2589 Dynamic directory services max TTL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.3 NAME 'olcDDSminTtl' DESC 'RFC2589 Dynamic directory services min TTL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.4 NAME 'olcDDSdefaultTtl' DESC 'RFC2589 Dynamic directory services default TTL' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.5 NAME 'olcDDSinterval' DESC 'RFC2589 Dynamic directory services expiration task run interval' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.6 NAME 'olcDDStolerance' DESC 'RFC2589 Dynamic directory services additional TTL in expiration scheduling' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.9.7 NAME 'olcDDSmaxDynamicObjects' DESC 'RFC2589 Dynamic directory services max number of dynamic objects' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.17.1 NAME 'olcDGAttrPair' DESC 'Member and MemberURL attribute pair' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.8.1 NAME 'olcDlAttrSet' DESC 'Dynamic list: , , ' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.2.840.113556.1.2.102 NAME 'memberOf' DESC 'Group that the entry belongs to' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE dSAOperation X-ORIGIN 'iPlanet Delegated Administrator' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.0 NAME 'olcMemberOfDN' DESC 'DN to be used as modifiersName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.1 NAME 'olcMemberOfDangling' DESC 'Behavior with respect to dangling members, constrained to ignore, drop, error' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.2 NAME 'olcMemberOfRefInt' DESC 'Take care of referential integrity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.3 NAME 'olcMemberOfGroupOC' DESC 'Group objectClass' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.4 NAME 'olcMemberOfMemberAD' DESC 'member attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.5 NAME 'olcMemberOfMemberOfAD' DESC 'memberOf attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.18.7 NAME 'olcMemberOfDanglingError' DESC 'Error code returned in case of dangling back reference' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.42.2.27.8.1.16 NAME 'pwdChangedTime' DESC 'The time the password was last changed' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.17 NAME 'pwdAccountLockedTime' DESC 'The time an user account was locked' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.19 NAME 'pwdFailureTime' DESC 'The timestamps of the last consecutive authentication failures' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.20 NAME 'pwdHistory' DESC 'The history of users passwords' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.21 NAME 'pwdGraceUseTime' DESC 'The timestamps of the grace login once the password has expired' EQUALITY generalizedTimeMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 NO-USER-MODIFICATION USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.22 NAME 'pwdReset' DESC 'The indication that the password has been reset' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE USAGE directoryOperation )", + "( 1.3.6.1.4.1.42.2.27.8.1.23 NAME 'pwdPolicySubentry' DESC 'The pwdPolicy subentry in effect for this object' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE USAGE directoryOperation )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.12.1 NAME 'olcPPolicyDefault' DESC 'DN of a pwdPolicy object for uncustomized objects' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.12.2 NAME 'olcPPolicyHashCleartext' DESC 'Hash passwords on add or modify' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.12.4 NAME 'olcPPolicyForwardUpdates' DESC 'Allow policy state updates to be forwarded via updateref' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.12.3 NAME 'olcPPolicyUseLockout' DESC 'Warn clients with AccountLocked' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.1 NAME ( 'olcPcache' 'olcProxyCache' ) DESC 'Proxy Cache basic parameters' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.2 NAME ( 'olcPcacheAttrset' 'olcProxyAttrset' ) DESC 'A set of attributes to cache' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.3 NAME ( 'olcPcacheTemplate' 'olcProxyCacheTemplate' ) DESC 'Filter template, attrset, cache TTL, optional negative TTL, optional sizelimit TTL, optional TTR' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.4 NAME 'olcPcachePosition' DESC 'Response callback position in overlay stack' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.5 NAME ( 'olcPcacheMaxQueries' 'olcProxyCacheQueries' ) DESC 'Maximum number of queries to cache' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.6 NAME ( 'olcPcachePersist' 'olcProxySaveQueries' ) DESC 'Save cached queries for hot restart' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.7 NAME ( 'olcPcacheValidate' 'olcProxyCheckCacheability' ) DESC 'Check whether the results of a query are cacheable, e.g. for schema issues' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.8 NAME 'olcPcacheOffline' DESC 'Set cache to offline mode and disable expiration' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.2.9 NAME 'olcPcacheBind' DESC 'Parameters for caching Binds' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.11.1 NAME 'olcRefintAttribute' DESC 'Attributes for referential integrity' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.11.2 NAME 'olcRefintNothing' DESC 'Replacement DN to supply when needed' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.11.3 NAME 'olcRefintModifiersName' DESC 'The DN to use as modifiersName' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.20.1 NAME 'olcRetcodeParent' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.20.2 NAME 'olcRetcodeItem' DESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.20.3 NAME 'olcRetcodeInDir' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.20.4 NAME 'olcRetcodeSleep' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.16.1 NAME 'olcRwmRewrite' DESC 'Rewrites strings' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.16.2 NAME 'olcRwmTFSupport' DESC 'Absolute filters support' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.16.3 NAME 'olcRwmMap' DESC 'maps attributes/objectClasses' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORDERED 'VALUES' )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.16.4 NAME 'olcRwmNormalizeMapped' DESC 'Normalize mapped attributes/objectClasses' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.16.5 NAME 'olcRwmDropUnrequested' DESC 'Drop unrequested attributes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.21.1 NAME 'olcSssVlvMax' DESC 'Maximum number of concurrent Sort requests' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.21.2 NAME 'olcSssVlvMaxKeys' DESC 'Maximum number of Keys in a Sort request' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.21.3 NAME 'olcSssVlvMaxPerConn' DESC 'Maximum number of concurrent paged search requests per connection' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.1.1 NAME 'olcSpCheckpoint' DESC 'ContextCSN checkpoint interval in ops and minutes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.1.2 NAME 'olcSpSessionlog' DESC 'Session log size in ops' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.1.3 NAME 'olcSpNoPresent' DESC 'Omit Present phase processing' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.1.4 NAME 'olcSpReloadHint' DESC 'Observe Reload Hint in Request control' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.14.1 NAME 'olcTranslucentStrict' DESC 'Reveal attribute deletion constraint violations' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.14.2 NAME 'olcTranslucentNoGlue' DESC 'Disable automatic glue records for ADD and MODRDN' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.14.3 NAME 'olcTranslucentLocal' DESC 'Attributes to use in local search filter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.14.4 NAME 'olcTranslucentRemote' DESC 'Attributes to use in remote search filter' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.14.5 NAME 'olcTranslucentBindLocal' DESC 'Enable local bind' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.14.6 NAME 'olcTranslucentPwModLocal' DESC 'Enable local RFC 3062 Password Modify extended operation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.10.1 NAME 'olcUniqueBase' DESC 'Subtree for uniqueness searches' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.10.2 NAME 'olcUniqueIgnore' DESC 'Attributes for which uniqueness shall not be enforced' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.10.3 NAME 'olcUniqueAttribute' DESC 'Attributes for which uniqueness shall be enforced' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.10.4 NAME 'olcUniqueStrict' DESC 'Enforce uniqueness of null values' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.10.5 NAME 'olcUniqueURI' DESC 'List of keywords and LDAP URIs for a uniqueness domain' EQUALITY caseExactMatch ORDERING caseExactOrderingMatch SUBSTR caseExactSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.4203.1.12.2.3.3.5.1 NAME 'olcValSortAttr' DESC 'Sorting rule for attribute under given DN' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.4.2 NAME 'knowledgeInformation' DESC 'RFC2256: knowledge information' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )", + "( 2.5.4.4 NAME ( 'sn' 'surname' ) DESC 'RFC2256: last (family) name(s) for which the entity is known by' SUP name )", + "( 2.5.4.5 NAME 'serialNumber' DESC 'RFC2256: serial number of the entity' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} )", + "( 2.5.4.6 NAME ( 'c' 'countryName' ) DESC 'RFC4519: two-letter ISO-3166 country code' SUP name SYNTAX 1.3.6.1.4.1.1466.115.121.1.11 SINGLE-VALUE )", + "( 2.5.4.7 NAME ( 'l' 'localityName' ) DESC 'RFC2256: locality which this object resides in' SUP name )", + "( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' ) DESC 'RFC2256: state or province which this object resides in' SUP name )", + "( 2.5.4.9 NAME ( 'street' 'streetAddress' ) DESC 'RFC2256: street address of this object' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )", + "( 2.5.4.10 NAME ( 'o' 'organizationName' ) DESC 'RFC2256: organization this object belongs to' SUP name )", + "( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' ) DESC 'RFC2256: organizational unit this object belongs to' SUP name )", + "( 2.5.4.12 NAME 'title' DESC 'RFC2256: title associated with the entity' SUP name )", + "( 2.5.4.14 NAME 'searchGuide' DESC 'RFC2256: search guide, deprecated by enhancedSearchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )", + "( 2.5.4.15 NAME 'businessCategory' DESC 'RFC2256: business category' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )", + "( 2.5.4.16 NAME 'postalAddress' DESC 'RFC2256: postal address' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )", + "( 2.5.4.17 NAME 'postalCode' DESC 'RFC2256: postal code' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )", + "( 2.5.4.18 NAME 'postOfficeBox' DESC 'RFC2256: Post Office Box' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )", + "( 2.5.4.19 NAME 'physicalDeliveryOfficeName' DESC 'RFC2256: Physical Delivery Office Name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )", + "( 2.5.4.20 NAME 'telephoneNumber' DESC 'RFC2256: Telephone Number' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )", + "( 2.5.4.21 NAME 'telexNumber' DESC 'RFC2256: Telex Number' SYNTAX 1.3.6.1.4.1.1466.115.121.1.52 )", + "( 2.5.4.22 NAME 'teletexTerminalIdentifier' DESC 'RFC2256: Teletex Terminal Identifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.51 )", + "( 2.5.4.23 NAME ( 'facsimileTelephoneNumber' 'fax' ) DESC 'RFC2256: Facsimile (Fax) Telephone Number' SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 )", + "( 2.5.4.24 NAME 'x121Address' DESC 'RFC2256: X.121 Address' EQUALITY numericStringMatch SUBSTR numericStringSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{15} )", + "( 2.5.4.25 NAME 'internationaliSDNNumber' DESC 'RFC2256: international ISDN number' EQUALITY numericStringMatch SUBSTR numericStringSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} )", + "( 2.5.4.26 NAME 'registeredAddress' DESC 'RFC2256: registered postal address' SUP postalAddress SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )", + "( 2.5.4.27 NAME 'destinationIndicator' DESC 'RFC2256: destination indicator' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} )", + "( 2.5.4.28 NAME 'preferredDeliveryMethod' DESC 'RFC2256: preferred delivery method' SYNTAX 1.3.6.1.4.1.1466.115.121.1.14 SINGLE-VALUE )", + "( 2.5.4.29 NAME 'presentationAddress' DESC 'RFC2256: presentation address' EQUALITY presentationAddressMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.43 SINGLE-VALUE )", + "( 2.5.4.30 NAME 'supportedApplicationContext' DESC 'RFC2256: supported application context' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", + "( 2.5.4.31 NAME 'member' DESC 'RFC2256: member of a group' SUP distinguishedName )", + "( 2.5.4.32 NAME 'owner' DESC 'RFC2256: owner (of the object)' SUP distinguishedName )", + "( 2.5.4.33 NAME 'roleOccupant' DESC 'RFC2256: occupant of role' SUP distinguishedName )", + "( 2.5.4.36 NAME 'userCertificate' DESC 'RFC2256: X.509 user certificate, use ;binary' EQUALITY certificateExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )", + "( 2.5.4.37 NAME 'cACertificate' DESC 'RFC2256: X.509 CA certificate, use ;binary' EQUALITY certificateExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )", + "( 2.5.4.38 NAME 'authorityRevocationList' DESC 'RFC2256: X.509 authority revocation list, use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )", + "( 2.5.4.39 NAME 'certificateRevocationList' DESC 'RFC2256: X.509 certificate revocation list, use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )", + "( 2.5.4.40 NAME 'crossCertificatePair' DESC 'RFC2256: X.509 cross certificate pair, use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.10 )", + "( 2.5.4.42 NAME ( 'givenName' 'gn' ) DESC 'RFC2256: first name(s) for which the entity is known by' SUP name )", + "( 2.5.4.43 NAME 'initials' DESC 'RFC2256: initials of some or all of names, but not the surname(s).' SUP name )", + "( 2.5.4.44 NAME 'generationQualifier' DESC 'RFC2256: name qualifier indicating a generation' SUP name )", + "( 2.5.4.45 NAME 'x500UniqueIdentifier' DESC 'RFC2256: X.500 unique identifier' EQUALITY bitStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )", + "( 2.5.4.46 NAME 'dnQualifier' DESC 'RFC2256: DN qualifier' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )", + "( 2.5.4.47 NAME 'enhancedSearchGuide' DESC 'RFC2256: enhanced search guide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.21 )", + "( 2.5.4.48 NAME 'protocolInformation' DESC 'RFC2256: protocol information' EQUALITY protocolInformationMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.42 )", + "( 2.5.4.50 NAME 'uniqueMember' DESC 'RFC2256: unique member of a group' EQUALITY uniqueMemberMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )", + "( 2.5.4.51 NAME 'houseIdentifier' DESC 'RFC2256: house identifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )", + "( 2.5.4.52 NAME 'supportedAlgorithms' DESC 'RFC2256: supported algorithms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.49 )", + "( 2.5.4.53 NAME 'deltaRevocationList' DESC 'RFC2256: delta revocation list; use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )", + "( 2.5.4.54 NAME 'dmdName' DESC 'RFC2256: name of DMD' SUP name )", + "( 2.5.4.65 NAME 'pseudonym' DESC 'X.520(4th): pseudonym for the object' SUP name )", + "( 0.9.2342.19200300.100.1.3 NAME ( 'mail' 'rfc822Mailbox' ) DESC 'RFC1274: RFC822 Mailbox' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )", + "( 0.9.2342.19200300.100.1.25 NAME ( 'dc' 'domainComponent' ) DESC 'RFC1274/2247: domain component' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.37 NAME 'associatedDomain' DESC 'RFC1274: domain associated with object' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.2.840.113549.1.9.1 NAME ( 'email' 'emailAddress' 'pkcs9email' ) DESC 'RFC3280: legacy attribute for email addresses in DNs' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )", + "( 0.9.2342.19200300.100.1.2 NAME 'textEncodedORAddress' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.4 NAME 'info' DESC 'RFC1274: general information' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{2048} )", + "( 0.9.2342.19200300.100.1.5 NAME ( 'drink' 'favouriteDrink' ) DESC 'RFC1274: favorite drink' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' DESC 'RFC1274: room number' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.7 NAME 'photo' DESC 'RFC1274: photo (G3 fax)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.23{25000} )", + "( 0.9.2342.19200300.100.1.8 NAME 'userClass' DESC 'RFC1274: category of user' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.9 NAME 'host' DESC 'RFC1274: host computer' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.10 NAME 'manager' DESC 'RFC1274: DN of manager' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.11 NAME 'documentIdentifier' DESC 'RFC1274: unique identifier of document' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.12 NAME 'documentTitle' DESC 'RFC1274: title of document' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.13 NAME 'documentVersion' DESC 'RFC1274: version of document' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.14 NAME 'documentAuthor' DESC 'RFC1274: DN of author of document' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.15 NAME 'documentLocation' DESC 'RFC1274: location of document original' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.20 NAME ( 'homePhone' 'homeTelephoneNumber' ) DESC 'RFC1274: home telephone number' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )", + "( 0.9.2342.19200300.100.1.21 NAME 'secretary' DESC 'RFC1274: DN of secretary' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.22 NAME 'otherMailbox' SYNTAX 1.3.6.1.4.1.1466.115.121.1.39 )", + "( 0.9.2342.19200300.100.1.26 NAME 'aRecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 0.9.2342.19200300.100.1.27 NAME 'mDRecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 0.9.2342.19200300.100.1.28 NAME 'mXRecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 0.9.2342.19200300.100.1.29 NAME 'nSRecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 0.9.2342.19200300.100.1.30 NAME 'sOARecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 0.9.2342.19200300.100.1.31 NAME 'cNAMERecord' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 0.9.2342.19200300.100.1.38 NAME 'associatedName' DESC 'RFC1274: DN of entry associated with domain' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress' DESC 'RFC1274: home postal address' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )", + "( 0.9.2342.19200300.100.1.40 NAME 'personalTitle' DESC 'RFC1274: personal title' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.41 NAME ( 'mobile' 'mobileTelephoneNumber' ) DESC 'RFC1274: mobile telephone number' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )", + "( 0.9.2342.19200300.100.1.42 NAME ( 'pager' 'pagerTelephoneNumber' ) DESC 'RFC1274: pager telephone number' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )", + "( 0.9.2342.19200300.100.1.43 NAME ( 'co' 'friendlyCountryName' ) DESC 'RFC1274: friendly country name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 0.9.2342.19200300.100.1.44 NAME 'uniqueIdentifier' DESC 'RFC1274: unique identifer' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.45 NAME 'organizationalStatus' DESC 'RFC1274: organizational status' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.46 NAME 'janetMailbox' DESC 'RFC1274: Janet mailbox' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )", + "( 0.9.2342.19200300.100.1.47 NAME 'mailPreferenceOption' DESC 'RFC1274: mail preference option' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 0.9.2342.19200300.100.1.48 NAME 'buildingName' DESC 'RFC1274: name of building' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + "( 0.9.2342.19200300.100.1.49 NAME 'dSAQuality' DESC 'RFC1274: DSA Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.19 SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.50 NAME 'singleLevelQuality' DESC 'RFC1274: Single Level Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.13 SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.51 NAME 'subtreeMinimumQuality' DESC 'RFC1274: Subtree Mininum Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.13 SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.52 NAME 'subtreeMaximumQuality' DESC 'RFC1274: Subtree Maximun Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.13 SINGLE-VALUE )", + "( 0.9.2342.19200300.100.1.53 NAME 'personalSignature' DESC 'RFC1274: Personal Signature (G3 fax)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.23 )", + "( 0.9.2342.19200300.100.1.54 NAME 'dITRedirect' DESC 'RFC1274: DIT Redirect' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 0.9.2342.19200300.100.1.55 NAME 'audio' DESC 'RFC1274: audio (u-law)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.4{25000} )", + "( 0.9.2342.19200300.100.1.56 NAME 'documentPublisher' DESC 'RFC1274: publisher of document' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.1.1 NAME 'carLicense' DESC 'RFC2798: vehicle license or registration plate' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.1.2 NAME 'departmentNumber' DESC 'RFC2798: identifies a department within an organization' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.16.840.1.113730.3.1.241 NAME 'displayName' DESC 'RFC2798: preferred name to be used when displaying entries' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 2.16.840.1.113730.3.1.3 NAME 'employeeNumber' DESC 'RFC2798: numerically identifies an employee within an organization' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 2.16.840.1.113730.3.1.4 NAME 'employeeType' DESC 'RFC2798: type of employment for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 0.9.2342.19200300.100.1.60 NAME 'jpegPhoto' DESC 'RFC2798: a JPEG image' SYNTAX 1.3.6.1.4.1.1466.115.121.1.28 )", + "( 2.16.840.1.113730.3.1.39 NAME 'preferredLanguage' DESC 'RFC2798: preferred written or spoken language for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 2.16.840.1.113730.3.1.40 NAME 'userSMIMECertificate' DESC 'RFC2798: PKCS#7 SignedData used to support S/MIME' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )", + "( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' DESC 'RFC2798: personal identity information, a PKCS #12 PFX' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )", + "( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; the common name' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.3 NAME 'homeDirectory' DESC 'The absolute path to the home directory' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.4 NAME 'loginShell' DESC 'The path to the login shell' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.5 NAME 'shadowLastChange' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.6 NAME 'shadowMin' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.7 NAME 'shadowMax' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.8 NAME 'shadowWarning' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.9 NAME 'shadowInactive' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.10 NAME 'shadowExpire' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.11 NAME 'shadowFlag' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.12 NAME 'memberUid' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.13 NAME 'memberNisNetgroup' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.14 NAME 'nisNetgroupTriple' DESC 'Netgroup triple' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.15 NAME 'ipServicePort' DESC 'Service port number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.16 NAME 'ipServiceProtocol' DESC 'Service protocol name' SUP name )", + "( 1.3.6.1.1.1.1.17 NAME 'ipProtocolNumber' DESC 'IP protocol number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.18 NAME 'oncRpcNumber' DESC 'ONC RPC number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.19 NAME 'ipHostNumber' DESC 'IPv4 addresses as a dotted decimal omitting leading zeros or IPv6 addresses as defined in RFC2373' SUP name )", + "( 1.3.6.1.1.1.1.20 NAME 'ipNetworkNumber' DESC 'IP network as a dotted decimal, eg. 192.168, omitting leading zeros' SUP name SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.21 NAME 'ipNetmaskNumber' DESC 'IP netmask as a dotted decimal, eg. 255.255.255.0, omitting leading zeros' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.22 NAME 'macAddress' DESC 'MAC address in maximal, colon separated hex notation, eg. 00:00:92:90:ee:e2' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.23 NAME 'bootParameter' DESC 'rpc.bootparamd parameter' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.24 NAME 'bootFile' DESC 'Boot image name' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.26 NAME 'nisMapName' DESC 'Name of a A generic NIS map' SUP name )", + "( 1.3.6.1.1.1.1.27 NAME 'nisMapEntry' DESC 'A generic NIS entry' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.28 NAME 'nisPublicKey' DESC 'NIS public key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.29 NAME 'nisSecretKey' DESC 'NIS secret key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.30 NAME 'nisDomain' DESC 'NIS domain' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.1.1.1.31 NAME 'automountMapName' DESC 'automount Map Name' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.32 NAME 'automountKey' DESC 'Automount Key value' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.1.1.1.33 NAME 'automountInformation' DESC 'Automount information' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.2 NAME 'suseDefaultBase' DESC 'Base DN where new Objects should be created by default' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.3 NAME 'suseNextUniqueId' DESC 'Next unused unique ID, can be used to generate directory wide uniqe IDs' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.4 NAME 'suseMinUniqueId' DESC 'lower Border for Unique IDs' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.5 NAME 'suseMaxUniqueId' DESC 'upper Border for Unique IDs' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.6 NAME 'suseDefaultTemplate' DESC 'The DN of a template that should be used by default' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.7 NAME 'suseSearchFilter' DESC 'Search filter to localize Objects' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.11 NAME 'suseDefaultValue' DESC 'an Attribute-Value-Assertions to define defaults for specific Attributes' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.7057.10.1.2.2.12 NAME 'suseNamingAttribute' DESC 'AttributeType that should be used as the RDN' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.15 NAME 'suseSecondaryGroup' DESC 'seconday group DN' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 1.3.6.1.4.1.7057.10.1.2.2.16 NAME 'suseMinPasswordLength' DESC 'minimum Password length for new users' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.17 NAME 'suseMaxPasswordLength' DESC 'maximum Password length for new users' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.18 NAME 'susePasswordHash' DESC 'Hash method to use for new users' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.19 NAME 'suseSkelDir' DESC '' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.4.1.7057.10.1.2.2.20 NAME 'susePlugin' DESC 'plugin to use upon user/ group creation' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.7057.10.1.2.2.21 NAME 'suseMapAttribute' DESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.3.6.1.4.1.7057.10.1.2.2.22 NAME 'suseImapServer' DESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.23 NAME 'suseImapAdmin' DESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.24 NAME 'suseImapDefaultQuota' DESC '' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )", + "( 1.3.6.1.4.1.7057.10.1.2.2.25 NAME 'suseImapUseSsl' DESC '' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )" + ], + "cn": [ + "Subschema" + ], + "createTimestamp": [ + "20141024204149Z" + ], + "entryDN": [ + "cn=Subschema" + ], + "ldapSyntaxes": [ + "( 1.3.6.1.4.1.1466.115.121.1.4 DESC 'Audio' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )", + "( 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' )", + "( 1.3.6.1.4.1.1466.115.121.1.8 DESC 'Certificate' X-BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.9 DESC 'Certificate List' X-BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.10 DESC 'Certificate Pair' X-BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.4203.666.11.10.2.1 DESC 'X.509 AttributeCertificate' X-BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'Distinguished Name' )", + "( 1.2.36.79672281.1.5.0 DESC 'RDN' )", + "( 1.3.6.1.4.1.1466.115.121.1.14 DESC 'Delivery Method' )", + "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' )", + "( 1.3.6.1.4.1.1466.115.121.1.22 DESC 'Facsimile Telephone Number' )", + "( 1.3.6.1.4.1.1466.115.121.1.24 DESC 'Generalized Time' )", + "( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' )", + "( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' )", + "( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.34 DESC 'Name And Optional UID' )", + "( 1.3.6.1.4.1.1466.115.121.1.36 DESC 'Numeric String' )", + "( 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' )", + "( 1.3.6.1.4.1.1466.115.121.1.39 DESC 'Other Mailbox' )", + "( 1.3.6.1.4.1.1466.115.121.1.40 DESC 'Octet String' )", + "( 1.3.6.1.4.1.1466.115.121.1.41 DESC 'Postal Address' )", + "( 1.3.6.1.4.1.1466.115.121.1.44 DESC 'Printable String' )", + "( 1.3.6.1.4.1.1466.115.121.1.11 DESC 'Country String' )", + "( 1.3.6.1.4.1.1466.115.121.1.45 DESC 'SubtreeSpecification' )", + "( 1.3.6.1.4.1.1466.115.121.1.49 DESC 'Supported Algorithm' X-BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )", + "( 1.3.6.1.4.1.1466.115.121.1.50 DESC 'Telephone Number' )", + "( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' )", + "( 1.3.6.1.1.1.0.0 DESC 'RFC2307 NIS Netgroup Triple' )", + "( 1.3.6.1.1.1.0.1 DESC 'RFC2307 Boot Parameter' )", + "( 1.3.6.1.1.16.1 DESC 'UUID' )" + ], + "matchingRuleUse": [ + "( 1.2.840.113556.1.4.804 NAME 'integerBitOrMatch' APPLIES ( supportedLDAPVersion $ entryTtl $ uidNumber $ gidNumber $ olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ olcIdleTimeout $ olcIndexSubstrIfMinLen $ olcIndexSubstrIfMaxLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcIndexIntLen $ olcListenerThreads $ olcLocalSSF $ olcMaxDerefDepth $ olcReplicationInterval $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcThreads $ olcToolThreads $ olcWriteTimeout $ olcDbCacheFree $ olcDbCacheSize $ olcDbDNcacheSize $ olcDbIDLcacheSize $ olcDbSearchStack $ olcDbShmKey $ olcDbProtocolVersion $ olcDbConnectionPoolMax $ olcChainMaxReferralDepth $ olcDDSmaxDynamicObjects $ olcPcacheMaxQueries $ olcRetcodeSleep $ olcSssVlvMax $ olcSssVlvMaxKeys $ olcSssVlvMaxPerConn $ olcSpSessionlog $ mailPreferenceOption $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipServicePort $ ipProtocolNumber $ oncRpcNumber $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseMinPasswordLength $ suseMaxPasswordLength $ suseImapDefaultQuota ) )", + "( 1.2.840.113556.1.4.803 NAME 'integerBitAndMatch' APPLIES ( supportedLDAPVersion $ entryTtl $ uidNumber $ gidNumber $ olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ olcIdleTimeout $ olcIndexSubstrIfMinLen $ olcIndexSubstrIfMaxLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcIndexIntLen $ olcListenerThreads $ olcLocalSSF $ olcMaxDerefDepth $ olcReplicationInterval $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcThreads $ olcToolThreads $ olcWriteTimeout $ olcDbCacheFree $ olcDbCacheSize $ olcDbDNcacheSize $ olcDbIDLcacheSize $ olcDbSearchStack $ olcDbShmKey $ olcDbProtocolVersion $ olcDbConnectionPoolMax $ olcChainMaxReferralDepth $ olcDDSmaxDynamicObjects $ olcPcacheMaxQueries $ olcRetcodeSleep $ olcSssVlvMax $ olcSssVlvMaxKeys $ olcSssVlvMaxPerConn $ olcSpSessionlog $ mailPreferenceOption $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipServicePort $ ipProtocolNumber $ oncRpcNumber $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseMinPasswordLength $ suseMaxPasswordLength $ suseImapDefaultQuota ) )", + "( 1.3.6.1.4.1.1466.109.114.2 NAME 'caseIgnoreIA5Match' APPLIES ( altServer $ olcDbConfig $ c $ mail $ dc $ associatedDomain $ email $ aRecord $ mDRecord $ mXRecord $ nSRecord $ sOARecord $ cNAMERecord $ janetMailbox $ gecos $ homeDirectory $ loginShell $ memberUid $ memberNisNetgroup $ nisNetgroupTriple $ ipNetmaskNumber $ macAddress $ bootParameter $ bootFile $ nisMapEntry $ nisDomain $ automountMapName $ automountKey $ automountInformation $ suseNamingAttribute $ susePasswordHash $ suseSkelDir ) )", + "( 1.3.6.1.4.1.1466.109.114.1 NAME 'caseExactIA5Match' APPLIES ( altServer $ olcDbConfig $ c $ mail $ dc $ associatedDomain $ email $ aRecord $ mDRecord $ mXRecord $ nSRecord $ sOARecord $ cNAMERecord $ janetMailbox $ gecos $ homeDirectory $ loginShell $ memberUid $ memberNisNetgroup $ nisNetgroupTriple $ ipNetmaskNumber $ macAddress $ bootParameter $ bootFile $ nisMapEntry $ nisDomain $ automountMapName $ automountKey $ automountInformation $ suseNamingAttribute $ susePasswordHash $ suseSkelDir ) )", + "( 2.5.13.38 NAME 'certificateListExactMatch' APPLIES ( authorityRevocationList $ certificateRevocationList $ deltaRevocationList ) )", + "( 2.5.13.34 NAME 'certificateExactMatch' APPLIES ( userCertificate $ cACertificate ) )", + "( 2.5.13.30 NAME 'objectIdentifierFirstComponentMatch' APPLIES ( supportedControl $ supportedExtension $ supportedFeatures $ ldapSyntaxes $ supportedApplicationContext ) )", + "( 2.5.13.29 NAME 'integerFirstComponentMatch' APPLIES ( supportedLDAPVersion $ entryTtl $ uidNumber $ gidNumber $ olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ olcIdleTimeout $ olcIndexSubstrIfMinLen $ olcIndexSubstrIfMaxLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcIndexIntLen $ olcListenerThreads $ olcLocalSSF $ olcMaxDerefDepth $ olcReplicationInterval $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcThreads $ olcToolThreads $ olcWriteTimeout $ olcDbCacheFree $ olcDbCacheSize $ olcDbDNcacheSize $ olcDbIDLcacheSize $ olcDbSearchStack $ olcDbShmKey $ olcDbProtocolVersion $ olcDbConnectionPoolMax $ olcChainMaxReferralDepth $ olcDDSmaxDynamicObjects $ olcPcacheMaxQueries $ olcRetcodeSleep $ olcSssVlvMax $ olcSssVlvMaxKeys $ olcSssVlvMaxPerConn $ olcSpSessionlog $ mailPreferenceOption $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipServicePort $ ipProtocolNumber $ oncRpcNumber $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseMinPasswordLength $ suseMaxPasswordLength $ suseImapDefaultQuota ) )", + "( 2.5.13.28 NAME 'generalizedTimeOrderingMatch' APPLIES ( createTimestamp $ modifyTimestamp $ pwdChangedTime $ pwdAccountLockedTime $ pwdFailureTime $ pwdGraceUseTime ) )", + "( 2.5.13.27 NAME 'generalizedTimeMatch' APPLIES ( createTimestamp $ modifyTimestamp $ pwdChangedTime $ pwdAccountLockedTime $ pwdFailureTime $ pwdGraceUseTime ) )", + "( 2.5.13.24 NAME 'protocolInformationMatch' APPLIES protocolInformation )", + "( 2.5.13.23 NAME 'uniqueMemberMatch' APPLIES uniqueMember )", + "( 2.5.13.22 NAME 'presentationAddressMatch' APPLIES presentationAddress )", + "( 2.5.13.20 NAME 'telephoneNumberMatch' APPLIES ( telephoneNumber $ homePhone $ mobile $ pager ) )", + "( 2.5.13.18 NAME 'octetStringOrderingMatch' APPLIES ( userPassword $ olcDbCryptKey $ pwdHistory $ nisPublicKey $ nisSecretKey ) )", + "( 2.5.13.17 NAME 'octetStringMatch' APPLIES ( userPassword $ olcDbCryptKey $ pwdHistory $ nisPublicKey $ nisSecretKey ) )", + "( 2.5.13.16 NAME 'bitStringMatch' APPLIES x500UniqueIdentifier )", + "( 2.5.13.15 NAME 'integerOrderingMatch' APPLIES ( supportedLDAPVersion $ entryTtl $ uidNumber $ gidNumber $ olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ olcIdleTimeout $ olcIndexSubstrIfMinLen $ olcIndexSubstrIfMaxLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcIndexIntLen $ olcListenerThreads $ olcLocalSSF $ olcMaxDerefDepth $ olcReplicationInterval $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcThreads $ olcToolThreads $ olcWriteTimeout $ olcDbCacheFree $ olcDbCacheSize $ olcDbDNcacheSize $ olcDbIDLcacheSize $ olcDbSearchStack $ olcDbShmKey $ olcDbProtocolVersion $ olcDbConnectionPoolMax $ olcChainMaxReferralDepth $ olcDDSmaxDynamicObjects $ olcPcacheMaxQueries $ olcRetcodeSleep $ olcSssVlvMax $ olcSssVlvMaxKeys $ olcSssVlvMaxPerConn $ olcSpSessionlog $ mailPreferenceOption $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipServicePort $ ipProtocolNumber $ oncRpcNumber $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseMinPasswordLength $ suseMaxPasswordLength $ suseImapDefaultQuota ) )", + "( 2.5.13.14 NAME 'integerMatch' APPLIES ( supportedLDAPVersion $ entryTtl $ uidNumber $ gidNumber $ olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ olcIdleTimeout $ olcIndexSubstrIfMinLen $ olcIndexSubstrIfMaxLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcIndexIntLen $ olcListenerThreads $ olcLocalSSF $ olcMaxDerefDepth $ olcReplicationInterval $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcThreads $ olcToolThreads $ olcWriteTimeout $ olcDbCacheFree $ olcDbCacheSize $ olcDbDNcacheSize $ olcDbIDLcacheSize $ olcDbSearchStack $ olcDbShmKey $ olcDbProtocolVersion $ olcDbConnectionPoolMax $ olcChainMaxReferralDepth $ olcDDSmaxDynamicObjects $ olcPcacheMaxQueries $ olcRetcodeSleep $ olcSssVlvMax $ olcSssVlvMaxKeys $ olcSssVlvMaxPerConn $ olcSpSessionlog $ mailPreferenceOption $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ ipServicePort $ ipProtocolNumber $ oncRpcNumber $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseMinPasswordLength $ suseMaxPasswordLength $ suseImapDefaultQuota ) )", + "( 2.5.13.13 NAME 'booleanMatch' APPLIES ( hasSubordinates $ olcAddContentAcl $ olcGentleHUP $ olcHidden $ olcLastMod $ olcMirrorMode $ olcMonitoring $ olcReadOnly $ olcReverseLookup $ olcSyncUseSubentry $ olcDbChecksum $ olcDbNoSync $ olcDbDirtyRead $ olcDbLinearIndex $ olcDbRebindAsUser $ olcDbChaseReferrals $ olcDbProxyWhoAmI $ olcDbSingleConn $ olcDbUseTemporaryConn $ olcDbNoRefs $ olcDbNoUndefFilter $ olcChainCacheURI $ olcChainReturnError $ olcAccessLogSuccess $ olcDDSstate $ olcMemberOfRefInt $ pwdReset $ olcPPolicyHashCleartext $ olcPPolicyForwardUpdates $ olcPPolicyUseLockout $ olcPcachePersist $ olcPcacheValidate $ olcPcacheOffline $ olcRetcodeInDir $ olcRwmNormalizeMapped $ olcRwmDropUnrequested $ olcSpNoPresent $ olcSpReloadHint $ olcTranslucentStrict $ olcTranslucentNoGlue $ olcTranslucentBindLocal $ olcTranslucentPwModLocal $ olcUniqueStrict $ suseImapUseSsl ) )", + "( 2.5.13.11 NAME 'caseIgnoreListMatch' APPLIES ( postalAddress $ registeredAddress $ homePostalAddress ) )", + "( 2.5.13.9 NAME 'numericStringOrderingMatch' APPLIES ( x121Address $ internationaliSDNNumber ) )", + "( 2.5.13.8 NAME 'numericStringMatch' APPLIES ( x121Address $ internationaliSDNNumber ) )", + "( 2.5.13.7 NAME 'caseExactSubstringsMatch' APPLIES ( serialNumber $ destinationIndicator $ dnQualifier ) )", + "( 2.5.13.6 NAME 'caseExactOrderingMatch' APPLIES ( supportedSASLMechanisms $ vendorName $ vendorVersion $ ref $ name $ cn $ uid $ labeledURI $ description $ olcConfigFile $ olcConfigDir $ olcAccess $ olcAllows $ olcArgsFile $ olcAttributeOptions $ olcAttributeTypes $ olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ olcBackend $ olcDatabase $ olcDisallows $ olcDitContentRules $ olcExtraAttrs $ olcInclude $ olcLdapSyntaxes $ olcLimits $ olcLogFile $ olcLogLevel $ olcModuleLoad $ olcModulePath $ olcObjectClasses $ olcObjectIdentifier $ olcOverlay $ olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ olcPlugin $ olcPluginLogFile $ olcReferral $ olcReplica $ olcReplicaArgsFile $ olcReplicaPidFile $ olcReplogFile $ olcRequires $ olcRestrict $ olcRootDSE $ olcRootPW $ olcSaslAuxprops $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ olcSecurity $ olcServerID $ olcSizeLimit $ olcSortVals $ olcSubordinate $ olcSyncrepl $ olcTCPBuffer $ olcTimeLimit $ olcTLSCACertificateFile $ olcTLSCACertificatePath $ olcTLSCertificateFile $ olcTLSCertificateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ olcTLSCRLFile $ olcTLSRandFile $ olcTLSVerifyClient $ olcTLSDHParamFile $ olcTLSProtocolMin $ olcUpdateRef $ olcDbDirectory $ olcDbCheckpoint $ olcDbCryptFile $ olcDbPageSize $ olcDbIndex $ olcDbLockDetect $ olcDbMode $ olcDbURI $ olcDbStartTLS $ olcDbACLPasswd $ olcDbACLBind $ olcDbIDAssertPasswd $ olcDbIDAssertBind $ olcDbIDAssertMode $ olcDbIDAssertAuthzFrom $ olcDbTFSupport $ olcDbTimeout $ olcDbIdleTimeout $ olcDbConnTtl $ olcDbNetworkTimeout $ olcDbCancel $ olcDbQuarantine $ olcDbIDAssertPassThru $ olcChainingBehavior $ olcAccessLogOps $ olcAccessLogPurge $ olcAccessLogOld $ olcAccessLogOldAttr $ olcAccessLogBase $ olcAuditlogFile $ olcCollectInfo $ olcConstraintAttribute $ olcDDSmaxTtl $ olcDDSminTtl $ olcDDSdefaultTtl $ olcDDSinterval $ olcDDStolerance $ olcDGAttrPair $ olcDlAttrSet $ olcMemberOfDangling $ olcMemberOfGroupOC $ olcMemberOfMemberAD $ olcMemberOfMemberOfAD $ olcMemberOfDanglingError $ olcPcache $ olcPcacheAttrset $ olcPcacheTemplate $ olcPcachePosition $ olcPcacheBind $ olcRefintAttribute $ olcRetcodeItem $ olcRwmRewrite $ olcRwmTFSupport $ olcRwmMap $ olcSpCheckpoint $ olcTranslucentLocal $ olcTranslucentRemote $ olcUniqueIgnore $ olcUniqueAttribute $ olcUniqueURI $ olcValSortAttr $ knowledgeInformation $ sn $ serialNumber $ c $ l $ st $ street $ o $ ou $ title $ businessCategory $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ destinationIndicator $ givenName $ initials $ generationQualifier $ dnQualifier $ houseIdentifier $ dmdName $ pseudonym $ textEncodedORAddress $ info $ drink $ roomNumber $ userClass $ host $ documentIdentifier $ documentTitle $ documentVersion $ documentLocation $ personalTitle $ co $ uniqueIdentifier $ organizationalStatus $ buildingName $ documentPublisher $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ preferredLanguage $ ipServiceProtocol $ ipHostNumber $ ipNetworkNumber $ nisMapName $ suseSearchFilter $ suseDefaultValue $ susePlugin $ suseMapAttribute $ suseImapServer $ suseImapAdmin ) )", + "( 2.5.13.5 NAME 'caseExactMatch' APPLIES ( supportedSASLMechanisms $ vendorName $ vendorVersion $ ref $ name $ cn $ uid $ labeledURI $ description $ olcConfigFile $ olcConfigDir $ olcAccess $ olcAllows $ olcArgsFile $ olcAttributeOptions $ olcAttributeTypes $ olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ olcBackend $ olcDatabase $ olcDisallows $ olcDitContentRules $ olcExtraAttrs $ olcInclude $ olcLdapSyntaxes $ olcLimits $ olcLogFile $ olcLogLevel $ olcModuleLoad $ olcModulePath $ olcObjectClasses $ olcObjectIdentifier $ olcOverlay $ olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ olcPlugin $ olcPluginLogFile $ olcReferral $ olcReplica $ olcReplicaArgsFile $ olcReplicaPidFile $ olcReplogFile $ olcRequires $ olcRestrict $ olcRootDSE $ olcRootPW $ olcSaslAuxprops $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ olcSecurity $ olcServerID $ olcSizeLimit $ olcSortVals $ olcSubordinate $ olcSyncrepl $ olcTCPBuffer $ olcTimeLimit $ olcTLSCACertificateFile $ olcTLSCACertificatePath $ olcTLSCertificateFile $ olcTLSCertificateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ olcTLSCRLFile $ olcTLSRandFile $ olcTLSVerifyClient $ olcTLSDHParamFile $ olcTLSProtocolMin $ olcUpdateRef $ olcDbDirectory $ olcDbCheckpoint $ olcDbCryptFile $ olcDbPageSize $ olcDbIndex $ olcDbLockDetect $ olcDbMode $ olcDbURI $ olcDbStartTLS $ olcDbACLPasswd $ olcDbACLBind $ olcDbIDAssertPasswd $ olcDbIDAssertBind $ olcDbIDAssertMode $ olcDbIDAssertAuthzFrom $ olcDbTFSupport $ olcDbTimeout $ olcDbIdleTimeout $ olcDbConnTtl $ olcDbNetworkTimeout $ olcDbCancel $ olcDbQuarantine $ olcDbIDAssertPassThru $ olcChainingBehavior $ olcAccessLogOps $ olcAccessLogPurge $ olcAccessLogOld $ olcAccessLogOldAttr $ olcAccessLogBase $ olcAuditlogFile $ olcCollectInfo $ olcConstraintAttribute $ olcDDSmaxTtl $ olcDDSminTtl $ olcDDSdefaultTtl $ olcDDSinterval $ olcDDStolerance $ olcDGAttrPair $ olcDlAttrSet $ olcMemberOfDangling $ olcMemberOfGroupOC $ olcMemberOfMemberAD $ olcMemberOfMemberOfAD $ olcMemberOfDanglingError $ olcPcache $ olcPcacheAttrset $ olcPcacheTemplate $ olcPcachePosition $ olcPcacheBind $ olcRefintAttribute $ olcRetcodeItem $ olcRwmRewrite $ olcRwmTFSupport $ olcRwmMap $ olcSpCheckpoint $ olcTranslucentLocal $ olcTranslucentRemote $ olcUniqueIgnore $ olcUniqueAttribute $ olcUniqueURI $ olcValSortAttr $ knowledgeInformation $ sn $ serialNumber $ c $ l $ st $ street $ o $ ou $ title $ businessCategory $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ destinationIndicator $ givenName $ initials $ generationQualifier $ dnQualifier $ houseIdentifier $ dmdName $ pseudonym $ textEncodedORAddress $ info $ drink $ roomNumber $ userClass $ host $ documentIdentifier $ documentTitle $ documentVersion $ documentLocation $ personalTitle $ co $ uniqueIdentifier $ organizationalStatus $ buildingName $ documentPublisher $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ preferredLanguage $ ipServiceProtocol $ ipHostNumber $ ipNetworkNumber $ nisMapName $ suseSearchFilter $ suseDefaultValue $ susePlugin $ suseMapAttribute $ suseImapServer $ suseImapAdmin ) )", + "( 2.5.13.4 NAME 'caseIgnoreSubstringsMatch' APPLIES ( serialNumber $ destinationIndicator $ dnQualifier ) )", + "( 2.5.13.3 NAME 'caseIgnoreOrderingMatch' APPLIES ( supportedSASLMechanisms $ vendorName $ vendorVersion $ ref $ name $ cn $ uid $ labeledURI $ description $ olcConfigFile $ olcConfigDir $ olcAccess $ olcAllows $ olcArgsFile $ olcAttributeOptions $ olcAttributeTypes $ olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ olcBackend $ olcDatabase $ olcDisallows $ olcDitContentRules $ olcExtraAttrs $ olcInclude $ olcLdapSyntaxes $ olcLimits $ olcLogFile $ olcLogLevel $ olcModuleLoad $ olcModulePath $ olcObjectClasses $ olcObjectIdentifier $ olcOverlay $ olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ olcPlugin $ olcPluginLogFile $ olcReferral $ olcReplica $ olcReplicaArgsFile $ olcReplicaPidFile $ olcReplogFile $ olcRequires $ olcRestrict $ olcRootDSE $ olcRootPW $ olcSaslAuxprops $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ olcSecurity $ olcServerID $ olcSizeLimit $ olcSortVals $ olcSubordinate $ olcSyncrepl $ olcTCPBuffer $ olcTimeLimit $ olcTLSCACertificateFile $ olcTLSCACertificatePath $ olcTLSCertificateFile $ olcTLSCertificateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ olcTLSCRLFile $ olcTLSRandFile $ olcTLSVerifyClient $ olcTLSDHParamFile $ olcTLSProtocolMin $ olcUpdateRef $ olcDbDirectory $ olcDbCheckpoint $ olcDbCryptFile $ olcDbPageSize $ olcDbIndex $ olcDbLockDetect $ olcDbMode $ olcDbURI $ olcDbStartTLS $ olcDbACLPasswd $ olcDbACLBind $ olcDbIDAssertPasswd $ olcDbIDAssertBind $ olcDbIDAssertMode $ olcDbIDAssertAuthzFrom $ olcDbTFSupport $ olcDbTimeout $ olcDbIdleTimeout $ olcDbConnTtl $ olcDbNetworkTimeout $ olcDbCancel $ olcDbQuarantine $ olcDbIDAssertPassThru $ olcChainingBehavior $ olcAccessLogOps $ olcAccessLogPurge $ olcAccessLogOld $ olcAccessLogOldAttr $ olcAccessLogBase $ olcAuditlogFile $ olcCollectInfo $ olcConstraintAttribute $ olcDDSmaxTtl $ olcDDSminTtl $ olcDDSdefaultTtl $ olcDDSinterval $ olcDDStolerance $ olcDGAttrPair $ olcDlAttrSet $ olcMemberOfDangling $ olcMemberOfGroupOC $ olcMemberOfMemberAD $ olcMemberOfMemberOfAD $ olcMemberOfDanglingError $ olcPcache $ olcPcacheAttrset $ olcPcacheTemplate $ olcPcachePosition $ olcPcacheBind $ olcRefintAttribute $ olcRetcodeItem $ olcRwmRewrite $ olcRwmTFSupport $ olcRwmMap $ olcSpCheckpoint $ olcTranslucentLocal $ olcTranslucentRemote $ olcUniqueIgnore $ olcUniqueAttribute $ olcUniqueURI $ olcValSortAttr $ knowledgeInformation $ sn $ serialNumber $ c $ l $ st $ street $ o $ ou $ title $ businessCategory $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ destinationIndicator $ givenName $ initials $ generationQualifier $ dnQualifier $ houseIdentifier $ dmdName $ pseudonym $ textEncodedORAddress $ info $ drink $ roomNumber $ userClass $ host $ documentIdentifier $ documentTitle $ documentVersion $ documentLocation $ personalTitle $ co $ uniqueIdentifier $ organizationalStatus $ buildingName $ documentPublisher $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ preferredLanguage $ ipServiceProtocol $ ipHostNumber $ ipNetworkNumber $ nisMapName $ suseSearchFilter $ suseDefaultValue $ susePlugin $ suseMapAttribute $ suseImapServer $ suseImapAdmin ) )", + "( 2.5.13.2 NAME 'caseIgnoreMatch' APPLIES ( supportedSASLMechanisms $ vendorName $ vendorVersion $ ref $ name $ cn $ uid $ labeledURI $ description $ olcConfigFile $ olcConfigDir $ olcAccess $ olcAllows $ olcArgsFile $ olcAttributeOptions $ olcAttributeTypes $ olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ olcBackend $ olcDatabase $ olcDisallows $ olcDitContentRules $ olcExtraAttrs $ olcInclude $ olcLdapSyntaxes $ olcLimits $ olcLogFile $ olcLogLevel $ olcModuleLoad $ olcModulePath $ olcObjectClasses $ olcObjectIdentifier $ olcOverlay $ olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ olcPlugin $ olcPluginLogFile $ olcReferral $ olcReplica $ olcReplicaArgsFile $ olcReplicaPidFile $ olcReplogFile $ olcRequires $ olcRestrict $ olcRootDSE $ olcRootPW $ olcSaslAuxprops $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ olcSecurity $ olcServerID $ olcSizeLimit $ olcSortVals $ olcSubordinate $ olcSyncrepl $ olcTCPBuffer $ olcTimeLimit $ olcTLSCACertificateFile $ olcTLSCACertificatePath $ olcTLSCertificateFile $ olcTLSCertificateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ olcTLSCRLFile $ olcTLSRandFile $ olcTLSVerifyClient $ olcTLSDHParamFile $ olcTLSProtocolMin $ olcUpdateRef $ olcDbDirectory $ olcDbCheckpoint $ olcDbCryptFile $ olcDbPageSize $ olcDbIndex $ olcDbLockDetect $ olcDbMode $ olcDbURI $ olcDbStartTLS $ olcDbACLPasswd $ olcDbACLBind $ olcDbIDAssertPasswd $ olcDbIDAssertBind $ olcDbIDAssertMode $ olcDbIDAssertAuthzFrom $ olcDbTFSupport $ olcDbTimeout $ olcDbIdleTimeout $ olcDbConnTtl $ olcDbNetworkTimeout $ olcDbCancel $ olcDbQuarantine $ olcDbIDAssertPassThru $ olcChainingBehavior $ olcAccessLogOps $ olcAccessLogPurge $ olcAccessLogOld $ olcAccessLogOldAttr $ olcAccessLogBase $ olcAuditlogFile $ olcCollectInfo $ olcConstraintAttribute $ olcDDSmaxTtl $ olcDDSminTtl $ olcDDSdefaultTtl $ olcDDSinterval $ olcDDStolerance $ olcDGAttrPair $ olcDlAttrSet $ olcMemberOfDangling $ olcMemberOfGroupOC $ olcMemberOfMemberAD $ olcMemberOfMemberOfAD $ olcMemberOfDanglingError $ olcPcache $ olcPcacheAttrset $ olcPcacheTemplate $ olcPcachePosition $ olcPcacheBind $ olcRefintAttribute $ olcRetcodeItem $ olcRwmRewrite $ olcRwmTFSupport $ olcRwmMap $ olcSpCheckpoint $ olcTranslucentLocal $ olcTranslucentRemote $ olcUniqueIgnore $ olcUniqueAttribute $ olcUniqueURI $ olcValSortAttr $ knowledgeInformation $ sn $ serialNumber $ c $ l $ st $ street $ o $ ou $ title $ businessCategory $ postalCode $ postOfficeBox $ physicalDeliveryOfficeName $ destinationIndicator $ givenName $ initials $ generationQualifier $ dnQualifier $ houseIdentifier $ dmdName $ pseudonym $ textEncodedORAddress $ info $ drink $ roomNumber $ userClass $ host $ documentIdentifier $ documentTitle $ documentVersion $ documentLocation $ personalTitle $ co $ uniqueIdentifier $ organizationalStatus $ buildingName $ documentPublisher $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ preferredLanguage $ ipServiceProtocol $ ipHostNumber $ ipNetworkNumber $ nisMapName $ suseSearchFilter $ suseDefaultValue $ susePlugin $ suseMapAttribute $ suseImapServer $ suseImapAdmin ) )", + "( 2.5.13.1 NAME 'distinguishedNameMatch' APPLIES ( creatorsName $ modifiersName $ subschemaSubentry $ entryDN $ namingContexts $ aliasedObjectName $ dynamicSubtrees $ distinguishedName $ seeAlso $ olcDefaultSearchBase $ olcRootDN $ olcSchemaDN $ olcSuffix $ olcUpdateDN $ olcDbACLAuthcDn $ olcDbIDAssertAuthcDn $ olcRelay $ olcAccessLogDB $ memberOf $ olcMemberOfDN $ pwdPolicySubentry $ olcPPolicyDefault $ olcRefintNothing $ olcRefintModifiersName $ olcRetcodeParent $ olcUniqueBase $ member $ owner $ roleOccupant $ manager $ documentAuthor $ secretary $ associatedName $ dITRedirect $ suseDefaultBase $ suseDefaultTemplate $ suseSecondaryGroup ) )", + "( 2.5.13.0 NAME 'objectIdentifierMatch' APPLIES ( supportedControl $ supportedExtension $ supportedFeatures $ supportedApplicationContext ) )" + ], + "matchingRules": [ + "( 1.3.6.1.1.16.3 NAME 'UUIDOrderingMatch' SYNTAX 1.3.6.1.1.16.1 )", + "( 1.3.6.1.1.16.2 NAME 'UUIDMatch' SYNTAX 1.3.6.1.1.16.1 )", + "( 1.2.840.113556.1.4.804 NAME 'integerBitOrMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 1.2.840.113556.1.4.803 NAME 'integerBitAndMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 1.3.6.1.4.1.4203.1.2.1 NAME 'caseExactIA5SubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.4.1.1466.109.114.2 NAME 'caseIgnoreIA5Match' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 1.3.6.1.4.1.1466.109.114.1 NAME 'caseExactIA5Match' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", + "( 2.5.13.38 NAME 'certificateListExactMatch' SYNTAX 1.3.6.1.1.15.5 )", + "( 2.5.13.34 NAME 'certificateExactMatch' SYNTAX 1.3.6.1.1.15.1 )", + "( 2.5.13.30 NAME 'objectIdentifierFirstComponentMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", + "( 2.5.13.29 NAME 'integerFirstComponentMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 2.5.13.28 NAME 'generalizedTimeOrderingMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )", + "( 2.5.13.27 NAME 'generalizedTimeMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )", + "( 2.5.13.23 NAME 'uniqueMemberMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )", + "( 2.5.13.21 NAME 'telephoneNumberSubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.20 NAME 'telephoneNumberMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )", + "( 2.5.13.19 NAME 'octetStringSubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )", + "( 2.5.13.18 NAME 'octetStringOrderingMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )", + "( 2.5.13.17 NAME 'octetStringMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )", + "( 2.5.13.16 NAME 'bitStringMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )", + "( 2.5.13.15 NAME 'integerOrderingMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 2.5.13.14 NAME 'integerMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )", + "( 2.5.13.13 NAME 'booleanMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )", + "( 2.5.13.11 NAME 'caseIgnoreListMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )", + "( 2.5.13.10 NAME 'numericStringSubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.9 NAME 'numericStringOrderingMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )", + "( 2.5.13.8 NAME 'numericStringMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 )", + "( 2.5.13.7 NAME 'caseExactSubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.6 NAME 'caseExactOrderingMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.5 NAME 'caseExactMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.4 NAME 'caseIgnoreSubstringsMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )", + "( 2.5.13.3 NAME 'caseIgnoreOrderingMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 2.5.13.2 NAME 'caseIgnoreMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", + "( 1.2.36.79672281.1.13.3 NAME 'rdnMatch' SYNTAX 1.2.36.79672281.1.5.0 )", + "( 2.5.13.1 NAME 'distinguishedNameMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", + "( 2.5.13.0 NAME 'objectIdentifierMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )" + ], + "modifyTimestamp": [ + "20141024204149Z" + ], + "objectClass": [ + "top", + "subentry", + "subschema", + "extensibleObject" + ], + "objectClasses": [ + "( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' ABSTRACT MUST objectClass )", + "( 1.3.6.1.4.1.1466.101.120.111 NAME 'extensibleObject' DESC 'RFC4512: extensible object' SUP top AUXILIARY )", + "( 2.5.6.1 NAME 'alias' DESC 'RFC4512: an alias' SUP top STRUCTURAL MUST aliasedObjectName )", + "( 2.16.840.1.113730.3.2.6 NAME 'referral' DESC 'namedref: named subordinate referral' SUP top STRUCTURAL MUST ref )", + "( 1.3.6.1.4.1.4203.1.4.1 NAME ( 'OpenLDAProotDSE' 'LDAProotDSE' ) DESC 'OpenLDAP Root DSE object' SUP top STRUCTURAL MAY cn )", + "( 2.5.17.0 NAME 'subentry' DESC 'RFC3672: subentry' SUP top STRUCTURAL MUST ( cn $ subtreeSpecification ) )", + "( 2.5.20.1 NAME 'subschema' DESC 'RFC4512: controlling subschema (sub)entry' AUXILIARY MAY ( dITStructureRules $ nameForms $ dITContentRules $ objectClasses $ attributeTypes $ matchingRules $ matchingRuleUse ) )", + "( 1.3.6.1.4.1.1466.101.119.2 NAME 'dynamicObject' DESC 'RFC2589: Dynamic Object' SUP top AUXILIARY )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.0 NAME 'olcConfig' DESC 'OpenLDAP configuration object' SUP top ABSTRACT )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.1 NAME 'olcGlobal' DESC 'OpenLDAP Global configuration options' SUP olcConfig STRUCTURAL MAY ( cn $ olcConfigFile $ olcConfigDir $ olcAllows $ olcArgsFile $ olcAttributeOptions $ olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ olcDisallows $ olcGentleHUP $ olcIdleTimeout $ olcIndexSubstrIfMaxLen $ olcIndexSubstrIfMinLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcIndexIntLen $ olcLocalSSF $ olcLogFile $ olcLogLevel $ olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ olcPluginLogFile $ olcReadOnly $ olcReferral $ olcReplogFile $ olcRequires $ olcRestrict $ olcReverseLookup $ olcRootDSE $ olcSaslAuxprops $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ olcSecurity $ olcServerID $ olcSizeLimit $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcTCPBuffer $ olcThreads $ olcTimeLimit $ olcTLSCACertificateFile $ olcTLSCACertificatePath $ olcTLSCertificateFile $ olcTLSCertificateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ olcTLSRandFile $ olcTLSVerifyClient $ olcTLSDHParamFile $ olcTLSCRLFile $ olcToolThreads $ olcWriteTimeout $ olcObjectIdentifier $ olcAttributeTypes $ olcObjectClasses $ olcDitContentRules $ olcLdapSyntaxes ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.2 NAME 'olcSchemaConfig' DESC 'OpenLDAP schema object' SUP olcConfig STRUCTURAL MAY ( cn $ olcObjectIdentifier $ olcAttributeTypes $ olcObjectClasses $ olcDitContentRules $ olcLdapSyntaxes ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.3 NAME 'olcBackendConfig' DESC 'OpenLDAP Backend-specific options' SUP olcConfig STRUCTURAL MUST olcBackend )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.4 NAME 'olcDatabaseConfig' DESC 'OpenLDAP Database-specific options' SUP olcConfig STRUCTURAL MUST olcDatabase MAY ( olcHidden $ olcSuffix $ olcSubordinate $ olcAccess $ olcAddContentAcl $ olcLastMod $ olcLimits $ olcMaxDerefDepth $ olcPlugin $ olcReadOnly $ olcReplica $ olcReplicaArgsFile $ olcReplicaPidFile $ olcReplicationInterval $ olcReplogFile $ olcRequires $ olcRestrict $ olcRootDN $ olcRootPW $ olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSyncUseSubentry $ olcSyncrepl $ olcTimeLimit $ olcUpdateDN $ olcUpdateRef $ olcMirrorMode $ olcMonitoring $ olcExtraAttrs ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.5 NAME 'olcOverlayConfig' DESC 'OpenLDAP Overlay-specific options' SUP olcConfig STRUCTURAL MUST olcOverlay )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.6 NAME 'olcIncludeFile' DESC 'OpenLDAP configuration include file' SUP olcConfig STRUCTURAL MUST olcInclude MAY ( cn $ olcRootDSE ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.7 NAME 'olcFrontendConfig' DESC 'OpenLDAP frontend configuration' AUXILIARY MAY ( olcDefaultSearchBase $ olcPasswordHash $ olcSortVals ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.0.8 NAME 'olcModuleList' DESC 'OpenLDAP dynamic module info' SUP olcConfig STRUCTURAL MAY ( cn $ olcModulePath $ olcModuleLoad ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.2.2.1 NAME 'olcLdifConfig' DESC 'LDIF backend configuration' SUP olcDatabaseConfig STRUCTURAL MUST olcDbDirectory )", + "( 1.3.6.1.4.1.4203.1.12.2.4.2.4.1 NAME 'olcMonitorConfig' DESC 'Monitor backend configuration' SUP olcDatabaseConfig STRUCTURAL )", + "( 1.3.6.1.4.1.4203.1.12.2.4.2.1.1 NAME 'olcBdbConfig' DESC 'BDB backend configuration' SUP olcDatabaseConfig STRUCTURAL MUST olcDbDirectory MAY ( olcDbCacheSize $ olcDbCheckpoint $ olcDbConfig $ olcDbCryptFile $ olcDbCryptKey $ olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ olcDbMode $ olcDbSearchStack $ olcDbShmKey $ olcDbCacheFree $ olcDbDNcacheSize $ olcDbPageSize ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.2.1.2 NAME 'olcHdbConfig' DESC 'HDB backend configuration' SUP olcDatabaseConfig STRUCTURAL MUST olcDbDirectory MAY ( olcDbCacheSize $ olcDbCheckpoint $ olcDbConfig $ olcDbCryptFile $ olcDbCryptKey $ olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ olcDbMode $ olcDbSearchStack $ olcDbShmKey $ olcDbCacheFree $ olcDbDNcacheSize $ olcDbPageSize ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.2.3.1 NAME 'olcLDAPConfig' DESC 'LDAP backend configuration' SUP olcDatabaseConfig STRUCTURAL MAY ( olcDbURI $ olcDbStartTLS $ olcDbACLAuthcDn $ olcDbACLPasswd $ olcDbACLBind $ olcDbIDAssertAuthcDn $ olcDbIDAssertPasswd $ olcDbIDAssertBind $ olcDbIDAssertMode $ olcDbIDAssertAuthzFrom $ olcDbIDAssertPassThru $ olcDbRebindAsUser $ olcDbChaseReferrals $ olcDbTFSupport $ olcDbProxyWhoAmI $ olcDbTimeout $ olcDbIdleTimeout $ olcDbConnTtl $ olcDbNetworkTimeout $ olcDbProtocolVersion $ olcDbSingleConn $ olcDbCancel $ olcDbQuarantine $ olcDbUseTemporaryConn $ olcDbConnectionPoolMax $ olcDbNoRefs $ olcDbNoUndefFilter ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.3.1 NAME 'olcChainConfig' DESC 'Chain configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcChainingBehavior $ olcChainCacheURI $ olcChainMaxReferralDepth $ olcChainReturnError ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.3.2 NAME 'olcChainDatabase' DESC 'Chain remote server configuration' AUXILIARY )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.3.3 NAME 'olcPBindConfig' DESC 'Proxy Bind configuration' SUP olcOverlayConfig STRUCTURAL MUST olcDbURI MAY ( olcDbStartTLS $ olcDbNetworkTimeout $ olcDbQuarantine ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.7.1 NAME 'olcDistProcConfig' DESC 'Distributed procedures configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcChainingBehavior $ olcChainCacheURI ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.7.2 NAME 'olcDistProcDatabase' DESC 'Distributed procedure remote server configuration' AUXILIARY )", + "( 1.3.6.1.4.1.4203.1.12.2.4.2.5.1 NAME 'olcRelayConfig' DESC 'Relay backend configuration' SUP olcDatabaseConfig STRUCTURAL MAY olcRelay )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.4.1 NAME 'olcAccessLogConfig' DESC 'Access log configuration' SUP olcOverlayConfig STRUCTURAL MUST olcAccessLogDB MAY ( olcAccessLogOps $ olcAccessLogPurge $ olcAccessLogSuccess $ olcAccessLogOld $ olcAccessLogOldAttr $ olcAccessLogBase ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.15.1 NAME 'olcAuditlogConfig' DESC 'Auditlog configuration' SUP olcOverlayConfig STRUCTURAL MAY olcAuditlogFile )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.19.1 NAME 'olcCollectConfig' DESC 'Collective Attribute configuration' SUP olcOverlayConfig STRUCTURAL MAY olcCollectInfo )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.13.1 NAME 'olcConstraintConfig' DESC 'Constraint overlay configuration' SUP olcOverlayConfig STRUCTURAL MAY olcConstraintAttribute )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.9.1 NAME 'olcDDSConfig' DESC 'RFC2589 Dynamic directory services configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcDDSstate $ olcDDSmaxTtl $ olcDDSminTtl $ olcDDSdefaultTtl $ olcDDSinterval $ olcDDStolerance $ olcDDSmaxDynamicObjects ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.17.1 NAME 'olcDGConfig' DESC 'Dynamic Group configuration' SUP olcOverlayConfig STRUCTURAL MAY olcDGAttrPair )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.8.1 NAME 'olcDynamicList' DESC 'Dynamic list configuration' SUP olcOverlayConfig STRUCTURAL MAY olcDLattrSet )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.18.1 NAME 'olcMemberOf' DESC 'Member-of configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcMemberOfDN $ olcMemberOfDangling $ olcMemberOfDanglingError $ olcMemberOfRefInt $ olcMemberOfGroupOC $ olcMemberOfMemberAD $ olcMemberOfMemberOfAD ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.12.1 NAME 'olcPPolicyConfig' DESC 'Password Policy configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcPPolicyDefault $ olcPPolicyHashCleartext $ olcPPolicyUseLockout $ olcPPolicyForwardUpdates ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.2.1 NAME 'olcPcacheConfig' DESC 'ProxyCache configuration' SUP olcOverlayConfig STRUCTURAL MUST ( olcPcache $ olcPcacheAttrset $ olcPcacheTemplate ) MAY ( olcPcachePosition $ olcPcacheMaxQueries $ olcPcachePersist $ olcPcacheValidate $ olcPcacheOffline $ olcPcacheBind ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.2.2 NAME 'olcPcacheDatabase' DESC 'Cache database configuration' AUXILIARY )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.11.1 NAME 'olcRefintConfig' DESC 'Referential integrity configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcRefintAttribute $ olcRefintNothing $ olcRefintModifiersName ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.20.1 NAME 'olcRetcodeConfig' DESC 'Retcode configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcRetcodeParent $ olcRetcodeItem $ olcRetcodeInDir $ olcRetcodeSleep ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.16.1 NAME 'olcRwmConfig' DESC 'Rewrite/remap configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcRwmRewrite $ olcRwmTFSupport $ olcRwmMap $ olcRwmNormalizeMapped ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.21.1 NAME 'olcSssVlvConfig' DESC 'SSS VLV configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcSssVlvMax $ olcSssVlvMaxKeys ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.1.1 NAME 'olcSyncProvConfig' DESC 'SyncRepl Provider configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcSpCheckpoint $ olcSpSessionlog $ olcSpNoPresent $ olcSpReloadHint ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.14.1 NAME 'olcTranslucentConfig' DESC 'Translucent configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcTranslucentStrict $ olcTranslucentNoGlue $ olcTranslucentLocal $ olcTranslucentRemote $ olcTranslucentBindLocal $ olcTranslucentPwModLocal ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.14.2 NAME 'olcTranslucentDatabase' DESC 'Translucent target database configuration' AUXILIARY )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.10.1 NAME 'olcUniqueConfig' DESC 'Attribute value uniqueness configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcUniqueBase $ olcUniqueIgnore $ olcUniqueAttribute $ olcUniqueStrict $ olcUniqueURI ) )", + "( 1.3.6.1.4.1.4203.1.12.2.4.3.5.1 NAME 'olcValSortConfig' DESC 'Value Sorting configuration' SUP olcOverlayConfig STRUCTURAL MUST olcValSortAttr )", + "( 2.5.6.2 NAME 'country' DESC 'RFC2256: a country' SUP top STRUCTURAL MUST c MAY ( searchGuide $ description ) )", + "( 2.5.6.3 NAME 'locality' DESC 'RFC2256: a locality' SUP top STRUCTURAL MAY ( street $ seeAlso $ searchGuide $ st $ l $ description ) )", + "( 2.5.6.4 NAME 'organization' DESC 'RFC2256: an organization' SUP top STRUCTURAL MUST o MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )", + "( 2.5.6.5 NAME 'organizationalUnit' DESC 'RFC2256: an organizational unit' SUP top STRUCTURAL MUST ou MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )", + "( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )", + "( 2.5.6.7 NAME 'organizationalPerson' DESC 'RFC2256: an organizational person' SUP person STRUCTURAL MAY ( title $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l ) )", + "( 2.5.6.8 NAME 'organizationalRole' DESC 'RFC2256: an organizational role' SUP top STRUCTURAL MUST cn MAY ( x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ seeAlso $ roleOccupant $ preferredDeliveryMethod $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l $ description ) )", + "( 2.5.6.9 NAME 'groupOfNames' DESC 'RFC2256: a group of names (DNs)' SUP top STRUCTURAL MUST ( member $ cn ) MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )", + "( 2.5.6.10 NAME 'residentialPerson' DESC 'RFC2256: an residential person' SUP person STRUCTURAL MUST l MAY ( businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ preferredDeliveryMethod $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l ) )", + "( 2.5.6.11 NAME 'applicationProcess' DESC 'RFC2256: an application process' SUP top STRUCTURAL MUST cn MAY ( seeAlso $ ou $ l $ description ) )", + "( 2.5.6.12 NAME 'applicationEntity' DESC 'RFC2256: an application entity' SUP top STRUCTURAL MUST ( presentationAddress $ cn ) MAY ( supportedApplicationContext $ seeAlso $ ou $ o $ l $ description ) )", + "( 2.5.6.13 NAME 'dSA' DESC 'RFC2256: a directory system agent (a server)' SUP applicationEntity STRUCTURAL MAY knowledgeInformation )", + "( 2.5.6.14 NAME 'device' DESC 'RFC2256: a device' SUP top STRUCTURAL MUST cn MAY ( serialNumber $ seeAlso $ owner $ ou $ o $ l $ description ) )", + "( 2.5.6.15 NAME 'strongAuthenticationUser' DESC 'RFC2256: a strong authentication user' SUP top AUXILIARY MUST userCertificate )", + "( 2.5.6.16 NAME 'certificationAuthority' DESC 'RFC2256: a certificate authority' SUP top AUXILIARY MUST ( authorityRevocationList $ certificateRevocationList $ cACertificate ) MAY crossCertificatePair )", + "( 2.5.6.17 NAME 'groupOfUniqueNames' DESC 'RFC2256: a group of unique names (DN and Unique Identifier)' SUP top STRUCTURAL MUST ( uniqueMember $ cn ) MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )", + "( 2.5.6.18 NAME 'userSecurityInformation' DESC 'RFC2256: a user security information' SUP top AUXILIARY MAY supportedAlgorithms )", + "( 2.5.6.16.2 NAME 'certificationAuthority-V2' SUP certificationAuthority AUXILIARY MAY deltaRevocationList )", + "( 2.5.6.19 NAME 'cRLDistributionPoint' SUP top STRUCTURAL MUST cn MAY ( certificateRevocationList $ authorityRevocationList $ deltaRevocationList ) )", + "( 2.5.6.20 NAME 'dmd' SUP top STRUCTURAL MUST dmdName MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )", + "( 2.5.6.21 NAME 'pkiUser' DESC 'RFC2587: a PKI user' SUP top AUXILIARY MAY userCertificate )", + "( 2.5.6.22 NAME 'pkiCA' DESC 'RFC2587: PKI certificate authority' SUP top AUXILIARY MAY ( authorityRevocationList $ certificateRevocationList $ cACertificate $ crossCertificatePair ) )", + "( 2.5.6.23 NAME 'deltaCRL' DESC 'RFC2587: PKI user' SUP top AUXILIARY MAY deltaRevocationList )", + "( 1.3.6.1.4.1.250.3.15 NAME 'labeledURIObject' DESC 'RFC2079: object that contains the URI attribute type' SUP top AUXILIARY MAY labeledURI )", + "( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject' DESC 'RFC1274: simple security object' SUP top AUXILIARY MUST userPassword )", + "( 1.3.6.1.4.1.1466.344 NAME 'dcObject' DESC 'RFC2247: domain component object' SUP top AUXILIARY MUST dc )", + "( 1.3.6.1.1.3.1 NAME 'uidObject' DESC 'RFC2377: uid object' SUP top AUXILIARY MUST uid )", + "( 0.9.2342.19200300.100.4.4 NAME ( 'pilotPerson' 'newPilotPerson' ) SUP person STRUCTURAL MAY ( userid $ textEncodedORAddress $ rfc822Mailbox $ favouriteDrink $ roomNumber $ userClass $ homeTelephoneNumber $ homePostalAddress $ secretary $ personalTitle $ preferredDeliveryMethod $ businessCategory $ janetMailbox $ otherMailbox $ mobileTelephoneNumber $ pagerTelephoneNumber $ organizationalStatus $ mailPreferenceOption $ personalSignature ) )", + "( 0.9.2342.19200300.100.4.5 NAME 'account' SUP top STRUCTURAL MUST userid MAY ( description $ seeAlso $ localityName $ organizationName $ organizationalUnitName $ host ) )", + "( 0.9.2342.19200300.100.4.6 NAME 'document' SUP top STRUCTURAL MUST documentIdentifier MAY ( commonName $ description $ seeAlso $ localityName $ organizationName $ organizationalUnitName $ documentTitle $ documentVersion $ documentAuthor $ documentLocation $ documentPublisher ) )", + "( 0.9.2342.19200300.100.4.7 NAME 'room' SUP top STRUCTURAL MUST commonName MAY ( roomNumber $ description $ seeAlso $ telephoneNumber ) )", + "( 0.9.2342.19200300.100.4.9 NAME 'documentSeries' SUP top STRUCTURAL MUST commonName MAY ( description $ seeAlso $ telephonenumber $ localityName $ organizationName $ organizationalUnitName ) )", + "( 0.9.2342.19200300.100.4.13 NAME 'domain' SUP top STRUCTURAL MUST domainComponent MAY ( associatedName $ organizationName $ description $ businessCategory $ seeAlso $ searchGuide $ userPassword $ localityName $ stateOrProvinceName $ streetAddress $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ streetAddress $ facsimileTelephoneNumber $ internationalISDNNumber $ telephoneNumber $ teletexTerminalIdentifier $ telexNumber $ preferredDeliveryMethod $ destinationIndicator $ registeredAddress $ x121Address ) )", + "( 0.9.2342.19200300.100.4.14 NAME 'RFC822localPart' SUP domain STRUCTURAL MAY ( commonName $ surname $ description $ seeAlso $ telephoneNumber $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOfficeBox $ streetAddress $ facsimileTelephoneNumber $ internationalISDNNumber $ telephoneNumber $ teletexTerminalIdentifier $ telexNumber $ preferredDeliveryMethod $ destinationIndicator $ registeredAddress $ x121Address ) )", + "( 0.9.2342.19200300.100.4.15 NAME 'dNSDomain' SUP domain STRUCTURAL MAY ( ARecord $ MDRecord $ MXRecord $ NSRecord $ SOARecord $ CNAMERecord ) )", + "( 0.9.2342.19200300.100.4.17 NAME 'domainRelatedObject' DESC 'RFC1274: an object related to an domain' SUP top AUXILIARY MUST associatedDomain )", + "( 0.9.2342.19200300.100.4.18 NAME 'friendlyCountry' SUP country STRUCTURAL MUST friendlyCountryName )", + "( 0.9.2342.19200300.100.4.20 NAME 'pilotOrganization' SUP ( organization $ organizationalUnit ) STRUCTURAL MAY buildingName )", + "( 0.9.2342.19200300.100.4.21 NAME 'pilotDSA' SUP dsa STRUCTURAL MAY dSAQuality )", + "( 0.9.2342.19200300.100.4.22 NAME 'qualityLabelledData' SUP top AUXILIARY MUST dsaQuality MAY ( subtreeMinimumQuality $ subtreeMaximumQuality ) )", + "( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' DESC 'RFC2798: Internet Organizational Person' SUP organizationalPerson STRUCTURAL MAY ( audio $ businessCategory $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ givenName $ homePhone $ homePostalAddress $ initials $ jpegPhoto $ labeledURI $ mail $ manager $ mobile $ o $ pager $ photo $ roomNumber $ secretary $ uid $ userCertificate $ x500uniqueIdentifier $ preferredLanguage $ userSMIMECertificate $ userPKCS12 ) )", + "( 1.3.6.1.1.1.2.0 NAME 'posixAccount' DESC 'Abstraction of an account with POSIX attributes' SUP top AUXILIARY MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $ description ) )", + "( 1.3.6.1.1.1.2.1 NAME 'shadowAccount' DESC 'Additional attributes for shadow passwords' SUP top AUXILIARY MUST uid MAY ( userPassword $ description $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag ) )", + "( 1.3.6.1.1.1.2.2 NAME 'posixGroup' DESC 'Abstraction of a group of accounts' SUP top AUXILIARY MUST gidNumber MAY ( userPassword $ memberUid $ description ) )", + "( 1.3.6.1.1.1.2.3 NAME 'ipService' DESC 'Abstraction an Internet Protocol service. Maps an IP port and protocol (such as tcp or udp) to one or more names; the distinguished value of the cn attribute denotes the services canonical name' SUP top STRUCTURAL MUST ( cn $ ipServicePort $ ipServiceProtocol ) MAY description )", + "( 1.3.6.1.1.1.2.4 NAME 'ipProtocol' DESC 'Abstraction of an IP protocol. Maps a protocol number to one or more names. The distinguished value of the cn attribute denotes the protocols canonical name' SUP top STRUCTURAL MUST ( cn $ ipProtocolNumber ) MAY description )", + "( 1.3.6.1.1.1.2.5 NAME 'oncRpc' DESC 'Abstraction of an Open Network Computing (ONC) [RFC1057] Remote Procedure Call (RPC) binding. This class maps an ONC RPC number to a name. The distinguished value of the cn attribute denotes the RPC services canonical name' SUP top STRUCTURAL MUST ( cn $ oncRpcNumber ) MAY description )", + "( 1.3.6.1.1.1.2.6 NAME 'ipHost' DESC 'Abstraction of a host, an IP device. The distinguished value of the cn attribute denotes the hosts canonical name. Device SHOULD be used as a structural class' SUP top AUXILIARY MUST ( cn $ ipHostNumber ) MAY ( userPassword $ l $ description $ manager ) )", + "( 1.3.6.1.1.1.2.7 NAME 'ipNetwork' DESC 'Abstraction of a network. The distinguished value of the cn attribute denotes the networks canonical name' SUP top STRUCTURAL MUST ipNetworkNumber MAY ( cn $ ipNetmaskNumber $ l $ description $ manager ) )", + "( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup' DESC 'Abstraction of a netgroup. May refer to other netgroups' SUP top STRUCTURAL MUST cn MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) )", + "( 1.3.6.1.1.1.2.9 NAME 'nisMap' DESC 'A generic abstraction of a NIS map' SUP top STRUCTURAL MUST nisMapName MAY description )", + "( 1.3.6.1.1.1.2.10 NAME 'nisObject' DESC 'An entry in a NIS map' SUP top STRUCTURAL MUST ( cn $ nisMapEntry $ nisMapName ) MAY description )", + "( 1.3.6.1.1.1.2.11 NAME 'ieee802Device' DESC 'A device with a MAC address; device SHOULD be used as a structural class' SUP top AUXILIARY MAY macAddress )", + "( 1.3.6.1.1.1.2.12 NAME 'bootableDevice' DESC 'A device with boot parameters; device SHOULD be used as a structural class' SUP top AUXILIARY MAY ( bootFile $ bootParameter ) )", + "( 1.3.6.1.1.1.2.14 NAME 'nisKeyObject' DESC 'An object with a public and secret key' SUP top AUXILIARY MUST ( cn $ nisPublicKey $ nisSecretKey ) MAY ( uidNumber $ description ) )", + "( 1.3.6.1.1.1.2.15 NAME 'nisDomainObject' DESC 'Associates a NIS domain with a naming context' SUP top AUXILIARY MUST nisDomain )", + "( 1.3.6.1.1.1.2.16 NAME 'automountMap' SUP top STRUCTURAL MUST automountMapName MAY description )", + "( 1.3.6.1.1.1.2.17 NAME 'automount' DESC 'Automount information' SUP top STRUCTURAL MUST ( automountKey $ automountInformation ) MAY description )", + "( 1.3.6.1.4.1.5322.13.1.1 NAME 'namedObject' SUP top STRUCTURAL MAY cn )", + "( 1.3.6.1.4.1.7057.10.1.2.1.2 NAME 'suseModuleConfiguration' DESC 'Contains configuration of Management Modules' SUP top STRUCTURAL MUST cn MAY suseDefaultBase )", + "( 1.3.6.1.4.1.7057.10.1.2.1.3 NAME 'suseUserConfiguration' DESC 'Configuration of user management tools' SUP suseModuleConfiguration STRUCTURAL MAY ( suseMinPasswordLength $ suseMaxPasswordLength $ susePasswordHash $ suseSkelDir $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseDefaultTemplate $ suseSearchFilter $ suseMapAttribute ) )", + "( 1.3.6.1.4.1.7057.10.1.2.1.4 NAME 'suseObjectTemplate' DESC 'Base Class for Object-Templates' SUP top STRUCTURAL MUST cn MAY ( susePlugin $ suseDefaultValue $ suseNamingAttribute ) )", + "( 1.3.6.1.4.1.7057.10.1.2.1.5 NAME 'suseUserTemplate' DESC 'User object template' SUP suseObjectTemplate STRUCTURAL MUST cn MAY suseSecondaryGroup )", + "( 1.3.6.1.4.1.7057.10.1.2.1.6 NAME 'suseGroupTemplate' DESC 'Group object template' SUP suseObjectTemplate STRUCTURAL MUST cn )", + "( 1.3.6.1.4.1.7057.10.1.2.1.7 NAME 'suseGroupConfiguration' DESC 'Configuration of user management tools' SUP suseModuleConfiguration STRUCTURAL MAY ( suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseDefaultTemplate $ suseSearchFilter $ suseMapAttribute ) )", + "( 1.3.6.1.4.1.7057.10.1.2.1.8 NAME 'suseCaConfiguration' DESC 'Configuration of CA management tools' SUP suseModuleConfiguration STRUCTURAL )", + "( 1.3.6.1.4.1.7057.10.1.2.1.9 NAME 'suseDnsConfiguration' DESC 'Configuration of mail server management tools' SUP suseModuleConfiguration STRUCTURAL )", + "( 1.3.6.1.4.1.7057.10.1.2.1.10 NAME 'suseDhcpConfiguration' DESC 'Configuration of DHCP server management tools' SUP suseModuleConfiguration STRUCTURAL )", + "( 1.3.6.1.4.1.7057.10.1.2.1.11 NAME 'suseMailConfiguration' DESC 'Configuration of IMAP user management tools' SUP suseModuleConfiguration STRUCTURAL MUST ( suseImapServer $ suseImapAdmin $ suseImapDefaultQuota $ suseImapUseSsl ) )" + ], + "structuralObjectClass": [ + "subentry" + ], + "subschemaSubentry": [ + "cn=Subschema" + ] + }, + "schema_entry": "cn=Subschema", + "type": "SchemaInfo" +} +""" + +slapd_2_4_dsa_info = """ +{ + "raw": { + "configContext": [ + "cn=config" + ], + "entryDN": [ + "" + ], + "namingContexts": [ + "o=services", + "o=test" + ], + "objectClass": [ + "top", + "OpenLDAProotDSE" + ], + "structuralObjectClass": [ + "OpenLDAProotDSE" + ], + "subschemaSubentry": [ + "cn=Subschema" + ], + "supportedControl": [ + "1.3.6.1.4.1.4203.1.9.1.1", + "2.16.840.1.113730.3.4.18", + "2.16.840.1.113730.3.4.2", + "1.3.6.1.4.1.4203.1.10.1", + "1.2.840.113556.1.4.319", + "1.2.826.0.1.3344810.2.3", + "1.3.6.1.1.13.2", + "1.3.6.1.1.13.1", + "1.3.6.1.1.12" + ], + "supportedExtension": [ + "1.3.6.1.4.1.1466.20037", + "1.3.6.1.4.1.4203.1.11.1", + "1.3.6.1.4.1.4203.1.11.3", + "1.3.6.1.1.8" + ], + "supportedFeatures": [ + "1.3.6.1.1.14", + "1.3.6.1.4.1.4203.1.5.1", + "1.3.6.1.4.1.4203.1.5.2", + "1.3.6.1.4.1.4203.1.5.3", + "1.3.6.1.4.1.4203.1.5.4", + "1.3.6.1.4.1.4203.1.5.5" + ], + "supportedLDAPVersion": [ + "3" + ], + "supportedSASLMechanisms": [ + "GSSAPI", + "DIGEST-MD5" + ] + }, + "type": "DsaInfo" +} +""" diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__init__.py b/python/user_packages/Python313/site-packages/ldap3/strategy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1780004109ccf4f8352ac79fa202959eacf577a Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/asyncStream.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/asyncStream.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..708c142d8779ce0647ecb334ed2c9f0c79d8e1ad Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/asyncStream.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/asynchronous.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/asynchronous.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fcd05a1466184c87d8dafc5a6402754813998985 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/asynchronous.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/base.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/base.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48f6f5a6bac883d965e0ac4e681ccead69c763e7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/base.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/ldifProducer.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/ldifProducer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7517989c295252e7256c0748cf37c86188174472 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/ldifProducer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockAsync.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockAsync.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da7b75bbdeeda32124c0b7a60f19338034d618d3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockAsync.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockBase.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockBase.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34598216d90097fdd7980beab72ee60e65f269a4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockBase.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockSync.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockSync.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc5012e78ce5fcdc6a6c2beb8db8d62993500c59 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/mockSync.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/restartable.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/restartable.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c5e61fa8a70992c31060135e4c49d13c9d251f1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/restartable.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/reusable.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/reusable.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..574fc2251b7957a8b551274b0bbbf17a0420fb2f Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/reusable.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/safeRestartable.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/safeRestartable.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4308a19dea3b909cd6fd359659e5edfc4661eb72 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/safeRestartable.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/safeSync.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/safeSync.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3090b111ccbab85ee5e62a78f8a39faa1342c03 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/safeSync.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/sync.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/sync.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f81b42e7b12f522addb65785176e1b2ddb76f73d Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/strategy/__pycache__/sync.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/asyncStream.py b/python/user_packages/Python313/site-packages/ldap3/strategy/asyncStream.py new file mode 100644 index 0000000000000000000000000000000000000000..631331c5a7ff9bf992c4e6f0c6b04db9252cf06d --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/asyncStream.py @@ -0,0 +1,119 @@ +""" +""" + +# Created on 2016.07.10 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +try: + from queue import Queue +except ImportError: # Python 2 + # noinspection PyUnresolvedReferences + from Queue import Queue + +from io import StringIO +from os import linesep + +from ..protocol.rfc2849 import decode_persistent_search_control +from ..strategy.asynchronous import AsyncStrategy +from ..core.exceptions import LDAPLDIFError +from ..utils.conv import prepare_for_stream +from ..protocol.rfc2849 import persistent_search_response_to_ldif, add_ldif_header + + +# noinspection PyProtectedMember +class AsyncStreamStrategy(AsyncStrategy): + """ + This strategy is asynchronous. It streams responses in a generator as they appear in the self._responses container + """ + def __init__(self, ldap_connection): + AsyncStrategy.__init__(self, ldap_connection) + self.can_stream = True + self.line_separator = linesep + self.all_base64 = False + self.stream = None + self.order = dict() + self._header_added = False + self.persistent_search_message_id = None + self.streaming = False + self.callback = None + if ldap_connection.pool_size: + self.events = Queue(ldap_connection.pool_size) + else: + self.events = Queue() + + del self._requests # remove _requests dict from Async Strategy + + def _start_listen(self): + AsyncStrategy._start_listen(self) + if self.streaming: + if not self.stream or (isinstance(self.stream, StringIO) and self.stream.closed): + self.set_stream(StringIO()) + + def _stop_listen(self): + AsyncStrategy._stop_listen(self) + if self.streaming: + self.stream.close() + + def accumulate_stream(self, message_id, change): + if message_id == self.persistent_search_message_id: + with self.async_lock: + self._responses[message_id] = [] + if self.streaming: + if not self._header_added and self.stream.tell() == 0: + header = add_ldif_header(['-'])[0] + self.stream.write(prepare_for_stream(header + self.line_separator + self.line_separator)) + ldif_lines = persistent_search_response_to_ldif(change) + if self.stream and ldif_lines and not self.connection.closed: + fragment = self.line_separator.join(ldif_lines) + if not self._header_added and self.stream.tell() == 0: + self._header_added = True + header = add_ldif_header(['-'])[0] + self.stream.write(prepare_for_stream(header + self.line_separator + self.line_separator)) + self.stream.write(prepare_for_stream(fragment + self.line_separator + self.line_separator)) + else: # strategy is not streaming, events are added to a queue + notification = decode_persistent_search_control(change) + if notification: + change.update(notification) + del change['controls']['2.16.840.1.113730.3.4.7'] + if not self.callback: + self.events.put(change) + else: + self.callback(change) + + def get_stream(self): + if self.streaming: + return self.stream + return None + + def set_stream(self, value): + error = False + try: + if not value.writable(): + error = True + except (ValueError, AttributeError): + error = True + + if error: + raise LDAPLDIFError('stream must be writable') + + self.stream = value + self.streaming = True diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/asynchronous.py b/python/user_packages/Python313/site-packages/ldap3/strategy/asynchronous.py new file mode 100644 index 0000000000000000000000000000000000000000..613db2a7e43dd7288c4f5171cff97ad4e869ebe8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/asynchronous.py @@ -0,0 +1,292 @@ +""" +""" + +# Created on 2013.07.15 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from threading import Thread, Lock, Event +import socket + +from .. import get_config_parameter, DIGEST_MD5 +from ..core.exceptions import LDAPSSLConfigurationError, LDAPStartTLSError, LDAPOperationResult, LDAPSignatureVerificationFailedError +from ..strategy.base import BaseStrategy, RESPONSE_COMPLETE +from ..protocol.rfc4511 import LDAPMessage +from ..utils.log import log, log_enabled, format_ldap_message, ERROR, NETWORK, EXTENDED +from ..utils.asn1 import decoder, decode_message_fast +from ..protocol.sasl.digestMd5 import md5_hmac + + +# noinspection PyProtectedMember +class AsyncStrategy(BaseStrategy): + """ + This strategy is asynchronous. You send the request and get the messageId of the request sent + Receiving data from socket is managed in a separated thread in a blocking mode + Requests return an int value to indicate the messageId of the requested Operation + You get the response with get_response, it has a timeout to wait for response to appear + Connection.response will contain the whole LDAP response for the messageId requested in a dict form + Connection.request will contain the result LDAP message in a dict form + Response appear in strategy._responses dictionary + """ + + # noinspection PyProtectedMember + class ReceiverSocketThread(Thread): + """ + The thread that actually manage the receiver socket + """ + + def __init__(self, ldap_connection): + Thread.__init__(self) + self.connection = ldap_connection + self.socket_size = get_config_parameter('SOCKET_SIZE') + + def run(self): + """ + Waits for data on socket, computes the length of the message and waits for enough bytes to decode the message + Message are appended to strategy._responses + """ + unprocessed = b'' + get_more_data = True + listen = True + data = b'' + sasl_total_bytes_recieved = 0 + sasl_received_data = b'' # used to verify the signature, typo GC + sasl_next_packet = b'' + sasl_buffer_length = -1 + # sasl_signature = b'' # not needed here GC + # sasl_sec_num = b'' # used to verify the signature, not needed here GC + + while listen: + if get_more_data: + try: + data = self.connection.socket.recv(self.socket_size) + except (OSError, socket.error, AttributeError): + if self.connection.receive_timeout: # a receive timeout has been detected - keep kistening on the socket + continue + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', str(e), self.connection) + raise # unexpected exception - re-raise + if len(data) > 0: + # If we are using DIGEST-MD5 and LDAP signing is set : verify & remove the signature from the message + if self.connection.sasl_mechanism == DIGEST_MD5 and self.connection._digest_md5_kis and not self.connection.sasl_in_progress: + data = sasl_next_packet + data + + if sasl_received_data == b'' or sasl_next_packet: + # Remove the sizeOf(encoded_message + signature + 0x0001 + secNum) from data. + sasl_buffer_length = int.from_bytes(data[0:4], "big") + data = data[4:] + sasl_next_packet = b'' + sasl_total_bytes_recieved += len(data) + sasl_received_data += data + + if sasl_total_bytes_recieved >= sasl_buffer_length: + # When the LDAP response is splitted accross multiple TCP packets, the SASL buffer length is equal to the MTU of each packet..Which is usually not equal to self.socket_size + # This means that the end of one SASL packet/beginning of one other....could be located in the middle of data + # We are using "sasl_received_data" instead of "data" & "unprocessed" for this reason + + # structure of messages when LDAP signing is enabled : sizeOf(encoded_message + signature + 0x0001 + secNum) + encoded_message + signature + 0x0001 + secNum + sasl_signature = sasl_received_data[sasl_buffer_length - 16:sasl_buffer_length - 6] + sasl_sec_num = sasl_received_data[sasl_buffer_length - 4:sasl_buffer_length] + sasl_next_packet = sasl_received_data[sasl_buffer_length:] # the last "data" variable may contain another sasl packet. We'll process it at the next iteration. + sasl_received_data = sasl_received_data[:sasl_buffer_length - 16] # remove signature + 0x0001 + secNum + the next packet if any, from sasl_received_data + + kis = self.connection._digest_md5_kis # renamed to lowercase GC + calculated_signature = bytes.fromhex(md5_hmac(kis, sasl_sec_num + sasl_received_data)[0:20]) + if sasl_signature != calculated_signature: + raise LDAPSignatureVerificationFailedError("Signature verification failed for the recieved LDAP message number " + str(int.from_bytes(sasl_sec_num, 'big')) + ". Expected signature " + calculated_signature.hex() + " but got " + sasl_signature.hex() + ".") + sasl_total_bytes_recieved = 0 + unprocessed += sasl_received_data + sasl_received_data = b'' + else: + unprocessed += data + data = b'' + else: + listen = False + length = BaseStrategy.compute_ldap_message_size(unprocessed) + if length == -1 or len(unprocessed) < length: + get_more_data = True + elif len(unprocessed) >= length: # add message to message list + if self.connection.usage: + self.connection._usage.update_received_message(length) + if log_enabled(NETWORK): + log(NETWORK, 'received %d bytes via <%s>', length, self.connection) + if self.connection.fast_decoder: + ldap_resp = decode_message_fast(unprocessed[:length]) + dict_response = self.connection.strategy.decode_response_fast(ldap_resp) + else: + ldap_resp = decoder.decode(unprocessed[:length], asn1Spec=LDAPMessage())[0] + dict_response = self.connection.strategy.decode_response(ldap_resp) + message_id = int(ldap_resp['messageID']) + if log_enabled(NETWORK): + log(NETWORK, 'received 1 ldap message via <%s>', self.connection) + if log_enabled(EXTENDED): + log(EXTENDED, 'ldap message received via <%s>:%s', self.connection, format_ldap_message(ldap_resp, '<<')) + if dict_response['type'] == 'extendedResp' and (dict_response['responseName'] == '1.3.6.1.4.1.1466.20037' or hasattr(self.connection, '_awaiting_for_async_start_tls')): + if dict_response['result'] == 0: # StartTls in progress + if self.connection.server.tls: + self.connection.server.tls._start_tls(self.connection) + else: + self.connection.last_error = 'no Tls object defined in Server' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSSLConfigurationError(self.connection.last_error) + else: + self.connection.last_error = 'asynchronous StartTls failed' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPStartTLSError(self.connection.last_error) + del self.connection._awaiting_for_async_start_tls + if message_id != 0: # 0 is reserved for 'Unsolicited Notification' from server as per RFC4511 (paragraph 4.4) + with self.connection.strategy.async_lock: + if message_id in self.connection.strategy._responses: + self.connection.strategy._responses[message_id].append(dict_response) + else: + self.connection.strategy._responses[message_id] = [dict_response] + if dict_response['type'] not in ['searchResEntry', 'searchResRef', 'intermediateResponse']: + self.connection.strategy._responses[message_id].append(RESPONSE_COMPLETE) + self.connection.strategy.set_event_for_message(message_id) + + if self.connection.strategy.can_stream: # for AsyncStreamStrategy, used for PersistentSearch + self.connection.strategy.accumulate_stream(message_id, dict_response) + unprocessed = unprocessed[length:] + get_more_data = False if unprocessed else True + listen = True if self.connection.listening or unprocessed else False + else: # Unsolicited Notification + if dict_response['responseName'] == '1.3.6.1.4.1.1466.20036': # Notice of Disconnection as per RFC4511 (paragraph 4.4.1) + listen = False + else: + self.connection.last_error = 'unknown unsolicited notification from server' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPStartTLSError(self.connection.last_error) + self.connection.strategy.close() + + def __init__(self, ldap_connection): + BaseStrategy.__init__(self, ldap_connection) + self.sync = False + self.no_real_dsa = False + self.pooled = False + self._responses = None + self._requests = None + self.can_stream = False + self.receiver = None + self.async_lock = Lock() + self.event_lock = Lock() + self._events = {} + + def open(self, reset_usage=True, read_server_info=True): + """ + Open connection and start listen on the socket in a different thread + """ + with self.connection.connection_lock: + self._responses = dict() + self._requests = dict() + BaseStrategy.open(self, reset_usage, read_server_info) + + if read_server_info: + try: + self.connection.refresh_server_info() + except LDAPOperationResult: # catch errors from server if raise_exception = True + self.connection.server._dsa_info = None + self.connection.server._schema_info = None + + def close(self): + """ + Close connection and stop socket thread + """ + with self.connection.connection_lock: + BaseStrategy.close(self) + + def _add_event_for_message(self, message_id): + with self.event_lock: + # Should have the check here because the receiver thread may has created it + if message_id not in self._events: + self._events[message_id] = Event() + + def set_event_for_message(self, message_id): + with self.event_lock: + # The receiver thread may receive the response before the sender set the event for the message_id, + # so we have to check if the event exists + if message_id not in self._events: + self._events[message_id] = Event() + self._events[message_id].set() + + def _get_event_for_message(self, message_id): + with self.event_lock: + if message_id not in self._events: + raise RuntimeError('Event for message[{}] should have been created before accessing'.format(message_id)) + return self._events[message_id] + + def post_send_search(self, message_id): + """ + Clears connection.response and returns messageId + """ + self.connection.response = None + self.connection.request = None + self.connection.result = None + self._add_event_for_message(message_id) + return message_id + + def post_send_single_response(self, message_id): + """ + Clears connection.response and returns messageId. + """ + self.connection.response = None + self.connection.request = None + self.connection.result = None + self._add_event_for_message(message_id) + return message_id + + def _start_listen(self): + """ + Start thread in daemon mode + """ + if not self.connection.listening: + self.receiver = AsyncStrategy.ReceiverSocketThread(self.connection) + self.connection.listening = True + self.receiver.daemon = True + self.receiver.start() + + def _get_response(self, message_id, timeout): + """ + Performs the capture of LDAP response for this strategy + The response is only complete after the event been set + """ + event = self._get_event_for_message(message_id) + flag = event.wait(timeout) + if not flag: + # timeout + return None + + # In this stage we could ensure the response is already there + self._events.pop(message_id) + with self.async_lock: + return self._responses.pop(message_id) + + def receiving(self): + raise NotImplementedError + + def get_stream(self): + raise NotImplementedError + + def set_stream(self, value): + raise NotImplementedError diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/base.py b/python/user_packages/Python313/site-packages/ldap3/strategy/base.py new file mode 100644 index 0000000000000000000000000000000000000000..6b6211ee1346c836b5432bdb51ea770069214dcd --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/base.py @@ -0,0 +1,925 @@ +""" +""" + +# Created on 2013.07.15 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more dectails. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import socket +try: # try to discover if unix sockets are available for LDAP over IPC (ldapi:// scheme) + # noinspection PyUnresolvedReferences + from socket import AF_UNIX + unix_socket_available = True +except ImportError: + unix_socket_available = False +from struct import pack +from platform import system +from random import choice + +from .. import SYNC, ANONYMOUS, get_config_parameter, BASE, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES, DIGEST_MD5 +from ..core.results import DO_NOT_RAISE_EXCEPTIONS, RESULT_REFERRAL +from ..core.exceptions import LDAPOperationResult, LDAPSASLBindInProgressError, LDAPSocketOpenError, LDAPSessionTerminatedByServerError,\ + LDAPUnknownResponseError, LDAPUnknownRequestError, LDAPReferralError, communication_exception_factory, LDAPStartTLSError, \ + LDAPSocketSendError, LDAPExceptionError, LDAPControlError, LDAPResponseTimeoutError, LDAPTransactionError +from ..utils.uri import parse_uri +from ..protocol.rfc4511 import LDAPMessage, ProtocolOp, MessageID, SearchResultEntry +from ..operation.add import add_response_to_dict, add_request_to_dict +from ..operation.modify import modify_request_to_dict, modify_response_to_dict +from ..operation.search import search_result_reference_response_to_dict, search_result_done_response_to_dict,\ + search_result_entry_response_to_dict, search_request_to_dict, search_result_entry_response_to_dict_fast,\ + search_result_reference_response_to_dict_fast, attributes_to_dict, attributes_to_dict_fast +from ..operation.bind import bind_response_to_dict, bind_request_to_dict, sicily_bind_response_to_dict, bind_response_to_dict_fast, \ + sicily_bind_response_to_dict_fast +from ..operation.compare import compare_response_to_dict, compare_request_to_dict +from ..operation.extended import extended_request_to_dict, extended_response_to_dict, intermediate_response_to_dict, extended_response_to_dict_fast, intermediate_response_to_dict_fast +from ..core.server import Server +from ..operation.modifyDn import modify_dn_request_to_dict, modify_dn_response_to_dict +from ..operation.delete import delete_response_to_dict, delete_request_to_dict +from ..protocol.convert import prepare_changes_for_request, build_controls_list +from ..operation.abandon import abandon_request_to_dict +from ..core.tls import Tls +from ..protocol.oid import Oids +from ..protocol.rfc2696 import RealSearchControlValue +from ..protocol.microsoft import DirSyncControlResponseValue +from ..utils.log import log, log_enabled, ERROR, BASIC, PROTOCOL, NETWORK, EXTENDED, format_ldap_message +from ..utils.asn1 import encode, decoder, ldap_result_to_dict_fast, decode_sequence +from ..utils.conv import to_unicode +from ..protocol.sasl.digestMd5 import md5_h, md5_hmac + +SESSION_TERMINATED_BY_SERVER = 'TERMINATED_BY_SERVER' +TRANSACTION_ERROR = 'TRANSACTION_ERROR' +RESPONSE_COMPLETE = 'RESPONSE_FROM_SERVER_COMPLETE' + + +# noinspection PyProtectedMember +class BaseStrategy(object): + """ + Base class for connection strategy + """ + + def __init__(self, ldap_connection): + self.connection = ldap_connection + self._outstanding = None + self._referrals = [] + self.sync = None # indicates a synchronous connection + self.no_real_dsa = None # indicates a connection to a fake LDAP server + self.pooled = None # Indicates a connection with a connection pool + self.can_stream = None # indicates if a strategy keeps a stream of responses (i.e. LdifProducer can accumulate responses with a single header). Stream must be initialized and closed in _start_listen() and _stop_listen() + self.referral_cache = {} + self.thread_safe = False # Indicates that connection can be used in a multithread application + if log_enabled(BASIC): + log(BASIC, 'instantiated <%s>: <%s>', self.__class__.__name__, self) + + def __str__(self): + s = [ + str(self.connection) if self.connection else 'None', + 'sync' if self.sync else 'async', + 'no real DSA' if self.no_real_dsa else 'real DSA', + 'pooled' if self.pooled else 'not pooled', + 'can stream output' if self.can_stream else 'cannot stream output', + ] + return ' - '.join(s) + + def open(self, reset_usage=True, read_server_info=True): + """ + Open a socket to a server. Choose a server from the server pool if available + """ + if log_enabled(NETWORK): + log(NETWORK, 'opening connection for <%s>', self.connection) + if self.connection.lazy and not self.connection._executing_deferred: + self.connection._deferred_open = True + self.connection.closed = False + if log_enabled(NETWORK): + log(NETWORK, 'deferring open connection for <%s>', self.connection) + else: + if not self.connection.closed and not self.connection._executing_deferred: # try to close connection if still open + self.close() + + self._outstanding = dict() + if self.connection.usage: + if reset_usage or not self.connection._usage.initial_connection_start_time: + self.connection._usage.start() + + if self.connection.server_pool: + new_server = self.connection.server_pool.get_server(self.connection) # get a server from the server_pool if available + if self.connection.server != new_server: + self.connection.server = new_server + if self.connection.usage: + self.connection._usage.servers_from_pool += 1 + + exception_history = [] + if not self.no_real_dsa: # tries to connect to a real server + for candidate_address in self.connection.server.candidate_addresses(): + try: + if log_enabled(BASIC): + log(BASIC, 'try to open candidate address %s', candidate_address[:-2]) + self._open_socket(candidate_address, self.connection.server.ssl, unix_socket=self.connection.server.ipc) + self.connection.server.current_address = candidate_address + self.connection.server.update_availability(candidate_address, True) + break + except Exception as e: + self.connection.server.update_availability(candidate_address, False) + # exception_history.append((datetime.now(), exc_type, exc_value, candidate_address[4])) + exception_history.append((type(e)(str(e)), candidate_address[4])) + if not self.connection.server.current_address and exception_history: + if len(exception_history) == 1: # only one exception, reraise + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', str(exception_history[0][0]) + ' ' + str((exception_history[0][1])), self.connection) + raise exception_history[0][0] + else: + if log_enabled(ERROR): + log(ERROR, 'unable to open socket for <%s>', self.connection) + raise LDAPSocketOpenError('unable to open socket', exception_history) + elif not self.connection.server.current_address: + if log_enabled(ERROR): + log(ERROR, 'invalid server address for <%s>', self.connection) + raise LDAPSocketOpenError('invalid server address') + + self.connection._deferred_open = False + self._start_listen() + if log_enabled(NETWORK): + log(NETWORK, 'connection open for <%s>', self.connection) + + def close(self): + """ + Close connection + """ + if log_enabled(NETWORK): + log(NETWORK, 'closing connection for <%s>', self.connection) + if self.connection.lazy and not self.connection._executing_deferred and (self.connection._deferred_bind or self.connection._deferred_open): + self.connection.listening = False + self.connection.closed = True + if log_enabled(NETWORK): + log(NETWORK, 'deferred connection closed for <%s>', self.connection) + else: + if not self.connection.closed: + self._stop_listen() + if not self. no_real_dsa: + self._close_socket() + if log_enabled(NETWORK): + log(NETWORK, 'connection closed for <%s>', self.connection) + + self.connection.bound = False + self.connection.request = None + self.connection.response = None + self.connection.tls_started = False + self._outstanding = None + self._referrals = [] + + if not self.connection.strategy.no_real_dsa: + self.connection.server.current_address = None + if self.connection.usage: + self.connection._usage.stop() + + def _open_socket(self, address, use_ssl=False, unix_socket=False): + """ + Tries to open and connect a socket to a Server + raise LDAPExceptionError if unable to open or connect socket + """ + try: + self.connection.socket = socket.socket(*address[:3]) + except Exception as e: + self.connection.last_error = 'socket creation error: ' + str(e) + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + # raise communication_exception_factory(LDAPSocketOpenError, exc)(self.connection.last_error) + raise communication_exception_factory(LDAPSocketOpenError, type(e)(str(e)))(self.connection.last_error) + # Try to bind the socket locally before connecting to the remote address + # We go through our connection's source ports and try to bind our socket to our connection's source address + # with them. + # If no source address or ports were specified, this will have the same success/fail result as if we + # tried to connect to the remote server without binding locally first. + # This is actually a little bit better, as it lets us distinguish the case of "issue binding the socket + # locally" from "remote server is unavailable" with more clarity, though this will only really be an + # issue when no source address/port is specified if the system checking server availability is running + # as a very unprivileged user. + last_bind_exc = None + if unix_socket_available and self.connection.socket.family != socket.AF_UNIX: + socket_bind_succeeded = False + for source_port in self.connection.source_port_list: + try: + self.connection.socket.bind((self.connection.source_address, source_port)) + socket_bind_succeeded = True + break + except Exception as bind_ex: + last_bind_exc = bind_ex + # we'll always end up logging at error level if we cannot bind any ports to the address locally. + # but if some work and some don't you probably don't want the ones that don't at ERROR level + if log_enabled(NETWORK): + log(NETWORK, 'Unable to bind to local address <%s> with source port <%s> due to <%s>', + self.connection.source_address, source_port, bind_ex) + if not socket_bind_succeeded: + self.connection.last_error = 'socket connection error while locally binding: ' + str(last_bind_exc) + if log_enabled(ERROR): + log(ERROR, 'Unable to locally bind to local address <%s> with any of the source ports <%s> for connection <%s due to <%s>', + self.connection.source_address, self.connection.source_port_list, self.connection, last_bind_exc) + raise communication_exception_factory(LDAPSocketOpenError, type(last_bind_exc)(str(last_bind_exc)))(last_bind_exc) + + try: # set socket timeout for opening connection + if self.connection.server.connect_timeout: + self.connection.socket.settimeout(self.connection.server.connect_timeout) + self.connection.socket.connect(address[4]) + except socket.error as e: + self.connection.last_error = 'socket connection error while opening: ' + str(e) + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + # raise communication_exception_factory(LDAPSocketOpenError, exc)(self.connection.last_error) + raise communication_exception_factory(LDAPSocketOpenError, type(e)(str(e)))(self.connection.last_error) + + # Set connection recv timeout (must be set after connect, + # because socket.settimeout() affects both, connect() as + # well as recv(). Set it before tls.wrap_socket() because + # the recv timeout should take effect during the TLS + # handshake. + if self.connection.receive_timeout is not None: + try: # set receive timeout for the connection socket + self.connection.socket.settimeout(self.connection.receive_timeout) + if system().lower() == 'windows': + self.connection.socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, int(1000 * self.connection.receive_timeout)) + else: + self.connection.socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, pack('LL', self.connection.receive_timeout, 0)) + except socket.error as e: + self.connection.last_error = 'unable to set receive timeout for socket connection: ' + str(e) + + # if exc: + # if log_enabled(ERROR): + # log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + # raise communication_exception_factory(LDAPSocketOpenError, exc)(self.connection.last_error) + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise communication_exception_factory(LDAPSocketOpenError, type(e)(str(e)))(self.connection.last_error) + + if use_ssl: + try: + self.connection.server.tls.wrap_socket(self.connection, do_handshake=True) + if self.connection.usage: + self.connection._usage.wrapped_sockets += 1 + except Exception as e: + self.connection.last_error = 'socket ssl wrapping error: ' + str(e) + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise communication_exception_factory(LDAPSocketOpenError, type(e)(str(e)))(self.connection.last_error) + if self.connection.usage: + self.connection._usage.open_sockets += 1 + + self.connection.closed = False + + def _close_socket(self): + """ + Try to close a socket + don't raise exception if unable to close socket, assume socket is already closed + """ + + try: + self.connection.socket.shutdown(socket.SHUT_RDWR) + except Exception: + pass + + try: + self.connection.socket.close() + except Exception: + pass + + self.connection.socket = None + self.connection.closed = True + + if self.connection.usage: + self.connection._usage.closed_sockets += 1 + + def _stop_listen(self): + self.connection.listening = False + + def send(self, message_type, request, controls=None): + """ + Send an LDAP message + Returns the message_id + """ + self.connection.request = None + if self.connection.listening: + if self.connection.sasl_in_progress and message_type not in ['bindRequest']: # as per RFC4511 (4.2.1) + self.connection.last_error = 'cannot send operation requests while SASL bind is in progress' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSASLBindInProgressError(self.connection.last_error) + message_id = self.connection.server.next_message_id() + ldap_message = LDAPMessage() + ldap_message['messageID'] = MessageID(message_id) + ldap_message['protocolOp'] = ProtocolOp().setComponentByName(message_type, request) + message_controls = build_controls_list(controls) + if message_controls is not None: + ldap_message['controls'] = message_controls + self.connection.request = BaseStrategy.decode_request(message_type, request, controls) + self._outstanding[message_id] = self.connection.request + self.sending(ldap_message) + else: + self.connection.last_error = 'unable to send message, socket is not open' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSocketOpenError(self.connection.last_error) + + return message_id + + def get_response(self, message_id, timeout=None, get_request=False): + """ + Get response LDAP messages + Responses are returned by the underlying connection strategy + Check if message_id LDAP message is still outstanding and wait for timeout to see if it appears in _get_response + Result is stored in connection.result + Responses without result is stored in connection.response + A tuple (responses, result) is returned + """ + if timeout is None: + timeout = get_config_parameter('RESPONSE_WAITING_TIMEOUT') + response = None + result = None + # request = None + if self._outstanding and message_id in self._outstanding: + responses = self._get_response(message_id, timeout) + + if not responses: + if log_enabled(ERROR): + log(ERROR, 'socket timeout, no response from server for <%s>', self.connection) + raise LDAPResponseTimeoutError('no response from server') + + if responses == SESSION_TERMINATED_BY_SERVER: + try: # try to close the session but don't raise any error if server has already closed the session + self.close() + except (socket.error, LDAPExceptionError): + pass + self.connection.last_error = 'session terminated by server' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSessionTerminatedByServerError(self.connection.last_error) + elif responses == TRANSACTION_ERROR: # Novell LDAP Transaction unsolicited notification + self.connection.last_error = 'transaction error' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPTransactionError(self.connection.last_error) + + # if referral in response opens a new connection to resolve referrals if requested + + if responses[-2]['result'] == RESULT_REFERRAL: + if self.connection.usage: + self.connection._usage.referrals_received += 1 + if self.connection.auto_referrals: + ref_response, ref_result = self.do_operation_on_referral(self._outstanding[message_id], responses[-2]['referrals']) + if ref_response is not None: + responses = ref_response + [ref_result] + responses.append(RESPONSE_COMPLETE) + elif ref_result is not None: + responses = [ref_result, RESPONSE_COMPLETE] + + self._referrals = [] + + if responses: + result = responses[-2] + response = responses[:-2] + self.connection.result = None + self.connection.response = None + + if self.connection.raise_exceptions and result and result['result'] not in DO_NOT_RAISE_EXCEPTIONS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, self.connection) + self._outstanding.pop(message_id) + self.connection.result = result.copy() + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + + # checks if any response has a range tag + # self._auto_range_searching is set as a flag to avoid recursive searches + if self.connection.auto_range and not hasattr(self, '_auto_range_searching') and any((True for resp in response if 'raw_attributes' in resp for name in resp['raw_attributes'] if ';range=' in name)): + self._auto_range_searching = result.copy() + temp_response = response[:] # copy + if self.do_search_on_auto_range(self._outstanding[message_id], response): + for resp in temp_response: + if resp['type'] == 'searchResEntry': + keys = [key for key in resp['raw_attributes'] if ';range=' in key] + for key in keys: + del resp['raw_attributes'][key] + del resp['attributes'][key] + response = temp_response + result = self._auto_range_searching + del self._auto_range_searching + + if self.connection.empty_attributes: + for entry in response: + if entry['type'] == 'searchResEntry': + for attribute_type in self._outstanding[message_id]['attributes']: + if attribute_type not in entry['raw_attributes'] and attribute_type not in (ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES): + entry['raw_attributes'][attribute_type] = list() + entry['attributes'][attribute_type] = list() + if log_enabled(PROTOCOL): + log(PROTOCOL, 'attribute set to empty list for missing attribute <%s> in <%s>', attribute_type, self) + if not self.connection.auto_range: + attrs_to_remove = [] + # removes original empty attribute in case a range tag is returned + for attribute_type in entry['attributes']: + if ';range' in attribute_type.lower(): + orig_attr, _, _ = attribute_type.partition(';') + attrs_to_remove.append(orig_attr) + for attribute_type in attrs_to_remove: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'attribute type <%s> removed in response because of same attribute returned as range by the server in <%s>', attribute_type, self) + del entry['raw_attributes'][attribute_type] + del entry['attributes'][attribute_type] + + request = self._outstanding.pop(message_id) + else: + if log_enabled(ERROR): + log(ERROR, 'message id not in outstanding queue for <%s>', self.connection) + raise(LDAPResponseTimeoutError('message id not in outstanding queue')) + + if get_request: + return response, result, request + else: + return response, result + + @staticmethod + def compute_ldap_message_size(data): + """ + Compute LDAP Message size according to BER definite length rules + Returns -1 if too few data to compute message length + """ + if isinstance(data, str): # fix for Python 2, data is string not bytes + data = bytearray(data) # Python 2 bytearray is equivalent to Python 3 bytes + + ret_value = -1 + if len(data) > 2: + if data[1] <= 127: # BER definite length - short form. Highest bit of byte 1 is 0, message length is in the last 7 bits - Value can be up to 127 bytes long + ret_value = data[1] + 2 + else: # BER definite length - long form. Highest bit of byte 1 is 1, last 7 bits counts the number of following octets containing the value length + bytes_length = data[1] - 128 + if len(data) >= bytes_length + 2: + value_length = 0 + cont = bytes_length + for byte in data[2:2 + bytes_length]: + cont -= 1 + value_length += byte * (256 ** cont) + ret_value = value_length + 2 + bytes_length + + return ret_value + + def decode_response(self, ldap_message): + """ + Convert received LDAPMessage to a dict + """ + message_type = ldap_message.getComponentByName('protocolOp').getName() + component = ldap_message['protocolOp'].getComponent() + controls = ldap_message['controls'] if ldap_message['controls'].hasValue() else None + if message_type == 'bindResponse': + if not bytes(component['matchedDN']).startswith(b'NTLM'): # patch for microsoft ntlm authentication + result = bind_response_to_dict(component) + else: + result = sicily_bind_response_to_dict(component) + elif message_type == 'searchResEntry': + result = search_result_entry_response_to_dict(component, self.connection.server.schema, self.connection.server.custom_formatter, self.connection.check_names) + elif message_type == 'searchResDone': + result = search_result_done_response_to_dict(component) + elif message_type == 'searchResRef': + result = search_result_reference_response_to_dict(component) + elif message_type == 'modifyResponse': + result = modify_response_to_dict(component) + elif message_type == 'addResponse': + result = add_response_to_dict(component) + elif message_type == 'delResponse': + result = delete_response_to_dict(component) + elif message_type == 'modDNResponse': + result = modify_dn_response_to_dict(component) + elif message_type == 'compareResponse': + result = compare_response_to_dict(component) + elif message_type == 'extendedResp': + result = extended_response_to_dict(component) + elif message_type == 'intermediateResponse': + result = intermediate_response_to_dict(component) + else: + if log_enabled(ERROR): + log(ERROR, 'unknown response <%s> for <%s>', message_type, self.connection) + raise LDAPUnknownResponseError('unknown response') + result['type'] = message_type + if controls: + result['controls'] = dict() + for control in controls: + decoded_control = self.decode_control(control) + result['controls'][decoded_control[0]] = decoded_control[1] + return result + + def decode_response_fast(self, ldap_message): + """ + Convert received LDAPMessage from fast ber decoder to a dict + """ + if ldap_message['protocolOp'] == 1: # bindResponse + if not ldap_message['payload'][1][3].startswith(b'NTLM'): # patch for microsoft ntlm authentication + result = bind_response_to_dict_fast(ldap_message['payload']) + else: + result = sicily_bind_response_to_dict_fast(ldap_message['payload']) + result['type'] = 'bindResponse' + elif ldap_message['protocolOp'] == 4: # searchResEntry' + result = search_result_entry_response_to_dict_fast(ldap_message['payload'], self.connection.server.schema, self.connection.server.custom_formatter, self.connection.check_names) + result['type'] = 'searchResEntry' + elif ldap_message['protocolOp'] == 5: # searchResDone + result = ldap_result_to_dict_fast(ldap_message['payload']) + result['type'] = 'searchResDone' + elif ldap_message['protocolOp'] == 19: # searchResRef + result = search_result_reference_response_to_dict_fast(ldap_message['payload']) + result['type'] = 'searchResRef' + elif ldap_message['protocolOp'] == 7: # modifyResponse + result = ldap_result_to_dict_fast(ldap_message['payload']) + result['type'] = 'modifyResponse' + elif ldap_message['protocolOp'] == 9: # addResponse + result = ldap_result_to_dict_fast(ldap_message['payload']) + result['type'] = 'addResponse' + elif ldap_message['protocolOp'] == 11: # delResponse + result = ldap_result_to_dict_fast(ldap_message['payload']) + result['type'] = 'delResponse' + elif ldap_message['protocolOp'] == 13: # modDNResponse + result = ldap_result_to_dict_fast(ldap_message['payload']) + result['type'] = 'modDNResponse' + elif ldap_message['protocolOp'] == 15: # compareResponse + result = ldap_result_to_dict_fast(ldap_message['payload']) + result['type'] = 'compareResponse' + elif ldap_message['protocolOp'] == 24: # extendedResp + result = extended_response_to_dict_fast(ldap_message['payload']) + result['type'] = 'extendedResp' + elif ldap_message['protocolOp'] == 25: # intermediateResponse + result = intermediate_response_to_dict_fast(ldap_message['payload']) + result['type'] = 'intermediateResponse' + else: + if log_enabled(ERROR): + log(ERROR, 'unknown response <%s> for <%s>', ldap_message['protocolOp'], self.connection) + raise LDAPUnknownResponseError('unknown response') + if ldap_message['controls']: + result['controls'] = dict() + for control in ldap_message['controls']: + decoded_control = self.decode_control_fast(control[3]) + result['controls'][decoded_control[0]] = decoded_control[1] + return result + + @staticmethod + def decode_control(control): + """ + decode control, return a 2-element tuple where the first element is the control oid + and the second element is a dictionary with description (from Oids), criticality and decoded control value + """ + control_type = str(control['controlType']) + criticality = bool(control['criticality']) + control_value = bytes(control['controlValue']) + unprocessed = None + if control_type == '1.2.840.113556.1.4.319': # simple paged search as per RFC2696 + control_resp, unprocessed = decoder.decode(control_value, asn1Spec=RealSearchControlValue()) + control_value = dict() + control_value['size'] = int(control_resp['size']) + control_value['cookie'] = bytes(control_resp['cookie']) + elif control_type == '1.2.840.113556.1.4.841': # DirSync AD + control_resp, unprocessed = decoder.decode(control_value, asn1Spec=DirSyncControlResponseValue()) + control_value = dict() + control_value['more_results'] = bool(control_resp['MoreResults']) # more_result if nonzero + control_value['cookie'] = bytes(control_resp['CookieServer']) + elif control_type == '1.3.6.1.1.13.1' or control_type == '1.3.6.1.1.13.2': # Pre-Read control, Post-Read Control as per RFC 4527 + control_resp, unprocessed = decoder.decode(control_value, asn1Spec=SearchResultEntry()) + control_value = dict() + control_value['result'] = attributes_to_dict(control_resp['attributes']) + if unprocessed: + if log_enabled(ERROR): + log(ERROR, 'unprocessed control response in substrate') + raise LDAPControlError('unprocessed control response in substrate') + return control_type, {'description': Oids.get(control_type, ''), 'criticality': criticality, 'value': control_value} + + @staticmethod + def decode_control_fast(control, from_server=True): + """ + decode control, return a 2-element tuple where the first element is the control oid + and the second element is a dictionary with description (from Oids), criticality and decoded control value + """ + control_type = str(to_unicode(control[0][3], from_server=from_server)) + criticality = False + control_value = None + for r in control[1:]: + if r[2] == 4: # controlValue + control_value = r[3] + else: + criticality = False if r[3] == 0 else True # criticality (booleand default to False) + if control_type == '1.2.840.113556.1.4.319': # simple paged search as per RFC2696 + control_resp = decode_sequence(control_value, 0, len(control_value)) + control_value = dict() + control_value['size'] = int(control_resp[0][3][0][3]) + control_value['cookie'] = bytes(control_resp[0][3][1][3]) + elif control_type == '1.2.840.113556.1.4.841': # DirSync AD + control_resp = decode_sequence(control_value, 0, len(control_value)) + control_value = dict() + control_value['more_results'] = True if control_resp[0][3][0][3] else False # more_result if nonzero + control_value['cookie'] = control_resp[0][3][2][3] + elif control_type == '1.3.6.1.1.13.1' or control_type == '1.3.6.1.1.13.2': # Pre-Read control, Post-Read Control as per RFC 4527 + control_resp = decode_sequence(control_value, 0, len(control_value)) + control_value = dict() + control_value['result'] = attributes_to_dict_fast(control_resp[0][3][1][3]) + return control_type, {'description': Oids.get(control_type, ''), 'criticality': criticality, 'value': control_value} + + @staticmethod + def decode_request(message_type, component, controls=None): + # message_type = ldap_message.getComponentByName('protocolOp').getName() + # component = ldap_message['protocolOp'].getComponent() + if message_type == 'bindRequest': + result = bind_request_to_dict(component) + elif message_type == 'unbindRequest': + result = dict() + elif message_type == 'addRequest': + result = add_request_to_dict(component) + elif message_type == 'compareRequest': + result = compare_request_to_dict(component) + elif message_type == 'delRequest': + result = delete_request_to_dict(component) + elif message_type == 'extendedReq': + result = extended_request_to_dict(component) + elif message_type == 'modifyRequest': + result = modify_request_to_dict(component) + elif message_type == 'modDNRequest': + result = modify_dn_request_to_dict(component) + elif message_type == 'searchRequest': + result = search_request_to_dict(component) + elif message_type == 'abandonRequest': + result = abandon_request_to_dict(component) + else: + if log_enabled(ERROR): + log(ERROR, 'unknown request <%s>', message_type) + raise LDAPUnknownRequestError('unknown request') + result['type'] = message_type + result['controls'] = controls + + return result + + def valid_referral_list(self, referrals): + referral_list = [] + for referral in referrals: + candidate_referral = parse_uri(referral) + if candidate_referral: + for ref_host in self.connection.server.allowed_referral_hosts: + if ref_host[0] == candidate_referral['host'] or ref_host[0] == '*': + if candidate_referral['host'] not in self._referrals: + candidate_referral['anonymousBindOnly'] = not ref_host[1] + referral_list.append(candidate_referral) + break + + return referral_list + + def do_next_range_search(self, request, response, attr_name): + done = False + current_response = response + while not done: + attr_type, _, returned_range = attr_name.partition(';range=') + _, _, high_range = returned_range.partition('-') + response['raw_attributes'][attr_type] += current_response['raw_attributes'][attr_name] + response['attributes'][attr_type] += current_response['attributes'][attr_name] + if high_range != '*': + if log_enabled(PROTOCOL): + log(PROTOCOL, 'performing next search on auto-range <%s> via <%s>', str(int(high_range) + 1), self.connection) + requested_range = attr_type + ';range=' + str(int(high_range) + 1) + '-*' + result = self.connection.search(search_base=response['dn'], + search_filter='(objectclass=*)', + search_scope=BASE, + dereference_aliases=request['dereferenceAlias'], + attributes=[attr_type + ';range=' + str(int(high_range) + 1) + '-*']) + if self.connection.strategy.thread_safe: + status, result, _response, _ = result + else: + status = result + result = self.connection.result + _response = self.connection.response + + if self.connection.strategy.sync: + if status: + current_response = _response[0] + else: + done = True + else: + current_response, _ = self.get_response(status) + current_response = current_response[0] + + if not done: + if requested_range in current_response['raw_attributes'] and len(current_response['raw_attributes'][requested_range]) == 0: + del current_response['raw_attributes'][requested_range] + del current_response['attributes'][requested_range] + attr_name = list(filter(lambda a: ';range=' in a, current_response['raw_attributes'].keys()))[0] + continue + done = True + + def do_search_on_auto_range(self, request, response): + for resp in [r for r in response if r['type'] == 'searchResEntry']: + for attr_name in list(resp['raw_attributes'].keys()): # generate list to avoid changing of dict size error + if ';range=' in attr_name: + attr_type, _, range_values = attr_name.partition(';range=') + if range_values in ('1-1', '0-0'): # DirSync returns these values for adding and removing members + return False + if attr_type not in resp['raw_attributes'] or resp['raw_attributes'][attr_type] is None: + resp['raw_attributes'][attr_type] = list() + if attr_type not in resp['attributes'] or resp['attributes'][attr_type] is None: + resp['attributes'][attr_type] = list() + self.do_next_range_search(request, resp, attr_name) + return True + + def create_referral_connection(self, referrals): + referral_connection = None + selected_referral = None + cachekey = None + valid_referral_list = self.valid_referral_list(referrals) + if valid_referral_list: + preferred_referral_list = [referral for referral in valid_referral_list if + referral['ssl'] == self.connection.server.ssl] + selected_referral = choice(preferred_referral_list) if preferred_referral_list else choice( + valid_referral_list) + + cachekey = (selected_referral['host'], selected_referral['port'] or self.connection.server.port, selected_referral['ssl']) + if self.connection.use_referral_cache and cachekey in self.referral_cache: + referral_connection = self.referral_cache[cachekey] + else: + referral_server = Server(host=selected_referral['host'], + port=selected_referral['port'] or self.connection.server.port, + use_ssl=selected_referral['ssl'], + get_info=self.connection.server.get_info, + formatter=self.connection.server.custom_formatter, + connect_timeout=self.connection.server.connect_timeout, + mode=self.connection.server.mode, + allowed_referral_hosts=self.connection.server.allowed_referral_hosts, + tls=Tls(local_private_key_file=self.connection.server.tls.private_key_file, + local_certificate_file=self.connection.server.tls.certificate_file, + validate=self.connection.server.tls.validate, + version=self.connection.server.tls.version, + ca_certs_file=self.connection.server.tls.ca_certs_file) if + selected_referral['ssl'] else None) + + from ..core.connection import Connection + + referral_connection = Connection(server=referral_server, + user=self.connection.user if not selected_referral['anonymousBindOnly'] else None, + password=self.connection.password if not selected_referral['anonymousBindOnly'] else None, + version=self.connection.version, + authentication=self.connection.authentication if not selected_referral['anonymousBindOnly'] else ANONYMOUS, + client_strategy=SYNC, + auto_referrals=True, + read_only=self.connection.read_only, + check_names=self.connection.check_names, + raise_exceptions=self.connection.raise_exceptions, + fast_decoder=self.connection.fast_decoder, + receive_timeout=self.connection.receive_timeout, + sasl_mechanism=self.connection.sasl_mechanism, + sasl_credentials=self.connection.sasl_credentials) + + if self.connection.usage: + self.connection._usage.referrals_connections += 1 + + referral_connection.open() + referral_connection.strategy._referrals = self._referrals + if self.connection.tls_started and not referral_server.ssl: # if the original server was in start_tls mode and the referral server is not in ssl then start_tls on the referral connection + if not referral_connection.start_tls(): + error = 'start_tls in referral not successful' + (' - ' + referral_connection.last_error if referral_connection.last_error else '') + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error, self) + self.unbind() + raise LDAPStartTLSError(error) + + if self.connection.bound: + referral_connection.bind() + + if self.connection.usage: + self.connection._usage.referrals_followed += 1 + + return selected_referral, referral_connection, cachekey + + def do_operation_on_referral(self, request, referrals): + if log_enabled(PROTOCOL): + log(PROTOCOL, 'following referral for <%s>', self.connection) + selected_referral, referral_connection, cachekey = self.create_referral_connection(referrals) + if selected_referral: + if request['type'] == 'searchRequest': + referral_connection.search(selected_referral['base'] or request['base'], + selected_referral['filter'] or request['filter'], + selected_referral['scope'] or request['scope'], + request['dereferenceAlias'], + selected_referral['attributes'] or request['attributes'], + request['sizeLimit'], + request['timeLimit'], + request['typesOnly'], + controls=request['controls']) + elif request['type'] == 'addRequest': + referral_connection.add(selected_referral['base'] or request['entry'], + None, + request['attributes'], + controls=request['controls']) + elif request['type'] == 'compareRequest': + referral_connection.compare(selected_referral['base'] or request['entry'], + request['attribute'], + request['value'], + controls=request['controls']) + elif request['type'] == 'delRequest': + referral_connection.delete(selected_referral['base'] or request['entry'], + controls=request['controls']) + elif request['type'] == 'extendedReq': + referral_connection.extended(request['name'], + request['value'], + controls=request['controls'], + no_encode=True + ) + elif request['type'] == 'modifyRequest': + referral_connection.modify(selected_referral['base'] or request['entry'], + prepare_changes_for_request(request['changes']), + controls=request['controls']) + elif request['type'] == 'modDNRequest': + referral_connection.modify_dn(selected_referral['base'] or request['entry'], + request['newRdn'], + request['deleteOldRdn'], + request['newSuperior'], + controls=request['controls']) + else: + self.connection.last_error = 'referral operation not permitted' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPReferralError(self.connection.last_error) + + response = referral_connection.response + result = referral_connection.result + if self.connection.use_referral_cache: + self.referral_cache[cachekey] = referral_connection + else: + referral_connection.unbind() + else: + response = None + result = None + + return response, result + + def sending(self, ldap_message): + if log_enabled(NETWORK): + log(NETWORK, 'sending 1 ldap message for <%s>', self.connection) + try: + encoded_message = encode(ldap_message) + if self.connection.sasl_mechanism == DIGEST_MD5 and self.connection._digest_md5_kic and not self.connection.sasl_in_progress: + # If we are using DIGEST-MD5 and LDAP signing is enabled: add a signature to the message + sec_num = self.connection._digest_md5_sec_num # added underscore GC + kic = self.connection._digest_md5_kic # lowercase GC + + # RFC 2831 : encoded_message = sizeOf(encored_message + signature + 0x0001 + secNum) + encoded_message + signature + 0x0001 + secNum + signature = bytes.fromhex(md5_hmac(kic, int(sec_num).to_bytes(4, 'big') + encoded_message)[0:20]) + encoded_message = int(len(encoded_message) + 4 + 2 + 10).to_bytes(4, 'big') + encoded_message + signature + int(1).to_bytes(2, 'big') + int(sec_num).to_bytes(4, 'big') + self.connection._digest_md5_sec_num += 1 + + self.connection.socket.sendall(encoded_message) + if log_enabled(EXTENDED): + log(EXTENDED, 'ldap message sent via <%s>:%s', self.connection, format_ldap_message(ldap_message, '>>')) + if log_enabled(NETWORK): + log(NETWORK, 'sent %d bytes via <%s>', len(encoded_message), self.connection) + except socket.error as e: + self.connection.last_error = 'socket sending error' + str(e) + encoded_message = None + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + # raise communication_exception_factory(LDAPSocketSendError, exc)(self.connection.last_error) + raise communication_exception_factory(LDAPSocketSendError, type(e)(str(e)))(self.connection.last_error) + if self.connection.usage: + self.connection._usage.update_transmitted_message(self.connection.request, len(encoded_message)) + + def _start_listen(self): + # overridden on strategy class + raise NotImplementedError + + def _get_response(self, message_id, timeout): + # overridden in strategy class + raise NotImplementedError + + def receiving(self): + # overridden in strategy class + raise NotImplementedError + + def post_send_single_response(self, message_id): + # overridden in strategy class + raise NotImplementedError + + def post_send_search(self, message_id): + # overridden in strategy class + raise NotImplementedError + + def get_stream(self): + raise NotImplementedError + + def set_stream(self, value): + raise NotImplementedError + + def unbind_referral_cache(self): + while len(self.referral_cache) > 0: + cachekey, referral_connection = self.referral_cache.popitem() + referral_connection.unbind() diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/ldifProducer.py b/python/user_packages/Python313/site-packages/ldap3/strategy/ldifProducer.py new file mode 100644 index 0000000000000000000000000000000000000000..a39c4d73059e144aa33f5b83052c934b8e22ed48 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/ldifProducer.py @@ -0,0 +1,152 @@ +""" +""" + +# Created on 2013.07.15 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from io import StringIO +from os import linesep +import random + +from ..core.exceptions import LDAPLDIFError +from ..utils.conv import prepare_for_stream +from ..protocol.rfc4511 import LDAPMessage, MessageID, ProtocolOp, LDAP_MAX_INT +from ..protocol.rfc2849 import operation_to_ldif, add_ldif_header +from ..protocol.convert import build_controls_list +from .base import BaseStrategy + + +class LdifProducerStrategy(BaseStrategy): + """ + This strategy is used to create the LDIF stream for the Add, Delete, Modify, ModifyDn operations. + You send the request and get the request in the ldif-change representation of the operation. + NO OPERATION IS SENT TO THE LDAP SERVER! + Connection.request will contain the result LDAP message in a dict form + Connection.response will contain the ldif-change format of the requested operation if available + You don't need a real server to connect to for this strategy + """ + + def __init__(self, ldap_connection): + BaseStrategy.__init__(self, ldap_connection) + self.sync = True + self.no_real_dsa = True + self.pooled = False + self.can_stream = True + self.line_separator = linesep + self.all_base64 = False + self.stream = None + self.order = dict() + self._header_added = False + random.seed() + + def _open_socket(self, address, use_ssl=False, unix_socket=False): # fake open socket + self.connection.socket = NotImplemented # placeholder for a dummy socket + if self.connection.usage: + self.connection._usage.open_sockets += 1 + + self.connection.closed = False + + def _close_socket(self): + if self.connection.usage: + self.connection._usage.closed_sockets += 1 + + self.connection.socket = None + self.connection.closed = True + + def _start_listen(self): + self.connection.listening = True + self.connection.closed = False + self.connection.bound = True + self._header_added = False + if not self.stream or (isinstance(self.stream, StringIO) and self.stream.closed): + self.set_stream(StringIO()) + + def _stop_listen(self): + self.stream.close() + self.connection.listening = False + self.connection.bound = False + self.connection.closed = True + + def receiving(self): + return None + + def send(self, message_type, request, controls=None): + """ + Build the LDAPMessage without sending to server + """ + message_id = random.randint(0, LDAP_MAX_INT) + ldap_message = LDAPMessage() + ldap_message['messageID'] = MessageID(message_id) + ldap_message['protocolOp'] = ProtocolOp().setComponentByName(message_type, request) + message_controls = build_controls_list(controls) + if message_controls is not None: + ldap_message['controls'] = message_controls + + self.connection.request = BaseStrategy.decode_request(message_type, request, controls) + self.connection.request['controls'] = controls + if self._outstanding is None: + self._outstanding = dict() + self._outstanding[message_id] = self.connection.request + return message_id + + def post_send_single_response(self, message_id): + self.connection.response = None + self.connection.result = None + if self._outstanding and message_id in self._outstanding: + request = self._outstanding.pop(message_id) + ldif_lines = operation_to_ldif(self.connection.request['type'], request, self.all_base64, self.order.get(self.connection.request['type'])) + if self.stream and ldif_lines and not self.connection.closed: + self.accumulate_stream(self.line_separator.join(ldif_lines)) + ldif_lines = add_ldif_header(ldif_lines) + self.connection.response = self.line_separator.join(ldif_lines) + return self.connection.response + + return None + + def post_send_search(self, message_id): + raise LDAPLDIFError('LDIF-CONTENT cannot be produced for Search operations') + + def _get_response(self, message_id, timeout): + pass + + def accumulate_stream(self, fragment): + if not self._header_added and self.stream.tell() == 0: + self._header_added = True + header = add_ldif_header(['-'])[0] + self.stream.write(prepare_for_stream(header + self.line_separator + self.line_separator)) + self.stream.write(prepare_for_stream(fragment + self.line_separator + self.line_separator)) + + def get_stream(self): + return self.stream + + def set_stream(self, value): + error = False + try: + if not value.writable(): + error = True + except (ValueError, AttributeError): + error = True + + if error: + raise LDAPLDIFError('stream must be writable') + + self.stream = value diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/mockAsync.py b/python/user_packages/Python313/site-packages/ldap3/strategy/mockAsync.py new file mode 100644 index 0000000000000000000000000000000000000000..f9965dca7d48b45dd2d100f2930de849a152792a --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/mockAsync.py @@ -0,0 +1,200 @@ +""" +""" + +# Created on 2016.04.30 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES +from .mockBase import MockBaseStrategy +from .asynchronous import AsyncStrategy +from ..operation.search import search_result_done_response_to_dict, search_result_entry_response_to_dict +from ..core.results import DO_NOT_RAISE_EXCEPTIONS +from ..utils.log import log, log_enabled, ERROR, PROTOCOL +from ..core.exceptions import LDAPResponseTimeoutError, LDAPOperationResult +from ..operation.bind import bind_response_to_dict +from ..operation.delete import delete_response_to_dict +from ..operation.add import add_response_to_dict +from ..operation.compare import compare_response_to_dict +from ..operation.modifyDn import modify_dn_response_to_dict +from ..operation.modify import modify_response_to_dict +from ..operation.search import search_result_done_response_to_dict, search_result_entry_response_to_dict +from ..operation.extended import extended_response_to_dict + +# LDAPResult ::= SEQUENCE { +# resultCode ENUMERATED { +# success (0), +# operationsError (1), +# protocolError (2), +# timeLimitExceeded (3), +# sizeLimitExceeded (4), +# compareFalse (5), +# compareTrue (6), +# authMethodNotSupported (7), +# strongerAuthRequired (8), +# -- 9 reserved -- +# referral (10), +# adminLimitExceeded (11), +# unavailableCriticalExtension (12), +# confidentialityRequired (13), +# saslBindInProgress (14), +# noSuchAttribute (16), +# undefinedAttributeType (17), +# inappropriateMatching (18), +# constraintViolation (19), +# attributeOrValueExists (20), +# invalidAttributeSyntax (21), +# -- 22-31 unused -- +# noSuchObject (32), +# aliasProblem (33), +# invalidDNSyntax (34), +# -- 35 reserved for undefined isLeaf -- +# aliasDereferencingProblem (36), +# -- 37-47 unused -- +# inappropriateAuthentication (48), +# invalidCredentials (49), +# insufficientAccessRights (50), +# busy (51), +# unavailable (52), +# unwillingToPerform (53), +# loopDetect (54), +# -- 55-63 unused -- +# namingViolation (64), +# objectClassViolation (65), +# notAllowedOnNonLeaf (66), +# notAllowedOnRDN (67), +# entryAlreadyExists (68), +# objectClassModsProhibited (69), +# -- 70 reserved for CLDAP -- +# affectsMultipleDSAs (71), +# -- 72-79 unused -- +# other (80), +# ... }, +# matchedDN LDAPDN, +# diagnosticMessage LDAPString, +# referral [3] Referral OPTIONAL } + + +class MockAsyncStrategy(MockBaseStrategy, AsyncStrategy): # class inheritance sequence is important, MockBaseStrategy must be the first one + """ + This strategy create a mock LDAP server, with asynchronous access + It can be useful to test LDAP without accessing a real Server + """ + def __init__(self, ldap_connection): + AsyncStrategy.__init__(self, ldap_connection) + MockBaseStrategy.__init__(self) + #outstanding = dict() # a dictionary with the message id as key and a tuple (result, response) as value + + def post_send_search(self, payload): + message_id, message_type, request, controls = payload + async_response = [] + async_result = dict() + if message_type == 'searchRequest': + responses, result = self.mock_search(request, controls) + result['type'] = 'searchResDone' + for entry in responses: + response = search_result_entry_response_to_dict(entry, self.connection.server.schema, self.connection.server.custom_formatter, self.connection.check_names) + response['type'] = 'searchResEntry' + + if self.connection.empty_attributes: + for attribute_type in request['attributes']: + attribute_name = str(attribute_type) + if attribute_name not in response['raw_attributes'] and attribute_name not in (ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES): + response['raw_attributes'][attribute_name] = list() + response['attributes'][attribute_name] = list() + if log_enabled(PROTOCOL): + log(PROTOCOL, 'attribute set to empty list for missing attribute <%s> in <%s>', + attribute_type, self) + if not self.connection.auto_range: + attrs_to_remove = [] + # removes original empty attribute in case a range tag is returned + for attribute_type in response['attributes']: + attribute_name = str(attribute_type) + if ';range' in attribute_name.lower(): + orig_attr, _, _ = attribute_name.partition(';') + attrs_to_remove.append(orig_attr) + for attribute_type in attrs_to_remove: + if log_enabled(PROTOCOL): + log(PROTOCOL, + 'attribute type <%s> removed in response because of same attribute returned as range by the server in <%s>', + attribute_type, self) + del response['raw_attributes'][attribute_type] + del response['attributes'][attribute_type] + + async_response.append(response) + async_result = search_result_done_response_to_dict(result) + async_result['type'] = 'searchResDone' + self._responses[message_id] = (request, async_result, async_response) + return message_id + + def post_send_single_response(self, payload): # payload is a tuple sent by self.send() made of message_type, request, controls + message_id, message_type, request, controls = payload + responses = [] + result = None + if message_type == 'bindRequest': + result = bind_response_to_dict(self.mock_bind(request, controls)) + result['type'] = 'bindResponse' + elif message_type == 'unbindRequest': + self.bound = None + elif message_type == 'abandonRequest': + pass + elif message_type == 'delRequest': + result = delete_response_to_dict(self.mock_delete(request, controls)) + result['type'] = 'delResponse' + elif message_type == 'addRequest': + result = add_response_to_dict(self.mock_add(request, controls)) + result['type'] = 'addResponse' + elif message_type == 'compareRequest': + result = compare_response_to_dict(self.mock_compare(request, controls)) + result['type'] = 'compareResponse' + elif message_type == 'modDNRequest': + result = modify_dn_response_to_dict(self.mock_modify_dn(request, controls)) + result['type'] = 'modDNResponse' + elif message_type == 'modifyRequest': + result = modify_response_to_dict(self.mock_modify(request, controls)) + result['type'] = 'modifyResponse' + elif message_type == 'extendedReq': + result = extended_response_to_dict(self.mock_extended(request, controls)) + result['type'] = 'extendedResp' + responses.append(result) + if self.connection.raise_exceptions and result and result['result'] not in DO_NOT_RAISE_EXCEPTIONS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, self.connection) + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + self._responses[message_id] = (request, result, responses) + return message_id + + + def get_response(self, message_id, timeout=None, get_request=False): + if message_id in self._responses: + request, result, response = self._responses.pop(message_id) + else: + raise(LDAPResponseTimeoutError('message id not in outstanding queue')) + + if self.connection.raise_exceptions and result and result['result'] not in DO_NOT_RAISE_EXCEPTIONS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, self.connection) + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + + if get_request: + return response, result, request + else: + return response, result diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/mockBase.py b/python/user_packages/Python313/site-packages/ldap3/strategy/mockBase.py new file mode 100644 index 0000000000000000000000000000000000000000..527d9c474223ed38cdbbee5fcd7405dff853d24c --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/mockBase.py @@ -0,0 +1,921 @@ +""" +""" + +# Created on 2016.04.30 +# +# Author: Giovanni Cannata +# +# Copyright 2016 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import json +import re + +from random import SystemRandom + +from pyasn1.type.univ import OctetString + +from .. import SEQUENCE_TYPES, ALL_ATTRIBUTES +from ..operation.bind import bind_request_to_dict +from ..operation.delete import delete_request_to_dict +from ..operation.add import add_request_to_dict +from ..operation.compare import compare_request_to_dict +from ..operation.modifyDn import modify_dn_request_to_dict +from ..operation.modify import modify_request_to_dict +from ..operation.extended import extended_request_to_dict +from ..operation.search import search_request_to_dict, parse_filter, ROOT, AND, OR, NOT, MATCH_APPROX, \ + MATCH_GREATER_OR_EQUAL, MATCH_LESS_OR_EQUAL, MATCH_EXTENSIBLE, MATCH_PRESENT,\ + MATCH_SUBSTRING, MATCH_EQUAL +from ..utils.conv import json_hook, to_unicode, to_raw +from ..core.exceptions import LDAPDefinitionError, LDAPPasswordIsMandatoryError, LDAPInvalidValueError, LDAPSocketOpenError +from ..core.results import RESULT_SUCCESS, RESULT_OPERATIONS_ERROR, RESULT_UNAVAILABLE_CRITICAL_EXTENSION, \ + RESULT_INVALID_CREDENTIALS, RESULT_NO_SUCH_OBJECT, RESULT_ENTRY_ALREADY_EXISTS, RESULT_COMPARE_TRUE, \ + RESULT_COMPARE_FALSE, RESULT_NO_SUCH_ATTRIBUTE, RESULT_UNWILLING_TO_PERFORM, RESULT_PROTOCOL_ERROR, RESULT_CONSTRAINT_VIOLATION, RESULT_NOT_ALLOWED_ON_RDN +from ..utils.ciDict import CaseInsensitiveDict +from ..utils.dn import to_dn, safe_dn, safe_rdn +from ..protocol.sasl.sasl import validate_simple_password +from ..protocol.formatters.standard import find_attribute_validator, format_attribute_values +from ..protocol.rfc2696 import paged_search_control +from ..utils.log import log, log_enabled, ERROR, BASIC +from ..utils.asn1 import encode +from ..utils.conv import ldap_escape_to_bytes +from ..strategy.base import BaseStrategy # needed for decode_control() method +from ..protocol.rfc4511 import LDAPMessage, ProtocolOp, MessageID +from ..protocol.convert import build_controls_list + + +# LDAPResult ::= SEQUENCE { +# resultCode ENUMERATED { +# success (0), +# operationsError (1), +# protocolError (2), +# timeLimitExceeded (3), +# sizeLimitExceeded (4), +# compareFalse (5), +# compareTrue (6), +# authMethodNotSupported (7), +# strongerAuthRequired (8), +# -- 9 reserved -- +# referral (10), +# adminLimitExceeded (11), +# unavailableCriticalExtension (12), +# confidentialityRequired (13), +# saslBindInProgress (14), +# noSuchAttribute (16), +# undefinedAttributeType (17), +# inappropriateMatching (18), +# constraintViolation (19), +# attributeOrValueExists (20), +# invalidAttributeSyntax (21), +# -- 22-31 unused -- +# noSuchObject (32), +# aliasProblem (33), +# invalidDNSyntax (34), +# -- 35 reserved for undefined isLeaf -- +# aliasDereferencingProblem (36), +# -- 37-47 unused -- +# inappropriateAuthentication (48), +# invalidCredentials (49), +# insufficientAccessRights (50), +# busy (51), +# unavailable (52), +# unwillingToPerform (53), +# loopDetect (54), +# -- 55-63 unused -- +# namingViolation (64), +# objectClassViolation (65), +# notAllowedOnNonLeaf (66), +# notAllowedOnRDN (67), +# entryAlreadyExists (68), +# objectClassModsProhibited (69), +# -- 70 reserved for CLDAP -- +# affectsMultipleDSAs (71), +# -- 72-79 unused -- +# other (80), +# ... }, +# matchedDN LDAPDN, +# diagnosticMessage LDAPString, +# referral [3] Referral OPTIONAL } + +# noinspection PyProtectedMember,PyUnresolvedReferences + +SEARCH_CONTROLS = ['1.2.840.113556.1.4.319' # simple paged search [RFC 2696] + ] +SERVER_ENCODING = 'utf-8' + + +def random_cookie(): + return to_raw(SystemRandom().random())[-6:] + + +class PagedSearchSet(object): + def __init__(self, response, size, criticality): + self.size = size + self.response = response + self.cookie = None + self.sent = 0 + self.done = False + + def next(self, size=None): + if size: + self.size=size + + message = '' + response = self.response[self.sent: self.sent + self.size] + self.sent += self.size + if self.sent > len(self.response): + self.done = True + self.cookie = '' + else: + self.cookie = random_cookie() + + response_control = paged_search_control(False, len(self.response), self.cookie) + result = {'resultCode': RESULT_SUCCESS, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None, + 'controls': [BaseStrategy.decode_control(response_control)] + } + return response, result + + +class MockBaseStrategy(object): + """ + Base class for connection strategy + """ + + def __init__(self): + if not hasattr(self.connection.server, 'dit'): # create entries dict if not already present + self.connection.server.dit = CaseInsensitiveDict() + self.entries = self.connection.server.dit # for simpler reference + self.no_real_dsa = True + self.bound = None + self.custom_validators = None + self.operational_attributes = ['entryDN'] + self.add_entry('cn=schema', [], validate=False) # add default entry for schema + self._paged_sets = [] # list of paged search in progress + if log_enabled(BASIC): + log(BASIC, 'instantiated <%s>: <%s>', self.__class__.__name__, self) + + def _start_listen(self): + self.connection.listening = True + self.connection.closed = False + if self.connection.usage: + self.connection._usage.open_sockets += 1 + + def _stop_listen(self): + self.connection.listening = False + self.connection.closed = True + if self.connection.usage: + self.connection._usage.closed_sockets += 1 + + def _prepare_value(self, attribute_type, value, validate=True): + """ + Prepare a value for being stored in the mock DIT + :param value: object to store + :return: raw value to store in the DIT + """ + if validate: # if loading from json dump do not validate values: + validator = find_attribute_validator(self.connection.server.schema, attribute_type, self.custom_validators) + validated = validator(value) + if validated is False: + raise LDAPInvalidValueError('value non valid for attribute \'%s\'' % attribute_type) + elif validated is not True: # a valid LDAP value equivalent to the actual value + value = validated + raw_value = to_raw(value) + if not isinstance(raw_value, bytes): + raise LDAPInvalidValueError('The value "%s" of type %s for "%s" must be bytes or an offline schema needs to be provided when Mock strategy is used.' % ( + value, + type(value), + attribute_type, + )) + return raw_value + + def _update_attribute(self, dn, attribute_type, value): + pass + + def add_entry(self, dn, attributes, validate=True): + with self.connection.server.dit_lock: + escaped_dn = safe_dn(dn) + if escaped_dn not in self.connection.server.dit: + new_entry = CaseInsensitiveDict() + for attribute in attributes: + if attribute in self.operational_attributes: # no restore of operational attributes, should be computed at runtime + continue + if not isinstance(attributes[attribute], SEQUENCE_TYPES): # entry attributes are always lists of bytes values + attributes[attribute] = [attributes[attribute]] + if self.connection.server.schema and self.connection.server.schema.attribute_types[attribute].single_value and len(attributes[attribute]) > 1: # multiple values in single-valued attribute + return False + if attribute.lower() == 'objectclass' and self.connection.server.schema: # builds the objectClass hierarchy only if schema is present + class_set = set() + for object_class in attributes[attribute]: + if self.connection.server.schema.object_classes and object_class not in self.connection.server.schema.object_classes: + return False + # walkups the class hierarchy and buils a set of all classes in it + class_set.add(object_class) + class_set_size = 0 + while class_set_size != len(class_set): + new_classes = set() + class_set_size = len(class_set) + for class_name in class_set: + if self.connection.server.schema.object_classes[class_name].superior: + new_classes.update(self.connection.server.schema.object_classes[class_name].superior) + class_set.update(new_classes) + new_entry['objectClass'] = [to_raw(value) for value in class_set] + else: + new_entry[attribute] = [self._prepare_value(attribute, value, validate) for value in attributes[attribute]] + for rdn in safe_rdn(escaped_dn, decompose=True): # adds rdns to entry attributes + if rdn[0] not in new_entry: # if rdn attribute is missing adds attribute and its value + new_entry[rdn[0]] = [to_raw(rdn[1])] + else: + raw_rdn = to_raw(rdn[1]) + if raw_rdn not in new_entry[rdn[0]]: # add rdn value if rdn attribute is present but value is missing + new_entry[rdn[0]].append(raw_rdn) + new_entry['entryDN'] = [to_raw(escaped_dn)] + self.connection.server.dit[escaped_dn] = new_entry + return True + return False + + def remove_entry(self, dn): + with self.connection.server.dit_lock: + escaped_dn = safe_dn(dn) + if escaped_dn in self.connection.server.dit: + del self.connection.server.dit[escaped_dn] + return True + return False + + def entries_from_json(self, json_entry_file): + target = open(json_entry_file, 'r') + definition = json.load(target, object_hook=json_hook) + if 'entries' not in definition: + self.connection.last_error = 'invalid JSON definition, missing "entries" section' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPDefinitionError(self.connection.last_error) + if not self.connection.server.dit: + self.connection.server.dit = CaseInsensitiveDict() + for entry in definition['entries']: + if 'raw' not in entry: + self.connection.last_error = 'invalid JSON definition, missing "raw" section' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPDefinitionError(self.connection.last_error) + if 'dn' not in entry: + self.connection.last_error = 'invalid JSON definition, missing "dn" section' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPDefinitionError(self.connection.last_error) + self.add_entry(entry['dn'], entry['raw'], validate=False) + target.close() + + def mock_bind(self, request_message, controls): + # BindRequest ::= [APPLICATION 0] SEQUENCE { + # version INTEGER (1 .. 127), + # name LDAPDN, + # authentication AuthenticationChoice } + # + # BindResponse ::= [APPLICATION 1] SEQUENCE { + # COMPONENTS OF LDAPResult, + # serverSaslCreds [7] OCTET STRING OPTIONAL } + # + # request: version, name, authentication + # response: LDAPResult + serverSaslCreds + request = bind_request_to_dict(request_message) + identity = request['name'] + if 'simple' in request['authentication']: + try: + password = validate_simple_password(request['authentication']['simple']) + except LDAPPasswordIsMandatoryError: + password = '' + identity = '' + else: + self.connection.last_error = 'only Simple Bind allowed in Mock strategy' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPDefinitionError(self.connection.last_error) + # checks userPassword for password. userPassword must be a text string or a list of text strings + if identity in self.connection.server.dit: + if 'userPassword' in self.connection.server.dit[identity]: + # if self.connection.server.dit[identity]['userPassword'] == password or password in self.connection.server.dit[identity]['userPassword']: + if self.equal(identity, 'userPassword', password): + result_code = RESULT_SUCCESS + message = '' + self.bound = identity + else: + result_code = RESULT_INVALID_CREDENTIALS + message = 'invalid credentials' + else: # no user found, returns invalidCredentials + result_code = RESULT_INVALID_CREDENTIALS + message = 'missing userPassword attribute' + elif identity == '': + result_code = RESULT_SUCCESS + message = '' + self.bound = identity + else: + result_code = RESULT_INVALID_CREDENTIALS + message = 'missing object' + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None, + 'serverSaslCreds': None + } + + def mock_delete(self, request_message, controls): + # DelRequest ::= [APPLICATION 10] LDAPDN + # + # DelResponse ::= [APPLICATION 11] LDAPResult + # + # request: entry + # response: LDAPResult + request = delete_request_to_dict(request_message) + dn = safe_dn(request['entry']) + if dn in self.connection.server.dit: + del self.connection.server.dit[dn] + result_code = RESULT_SUCCESS + message = '' + else: + result_code = RESULT_NO_SUCH_OBJECT + message = 'object not found' + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + + def mock_add(self, request_message, controls): + # AddRequest ::= [APPLICATION 8] SEQUENCE { + # entry LDAPDN, + # attributes AttributeList } + # + # AddResponse ::= [APPLICATION 9] LDAPResult + # + # request: entry, attributes + # response: LDAPResult + request = add_request_to_dict(request_message) + dn = safe_dn(request['entry']) + attributes = request['attributes'] + # converts attributes values to bytes + + if dn not in self.connection.server.dit: + if self.add_entry(dn, attributes): + result_code = RESULT_SUCCESS + message = '' + else: + result_code = RESULT_OPERATIONS_ERROR + message = 'error adding entry' + else: + result_code = RESULT_ENTRY_ALREADY_EXISTS + message = 'entry already exist' + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + + def mock_compare(self, request_message, controls): + # CompareRequest ::= [APPLICATION 14] SEQUENCE { + # entry LDAPDN, + # ava AttributeValueAssertion } + # + # CompareResponse ::= [APPLICATION 15] LDAPResult + # + # request: entry, attribute, value + # response: LDAPResult + request = compare_request_to_dict(request_message) + dn = safe_dn(request['entry']) + attribute = request['attribute'] + value = to_raw(request['value']) + if dn in self.connection.server.dit: + if attribute in self.connection.server.dit[dn]: + if self.equal(dn, attribute, value): + result_code = RESULT_COMPARE_TRUE + message = '' + else: + result_code = RESULT_COMPARE_FALSE + message = '' + else: + result_code = RESULT_NO_SUCH_ATTRIBUTE + message = 'attribute not found' + else: + result_code = RESULT_NO_SUCH_OBJECT + message = 'object not found' + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + + def mock_modify_dn(self, request_message, controls): + # ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { + # entry LDAPDN, + # newrdn RelativeLDAPDN, + # deleteoldrdn BOOLEAN, + # newSuperior [0] LDAPDN OPTIONAL } + # + # ModifyDNResponse ::= [APPLICATION 13] LDAPResult + # + # request: entry, newRdn, deleteOldRdn, newSuperior + # response: LDAPResult + request = modify_dn_request_to_dict(request_message) + dn = safe_dn(request['entry']) + new_rdn = request['newRdn'] + delete_old_rdn = request['deleteOldRdn'] + new_superior = safe_dn(request['newSuperior']) if request['newSuperior'] else '' + dn_components = to_dn(dn) + if dn in self.connection.server.dit: + if new_superior and new_rdn: # performs move in the DIT + new_dn = safe_dn(dn_components[0] + ',' + new_superior) + self.connection.server.dit[new_dn] = self.connection.server.dit[dn].copy() + moved_entry = self.connection.server.dit[new_dn] + if delete_old_rdn: + del self.connection.server.dit[dn] + result_code = RESULT_SUCCESS + message = 'entry moved' + moved_entry['entryDN'] = [to_raw(new_dn)] + elif new_rdn and not new_superior: # performs rename + new_dn = safe_dn(new_rdn + ',' + safe_dn(dn_components[1:])) + self.connection.server.dit[new_dn] = self.connection.server.dit[dn].copy() + renamed_entry = self.connection.server.dit[new_dn] + del self.connection.server.dit[dn] + renamed_entry['entryDN'] = [to_raw(new_dn)] + + for rdn in safe_rdn(new_dn, decompose=True): # adds rdns to entry attributes + renamed_entry[rdn[0]] = [to_raw(rdn[1])] + + result_code = RESULT_SUCCESS + message = 'entry rdn renamed' + else: + result_code = RESULT_UNWILLING_TO_PERFORM + message = 'newRdn or newSuperior missing' + else: + result_code = RESULT_NO_SUCH_OBJECT + message = 'object not found' + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + + def mock_modify(self, request_message, controls): + # ModifyRequest ::= [APPLICATION 6] SEQUENCE { + # object LDAPDN, + # changes SEQUENCE OF change SEQUENCE { + # operation ENUMERATED { + # add (0), + # delete (1), + # replace (2), + # ... }, + # modification PartialAttribute } } + # + # ModifyResponse ::= [APPLICATION 7] LDAPResult + # + # request: entry, changes + # response: LDAPResult + # + # changes is a dictionary in the form {'attribute': [(operation, [val1, ...]), ...], ...} + # operation is 0 (add), 1 (delete), 2 (replace), 3 (increment) + request = modify_request_to_dict(request_message) + dn = safe_dn(request['entry']) + changes = request['changes'] + result_code = 0 + message = '' + rdns = [rdn[0] for rdn in safe_rdn(dn, decompose=True)] + if dn in self.connection.server.dit: + entry = self.connection.server.dit[dn] + original_entry = entry.copy() # to preserve atomicity of operation + for modification in changes: + operation = modification['operation'] + attribute = modification['attribute']['type'] + elements = modification['attribute']['value'] + if operation == 0: # add + if attribute not in entry and elements: # attribute not present, creates the new attribute and add elements + if self.connection.server.schema and self.connection.server.schema.attribute_types and self.connection.server.schema.attribute_types[attribute].single_value and len(elements) > 1: # multiple values in single-valued attribute + result_code = RESULT_CONSTRAINT_VIOLATION + message = 'attribute is single-valued' + else: + entry[attribute] = [to_raw(element) for element in elements] + else: # attribute present, adds elements to current values + if self.connection.server.schema and self.connection.server.schema.attribute_types and self.connection.server.schema.attribute_types[attribute].single_value: # multiple values in single-valued attribute + result_code = RESULT_CONSTRAINT_VIOLATION + message = 'attribute is single-valued' + else: + entry[attribute].extend([to_raw(element) for element in elements]) + elif operation == 1: # delete + if attribute not in entry: # attribute must exist + result_code = RESULT_NO_SUCH_ATTRIBUTE + message = 'attribute must exists for deleting its values' + elif attribute in rdns: # attribute can't be used in dn + result_code = RESULT_NOT_ALLOWED_ON_RDN + message = 'cannot delete an rdn' + else: + if not elements: # deletes whole attribute if element list is empty + del entry[attribute] + else: + for element in elements: + raw_element = to_raw(element) + if self.equal(dn, attribute, raw_element): # removes single element + entry[attribute].remove(raw_element) + else: + result_code = 1 + message = 'value to delete not found' + if not entry[attribute]: # removes the whole attribute if no elements remained + del entry[attribute] + elif operation == 2: # replace + if attribute not in entry and elements: # attribute not present, creates the new attribute and add elements + if self.connection.server.schema and self.connection.server.schema.attribute_types and self.connection.server.schema.attribute_types[attribute].single_value and len(elements) > 1: # multiple values in single-valued attribute + result_code = RESULT_CONSTRAINT_VIOLATION + message = 'attribute is single-valued' + else: + entry[attribute] = [to_raw(element) for element in elements] + elif not elements and attribute in rdns: # attribute can't be used in dn + result_code = RESULT_NOT_ALLOWED_ON_RDN + message = 'cannot replace an rdn' + elif not elements: # deletes whole attribute if element list is empty + if attribute in entry: + del entry[attribute] + else: # substitutes elements + entry[attribute] = [to_raw(element) for element in elements] + elif operation == 3: # increment + if attribute not in entry: # attribute must exist + result_code = RESULT_NO_SUCH_ATTRIBUTE + message = 'attribute must exists for incrementing its values' + else: + if len(elements) != 1: + result_code = RESULT_PROTOCOL_ERROR + message = 'only one increment value is allowed' + else: + try: + entry[attribute] = [bytes(str(int(value) + int(elements[0])), encoding='utf-8') for value in entry[attribute]] + except: + result_code = RESULT_UNWILLING_TO_PERFORM + message = 'unable to increment value' + + if result_code: # an error has happened, restores the original dn + self.connection.server.dit[dn] = original_entry + else: + result_code = RESULT_NO_SUCH_OBJECT + message = 'object not found' + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + + def mock_search(self, request_message, controls): + # SearchRequest ::= [APPLICATION 3] SEQUENCE { + # baseObject LDAPDN, + # scope ENUMERATED { + # baseObject (0), + # singleLevel (1), + # wholeSubtree (2), + # ... }, + # derefAliases ENUMERATED { + # neverDerefAliases (0), + # derefInSearching (1), + # derefFindingBaseObj (2), + # derefAlways (3) }, + # sizeLimit INTEGER (0 .. maxInt), + # timeLimit INTEGER (0 .. maxInt), + # typesOnly BOOLEAN, + # filter Filter, + # attributes AttributeSelection } + # + # SearchResultEntry ::= [APPLICATION 4] SEQUENCE { + # objectName LDAPDN, + # attributes PartialAttributeList } + # + # + # SearchResultReference ::= [APPLICATION 19] SEQUENCE + # SIZE (1..MAX) OF uri URI + # + # SearchResultDone ::= [APPLICATION 5] LDAPResult + # + # request: base, scope, dereferenceAlias, sizeLimit, timeLimit, typesOnly, filter, attributes + # response_entry: object, attributes + # response_done: LDAPResult + request = search_request_to_dict(request_message) + if controls: + decoded_controls = [self.decode_control(control) for control in controls if control] + for decoded_control in decoded_controls: + if decoded_control[1]['criticality'] and decoded_control[0] not in SEARCH_CONTROLS: + message = 'Critical requested control ' + str(decoded_control[0]) + ' not available' + result = {'resultCode': RESULT_UNAVAILABLE_CRITICAL_EXTENSION, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + return [], result + elif decoded_control[0] == '1.2.840.113556.1.4.319': # Simple paged search + if not decoded_control[1]['value']['cookie']: # new paged search + response, result = self._execute_search(request) + if result['resultCode'] == RESULT_SUCCESS: # success + paged_set = PagedSearchSet(response, int(decoded_control[1]['value']['size']), decoded_control[1]['criticality']) + response, result = paged_set.next() + if paged_set.done: # paged search already completed, no need to store the set + del paged_set + else: + self._paged_sets.append(paged_set) + return response, result + else: + return [], result + else: + for paged_set in self._paged_sets: + if paged_set.cookie == decoded_control[1]['value']['cookie']: # existing paged set + response, result = paged_set.next() # returns next bunch of entries as per paged set specifications + if paged_set.done: + self._paged_sets.remove(paged_set) + return response, result + # paged set not found + message = 'Invalid cookie in simple paged search' + result = {'resultCode': RESULT_OPERATIONS_ERROR, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + return [], result + + else: + return self._execute_search(request) + + def _execute_search(self, request): + responses = [] + base = safe_dn(request['base']) + scope = request['scope'] + attributes = request['attributes'] + if '+' in attributes: # operational attributes requested + attributes.extend(self.operational_attributes) + attributes.remove('+') + + attributes = [attr.lower() for attr in request['attributes']] + + filter_root = parse_filter(request['filter'], self.connection.server.schema, auto_escape=True, auto_encode=False, validator=self.connection.server.custom_validator, check_names=self.connection.check_names) + candidates = [] + if scope == 0: # base object + if base in self.connection.server.dit or base.lower() == 'cn=schema': + candidates.append(base) + elif scope == 1: # single level + for entry in self.connection.server.dit: + if entry.lower().endswith(base.lower()) and ',' not in entry[:-len(base) - 1]: # only leafs without commas in the remaining dn + candidates.append(entry) + elif scope == 2: # whole subtree + for entry in self.connection.server.dit: + if entry.lower().endswith(base.lower()): + candidates.append(entry) + + if not candidates: # incorrect base + result_code = RESULT_NO_SUCH_OBJECT + message = 'incorrect base object' + else: + matched = self.evaluate_filter_node(filter_root, candidates) + if self.connection.raise_exceptions and 0 < request['sizeLimit'] < len(matched): + result_code = 4 + message = 'size limit exceeded' + else: + for match in matched: + responses.append({ + 'object': match, + 'attributes': [{'type': attribute, + 'vals': [] if request['typesOnly'] else self.connection.server.dit[match][attribute]} + for attribute in self.connection.server.dit[match] + if attribute.lower() in attributes or ALL_ATTRIBUTES in attributes] + }) + if '+' not in attributes: # remove operational attributes + for op_attr in self.operational_attributes: + if op_attr.lower() in attributes: + # if the op_attr was explicitly requested, then keep it + continue + for i, attr in enumerate(responses[len(responses)-1]['attributes']): + if attr['type'] == op_attr: + del responses[len(responses)-1]['attributes'][i] + result_code = 0 + message = '' + + result = {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None + } + + return responses[:request['sizeLimit']] if request['sizeLimit'] > 0 else responses, result + + def mock_extended(self, request_message, controls): + # ExtendedRequest ::= [APPLICATION 23] SEQUENCE { + # requestName [0] LDAPOID, + # requestValue [1] OCTET STRING OPTIONAL } + # + # ExtendedResponse ::= [APPLICATION 24] SEQUENCE { + # COMPONENTS OF LDAPResult, + # responseName [10] LDAPOID OPTIONAL, + # responseValue [11] OCTET STRING OPTIONAL } + # + # IntermediateResponse ::= [APPLICATION 25] SEQUENCE { + # responseName [0] LDAPOID OPTIONAL, + # responseValue [1] OCTET STRING OPTIONAL } + request = extended_request_to_dict(request_message) + + result_code = RESULT_UNWILLING_TO_PERFORM + message = 'not implemented' + response_name = None + response_value = None + if self.connection.server.info: + for extension in self.connection.server.info.supported_extensions: + if request['name'] == extension[0]: # server can answer the extended request + if extension[0] == '2.16.840.1.113719.1.27.100.31': # getBindDNRequest [NOVELL] + result_code = 0 + message = '' + response_name = OctetString('2.16.840.1.113719.1.27.100.32') # getBindDNResponse [NOVELL] + response_value = OctetString(self.bound) + elif extension[0] == '1.3.6.1.4.1.4203.1.11.3': # WhoAmI [RFC4532] + result_code = 0 + message = '' + response_name = OctetString('1.3.6.1.4.1.4203.1.11.3') # WhoAmI [RFC4532] + response_value = OctetString(self.bound) + break + + return {'resultCode': result_code, + 'matchedDN': '', + 'diagnosticMessage': to_unicode(message, SERVER_ENCODING), + 'referral': None, + 'responseName': response_name, + 'responseValue': response_value + } + + def evaluate_filter_node(self, node, candidates): + """After evaluation each 2 sets are added to each MATCH node, one for the matched object and one for unmatched object. + The unmatched object set is needed if a superior node is a NOT that reverts the evaluation. The BOOLEAN nodes mix the sets + returned by the MATCH nodes""" + node.matched = set() + node.unmatched = set() + + if node.elements: + for element in node.elements: + self.evaluate_filter_node(element, candidates) + + if node.tag == ROOT: + return node.elements[0].matched + elif node.tag == AND: + first_element = node.elements[0] + node.matched.update(first_element.matched) + node.unmatched.update(first_element.unmatched) + + for element in node.elements[1:]: + node.matched.intersection_update(element.matched) + node.unmatched.intersection_update(element.unmatched) + elif node.tag == OR: + for element in node.elements: + node.matched.update(element.matched) + node.unmatched.update(element.unmatched) + elif node.tag == NOT: + node.matched = node.elements[0].unmatched + node.unmatched = node.elements[0].matched + elif node.tag == MATCH_GREATER_OR_EQUAL: + attr_name = node.assertion['attr'] + attr_value = node.assertion['value'] + for candidate in candidates: + if attr_name in self.connection.server.dit[candidate]: + for value in self.connection.server.dit[candidate][attr_name]: + if value.isdigit() and attr_value.isdigit(): # int comparison + if int(value) >= int(attr_value): + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + else: + if to_unicode(value, SERVER_ENCODING).lower() >= to_unicode(attr_value, SERVER_ENCODING).lower(): # case insensitive string comparison + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + elif node.tag == MATCH_LESS_OR_EQUAL: + attr_name = node.assertion['attr'] + attr_value = node.assertion['value'] + for candidate in candidates: + if attr_name in self.connection.server.dit[candidate]: + for value in self.connection.server.dit[candidate][attr_name]: + if value.isdigit() and attr_value.isdigit(): # int comparison + if int(value) <= int(attr_value): + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + else: + if to_unicode(value, SERVER_ENCODING).lower() <= to_unicode(attr_value, SERVER_ENCODING).lower(): # case insentive string comparison + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + elif node.tag == MATCH_EXTENSIBLE: + self.connection.last_error = 'Extensible match not allowed in Mock strategy' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPDefinitionError(self.connection.last_error) + elif node.tag == MATCH_PRESENT: + attr_name = node.assertion['attr'] + for candidate in candidates: + if attr_name in self.connection.server.dit[candidate]: + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + elif node.tag == MATCH_SUBSTRING: + attr_name = node.assertion['attr'] + # rebuild the original substring filter + if 'initial' in node.assertion and node.assertion['initial'] is not None: + substring_filter = re.escape(to_unicode(node.assertion['initial'], SERVER_ENCODING)) + else: + substring_filter = '' + + if 'any' in node.assertion and node.assertion['any'] is not None: + for middle in node.assertion['any']: + substring_filter += '.*' + re.escape(to_unicode(middle, SERVER_ENCODING)) + + if 'final' in node.assertion and node.assertion['final'] is not None: + substring_filter += '.*' + re.escape(to_unicode(node.assertion['final'], SERVER_ENCODING)) + + if substring_filter and not node.assertion.get('any', None) and not node.assertion.get('final', None): # only initial, adds .* + substring_filter += '.*' + + regex_filter = re.compile(substring_filter, flags=re.UNICODE | re.IGNORECASE) # unicode AND ignorecase + for candidate in candidates: + if attr_name in self.connection.server.dit[candidate]: + for value in self.connection.server.dit[candidate][attr_name]: + if regex_filter.match(to_unicode(value, SERVER_ENCODING)): + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + else: + node.unmatched.add(candidate) + elif node.tag == MATCH_EQUAL or node.tag == MATCH_APPROX: + attr_name = node.assertion['attr'] + attr_value = node.assertion['value'] + for candidate in candidates: + if attr_name in self.connection.server.dit[candidate] and self.equal(candidate, attr_name, attr_value): + node.matched.add(candidate) + else: + node.unmatched.add(candidate) + + def equal(self, dn, attribute_type, value_to_check): + # value is the value to match + attribute_values = self.connection.server.dit[dn][attribute_type] + if not isinstance(attribute_values, SEQUENCE_TYPES): + attribute_values = [attribute_values] + escaped_value_to_check = ldap_escape_to_bytes(value_to_check) + for attribute_value in attribute_values: + if self._check_equality(escaped_value_to_check, attribute_value): + return True + if self._check_equality(self._prepare_value(attribute_type, value_to_check), attribute_value): + return True + return False + + @staticmethod + def _check_equality(value1, value2): + if value1 == value2: # exact matching + return True + if str(value1).isdigit() and str(value2).isdigit(): + if int(value1) == int(value2): # int comparison + return True + try: + if to_unicode(value1, SERVER_ENCODING).lower() == to_unicode(value2, SERVER_ENCODING).lower(): # case insensitive comparison + return True + except UnicodeError: + pass + + return False + + def send(self, message_type, request, controls=None): + self.connection.request = self.decode_request(message_type, request, controls) + if self.connection.listening: + message_id = self.connection.server.next_message_id() + if self.connection.usage: # ldap message is built for updating metrics only + ldap_message = LDAPMessage() + ldap_message['messageID'] = MessageID(message_id) + ldap_message['protocolOp'] = ProtocolOp().setComponentByName(message_type, request) + message_controls = build_controls_list(controls) + if message_controls is not None: + ldap_message['controls'] = message_controls + asn1_request = BaseStrategy.decode_request(message_type, request, controls) + self.connection._usage.update_transmitted_message(asn1_request, len(encode(ldap_message))) + return message_id, message_type, request, controls + else: + self.connection.last_error = 'unable to send message, connection is not open' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSocketOpenError(self.connection.last_error) + diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/mockSync.py b/python/user_packages/Python313/site-packages/ldap3/strategy/mockSync.py new file mode 100644 index 0000000000000000000000000000000000000000..efd2c15d9844505a88fe04959e1c9120d2e1c155 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/mockSync.py @@ -0,0 +1,133 @@ +""" +""" + +# Created on 2014.11.17 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from ..core.results import DO_NOT_RAISE_EXCEPTIONS +from .mockBase import MockBaseStrategy +from .. import ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES +from .sync import SyncStrategy +from ..operation.bind import bind_response_to_dict +from ..operation.delete import delete_response_to_dict +from ..operation.add import add_response_to_dict +from ..operation.compare import compare_response_to_dict +from ..operation.modifyDn import modify_dn_response_to_dict +from ..operation.modify import modify_response_to_dict +from ..operation.search import search_result_done_response_to_dict, search_result_entry_response_to_dict +from ..operation.extended import extended_response_to_dict +from ..core.exceptions import LDAPSocketOpenError, LDAPOperationResult +from ..utils.log import log, log_enabled, ERROR, PROTOCOL + + +class MockSyncStrategy(MockBaseStrategy, SyncStrategy): # class inheritance sequence is important, MockBaseStrategy must be the first one + """ + This strategy create a mock LDAP server, with synchronous access + It can be useful to test LDAP without accessing a real Server + """ + def __init__(self, ldap_connection): + SyncStrategy.__init__(self, ldap_connection) + MockBaseStrategy.__init__(self) + + def post_send_search(self, payload): + message_id, message_type, request, controls = payload + self.connection.response = [] + self.connection.result = dict() + if message_type == 'searchRequest': + responses, result = self.mock_search(request, controls) + for entry in responses: + response = search_result_entry_response_to_dict(entry, self.connection.server.schema, self.connection.server.custom_formatter, self.connection.check_names) + response['type'] = 'searchResEntry' + ### + if self.connection.empty_attributes: + for attribute_type in request['attributes']: + attribute_name = str(attribute_type) + if attribute_name not in response['raw_attributes'] and attribute_name not in (ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES): + response['raw_attributes'][attribute_name] = list() + response['attributes'][attribute_name] = list() + if log_enabled(PROTOCOL): + log(PROTOCOL, 'attribute set to empty list for missing attribute <%s> in <%s>', + attribute_type, self) + if not self.connection.auto_range: + attrs_to_remove = [] + # removes original empty attribute in case a range tag is returned + for attribute_type in response['attributes']: + attribute_name = str(attribute_type) + if ';range' in attribute_name.lower(): + orig_attr, _, _ = attribute_name.partition(';') + attrs_to_remove.append(orig_attr) + for attribute_type in attrs_to_remove: + if log_enabled(PROTOCOL): + log(PROTOCOL, + 'attribute type <%s> removed in response because of same attribute returned as range by the server in <%s>', + attribute_type, self) + del response['raw_attributes'][attribute_type] + del response['attributes'][attribute_type] + ### + self.connection.response.append(response) + result = search_result_done_response_to_dict(result) + result['type'] = 'searchResDone' + self.connection.result = result + if self.connection.raise_exceptions and result and result['result'] not in DO_NOT_RAISE_EXCEPTIONS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, self.connection) + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + + return self.connection.response + + def post_send_single_response(self, payload): # payload is a tuple sent by self.send() made of message_type, request, controls + message_id, message_type, request, controls = payload + responses = [] + result = None + if message_type == 'bindRequest': + result = bind_response_to_dict(self.mock_bind(request, controls)) + result['type'] = 'bindResponse' + elif message_type == 'unbindRequest': + self.bound = None + elif message_type == 'abandonRequest': + pass + elif message_type == 'delRequest': + result = delete_response_to_dict(self.mock_delete(request, controls)) + result['type'] = 'delResponse' + elif message_type == 'addRequest': + result = add_response_to_dict(self.mock_add(request, controls)) + result['type'] = 'addResponse' + elif message_type == 'compareRequest': + result = compare_response_to_dict(self.mock_compare(request, controls)) + result['type'] = 'compareResponse' + elif message_type == 'modDNRequest': + result = modify_dn_response_to_dict(self.mock_modify_dn(request, controls)) + result['type'] = 'modDNResponse' + elif message_type == 'modifyRequest': + result = modify_response_to_dict(self.mock_modify(request, controls)) + result['type'] = 'modifyResponse' + elif message_type == 'extendedReq': + result = extended_response_to_dict(self.mock_extended(request, controls)) + result['type'] = 'extendedResp' + self.connection.result = result + responses.append(result) + if self.connection.raise_exceptions and result and result['result'] not in DO_NOT_RAISE_EXCEPTIONS: + if log_enabled(PROTOCOL): + log(PROTOCOL, 'operation result <%s> for <%s>', result, self.connection) + raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) + return responses + diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/restartable.py b/python/user_packages/Python313/site-packages/ldap3/strategy/restartable.py new file mode 100644 index 0000000000000000000000000000000000000000..55f170600063a01b132067de6613b9c286620fed --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/restartable.py @@ -0,0 +1,260 @@ +""" +""" + +# Created on 2014.03.04 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from time import sleep +import socket + +from .. import get_config_parameter +from .sync import SyncStrategy +from ..core.exceptions import LDAPSocketOpenError, LDAPOperationResult, LDAPMaximumRetriesError, LDAPStartTLSError +from ..utils.log import log, log_enabled, ERROR, BASIC + + +# noinspection PyBroadException,PyProtectedMember +class RestartableStrategy(SyncStrategy): + def __init__(self, ldap_connection): + SyncStrategy.__init__(self, ldap_connection) + self.sync = True + self.no_real_dsa = False + self.pooled = False + self.can_stream = False + self.restartable_sleep_time = get_config_parameter('RESTARTABLE_SLEEPTIME') + self.restartable_tries = get_config_parameter('RESTARTABLE_TRIES') + self._restarting = False + self._last_bind_controls = None + self._current_message_type = None + self._current_request = None + self._current_controls = None + self._restart_tls = None + self.exception_history = [] + + def open(self, reset_usage=False, read_server_info=True): + SyncStrategy.open(self, reset_usage, read_server_info) + + def _open_socket(self, address, use_ssl=False, unix_socket=False): + """ + Try to open and connect a socket to a Server + raise LDAPExceptionError if unable to open or connect socket + if connection is restartable tries for the number of restarting requested or forever + """ + try: + SyncStrategy._open_socket(self, address, use_ssl, unix_socket) # try to open socket using SyncWait + self._reset_exception_history() + return + except Exception as e: # machinery for restartable connection + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + + if not self._restarting: # if not already performing a restart + self._restarting = True + counter = self.restartable_tries + while counter > 0: # includes restartable_tries == True + if log_enabled(BASIC): + log(BASIC, 'try #%d to open Restartable connection <%s>', self.restartable_tries - counter, self.connection) + sleep(self.restartable_sleep_time) + if not self.connection.closed: + try: # resetting connection + self.connection.unbind() + except (socket.error, LDAPSocketOpenError): # don't trace catch socket errors because socket could already be closed + pass + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + try: # reissuing same operation + if self.connection.server_pool: + new_server = self.connection.server_pool.get_server(self.connection) # get a server from the server_pool if available + if self.connection.server != new_server: + self.connection.server = new_server + if self.connection.usage: + self.connection._usage.servers_from_pool += 1 + SyncStrategy._open_socket(self, address, use_ssl, unix_socket) # calls super (not restartable) _open_socket() + if self.connection.usage: + self.connection._usage.restartable_successes += 1 + self.connection.closed = False + self._restarting = False + self._reset_exception_history() + return + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + if self.connection.usage: + self.connection._usage.restartable_failures += 1 + if not isinstance(self.restartable_tries, bool): + counter -= 1 + self._restarting = False + self.connection.last_error = 'restartable connection strategy failed while opening socket' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPMaximumRetriesError(self.connection.last_error, self.exception_history, self.restartable_tries) + + def send(self, message_type, request, controls=None): + self._current_message_type = message_type + self._current_request = request + self._current_controls = controls + if not self._restart_tls: # RFCs doesn't define how to stop tls once started + self._restart_tls = self.connection.tls_started + if message_type == 'bindRequest': # stores controls used in bind operation to be used again when restarting the connection + self._last_bind_controls = controls + + try: + message_id = SyncStrategy.send(self, message_type, request, controls) # tries to send using SyncWait + self._reset_exception_history() + return message_id + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + if not self._restarting: # machinery for restartable connection + self._restarting = True + counter = self.restartable_tries + while counter > 0: + if log_enabled(BASIC): + log(BASIC, 'try #%d to send in Restartable connection <%s>', self.restartable_tries - counter, self.connection) + sleep(self.restartable_sleep_time) + if not self.connection.closed: + try: # resetting connection + self.connection.unbind() + except (socket.error, LDAPSocketOpenError): # don't trace socket errors because socket could already be closed + pass + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + failure = False + try: # reopening connection + self.connection.open(reset_usage=False, read_server_info=False) + if self._restart_tls: # restart tls if start_tls was previously used + if not self.connection.start_tls(read_server_info=False): + error = 'restart tls in restartable not successful' + (' - ' + self.connection.last_error if self.connection.last_error else '') + if log_enabled(ERROR): + log(ERROR, '%s for <%s>', error, self) + self.connection.unbind() + raise LDAPStartTLSError(error) + if message_type != 'bindRequest': + self.connection.bind(read_server_info=False, controls=self._last_bind_controls) # binds with previously used controls unless the request is already a bindRequest + if not self.connection.server.schema and not self.connection.server.info: + self.connection.refresh_server_info() + else: + self.connection._fire_deferred(read_info=False) # in case of lazy connection, not open by the refresh_server_info + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + failure = True + + if not failure: + try: # reissuing same operation + ret_value = self.connection.send(message_type, request, controls) + if self.connection.usage: + self.connection._usage.restartable_successes += 1 + self._restarting = False + self._reset_exception_history() + return ret_value # successful send + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + failure = True + + if failure and self.connection.usage: + self.connection._usage.restartable_failures += 1 + + if not isinstance(self.restartable_tries, bool): + counter -= 1 + + self._restarting = False + + self.connection.last_error = 'restartable connection failed to send' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPMaximumRetriesError(self.connection.last_error, self.exception_history, self.restartable_tries) + + def post_send_single_response(self, message_id): + try: + ret_value = SyncStrategy.post_send_single_response(self, message_id) + self._reset_exception_history() + return ret_value + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + + # if an LDAPExceptionError is raised then resend the request + try: + ret_value = SyncStrategy.post_send_single_response(self, self.send(self._current_message_type, self._current_request, self._current_controls)) + self._reset_exception_history() + return ret_value + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + if not isinstance(e, LDAPOperationResult): + self.connection.last_error = 'restartable connection strategy failed in post_send_single_response' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise + + def post_send_search(self, message_id): + try: + ret_value = SyncStrategy.post_send_search(self, message_id) + self._reset_exception_history() + return ret_value + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + + # if an LDAPExceptionError is raised then resend the request + try: + ret_value = SyncStrategy.post_send_search(self, self.connection.send(self._current_message_type, self._current_request, self._current_controls)) + self._reset_exception_history() + return ret_value + except Exception as e: + if log_enabled(ERROR): + log(ERROR, '<%s> while restarting <%s>', e, self.connection) + self._add_exception_to_history(type(e)(str(e))) + if not isinstance(e, LDAPOperationResult): + self.connection.last_error = e.args + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise e + + def _add_exception_to_history(self, exc): + if not isinstance(self.restartable_tries, bool): # doesn't accumulate when restarting forever + if not isinstance(exc, LDAPMaximumRetriesError): # doesn't add the LDAPMaximumRetriesError exception + self.exception_history.append(exc) + + def _reset_exception_history(self): + if self.exception_history: + self.exception_history = [] + + def get_stream(self): + raise NotImplementedError + + def set_stream(self, value): + raise NotImplementedError diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/reusable.py b/python/user_packages/Python313/site-packages/ldap3/strategy/reusable.py new file mode 100644 index 0000000000000000000000000000000000000000..01bd9d32fc6c8044008e1797d8e3406307cdd478 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/reusable.py @@ -0,0 +1,495 @@ +""" +""" + +# Created on 2014.03.23 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from datetime import datetime +from os import linesep +from threading import Thread, Lock +from time import sleep + +from .. import RESTARTABLE, get_config_parameter, AUTO_BIND_DEFAULT, AUTO_BIND_NONE, AUTO_BIND_NO_TLS, AUTO_BIND_TLS_AFTER_BIND, AUTO_BIND_TLS_BEFORE_BIND +from .base import BaseStrategy +from ..core.usage import ConnectionUsage +from ..core.exceptions import LDAPConnectionPoolNameIsMandatoryError, LDAPConnectionPoolNotStartedError, LDAPOperationResult, LDAPExceptionError, LDAPResponseTimeoutError +from ..utils.log import log, log_enabled, ERROR, BASIC +from ..protocol.rfc4511 import LDAP_MAX_INT + +TERMINATE_REUSABLE = 'TERMINATE_REUSABLE_CONNECTION' + +BOGUS_BIND = -1 +BOGUS_UNBIND = -2 +BOGUS_EXTENDED = -3 +BOGUS_ABANDON = -4 + +try: + from queue import Queue, Empty +except ImportError: # Python 2 + # noinspection PyUnresolvedReferences + from Queue import Queue, Empty + + +# noinspection PyProtectedMember +class ReusableStrategy(BaseStrategy): + """ + A pool of reusable SyncWaitRestartable connections with lazy behaviour and limited lifetime. + The connection using this strategy presents itself as a normal connection, but internally the strategy has a pool of + connections that can be used as needed. Each connection lives in its own thread and has a busy/available status. + The strategy performs the requested operation on the first available connection. + The pool of connections is instantiated at strategy initialization. + Strategy has two customizable properties, the total number of connections in the pool and the lifetime of each connection. + When lifetime is expired the connection is closed and will be open again when needed. + """ + pools = dict() + + def receiving(self): + raise NotImplementedError + + def _start_listen(self): + raise NotImplementedError + + def _get_response(self, message_id, timeout): + raise NotImplementedError + + def get_stream(self): + raise NotImplementedError + + def set_stream(self, value): + raise NotImplementedError + + # noinspection PyProtectedMember + class ConnectionPool(object): + """ + Container for the Connection Threads + """ + def __new__(cls, connection): + if connection.pool_name in ReusableStrategy.pools: # returns existing connection pool + pool = ReusableStrategy.pools[connection.pool_name] + if not pool.started: # if pool is not started remove it from the pools singleton and create a new onw + del ReusableStrategy.pools[connection.pool_name] + return object.__new__(cls) + if connection.pool_keepalive and pool.keepalive != connection.pool_keepalive: # change lifetime + pool.keepalive = connection.pool_keepalive + if connection.pool_lifetime and pool.lifetime != connection.pool_lifetime: # change keepalive + pool.lifetime = connection.pool_lifetime + if connection.pool_size and pool.pool_size != connection.pool_size: # if pool size has changed terminate and recreate the connections + pool.terminate_pool() + pool.pool_size = connection.pool_size + return pool + else: + return object.__new__(cls) + + def __init__(self, connection): + if not hasattr(self, 'workers'): + self.name = connection.pool_name + self.master_connection = connection + self.workers = [] + self.pool_size = connection.pool_size or get_config_parameter('REUSABLE_THREADED_POOL_SIZE') + self.lifetime = connection.pool_lifetime or get_config_parameter('REUSABLE_THREADED_LIFETIME') + self.keepalive = connection.pool_keepalive + self.request_queue = Queue() + self.open_pool = False + self.bind_pool = False + self.tls_pool = False + self._incoming = dict() + self.counter = 0 + self.terminated_usage = ConnectionUsage() if connection._usage else None + self.terminated = False + self.pool_lock = Lock() + ReusableStrategy.pools[self.name] = self + self.started = False + if log_enabled(BASIC): + log(BASIC, 'instantiated ConnectionPool: <%r>', self) + + def __str__(self): + s = 'POOL: ' + str(self.name) + ' - status: ' + ('started' if self.started else 'terminated') + s += ' - responses in queue: ' + str(len(self._incoming)) + s += ' - pool size: ' + str(self.pool_size) + s += ' - lifetime: ' + str(self.lifetime) + s += ' - keepalive: ' + str(self.keepalive) + s += ' - open: ' + str(self.open_pool) + s += ' - bind: ' + str(self.bind_pool) + s += ' - tls: ' + str(self.tls_pool) + linesep + s += 'MASTER CONN: ' + str(self.master_connection) + linesep + s += 'WORKERS:' + if self.workers: + for i, worker in enumerate(self.workers): + s += linesep + str(i).rjust(5) + ': ' + str(worker) + else: + s += linesep + ' no active workers in pool' + + return s + + def __repr__(self): + return self.__str__() + + def get_info_from_server(self): + for worker in self.workers: + with worker.worker_lock: + if not worker.connection.server.schema or not worker.connection.server.info: + worker.get_info_from_server = True + else: + worker.get_info_from_server = False + + def rebind_pool(self): + for worker in self.workers: + with worker.worker_lock: + worker.connection.rebind(self.master_connection.user, + self.master_connection.password, + self.master_connection.authentication, + self.master_connection.sasl_mechanism, + self.master_connection.sasl_credentials) + + def start_pool(self): + if not self.started: + self.create_pool() + for worker in self.workers: + with worker.worker_lock: + worker.thread.start() + self.started = True + self.terminated = False + if log_enabled(BASIC): + log(BASIC, 'worker started for pool <%s>', self) + return True + return False + + def create_pool(self): + if log_enabled(BASIC): + log(BASIC, 'created pool <%s>', self) + self.workers = [ReusableStrategy.PooledConnectionWorker(self.master_connection, self.request_queue) for _ in range(self.pool_size)] + + def terminate_pool(self): + if not self.terminated: + if log_enabled(BASIC): + log(BASIC, 'terminating pool <%s>', self) + self.started = False + self.request_queue.join() # waits for all queue pending operations + for _ in range(len([worker for worker in self.workers if worker.thread.is_alive()])): # put a TERMINATE signal on the queue for each active thread + self.request_queue.put((TERMINATE_REUSABLE, None, None, None)) + self.request_queue.join() # waits for all queue terminate operations + self.terminated = True + if log_enabled(BASIC): + log(BASIC, 'pool terminated for <%s>', self) + + class PooledConnectionThread(Thread): + """ + The thread that holds the Reusable connection and receive operation request via the queue + Result are sent back in the pool._incoming list when ready + """ + def __init__(self, worker, master_connection): + Thread.__init__(self) + self.daemon = True + self.worker = worker + self.master_connection = master_connection + if log_enabled(BASIC): + log(BASIC, 'instantiated PooledConnectionThread: <%r>', self) + + # noinspection PyProtectedMember + def run(self): + self.worker.running = True + terminate = False + pool = self.master_connection.strategy.pool + while not terminate: + try: + counter, message_type, request, controls = pool.request_queue.get(block=True, timeout=self.master_connection.strategy.pool.keepalive) + except Empty: # issue an Abandon(0) operation to keep the connection live - Abandon(0) is a harmless operation + if not self.worker.connection.closed: + self.worker.connection.abandon(0) + continue + + with self.worker.worker_lock: + self.worker.busy = True + if counter == TERMINATE_REUSABLE: + terminate = True + if self.worker.connection.bound: + try: + self.worker.connection.unbind() + if log_enabled(BASIC): + log(BASIC, 'thread terminated') + except LDAPExceptionError: + pass + else: + if (datetime.now() - self.worker.creation_time).seconds >= self.master_connection.strategy.pool.lifetime: # destroy and create a new connection + try: + self.worker.connection.unbind() + except LDAPExceptionError: + pass + self.worker.new_connection() + if log_enabled(BASIC): + log(BASIC, 'thread respawn') + if message_type not in ['bindRequest', 'unbindRequest']: + try: + if pool.open_pool and self.worker.connection.closed: + self.worker.connection.open(read_server_info=False) + if pool.tls_pool and not self.worker.connection.tls_started: + self.worker.connection.start_tls(read_server_info=False) + if pool.bind_pool and not self.worker.connection.bound: + self.worker.connection.bind(read_server_info=False) + elif pool.open_pool and not self.worker.connection.closed: # connection already open, issues a start_tls + if pool.tls_pool and not self.worker.connection.tls_started: + self.worker.connection.start_tls(read_server_info=False) + if self.worker.get_info_from_server and counter: + self.worker.connection.refresh_server_info() + self.worker.get_info_from_server = False + response = None + result = None + if message_type == 'searchRequest': + response = self.worker.connection.post_send_search(self.worker.connection.send(message_type, request, controls)) + else: + response = self.worker.connection.post_send_single_response(self.worker.connection.send(message_type, request, controls)) + result = self.worker.connection.result + with pool.pool_lock: + pool._incoming[counter] = (response, result, BaseStrategy.decode_request(message_type, request, controls)) + except LDAPOperationResult as e: # raise_exceptions has raised an exception. It must be redirected to the original connection thread + with pool.pool_lock: + pool._incoming[counter] = (e, None, None) + # pool._incoming[counter] = (type(e)(str(e)), None, None) + # except LDAPOperationResult as e: # raise_exceptions has raised an exception. It must be redirected to the original connection thread + # exc = e + # with pool.pool_lock: + # if exc: + # pool._incoming[counter] = (exc, None, None) + # else: + # pool._incoming[counter] = (response, result, BaseStrategy.decode_request(message_type, request, controls)) + + self.worker.busy = False + pool.request_queue.task_done() + self.worker.task_counter += 1 + if log_enabled(BASIC): + log(BASIC, 'thread terminated') + if self.master_connection.usage: + pool.terminated_usage += self.worker.connection.usage + self.worker.running = False + + class PooledConnectionWorker(object): + """ + Container for the restartable connection. it includes a thread and a lock to execute the connection in the pool + """ + def __init__(self, connection, request_queue): + self.master_connection = connection + self.request_queue = request_queue + self.running = False + self.busy = False + self.get_info_from_server = False + self.connection = None + self.creation_time = None + self.task_counter = 0 + self.new_connection() + self.thread = ReusableStrategy.PooledConnectionThread(self, self.master_connection) + self.worker_lock = Lock() + if log_enabled(BASIC): + log(BASIC, 'instantiated PooledConnectionWorker: <%s>', self) + + def __str__(self): + s = 'CONN: ' + str(self.connection) + linesep + ' THREAD: ' + s += 'running' if self.running else 'halted' + s += ' - ' + ('busy' if self.busy else 'available') + s += ' - ' + ('created at: ' + self.creation_time.isoformat()) + s += ' - time to live: ' + str(self.master_connection.strategy.pool.lifetime - (datetime.now() - self.creation_time).seconds) + s += ' - requests served: ' + str(self.task_counter) + + return s + + def new_connection(self): + from ..core.connection import Connection + # noinspection PyProtectedMember + self.creation_time = datetime.now() + self.connection = Connection(server=self.master_connection.server_pool if self.master_connection.server_pool else self.master_connection.server, + user=self.master_connection.user, + password=self.master_connection.password, + auto_bind=AUTO_BIND_NONE, # do not perform auto_bind because it reads again the schema + version=self.master_connection.version, + authentication=self.master_connection.authentication, + client_strategy=RESTARTABLE, + auto_referrals=self.master_connection.auto_referrals, + auto_range=self.master_connection.auto_range, + sasl_mechanism=self.master_connection.sasl_mechanism, + sasl_credentials=self.master_connection.sasl_credentials, + check_names=self.master_connection.check_names, + collect_usage=self.master_connection._usage, + read_only=self.master_connection.read_only, + raise_exceptions=self.master_connection.raise_exceptions, + lazy=False, + fast_decoder=self.master_connection.fast_decoder, + receive_timeout=self.master_connection.receive_timeout, + return_empty_attributes=self.master_connection.empty_attributes) + + # simulates auto_bind, always with read_server_info=False + if self.master_connection.auto_bind and self.master_connection.auto_bind not in [AUTO_BIND_NONE, AUTO_BIND_DEFAULT]: + if log_enabled(BASIC): + log(BASIC, 'performing automatic bind for <%s>', self.connection) + self.connection.open(read_server_info=False) + if self.master_connection.auto_bind == AUTO_BIND_NO_TLS: + self.connection.bind(read_server_info=False) + elif self.master_connection.auto_bind == AUTO_BIND_TLS_BEFORE_BIND: + self.connection.start_tls(read_server_info=False) + self.connection.bind(read_server_info=False) + elif self.master_connection.auto_bind == AUTO_BIND_TLS_AFTER_BIND: + self.connection.bind(read_server_info=False) + self.connection.start_tls(read_server_info=False) + + if self.master_connection.server_pool: + self.connection.server_pool = self.master_connection.server_pool + self.connection.server_pool.initialize(self.connection) + + # ReusableStrategy methods + def __init__(self, ldap_connection): + BaseStrategy.__init__(self, ldap_connection) + self.sync = False + self.no_real_dsa = False + self.pooled = True + self.can_stream = False + if hasattr(ldap_connection, 'pool_name') and ldap_connection.pool_name: + self.pool = ReusableStrategy.ConnectionPool(ldap_connection) + else: + if log_enabled(ERROR): + log(ERROR, 'reusable connection must have a pool_name') + raise LDAPConnectionPoolNameIsMandatoryError('reusable connection must have a pool_name') + + def open(self, reset_usage=True, read_server_info=True): + # read_server_info not used + self.pool.open_pool = True + self.pool.start_pool() + self.connection.closed = False + if self.connection.usage: + if reset_usage or not self.connection._usage.initial_connection_start_time: + self.connection._usage.start() + + def terminate(self): + self.pool.terminate_pool() + self.pool.open_pool = False + self.connection.bound = False + self.connection.closed = True + self.pool.bind_pool = False + self.pool.tls_pool = False + + def _close_socket(self): + """ + Doesn't really close the socket + """ + self.connection.closed = True + + if self.connection.usage: + self.connection._usage.closed_sockets += 1 + + def send(self, message_type, request, controls=None): + if self.pool.started: + if message_type == 'bindRequest': + self.pool.bind_pool = True + counter = BOGUS_BIND + elif message_type == 'unbindRequest': + self.pool.bind_pool = False + counter = BOGUS_UNBIND + elif message_type == 'abandonRequest': + counter = BOGUS_ABANDON + elif message_type == 'extendedReq' and self.connection.starting_tls: + self.pool.tls_pool = True + counter = BOGUS_EXTENDED + else: + with self.pool.pool_lock: + self.pool.counter += 1 + if self.pool.counter > LDAP_MAX_INT: + self.pool.counter = 1 + counter = self.pool.counter + self.pool.request_queue.put((counter, message_type, request, controls)) + return counter + if log_enabled(ERROR): + log(ERROR, 'reusable connection pool not started') + raise LDAPConnectionPoolNotStartedError('reusable connection pool not started') + + def validate_bind(self, controls): + # in case of a new connection or different credentials + if (self.connection.user != self.pool.master_connection.user or + self.connection.password != self.pool.master_connection.password or + self.connection.authentication != self.pool.master_connection.authentication or + self.connection.sasl_mechanism != self.pool.master_connection.sasl_mechanism or + self.connection.sasl_credentials != self.pool.master_connection.sasl_credentials): + self.pool.master_connection.user = self.connection.user + self.pool.master_connection.password = self.connection.password + self.pool.master_connection.authentication = self.connection.authentication + self.pool.master_connection.sasl_mechanism = self.connection.sasl_mechanism + self.pool.master_connection.sasl_credentials = self.connection.sasl_credentials + self.pool.rebind_pool() + temp_connection = self.pool.workers[0].connection + old_lazy = temp_connection.lazy + temp_connection.lazy = False + if not self.connection.server.schema or not self.connection.server.info: + result = self.pool.workers[0].connection.bind(controls=controls) + else: + result = self.pool.workers[0].connection.bind(controls=controls, read_server_info=False) + + temp_connection.unbind() + temp_connection.lazy = old_lazy + if result: + self.pool.bind_pool = True # bind pool if bind is validated + return result + + def get_response(self, counter, timeout=None, get_request=False): + sleeptime = get_config_parameter('RESPONSE_SLEEPTIME') + request=None + if timeout is None: + timeout = get_config_parameter('RESPONSE_WAITING_TIMEOUT') + if counter == BOGUS_BIND: # send a bogus bindResponse + response = list() + result = {'description': 'success', 'referrals': None, 'type': 'bindResponse', 'result': 0, 'dn': '', 'message': '', 'saslCreds': None} + elif counter == BOGUS_UNBIND: # bogus unbind response + response = None + result = None + elif counter == BOGUS_ABANDON: # abandon cannot be executed because of multiple connections + response = list() + result = {'result': 0, 'referrals': None, 'responseName': '1.3.6.1.4.1.1466.20037', 'type': 'extendedResp', 'description': 'success', 'responseValue': 'None', 'dn': '', 'message': ''} + elif counter == BOGUS_EXTENDED: # bogus startTls extended response + response = list() + result = {'result': 0, 'referrals': None, 'responseName': '1.3.6.1.4.1.1466.20037', 'type': 'extendedResp', 'description': 'success', 'responseValue': 'None', 'dn': '', 'message': ''} + self.connection.starting_tls = False + else: + response = None + result = None + while timeout >= 0: # waiting for completed message to appear in _incoming + try: + with self.connection.strategy.pool.pool_lock: + response, result, request = self.connection.strategy.pool._incoming.pop(counter) + except KeyError: + sleep(sleeptime) + timeout -= sleeptime + continue + break + + if timeout <= 0: + if log_enabled(ERROR): + log(ERROR, 'no response from worker threads in Reusable connection') + raise LDAPResponseTimeoutError('no response from worker threads in Reusable connection') + + if isinstance(response, LDAPOperationResult): + raise response # an exception has been raised with raise_exceptions + + if get_request: + return response, result, request + + return response, result + + def post_send_single_response(self, counter): + return counter + + def post_send_search(self, counter): + return counter diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/safeRestartable.py b/python/user_packages/Python313/site-packages/ldap3/strategy/safeRestartable.py new file mode 100644 index 0000000000000000000000000000000000000000..3c65176e02a5b1c98528085672dbcca20f56d7e0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/safeRestartable.py @@ -0,0 +1,32 @@ +""" +""" + +# Created on 2020.07.12 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .restartable import RestartableStrategy + + +class SafeRestartableStrategy(RestartableStrategy): + def __init__(self, ldap_connection): + RestartableStrategy.__init__(self, ldap_connection) + self.thread_safe = True diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/safeSync.py b/python/user_packages/Python313/site-packages/ldap3/strategy/safeSync.py new file mode 100644 index 0000000000000000000000000000000000000000..dcd2b924d1e58ed2f852ebf7cb75be7ecbd504d0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/safeSync.py @@ -0,0 +1,32 @@ +""" +""" + +# Created on 2020.07.12 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .sync import SyncStrategy + + +class SafeSyncStrategy(SyncStrategy): + def __init__(self, ldap_connection): + SyncStrategy.__init__(self, ldap_connection) + self.thread_safe = True diff --git a/python/user_packages/Python313/site-packages/ldap3/strategy/sync.py b/python/user_packages/Python313/site-packages/ldap3/strategy/sync.py new file mode 100644 index 0000000000000000000000000000000000000000..49224c6f9a70ebfc1a8af4eb0cf260520913d762 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/strategy/sync.py @@ -0,0 +1,251 @@ +""" +""" + +# Created on 2013.07.15 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +import socket + +from .. import SEQUENCE_TYPES, get_config_parameter, DIGEST_MD5 +from ..core.exceptions import LDAPSocketReceiveError, communication_exception_factory, LDAPExceptionError, LDAPExtensionError, LDAPOperationResult, LDAPSignatureVerificationFailedError +from ..strategy.base import BaseStrategy, SESSION_TERMINATED_BY_SERVER, RESPONSE_COMPLETE, TRANSACTION_ERROR +from ..protocol.rfc4511 import LDAPMessage +from ..utils.log import log, log_enabled, ERROR, NETWORK, EXTENDED, format_ldap_message +from ..utils.asn1 import decoder, decode_message_fast +from ..protocol.sasl.digestMd5 import md5_hmac + +LDAP_MESSAGE_TEMPLATE = LDAPMessage() + + +# noinspection PyProtectedMember +class SyncStrategy(BaseStrategy): + """ + This strategy is synchronous. You send the request and get the response + Requests return a boolean value to indicate the result of the requested Operation + Connection.response will contain the whole LDAP response for the messageId requested in a dict form + Connection.request will contain the result LDAP message in a dict form + """ + + def __init__(self, ldap_connection): + BaseStrategy.__init__(self, ldap_connection) + self.sync = True + self.no_real_dsa = False + self.pooled = False + self.can_stream = False + self.socket_size = get_config_parameter('SOCKET_SIZE') + + def open(self, reset_usage=True, read_server_info=True): + BaseStrategy.open(self, reset_usage, read_server_info) + if read_server_info and not self.connection._deferred_open: + try: + self.connection.refresh_server_info() + except LDAPOperationResult: # catch errors from server if raise_exception = True + self.connection.server._dsa_info = None + self.connection.server._schema_info = None + + def _start_listen(self): + if not self.connection.listening and not self.connection.closed: + self.connection.listening = True + + def receiving(self): + """ + Receives data over the socket + Checks if the socket is closed + """ + messages = [] + receiving = True + unprocessed = b'' + data = b'' + get_more_data = True + # exc = None # not needed here GC + sasl_total_bytes_recieved = 0 + sasl_received_data = b'' # used to verify the signature + sasl_next_packet = b'' + # sasl_signature = b'' # not needed here? GC + # sasl_sec_num = b'' # used to verify the signature # not needed here, reformatted to lowercase GC + sasl_buffer_length = -1 # added, not initialized? GC + while receiving: + if get_more_data: + try: + data = self.connection.socket.recv(self.socket_size) + except (OSError, socket.error, AttributeError) as e: + self.connection.last_error = 'error receiving data: ' + str(e) + try: # try to close the connection before raising exception + self.close() + except (socket.error, LDAPExceptionError): + pass + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + # raise communication_exception_factory(LDAPSocketReceiveError, exc)(self.connection.last_error) + raise communication_exception_factory(LDAPSocketReceiveError, type(e)(str(e)))(self.connection.last_error) + + # If we are using DIGEST-MD5 and LDAP signing is set : verify & remove the signature from the message + if self.connection.sasl_mechanism == DIGEST_MD5 and self.connection._digest_md5_kis and not self.connection.sasl_in_progress: + data = sasl_next_packet + data + + if sasl_received_data == b'' or sasl_next_packet: + # Remove the sizeOf(encoded_message + signature + 0x0001 + secNum) from data. + sasl_buffer_length = int.from_bytes(data[0:4], "big") + data = data[4:] + sasl_next_packet = b'' + sasl_total_bytes_recieved += len(data) + sasl_received_data += data + + if sasl_total_bytes_recieved >= sasl_buffer_length: + # When the LDAP response is splitted accross multiple TCP packets, the SASL buffer length is equal to the MTU of each packet..Which is usually not equal to self.socket_size + # This means that the end of one SASL packet/beginning of one other....could be located in the middle of data + # We are using "sasl_received_data" instead of "data" & "unprocessed" for this reason + + # structure of messages when LDAP signing is enabled : sizeOf(encoded_message + signature + 0x0001 + secNum) + encoded_message + signature + 0x0001 + secNum + sasl_signature = sasl_received_data[sasl_buffer_length - 16:sasl_buffer_length - 6] + sasl_sec_num = sasl_received_data[sasl_buffer_length - 4:sasl_buffer_length] + sasl_next_packet = sasl_received_data[sasl_buffer_length:] # the last "data" variable may contain another sasl packet. We'll process it at the next iteration. + sasl_received_data = sasl_received_data[:sasl_buffer_length - 16] # remove signature + 0x0001 + secNum + the next packet if any, from sasl_received_data + + kis = self.connection._digest_md5_kis # renamed to lowercase GC + calculated_signature = bytes.fromhex(md5_hmac(kis, sasl_sec_num + sasl_received_data)[0:20]) + if sasl_signature != calculated_signature: + raise LDAPSignatureVerificationFailedError("Signature verification failed for the recieved LDAP message number " + str(int.from_bytes(sasl_sec_num, 'big')) + ". Expected signature " + calculated_signature.hex() + " but got " + sasl_signature.hex() + ".") + sasl_total_bytes_recieved = 0 + unprocessed += sasl_received_data + sasl_received_data = b'' + else: + unprocessed += data + if len(data) > 0: + length = BaseStrategy.compute_ldap_message_size(unprocessed) + if length == -1: # too few data to decode message length + get_more_data = True + continue + if len(unprocessed) < length: + get_more_data = True + else: + if log_enabled(NETWORK): + log(NETWORK, 'received %d bytes via <%s>', len(unprocessed[:length]), self.connection) + messages.append(unprocessed[:length]) + unprocessed = unprocessed[length:] + get_more_data = False + if len(unprocessed) == 0: + receiving = False + else: + receiving = False + + if log_enabled(NETWORK): + log(NETWORK, 'received %d ldap messages via <%s>', len(messages), self.connection) + return messages + + def post_send_single_response(self, message_id): + """ + Executed after an Operation Request (except Search) + Returns the result message or None + """ + responses, result = self.get_response(message_id) + self.connection.result = result + if result['type'] == 'intermediateResponse': # checks that all responses are intermediates (there should be only one) + for response in responses: + if response['type'] != 'intermediateResponse': + self.connection.last_error = 'multiple messages received error' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSocketReceiveError(self.connection.last_error) + + responses.append(result) + return responses + + def post_send_search(self, message_id): + """ + Executed after a search request + Returns the result message and store in connection.response the objects found + """ + responses, result = self.get_response(message_id) + self.connection.result = result + if isinstance(responses, SEQUENCE_TYPES): + self.connection.response = responses[:] # copy search result entries + return responses + + self.connection.last_error = 'error receiving response' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSocketReceiveError(self.connection.last_error) + + def _get_response(self, message_id, timeout): + """ + Performs the capture of LDAP response for SyncStrategy + """ + ldap_responses = [] + response_complete = False + while not response_complete: + responses = self.receiving() + if responses: + for response in responses: + if len(response) > 0: + if self.connection.usage: + self.connection._usage.update_received_message(len(response)) + if self.connection.fast_decoder: + ldap_resp = decode_message_fast(response) + dict_response = self.decode_response_fast(ldap_resp) + else: + ldap_resp, _ = decoder.decode(response, asn1Spec=LDAP_MESSAGE_TEMPLATE) # unprocessed unused because receiving() waits for the whole message + dict_response = self.decode_response(ldap_resp) + if log_enabled(EXTENDED): + log(EXTENDED, 'ldap message received via <%s>:%s', self.connection, format_ldap_message(ldap_resp, '<<')) + if int(ldap_resp['messageID']) == message_id: + ldap_responses.append(dict_response) + if dict_response['type'] not in ['searchResEntry', 'searchResRef', 'intermediateResponse']: + response_complete = True + elif int(ldap_resp['messageID']) == 0: # 0 is reserved for 'Unsolicited Notification' from server as per RFC4511 (paragraph 4.4) + if dict_response['responseName'] == '1.3.6.1.4.1.1466.20036': # Notice of Disconnection as per RFC4511 (paragraph 4.4.1) + return SESSION_TERMINATED_BY_SERVER + elif dict_response['responseName'] == '2.16.840.1.113719.1.27.103.4': # Novell LDAP transaction error unsolicited notification + return TRANSACTION_ERROR + else: + self.connection.last_error = 'unknown unsolicited notification from server' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSocketReceiveError(self.connection.last_error) + elif int(ldap_resp['messageID']) != message_id and dict_response['type'] == 'extendedResp': + self.connection.last_error = 'multiple extended responses to a single extended request' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPExtensionError(self.connection.last_error) + # pass # ignore message with invalid messageId when receiving multiple extendedResp. This is not allowed by RFC4511 but some LDAP server do it + else: + self.connection.last_error = 'invalid messageId received' + if log_enabled(ERROR): + log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + raise LDAPSocketReceiveError(self.connection.last_error) + # response = unprocessed + # if response: # if this statement is removed unprocessed data will be processed as another message + # self.connection.last_error = 'unprocessed substrate error' + # if log_enabled(ERROR): + # log(ERROR, '<%s> for <%s>', self.connection.last_error, self.connection) + # raise LDAPSocketReceiveError(self.connection.last_error) + else: + return SESSION_TERMINATED_BY_SERVER + ldap_responses.append(RESPONSE_COMPLETE) + + return ldap_responses + + def set_stream(self, value): + raise NotImplementedError + + def get_stream(self): + raise NotImplementedError diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__init__.py b/python/user_packages/Python313/site-packages/ldap3/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b81a286276b533c1efccacf5ddf6dac1d6a99cdd Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/asn1.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/asn1.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f9ca5619c3612938b6c7f6c367093f133dc1160 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/asn1.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ciDict.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ciDict.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..90135d10e4a9d2832ceed479f2cafd19f4d6c253 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ciDict.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/config.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53b328ee82460afd73194c90e7ce1bf67021aa64 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/config.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/conv.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/conv.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a78f088d55a01b0f76459eaa83416a53d9de1d2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/conv.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/dn.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/dn.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f4ff46ac13ecbda2bd33905915430001313bcac Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/dn.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/hashed.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/hashed.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21bfc46a92c76f2fa971ab1cb4ca666620629917 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/hashed.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/log.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/log.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c08622b0848db90cd5d34f3450c3828608f9fd86 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/log.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ntlm.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ntlm.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab5d43c4c7caf365961b41df576af71616c0a4a8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ntlm.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ordDict.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ordDict.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..80ee81b353649af151bd4894b1a56a336763c7fe Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/ordDict.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/port_validators.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/port_validators.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08fc0b309f1274dd9cd46b411ddc7b6690e99993 Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/port_validators.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/repr.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/repr.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22b0093b78e915677b5f13bee2c05ae04c1f49fb Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/repr.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/tls_backport.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/tls_backport.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad3f1b4ef46fa23888c8369f3627c11af1b3aefc Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/tls_backport.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/uri.cpython-313.pyc b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/uri.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..877aa6dff88e97974483c556a2f8fa9895e5119d Binary files /dev/null and b/python/user_packages/Python313/site-packages/ldap3/utils/__pycache__/uri.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/asn1.py b/python/user_packages/Python313/site-packages/ldap3/utils/asn1.py new file mode 100644 index 0000000000000000000000000000000000000000..1b6091d4e43472a68e8a440228b76a22e99104a5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/asn1.py @@ -0,0 +1,245 @@ +""" +""" + +# Created on 2015.08.19 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from pyasn1 import __version__ as pyasn1_version +from pyasn1.codec.ber import decoder # for usage in other modules +from pyasn1.codec.ber.encoder import Encoder # for monkeypatching of boolean value +from ..core.results import RESULT_CODES +from ..utils.conv import to_unicode +from ..protocol.convert import referrals_to_list + +CLASSES = {(False, False): 0, # Universal + (False, True): 1, # Application + (True, False): 2, # Context + (True, True): 3} # Private + + +# Monkeypatching of pyasn1 for encoding Boolean with the value 0xFF for TRUE +# THIS IS NOT PART OF THE FAST BER DECODER +if pyasn1_version == 'xxx0.2.3': + from pyasn1.codec.ber.encoder import tagMap, BooleanEncoder, encode + from pyasn1.type.univ import Boolean + from pyasn1.compat.octets import ints2octs + class BooleanCEREncoder(BooleanEncoder): + _true = ints2octs((255,)) + + tagMap[Boolean.tagSet] = BooleanCEREncoder() +else: + from pyasn1.codec.ber.encoder import tagMap, typeMap, AbstractItemEncoder + from pyasn1.type.univ import Boolean + from copy import deepcopy + + class LDAPBooleanEncoder(AbstractItemEncoder): + supportIndefLenMode = False + if pyasn1_version <= '0.2.3': + from pyasn1.compat.octets import ints2octs + _true = ints2octs((255,)) + _false = ints2octs((0,)) + def encodeValue(self, encodeFun, value, defMode, maxChunkSize): + return value and self._true or self._false, 0 + elif pyasn1_version <= '0.3.1': + def encodeValue(self, encodeFun, value, defMode, maxChunkSize): + return value and (255,) or (0,), False, False + elif pyasn1_version <= '0.3.4': + def encodeValue(self, encodeFun, value, defMode, maxChunkSize, ifNotEmpty=False): + return value and (255,) or (0,), False, False + elif pyasn1_version <= '0.3.7': + def encodeValue(self, value, encodeFun, **options): + return value and (255,) or (0,), False, False + else: + def encodeValue(self, value, asn1Spec, encodeFun, **options): + return value and (255,) or (0,), False, False + + customTagMap = deepcopy(tagMap) + customTypeMap = deepcopy(typeMap) + customTagMap[Boolean.tagSet] = LDAPBooleanEncoder() + customTypeMap[Boolean.typeId] = LDAPBooleanEncoder() + + encode = Encoder(customTagMap, customTypeMap) +# end of monkey patching + +# a fast BER decoder for LDAP responses only +def compute_ber_size(data): + """ + Compute size according to BER definite length rules + Returns size of value and value offset + """ + + if data[1] <= 127: # BER definite length - short form. Highest bit of byte 1 is 0, message length is in the last 7 bits - Value can be up to 127 bytes long + return data[1], 2 + else: # BER definite length - long form. Highest bit of byte 1 is 1, last 7 bits counts the number of following octets containing the value length + bytes_length = data[1] - 128 + value_length = 0 + cont = bytes_length + for byte in data[2: 2 + bytes_length]: + cont -= 1 + value_length += byte * (256 ** cont) + return value_length, bytes_length + 2 + + +def decode_message_fast(message): + ber_len, ber_value_offset = compute_ber_size(get_bytes(message[:10])) # get start of sequence, at maximum 3 bytes for length + decoded = decode_sequence(message, ber_value_offset, ber_len + ber_value_offset, LDAP_MESSAGE_CONTEXT) + return { + 'messageID': decoded[0][3], + 'protocolOp': decoded[1][2], + 'payload': decoded[1][3], + 'controls': decoded[2][3] if len(decoded) == 3 else None + } + + +def decode_sequence(message, start, stop, context_decoders=None): + decoded = [] + while start < stop: + octet = get_byte(message[start]) + ber_class = CLASSES[(bool(octet & 0b10000000), bool(octet & 0b01000000))] + ber_constructed = bool(octet & 0b00100000) + ber_type = octet & 0b00011111 + ber_decoder = DECODERS[(ber_class, octet & 0b00011111)] if ber_class < 2 else None + ber_len, ber_value_offset = compute_ber_size(get_bytes(message[start: start + 10])) + start += ber_value_offset + if ber_decoder: + value = ber_decoder(message, start, start + ber_len, context_decoders) # call value decode function + else: + # try: + value = context_decoders[ber_type](message, start, start + ber_len) # call value decode function for context class + # except KeyError: + # if ber_type == 3: # Referral in result + # value = decode_sequence(message, start, start + ber_len) + # else: + # raise # re-raise, should never happen + decoded.append((ber_class, ber_constructed, ber_type, value)) + start += ber_len + + return decoded + + +def decode_integer(message, start, stop, context_decoders=None): + first = message[start] + value = -1 if get_byte(first) & 0x80 else 0 + for octet in message[start: stop]: + value = value << 8 | get_byte(octet) + + return value + + +def decode_octet_string(message, start, stop, context_decoders=None): + return message[start: stop] + + +def decode_boolean(message, start, stop, context_decoders=None): + return False if message[start: stop] == 0 else True + + +def decode_bind_response(message, start, stop, context_decoders=None): + return decode_sequence(message, start, stop, BIND_RESPONSE_CONTEXT) + + +def decode_extended_response(message, start, stop, context_decoders=None): + return decode_sequence(message, start, stop, EXTENDED_RESPONSE_CONTEXT) + + +def decode_intermediate_response(message, start, stop, context_decoders=None): + return decode_sequence(message, start, stop, INTERMEDIATE_RESPONSE_CONTEXT) + + +def decode_controls(message, start, stop, context_decoders=None): + return decode_sequence(message, start, stop, CONTROLS_CONTEXT) + + +def ldap_result_to_dict_fast(response): + response_dict = dict() + response_dict['result'] = int(response[0][3]) # resultCode + response_dict['description'] = RESULT_CODES[response_dict['result']] + response_dict['dn'] = to_unicode(response[1][3], from_server=True) # matchedDN + response_dict['message'] = to_unicode(response[2][3], from_server=True) # diagnosticMessage + if len(response) == 4: + response_dict['referrals'] = referrals_to_list([to_unicode(referral[3], from_server=True) for referral in response[3][3]]) # referrals + else: + response_dict['referrals'] = None + + return response_dict + + +###### + +if str is not bytes: # Python 3 + def get_byte(x): + return x + + def get_bytes(x): + return x +else: # Python 2 + def get_byte(x): + return ord(x) + + def get_bytes(x): + return bytearray(x) + +DECODERS = { + # Universal + (0, 1): decode_boolean, # Boolean + (0, 2): decode_integer, # Integer + (0, 4): decode_octet_string, # Octet String + (0, 10): decode_integer, # Enumerated + (0, 16): decode_sequence, # Sequence + (0, 17): decode_sequence, # Set + # Application + (1, 1): decode_bind_response, # Bind response + (1, 4): decode_sequence, # Search result entry + (1, 5): decode_sequence, # Search result done + (1, 7): decode_sequence, # Modify response + (1, 9): decode_sequence, # Add response + (1, 11): decode_sequence, # Delete response + (1, 13): decode_sequence, # ModifyDN response + (1, 15): decode_sequence, # Compare response + (1, 19): decode_sequence, # Search result reference + (1, 24): decode_extended_response, # Extended response + (1, 25): decode_intermediate_response, # intermediate response + (2, 3): decode_octet_string # +} + +BIND_RESPONSE_CONTEXT = { + 7: decode_octet_string # SaslCredentials +} + +EXTENDED_RESPONSE_CONTEXT = { + 10: decode_octet_string, # ResponseName + 11: decode_octet_string # Response Value +} + +INTERMEDIATE_RESPONSE_CONTEXT = { + 0: decode_octet_string, # IntermediateResponseName + 1: decode_octet_string # IntermediateResponseValue +} + +LDAP_MESSAGE_CONTEXT = { + 0: decode_controls, # Controls + 3: decode_sequence # Referral +} + +CONTROLS_CONTEXT = { + 0: decode_sequence # Control +} diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/ciDict.py b/python/user_packages/Python313/site-packages/ldap3/utils/ciDict.py new file mode 100644 index 0000000000000000000000000000000000000000..c51d7ff11fe731274b09cf0bcc4a800fcdac4f47 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/ciDict.py @@ -0,0 +1,199 @@ +""" +""" + +# Created on 2014.08.23 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +try: + from collections.abc import MutableMapping, Mapping +except ImportError: + from collections import MutableMapping, Mapping + +from .. import SEQUENCE_TYPES + + +class CaseInsensitiveDict(MutableMapping): + def __init__(self, other=None, **kwargs): + self._store = dict() # store use the original key + self._case_insensitive_keymap = dict() # is a mapping ci_key -> key + if other or kwargs: + if other is None: + other = dict() + self.update(other, **kwargs) + + def __contains__(self, item): + try: + self.__getitem__(item) + return True + except KeyError: + return False + + @staticmethod + def _ci_key(key): + return key.strip().lower() if hasattr(key, 'lower') else key + + def __delitem__(self, key): + ci_key = self._ci_key(key) + del self._store[self._case_insensitive_keymap[ci_key]] + del self._case_insensitive_keymap[ci_key] + + def __setitem__(self, key, item): + ci_key = self._ci_key(key) + if ci_key in self._case_insensitive_keymap: # updates existing value + self._store[self._case_insensitive_keymap[ci_key]] = item + else: # new key + self._store[key] = item + self._case_insensitive_keymap[ci_key] = key + + def __getitem__(self, key): + return self._store[self._case_insensitive_keymap[self._ci_key(key)]] + + def __iter__(self): + return self._store.__iter__() + + def __len__(self): # if len is 0 then the cidict appears as False in IF statement + return len(self._store) + + def __repr__(self): + return repr(self._store) + + def __str__(self): + return str(self._store) + + def keys(self): + return self._store.keys() + + def values(self): + return self._store.values() + + def items(self): + return self._store.items() + + def __eq__(self, other): + if not isinstance(other, (Mapping, dict)): + return NotImplemented + + if isinstance(other, CaseInsensitiveDict): + if len(self.items()) != len(other.items()): + return False + else: + for key, value in self.items(): + if not (key in other and other[key] == value): + return False + return True + + return self == CaseInsensitiveDict(other) + + def copy(self): + return CaseInsensitiveDict(self._store) + + +class CaseInsensitiveWithAliasDict(CaseInsensitiveDict): + def __init__(self, other=None, **kwargs): + self._aliases = dict() + self._alias_keymap = dict() # is a mapping key -> [alias1, alias2, ...] + CaseInsensitiveDict.__init__(self, other, **kwargs) + + def aliases(self): + return self._aliases.keys() + + def __setitem__(self, key, value): + if isinstance(key, SEQUENCE_TYPES): + ci_key = self._ci_key(key[0]) + if ci_key not in self._aliases: + CaseInsensitiveDict.__setitem__(self, key[0], value) + self.set_alias(ci_key, key[1:]) + else: + raise KeyError('\'' + str(key[0] + ' already used as alias')) + else: + ci_key = self._ci_key(key) + if ci_key not in self._aliases: + CaseInsensitiveDict.__setitem__(self, key, value) + else: + self[self._aliases[ci_key]] = value + + def __delitem__(self, key): + ci_key = self._ci_key(key) + try: + CaseInsensitiveDict.__delitem__(self, ci_key) + if ci_key in self._alias_keymap: + for alias in self._alias_keymap[ci_key][:]: # removes aliases, uses a copy of _alias_keymap because iterator gets confused when aliases are removed from _alias_keymap + self.remove_alias(alias) + return + except KeyError: # try to remove alias + if ci_key in self._aliases: + self.remove_alias(ci_key) + + def set_alias(self, key, alias, ignore_duplicates=False): + if not isinstance(alias, SEQUENCE_TYPES): + alias = [alias] + for alias_to_add in alias: + ci_key = self._ci_key(key) + if ci_key in self._case_insensitive_keymap: + ci_alias = self._ci_key(alias_to_add) + if ci_alias not in self._case_insensitive_keymap: # checks if alias is used a key + if ci_alias not in self._aliases: # checks if alias is used as another alias + self._aliases[ci_alias] = ci_key + if ci_key in self._alias_keymap: # extends alias keymap + self._alias_keymap[ci_key].append(self._ci_key(ci_alias)) + else: + self._alias_keymap[ci_key] = list() + self._alias_keymap[ci_key].append(self._ci_key(ci_alias)) + else: + if ci_key in self._alias_keymap and ci_alias in self._alias_keymap[ci_key]: # passes if alias is already defined to the same key + pass + elif not ignore_duplicates: + raise KeyError('\'' + str(alias_to_add) + '\' already used as alias') + else: + if ci_key == self._ci_key(self._case_insensitive_keymap[ci_alias]): # passes if alias is already defined to the same key + pass + elif not ignore_duplicates: + raise KeyError('\'' + str(alias_to_add) + '\' already used as key') + else: + for keymap in self._alias_keymap: + if ci_key in self._alias_keymap[keymap]: # kye is already aliased + self.set_alias(keymap, alias + [ci_key], ignore_duplicates=ignore_duplicates) + break + else: + raise KeyError('\'' + str(ci_key) + '\' is not an existing alias or key') + + def remove_alias(self, alias): + if not isinstance(alias, SEQUENCE_TYPES): + alias = [alias] + for alias_to_remove in alias: + ci_alias = self._ci_key(alias_to_remove) + self._alias_keymap[self._aliases[ci_alias]].remove(ci_alias) + if not self._alias_keymap[self._aliases[ci_alias]]: # remove keymap if empty + del self._alias_keymap[self._aliases[ci_alias]] + del self._aliases[ci_alias] + + def __getitem__(self, key): + try: + return CaseInsensitiveDict.__getitem__(self, key) + except KeyError: + return CaseInsensitiveDict.__getitem__(self, self._aliases[self._ci_key(key)]) + + def copy(self): + new = CaseInsensitiveWithAliasDict(self._store) + new._aliases = self._aliases.copy() + new._alias_keymap = self._alias_keymap + return new diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/config.py b/python/user_packages/Python313/site-packages/ldap3/utils/config.py new file mode 100644 index 0000000000000000000000000000000000000000..8a356b78655a6a2f78e3e5fddea66092a80f1d85 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/config.py @@ -0,0 +1,299 @@ +""" +""" + +# Created on 2016.08.31 +# +# Author: Giovanni Cannata +# +# Copyright 2013 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from sys import stdin, getdefaultencoding + +from .. import ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, NO_ATTRIBUTES, SEQUENCE_TYPES +from ..core.exceptions import LDAPConfigurationParameterError + +# checks +_CLASSES_EXCLUDED_FROM_CHECK = ['subschema'] +_ATTRIBUTES_EXCLUDED_FROM_CHECK = [ALL_ATTRIBUTES, + ALL_OPERATIONAL_ATTRIBUTES, + NO_ATTRIBUTES, + 'ldapSyntaxes', + 'matchingRules', + 'matchingRuleUse', + 'dITContentRules', + 'dITStructureRules', + 'nameForms', + 'altServer', + 'namingContexts', + 'supportedControl', + 'supportedExtension', + 'supportedFeatures', + 'supportedCapabilities', + 'supportedLdapVersion', + 'supportedSASLMechanisms', + 'vendorName', + 'vendorVersion', + 'subschemaSubentry', + 'ACL'] +_UTF8_ENCODED_SYNTAXES = ['1.2.840.113556.1.4.904', # DN String [MICROSOFT] + '1.2.840.113556.1.4.1362', # String (Case) [MICROSOFT] + '1.3.6.1.4.1.1466.115.121.1.12', # DN String [RFC4517] + '1.3.6.1.4.1.1466.115.121.1.15', # Directory String [RFC4517] + '1.3.6.1.4.1.1466.115.121.1.41', # Postal Address) [RFC4517] + '1.3.6.1.4.1.1466.115.121.1.58', # Substring Assertion [RFC4517] + '2.16.840.1.113719.1.1.5.1.6', # Case Ignore List [NOVELL] + '2.16.840.1.113719.1.1.5.1.14', # Tagged String [NOVELL] + '2.16.840.1.113719.1.1.5.1.15', # Tagged Name and String [NOVELL] + '2.16.840.1.113719.1.1.5.1.23', # Tagged Name [NOVELL] + '2.16.840.1.113719.1.1.5.1.25'] # Typed Name [NOVELL] + +_UTF8_ENCODED_TYPES = [] + +_ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF = ['msds-memberOfTransitive', 'msds-memberTransitive', 'entryDN'] +_IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF = ['instanceType', 'nTSecurityDescriptor', 'objectCategory'] + +_CASE_INSENSITIVE_ATTRIBUTE_NAMES = True +_CASE_INSENSITIVE_SCHEMA_NAMES = True + +# abstraction layer +_ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX = 'OA_' + +# communication +_POOLING_LOOP_TIMEOUT = 10 # number of seconds to wait before restarting a cycle to find an active server in the pool +_RESPONSE_SLEEPTIME = 0.05 # seconds to wait while waiting for a response in asynchronous strategies +_RESPONSE_WAITING_TIMEOUT = 20 # waiting timeout for receiving a response in asynchronous strategies +_SOCKET_SIZE = 4096 # socket byte size +_CHECK_AVAILABILITY_TIMEOUT = 2.5 # default timeout for socket connect when checking availability +_RESET_AVAILABILITY_TIMEOUT = 5 # default timeout for resetting the availability status when checking candidate addresses +_RESTARTABLE_SLEEPTIME = 2 # time to wait in a restartable strategy before retrying the request +_RESTARTABLE_TRIES = 30 # number of times to retry in a restartable strategy before giving up. Set to True for unlimited retries +_REUSABLE_THREADED_POOL_SIZE = 5 +_REUSABLE_THREADED_LIFETIME = 3600 # 1 hour +_DEFAULT_THREADED_POOL_NAME = 'REUSABLE_DEFAULT_POOL' +_ADDRESS_INFO_REFRESH_TIME = 300 # seconds to wait before refreshing address info from dns +_ADDITIONAL_SERVER_ENCODINGS = ['latin-1', 'koi8-r'] # some broken LDAP implementation may have different encoding than those expected by RFCs +_ADDITIONAL_CLIENT_ENCODINGS = ['utf-8'] +_IGNORE_MALFORMED_SCHEMA = False # some flaky LDAP servers returns malformed schema. If True no expection is raised and schema is thrown away +_DEFAULT_SERVER_ENCODING = 'utf-8' # should always be utf-8 +_LDIF_LINE_LENGTH = 78 # as stated in RFC 2849 + +if stdin and hasattr(stdin, 'encoding') and stdin.encoding: + _DEFAULT_CLIENT_ENCODING = stdin.encoding +elif getdefaultencoding(): + _DEFAULT_CLIENT_ENCODING = getdefaultencoding() +else: + _DEFAULT_CLIENT_ENCODING = 'utf-8' + +PARAMETERS = ['CASE_INSENSITIVE_ATTRIBUTE_NAMES', + 'CASE_INSENSITIVE_SCHEMA_NAMES', + 'ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX', + 'POOLING_LOOP_TIMEOUT', + 'RESPONSE_SLEEPTIME', + 'RESPONSE_WAITING_TIMEOUT', + 'SOCKET_SIZE', + 'CHECK_AVAILABILITY_TIMEOUT', + 'RESTARTABLE_SLEEPTIME', + 'RESTARTABLE_TRIES', + 'REUSABLE_THREADED_POOL_SIZE', + 'REUSABLE_THREADED_LIFETIME', + 'DEFAULT_THREADED_POOL_NAME', + 'ADDRESS_INFO_REFRESH_TIME', + 'RESET_AVAILABILITY_TIMEOUT', + 'DEFAULT_CLIENT_ENCODING', + 'DEFAULT_SERVER_ENCODING', + 'CLASSES_EXCLUDED_FROM_CHECK', + 'ATTRIBUTES_EXCLUDED_FROM_CHECK', + 'UTF8_ENCODED_SYNTAXES', + 'UTF8_ENCODED_TYPES', + 'ADDITIONAL_SERVER_ENCODINGS', + 'ADDITIONAL_CLIENT_ENCODINGS', + 'IGNORE_MALFORMED_SCHEMA', + 'ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF', + 'IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF', + 'LDIF_LINE_LENGTH' + ] + + +def get_config_parameter(parameter): + if parameter == 'CASE_INSENSITIVE_ATTRIBUTE_NAMES': # Boolean + return _CASE_INSENSITIVE_ATTRIBUTE_NAMES + elif parameter == 'CASE_INSENSITIVE_SCHEMA_NAMES': # Boolean + return _CASE_INSENSITIVE_SCHEMA_NAMES + elif parameter == 'ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX': # String + return _ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX + elif parameter == 'POOLING_LOOP_TIMEOUT': # Integer + return _POOLING_LOOP_TIMEOUT + elif parameter == 'RESPONSE_SLEEPTIME': # Integer + return _RESPONSE_SLEEPTIME + elif parameter == 'RESPONSE_WAITING_TIMEOUT': # Integer + return _RESPONSE_WAITING_TIMEOUT + elif parameter == 'SOCKET_SIZE': # Integer + return _SOCKET_SIZE + elif parameter == 'CHECK_AVAILABILITY_TIMEOUT': # Integer + return _CHECK_AVAILABILITY_TIMEOUT + elif parameter == 'RESTARTABLE_SLEEPTIME': # Integer + return _RESTARTABLE_SLEEPTIME + elif parameter == 'RESTARTABLE_TRIES': # Integer + return _RESTARTABLE_TRIES + elif parameter == 'REUSABLE_THREADED_POOL_SIZE': # Integer + return _REUSABLE_THREADED_POOL_SIZE + elif parameter == 'REUSABLE_THREADED_LIFETIME': # Integer + return _REUSABLE_THREADED_LIFETIME + elif parameter == 'DEFAULT_THREADED_POOL_NAME': # String + return _DEFAULT_THREADED_POOL_NAME + elif parameter == 'ADDRESS_INFO_REFRESH_TIME': # Integer + return _ADDRESS_INFO_REFRESH_TIME + elif parameter == 'RESET_AVAILABILITY_TIMEOUT': # Integer + return _RESET_AVAILABILITY_TIMEOUT + elif parameter in ['DEFAULT_CLIENT_ENCODING', 'DEFAULT_ENCODING']: # String - DEFAULT_ENCODING for backward compatibility + return _DEFAULT_CLIENT_ENCODING + elif parameter == 'DEFAULT_SERVER_ENCODING': # String + return _DEFAULT_SERVER_ENCODING + elif parameter == 'CLASSES_EXCLUDED_FROM_CHECK': # Sequence + if isinstance(_CLASSES_EXCLUDED_FROM_CHECK, SEQUENCE_TYPES): + return _CLASSES_EXCLUDED_FROM_CHECK + else: + return [_CLASSES_EXCLUDED_FROM_CHECK] + elif parameter == 'ATTRIBUTES_EXCLUDED_FROM_CHECK': # Sequence + if isinstance(_ATTRIBUTES_EXCLUDED_FROM_CHECK, SEQUENCE_TYPES): + return _ATTRIBUTES_EXCLUDED_FROM_CHECK + else: + return [_ATTRIBUTES_EXCLUDED_FROM_CHECK] + elif parameter == 'UTF8_ENCODED_SYNTAXES': # Sequence + if isinstance(_UTF8_ENCODED_SYNTAXES, SEQUENCE_TYPES): + return _UTF8_ENCODED_SYNTAXES + else: + return [_UTF8_ENCODED_SYNTAXES] + elif parameter == 'UTF8_ENCODED_TYPES': # Sequence + if isinstance(_UTF8_ENCODED_TYPES, SEQUENCE_TYPES): + return _UTF8_ENCODED_TYPES + else: + return [_UTF8_ENCODED_TYPES] + elif parameter in ['ADDITIONAL_SERVER_ENCODINGS', 'ADDITIONAL_ENCODINGS']: # Sequence - ADDITIONAL_ENCODINGS for backward compatibility + if isinstance(_ADDITIONAL_SERVER_ENCODINGS, SEQUENCE_TYPES): + return _ADDITIONAL_SERVER_ENCODINGS + else: + return [_ADDITIONAL_SERVER_ENCODINGS] + elif parameter in ['ADDITIONAL_CLIENT_ENCODINGS']: # Sequence + if isinstance(_ADDITIONAL_CLIENT_ENCODINGS, SEQUENCE_TYPES): + return _ADDITIONAL_CLIENT_ENCODINGS + else: + return [_ADDITIONAL_CLIENT_ENCODINGS] + elif parameter == 'IGNORE_MALFORMED_SCHEMA': # Boolean + return _IGNORE_MALFORMED_SCHEMA + elif parameter == 'ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF': # Sequence + if isinstance(_ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF, SEQUENCE_TYPES): + return _ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF + else: + return [_ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF] + elif parameter == 'IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF': # Sequence + if isinstance(_IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF, SEQUENCE_TYPES): + return _IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF + else: + return [_IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF] + elif parameter == 'LDIF_LINE_LENGTH': # Integer + return _LDIF_LINE_LENGTH + + raise LDAPConfigurationParameterError('configuration parameter %s not valid' % parameter) + + +def set_config_parameter(parameter, value): + if parameter == 'CASE_INSENSITIVE_ATTRIBUTE_NAMES': + global _CASE_INSENSITIVE_ATTRIBUTE_NAMES + _CASE_INSENSITIVE_ATTRIBUTE_NAMES = value + elif parameter == 'CASE_INSENSITIVE_SCHEMA_NAMES': + global _CASE_INSENSITIVE_SCHEMA_NAMES + _CASE_INSENSITIVE_SCHEMA_NAMES = value + elif parameter == 'ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX': + global _ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX + _ABSTRACTION_OPERATIONAL_ATTRIBUTE_PREFIX = value + elif parameter == 'POOLING_LOOP_TIMEOUT': + global _POOLING_LOOP_TIMEOUT + _POOLING_LOOP_TIMEOUT = value + elif parameter == 'RESPONSE_SLEEPTIME': + global _RESPONSE_SLEEPTIME + _RESPONSE_SLEEPTIME = value + elif parameter == 'RESPONSE_WAITING_TIMEOUT': + global _RESPONSE_WAITING_TIMEOUT + _RESPONSE_WAITING_TIMEOUT = value + elif parameter == 'SOCKET_SIZE': + global _SOCKET_SIZE + _SOCKET_SIZE = value + elif parameter == 'CHECK_AVAILABILITY_TIMEOUT': + global _CHECK_AVAILABILITY_TIMEOUT + _CHECK_AVAILABILITY_TIMEOUT = value + elif parameter == 'RESTARTABLE_SLEEPTIME': + global _RESTARTABLE_SLEEPTIME + _RESTARTABLE_SLEEPTIME = value + elif parameter == 'RESTARTABLE_TRIES': + global _RESTARTABLE_TRIES + _RESTARTABLE_TRIES = value + elif parameter == 'REUSABLE_THREADED_POOL_SIZE': + global _REUSABLE_THREADED_POOL_SIZE + _REUSABLE_THREADED_POOL_SIZE = value + elif parameter == 'REUSABLE_THREADED_LIFETIME': + global _REUSABLE_THREADED_LIFETIME + _REUSABLE_THREADED_LIFETIME = value + elif parameter == 'DEFAULT_THREADED_POOL_NAME': + global _DEFAULT_THREADED_POOL_NAME + _DEFAULT_THREADED_POOL_NAME = value + elif parameter == 'ADDRESS_INFO_REFRESH_TIME': + global _ADDRESS_INFO_REFRESH_TIME + _ADDRESS_INFO_REFRESH_TIME = value + elif parameter == 'RESET_AVAILABILITY_TIMEOUT': + global _RESET_AVAILABILITY_TIMEOUT + _RESET_AVAILABILITY_TIMEOUT = value + elif parameter in ['DEFAULT_CLIENT_ENCODING', 'DEFAULT_ENCODING']: + global _DEFAULT_CLIENT_ENCODING + _DEFAULT_CLIENT_ENCODING = value + elif parameter == 'DEFAULT_SERVER_ENCODING': + global _DEFAULT_SERVER_ENCODING + _DEFAULT_SERVER_ENCODING = value + elif parameter == 'CLASSES_EXCLUDED_FROM_CHECK': + global _CLASSES_EXCLUDED_FROM_CHECK + _CLASSES_EXCLUDED_FROM_CHECK = value + elif parameter == 'ATTRIBUTES_EXCLUDED_FROM_CHECK': + global _ATTRIBUTES_EXCLUDED_FROM_CHECK + _ATTRIBUTES_EXCLUDED_FROM_CHECK = value + elif parameter == 'UTF8_ENCODED_SYNTAXES': + global _UTF8_ENCODED_SYNTAXES + _UTF8_ENCODED_SYNTAXES = value + elif parameter == 'UTF8_ENCODED_TYPES': + global _UTF8_ENCODED_TYPES + _UTF8_ENCODED_TYPES = value + elif parameter in ['ADDITIONAL_SERVER_ENCODINGS', 'ADDITIONAL_ENCODINGS']: + global _ADDITIONAL_SERVER_ENCODINGS + _ADDITIONAL_SERVER_ENCODINGS = value if isinstance(value, SEQUENCE_TYPES) else [value] + elif parameter in ['ADDITIONAL_CLIENT_ENCODINGS']: + global _ADDITIONAL_CLIENT_ENCODINGS + _ADDITIONAL_CLIENT_ENCODINGS = value if isinstance(value, SEQUENCE_TYPES) else [value] + elif parameter == 'IGNORE_MALFORMED_SCHEMA': + global _IGNORE_MALFORMED_SCHEMA + _IGNORE_MALFORMED_SCHEMA = value + elif parameter == 'ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF': + global _ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF + _ATTRIBUTES_EXCLUDED_FROM_OBJECT_DEF = value + elif parameter == 'IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF': + global _IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF + _IGNORED_MANDATORY_ATTRIBUTES_IN_OBJECT_DEF = value + elif parameter == 'LDIF_LINE_LENGTH': + global _LDIF_LINE_LENGTH + _LDIF_LINE_LENGTH = value + else: + raise LDAPConfigurationParameterError('unable to set configuration parameter %s' % parameter) diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/conv.py b/python/user_packages/Python313/site-packages/ldap3/utils/conv.py new file mode 100644 index 0000000000000000000000000000000000000000..514faadfae91bf09c18b5daf7560ff316f224af2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/conv.py @@ -0,0 +1,272 @@ +""" +""" + +# Created on 2014.04.26 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from base64 import b64encode, b64decode +import datetime +import re + +from .. import SEQUENCE_TYPES, STRING_TYPES, NUMERIC_TYPES, get_config_parameter +from ..utils.ciDict import CaseInsensitiveDict +from ..core.exceptions import LDAPDefinitionError + + +def to_unicode(obj, encoding=None, from_server=False): + """Try to convert bytes (and str in python2) to unicode. + Return object unmodified if python3 string, else raise an exception + """ + conf_default_client_encoding = get_config_parameter('DEFAULT_CLIENT_ENCODING') + conf_default_server_encoding = get_config_parameter('DEFAULT_SERVER_ENCODING') + conf_additional_server_encodings = get_config_parameter('ADDITIONAL_SERVER_ENCODINGS') + conf_additional_client_encodings = get_config_parameter('ADDITIONAL_CLIENT_ENCODINGS') + if isinstance(obj, NUMERIC_TYPES): + obj = str(obj) + + if isinstance(obj, (bytes, bytearray)): + if from_server: # data from server + if encoding is None: + encoding = conf_default_server_encoding + try: + return obj.decode(encoding) + except UnicodeDecodeError: + for encoding in conf_additional_server_encodings: # AD could have DN not encoded in utf-8 (even if this is not allowed by RFC4510) + try: + return obj.decode(encoding) + except UnicodeDecodeError: + pass + raise UnicodeError("Unable to convert server data to unicode: %r" % obj) + else: # data from client + if encoding is None: + encoding = conf_default_client_encoding + try: + return obj.decode(encoding) + except UnicodeDecodeError: + for encoding in conf_additional_client_encodings: # tries additional encodings + try: + return obj.decode(encoding) + except UnicodeDecodeError: + pass + raise UnicodeError("Unable to convert client data to unicode: %r" % obj) + + if isinstance(obj, STRING_TYPES): # python3 strings, python 2 unicode + return obj + + raise UnicodeError("Unable to convert type %s to unicode: %r" % (obj.__class__.__name__, obj)) + + +def to_raw(obj, encoding='utf-8'): + """Tries to convert to raw bytes from unicode""" + if isinstance(obj, NUMERIC_TYPES): + obj = str(obj) + + if not (isinstance(obj, bytes)): + if isinstance(obj, SEQUENCE_TYPES): + return [to_raw(element) for element in obj] + elif isinstance(obj, STRING_TYPES): + return obj.encode(encoding) + return obj + + +def escape_filter_chars(text, encoding=None): + """ Escape chars mentioned in RFC4515. """ + if encoding is None: + encoding = get_config_parameter('DEFAULT_ENCODING') + + try: + text = to_unicode(text, encoding) + escaped = text.replace('\\', '\\5c') + escaped = escaped.replace('*', '\\2a') + escaped = escaped.replace('(', '\\28') + escaped = escaped.replace(')', '\\29') + escaped = escaped.replace('\x00', '\\00') + except Exception: # probably raw bytes values, return escaped bytes value + escaped = to_unicode(escape_bytes(text)) + # escape all octets greater than 0x7F that are not part of a valid UTF-8 + # escaped = ''.join(c if c <= ord(b'\x7f') else escape_bytes(to_raw(to_unicode(c, encoding))) for c in escaped) + return escaped + + +def unescape_filter_chars(text, encoding=None): + """ unescape chars mentioned in RFC4515. """ + if encoding is None: + encoding = get_config_parameter('DEFAULT_ENCODING') + + unescaped = to_raw(text, encoding) + unescaped = unescaped.replace(b'\\5c', b'\\') + unescaped = unescaped.replace(b'\\5C', b'\\') + unescaped = unescaped.replace(b'\\2a', b'*') + unescaped = unescaped.replace(b'\\2A', b'*') + unescaped = unescaped.replace(b'\\28', b'(') + unescaped = unescaped.replace(b'\\29', b')') + unescaped = unescaped.replace(b'\\00', b'\x00') + return unescaped + + +def escape_bytes(bytes_value): + """ Convert a byte sequence to a properly escaped for LDAP (format BACKSLASH HEX HEX) string""" + if bytes_value: + if str is not bytes: # Python 3 + if isinstance(bytes_value, str): + bytes_value = bytearray(bytes_value, encoding='utf-8') + escaped = '\\'.join([('%02x' % int(b)) for b in bytes_value]) + else: # Python 2 + if isinstance(bytes_value, unicode): + bytes_value = bytes_value.encode('utf-8') + escaped = '\\'.join([('%02x' % ord(b)) for b in bytes_value]) + else: + escaped = '' + + return ('\\' + escaped) if escaped else '' + + +def prepare_for_stream(value): + if str is not bytes: # Python 3 + return value + else: # Python 2 + return value.decode() + + +def json_encode_b64(obj): + try: + return dict(encoding='base64', encoded=b64encode(obj)) + except Exception as e: + raise LDAPDefinitionError('unable to encode ' + str(obj) + ' - ' + str(e)) + + +# noinspection PyProtectedMember +def check_json_dict(json_dict): + # needed for python 2 + + for k, v in json_dict.items(): + if isinstance(v, dict): + check_json_dict(v) + elif isinstance(v, CaseInsensitiveDict): + check_json_dict(v._store) + elif isinstance(v, SEQUENCE_TYPES): + for i, e in enumerate(v): + if isinstance(e, dict): + check_json_dict(e) + elif isinstance(e, CaseInsensitiveDict): + check_json_dict(e._store) + else: + v[i] = format_json(e) + else: + json_dict[k] = format_json(v) + + +def json_hook(obj): + if hasattr(obj, 'keys') and len(list(obj.keys())) == 2 and 'encoding' in obj.keys() and 'encoded' in obj.keys(): + return b64decode(obj['encoded']) + + return obj + + +# noinspection PyProtectedMember +def format_json(obj, iso_format=False): + if isinstance(obj, CaseInsensitiveDict): + return obj._store + + if isinstance(obj, datetime.datetime): + return str(obj) + + if isinstance(obj, int): + return obj + + if isinstance(obj, datetime.timedelta): + if iso_format: + return obj.isoformat() + return str(obj) + + if str is bytes: # Python 2 + if isinstance(obj, long): # long exists only in python2 + return obj + + try: + if str is not bytes: # Python 3 + if isinstance(obj, bytes): + # return check_escape(str(obj, 'utf-8', errors='strict')) + return str(obj, 'utf-8', errors='strict') + raise LDAPDefinitionError('unable to serialize ' + str(obj)) + else: # Python 2 + if isinstance(obj, unicode): + return obj + else: + # return unicode(check_escape(obj)) + return unicode(obj) + except (TypeError, UnicodeDecodeError): + pass + + try: + return json_encode_b64(bytes(obj)) + except Exception: + pass + + raise LDAPDefinitionError('unable to serialize ' + str(obj)) + + +def is_filter_escaped(text): + if not type(text) == ((str is not bytes) and str or unicode): # requires str for Python 3 and unicode for Python 2 + raise ValueError('unicode input expected') + + return all(c not in text for c in '()*\0') and not re.search('\\\\([^0-9a-fA-F]|(.[^0-9a-fA-F]))', text) + + +def ldap_escape_to_bytes(text): + bytesequence = bytearray() + i = 0 + try: + if isinstance(text, STRING_TYPES): + while i < len(text): + if text[i] == '\\': + if len(text) > i + 2: + try: + bytesequence.append(int(text[i+1:i+3], 16)) + i += 3 + continue + except ValueError: + pass + bytesequence.append(92) # "\" ASCII code + else: + raw = to_raw(text[i]) + for c in raw: + bytesequence.append(c) + i += 1 + elif isinstance(text, (bytes, bytearray)): + while i < len(text): + if text[i] == 92: # "\" ASCII code + if len(text) > i + 2: + try: + bytesequence.append(int(text[i + 1:i + 3], 16)) + i += 3 + continue + except ValueError: + pass + bytesequence.append(92) # "\" ASCII code + else: + bytesequence.append(text[i]) + i += 1 + except Exception: + raise LDAPDefinitionError('badly formatted LDAP byte escaped sequence') + + return bytes(bytesequence) diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/dn.py b/python/user_packages/Python313/site-packages/ldap3/utils/dn.py new file mode 100644 index 0000000000000000000000000000000000000000..c2a1e66ade8fcb73eaa3b5f2bce020cd3046777b --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/dn.py @@ -0,0 +1,405 @@ +""" +""" + +# Created on 2014.09.08 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from string import hexdigits, ascii_letters, digits + +from .. import SEQUENCE_TYPES +from ..core.exceptions import LDAPInvalidDnError + + +STATE_ANY = 0 +STATE_ESCAPE = 1 +STATE_ESCAPE_HEX = 2 + + +def _add_ava(ava, decompose, remove_space, space_around_equal): + if not ava: + return '' + + space = ' ' if space_around_equal else '' + attr_name, _, value = ava.partition('=') + if decompose: + if remove_space: + component = (attr_name.strip(), value.strip()) + else: + component = (attr_name, value) + else: + if remove_space: + component = attr_name.strip() + space + '=' + space + value.strip() + else: + component = attr_name + space + '=' + space + value + + return component + + +def to_dn(iterator, decompose=False, remove_space=False, space_around_equal=False, separate_rdn=False): + """ + Convert an iterator to a list of dn parts + if decompose=True return a list of tuple (one for each dn component) else return a list of strings + if remove_space=True removes unneeded spaces + if space_around_equal=True add spaces around equal in returned strings + if separate_rdn=True consider multiple RDNs as different component of DN + """ + dn = [] + component = '' + escape_sequence = False + for c in iterator: + if c == '\\': # escape sequence + escape_sequence = True + elif escape_sequence and c != ' ': + escape_sequence = False + elif c == '+' and separate_rdn: + dn.append(_add_ava(component, decompose, remove_space, space_around_equal)) + component = '' + continue + elif c == ',': + if '=' in component: + dn.append(_add_ava(component, decompose, remove_space, space_around_equal)) + component = '' + continue + + component += c + + dn.append(_add_ava(component, decompose, remove_space, space_around_equal)) + return dn + + +def _find_first_unescaped(dn, char, pos): + while True: + pos = dn.find(char, pos) + if pos == -1: + break # no char found + if pos > 0 and dn[pos - 1] != '\\': # unescaped char + break + elif pos > 1 and dn[pos - 1] == '\\': # may be unescaped + escaped = True + for c in dn[pos - 2:0:-1]: + if c == '\\': + escaped = not escaped + else: + break + if not escaped: + break + pos += 1 + + return pos + + +def _find_last_unescaped(dn, char, start, stop=0): + while True: + stop = dn.rfind(char, start, stop) + if stop == -1: + break + if stop >= 0 and dn[stop - 1] != '\\': + break + elif stop > 1 and dn[stop - 1] == '\\': # may be unescaped + escaped = True + for c in dn[stop - 2:0:-1]: + if c == '\\': + escaped = not escaped + else: + break + if not escaped: + break + if stop < start: + stop = -1 + break + + return stop + + +def _get_next_ava(dn): + comma = _find_first_unescaped(dn, ',', 0) + plus = _find_first_unescaped(dn, '+', 0) + + if plus > 0 and (plus < comma or comma == -1): + equal = _find_first_unescaped(dn, '=', plus + 1) + if equal > plus + 1: + plus = _find_last_unescaped(dn, '+', plus, equal) + return dn[:plus], '+' + + if comma > 0: + equal = _find_first_unescaped(dn, '=', comma + 1) + if equal > comma + 1: + comma = _find_last_unescaped(dn, ',', comma, equal) + return dn[:comma], ',' + + return dn, '' + + +def _split_ava(ava, escape=False, strip=True): + equal = ava.find('=') + while equal > 0: # not first character + if ava[equal - 1] != '\\': # not an escaped equal so it must be an ava separator + # attribute_type1 = ava[0:equal].strip() if strip else ava[0:equal] + if strip: + attribute_type = ava[0:equal].strip() + attribute_value = _escape_attribute_value(ava[equal + 1:].strip()) if escape else ava[equal + 1:].strip() + else: + attribute_type = ava[0:equal] + attribute_value = _escape_attribute_value(ava[equal + 1:]) if escape else ava[equal + 1:] + + return attribute_type, attribute_value + equal = ava.find('=', equal + 1) + + return '', (ava.strip if strip else ava) # if no equal found return only value + + +def _validate_attribute_type(attribute_type): + if not attribute_type: + raise LDAPInvalidDnError('attribute type not present') + + if attribute_type == ' pairs') + if attribute_value[0] == ' ': # unescaped space cannot be used as leading or last character + raise LDAPInvalidDnError('SPACE must be escaped as leading character of attribute value') + if attribute_value.endswith(' ') and not attribute_value.endswith('\\ '): + raise LDAPInvalidDnError('SPACE must be escaped as trailing character of attribute value') + + state = STATE_ANY + for c in attribute_value: + if state == STATE_ANY: + if c == '\\': + state = STATE_ESCAPE + elif c in '"#+,;<=>\00': + raise LDAPInvalidDnError('special character ' + c + ' must be escaped') + elif state == STATE_ESCAPE: + if c in hexdigits: + state = STATE_ESCAPE_HEX + elif c in ' "#+,;<=>\\\00': + state = STATE_ANY + else: + raise LDAPInvalidDnError('invalid escaped character ' + c) + elif state == STATE_ESCAPE_HEX: + if c in hexdigits: + state = STATE_ANY + else: + raise LDAPInvalidDnError('invalid escaped character ' + c) + + # final state + if state != STATE_ANY: + raise LDAPInvalidDnError('invalid final character') + + return True + + +def _escape_attribute_value(attribute_value): + if not attribute_value: + return '' + + if attribute_value[0] == '#': # with leading SHARP only pairs of hex characters are valid + valid_hex = True + if len(attribute_value) % 2 == 0: # string must be # + HEX HEX (an odd number of chars) + valid_hex = False + + if valid_hex: + for c in attribute_value: + if c not in hexdigits: # allowed only hex digits as per RFC 4514 + valid_hex = False + break + + if valid_hex: + return attribute_value + + state = STATE_ANY + escaped = '' + tmp_buffer = '' + for c in attribute_value: + if state == STATE_ANY: + if c == '\\': + state = STATE_ESCAPE + elif c in '"#+,;<=>\00': + escaped += '\\' + c + else: + escaped += c + elif state == STATE_ESCAPE: + if c in hexdigits: + tmp_buffer = c + state = STATE_ESCAPE_HEX + elif c in ' "#+,;<=>\\\00': + escaped += '\\' + c + state = STATE_ANY + else: + escaped += '\\\\' + c + elif state == STATE_ESCAPE_HEX: + if c in hexdigits: + escaped += '\\' + tmp_buffer + c + else: + escaped += '\\\\' + tmp_buffer + c + tmp_buffer = '' + state = STATE_ANY + + # final state + if state == STATE_ESCAPE: + escaped += '\\\\' + elif state == STATE_ESCAPE_HEX: + escaped += '\\\\' + tmp_buffer + + if escaped[0] == ' ': # leading SPACE must be escaped + escaped = '\\' + escaped + + if escaped[-1] == ' ' and len(escaped) > 1 and escaped[-2] != '\\': # trailing SPACE must be escaped + escaped = escaped[:-1] + '\\ ' + + return escaped + + +def parse_dn(dn, escape=False, strip=False): + """ + Parses a DN into syntactic components + :param dn: + :param escape: + :param strip: + :return: + a list of tripels representing `attributeTypeAndValue` elements + containing `attributeType`, `attributeValue` and the following separator (`COMMA` or `PLUS`) if given, else an empty `str`. + in their original representation, still containing escapes or encoded as hex. + """ + rdns = [] + avas = [] + while dn: + ava, separator = _get_next_ava(dn) # if returned ava doesn't containg any unescaped equal it'a appended to last ava in avas + + dn = dn[len(ava) + 1:] + if _find_first_unescaped(ava, '=', 0) > 0 or len(avas) == 0: + avas.append((ava, separator)) + else: + avas[len(avas) - 1] = (avas[len(avas) - 1][0] + avas[len(avas) - 1][1] + ava, separator) + + for ava, separator in avas: + attribute_type, attribute_value = _split_ava(ava, escape, strip) + + if not _validate_attribute_type(attribute_type): + raise LDAPInvalidDnError('unable to validate attribute type in ' + ava) + + if not _validate_attribute_value(attribute_value): + raise LDAPInvalidDnError('unable to validate attribute value in ' + ava) + + rdns.append((attribute_type, attribute_value, separator)) + dn = dn[len(ava) + 1:] + + if not rdns: + raise LDAPInvalidDnError('empty dn') + + return rdns + + +def safe_dn(dn, decompose=False, reverse=False): + """ + normalize and escape a dn, if dn is a sequence it is joined. + the reverse parameter changes the join direction of the sequence + """ + if isinstance(dn, SEQUENCE_TYPES): + components = [rdn for rdn in dn] + if reverse: + dn = ','.join(reversed(components)) + else: + dn = ','.join(components) + if decompose: + escaped_dn = [] + else: + escaped_dn = '' + + if dn.startswith(''): # Active Directory allows looking up objects by putting its GUID in a specially-formatted DN (e.g. '') + escaped_dn = dn + elif dn.startswith(''): # Active Directory allows Binding to Well-Known Objects Using WKGUID in a specially-formatted DN (e.g. ) + escaped_dn = dn + elif dn.startswith(''): # Active Directory allows looking up objects by putting its security identifier (SID) in a specially-formatted DN (e.g. '') + escaped_dn = dn + elif '@' not in dn: # active directory UPN (User Principal Name) consist of an account, the at sign (@) and a domain, or the domain level logn name domain\username + for component in parse_dn(dn, escape=True): + if decompose: + escaped_dn.append((component[0], component[1], component[2])) + else: + escaped_dn += component[0] + '=' + component[1] + component[2] + elif '@' in dn and '=' not in dn and len(dn.split('@')) != 2: + raise LDAPInvalidDnError('Active Directory User Principal Name must consist of name@domain') + elif '\\' in dn and '=' not in dn and len(dn.split('\\')) != 2: + raise LDAPInvalidDnError('Active Directory Domain Level Logon Name must consist of name\\domain') + else: + escaped_dn = dn + + return escaped_dn + + +def safe_rdn(dn, decompose=False): + """Returns a list of rdn for the dn, usually there is only one rdn, but it can be more than one when the + sign is used""" + escaped_rdn = [] + one_more = True + for component in parse_dn(dn, escape=True): + if component[2] == '+' or one_more: + if decompose: + escaped_rdn.append((component[0], component[1])) + else: + escaped_rdn.append(component[0] + '=' + component[1]) + if component[2] == '+': + one_more = True + else: + one_more = False + break + + if one_more: + raise LDAPInvalidDnError('bad dn ' + str(dn)) + + return escaped_rdn + + +def escape_rdn(rdn): + """ + Escape rdn characters to prevent injection according to RFC 4514. + """ + + # '/' must be handled first or the escape slashes will be escaped! + for char in ['\\', ',', '+', '"', '<', '>', ';', '=', '\x00']: + rdn = rdn.replace(char, '\\' + char) + + if rdn[0] == '#' or rdn[0] == ' ': + rdn = ''.join(('\\', rdn)) + + if rdn[-1] == ' ': + rdn = ''.join((rdn[:-1], '\\ ')) + + return rdn diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/hashed.py b/python/user_packages/Python313/site-packages/ldap3/utils/hashed.py new file mode 100644 index 0000000000000000000000000000000000000000..e58d67dbe7df6940132079b1cf24decc204fc844 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/hashed.py @@ -0,0 +1,94 @@ +""" +""" + +# Created on 2015.07.16 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from .. import HASHED_NONE, HASHED_MD5, HASHED_SALTED_MD5, HASHED_SALTED_SHA, HASHED_SALTED_SHA256, \ + HASHED_SALTED_SHA384, HASHED_SALTED_SHA512, HASHED_SHA, HASHED_SHA256, HASHED_SHA384, HASHED_SHA512 + +import hashlib +from os import urandom +from base64 import b64encode + +from ..core.exceptions import LDAPInvalidHashAlgorithmError + +# each tuple: (the string to include between braces in the digest, the name of the algorithm to invoke with the new() function) + +algorithms_table = { + HASHED_MD5: ('md5', 'MD5'), + HASHED_SHA: ('sha', 'SHA1'), + HASHED_SHA256: ('sha256', 'SHA256'), + HASHED_SHA384: ('sha384', 'SHA384'), + HASHED_SHA512: ('sha512', 'SHA512') +} + + +salted_table = { + HASHED_SALTED_MD5: ('smd5', HASHED_MD5), + HASHED_SALTED_SHA: ('ssha', HASHED_SHA), + HASHED_SALTED_SHA256: ('ssha256', HASHED_SHA256), + HASHED_SALTED_SHA384: ('ssha384', HASHED_SHA384), + HASHED_SALTED_SHA512: ('ssha512', HASHED_SHA512) +} + + +def hashed(algorithm, value, salt=None, raw=False, encoding='utf-8'): + if str is not bytes and not isinstance(value, bytes): # Python 3 + value = value.encode(encoding) + + if algorithm is None or algorithm == HASHED_NONE: + return value + + # algorithm name can be already coded in the ldap3 constants or can be any value passed in the 'algorithm' parameter + + if algorithm in algorithms_table: + try: + digest = hashlib.new(algorithms_table[algorithm][1], value).digest() + except ValueError: + raise LDAPInvalidHashAlgorithmError('Hash algorithm ' + str(algorithm) + ' not available') + + if raw: + return digest + return ('{%s}' % algorithms_table[algorithm][0]) + b64encode(digest).decode('ascii') + elif algorithm in salted_table: + if not salt: + salt = urandom(8) + digest = hashed(salted_table[algorithm][1], value + salt, raw=True) + salt + if raw: + return digest + return ('{%s}' % salted_table[algorithm][0]) + b64encode(digest).decode('ascii') + else: + # if an unknown (to the library) algorithm is requested passes the name as the string in braces and as the algorithm name + # if salt is present uses it to salt the digest + try: + if not salt: + digest = hashlib.new(algorithm, value).digest() + else: + digest = hashlib.new(algorithm, value + salt).digest() + salt + except ValueError: + raise LDAPInvalidHashAlgorithmError('Hash algorithm ' + str(algorithm) + ' not available') + + if raw: + return digest + return ('{%s}' % algorithm) + b64encode(digest).decode('ascii') + diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/log.py b/python/user_packages/Python313/site-packages/ldap3/utils/log.py new file mode 100644 index 0000000000000000000000000000000000000000..d1cf4d54f1062354b88c93fc89251fff4d3ad30d --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/log.py @@ -0,0 +1,216 @@ +""" +""" + +# Created on 2015.05.01 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +from logging import getLogger, DEBUG +from copy import deepcopy +from pprint import pformat +from ..protocol.rfc4511 import LDAPMessage + +# logging levels +OFF = 0 +ERROR = 10 +BASIC = 20 +PROTOCOL = 30 +NETWORK = 40 +EXTENDED = 50 + +_sensitive_lines = ('simple', 'credentials', 'serversaslcreds') # must be a tuple, not a list, lowercase +_sensitive_args = ('simple', 'password', 'sasl_credentials', 'saslcreds', 'server_creds') +_sensitive_attrs = ('userpassword', 'unicodepwd') + +_hide_sensitive_data = None + +DETAIL_LEVELS = [OFF, ERROR, BASIC, PROTOCOL, NETWORK, EXTENDED] + +_max_line_length = 4096 +_logging_level = 0 +_detail_level = 0 +_logging_encoding = 'ascii' + +try: + from logging import NullHandler +except ImportError: # NullHandler not present in Python < 2.7 + from logging import Handler + + class NullHandler(Handler): + def handle(self, record): + pass + + def emit(self, record): + pass + + def createLock(self): + self.lock = None + + +def _strip_sensitive_data_from_dict(d): + if not isinstance(d, dict): + return d + + try: + d = deepcopy(d) + except Exception: # if deepcopy goes wrong gives up and returns the dict unchanged + return d + for k in d.keys(): + if isinstance(d[k], dict): + d[k] = _strip_sensitive_data_from_dict(d[k]) + elif k.lower() in _sensitive_args and d[k]: + d[k] = '' % len(d[k]) + + return d + + +def get_detail_level_name(level_name): + if level_name == OFF: + return 'OFF' + elif level_name == ERROR: + return 'ERROR' + elif level_name == BASIC: + return 'BASIC' + elif level_name == PROTOCOL: + return 'PROTOCOL' + elif level_name == NETWORK: + return 'NETWORK' + elif level_name == EXTENDED: + return 'EXTENDED' + raise ValueError('unknown detail level') + + +def log(detail, message, *args): + if detail <= _detail_level: + if _hide_sensitive_data: + args = tuple([_strip_sensitive_data_from_dict(arg) if isinstance(arg, dict) else arg for arg in args]) + + if str is not bytes: # Python 3 + encoded_message = (get_detail_level_name(detail) + ':' + message % args).encode(_logging_encoding, 'backslashreplace') + encoded_message = encoded_message.decode() + else: + try: + encoded_message = (get_detail_level_name(detail) + ':' + message % args).encode(_logging_encoding, 'replace') + except Exception: + encoded_message = (get_detail_level_name(detail) + ':' + message % args).decode(_logging_encoding, 'replace') + + if len(encoded_message) > _max_line_length: + logger.log(_logging_level, encoded_message[:_max_line_length] + ' ' % (len(encoded_message) - _max_line_length, )) + else: + logger.log(_logging_level, encoded_message) + + +def log_enabled(detail): + if detail <= _detail_level: + if logger.isEnabledFor(_logging_level): + return True + + return False + + +def set_library_log_hide_sensitive_data(hide=True): + global _hide_sensitive_data + if hide: + _hide_sensitive_data = True + else: + _hide_sensitive_data = False + if log_enabled(ERROR): + log(ERROR, 'hide sensitive data set to ' + str(_hide_sensitive_data)) + + +def get_library_log_hide_sensitive_data(): + return True if _hide_sensitive_data else False + + +def set_library_log_activation_level(logging_level): + if isinstance(logging_level, int): + global _logging_level + _logging_level = logging_level + else: + if log_enabled(ERROR): + log(ERROR, 'invalid library log activation level <%s> ', logging_level) + raise ValueError('invalid library log activation level') + + +def get_library_log_activation_lavel(): + return _logging_level + + +def set_library_log_max_line_length(length): + if isinstance(length, int): + global _max_line_length + _max_line_length = length + else: + if log_enabled(ERROR): + log(ERROR, 'invalid log max line length <%s> ', length) + raise ValueError('invalid library log max line length') + + +def get_library_log_max_line_length(): + return _max_line_length + + +def set_library_log_detail_level(detail): + if detail in DETAIL_LEVELS: + global _detail_level + _detail_level = detail + if log_enabled(ERROR): + log(ERROR, 'detail level set to ' + get_detail_level_name(_detail_level)) + else: + if log_enabled(ERROR): + log(ERROR, 'unable to set log detail level to <%s>', detail) + raise ValueError('invalid library log detail level') + + +def get_library_log_detail_level(): + return _detail_level + + +def format_ldap_message(message, prefix): + if isinstance(message, LDAPMessage): + try: # pyasn1 prettyprint raises exception in version 0.4.3 + formatted = message.prettyPrint().split('\n') # pyasn1 pretty print + except Exception as e: + formatted = ['pyasn1 exception', str(e)] + else: + formatted = pformat(message).split('\n') + + prefixed = '' + for line in formatted: + if line: + if _hide_sensitive_data and line.strip().lower().startswith(_sensitive_lines): # _sensitive_lines is a tuple. startswith() method checks each tuple element + tag, _, data = line.partition('=') + if data.startswith("b'") and data.endswith("'") or data.startswith('b"') and data.endswith('"'): + prefixed += '\n' + prefix + tag + '=' % (len(data) - 3, ) + else: + prefixed += '\n' + prefix + tag + '=' % len(data) + else: + prefixed += '\n' + prefix + line + return prefixed + +# sets a logger for the library with NullHandler. It can be used by the application with its own logging configuration +logger = getLogger('ldap3') +logger.addHandler(NullHandler()) + +# sets defaults for the library logging +set_library_log_activation_level(DEBUG) +set_library_log_detail_level(OFF) +set_library_log_hide_sensitive_data(True) diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/ntlm.py b/python/user_packages/Python313/site-packages/ldap3/utils/ntlm.py new file mode 100644 index 0000000000000000000000000000000000000000..5271669f043e0f69f3ff647be714a013a032259d --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/ntlm.py @@ -0,0 +1,505 @@ +""" +""" + +# Created on 2015.04.02 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +# NTLMv2 authentication as per [MS-NLMP] (https://msdn.microsoft.com/en-us/library/cc236621.aspx) + +from struct import pack, unpack +from platform import system, version +from socket import gethostname +from time import time +import hmac +import hashlib +import binascii +from os import urandom + +try: + from locale import getpreferredencoding + oem_encoding = getpreferredencoding() +except Exception: + oem_encoding = 'utf-8' + +from ..protocol.formatters.formatters import format_ad_timestamp + +NTLM_SIGNATURE = b'NTLMSSP\x00' +NTLM_MESSAGE_TYPE_NTLM_NEGOTIATE = 1 +NTLM_MESSAGE_TYPE_NTLM_CHALLENGE = 2 +NTLM_MESSAGE_TYPE_NTLM_AUTHENTICATE = 3 + +FLAG_NEGOTIATE_56 = 31 # W +FLAG_NEGOTIATE_KEY_EXCH = 30 # V +FLAG_NEGOTIATE_128 = 29 # U +FLAG_NEGOTIATE_VERSION = 25 # T +FLAG_NEGOTIATE_TARGET_INFO = 23 # S +FLAG_REQUEST_NOT_NT_SESSION_KEY = 22 # R +FLAG_NEGOTIATE_IDENTIFY = 20 # Q +FLAG_NEGOTIATE_EXTENDED_SESSIONSECURITY = 19 # P +FLAG_TARGET_TYPE_SERVER = 17 # O +FLAG_TARGET_TYPE_DOMAIN = 16 # N +FLAG_NEGOTIATE_ALWAYS_SIGN = 15 # M +FLAG_NEGOTIATE_OEM_WORKSTATION_SUPPLIED = 13 # L +FLAG_NEGOTIATE_OEM_DOMAIN_SUPPLIED = 12 # K +FLAG_NEGOTIATE_ANONYMOUS = 11 # J +FLAG_NEGOTIATE_NTLM = 9 # H +FLAG_NEGOTIATE_LM_KEY = 7 # G +FLAG_NEGOTIATE_DATAGRAM = 6 # F +FLAG_NEGOTIATE_SEAL = 5 # E +FLAG_NEGOTIATE_SIGN = 4 # D +FLAG_REQUEST_TARGET = 2 # C +FLAG_NEGOTIATE_OEM = 1 # B +FLAG_NEGOTIATE_UNICODE = 0 # A + +FLAG_TYPES = [FLAG_NEGOTIATE_56, + FLAG_NEGOTIATE_KEY_EXCH, + FLAG_NEGOTIATE_128, + FLAG_NEGOTIATE_VERSION, + FLAG_NEGOTIATE_TARGET_INFO, + FLAG_REQUEST_NOT_NT_SESSION_KEY, + FLAG_NEGOTIATE_IDENTIFY, + FLAG_NEGOTIATE_EXTENDED_SESSIONSECURITY, + FLAG_TARGET_TYPE_SERVER, + FLAG_TARGET_TYPE_DOMAIN, + FLAG_NEGOTIATE_ALWAYS_SIGN, + FLAG_NEGOTIATE_OEM_WORKSTATION_SUPPLIED, + FLAG_NEGOTIATE_OEM_DOMAIN_SUPPLIED, + FLAG_NEGOTIATE_ANONYMOUS, + FLAG_NEGOTIATE_NTLM, + FLAG_NEGOTIATE_LM_KEY, + FLAG_NEGOTIATE_DATAGRAM, + FLAG_NEGOTIATE_SEAL, + FLAG_NEGOTIATE_SIGN, + FLAG_REQUEST_TARGET, + FLAG_NEGOTIATE_OEM, + FLAG_NEGOTIATE_UNICODE] + +AV_END_OF_LIST = 0 +AV_NETBIOS_COMPUTER_NAME = 1 +AV_NETBIOS_DOMAIN_NAME = 2 +AV_DNS_COMPUTER_NAME = 3 +AV_DNS_DOMAIN_NAME = 4 +AV_DNS_TREE_NAME = 5 +AV_FLAGS = 6 +AV_TIMESTAMP = 7 +AV_SINGLE_HOST_DATA = 8 +AV_TARGET_NAME = 9 +AV_CHANNEL_BINDINGS = 10 + +AV_TYPES = [AV_END_OF_LIST, + AV_NETBIOS_COMPUTER_NAME, + AV_NETBIOS_DOMAIN_NAME, + AV_DNS_COMPUTER_NAME, + AV_DNS_DOMAIN_NAME, + AV_DNS_TREE_NAME, + AV_FLAGS, + AV_TIMESTAMP, + AV_SINGLE_HOST_DATA, + AV_TARGET_NAME, + AV_CHANNEL_BINDINGS] + +AV_FLAG_CONSTRAINED = 0 +AV_FLAG_INTEGRITY = 1 +AV_FLAG_TARGET_SPN_UNTRUSTED = 2 + +AV_FLAG_TYPES = [AV_FLAG_CONSTRAINED, + AV_FLAG_INTEGRITY, + AV_FLAG_TARGET_SPN_UNTRUSTED] + + +def pack_windows_version(debug=False): + if debug: + if system().lower() == 'windows': + try: + major_release, minor_release, build = version().split('.') + major_release = int(major_release) + minor_release = int(minor_release) + build = int(build) + except Exception: + major_release = 5 + minor_release = 1 + build = 2600 + else: + major_release = 5 + minor_release = 1 + build = 2600 + else: + major_release = 0 + minor_release = 0 + build = 0 + + return pack(' 1: + raise TypeError('expected at most 1 arguments, got %d' % len(args)) + try: + self.__end + except AttributeError: + self.clear() + self.update(*args, **kwds) + + def clear(self): + self.__end = end = [] + end += [None, end, end] # sentinel node for doubly linked list + self.__map = {} # key --> [key, prev, next] + dict.clear(self) + + def __setitem__(self, key, value): + if key not in self: + end = self.__end + curr = end[1] + curr[2] = end[1] = self.__map[key] = [key, curr, end] + dict.__setitem__(self, key, value) + + def __delitem__(self, key): + dict.__delitem__(self, key) + key, prev, next = self.__map.pop(key) + prev[2] = next + next[1] = prev + + def __iter__(self): + end = self.__end + curr = end[2] + while curr is not end: + yield curr[0] + curr = curr[2] + + def __reversed__(self): + end = self.__end + curr = end[1] + while curr is not end: + yield curr[0] + curr = curr[1] + + def popitem(self, last=True): + if not self: + raise KeyError('dictionary is empty') + if last: + key = reversed(self).next() + else: + key = iter(self).next() + value = self.pop(key) + return key, value + + def __reduce__(self): + items = [[k, self[k]] for k in self] + tmp = self.__map, self.__end + del self.__map, self.__end + inst_dict = vars(self).copy() + self.__map, self.__end = tmp + if inst_dict: + return (self.__class__, (items,), inst_dict) + return self.__class__, (items,) + + def keys(self): + return list(self) + + setdefault = DictMixin.setdefault + update = DictMixin.update + pop = DictMixin.pop + values = DictMixin.values + items = DictMixin.items + iterkeys = DictMixin.iterkeys + itervalues = DictMixin.itervalues + iteritems = DictMixin.iteritems + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, self.items()) + + def copy(self): + return self.__class__(self) + + @classmethod + def fromkeys(cls, iterable, value=None): + d = cls() + for key in iterable: + d[key] = value + return d + + def __eq__(self, other): + if isinstance(other, OrderedDict): + if len(self) != len(other): + return False + for p, q in zip(self.items(), other.items()): + if p != q: + return False + return True + return dict.__eq__(self, other) + + def __ne__(self, other): + return not self == other diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/port_validators.py b/python/user_packages/Python313/site-packages/ldap3/utils/port_validators.py new file mode 100644 index 0000000000000000000000000000000000000000..c46b752cfc042695a6814cff507feeee5a30febd --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/port_validators.py @@ -0,0 +1,37 @@ +""" Some helper functions for validation of ports and lists of ports. """ + + +def check_port(port): + """ Check if a port is valid. Return an error message indicating what is invalid if something isn't valid. """ + if isinstance(port, int): + if port not in range(0, 65535): + return 'Source port must in range from 0 to 65535' + else: + return 'Source port must be an integer' + return None + + +def check_port_and_port_list(port, port_list): + """ Take in a port and a port list and check that at most one is non-null. Additionally check that if either + is non-null, it is valid. + Return an error message indicating what is invalid if something isn't valid. + """ + if port is not None and port_list is not None: + return 'Cannot specify both a source port and a source port list' + elif port is not None: + if isinstance(port, int): + if port not in range(0, 65535): + return 'Source port must in range from 0 to 65535' + else: + return 'Source port must be an integer' + elif port_list is not None: + try: + _ = iter(port_list) + except TypeError: + return 'Source port list must be an iterable {}'.format(port_list) + + for candidate_port in port_list: + err = check_port(candidate_port) + if err: + return err + return None diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/repr.py b/python/user_packages/Python313/site-packages/ldap3/utils/repr.py new file mode 100644 index 0000000000000000000000000000000000000000..8ac9d0be27bfa32ac5628e6aad2bb5c226dbd02d --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/repr.py @@ -0,0 +1,51 @@ +""" +""" + +# Created on 2015.07.09 +# +# Author: Giovanni Cannata +# +# Copyright 2015 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +from binascii import hexlify + +from .. import STRING_TYPES + +try: + from sys import stdout + repr_encoding = stdout.encoding # get the encoding of the stdout for printing (repr) + if not repr_encoding: + repr_encoding = 'ascii' # default +except Exception: + repr_encoding = 'ascii' # default + + +def to_stdout_encoding(value): + if not isinstance(value, STRING_TYPES): + value = str(value) + + if str is bytes: # Python 2 + try: + return value.encode(repr_encoding, 'backslashreplace') + except UnicodeDecodeError: # Python 2.6 + return hexlify(value) + else: # Python 3 + try: + return value.encode(repr_encoding, errors='backslashreplace').decode(repr_encoding, errors='backslashreplace') + except UnicodeDecodeError: + return hexlify(value) diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/tls_backport.py b/python/user_packages/Python313/site-packages/ldap3/utils/tls_backport.py new file mode 100644 index 0000000000000000000000000000000000000000..252c1413626ea8dd8ea37149494ca967c6ebb906 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/tls_backport.py @@ -0,0 +1,133 @@ +""" +""" + +# Created on 2014.10.05 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . +import re +from ..utils.log import log, log_enabled, NETWORK + +try: + from backports.ssl_match_hostname import match_hostname, CertificateError +except ImportError: + class CertificateError(ValueError): # fix for Python 2, code from Python 3.5 standard library + pass + + + def _dnsname_match(dn, hostname, max_wildcards=1): + """Backported from Python 3.4.3 standard library + + Matching according to RFC 6125, section 6.4.3 + + http://tools.ietf.org/html/rfc6125#section-6.4.3 + """ + if log_enabled(NETWORK): + log(NETWORK, "matching dn %s with hostname %s", dn, hostname) + pats = [] + if not dn: + return False + + pieces = dn.split(r'.') + leftmost = pieces[0] + remainder = pieces[1:] + + wildcards = leftmost.count('*') + if wildcards > max_wildcards: + # Issue #17980: avoid denials of service by refusing more + # than one wildcard per fragment. A survey of established + # policy among SSL implementations showed it to be a + # reasonable choice. + raise CertificateError( + "too many wildcards in certificate DNS name: " + repr(dn)) + + # speed up common case w/o wildcards + if not wildcards: + return dn.lower() == hostname.lower() + + # RFC 6125, section 6.4.3, subitem 1. + # The client SHOULD NOT attempt to match a presented identifier in which + # the wildcard character comprises a label other than the left-most label. + if leftmost == '*': + # When '*' is a fragment by itself, it matches a non-empty dotless + # fragment. + pats.append('[^.]+') + elif leftmost.startswith('xn--') or hostname.startswith('xn--'): + # RFC 6125, section 6.4.3, subitem 3. + # The client SHOULD NOT attempt to match a presented identifier + # where the wildcard character is embedded within an A-label or + # U-label of an internationalized domain name. + pats.append(re.escape(leftmost)) + else: + # Otherwise, '*' matches any dotless string, e.g. www* + pats.append(re.escape(leftmost).replace(r'\*', '[^.]*')) + + # add the remaining fragments, ignore any wildcards + for frag in remainder: + pats.append(re.escape(frag)) + + pat = re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) + return pat.match(hostname) + + + def match_hostname(cert, hostname): + """Backported from Python 3.4.3 standard library. + + Verify that *cert* (in decoded format as returned by + SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 + rules are followed, but IP addresses are not accepted for *hostname*. + + CertificateError is raised on failure. On success, the function + returns nothing. + """ + + if not cert: + raise ValueError("empty or no certificate, match_hostname needs a " + "SSL socket or SSL context with either " + "CERT_OPTIONAL or CERT_REQUIRED") + dnsnames = [] + san = cert.get('subjectAltName', ()) + for key, value in san: + if key == 'DNS': + if _dnsname_match(value, hostname): + return + dnsnames.append(value) + if not dnsnames: + # The subject is only checked when there is no dNSName entry + # in subjectAltName + for sub in cert.get('subject', ()): + for key, value in sub: + # XXX according to RFC 2818, the most specific Common Name + # must be used. + if key == 'commonName': + if _dnsname_match(value, hostname): + return + dnsnames.append(value) + if len(dnsnames) > 1: + raise CertificateError("hostname %r " + "doesn't match either of %s" + % (hostname, ', '.join(map(repr, dnsnames)))) + elif len(dnsnames) == 1: + raise CertificateError("hostname %r " + "doesn't match %r" + % (hostname, dnsnames[0])) + else: + raise CertificateError("no appropriate commonName or " + "subjectAltName fields were found") diff --git a/python/user_packages/Python313/site-packages/ldap3/utils/uri.py b/python/user_packages/Python313/site-packages/ldap3/utils/uri.py new file mode 100644 index 0000000000000000000000000000000000000000..3e566744ab32e9691390fc4e07da88ea9c6777a4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/ldap3/utils/uri.py @@ -0,0 +1,118 @@ +""" +""" + +# Created on 2014.09.08 +# +# Author: Giovanni Cannata +# +# Copyright 2014 - 2020 Giovanni Cannata +# +# This file is part of ldap3. +# +# ldap3 is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ldap3 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with ldap3 in the COPYING and COPYING.LESSER files. +# If not, see . + +try: + from urllib.parse import unquote # Python3 +except ImportError: + from urllib import unquote # Python 2 + +from .. import SUBTREE, BASE, LEVEL + + +def parse_uri(uri): + """ + Decode LDAP URI as specified in RFC 4516 relaxing specifications + permitting 'ldaps' as scheme for ssl-ldap + """ + + # ldapurl = scheme COLON SLASH SLASH [host [COLON port]] + # [SLASH dn [QUESTION [attributes] + # [QUESTION [scope] [QUESTION [filter] + # [QUESTION extensions]]]]] + # ; and are defined + # ; in Sections 3.2.2 and 3.2.3 + # ; of [RFC3986]. + # ; is from Section 3 of + # ; [RFC4515], subject to the + # ; provisions of the + # ; "Percent-Encoding" section + # ; below. + # + # scheme = "ldap" / "ldaps" <== not RFC4516 compliant (original is 'scheme = "ldap"') + # dn = distinguishedName ; From Section 3 of [RFC4514], + # ; subject to the provisions of + # ; the "Percent-Encoding" + # ; section below. + # + # attributes = attrdesc *(COMMA attrdesc) + # attrdesc = selector *(COMMA selector) + # selector = attributeSelector ; From Section 4.5.1 of + # ; [RFC4511], subject to the + # ; provisions of the + # ; "Percent-Encoding" section + # ; below. + # + # scope = "base" / "one" / "sub" + # extensions = extension *(COMMA extension) + # extension = [EXCLAMATION] extype [EQUALS exvalue] + # extype = oid ; From section 1.4 of [RFC4512]. + # + # exvalue = LDAPString ; From section 4.1.2 of + # ; [RFC4511], subject to the + # ; provisions of the + # ; "Percent-Encoding" section + # ; below. + # + # EXCLAMATION = %x21 ; exclamation mark ("!") + # SLASH = %x2F ; forward slash ("/") + # COLON = %x3A ; colon (":") + # QUESTION = %x3F ; question mark ("?") + + uri_components = dict() + parts = unquote(uri).split('?') # encoding defaults to utf-8 in Python 3 + scheme, sep, remain = parts[0].partition('://') + if sep != '://' or scheme not in ['ldap', 'ldaps']: + return None + + address, _, uri_components['base'] = remain.partition('/') + + uri_components['ssl'] = True if scheme == 'ldaps' else False + uri_components['host'], sep, uri_components['port'] = address.partition(':') + if sep != ':': + if uri_components['ssl']: + uri_components['port'] = 636 + else: + uri_components['port'] = None + else: + if not uri_components['port'].isdigit() or not (0 < int(uri_components['port']) < 65536): + return None + else: + uri_components['port'] = int(uri_components['port']) + + uri_components['attributes'] = parts[1].split(',') if len(parts) > 1 and parts[1] else None + uri_components['scope'] = parts[2] if len(parts) > 2 else None + if uri_components['scope'] == 'base': + uri_components['scope'] = BASE + elif uri_components['scope'] == 'sub': + uri_components['scope'] = SUBTREE + elif uri_components['scope'] == 'one': + uri_components['scope'] = LEVEL + elif uri_components['scope']: + return None + + uri_components['filter'] = parts[3] if len(parts) > 3 else None + uri_components['extensions'] = parts[4].split(',') if len(parts) > 4 else None + + return uri_components diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c01c52a7133f91a553baf658bcf9d428f7679b0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_asyncio_loop.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_asyncio_loop.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22c8ddaa346b8bf029f0511a5a814f77187ec1d1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_asyncio_loop.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_better_exceptions.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_better_exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fdb93132b7750f723c8d0218142a62633b1dc51 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_better_exceptions.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_colorama.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_colorama.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4089765f83cc9b3fce13a9b312fbccef3a769401 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_colorama.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_colorizer.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_colorizer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3670a0fac2fee7b60fb0d2e697d3e50d13783f99 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_colorizer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_contextvars.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_contextvars.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97eab746d6e50cf250ea09818544e67d35f4be28 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_contextvars.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_ctime_functions.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_ctime_functions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1703bbb00996c0067b665a2312aef123d953ee6f Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_ctime_functions.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_datetime.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_datetime.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d84076edcf9f75d000d8a68472a385d221474179 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_datetime.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_defaults.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_defaults.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d8cc8c3dc80002d4a8308852365f6f109c260cd Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_defaults.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_error_interceptor.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_error_interceptor.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6982a09ccd7bc5855658c38f7bb208fc04446f58 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_error_interceptor.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_file_sink.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_file_sink.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d6f2318b4bb68d6dea0817023045dd3b2723d88 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_file_sink.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_filters.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_filters.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99b08ee49d1e85456c267e2ad52cfb9aefb8d141 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_filters.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_get_frame.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_get_frame.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62698457d8dc2f1ac0861aa47cf4f3d5ed41c9e8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_get_frame.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_handler.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_handler.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..056d3286273cc90d023dcadb8e718181a9bdafd5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_handler.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_locks_machinery.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_locks_machinery.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a31ba23f4f15f5545868ddd96ab7b5aac4e5bdb Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_locks_machinery.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_logger.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_logger.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..521ee57d42226fc2dba4ef097042a67d43f61749 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_logger.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_recattrs.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_recattrs.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af4881e750f33a10652b7727e5a345d7a52de585 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_recattrs.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_simple_sinks.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_simple_sinks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5878fe8a75e44bcd11c6e67caf9989f16f1980cf Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_simple_sinks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/loguru/__pycache__/_string_parsers.cpython-313.pyc b/python/user_packages/Python313/site-packages/loguru/__pycache__/_string_parsers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2715816f2aea633dbe971a4e0d2e21c3a285b3d2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/loguru/__pycache__/_string_parsers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a6d61d43bdd310b00ab679ac778393838ea7dc2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/_compat.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/_compat.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f99e0f018fa97a11e7deb425099088fb7fdfb0b4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/_compat.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/_punycode.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/_punycode.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29f6b2cf643371c584f046526c653b27be65f5ca Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/_punycode.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/main.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..593289ba08ca830efa34bf1e47ae47a19da72d63 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/main.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_block.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_block.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d92de7834c634ca572191548407384e0a516046e Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_block.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_core.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_core.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..184c653378c9125be5037d9db20002160d5681d1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_core.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_inline.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_inline.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9df5c2945855de0b25bde38b78b9318ac20a7ae Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/parser_inline.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/renderer.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/renderer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db6231da5d242e2d940879defcb5d62448aa6458 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/renderer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/ruler.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/ruler.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c39caf9a2188729aef2a7de89414603c8e152e6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/ruler.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/token.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/token.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..353daae199b7bd1c11433a10d5ffb62d6b512d08 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/token.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/tree.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/tree.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..90f39b8b12f096d89b407dda619e2fc8dba0b16e Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/tree.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/__pycache__/utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b19078e216ff19d44833ca6951674ba9027e4e90 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/__pycache__/utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/cli/__init__.py b/python/user_packages/Python313/site-packages/markdown_it/cli/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/markdown_it/cli/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/cli/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a5d01efc55daeb1ce6bba206d85cdbbf7444c93 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/cli/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/cli/__pycache__/parse.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/cli/__pycache__/parse.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a8c22018f25589d0ccc7e60093e98006a4fe395 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/cli/__pycache__/parse.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/cli/parse.py b/python/user_packages/Python313/site-packages/markdown_it/cli/parse.py new file mode 100644 index 0000000000000000000000000000000000000000..5de738b2da7e528e974e9c6be6de44ac74b3d66f --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/cli/parse.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python +""" +CLI interface to markdown-it-py + +Parse one or more markdown files, convert each to HTML, and print to stdout. +""" + +from __future__ import annotations + +import argparse +from collections.abc import Iterable, Sequence +import sys + +from markdown_it import __version__ +from markdown_it.main import MarkdownIt + +version_str = f"markdown-it-py [version {__version__}]" + + +def main(args: Sequence[str] | None = None) -> int: + namespace = parse_args(args) + if namespace.filenames: + convert(namespace.filenames) + elif namespace.stdin: + convert_stdin() + else: + interactive() + return 0 + + +def convert(filenames: Iterable[str]) -> None: + for filename in filenames: + convert_file(filename) + + +def convert_stdin() -> None: + """ + Parse a Markdown file and dump the output to stdout. + """ + try: + rendered = MarkdownIt().render(sys.stdin.read()) + print(rendered, end="") + except OSError: + sys.stderr.write("Cannot parse Markdown from the standard input.\n") + sys.exit(1) + + +def convert_file(filename: str) -> None: + """ + Parse a Markdown file and dump the output to stdout. + """ + try: + with open(filename, encoding="utf8", errors="ignore") as fin: + rendered = MarkdownIt().render(fin.read()) + print(rendered, end="") + except OSError: + sys.stderr.write(f'Cannot open file "{filename}".\n') + sys.exit(1) + + +def interactive() -> None: + """ + Parse user input, dump to stdout, rinse and repeat. + Python REPL style. + """ + print_heading() + contents = [] + more = False + while True: + try: + prompt, more = ("... ", True) if more else (">>> ", True) + contents.append(input(prompt) + "\n") + except EOFError: + print("\n" + MarkdownIt().render("\n".join(contents)), end="") + more = False + contents = [] + except KeyboardInterrupt: + print("\nExiting.") + break + + +def parse_args(args: Sequence[str] | None) -> argparse.Namespace: + """Parse input CLI arguments.""" + parser = argparse.ArgumentParser( + description="Parse one or more markdown files, " + "convert each to HTML, and print to stdout", + # NOTE: Remember to update README.md w/ the output of `markdown-it -h` + epilog=( + f""" +Interactive: + + $ markdown-it + markdown-it-py [version {__version__}] (interactive) + Type Ctrl-D to complete input, or Ctrl-C to exit. + >>> # Example + ... > markdown *input* + ... +

Example

+
+

markdown input

+
+ +Batch: + + $ markdown-it README.md README.footer.md > index.html +""" + ), + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument("-v", "--version", action="version", version=version_str) + parser.add_argument( + "--stdin", action="store_true", help="read Markdown from standard input" + ) + parser.add_argument( + "filenames", nargs="*", help="specify an optional list of files to convert" + ) + return parser.parse_args(args) + + +def print_heading() -> None: + print(f"{version_str} (interactive)") + print("Type Ctrl-D to complete input, or Ctrl-C to exit.") + + +if __name__ == "__main__": + exit_code = main(sys.argv[1:]) + sys.exit(exit_code) diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__init__.py b/python/user_packages/Python313/site-packages/markdown_it/common/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f593aa7c84dc9ab956d0c8931286a270191a0996 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/entities.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/entities.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2298b822e0116885e26deac5ccf033d8887f54e6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/entities.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/html_blocks.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/html_blocks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a5e5d086e15d8fdcb8efb0446d49cccccc11505 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/html_blocks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/html_re.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/html_re.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12afb45015bb545fcb033b98a4032362d46d4796 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/html_re.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/normalize_url.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/normalize_url.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abe38182b8889f7e87179b533d6e769a4cc7d422 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/normalize_url.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32bf5d0b3afb544f8c5ceea6fc9583552826e65a Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/common/__pycache__/utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/entities.py b/python/user_packages/Python313/site-packages/markdown_it/common/entities.py new file mode 100644 index 0000000000000000000000000000000000000000..14d08ec9546995f8eea3e9b83ea896f29ef020cb --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/common/entities.py @@ -0,0 +1,5 @@ +"""HTML5 entities map: { name -> characters }.""" + +import html.entities + +entities = {name.rstrip(";"): chars for name, chars in html.entities.html5.items()} diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/html_blocks.py b/python/user_packages/Python313/site-packages/markdown_it/common/html_blocks.py new file mode 100644 index 0000000000000000000000000000000000000000..8a3b0b7d5ab7bc174a3c96cbc8976816278a6c21 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/common/html_blocks.py @@ -0,0 +1,69 @@ +"""List of valid html blocks names, according to commonmark spec +http://jgm.github.io/CommonMark/spec.html#html-blocks +""" + +# see https://spec.commonmark.org/0.31.2/#html-blocks +block_names = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "search", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul", +] diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/html_re.py b/python/user_packages/Python313/site-packages/markdown_it/common/html_re.py new file mode 100644 index 0000000000000000000000000000000000000000..ab822c5fc487c5a494966604a1e89b57a06e0564 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/common/html_re.py @@ -0,0 +1,39 @@ +"""Regexps to match html elements""" + +import re + +attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*" + +unquoted = "[^\"'=<>`\\x00-\\x20]+" +single_quoted = "'[^']*'" +double_quoted = '"[^"]*"' + +attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")" + +attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)" + +open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>" + +close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>" +comment = "" +processing = "<[?][\\s\\S]*?[?]>" +declaration = "]*>" +cdata = "" + +HTML_TAG_RE = re.compile( + "^(?:" + + open_tag + + "|" + + close_tag + + "|" + + comment + + "|" + + processing + + "|" + + declaration + + "|" + + cdata + + ")" +) +HTML_OPEN_CLOSE_TAG_STR = "^(?:" + open_tag + "|" + close_tag + ")" +HTML_OPEN_CLOSE_TAG_RE = re.compile(HTML_OPEN_CLOSE_TAG_STR) diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/normalize_url.py b/python/user_packages/Python313/site-packages/markdown_it/common/normalize_url.py new file mode 100644 index 0000000000000000000000000000000000000000..92720b31621b0f6b4ac853179d886cb58e4e2f36 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/common/normalize_url.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Callable +from contextlib import suppress +import re +from urllib.parse import quote, unquote, urlparse, urlunparse # noqa: F401 + +import mdurl + +from .. import _punycode + +RECODE_HOSTNAME_FOR = ("http:", "https:", "mailto:") + + +def normalizeLink(url: str) -> str: + """Normalize destination URLs in links + + :: + + [label]: destination 'title' + ^^^^^^^^^^^ + """ + parsed = mdurl.parse(url, slashes_denote_host=True) + + # Encode hostnames in urls like: + # `http://host/`, `https://host/`, `mailto:user@host`, `//host/` + # + # We don't encode unknown schemas, because it's likely that we encode + # something we shouldn't (e.g. `skype:name` treated as `skype:host`) + # + if parsed.hostname and ( + not parsed.protocol or parsed.protocol in RECODE_HOSTNAME_FOR + ): + with suppress(Exception): + parsed = parsed._replace(hostname=_punycode.to_ascii(parsed.hostname)) + + return mdurl.encode(mdurl.format(parsed)) + + +def normalizeLinkText(url: str) -> str: + """Normalize autolink content + + :: + + + ~~~~~~~~~~~ + """ + parsed = mdurl.parse(url, slashes_denote_host=True) + + # Encode hostnames in urls like: + # `http://host/`, `https://host/`, `mailto:user@host`, `//host/` + # + # We don't encode unknown schemas, because it's likely that we encode + # something we shouldn't (e.g. `skype:name` treated as `skype:host`) + # + if parsed.hostname and ( + not parsed.protocol or parsed.protocol in RECODE_HOSTNAME_FOR + ): + with suppress(Exception): + parsed = parsed._replace(hostname=_punycode.to_unicode(parsed.hostname)) + + # add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 + return mdurl.decode(mdurl.format(parsed), mdurl.DECODE_DEFAULT_CHARS + "%") + + +BAD_PROTO_RE = re.compile(r"^(vbscript|javascript|file|data):") +GOOD_DATA_RE = re.compile(r"^data:image\/(gif|png|jpeg|webp);") + + +def validateLink(url: str, validator: Callable[[str], bool] | None = None) -> bool: + """Validate URL link is allowed in output. + + This validator can prohibit more than really needed to prevent XSS. + It's a tradeoff to keep code simple and to be secure by default. + + Note: url should be normalized at this point, and existing entities decoded. + """ + if validator is not None: + return validator(url) + url = url.strip().lower() + return bool(GOOD_DATA_RE.search(url)) if BAD_PROTO_RE.search(url) else True diff --git a/python/user_packages/Python313/site-packages/markdown_it/common/utils.py b/python/user_packages/Python313/site-packages/markdown_it/common/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..11bda644c260b714cf010ed44d2ed345de80314e --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/common/utils.py @@ -0,0 +1,313 @@ +"""Utilities for parsing source text""" + +from __future__ import annotations + +import re +from re import Match +from typing import TypeVar +import unicodedata + +from .entities import entities + + +def charCodeAt(src: str, pos: int) -> int | None: + """ + Returns the Unicode value of the character at the specified location. + + @param - index The zero-based index of the desired character. + If there is no character at the specified index, NaN is returned. + + This was added for compatibility with python + """ + try: + return ord(src[pos]) + except IndexError: + return None + + +def charStrAt(src: str, pos: int) -> str | None: + """ + Returns the Unicode value of the character at the specified location. + + @param - index The zero-based index of the desired character. + If there is no character at the specified index, NaN is returned. + + This was added for compatibility with python + """ + try: + return src[pos] + except IndexError: + return None + + +_ItemTV = TypeVar("_ItemTV") + + +def arrayReplaceAt( + src: list[_ItemTV], pos: int, newElements: list[_ItemTV] +) -> list[_ItemTV]: + """ + Remove element from array and put another array at those position. + Useful for some operations with tokens + """ + return src[:pos] + newElements + src[pos + 1 :] + + +def isValidEntityCode(c: int) -> bool: + # broken sequence + if c >= 0xD800 and c <= 0xDFFF: + return False + # never used + if c >= 0xFDD0 and c <= 0xFDEF: + return False + if ((c & 0xFFFF) == 0xFFFF) or ((c & 0xFFFF) == 0xFFFE): + return False + # control codes + if c >= 0x00 and c <= 0x08: + return False + if c == 0x0B: + return False + if c >= 0x0E and c <= 0x1F: + return False + if c >= 0x7F and c <= 0x9F: + return False + # out of range + return not (c > 0x10FFFF) + + +def fromCodePoint(c: int) -> str: + """Convert ordinal to unicode. + + Note, in the original Javascript two string characters were required, + for codepoints larger than `0xFFFF`. + But Python 3 can represent any unicode codepoint in one character. + """ + return chr(c) + + +# UNESCAPE_MD_RE = re.compile(r'\\([!"#$%&\'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])') +# ENTITY_RE_g = re.compile(r'&([a-z#][a-z0-9]{1,31})', re.IGNORECASE) +UNESCAPE_ALL_RE = re.compile( + r'\\([!"#$%&\'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])' + "|" + r"&([a-z#][a-z0-9]{1,31});", + re.IGNORECASE, +) +DIGITAL_ENTITY_BASE10_RE = re.compile(r"#([0-9]{1,8})") +DIGITAL_ENTITY_BASE16_RE = re.compile(r"#x([a-f0-9]{1,8})", re.IGNORECASE) + + +def replaceEntityPattern(match: str, name: str) -> str: + """Convert HTML entity patterns, + see https://spec.commonmark.org/0.30/#entity-references + """ + if name in entities: + return entities[name] + + code: None | int = None + if pat := DIGITAL_ENTITY_BASE10_RE.fullmatch(name): + code = int(pat.group(1), 10) + elif pat := DIGITAL_ENTITY_BASE16_RE.fullmatch(name): + code = int(pat.group(1), 16) + + if code is not None and isValidEntityCode(code): + return fromCodePoint(code) + + return match + + +def unescapeAll(string: str) -> str: + def replacer_func(match: Match[str]) -> str: + escaped = match.group(1) + if escaped: + return escaped + entity = match.group(2) + return replaceEntityPattern(match.group(), entity) + + if "\\" not in string and "&" not in string: + return string + return UNESCAPE_ALL_RE.sub(replacer_func, string) + + +ESCAPABLE = r"""\\!"#$%&'()*+,./:;<=>?@\[\]^`{}|_~-""" +ESCAPE_CHAR = re.compile(r"\\([" + ESCAPABLE + r"])") + + +def stripEscape(string: str) -> str: + """Strip escape \\ characters""" + return ESCAPE_CHAR.sub(r"\1", string) + + +def escapeHtml(raw: str) -> str: + """Replace special characters "&", "<", ">" and '"' to HTML-safe sequences.""" + # like html.escape, but without escaping single quotes + raw = raw.replace("&", "&") # Must be done first! + raw = raw.replace("<", "<") + raw = raw.replace(">", ">") + raw = raw.replace('"', """) + return raw + + +# ////////////////////////////////////////////////////////////////////////////// + +REGEXP_ESCAPE_RE = re.compile(r"[.?*+^$[\]\\(){}|-]") + + +def escapeRE(string: str) -> str: + string = REGEXP_ESCAPE_RE.sub("\\$&", string) + return string + + +# ////////////////////////////////////////////////////////////////////////////// + + +def isSpace(code: int | None) -> bool: + """Check if character code is a whitespace.""" + return code in (0x09, 0x20) + + +def isStrSpace(ch: str | None) -> bool: + """Check if character is a whitespace.""" + return ch in ("\t", " ") + + +MD_WHITESPACE = { + 0x09, # \t + 0x0A, # \n + 0x0B, # \v + 0x0C, # \f + 0x0D, # \r + 0x20, # space + 0xA0, + 0x1680, + 0x202F, + 0x205F, + 0x3000, +} + + +def isWhiteSpace(code: int) -> bool: + r"""Zs (unicode class) || [\t\f\v\r\n]""" + if code >= 0x2000 and code <= 0x200A: + return True + return code in MD_WHITESPACE + + +# ////////////////////////////////////////////////////////////////////////////// + + +def isPunctChar(ch: str) -> bool: + """Check if character is a punctuation character.""" + return unicodedata.category(ch).startswith(("P", "S")) + + +MD_ASCII_PUNCT = { + 0x21, # /* ! */ + 0x22, # /* " */ + 0x23, # /* # */ + 0x24, # /* $ */ + 0x25, # /* % */ + 0x26, # /* & */ + 0x27, # /* ' */ + 0x28, # /* ( */ + 0x29, # /* ) */ + 0x2A, # /* * */ + 0x2B, # /* + */ + 0x2C, # /* , */ + 0x2D, # /* - */ + 0x2E, # /* . */ + 0x2F, # /* / */ + 0x3A, # /* : */ + 0x3B, # /* ; */ + 0x3C, # /* < */ + 0x3D, # /* = */ + 0x3E, # /* > */ + 0x3F, # /* ? */ + 0x40, # /* @ */ + 0x5B, # /* [ */ + 0x5C, # /* \ */ + 0x5D, # /* ] */ + 0x5E, # /* ^ */ + 0x5F, # /* _ */ + 0x60, # /* ` */ + 0x7B, # /* { */ + 0x7C, # /* | */ + 0x7D, # /* } */ + 0x7E, # /* ~ */ +} + + +def isMdAsciiPunct(ch: int) -> bool: + """Markdown ASCII punctuation characters. + + :: + + !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~ + + See http://spec.commonmark.org/0.15/#ascii-punctuation-character + + Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. + + """ + return ch in MD_ASCII_PUNCT + + +def normalizeReference(string: str) -> str: + """Helper to unify [reference labels].""" + # Trim and collapse whitespace + # + string = re.sub(r"\s+", " ", string.strip()) + + # In node v10 'แบž'.toLowerCase() === 'แนพ', which is presumed to be a bug + # fixed in v12 (couldn't find any details). + # + # So treat this one as a special case + # (remove this when node v10 is no longer supported). + # + # if ('แบž'.toLowerCase() === 'แนพ') { + # str = str.replace(/แบž/g, 'รŸ') + # } + + # .toLowerCase().toUpperCase() should get rid of all differences + # between letter variants. + # + # Simple .toLowerCase() doesn't normalize 125 code points correctly, + # and .toUpperCase doesn't normalize 6 of them (list of exceptions: + # ฤฐ, ฯด, แบž, โ„ฆ, โ„ช, โ„ซ - those are already uppercased, but have differently + # uppercased versions). + # + # Here's an example showing how it happens. Lets take greek letter omega: + # uppercase U+0398 (ฮ˜), U+03f4 (ฯด) and lowercase U+03b8 (ฮธ), U+03d1 (ฯ‘) + # + # Unicode entries: + # 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8 + # 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 + # 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 + # 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8 + # + # Case-insensitive comparison should treat all of them as equivalent. + # + # But .toLowerCase() doesn't change ฯ‘ (it's already lowercase), + # and .toUpperCase() doesn't change ฯด (already uppercase). + # + # Applying first lower then upper case normalizes any character: + # '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' + # + # Note: this is equivalent to unicode case folding; unicode normalization + # is a different step that is not required here. + # + # Final result should be uppercased, because it's later stored in an object + # (this avoid a conflict with Object.prototype members, + # most notably, `__proto__`) + # + return string.lower().upper() + + +LINK_OPEN_RE = re.compile(r"^\s]", flags=re.IGNORECASE) +LINK_CLOSE_RE = re.compile(r"^", flags=re.IGNORECASE) + + +def isLinkOpen(string: str) -> bool: + return bool(LINK_OPEN_RE.search(string)) + + +def isLinkClose(string: str) -> bool: + return bool(LINK_CLOSE_RE.search(string)) diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/__init__.py b/python/user_packages/Python313/site-packages/markdown_it/helpers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4e2cd21b94b9ee9ecb0cac21da619233a5258b9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/helpers/__init__.py @@ -0,0 +1,6 @@ +"""Functions for parsing Links""" + +__all__ = ("parseLinkDestination", "parseLinkLabel", "parseLinkTitle") +from .parse_link_destination import parseLinkDestination +from .parse_link_label import parseLinkLabel +from .parse_link_title import parseLinkTitle diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98dcdf0f876bdce6ce3bd20632d4336fa0f76a84 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_destination.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_destination.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d3c994f8c87c22478ca964a273ee8b614b16d5e Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_destination.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_label.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_label.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c73677953a231e5541d6e1b20d4d5573796fa3e Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_label.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_title.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_title.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f9a1a50e525c4aad5326b55821b0bf46dba26eb Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/helpers/__pycache__/parse_link_title.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_destination.py b/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_destination.py new file mode 100644 index 0000000000000000000000000000000000000000..c98323c056e0103a12849671fbbac58dc76de4b4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_destination.py @@ -0,0 +1,83 @@ +""" +Parse link destination +""" + +from ..common.utils import charCodeAt, unescapeAll + + +class _Result: + __slots__ = ("ok", "pos", "str") + + def __init__(self) -> None: + self.ok = False + self.pos = 0 + self.str = "" + + +def parseLinkDestination(string: str, pos: int, maximum: int) -> _Result: + start = pos + result = _Result() + + if charCodeAt(string, pos) == 0x3C: # /* < */ + pos += 1 + while pos < maximum: + code = charCodeAt(string, pos) + if code == 0x0A: # /* \n */) + return result + if code == 0x3C: # / * < * / + return result + if code == 0x3E: # /* > */) { + result.pos = pos + 1 + result.str = unescapeAll(string[start + 1 : pos]) + result.ok = True + return result + + if code == 0x5C and pos + 1 < maximum: # \ + pos += 2 + continue + + pos += 1 + + # no closing '>' + return result + + # this should be ... } else { ... branch + + level = 0 + while pos < maximum: + code = charCodeAt(string, pos) + + if code is None or code == 0x20: + break + + # ascii control characters + if code < 0x20 or code == 0x7F: + break + + if code == 0x5C and pos + 1 < maximum: + if charCodeAt(string, pos + 1) == 0x20: + break + pos += 2 + continue + + if code == 0x28: # /* ( */) + level += 1 + if level > 32: + return result + + if code == 0x29: # /* ) */) + if level == 0: + break + level -= 1 + + pos += 1 + + if start == pos: + return result + if level != 0: + return result + + result.str = unescapeAll(string[start:pos]) + result.pos = pos + result.ok = True + return result diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_label.py b/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_label.py new file mode 100644 index 0000000000000000000000000000000000000000..c80da5a7ec54521281dac45b66977404f5384491 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_label.py @@ -0,0 +1,44 @@ +""" +Parse link label + +this function assumes that first character ("[") already matches +returns the end of the label + +""" + +from markdown_it.rules_inline import StateInline + + +def parseLinkLabel(state: StateInline, start: int, disableNested: bool = False) -> int: + labelEnd = -1 + oldPos = state.pos + found = False + + state.pos = start + 1 + level = 1 + + while state.pos < state.posMax: + marker = state.src[state.pos] + if marker == "]": + level -= 1 + if level == 0: + found = True + break + + prevPos = state.pos + state.md.inline.skipToken(state) + if marker == "[": + if prevPos == state.pos - 1: + # increase level if we find text `[`, + # which is not a part of any token + level += 1 + elif disableNested: + state.pos = oldPos + return -1 + if found: + labelEnd = state.pos + + # restore old state + state.pos = oldPos + + return labelEnd diff --git a/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_title.py b/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_title.py new file mode 100644 index 0000000000000000000000000000000000000000..a38ff0d98ac7feaba80fd67f3c8f0d0454dde47f --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/helpers/parse_link_title.py @@ -0,0 +1,75 @@ +"""Parse link title""" + +from ..common.utils import charCodeAt, unescapeAll + + +class _State: + __slots__ = ("can_continue", "marker", "ok", "pos", "str") + + def __init__(self) -> None: + self.ok = False + """if `true`, this is a valid link title""" + self.can_continue = False + """if `true`, this link can be continued on the next line""" + self.pos = 0 + """if `ok`, it's the position of the first character after the closing marker""" + self.str = "" + """if `ok`, it's the unescaped title""" + self.marker = 0 + """expected closing marker character code""" + + def __str__(self) -> str: + return self.str + + +def parseLinkTitle( + string: str, start: int, maximum: int, prev_state: _State | None = None +) -> _State: + """Parse link title within `str` in [start, max] range, + or continue previous parsing if `prev_state` is defined (equal to result of last execution). + """ + pos = start + state = _State() + + if prev_state is not None: + # this is a continuation of a previous parseLinkTitle call on the next line, + # used in reference links only + state.str = prev_state.str + state.marker = prev_state.marker + else: + if pos >= maximum: + return state + + marker = charCodeAt(string, pos) + + # /* " */ /* ' */ /* ( */ + if marker != 0x22 and marker != 0x27 and marker != 0x28: + return state + + start += 1 + pos += 1 + + # if opening marker is "(", switch it to closing marker ")" + if marker == 0x28: + marker = 0x29 + + state.marker = marker + + while pos < maximum: + code = charCodeAt(string, pos) + if code == state.marker: + state.pos = pos + 1 + state.str += unescapeAll(string[start:pos]) + state.ok = True + return state + elif code == 0x28 and state.marker == 0x29: # /* ( */ /* ) */ + return state + elif code == 0x5C and pos + 1 < maximum: # /* \ */ + pos += 1 + + pos += 1 + + # no closing marker found, but this link title may continue on the next line (for references) + state.can_continue = True + state.str += unescapeAll(string[start:pos]) + return state diff --git a/python/user_packages/Python313/site-packages/markdown_it/presets/__init__.py b/python/user_packages/Python313/site-packages/markdown_it/presets/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..43578148cee4dc544721e74c4bd5fed042f3e7fe --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/presets/__init__.py @@ -0,0 +1,48 @@ +__all__ = ("commonmark", "default", "gfm_like", "gfm_like2", "js_default", "zero") + +from ..utils import PresetType +from . import commonmark, default, zero + +js_default = default + + +class gfm_like: # noqa: N801 + """GitHub Flavoured Markdown (GFM) like. + + This adds the linkify, table and strikethrough components to CommmonMark. + + Note, it lacks task-list items and raw HTML filtering, + to meet the the full GFM specification + (see https://github.github.com/gfm/#autolinks-extension-). + """ + + @staticmethod + def make() -> PresetType: + config = commonmark.make() + config["components"]["core"]["rules"].append("linkify") + config["components"]["block"]["rules"].append("table") + config["components"]["inline"]["rules"].extend(["strikethrough", "linkify"]) + config["components"]["inline"]["rules2"].append("strikethrough") + config["options"]["linkify"] = True + config["options"]["html"] = True + return config + + +class gfm_like2: # noqa: N801 + """GitHub Flavoured Markdown (GFM) like, extended. + + Builds on ``gfm-like`` and additionally enables: + + - Task lists (``- [x] done``) + - Alerts (``> [!NOTE]``) + - Single-tilde strikethrough (``~text~`` in addition to ``~~text~~``) + """ + + @staticmethod + def make() -> PresetType: + config = gfm_like.make() + config["options"]["tasklists"] = True + config["options"]["tasklists_editable"] = False + config["options"]["alerts"] = True + config["options"]["strikethrough_single_tilde"] = True + return config diff --git a/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d57f9ea5997e4ed74b6fd545d621731ab567c59 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/commonmark.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/commonmark.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b879b61c5003e68bc2fd3b83e2c3888ae3a6a1c Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/commonmark.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/default.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/default.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f8322c059edc0d232a8c49aada62fc41071f267 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/default.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/zero.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/zero.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12732b01c7b11ceb1dc69bad08cf64c43213be4b Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/presets/__pycache__/zero.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/presets/commonmark.py b/python/user_packages/Python313/site-packages/markdown_it/presets/commonmark.py new file mode 100644 index 0000000000000000000000000000000000000000..ed0de0fe4dfbad9e3ab82477433805ea0b6650c6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/presets/commonmark.py @@ -0,0 +1,75 @@ +"""Commonmark default options. + +This differs to presets.default, +primarily in that it allows HTML and does not enable components: + +- block: table +- inline: strikethrough +""" + +from ..utils import PresetType + + +def make() -> PresetType: + return { + "options": { + "maxNesting": 20, # Internal protection, recursion limit + "html": True, # Enable HTML tags in source, + # this is just a shorthand for .enable(["html_inline", "html_block"]) + # used by the linkify rule: + "linkify": False, # autoconvert URL-like texts to links + # used by the replacements and smartquotes rules + # Enable some language-neutral replacements + quotes beautification + "typographer": False, + # used by the smartquotes rule: + # Double + single quotes replacement pairs, when typographer enabled, + # and smartquotes on. Could be either a String or an Array. + # + # For example, you can use 'ยซยปโ€žโ€œ' for Russian, 'โ€žโ€œโ€šโ€˜' for German, + # and ['ยซ\xA0', '\xA0ยป', 'โ€น\xA0', '\xA0โ€บ'] for French (including nbsp). + "quotes": "\u201c\u201d\u2018\u2019", # /* โ€œโ€โ€˜โ€™ */ + # Renderer specific; these options are used directly in the HTML renderer + "xhtmlOut": True, # Use '/' to close single tags (
) + "breaks": False, # Convert '\n' in paragraphs into
+ "langPrefix": "language-", # CSS language prefix for fenced blocks + # Highlighter function. Should return escaped HTML, + # or '' if the source string is not changed and should be escaped externally. + # If result starts with PresetType: + return { + "options": { + "maxNesting": 100, # Internal protection, recursion limit + "html": False, # Enable HTML tags in source + # this is just a shorthand for .disable(["html_inline", "html_block"]) + # used by the linkify rule: + "linkify": False, # autoconvert URL-like texts to links + # used by the replacements and smartquotes rules: + # Enable some language-neutral replacements + quotes beautification + "typographer": False, + # used by the smartquotes rule: + # Double + single quotes replacement pairs, when typographer enabled, + # and smartquotes on. Could be either a String or an Array. + # For example, you can use 'ยซยปโ€žโ€œ' for Russian, 'โ€žโ€œโ€šโ€˜' for German, + # and ['ยซ\xA0', '\xA0ยป', 'โ€น\xA0', '\xA0โ€บ'] for French (including nbsp). + "quotes": "\u201c\u201d\u2018\u2019", # /* โ€œโ€โ€˜โ€™ */ + # Renderer specific; these options are used directly in the HTML renderer + "xhtmlOut": False, # Use '/' to close single tags (
) + "breaks": False, # Convert '\n' in paragraphs into
+ "langPrefix": "language-", # CSS language prefix for fenced blocks + # Highlighter function. Should return escaped HTML, + # or '' if the source string is not changed and should be escaped externally. + # If result starts with PresetType: + return { + "options": { + "maxNesting": 20, # Internal protection, recursion limit + "html": False, # Enable HTML tags in source + # this is just a shorthand for .disable(["html_inline", "html_block"]) + # used by the linkify rule: + "linkify": False, # autoconvert URL-like texts to links + # used by the replacements and smartquotes rules: + # Enable some language-neutral replacements + quotes beautification + "typographer": False, + # used by the smartquotes rule: + # Double + single quotes replacement pairs, when typographer enabled, + # and smartquotes on. Could be either a String or an Array. + # For example, you can use 'ยซยปโ€žโ€œ' for Russian, 'โ€žโ€œโ€šโ€˜' for German, + # and ['ยซ\xA0', '\xA0ยป', 'โ€น\xA0', '\xA0โ€บ'] for French (including nbsp). + "quotes": "\u201c\u201d\u2018\u2019", # /* โ€œโ€โ€˜โ€™ */ + # Renderer specific; these options are used directly in the HTML renderer + "xhtmlOut": False, # Use '/' to close single tags (
) + "breaks": False, # Convert '\n' in paragraphs into
+ "langPrefix": "language-", # CSS language prefix for fenced blocks + # Highlighter function. Should return escaped HTML, + # or '' if the source string is not changed and should be escaped externally. + # If result starts with bool: + LOGGER.debug( + "entering blockquote: %s, %s, %s, %s", state, startLine, endLine, silent + ) + + oldLineMax = state.lineMax + pos = state.bMarks[startLine] + state.tShift[startLine] + max = state.eMarks[startLine] + + if state.is_code_block(startLine): + return False + + # check the block quote marker + try: + if state.src[pos] != ">": + return False + except IndexError: + return False + pos += 1 + + # we know that it's going to be a valid blockquote, + # so no point trying to find the end of it in silent mode + if silent: + return True + + # set offset past spaces and ">" + initial = offset = state.sCount[startLine] + 1 + + try: + second_char: str | None = state.src[pos] + except IndexError: + second_char = None + + # skip one optional space after '>' + if second_char == " ": + # ' > test ' + # ^ -- position start of line here: + pos += 1 + initial += 1 + offset += 1 + adjustTab = False + spaceAfterMarker = True + elif second_char == "\t": + spaceAfterMarker = True + + if (state.bsCount[startLine] + offset) % 4 == 3: + # ' >\t test ' + # ^ -- position start of line here (tab has width==1) + pos += 1 + initial += 1 + offset += 1 + adjustTab = False + else: + # ' >\t test ' + # ^ -- position start of line here + shift bsCount slightly + # to make extra space appear + adjustTab = True + + else: + spaceAfterMarker = False + + oldBMarks = [state.bMarks[startLine]] + state.bMarks[startLine] = pos + + while pos < max: + ch = state.src[pos] + + if isStrSpace(ch): + if ch == "\t": + offset += ( + 4 + - (offset + state.bsCount[startLine] + (1 if adjustTab else 0)) % 4 + ) + else: + offset += 1 + + else: + break + + pos += 1 + + oldBSCount = [state.bsCount[startLine]] + state.bsCount[startLine] = ( + state.sCount[startLine] + 1 + (1 if spaceAfterMarker else 0) + ) + + lastLineEmpty = pos >= max + + oldSCount = [state.sCount[startLine]] + state.sCount[startLine] = offset - initial + + oldTShift = [state.tShift[startLine]] + state.tShift[startLine] = pos - state.bMarks[startLine] + + terminatorRules = state.md.block.ruler.getRules("blockquote") + + oldParentType = state.parentType + state.parentType = "blockquote" + + # Search the end of the block + # + # Block ends with either: + # 1. an empty line outside: + # ``` + # > test + # + # ``` + # 2. an empty line inside: + # ``` + # > + # test + # ``` + # 3. another tag: + # ``` + # > test + # - - - + # ``` + + # for (nextLine = startLine + 1; nextLine < endLine; nextLine++) { + nextLine = startLine + 1 + while nextLine < endLine: + # check if it's outdented, i.e. it's inside list item and indented + # less than said list item: + # + # ``` + # 1. anything + # > current blockquote + # 2. checking this line + # ``` + isOutdented = state.sCount[nextLine] < state.blkIndent + + pos = state.bMarks[nextLine] + state.tShift[nextLine] + max = state.eMarks[nextLine] + + if pos >= max: + # Case 1: line is not inside the blockquote, and this line is empty. + break + + evaluatesTrue = state.src[pos] == ">" and not isOutdented + pos += 1 + if evaluatesTrue: + # This line is inside the blockquote. + + # set offset past spaces and ">" + initial = offset = state.sCount[nextLine] + 1 + + try: + next_char: str | None = state.src[pos] + except IndexError: + next_char = None + + # skip one optional space after '>' + if next_char == " ": + # ' > test ' + # ^ -- position start of line here: + pos += 1 + initial += 1 + offset += 1 + adjustTab = False + spaceAfterMarker = True + elif next_char == "\t": + spaceAfterMarker = True + + if (state.bsCount[nextLine] + offset) % 4 == 3: + # ' >\t test ' + # ^ -- position start of line here (tab has width==1) + pos += 1 + initial += 1 + offset += 1 + adjustTab = False + else: + # ' >\t test ' + # ^ -- position start of line here + shift bsCount slightly + # to make extra space appear + adjustTab = True + + else: + spaceAfterMarker = False + + oldBMarks.append(state.bMarks[nextLine]) + state.bMarks[nextLine] = pos + + while pos < max: + ch = state.src[pos] + + if isStrSpace(ch): + if ch == "\t": + offset += ( + 4 + - ( + offset + + state.bsCount[nextLine] + + (1 if adjustTab else 0) + ) + % 4 + ) + else: + offset += 1 + else: + break + + pos += 1 + + lastLineEmpty = pos >= max + + oldBSCount.append(state.bsCount[nextLine]) + state.bsCount[nextLine] = ( + state.sCount[nextLine] + 1 + (1 if spaceAfterMarker else 0) + ) + + oldSCount.append(state.sCount[nextLine]) + state.sCount[nextLine] = offset - initial + + oldTShift.append(state.tShift[nextLine]) + state.tShift[nextLine] = pos - state.bMarks[nextLine] + + nextLine += 1 + continue + + # Case 2: line is not inside the blockquote, and the last line was empty. + if lastLineEmpty: + break + + # Case 3: another tag found. + terminate = False + + for terminatorRule in terminatorRules: + if terminatorRule(state, nextLine, endLine, True): + terminate = True + break + + if terminate: + # Quirk to enforce "hard termination mode" for paragraphs; + # normally if you call `tokenize(state, startLine, nextLine)`, + # paragraphs will look below nextLine for paragraph continuation, + # but if blockquote is terminated by another tag, they shouldn't + state.lineMax = nextLine + + if state.blkIndent != 0: + # state.blkIndent was non-zero, we now set it to zero, + # so we need to re-calculate all offsets to appear as + # if indent wasn't changed + oldBMarks.append(state.bMarks[nextLine]) + oldBSCount.append(state.bsCount[nextLine]) + oldTShift.append(state.tShift[nextLine]) + oldSCount.append(state.sCount[nextLine]) + state.sCount[nextLine] -= state.blkIndent + + break + + oldBMarks.append(state.bMarks[nextLine]) + oldBSCount.append(state.bsCount[nextLine]) + oldTShift.append(state.tShift[nextLine]) + oldSCount.append(state.sCount[nextLine]) + + # A negative indentation means that this is a paragraph continuation + # + state.sCount[nextLine] = -1 + + nextLine += 1 + + oldIndent = state.blkIndent + state.blkIndent = 0 + + # Detect GitHub-style alert marker on the first content line. + # Note: `startLine` here refers to the first content line of the + # blockquote, after the `>` prefix has already been stripped by the + # blockquote parser above (bMarks/tShift adjusted to skip `> `). + alert_kind = None + if state.md.options.get("alerts", False) and nextLine > startLine: + alert_kind = _detect_alert(state, startLine) + + lines = [startLine, 0] + + if alert_kind is not None: + # Emit alert tokens instead of blockquote tokens + alert_lower = alert_kind.lower() + token = state.push("alert_open", "div", 1) + token.markup = ">" + token.attrSet("class", f"markdown-alert markdown-alert-{alert_lower}") + token.map = lines + token.info = alert_kind + token.meta = {"kind": alert_kind} + + # Emit a title paragraph:

Kind

+ token = state.push("alert_title_open", "p", 1) + token.attrSet("class", "markdown-alert-title") + title_token = state.push("inline", "", 0) + title_token.content = alert_kind.capitalize() + title_token.children = [] + token = state.push("alert_title_close", "p", -1) + + # Skip the marker line (startLine) and tokenize from startLine + 1. + contentStart = startLine + 1 + if contentStart < nextLine: + # tokenize() updates state.line to nextLine as part of its + # contract, consistent with the blockquote code path below. + state.md.block.tokenize(state, contentStart, nextLine) + else: + state.line = nextLine + + token = state.push("alert_close", "div", -1) + token.markup = ">" + else: + token = state.push("blockquote_open", "blockquote", 1) + token.markup = ">" + token.map = lines + + state.md.block.tokenize(state, startLine, nextLine) + + token = state.push("blockquote_close", "blockquote", -1) + token.markup = ">" + + state.lineMax = oldLineMax + state.parentType = oldParentType + # Update the opening token map for both alert and blockquote containers. + lines[1] = state.line + + # Restore original tShift; this might not be necessary since the parser + # has already been here, but just to make sure we can do that. + for i, item in enumerate(oldTShift): + state.bMarks[i + startLine] = oldBMarks[i] + state.tShift[i + startLine] = item + state.sCount[i + startLine] = oldSCount[i] + state.bsCount[i + startLine] = oldBSCount[i] + + state.blkIndent = oldIndent + + return True + + +_ALERT_TYPES = {"NOTE", "TIP", "IMPORTANT", "WARNING", "CAUTION"} + + +def _detect_alert(state: StateBlock, startLine: int) -> str | None: + """Detect ``[!TYPE]`` on *startLine* (after ``>`` prefix has been stripped). + + Returns the alert type string (e.g. ``"NOTE"``) or ``None``. + """ + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + src = state.src + + # Trim trailing whitespace + while maximum > pos and src[maximum - 1] in (" ", "\t"): + maximum -= 1 + + if maximum - pos < 4: + return None + if src[pos] != "[" or src[pos + 1] != "!": + return None + if src[maximum - 1] != "]": + return None + type_str = src[pos + 2 : maximum - 1].upper() + if type_str not in _ALERT_TYPES: + return None + return type_str diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/code.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/code.py new file mode 100644 index 0000000000000000000000000000000000000000..af8a41c8058b1a4887252469bdc6f20f085ad7d5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/code.py @@ -0,0 +1,36 @@ +"""Code block (4 spaces padded).""" + +import logging + +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def code(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug("entering code: %s, %s, %s, %s", state, startLine, endLine, silent) + + if not state.is_code_block(startLine): + return False + + last = nextLine = startLine + 1 + + while nextLine < endLine: + if state.isEmpty(nextLine): + nextLine += 1 + continue + + if state.is_code_block(nextLine): + nextLine += 1 + last = nextLine + continue + + break + + state.line = last + + token = state.push("code_block", "code", 0) + token.content = state.getLines(startLine, last, 4 + state.blkIndent, False) + "\n" + token.map = [startLine, state.line] + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/fence.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/fence.py new file mode 100644 index 0000000000000000000000000000000000000000..0d7e651eb06b73386ef447f2d19e2aa0042f97e5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/fence.py @@ -0,0 +1,146 @@ +# fences (``` lang, ~~~ lang) +from __future__ import annotations + +from collections.abc import Callable +import logging + +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def make_fence_rule( + *, + markers: tuple[str, ...] = ("~", "`"), + token_type: str = "fence", + exact_match: bool = False, + disallow_marker_in_info: tuple[str, ...] = ("`",), + min_markers: int = 3, +) -> Callable[[StateBlock, int, int, bool], bool]: + """Create a fence parsing rule with configurable options. + + :param markers: Tuple of single characters that can be used as fence markers. + :param token_type: The token type name to emit (e.g. "fence", "colon_fence"). + :param exact_match: If True, the closing fence must have exactly the same + number of marker characters as the opening fence (not "at least as many"). + This enables nesting of fences with different marker counts. + :param disallow_marker_in_info: Tuple of marker characters that are not allowed + to appear in the info string. The check only applies when the actual opening + marker is in this tuple (e.g. a tilde fence is unaffected by ``"`"`` being + listed). Per CommonMark, backtick fences cannot have backticks in the info + string. Use ``()`` to disable this restriction. + :param min_markers: Minimum number of marker characters to form a fence. + :return: A block rule function with signature + ``(state, startLine, endLine, silent) -> bool``. + """ + + closing_matcher: Callable[[int, int], bool] + if exact_match: + # closing code fence must have exactly the same number of markers as the opening one + closing_matcher = lambda opening_len, closing_len: closing_len == opening_len # noqa: E731 + else: + # closing code fence must be at least as long as the opening one + closing_matcher = lambda opening_len, closing_len: closing_len >= opening_len # noqa: E731 + + def _fence_rule( + state: StateBlock, startLine: int, endLine: int, silent: bool + ) -> bool: + LOGGER.debug( + "entering fence: %s, %s, %s, %s", state, startLine, endLine, silent + ) + + haveEndMarker = False + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + + if state.is_code_block(startLine): + return False + + if pos + min_markers > maximum: + return False + + marker = state.src[pos] + + if marker not in markers: + return False + + # scan marker length + mem = pos + pos = state.skipCharsStr(pos, marker) + + length = pos - mem + + if length < min_markers: + return False + + markup = state.src[mem:pos] + params = state.src[pos:maximum] + + if marker in disallow_marker_in_info and marker in params: + return False + + # Since start is found, we can report success here in validation mode + if silent: + return True + + # search end of block + nextLine = startLine + + while True: + nextLine += 1 + if nextLine >= endLine: + # unclosed block should be autoclosed by end of document. + # also block seems to be autoclosed by end of parent + break + + pos = mem = state.bMarks[nextLine] + state.tShift[nextLine] + maximum = state.eMarks[nextLine] + + if pos < maximum and state.sCount[nextLine] < state.blkIndent: + # non-empty line with negative indent should stop the list: + # - ``` + # test + break + + try: + if state.src[pos] != marker: + continue + except IndexError: + break + + if state.is_code_block(nextLine): + continue + + pos = state.skipCharsStr(pos, marker) + + if not closing_matcher(length, pos - mem): + continue + + # make sure tail has spaces only + pos = state.skipSpaces(pos) + + if pos < maximum: + continue + + haveEndMarker = True + # found! + break + + # If a fence has heading spaces, they should be removed from its inner block + length = state.sCount[startLine] + + state.line = nextLine + (1 if haveEndMarker else 0) + + token = state.push(token_type, "code", 0) + token.info = params + token.content = state.getLines(startLine + 1, nextLine, length, True) + token.markup = markup + token.map = [startLine, state.line] + + return True + + return _fence_rule + + +#: The default fence rule (backtick and tilde markers, CommonMark compliant). +fence = make_fence_rule() diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/heading.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/heading.py new file mode 100644 index 0000000000000000000000000000000000000000..afcf9ed458124e52b9b365a6c17440872ffa0975 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/heading.py @@ -0,0 +1,69 @@ +"""Atex heading (#, ##, ...)""" + +from __future__ import annotations + +import logging + +from ..common.utils import isStrSpace +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def heading(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug("entering heading: %s, %s, %s, %s", state, startLine, endLine, silent) + + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + + if state.is_code_block(startLine): + return False + + ch: str | None = state.src[pos] + + if ch != "#" or pos >= maximum: + return False + + # count heading level + level = 1 + pos += 1 + try: + ch = state.src[pos] + except IndexError: + ch = None + while ch == "#" and pos < maximum and level <= 6: + level += 1 + pos += 1 + try: + ch = state.src[pos] + except IndexError: + ch = None + + if level > 6 or (pos < maximum and not isStrSpace(ch)): + return False + + if silent: + return True + + # Let's cut tails like ' ### ' from the end of string + + maximum = state.skipSpacesBack(maximum, pos) + tmp = state.skipCharsStrBack(maximum, "#", pos) + if tmp > pos and isStrSpace(state.src[tmp - 1]): + maximum = tmp + + state.line = startLine + 1 + + token = state.push("heading_open", "h" + str(level), 1) + token.markup = "########"[:level] + token.map = [startLine, state.line] + + token = state.push("inline", "", 0) + token.content = state.src[pos:maximum].strip() + token.map = [startLine, state.line] + token.children = [] + + token = state.push("heading_close", "h" + str(level), -1) + token.markup = "########"[:level] + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/hr.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/hr.py new file mode 100644 index 0000000000000000000000000000000000000000..fca7d79d2780a5e656e689ac4843b8464b4ab5bd --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/hr.py @@ -0,0 +1,56 @@ +"""Horizontal rule + +At least 3 of these characters on a line * - _ +""" + +import logging + +from ..common.utils import isStrSpace +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def hr(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug("entering hr: %s, %s, %s, %s", state, startLine, endLine, silent) + + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + + if state.is_code_block(startLine): + return False + + try: + marker = state.src[pos] + except IndexError: + return False + pos += 1 + + # Check hr marker + if marker not in ("*", "-", "_"): + return False + + # markers can be mixed with spaces, but there should be at least 3 of them + + cnt = 1 + while pos < maximum: + ch = state.src[pos] + pos += 1 + if ch != marker and not isStrSpace(ch): + return False + if ch == marker: + cnt += 1 + + if cnt < 3: + return False + + if silent: + return True + + state.line = startLine + 1 + + token = state.push("hr", "hr", 0) + token.map = [startLine, state.line] + token.markup = marker * (cnt + 1) + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/html_block.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/html_block.py new file mode 100644 index 0000000000000000000000000000000000000000..3d43f6ee1deb527a42f4d99da40bd052d9b02886 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/html_block.py @@ -0,0 +1,90 @@ +# HTML block +from __future__ import annotations + +import logging +import re + +from ..common.html_blocks import block_names +from ..common.html_re import HTML_OPEN_CLOSE_TAG_STR +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + +# An array of opening and corresponding closing sequences for html tags, +# last argument defines whether it can terminate a paragraph or not +HTML_SEQUENCES: list[tuple[re.Pattern[str], re.Pattern[str], bool]] = [ + ( + re.compile(r"^<(script|pre|style|textarea)(?=(\s|>|$))", re.IGNORECASE), + re.compile(r"<\/(script|pre|style|textarea)>", re.IGNORECASE), + True, + ), + (re.compile(r"^"), True), + (re.compile(r"^<\?"), re.compile(r"\?>"), True), + (re.compile(r"^"), True), + (re.compile(r"^"), True), + ( + re.compile("^|$))", re.IGNORECASE), + re.compile(r"^$"), + True, + ), + (re.compile(HTML_OPEN_CLOSE_TAG_STR + "\\s*$"), re.compile(r"^$"), False), +] + + +def html_block(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug( + "entering html_block: %s, %s, %s, %s", state, startLine, endLine, silent + ) + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + + if state.is_code_block(startLine): + return False + + if not state.md.options.get("html", None): + return False + + if state.src[pos] != "<": + return False + + lineText = state.src[pos:maximum] + + html_seq = None + for HTML_SEQUENCE in HTML_SEQUENCES: + if HTML_SEQUENCE[0].search(lineText): + html_seq = HTML_SEQUENCE + break + + if not html_seq: + return False + + if silent: + # true if this sequence can be a terminator, false otherwise + return html_seq[2] + + nextLine = startLine + 1 + + # If we are here - we detected HTML block. + # Let's roll down till block end. + if not html_seq[1].search(lineText): + while nextLine < endLine: + if state.sCount[nextLine] < state.blkIndent: + break + + pos = state.bMarks[nextLine] + state.tShift[nextLine] + maximum = state.eMarks[nextLine] + lineText = state.src[pos:maximum] + + if html_seq[1].search(lineText): + if len(lineText) != 0: + nextLine += 1 + break + nextLine += 1 + + state.line = nextLine + + token = state.push("html_block", "", 0) + token.map = [startLine, nextLine] + token.content = state.getLines(startLine, nextLine, state.blkIndent, True) + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/lheading.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/lheading.py new file mode 100644 index 0000000000000000000000000000000000000000..3522207abb680510decdd6c54d0be81401128ad7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/lheading.py @@ -0,0 +1,86 @@ +# lheading (---, ==) +import logging + +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def lheading(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug("entering lheading: %s, %s, %s, %s", state, startLine, endLine, silent) + + level = None + nextLine = startLine + 1 + ruler = state.md.block.ruler + terminatorRules = ruler.getRules("paragraph") + + if state.is_code_block(startLine): + return False + + oldParentType = state.parentType + state.parentType = "paragraph" # use paragraph to match terminatorRules + + # jump line-by-line until empty one or EOF + while nextLine < endLine and not state.isEmpty(nextLine): + # this would be a code block normally, but after paragraph + # it's considered a lazy continuation regardless of what's there + if state.sCount[nextLine] - state.blkIndent > 3: + nextLine += 1 + continue + + # Check for underline in setext header + if state.sCount[nextLine] >= state.blkIndent: + pos = state.bMarks[nextLine] + state.tShift[nextLine] + maximum = state.eMarks[nextLine] + + if pos < maximum: + marker = state.src[pos] + + if marker in ("-", "="): + pos = state.skipCharsStr(pos, marker) + pos = state.skipSpaces(pos) + + # /* = */ + if pos >= maximum: + level = 1 if marker == "=" else 2 + break + + # quirk for blockquotes, this line should already be checked by that rule + if state.sCount[nextLine] < 0: + nextLine += 1 + continue + + # Some tags can terminate paragraph without empty line. + terminate = False + for terminatorRule in terminatorRules: + if terminatorRule(state, nextLine, endLine, True): + terminate = True + break + if terminate: + break + + nextLine += 1 + + if not level: + # Didn't find valid underline + return False + + content = state.getLines(startLine, nextLine, state.blkIndent, False).strip() + + state.line = nextLine + 1 + + token = state.push("heading_open", "h" + str(level), 1) + token.markup = marker + token.map = [startLine, state.line] + + token = state.push("inline", "", 0) + token.content = content + token.map = [startLine, state.line - 1] + token.children = [] + + token = state.push("heading_close", "h" + str(level), -1) + token.markup = marker + + state.parentType = oldParentType + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/list.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/list.py new file mode 100644 index 0000000000000000000000000000000000000000..c8fe7af5d5d0a2a1aedb59c09c01a2f8d49b1eea --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/list.py @@ -0,0 +1,408 @@ +# Lists +import logging + +from ..common.utils import isStrSpace +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +# Search `[-+*][\n ]`, returns next pos after marker on success +# or -1 on fail. +def skipBulletListMarker(state: StateBlock, startLine: int) -> int: + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + + try: + marker = state.src[pos] + except IndexError: + return -1 + pos += 1 + + if marker not in ("*", "-", "+"): + return -1 + + if pos < maximum: + ch = state.src[pos] + + if not isStrSpace(ch): + # " -test " - is not a list item + return -1 + + return pos + + +# Search `\d+[.)][\n ]`, returns next pos after marker on success +# or -1 on fail. +def skipOrderedListMarker(state: StateBlock, startLine: int) -> int: + start = state.bMarks[startLine] + state.tShift[startLine] + pos = start + maximum = state.eMarks[startLine] + + # List marker should have at least 2 chars (digit + dot) + if pos + 1 >= maximum: + return -1 + + ch = state.src[pos] + pos += 1 + + ch_ord = ord(ch) + # /* 0 */ /* 9 */ + if ch_ord < 0x30 or ch_ord > 0x39: + return -1 + + while True: + # EOL -> fail + if pos >= maximum: + return -1 + + ch = state.src[pos] + pos += 1 + + # /* 0 */ /* 9 */ + ch_ord = ord(ch) + if ch_ord >= 0x30 and ch_ord <= 0x39: + # List marker should have no more than 9 digits + # (prevents integer overflow in browsers) + if pos - start >= 10: + return -1 + + continue + + # found valid marker + if ch in (")", "."): + break + + return -1 + + if pos < maximum: + ch = state.src[pos] + + if not isStrSpace(ch): + # " 1.test " - is not a list item + return -1 + + return pos + + +def markTightParagraphs(state: StateBlock, idx: int) -> None: + level = state.level + 2 + + i = idx + 2 + length = len(state.tokens) - 2 + while i < length: + if state.tokens[i].level == level and state.tokens[i].type == "paragraph_open": + state.tokens[i + 2].hidden = True + state.tokens[i].hidden = True + i += 2 + i += 1 + + +def list_block(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug("entering list: %s, %s, %s, %s", state, startLine, endLine, silent) + + isTerminatingParagraph = False + tight = True + + if state.is_code_block(startLine): + return False + + # Special case: + # - item 1 + # - item 2 + # - item 3 + # - item 4 + # - this one is a paragraph continuation + if ( + state.listIndent >= 0 + and state.sCount[startLine] - state.listIndent >= 4 + and state.sCount[startLine] < state.blkIndent + ): + return False + + # limit conditions when list can interrupt + # a paragraph (validation mode only) + # Next list item should still terminate previous list item + # + # This code can fail if plugins use blkIndent as well as lists, + # but I hope the spec gets fixed long before that happens. + # + if ( + silent + and state.parentType == "paragraph" + and state.sCount[startLine] >= state.blkIndent + ): + isTerminatingParagraph = True + + # Detect list type and position after marker + posAfterMarker = skipOrderedListMarker(state, startLine) + if posAfterMarker >= 0: + isOrdered = True + start = state.bMarks[startLine] + state.tShift[startLine] + markerValue = int(state.src[start : posAfterMarker - 1]) + + # If we're starting a new ordered list right after + # a paragraph, it should start with 1. + if isTerminatingParagraph and markerValue != 1: + return False + else: + posAfterMarker = skipBulletListMarker(state, startLine) + if posAfterMarker >= 0: + isOrdered = False + else: + return False + + # If we're starting a new unordered list right after + # a paragraph, first line should not be empty. + if ( + isTerminatingParagraph + and state.skipSpaces(posAfterMarker) >= state.eMarks[startLine] + ): + return False + + # We should terminate list on style change. Remember first one to compare. + markerChar = state.src[posAfterMarker - 1] + + # For validation mode we can terminate immediately + if silent: + return True + + # Start list + listTokIdx = len(state.tokens) + + if isOrdered: + token = state.push("ordered_list_open", "ol", 1) + if markerValue != 1: + token.attrs = {"start": markerValue} + + else: + token = state.push("bullet_list_open", "ul", 1) + + token.map = listLines = [startLine, 0] + token.markup = markerChar + + # + # Iterate list items + # + + nextLine = startLine + prevEmptyEnd = False + terminatorRules = state.md.block.ruler.getRules("list") + + oldParentType = state.parentType + state.parentType = "list" + + while nextLine < endLine: + pos = posAfterMarker + maximum = state.eMarks[nextLine] + + initial = offset = ( + state.sCount[nextLine] + + posAfterMarker + - (state.bMarks[startLine] + state.tShift[startLine]) + ) + + while pos < maximum: + ch = state.src[pos] + + if ch == "\t": + offset += 4 - (offset + state.bsCount[nextLine]) % 4 + elif ch == " ": + offset += 1 + else: + break + + pos += 1 + + contentStart = pos + + # trimming space in "- \n 3" case, indent is 1 here + indentAfterMarker = 1 if contentStart >= maximum else offset - initial + + # If we have more than 4 spaces, the indent is 1 + # (the rest is just indented code block) + if indentAfterMarker > 4: + indentAfterMarker = 1 + + # " - test" + # ^^^^^ - calculating total length of this thing + indent = initial + indentAfterMarker + + # Run subparser & write tokens + token = state.push("list_item_open", "li", 1) + token.markup = markerChar + token.map = itemLines = [startLine, 0] + if isOrdered: + token.info = state.src[start : posAfterMarker - 1] + + # Detect GFM task checkbox: `[ ] ` or `[x] `/`[X] ` at content start + checkboxLen = 0 + if state.md.options.get("tasklists", False) and contentStart < maximum: + checked = _detect_task_checkbox(state.src, contentStart, maximum) + if checked is not None: + token.meta = {"checked": checked} + # Advance content past the checkbox: `[x]` (3 chars) + whitespace. + # `_detect_task_checkbox` already guarantees a whitespace char at + # pos+3, so we always consume 4 characters. + checkboxLen = 4 + + # change current state, then restore it after parser subcall + oldTight = state.tight + oldBMark = state.bMarks[startLine] + oldTShift = state.tShift[startLine] + oldSCount = state.sCount[startLine] + + # - example list + # ^ listIndent position will be here + # ^ blkIndent position will be here + # + oldListIndent = state.listIndent + state.listIndent = state.blkIndent + state.blkIndent = indent + + state.tight = True + state.tShift[startLine] = contentStart - state.bMarks[startLine] + state.sCount[startLine] = offset + + # If we detected a checkbox, advance bMarks past it so that + # getLines() doesn't include the checkbox text in the content. + if checkboxLen: + state.bMarks[startLine] = contentStart + checkboxLen + state.tShift[startLine] = 0 + + if contentStart >= maximum and state.isEmpty(startLine + 1): + # workaround for this case + # (list item is empty, list terminates before "foo"): + # ~~~~~~~~ + # - + # + # foo + # ~~~~~~~~ + state.line = min(state.line + 2, endLine) + else: + # NOTE in list.js this was: + # state.md.block.tokenize(state, startLine, endLine, True) + # but tokeniz does not take the final parameter + state.md.block.tokenize(state, startLine, endLine) + + # If any of list item is tight, mark list as tight + if (not state.tight) or prevEmptyEnd: + tight = False + + # Item become loose if finish with empty line, + # but we should filter last element, because it means list finish + prevEmptyEnd = (state.line - startLine) > 1 and state.isEmpty(state.line - 1) + + state.blkIndent = state.listIndent + state.listIndent = oldListIndent + if checkboxLen: + state.bMarks[startLine] = oldBMark + state.tShift[startLine] = oldTShift + state.sCount[startLine] = oldSCount + state.tight = oldTight + + token = state.push("list_item_close", "li", -1) + token.markup = markerChar + + nextLine = startLine = state.line + itemLines[1] = nextLine + + if nextLine >= endLine: + break + + contentStart = state.bMarks[startLine] + + # + # Try to check if list is terminated or continued. + # + if state.sCount[nextLine] < state.blkIndent: + break + + if state.is_code_block(startLine): + break + + # fail if terminating block found + terminate = False + for terminatorRule in terminatorRules: + if terminatorRule(state, nextLine, endLine, True): + terminate = True + break + + if terminate: + break + + # fail if list has another type + if isOrdered: + posAfterMarker = skipOrderedListMarker(state, nextLine) + if posAfterMarker < 0: + break + start = state.bMarks[nextLine] + state.tShift[nextLine] + else: + posAfterMarker = skipBulletListMarker(state, nextLine) + if posAfterMarker < 0: + break + + if markerChar != state.src[posAfterMarker - 1]: + break + + # Finalize list + + # If any direct list item has a task checkbox, add class to the list + if state.md.options.get("tasklists", False): + containsTask = False + level = state.tokens[listTokIdx].level + for j in range(listTokIdx + 1, len(state.tokens)): + tok = state.tokens[j] + if ( + tok.level == level + 1 + and tok.type == "list_item_open" + and tok.meta + and "checked" in tok.meta + ): + tok.attrJoin("class", "task-list-item") + containsTask = True + if containsTask: + state.tokens[listTokIdx].attrJoin("class", "contains-task-list") + + if isOrdered: + token = state.push("ordered_list_close", "ol", -1) + else: + token = state.push("bullet_list_close", "ul", -1) + + token.markup = markerChar + + listLines[1] = nextLine + state.line = nextLine + + state.parentType = oldParentType + + # mark paragraphs tight if needed + if tight: + markTightParagraphs(state, listTokIdx) + + return True + + +def _detect_task_checkbox(src: str, pos: int, maximum: int) -> bool | None: + """Detect ``[ ]``, ``[x]``, or ``[X]`` at *pos*, followed by whitespace. + + Returns ``True`` (checked), ``False`` (unchecked), or ``None`` (no match). + """ + # Need at least 4 chars: `[`, char, `]`, whitespace + if pos + 4 > maximum: + return None + if src[pos] != "[": + return None + inner = src[pos + 1] + if src[pos + 2] != "]": + return None + if inner == " ": + checked = False + elif inner in ("x", "X"): + checked = True + else: + return None + # After `]`, must have whitespace + if src[pos + 3] not in (" ", "\t"): + return None + return checked diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/paragraph.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/paragraph.py new file mode 100644 index 0000000000000000000000000000000000000000..30ba877799beb764dc0a603caa21fe6e6b641375 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/paragraph.py @@ -0,0 +1,66 @@ +"""Paragraph.""" + +import logging + +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def paragraph(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + LOGGER.debug( + "entering paragraph: %s, %s, %s, %s", state, startLine, endLine, silent + ) + + nextLine = startLine + 1 + ruler = state.md.block.ruler + terminatorRules = ruler.getRules("paragraph") + endLine = state.lineMax + + oldParentType = state.parentType + state.parentType = "paragraph" + + # jump line-by-line until empty one or EOF + while nextLine < endLine: + if state.isEmpty(nextLine): + break + # this would be a code block normally, but after paragraph + # it's considered a lazy continuation regardless of what's there + if state.sCount[nextLine] - state.blkIndent > 3: + nextLine += 1 + continue + + # quirk for blockquotes, this line should already be checked by that rule + if state.sCount[nextLine] < 0: + nextLine += 1 + continue + + # Some tags can terminate paragraph without empty line. + terminate = False + for terminatorRule in terminatorRules: + if terminatorRule(state, nextLine, endLine, True): + terminate = True + break + + if terminate: + break + + nextLine += 1 + + content = state.getLines(startLine, nextLine, state.blkIndent, False).strip() + + state.line = nextLine + + token = state.push("paragraph_open", "p", 1) + token.map = [startLine, state.line] + + token = state.push("inline", "", 0) + token.content = content + token.map = [startLine, state.line] + token.children = [] + + token = state.push("paragraph_close", "p", -1) + + state.parentType = oldParentType + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/reference.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/reference.py new file mode 100644 index 0000000000000000000000000000000000000000..ad94d40941ee7cd43c7d3873ac64276a47c15d8b --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/reference.py @@ -0,0 +1,235 @@ +import logging + +from ..common.utils import charCodeAt, isSpace, normalizeReference +from .state_block import StateBlock + +LOGGER = logging.getLogger(__name__) + + +def reference(state: StateBlock, startLine: int, _endLine: int, silent: bool) -> bool: + LOGGER.debug( + "entering reference: %s, %s, %s, %s", state, startLine, _endLine, silent + ) + + pos = state.bMarks[startLine] + state.tShift[startLine] + maximum = state.eMarks[startLine] + nextLine = startLine + 1 + + if state.is_code_block(startLine): + return False + + if state.src[pos] != "[": + return False + + string = state.src[pos : maximum + 1] + + # string = state.getLines(startLine, nextLine, state.blkIndent, False).strip() + maximum = len(string) + + labelEnd = None + pos = 1 + while pos < maximum: + ch = charCodeAt(string, pos) + if ch == 0x5B: # /* [ */ + return False + elif ch == 0x5D: # /* ] */ + labelEnd = pos + break + elif ch == 0x0A: # /* \n */ + if (lineContent := getNextLine(state, nextLine)) is not None: + string += lineContent + maximum = len(string) + nextLine += 1 + elif ch == 0x5C: # /* \ */ + pos += 1 + if ( + pos < maximum + and charCodeAt(string, pos) == 0x0A + and (lineContent := getNextLine(state, nextLine)) is not None + ): + string += lineContent + maximum = len(string) + nextLine += 1 + pos += 1 + + if ( + labelEnd is None or labelEnd < 0 or charCodeAt(string, labelEnd + 1) != 0x3A + ): # /* : */ + return False + + # [label]: destination 'title' + # ^^^ skip optional whitespace here + pos = labelEnd + 2 + while pos < maximum: + ch = charCodeAt(string, pos) + if ch == 0x0A: + if (lineContent := getNextLine(state, nextLine)) is not None: + string += lineContent + maximum = len(string) + nextLine += 1 + elif isSpace(ch): + pass + else: + break + pos += 1 + + # [label]: destination 'title' + # ^^^^^^^^^^^ parse this + destRes = state.md.helpers.parseLinkDestination(string, pos, maximum) + if not destRes.ok: + return False + + href = state.md.normalizeLink(destRes.str) + if not state.md.validateLink(href): + return False + + pos = destRes.pos + + # save cursor state, we could require to rollback later + destEndPos = pos + destEndLineNo = nextLine + + # [label]: destination 'title' + # ^^^ skipping those spaces + start = pos + while pos < maximum: + ch = charCodeAt(string, pos) + if ch == 0x0A: + if (lineContent := getNextLine(state, nextLine)) is not None: + string += lineContent + maximum = len(string) + nextLine += 1 + elif isSpace(ch): + pass + else: + break + pos += 1 + + # [label]: destination 'title' + # ^^^^^^^ parse this + titleRes = state.md.helpers.parseLinkTitle(string, pos, maximum, None) + while titleRes.can_continue: + if (lineContent := getNextLine(state, nextLine)) is None: + break + string += lineContent + pos = maximum + maximum = len(string) + nextLine += 1 + titleRes = state.md.helpers.parseLinkTitle(string, pos, maximum, titleRes) + + if pos < maximum and start != pos and titleRes.ok: + title = titleRes.str + pos = titleRes.pos + else: + title = "" + pos = destEndPos + nextLine = destEndLineNo + + # skip trailing spaces until the rest of the line + while pos < maximum: + ch = charCodeAt(string, pos) + if not isSpace(ch): + break + pos += 1 + + if pos < maximum and charCodeAt(string, pos) != 0x0A and title: + # garbage at the end of the line after title, + # but it could still be a valid reference if we roll back + title = "" + pos = destEndPos + nextLine = destEndLineNo + while pos < maximum: + ch = charCodeAt(string, pos) + if not isSpace(ch): + break + pos += 1 + + if pos < maximum and charCodeAt(string, pos) != 0x0A: + # garbage at the end of the line + return False + + label = normalizeReference(string[1:labelEnd]) + if not label: + # CommonMark 0.20 disallows empty labels + return False + + # Reference can not terminate anything. This check is for safety only. + if silent: + return True + + if "references" not in state.env: + state.env["references"] = {} + + state.line = nextLine + + # note, this is not part of markdown-it JS, but is useful for renderers + if state.md.options.get("inline_definitions", False): + token = state.push("definition", "", 0) + token.meta = { + "id": label, + "title": title, + "url": href, + "label": string[1:labelEnd], + } + token.map = [startLine, state.line] + + if label not in state.env["references"]: + state.env["references"][label] = { + "title": title, + "href": href, + "map": [startLine, state.line], + } + else: + state.env.setdefault("duplicate_refs", []).append( + { + "title": title, + "href": href, + "label": label, + "map": [startLine, state.line], + } + ) + + return True + + +def getNextLine(state: StateBlock, nextLine: int) -> None | str: + endLine = state.lineMax + + if nextLine >= endLine or state.isEmpty(nextLine): + # empty line or end of input + return None + + isContinuation = False + + # this would be a code block normally, but after paragraph + # it's considered a lazy continuation regardless of what's there + if state.is_code_block(nextLine): + isContinuation = True + + # quirk for blockquotes, this line should already be checked by that rule + if state.sCount[nextLine] < 0: + isContinuation = True + + if not isContinuation: + terminatorRules = state.md.block.ruler.getRules("reference") + oldParentType = state.parentType + state.parentType = "reference" + + # Some tags can terminate paragraph without empty line. + terminate = False + for terminatorRule in terminatorRules: + if terminatorRule(state, nextLine, endLine, True): + terminate = True + break + + state.parentType = oldParentType + + if terminate: + # terminated by another block + return None + + pos = state.bMarks[nextLine] + state.tShift[nextLine] + maximum = state.eMarks[nextLine] + + # max + 1 explicitly includes the newline + return state.src[pos : maximum + 1] diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/state_block.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/state_block.py new file mode 100644 index 0000000000000000000000000000000000000000..445ad265a01e3f1dededf9f72848686a2b5ee901 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/state_block.py @@ -0,0 +1,261 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Literal + +from ..common.utils import isStrSpace +from ..ruler import StateBase +from ..token import Token +from ..utils import EnvType + +if TYPE_CHECKING: + from markdown_it.main import MarkdownIt + + +class StateBlock(StateBase): + def __init__( + self, src: str, md: MarkdownIt, env: EnvType, tokens: list[Token] + ) -> None: + self.src = src + + # link to parser instance + self.md = md + + self.env = env + + # + # Internal state variables + # + + self.tokens = tokens + + self.bMarks: list[int] = [] # line begin offsets for fast jumps + self.eMarks: list[int] = [] # line end offsets for fast jumps + # offsets of the first non-space characters (tabs not expanded) + self.tShift: list[int] = [] + self.sCount: list[int] = [] # indents for each line (tabs expanded) + + # An amount of virtual spaces (tabs expanded) between beginning + # of each line (bMarks) and real beginning of that line. + # + # It exists only as a hack because blockquotes override bMarks + # losing information in the process. + # + # It's used only when expanding tabs, you can think about it as + # an initial tab length, e.g. bsCount=21 applied to string `\t123` + # means first tab should be expanded to 4-21%4 === 3 spaces. + # + self.bsCount: list[int] = [] + + # block parser variables + self.blkIndent = 0 # required block content indent (for example, if we are + # inside a list, it would be positioned after list marker) + self.line = 0 # line index in src + self.lineMax = 0 # lines count + self.tight = False # loose/tight mode for lists + self.ddIndent = -1 # indent of the current dd block (-1 if there isn't any) + self.listIndent = -1 # indent of the current list block (-1 if there isn't any) + + # can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' + # used in lists to determine if they interrupt a paragraph + self.parentType = "root" + + self.level = 0 + + # renderer + self.result = "" + + # Create caches + # Generate markers. + indent_found = False + + start = pos = indent = offset = 0 + length = len(self.src) + + for pos, character in enumerate(self.src): + if not indent_found: + if isStrSpace(character): + indent += 1 + + if character == "\t": + offset += 4 - offset % 4 + else: + offset += 1 + continue + else: + indent_found = True + + if character == "\n" or pos == length - 1: + if character != "\n": + pos += 1 + self.bMarks.append(start) + self.eMarks.append(pos) + self.tShift.append(indent) + self.sCount.append(offset) + self.bsCount.append(0) + + indent_found = False + indent = 0 + offset = 0 + start = pos + 1 + + # Push fake entry to simplify cache bounds checks + self.bMarks.append(length) + self.eMarks.append(length) + self.tShift.append(0) + self.sCount.append(0) + self.bsCount.append(0) + + self.lineMax = len(self.bMarks) - 1 # don't count last fake line + + # pre-check if code blocks are enabled, to speed up is_code_block method + self._code_enabled = "code" in self.md["block"].ruler.get_active_rules() + + def __repr__(self) -> str: + return ( + f"{self.__class__.__name__}" + f"(line={self.line},level={self.level},tokens={len(self.tokens)})" + ) + + def push(self, ttype: str, tag: str, nesting: Literal[-1, 0, 1]) -> Token: + """Push new token to "stream".""" + token = Token(ttype, tag, nesting) + token.block = True + if nesting < 0: + self.level -= 1 # closing tag + token.level = self.level + if nesting > 0: + self.level += 1 # opening tag + self.tokens.append(token) + return token + + def isEmpty(self, line: int) -> bool: + """.""" + return (self.bMarks[line] + self.tShift[line]) >= self.eMarks[line] + + def skipEmptyLines(self, from_pos: int) -> int: + """.""" + while from_pos < self.lineMax: + try: + if (self.bMarks[from_pos] + self.tShift[from_pos]) < self.eMarks[ + from_pos + ]: + break + except IndexError: + pass + from_pos += 1 + return from_pos + + def skipSpaces(self, pos: int) -> int: + """Skip spaces from given position.""" + while True: + try: + current = self.src[pos] + except IndexError: + break + if not isStrSpace(current): + break + pos += 1 + return pos + + def skipSpacesBack(self, pos: int, minimum: int) -> int: + """Skip spaces from given position in reverse.""" + if pos <= minimum: + return pos + while pos > minimum: + pos -= 1 + if not isStrSpace(self.src[pos]): + return pos + 1 + return pos + + def skipChars(self, pos: int, code: int) -> int: + """Skip character code from given position.""" + while True: + try: + current = self.srcCharCode[pos] + except IndexError: + break + if current != code: + break + pos += 1 + return pos + + def skipCharsStr(self, pos: int, ch: str) -> int: + """Skip character string from given position.""" + while True: + try: + current = self.src[pos] + except IndexError: + break + if current != ch: + break + pos += 1 + return pos + + def skipCharsBack(self, pos: int, code: int, minimum: int) -> int: + """Skip character code reverse from given position - 1.""" + if pos <= minimum: + return pos + while pos > minimum: + pos -= 1 + if code != self.srcCharCode[pos]: + return pos + 1 + return pos + + def skipCharsStrBack(self, pos: int, ch: str, minimum: int) -> int: + """Skip character string reverse from given position - 1.""" + if pos <= minimum: + return pos + while pos > minimum: + pos -= 1 + if ch != self.src[pos]: + return pos + 1 + return pos + + def getLines(self, begin: int, end: int, indent: int, keepLastLF: bool) -> str: + """Cut lines range from source.""" + line = begin + if begin >= end: + return "" + + queue = [""] * (end - begin) + + i = 1 + while line < end: + lineIndent = 0 + lineStart = first = self.bMarks[line] + last = ( + self.eMarks[line] + 1 + if line + 1 < end or keepLastLF + else self.eMarks[line] + ) + + while (first < last) and (lineIndent < indent): + ch = self.src[first] + if isStrSpace(ch): + if ch == "\t": + lineIndent += 4 - (lineIndent + self.bsCount[line]) % 4 + else: + lineIndent += 1 + elif first - lineStart < self.tShift[line]: + lineIndent += 1 + else: + break + first += 1 + + if lineIndent > indent: + # partially expanding tabs in code blocks, e.g '\t\tfoobar' + # with indent=2 becomes ' \tfoobar' + queue[i - 1] = (" " * (lineIndent - indent)) + self.src[first:last] + else: + queue[i - 1] = self.src[first:last] + + line += 1 + i += 1 + + return "".join(queue) + + def is_code_block(self, line: int) -> bool: + """Check if line is a code block, + i.e. the code block rule is enabled and text is indented by more than 3 spaces. + """ + return self._code_enabled and (self.sCount[line] - self.blkIndent) >= 4 diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_block/table.py b/python/user_packages/Python313/site-packages/markdown_it/rules_block/table.py new file mode 100644 index 0000000000000000000000000000000000000000..c52553d8c21265df65e23be253686ef00b3297eb --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_block/table.py @@ -0,0 +1,250 @@ +# GFM table, https://github.github.com/gfm/#tables-extension- +from __future__ import annotations + +import re + +from ..common.utils import charStrAt, isStrSpace +from .state_block import StateBlock + +headerLineRe = re.compile(r"^:?-+:?$") +enclosingPipesRe = re.compile(r"^\||\|$") + +# Limit the amount of empty autocompleted cells in a table, +# see https://github.com/markdown-it/markdown-it/issues/1000, +# Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k. +# We set it to 65k, which can expand user input by a factor of x370 +# (256x256 square is 1.8kB expanded into 650kB). +MAX_AUTOCOMPLETED_CELLS = 0x10000 + + +def getLine(state: StateBlock, line: int) -> str: + pos = state.bMarks[line] + state.tShift[line] + maximum = state.eMarks[line] + + # return state.src.substr(pos, max - pos) + return state.src[pos:maximum] + + +def escapedSplit(string: str) -> list[str]: + result: list[str] = [] + pos = 0 + max = len(string) + isEscaped = False + lastPos = 0 + current = "" + ch = charStrAt(string, pos) + + while pos < max: + if ch == "|": + if not isEscaped: + # pipe separating cells, '|' + result.append(current + string[lastPos:pos]) + current = "" + lastPos = pos + 1 + else: + # escaped pipe, '\|' + current += string[lastPos : pos - 1] + lastPos = pos + + isEscaped = ch == "\\" + pos += 1 + + ch = charStrAt(string, pos) + + result.append(current + string[lastPos:]) + + return result + + +def table(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: + tbodyLines = None + + # should have at least two lines + if startLine + 2 > endLine: + return False + + nextLine = startLine + 1 + + if state.sCount[nextLine] < state.blkIndent: + return False + + if state.is_code_block(nextLine): + return False + + # first character of the second line should be '|', '-', ':', + # and no other characters are allowed but spaces; + # basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp + + pos = state.bMarks[nextLine] + state.tShift[nextLine] + if pos >= state.eMarks[nextLine]: + return False + first_ch = state.src[pos] + pos += 1 + if first_ch not in ("|", "-", ":"): + return False + + if pos >= state.eMarks[nextLine]: + return False + second_ch = state.src[pos] + pos += 1 + if second_ch not in ("|", "-", ":") and not isStrSpace(second_ch): + return False + + # if first character is '-', then second character must not be a space + # (due to parsing ambiguity with list) + if first_ch == "-" and isStrSpace(second_ch): + return False + + while pos < state.eMarks[nextLine]: + ch = state.src[pos] + + if ch not in ("|", "-", ":") and not isStrSpace(ch): + return False + + pos += 1 + + lineText = getLine(state, startLine + 1) + + columns = lineText.split("|") + aligns = [] + for i in range(len(columns)): + t = columns[i].strip() + if not t: + # allow empty columns before and after table, but not in between columns; + # e.g. allow ` |---| `, disallow ` ---||--- ` + if i == 0 or i == len(columns) - 1: + continue + else: + return False + + if not headerLineRe.search(t): + return False + if charStrAt(t, len(t) - 1) == ":": + aligns.append("center" if charStrAt(t, 0) == ":" else "right") + elif charStrAt(t, 0) == ":": + aligns.append("left") + else: + aligns.append("") + + lineText = getLine(state, startLine).strip() + if "|" not in lineText: + return False + if state.is_code_block(startLine): + return False + columns = escapedSplit(lineText) + if columns and columns[0] == "": + columns.pop(0) + if columns and columns[-1] == "": + columns.pop() + + # header row will define an amount of columns in the entire table, + # and align row should be exactly the same (the rest of the rows can differ) + columnCount = len(columns) + if columnCount == 0 or columnCount != len(aligns): + return False + + if silent: + return True + + oldParentType = state.parentType + state.parentType = "table" + + # use 'blockquote' lists for termination because it's + # the most similar to tables + terminatorRules = state.md.block.ruler.getRules("blockquote") + + token = state.push("table_open", "table", 1) + token.map = tableLines = [startLine, 0] + + token = state.push("thead_open", "thead", 1) + token.map = [startLine, startLine + 1] + + token = state.push("tr_open", "tr", 1) + token.map = [startLine, startLine + 1] + + for i in range(len(columns)): + token = state.push("th_open", "th", 1) + if aligns[i]: + token.attrs = {"style": "text-align:" + aligns[i]} + + token = state.push("inline", "", 0) + # note in markdown-it this map was removed in v12.0.0 however, we keep it, + # since it is helpful to propagate to children tokens + token.map = [startLine, startLine + 1] + token.content = columns[i].strip() + token.children = [] + + token = state.push("th_close", "th", -1) + + token = state.push("tr_close", "tr", -1) + token = state.push("thead_close", "thead", -1) + + autocompleted_cells = 0 + nextLine = startLine + 2 + while nextLine < endLine: + if state.sCount[nextLine] < state.blkIndent: + break + + terminate = False + for i in range(len(terminatorRules)): + if terminatorRules[i](state, nextLine, endLine, True): + terminate = True + break + + if terminate: + break + lineText = getLine(state, nextLine).strip() + if not lineText: + break + if state.is_code_block(nextLine): + break + columns = escapedSplit(lineText) + if columns and columns[0] == "": + columns.pop(0) + if columns and columns[-1] == "": + columns.pop() + + # note: autocomplete count can be negative if user specifies more columns than header, + # but that does not affect intended use (which is limiting expansion) + autocompleted_cells += columnCount - len(columns) + if autocompleted_cells > MAX_AUTOCOMPLETED_CELLS: + break + + if nextLine == startLine + 2: + token = state.push("tbody_open", "tbody", 1) + token.map = tbodyLines = [startLine + 2, 0] + + token = state.push("tr_open", "tr", 1) + token.map = [nextLine, nextLine + 1] + + for i in range(columnCount): + token = state.push("td_open", "td", 1) + if aligns[i]: + token.attrs = {"style": "text-align:" + aligns[i]} + + token = state.push("inline", "", 0) + # note in markdown-it this map was removed in v12.0.0 however, we keep it, + # since it is helpful to propagate to children tokens + token.map = [nextLine, nextLine + 1] + try: + token.content = columns[i].strip() if columns[i] else "" + except IndexError: + token.content = "" + token.children = [] + + token = state.push("td_close", "td", -1) + + token = state.push("tr_close", "tr", -1) + + nextLine += 1 + + if tbodyLines: + token = state.push("tbody_close", "tbody", -1) + tbodyLines[1] = nextLine + + token = state.push("table_close", "table", -1) + + tableLines[1] = nextLine + state.parentType = oldParentType + state.line = nextLine + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__init__.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e7d775363c6e1d454e73a7e3fff9af3115be4339 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__init__.py @@ -0,0 +1,19 @@ +__all__ = ( + "StateCore", + "block", + "inline", + "linkify", + "normalize", + "replace", + "smartquotes", + "text_join", +) + +from .block import block +from .inline import inline +from .linkify import linkify +from .normalize import normalize +from .replacements import replace +from .smartquotes import smartquotes +from .state_core import StateCore +from .text_join import text_join diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c435ad2f6c8e5bb862e5075f202b81036fb9938 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/block.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/block.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0909d7913dfc620151ea198c12ba3d281fe06ca Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/block.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/inline.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/inline.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9feb69a2d5df1794633442f4f87a46c14035541 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/inline.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/linkify.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/linkify.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7392b56533911f061c09c208cb479bedcaaf2886 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/linkify.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/normalize.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/normalize.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9bd2adba84e3ac8c8065fb500cd769a3f785bad Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/normalize.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/replacements.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/replacements.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c787808cebd70a7980474bb8cfe7c49b3233f7c0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/replacements.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/smartquotes.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/smartquotes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f9aec4cae994b44331da5098de57d1148151fd0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/smartquotes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/state_core.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/state_core.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..60b0ca423db9d4213f144a69a0e23b68ea8f2554 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/state_core.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/text_join.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/text_join.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf31e91706eec1f02dbc0085c311bd1ad832127a Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_core/__pycache__/text_join.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/block.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/block.py new file mode 100644 index 0000000000000000000000000000000000000000..a6c3bb8d7ae18880fd638690fb5b09beb78b103c --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/block.py @@ -0,0 +1,13 @@ +from ..token import Token +from .state_core import StateCore + + +def block(state: StateCore) -> None: + if state.inlineMode: + token = Token("inline", "", 0) + token.content = state.src + token.map = [0, 1] + token.children = [] + state.tokens.append(token) + else: + state.md.block.parse(state.src, state.md, state.env, state.tokens) diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/inline.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/inline.py new file mode 100644 index 0000000000000000000000000000000000000000..c3fd0b5e25dda5d8a5a644cc9e460d0f92ae2d1d --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/inline.py @@ -0,0 +1,10 @@ +from .state_core import StateCore + + +def inline(state: StateCore) -> None: + """Parse inlines""" + for token in state.tokens: + if token.type == "inline": + if token.children is None: + token.children = [] + state.md.inline.parse(token.content, state.md, state.env, token.children) diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/linkify.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/linkify.py new file mode 100644 index 0000000000000000000000000000000000000000..efbc9d4c9b1cbada1c936401b3421d73fbff5b64 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/linkify.py @@ -0,0 +1,149 @@ +from __future__ import annotations + +import re +from typing import Protocol + +from ..common.utils import arrayReplaceAt, isLinkClose, isLinkOpen +from ..token import Token +from .state_core import StateCore + +HTTP_RE = re.compile(r"^http://") +MAILTO_RE = re.compile(r"^mailto:") +TEST_MAILTO_RE = re.compile(r"^mailto:", flags=re.IGNORECASE) + + +def linkify(state: StateCore) -> None: + """Rule for identifying plain-text links.""" + if not state.md.options.linkify: + return + + if not state.md.linkify: + raise ModuleNotFoundError("Linkify enabled but not installed.") + + for inline_token in state.tokens: + if inline_token.type != "inline" or not state.md.linkify.pretest( + inline_token.content + ): + continue + + tokens = inline_token.children + + htmlLinkLevel = 0 + + # We scan from the end, to keep position when new tags added. + # Use reversed logic in links start/end match + assert tokens is not None + i = len(tokens) + while i >= 1: + i -= 1 + assert isinstance(tokens, list) + currentToken = tokens[i] + + # Skip content of markdown links + if currentToken.type == "link_close": + i -= 1 + while ( + tokens[i].level != currentToken.level + and tokens[i].type != "link_open" + ): + i -= 1 + continue + + # Skip content of html tag links + if currentToken.type == "html_inline": + if isLinkOpen(currentToken.content) and htmlLinkLevel > 0: + htmlLinkLevel -= 1 + if isLinkClose(currentToken.content): + htmlLinkLevel += 1 + if htmlLinkLevel > 0: + continue + + if currentToken.type == "text" and state.md.linkify.test( + currentToken.content + ): + text = currentToken.content + links: list[_LinkType] = state.md.linkify.match(text) or [] + + # Now split string to nodes + nodes = [] + level = currentToken.level + lastPos = 0 + + # forbid escape sequence at the start of the string, + # this avoids http\://example.com/ from being linkified as + # http://example.com/ + if ( + links + and links[0].index == 0 + and i > 0 + and tokens[i - 1].type == "text_special" + ): + links = links[1:] + + for link in links: + url = link.url + fullUrl = state.md.normalizeLink(url) + if not state.md.validateLink(fullUrl): + continue + + urlText = link.text + + # Linkifier might send raw hostnames like "example.com", where url + # starts with domain name. So we prepend http:// in those cases, + # and remove it afterwards. + if not link.schema: + urlText = HTTP_RE.sub( + "", state.md.normalizeLinkText("http://" + urlText) + ) + elif link.schema == "mailto:" and TEST_MAILTO_RE.search(urlText): + urlText = MAILTO_RE.sub( + "", state.md.normalizeLinkText("mailto:" + urlText) + ) + else: + urlText = state.md.normalizeLinkText(urlText) + + pos = link.index + + if pos > lastPos: + token = Token("text", "", 0) + token.content = text[lastPos:pos] + token.level = level + nodes.append(token) + + token = Token("link_open", "a", 1) + token.attrs = {"href": fullUrl} + token.level = level + level += 1 + token.markup = "linkify" + token.info = "auto" + nodes.append(token) + + token = Token("text", "", 0) + token.content = urlText + token.level = level + nodes.append(token) + + token = Token("link_close", "a", -1) + level -= 1 + token.level = level + token.markup = "linkify" + token.info = "auto" + nodes.append(token) + + lastPos = link.last_index + + if lastPos < len(text): + token = Token("text", "", 0) + token.content = text[lastPos:] + token.level = level + nodes.append(token) + + inline_token.children = tokens = arrayReplaceAt(tokens, i, nodes) + + +class _LinkType(Protocol): + url: str + text: str + index: int + last_index: int + schema: str | None diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/normalize.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/normalize.py new file mode 100644 index 0000000000000000000000000000000000000000..32439243ef6ebfa424d202ed63635983d4c9ea82 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/normalize.py @@ -0,0 +1,19 @@ +"""Normalize input string.""" + +import re + +from .state_core import StateCore + +# https://spec.commonmark.org/0.29/#line-ending +NEWLINES_RE = re.compile(r"\r\n?|\n") +NULL_RE = re.compile(r"\0") + + +def normalize(state: StateCore) -> None: + # Normalize newlines + string = NEWLINES_RE.sub("\n", state.src) + + # Replace NULL characters + string = NULL_RE.sub("\ufffd", string) + + state.src = string diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/replacements.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/replacements.py new file mode 100644 index 0000000000000000000000000000000000000000..bcc9980046bf76723245b1ca2543af132efe5541 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/replacements.py @@ -0,0 +1,127 @@ +"""Simple typographic replacements + +* ``(c)``, ``(C)`` โ†’ ยฉ +* ``(tm)``, ``(TM)`` โ†’ โ„ข +* ``(r)``, ``(R)`` โ†’ ยฎ +* ``+-`` โ†’ ยฑ +* ``...`` โ†’ โ€ฆ +* ``?....`` โ†’ ?.. +* ``!....`` โ†’ !.. +* ``????????`` โ†’ ??? +* ``!!!!!`` โ†’ !!! +* ``,,,`` โ†’ , +* ``--`` โ†’ &ndash +* ``---`` โ†’ &mdash +""" + +from __future__ import annotations + +import logging +import re + +from ..token import Token +from .state_core import StateCore + +LOGGER = logging.getLogger(__name__) + +# TODO: +# - fractionals 1/2, 1/4, 3/4 -> ยฝ, ยผ, ยพ +# - multiplication 2 x 4 -> 2 ร— 4 + +RARE_RE = re.compile(r"\+-|\.\.|\?\?\?\?|!!!!|,,|--") + +# Workaround for phantomjs - need regex without /g flag, +# or root check will fail every second time +# SCOPED_ABBR_TEST_RE = r"\((c|tm|r)\)" + +SCOPED_ABBR_RE = re.compile(r"\((c|tm|r)\)", flags=re.IGNORECASE) + +PLUS_MINUS_RE = re.compile(r"\+-") + +ELLIPSIS_RE = re.compile(r"\.{2,}") + +ELLIPSIS_QUESTION_EXCLAMATION_RE = re.compile(r"([?!])โ€ฆ") + +QUESTION_EXCLAMATION_RE = re.compile(r"([?!]){4,}") + +COMMA_RE = re.compile(r",{2,}") + +EM_DASH_RE = re.compile(r"(^|[^-])---(?=[^-]|$)", flags=re.MULTILINE) + +EN_DASH_RE = re.compile(r"(^|\s)--(?=\s|$)", flags=re.MULTILINE) + +EN_DASH_INDENT_RE = re.compile(r"(^|[^-\s])--(?=[^-\s]|$)", flags=re.MULTILINE) + + +SCOPED_ABBR = {"c": "ยฉ", "r": "ยฎ", "tm": "โ„ข"} + + +def replaceFn(match: re.Match[str]) -> str: + return SCOPED_ABBR[match.group(1).lower()] + + +def replace_scoped(inlineTokens: list[Token]) -> None: + inside_autolink = 0 + + for token in inlineTokens: + if token.type == "text" and not inside_autolink: + token.content = SCOPED_ABBR_RE.sub(replaceFn, token.content) + + if token.type == "link_open" and token.info == "auto": + inside_autolink -= 1 + + if token.type == "link_close" and token.info == "auto": + inside_autolink += 1 + + +def replace_rare(inlineTokens: list[Token]) -> None: + inside_autolink = 0 + + for token in inlineTokens: + if ( + token.type == "text" + and (not inside_autolink) + and RARE_RE.search(token.content) + ): + # +- -> ยฑ + token.content = PLUS_MINUS_RE.sub("ยฑ", token.content) + + # .., ..., ....... -> โ€ฆ + token.content = ELLIPSIS_RE.sub("โ€ฆ", token.content) + + # but ?..... & !..... -> ?.. & !.. + token.content = ELLIPSIS_QUESTION_EXCLAMATION_RE.sub("\\1..", token.content) + token.content = QUESTION_EXCLAMATION_RE.sub("\\1\\1\\1", token.content) + + # ,, ,,, ,,,, -> , + token.content = COMMA_RE.sub(",", token.content) + + # em-dash + token.content = EM_DASH_RE.sub("\\1\u2014", token.content) + + # en-dash + token.content = EN_DASH_RE.sub("\\1\u2013", token.content) + token.content = EN_DASH_INDENT_RE.sub("\\1\u2013", token.content) + + if token.type == "link_open" and token.info == "auto": + inside_autolink -= 1 + + if token.type == "link_close" and token.info == "auto": + inside_autolink += 1 + + +def replace(state: StateCore) -> None: + if not state.md.options.typographer: + return + + for token in state.tokens: + if token.type != "inline": + continue + if token.children is None: + continue + + if SCOPED_ABBR_RE.search(token.content): + replace_scoped(token.children) + + if RARE_RE.search(token.content): + replace_rare(token.children) diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/smartquotes.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/smartquotes.py new file mode 100644 index 0000000000000000000000000000000000000000..f9b8b457b6c134f5736fabd3b14dc746e75ab86b --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/smartquotes.py @@ -0,0 +1,202 @@ +"""Convert straight quotation marks to typographic ones""" + +from __future__ import annotations + +import re +from typing import Any + +from ..common.utils import charCodeAt, isMdAsciiPunct, isPunctChar, isWhiteSpace +from ..token import Token +from .state_core import StateCore + +QUOTE_TEST_RE = re.compile(r"['\"]") +QUOTE_RE = re.compile(r"['\"]") +APOSTROPHE = "\u2019" # โ€™ + + +def replaceAt(string: str, index: int, ch: str) -> str: + # When the index is negative, the behavior is different from the js version. + # But basically, the index will not be negative. + assert index >= 0 + return string[:index] + ch + string[index + 1 :] + + +def process_inlines(tokens: list[Token], state: StateCore) -> None: + stack: list[dict[str, Any]] = [] + + for i, token in enumerate(tokens): + thisLevel = token.level + + j = 0 + for j in range(len(stack))[::-1]: + if stack[j]["level"] <= thisLevel: + break + else: + # When the loop is terminated without a "break". + # Subtract 1 to get the same index as the js version. + j -= 1 + + stack = stack[: j + 1] + + if token.type != "text": + continue + + text = token.content + pos = 0 + maximum = len(text) + + while pos < maximum: + goto_outer = False + lastIndex = pos + t = QUOTE_RE.search(text[lastIndex:]) + if not t: + break + + canOpen = canClose = True + pos = t.start(0) + lastIndex + 1 + isSingle = t.group(0) == "'" + + # Find previous character, + # default to space if it's the beginning of the line + lastChar: None | int = 0x20 + + if t.start(0) + lastIndex - 1 >= 0: + lastChar = charCodeAt(text, t.start(0) + lastIndex - 1) + else: + for j in range(i)[::-1]: + if tokens[j].type == "softbreak" or tokens[j].type == "hardbreak": + break + # should skip all tokens except 'text', 'html_inline' or 'code_inline' + if not tokens[j].content: + continue + + lastChar = charCodeAt(tokens[j].content, len(tokens[j].content) - 1) + break + + # Find next character, + # default to space if it's the end of the line + nextChar: None | int = 0x20 + + if pos < maximum: + nextChar = charCodeAt(text, pos) + else: + for j in range(i + 1, len(tokens)): + # nextChar defaults to 0x20 + if tokens[j].type == "softbreak" or tokens[j].type == "hardbreak": + break + # should skip all tokens except 'text', 'html_inline' or 'code_inline' + if not tokens[j].content: + continue + + nextChar = charCodeAt(tokens[j].content, 0) + break + + isLastPunctChar = lastChar is not None and ( + isMdAsciiPunct(lastChar) or isPunctChar(chr(lastChar)) + ) + isNextPunctChar = nextChar is not None and ( + isMdAsciiPunct(nextChar) or isPunctChar(chr(nextChar)) + ) + + isLastWhiteSpace = lastChar is not None and isWhiteSpace(lastChar) + isNextWhiteSpace = nextChar is not None and isWhiteSpace(nextChar) + + if isNextWhiteSpace: # noqa: SIM114 + canOpen = False + elif isNextPunctChar and not (isLastWhiteSpace or isLastPunctChar): + canOpen = False + + if isLastWhiteSpace: # noqa: SIM114 + canClose = False + elif isLastPunctChar and not (isNextWhiteSpace or isNextPunctChar): + canClose = False + + if nextChar == 0x22 and t.group(0) == '"': # 0x22: " # noqa: SIM102 + if ( + lastChar is not None and lastChar >= 0x30 and lastChar <= 0x39 + ): # 0x30: 0, 0x39: 9 + # special case: 1"" - count first quote as an inch + canClose = canOpen = False + + if canOpen and canClose: + # Replace quotes in the middle of punctuation sequence, but not + # in the middle of the words, i.e.: + # + # 1. foo " bar " baz - not replaced + # 2. foo-"-bar-"-baz - replaced + # 3. foo"bar"baz - not replaced + canOpen = isLastPunctChar + canClose = isNextPunctChar + + if not canOpen and not canClose: + # middle of word + if isSingle: + token.content = replaceAt( + token.content, t.start(0) + lastIndex, APOSTROPHE + ) + continue + + if canClose: + # this could be a closing quote, rewind the stack to get a match + for j in range(len(stack))[::-1]: + item = stack[j] + if stack[j]["level"] < thisLevel: + break + if item["single"] == isSingle and stack[j]["level"] == thisLevel: + item = stack[j] + + if isSingle: + openQuote = state.md.options.quotes[2] + closeQuote = state.md.options.quotes[3] + else: + openQuote = state.md.options.quotes[0] + closeQuote = state.md.options.quotes[1] + + # replace token.content *before* tokens[item.token].content, + # because, if they are pointing at the same token, replaceAt + # could mess up indices when quote length != 1 + token.content = replaceAt( + token.content, t.start(0) + lastIndex, closeQuote + ) + tokens[item["token"]].content = replaceAt( + tokens[item["token"]].content, item["pos"], openQuote + ) + + pos += len(closeQuote) - 1 + if item["token"] == i: + pos += len(openQuote) - 1 + + text = token.content + maximum = len(text) + + stack = stack[:j] + goto_outer = True + break + if goto_outer: + goto_outer = False + continue + + if canOpen: + stack.append( + { + "token": i, + "pos": t.start(0) + lastIndex, + "single": isSingle, + "level": thisLevel, + } + ) + elif canClose and isSingle: + token.content = replaceAt( + token.content, t.start(0) + lastIndex, APOSTROPHE + ) + + +def smartquotes(state: StateCore) -> None: + if not state.md.options.typographer: + return + + for token in state.tokens: + if token.type != "inline" or not QUOTE_RE.search(token.content): + continue + if token.children is not None: + process_inlines(token.children, state) diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/state_core.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/state_core.py new file mode 100644 index 0000000000000000000000000000000000000000..a938041d992fdf7ae3f2843a2e0f9ef298c45790 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/state_core.py @@ -0,0 +1,25 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from ..ruler import StateBase +from ..token import Token +from ..utils import EnvType + +if TYPE_CHECKING: + from markdown_it import MarkdownIt + + +class StateCore(StateBase): + def __init__( + self, + src: str, + md: MarkdownIt, + env: EnvType, + tokens: list[Token] | None = None, + ) -> None: + self.src = src + self.md = md # link to parser instance + self.env = env + self.tokens: list[Token] = tokens or [] + self.inlineMode = False diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_core/text_join.py b/python/user_packages/Python313/site-packages/markdown_it/rules_core/text_join.py new file mode 100644 index 0000000000000000000000000000000000000000..939b83b29f75fa697a9b0f57ca86302744d639d1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_core/text_join.py @@ -0,0 +1,53 @@ +"""Join raw text tokens with the rest of the text + +This is set as a separate rule to provide an opportunity for plugins +to run text replacements after text join, but before escape join. + +For example, `\\:)` shouldn't be replaced with an emoji. +""" + +from __future__ import annotations + +from ..token import Token +from .state_core import StateCore + + +def text_join(state: StateCore) -> None: + """Join raw text for escape sequences (`text_special`) tokens with the rest of the text""" + + for inline_token in state.tokens[:]: + if inline_token.type != "inline": + continue + + # convert text_special to text and join all adjacent text nodes + new_tokens: list[Token] = [] + children = inline_token.children or [] + i = 0 + while i < len(children): + child_token = children[i] + if child_token.type == "text_special": + child_token.type = "text" + if ( + child_token.type == "text" + and new_tokens + and new_tokens[-1].type == "text" + ): + # Collapse a run of adjacent text nodes in a single join, instead + # of pairwise `a + b` concatenation. The pairwise form is O(L*k) + # in the size of the run because each step rebuilds the growing + # prefix; "".join is O(L). + parts = [new_tokens[-1].content, child_token.content] + i += 1 + while i < len(children): + next_token = children[i] + if next_token.type == "text_special": + next_token.type = "text" + if next_token.type != "text": + break + parts.append(next_token.content) + i += 1 + new_tokens[-1].content = "".join(parts) + else: + new_tokens.append(child_token) + i += 1 + inline_token.children = new_tokens diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__init__.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d82ef8fbcca54eab4bbb40e8410104eef7a27f57 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__init__.py @@ -0,0 +1,31 @@ +__all__ = ( + "StateInline", + "autolink", + "backtick", + "emphasis", + "entity", + "escape", + "fragments_join", + "html_inline", + "image", + "link", + "link_pairs", + "linkify", + "newline", + "strikethrough", + "text", +) +from . import emphasis, strikethrough +from .autolink import autolink +from .backticks import backtick +from .balance_pairs import link_pairs +from .entity import entity +from .escape import escape +from .fragments_join import fragments_join +from .html_inline import html_inline +from .image import image +from .link import link +from .linkify import linkify +from .newline import newline +from .state_inline import StateInline +from .text import text diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea7ed94ebc01dfb6a70797f898de8b3927540b4e Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/autolink.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/autolink.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c8a7d4e9d94add94cbc44afea467dd4f7c7b3b9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/autolink.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/backticks.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/backticks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69d22fc0adf2f5d25fe3a7240e13e6581fda75b5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/backticks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/balance_pairs.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/balance_pairs.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0651f3906b38a4ac497bf943f0695956d95934c9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/balance_pairs.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/emphasis.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/emphasis.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..448d462da5903193f5f94f20f17df4247e005b11 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/emphasis.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/entity.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/entity.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cd3f891f9c538f8218d51458f99831ad18661f7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/entity.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/escape.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/escape.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9cbb85edba4455cd8a2dfc634b7a6f88fcefd54 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/escape.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/fragments_join.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/fragments_join.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a019f7c52a31eacb123c0325aa61d324bfaf04d3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/fragments_join.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/html_inline.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/html_inline.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95482038c7223717b839de02bb5bf668391e9b2d Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/html_inline.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/image.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/image.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6bd6ea4042232447b6802a1865561a7147ab9ac Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/image.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/link.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/link.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13a8ffb460f093189db28d9b28f6a3914add21ad Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/link.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/linkify.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/linkify.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..372ed2ccdd510807cd7b5d53d8b4e67521236086 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/linkify.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/newline.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/newline.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10c817e8dfcb2b56e06a1a1fd646da75d84bdd46 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/newline.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/state_inline.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/state_inline.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fa46b8389c6b54241d16519b57d35c335653dd5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/state_inline.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/strikethrough.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/strikethrough.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebcdb61ea4550768965425b30bc2bbf856998ff3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/strikethrough.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/text.cpython-313.pyc b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/text.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d00f507cd4a4323311017a98389b447896ad94bb Binary files /dev/null and b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/__pycache__/text.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/autolink.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/autolink.py new file mode 100644 index 0000000000000000000000000000000000000000..6546e2502f93a1b38a49c3fd728963a156cf0243 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/autolink.py @@ -0,0 +1,77 @@ +# Process autolinks '' +import re + +from .state_inline import StateInline + +EMAIL_RE = re.compile( + r"^([a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$" +) +AUTOLINK_RE = re.compile(r"^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$") + + +def autolink(state: StateInline, silent: bool) -> bool: + pos = state.pos + + if state.src[pos] != "<": + return False + + start = state.pos + maximum = state.posMax + + while True: + pos += 1 + if pos >= maximum: + return False + + ch = state.src[pos] + + if ch == "<": + return False + if ch == ">": + break + + url = state.src[start + 1 : pos] + + if AUTOLINK_RE.search(url) is not None: + fullUrl = state.md.normalizeLink(url) + if not state.md.validateLink(fullUrl): + return False + + if not silent: + token = state.push("link_open", "a", 1) + token.attrs = {"href": fullUrl} + token.markup = "autolink" + token.info = "auto" + + token = state.push("text", "", 0) + token.content = state.md.normalizeLinkText(url) + + token = state.push("link_close", "a", -1) + token.markup = "autolink" + token.info = "auto" + + state.pos += len(url) + 2 + return True + + if EMAIL_RE.search(url) is not None: + fullUrl = state.md.normalizeLink("mailto:" + url) + if not state.md.validateLink(fullUrl): + return False + + if not silent: + token = state.push("link_open", "a", 1) + token.attrs = {"href": fullUrl} + token.markup = "autolink" + token.info = "auto" + + token = state.push("text", "", 0) + token.content = state.md.normalizeLinkText(url) + + token = state.push("link_close", "a", -1) + token.markup = "autolink" + token.info = "auto" + + state.pos += len(url) + 2 + return True + + return False diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/backticks.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/backticks.py new file mode 100644 index 0000000000000000000000000000000000000000..fc60d6b15cdfa7012a05bcf1ccbb06f44d870dfd --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/backticks.py @@ -0,0 +1,72 @@ +# Parse backticks +import re + +from .state_inline import StateInline + +regex = re.compile("^ (.+) $") + + +def backtick(state: StateInline, silent: bool) -> bool: + pos = state.pos + + if state.src[pos] != "`": + return False + + start = pos + pos += 1 + maximum = state.posMax + + # scan marker length + while pos < maximum and (state.src[pos] == "`"): + pos += 1 + + marker = state.src[start:pos] + openerLength = len(marker) + + if state.backticksScanned and state.backticks.get(openerLength, 0) <= start: + if not silent: + state.pending += marker + state.pos += openerLength + return True + + matchStart = matchEnd = pos + + # Nothing found in the cache, scan until the end of the line (or until marker is found) + while True: + try: + matchStart = state.src.index("`", matchEnd) + except ValueError: + break + matchEnd = matchStart + 1 + + # scan marker length + while matchEnd < maximum and (state.src[matchEnd] == "`"): + matchEnd += 1 + + closerLength = matchEnd - matchStart + + if closerLength == openerLength: + # Found matching closer length. + if not silent: + token = state.push("code_inline", "code", 0) + token.markup = marker + token.content = state.src[pos:matchStart].replace("\n", " ") + if ( + token.content.startswith(" ") + and token.content.endswith(" ") + and len(token.content.strip()) > 0 + ): + token.content = token.content[1:-1] + state.pos = matchEnd + return True + + # Some different length found, put it in cache as upper limit of where closer can be found + state.backticks[closerLength] = matchStart + + # Scanned through the end, didn't find anything + state.backticksScanned = True + + if not silent: + state.pending += marker + state.pos += openerLength + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/balance_pairs.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/balance_pairs.py new file mode 100644 index 0000000000000000000000000000000000000000..9c63b27f7186eb99c61938d27309fda7e900b88d --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/balance_pairs.py @@ -0,0 +1,138 @@ +"""Balance paired characters (*, _, etc) in inline tokens.""" + +from __future__ import annotations + +from .state_inline import Delimiter, StateInline + + +def processDelimiters(state: StateInline, delimiters: list[Delimiter]) -> None: + """For each opening emphasis-like marker find a matching closing one.""" + if not delimiters: + return + + openersBottom = {} + maximum = len(delimiters) + + # headerIdx is the first delimiter of the current (where closer is) delimiter run + headerIdx = 0 + lastTokenIdx = -2 # needs any value lower than -1 + jumps: list[int] = [] + closerIdx = 0 + while closerIdx < maximum: + closer = delimiters[closerIdx] + + jumps.append(0) + + # markers belong to same delimiter run if: + # - they have adjacent tokens + # - AND markers are the same + # + if ( + delimiters[headerIdx].marker != closer.marker + or lastTokenIdx != closer.token - 1 + ): + headerIdx = closerIdx + lastTokenIdx = closer.token + + # Length is only used for emphasis-specific "rule of 3", + # if it's not defined (in strikethrough or 3rd party plugins), + # we can default it to 0 to disable those checks. + # + closer.length = closer.length or 0 + + if not closer.close: + closerIdx += 1 + continue + + # Previously calculated lower bounds (previous fails) + # for each marker, each delimiter length modulo 3, + # and for whether this closer can be an opener; + # https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 + if closer.marker not in openersBottom: + openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1] + + minOpenerIdx = openersBottom[closer.marker][ + (3 if closer.open else 0) + (closer.length % 3) + ] + + openerIdx = headerIdx - jumps[headerIdx] - 1 + + newMinOpenerIdx = openerIdx + + while openerIdx > minOpenerIdx: + opener = delimiters[openerIdx] + + if opener.marker != closer.marker: + openerIdx -= jumps[openerIdx] + 1 + continue + + if opener.open and opener.end < 0: + isOddMatch = False + + # from spec: + # + # If one of the delimiters can both open and close emphasis, then the + # sum of the lengths of the delimiter runs containing the opening and + # closing delimiters must not be a multiple of 3 unless both lengths + # are multiples of 3. + # + if ( + (opener.close or closer.open) + and ((opener.length + closer.length) % 3 == 0) + and (opener.length % 3 != 0 or closer.length % 3 != 0) + ): + isOddMatch = True + + if not isOddMatch: + # If previous delimiter cannot be an opener, we can safely skip + # the entire sequence in future checks. This is required to make + # sure algorithm has linear complexity (see *_*_*_*_*_... case). + # + if openerIdx > 0 and not delimiters[openerIdx - 1].open: + lastJump = jumps[openerIdx - 1] + 1 + else: + lastJump = 0 + + jumps[closerIdx] = closerIdx - openerIdx + lastJump + jumps[openerIdx] = lastJump + + closer.open = False + opener.end = closerIdx + opener.close = False + newMinOpenerIdx = -1 + + # treat next token as start of run, + # it optimizes skips in **<...>**a**<...>** pathological case + lastTokenIdx = -2 + + break + + openerIdx -= jumps[openerIdx] + 1 + + if newMinOpenerIdx != -1: + # If match for this delimiter run failed, we want to set lower bound for + # future lookups. This is required to make sure algorithm has linear + # complexity. + # + # See details here: + # https:#github.com/commonmark/cmark/issues/178#issuecomment-270417442 + # + openersBottom[closer.marker][ + (3 if closer.open else 0) + ((closer.length or 0) % 3) + ] = newMinOpenerIdx + + closerIdx += 1 + + +def link_pairs(state: StateInline) -> None: + tokens_meta = state.tokens_meta + maximum = len(state.tokens_meta) + + processDelimiters(state, state.delimiters) + + curr = 0 + while curr < maximum: + curr_meta = tokens_meta[curr] + if curr_meta and "delimiters" in curr_meta: + processDelimiters(state, curr_meta["delimiters"]) + curr += 1 diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/emphasis.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/emphasis.py new file mode 100644 index 0000000000000000000000000000000000000000..9a98f9e216c94db0217e986270aaaa72fcc99f7f --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/emphasis.py @@ -0,0 +1,102 @@ +# Process *this* and _that_ +# +from __future__ import annotations + +from .state_inline import Delimiter, StateInline + + +def tokenize(state: StateInline, silent: bool) -> bool: + """Insert each marker as a separate text token, and add it to delimiter list""" + start = state.pos + marker = state.src[start] + + if silent: + return False + + if marker not in ("_", "*"): + return False + + scanned = state.scanDelims(state.pos, marker == "*") + + for _ in range(scanned.length): + token = state.push("text", "", 0) + token.content = marker + state.delimiters.append( + Delimiter( + marker=ord(marker), + length=scanned.length, + token=len(state.tokens) - 1, + end=-1, + open=scanned.can_open, + close=scanned.can_close, + ) + ) + + state.pos += scanned.length + + return True + + +def _postProcess(state: StateInline, delimiters: list[Delimiter]) -> None: + i = len(delimiters) - 1 + while i >= 0: + startDelim = delimiters[i] + + # /* _ */ /* * */ + if startDelim.marker != 0x5F and startDelim.marker != 0x2A: + i -= 1 + continue + + # Process only opening markers + if startDelim.end == -1: + i -= 1 + continue + + endDelim = delimiters[startDelim.end] + + # If the previous delimiter has the same marker and is adjacent to this one, + # merge those into one strong delimiter. + # + # `whatever` -> `whatever` + # + isStrong = ( + i > 0 + and delimiters[i - 1].end == startDelim.end + 1 + # check that first two markers match and adjacent + and delimiters[i - 1].marker == startDelim.marker + and delimiters[i - 1].token == startDelim.token - 1 + # check that last two markers are adjacent (we can safely assume they match) + and delimiters[startDelim.end + 1].token == endDelim.token + 1 + ) + + ch = chr(startDelim.marker) + + token = state.tokens[startDelim.token] + token.type = "strong_open" if isStrong else "em_open" + token.tag = "strong" if isStrong else "em" + token.nesting = 1 + token.markup = ch + ch if isStrong else ch + token.content = "" + + token = state.tokens[endDelim.token] + token.type = "strong_close" if isStrong else "em_close" + token.tag = "strong" if isStrong else "em" + token.nesting = -1 + token.markup = ch + ch if isStrong else ch + token.content = "" + + if isStrong: + state.tokens[delimiters[i - 1].token].content = "" + state.tokens[delimiters[startDelim.end + 1].token].content = "" + i -= 1 + + i -= 1 + + +def postProcess(state: StateInline) -> None: + """Walk through delimiter list and replace text tokens with tags.""" + _postProcess(state, state.delimiters) + + for token in state.tokens_meta: + if token and "delimiters" in token: + _postProcess(state, token["delimiters"]) diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/entity.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/entity.py new file mode 100644 index 0000000000000000000000000000000000000000..ec9d39650e5bc533e694d3d6699677068d22c69f --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/entity.py @@ -0,0 +1,53 @@ +# Process html entity - {, ¯, ", ... +import re + +from ..common.entities import entities +from ..common.utils import fromCodePoint, isValidEntityCode +from .state_inline import StateInline + +DIGITAL_RE = re.compile(r"^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));", re.IGNORECASE) +NAMED_RE = re.compile(r"^&([a-z][a-z0-9]{1,31});", re.IGNORECASE) + + +def entity(state: StateInline, silent: bool) -> bool: + pos = state.pos + maximum = state.posMax + + if state.src[pos] != "&": + return False + + if pos + 1 >= maximum: + return False + + if state.src[pos + 1] == "#": + if match := DIGITAL_RE.search(state.src[pos:]): + if not silent: + match1 = match.group(1) + code = ( + int(match1[1:], 16) if match1[0].lower() == "x" else int(match1, 10) + ) + + token = state.push("text_special", "", 0) + token.content = ( + fromCodePoint(code) + if isValidEntityCode(code) + else fromCodePoint(0xFFFD) + ) + token.markup = match.group(0) + token.info = "entity" + + state.pos += len(match.group(0)) + return True + + else: + if (match := NAMED_RE.search(state.src[pos:])) and match.group(1) in entities: + if not silent: + token = state.push("text_special", "", 0) + token.content = entities[match.group(1)] + token.markup = match.group(0) + token.info = "entity" + + state.pos += len(match.group(0)) + return True + + return False diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/escape.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/escape.py new file mode 100644 index 0000000000000000000000000000000000000000..0fca6c84e035b83b21d5224be92fd4973f25b80b --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/escape.py @@ -0,0 +1,93 @@ +""" +Process escaped chars and hardbreaks +""" + +from ..common.utils import isStrSpace +from .state_inline import StateInline + + +def escape(state: StateInline, silent: bool) -> bool: + """Process escaped chars and hardbreaks.""" + pos = state.pos + maximum = state.posMax + + if state.src[pos] != "\\": + return False + + pos += 1 + + # '\' at the end of the inline block + if pos >= maximum: + return False + + ch1 = state.src[pos] + ch1_ord = ord(ch1) + if ch1 == "\n": + if not silent: + state.push("hardbreak", "br", 0) + pos += 1 + # skip leading whitespaces from next line + while pos < maximum: + ch = state.src[pos] + if not isStrSpace(ch): + break + pos += 1 + + state.pos = pos + return True + + escapedStr = state.src[pos] + + if ch1_ord >= 0xD800 and ch1_ord <= 0xDBFF and pos + 1 < maximum: + ch2 = state.src[pos + 1] + ch2_ord = ord(ch2) + if ch2_ord >= 0xDC00 and ch2_ord <= 0xDFFF: + escapedStr += ch2 + pos += 1 + + origStr = "\\" + escapedStr + + if not silent: + token = state.push("text_special", "", 0) + token.content = escapedStr if ch1 in _ESCAPED else origStr + token.markup = origStr + token.info = "escape" + + state.pos = pos + 1 + return True + + +_ESCAPED = { + "!", + '"', + "#", + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + ":", + ";", + "<", + "=", + ">", + "?", + "@", + "[", + "\\", + "]", + "^", + "_", + "`", + "{", + "|", + "}", + "~", +} diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/fragments_join.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/fragments_join.py new file mode 100644 index 0000000000000000000000000000000000000000..5eb88a14025793d02188392244c1099042cf3727 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/fragments_join.py @@ -0,0 +1,54 @@ +from .state_inline import StateInline + + +def fragments_join(state: StateInline) -> None: + """ + Clean up tokens after emphasis and strikethrough postprocessing: + merge adjacent text nodes into one and re-calculate all token levels + + This is necessary because initially emphasis delimiter markers (``*, _, ~``) + are treated as their own separate text tokens. Then emphasis rule either + leaves them as text (needed to merge with adjacent text) or turns them + into opening/closing tags (which messes up levels inside). + """ + level = 0 + maximum = len(state.tokens) + + curr = last = 0 + while curr < maximum: + # re-calculate levels after emphasis/strikethrough turns some text nodes + # into opening/closing tags + if state.tokens[curr].nesting < 0: + level -= 1 # closing tag + state.tokens[curr].level = level + if state.tokens[curr].nesting > 0: + level += 1 # opening tag + + if ( + state.tokens[curr].type == "text" + and curr + 1 < maximum + and state.tokens[curr + 1].type == "text" + ): + # Collapse a run of adjacent text nodes in a single join, instead + # of pairwise `a + b` concatenation. The pairwise form is O(L*k) + # in the size of the run because each step rebuilds the growing + # prefix; "".join is O(L). + parts = [state.tokens[curr].content] + curr += 1 + while curr < maximum and state.tokens[curr].type == "text": + parts.append(state.tokens[curr].content) + curr += 1 + merged = state.tokens[curr - 1] + merged.content = "".join(parts) + merged.level = level + state.tokens[last] = merged + last += 1 + continue + + if curr != last: + state.tokens[last] = state.tokens[curr] + last += 1 + curr += 1 + + if curr != last: + del state.tokens[last:] diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/html_inline.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/html_inline.py new file mode 100644 index 0000000000000000000000000000000000000000..9065e1d034da76270f7d3f1ba528132c8d57d341 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/html_inline.py @@ -0,0 +1,43 @@ +# Process html tags +from ..common.html_re import HTML_TAG_RE +from ..common.utils import isLinkClose, isLinkOpen +from .state_inline import StateInline + + +def isLetter(ch: int) -> bool: + lc = ch | 0x20 # to lower case + # /* a */ and /* z */ + return (lc >= 0x61) and (lc <= 0x7A) + + +def html_inline(state: StateInline, silent: bool) -> bool: + pos = state.pos + + if not state.md.options.get("html", None): + return False + + # Check start + maximum = state.posMax + if state.src[pos] != "<" or pos + 2 >= maximum: + return False + + # Quick fail on second char + ch = state.src[pos + 1] + if ch not in ("!", "?", "/") and not isLetter(ord(ch)): # /* / */ + return False + + match = HTML_TAG_RE.search(state.src[pos:]) + if not match: + return False + + if not silent: + token = state.push("html_inline", "", 0) + token.content = state.src[pos : pos + len(match.group(0))] + + if isLinkOpen(token.content): + state.linkLevel += 1 + if isLinkClose(token.content): + state.linkLevel -= 1 + + state.pos += len(match.group(0)) + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/image.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/image.py new file mode 100644 index 0000000000000000000000000000000000000000..005105b1c7ed1a93772c62af8bd5ef54d97dfebe --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/image.py @@ -0,0 +1,148 @@ +# Process ![image]( "title") +from __future__ import annotations + +from ..common.utils import isStrSpace, normalizeReference +from ..token import Token +from .state_inline import StateInline + + +def image(state: StateInline, silent: bool) -> bool: + label = None + href = "" + oldPos = state.pos + max = state.posMax + + if state.src[state.pos] != "!": + return False + + if state.pos + 1 < state.posMax and state.src[state.pos + 1] != "[": + return False + + labelStart = state.pos + 2 + labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, False) + + # parser failed to find ']', so it's not a valid link + if labelEnd < 0: + return False + + pos = labelEnd + 1 + + if pos < max and state.src[pos] == "(": + # + # Inline link + # + + # [link]( "title" ) + # ^^ skipping these spaces + pos += 1 + while pos < max: + ch = state.src[pos] + if not isStrSpace(ch) and ch != "\n": + break + pos += 1 + + if pos >= max: + return False + + # [link]( "title" ) + # ^^^^^^ parsing link destination + start = pos + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax) + if res.ok: + href = state.md.normalizeLink(res.str) + if state.md.validateLink(href): + pos = res.pos + else: + href = "" + + # [link]( "title" ) + # ^^ skipping these spaces + start = pos + while pos < max: + ch = state.src[pos] + if not isStrSpace(ch) and ch != "\n": + break + pos += 1 + + # [link]( "title" ) + # ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax, None) + if pos < max and start != pos and res.ok: + title = res.str + pos = res.pos + + # [link]( "title" ) + # ^^ skipping these spaces + while pos < max: + ch = state.src[pos] + if not isStrSpace(ch) and ch != "\n": + break + pos += 1 + else: + title = "" + + if pos >= max or state.src[pos] != ")": + state.pos = oldPos + return False + + pos += 1 + + else: + # + # Link reference + # + if "references" not in state.env: + return False + + # /* [ */ + if pos < max and state.src[pos] == "[": + start = pos + 1 + pos = state.md.helpers.parseLinkLabel(state, pos) + if pos >= 0: + label = state.src[start:pos] + pos += 1 + else: + pos = labelEnd + 1 + else: + pos = labelEnd + 1 + + # covers label == '' and label == undefined + # (collapsed reference link and shortcut reference link respectively) + if not label: + label = state.src[labelStart:labelEnd] + + label = normalizeReference(label) + + ref = state.env["references"].get(label, None) + if not ref: + state.pos = oldPos + return False + + href = ref["href"] + title = ref["title"] + + # + # We found the end of the link, and know for a fact it's a valid link + # so all that's left to do is to call tokenizer. + # + if not silent: + content = state.src[labelStart:labelEnd] + + tokens: list[Token] = [] + state.md.inline.parse(content, state.md, state.env, tokens) + + token = state.push("image", "img", 0) + token.attrs = {"src": href, "alt": ""} + token.children = tokens or None + token.content = content + + if title: + token.attrSet("title", title) + + # note, this is not part of markdown-it JS, but is useful for renderers + if label and state.md.options.get("store_labels", False): + token.meta["label"] = label + + state.pos = pos + state.posMax = max + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/link.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/link.py new file mode 100644 index 0000000000000000000000000000000000000000..2e92c7d83629f00283b5ed885637c8c4a851ffc7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/link.py @@ -0,0 +1,149 @@ +# Process [link]( "stuff") + +from ..common.utils import isStrSpace, normalizeReference +from .state_inline import StateInline + + +def link(state: StateInline, silent: bool) -> bool: + href = "" + title = "" + label = None + oldPos = state.pos + maximum = state.posMax + start = state.pos + parseReference = True + + if state.src[state.pos] != "[": + return False + + labelStart = state.pos + 1 + labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, True) + + # parser failed to find ']', so it's not a valid link + if labelEnd < 0: + return False + + pos = labelEnd + 1 + + if pos < maximum and state.src[pos] == "(": + # + # Inline link + # + + # might have found a valid shortcut link, disable reference parsing + parseReference = False + + # [link]( "title" ) + # ^^ skipping these spaces + pos += 1 + while pos < maximum: + ch = state.src[pos] + if not isStrSpace(ch) and ch != "\n": + break + pos += 1 + + if pos >= maximum: + return False + + # [link]( "title" ) + # ^^^^^^ parsing link destination + start = pos + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax) + if res.ok: + href = state.md.normalizeLink(res.str) + if state.md.validateLink(href): + pos = res.pos + else: + href = "" + + # [link]( "title" ) + # ^^ skipping these spaces + start = pos + while pos < maximum: + ch = state.src[pos] + if not isStrSpace(ch) and ch != "\n": + break + pos += 1 + + # [link]( "title" ) + # ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax) + if pos < maximum and start != pos and res.ok: + title = res.str + pos = res.pos + + # [link]( "title" ) + # ^^ skipping these spaces + while pos < maximum: + ch = state.src[pos] + if not isStrSpace(ch) and ch != "\n": + break + pos += 1 + + if pos >= maximum or state.src[pos] != ")": + # parsing a valid shortcut link failed, fallback to reference + parseReference = True + + pos += 1 + + if parseReference: + # + # Link reference + # + if "references" not in state.env: + return False + + if pos < maximum and state.src[pos] == "[": + start = pos + 1 + pos = state.md.helpers.parseLinkLabel(state, pos) + if pos >= 0: + label = state.src[start:pos] + pos += 1 + else: + pos = labelEnd + 1 + + else: + pos = labelEnd + 1 + + # covers label == '' and label == undefined + # (collapsed reference link and shortcut reference link respectively) + if not label: + label = state.src[labelStart:labelEnd] + + label = normalizeReference(label) + + ref = state.env["references"].get(label, None) + if not ref: + state.pos = oldPos + return False + + href = ref["href"] + title = ref["title"] + + # + # We found the end of the link, and know for a fact it's a valid link + # so all that's left to do is to call tokenizer. + # + if not silent: + state.pos = labelStart + state.posMax = labelEnd + + token = state.push("link_open", "a", 1) + token.attrs = {"href": href} + + if title: + token.attrSet("title", title) + + # note, this is not part of markdown-it JS, but is useful for renderers + if label and state.md.options.get("store_labels", False): + token.meta["label"] = label + + state.linkLevel += 1 + state.md.inline.tokenize(state) + state.linkLevel -= 1 + + token = state.push("link_close", "a", -1) + + state.pos = pos + state.posMax = maximum + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/linkify.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/linkify.py new file mode 100644 index 0000000000000000000000000000000000000000..3669396e3e7d51c125678f45a862139fe3b3fd9d --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/linkify.py @@ -0,0 +1,62 @@ +"""Process links like https://example.org/""" + +import re + +from .state_inline import StateInline + +# RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) +SCHEME_RE = re.compile(r"(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$", re.IGNORECASE) + + +def linkify(state: StateInline, silent: bool) -> bool: + """Rule for identifying plain-text links.""" + if not state.md.options.linkify: + return False + if state.linkLevel > 0: + return False + if not state.md.linkify: + raise ModuleNotFoundError("Linkify enabled but not installed.") + + pos = state.pos + maximum = state.posMax + + if ( + (pos + 3) > maximum + or state.src[pos] != ":" + or state.src[pos + 1] != "/" + or state.src[pos + 2] != "/" + ): + return False + + if not (match := SCHEME_RE.search(state.pending)): + return False + + proto = match.group(1) + if not (link := state.md.linkify.match_at_start(state.src[pos - len(proto) :])): + return False + url: str = link.url + + # disallow '*' at the end of the link (conflicts with emphasis) + url = url.rstrip("*") + + full_url = state.md.normalizeLink(url) + if not state.md.validateLink(full_url): + return False + + if not silent: + state.pending = state.pending[: -len(proto)] + + token = state.push("link_open", "a", 1) + token.attrs = {"href": full_url} + token.markup = "linkify" + token.info = "auto" + + token = state.push("text", "", 0) + token.content = state.md.normalizeLinkText(url) + + token = state.push("link_close", "a", -1) + token.markup = "linkify" + token.info = "auto" + + state.pos += len(url) - len(proto) + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/newline.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/newline.py new file mode 100644 index 0000000000000000000000000000000000000000..d05ee6dac712a2211ab24f90dbea64a99e4d80b0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/newline.py @@ -0,0 +1,44 @@ +"""Proceess '\n'.""" + +from ..common.utils import charStrAt, isStrSpace +from .state_inline import StateInline + + +def newline(state: StateInline, silent: bool) -> bool: + pos = state.pos + + if state.src[pos] != "\n": + return False + + pmax = len(state.pending) - 1 + maximum = state.posMax + + # ' \n' -> hardbreak + # Lookup in pending chars is bad practice! Don't copy to other rules! + # Pending string is stored in concat mode, indexed lookups will cause + # conversion to flat mode. + if not silent: + if pmax >= 0 and charStrAt(state.pending, pmax) == " ": + if pmax >= 1 and charStrAt(state.pending, pmax - 1) == " ": + # Find whitespaces tail of pending chars. + ws = pmax - 1 + while ws >= 1 and charStrAt(state.pending, ws - 1) == " ": + ws -= 1 + state.pending = state.pending[:ws] + + state.push("hardbreak", "br", 0) + else: + state.pending = state.pending[:-1] + state.push("softbreak", "br", 0) + + else: + state.push("softbreak", "br", 0) + + pos += 1 + + # skip heading spaces for next line + while pos < maximum and isStrSpace(state.src[pos]): + pos += 1 + + state.pos = pos + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/state_inline.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/state_inline.py new file mode 100644 index 0000000000000000000000000000000000000000..de35287d427969eb9354dd13a74e5372c85cbfab --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/state_inline.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +from dataclasses import dataclass +from typing import TYPE_CHECKING, Any, Literal, NamedTuple + +from ..common.utils import isMdAsciiPunct, isPunctChar, isWhiteSpace +from ..ruler import StateBase +from ..token import Token +from ..utils import EnvType + +if TYPE_CHECKING: + from markdown_it import MarkdownIt + + +@dataclass(slots=True) +class Delimiter: + # Char code of the starting marker (number). + marker: int + + # Total length of these series of delimiters. + length: int + + # A position of the token this delimiter corresponds to. + token: int + + # If this delimiter is matched as a valid opener, `end` will be + # equal to its position, otherwise it's `-1`. + end: int + + # Boolean flags that determine if this delimiter could open or close + # an emphasis. + open: bool + close: bool + + level: bool | None = None + + +class Scanned(NamedTuple): + can_open: bool + can_close: bool + length: int + + +class StateInline(StateBase): + def __init__( + self, src: str, md: MarkdownIt, env: EnvType, outTokens: list[Token] + ) -> None: + self.src = src + self.env = env + self.md = md + self.tokens = outTokens + self.tokens_meta: list[dict[str, Any] | None] = [None] * len(outTokens) + + self.pos = 0 + self.posMax = len(self.src) + self.level = 0 + self.pending = "" + self.pendingLevel = 0 + + # Stores { start: end } pairs. Useful for backtrack + # optimization of pairs parse (emphasis, strikes). + self.cache: dict[int, int] = {} + + # List of emphasis-like delimiters for current tag + self.delimiters: list[Delimiter] = [] + + # Stack of delimiter lists for upper level tags + self._prev_delimiters: list[list[Delimiter]] = [] + + # backticklength => last seen position + self.backticks: dict[int, int] = {} + self.backticksScanned = False + + # Counter used to disable inline linkify-it execution + # inside and markdown links + self.linkLevel = 0 + + def __repr__(self) -> str: + return ( + f"{self.__class__.__name__}" + f"(pos=[{self.pos} of {self.posMax}], token={len(self.tokens)})" + ) + + def pushPending(self) -> Token: + token = Token("text", "", 0) + token.content = self.pending + token.level = self.pendingLevel + self.tokens.append(token) + self.pending = "" + return token + + def push(self, ttype: str, tag: str, nesting: Literal[-1, 0, 1]) -> Token: + """Push new token to "stream". + If pending text exists - flush it as text token + """ + if self.pending: + self.pushPending() + + token = Token(ttype, tag, nesting) + token_meta = None + + if nesting < 0: + # closing tag + self.level -= 1 + self.delimiters = self._prev_delimiters.pop() + + token.level = self.level + + if nesting > 0: + # opening tag + self.level += 1 + self._prev_delimiters.append(self.delimiters) + self.delimiters = [] + token_meta = {"delimiters": self.delimiters} + + self.pendingLevel = self.level + self.tokens.append(token) + self.tokens_meta.append(token_meta) + return token + + def scanDelims(self, start: int, canSplitWord: bool) -> Scanned: + """ + Scan a sequence of emphasis-like markers, and determine whether + it can start an emphasis sequence or end an emphasis sequence. + + - start - position to scan from (it should point at a valid marker); + - canSplitWord - determine if these markers can be found inside a word + + """ + pos = start + maximum = self.posMax + marker = self.src[start] + + # treat beginning of the line as a whitespace + lastChar = self.src[start - 1] if start > 0 else " " + + while pos < maximum and self.src[pos] == marker: + pos += 1 + + count = pos - start + + # treat end of the line as a whitespace + nextChar = self.src[pos] if pos < maximum else " " + + isLastPunctChar = isMdAsciiPunct(ord(lastChar)) or isPunctChar(lastChar) + isNextPunctChar = isMdAsciiPunct(ord(nextChar)) or isPunctChar(nextChar) + + isLastWhiteSpace = isWhiteSpace(ord(lastChar)) + isNextWhiteSpace = isWhiteSpace(ord(nextChar)) + + left_flanking = not ( + isNextWhiteSpace + or (isNextPunctChar and not (isLastWhiteSpace or isLastPunctChar)) + ) + right_flanking = not ( + isLastWhiteSpace + or (isLastPunctChar and not (isNextWhiteSpace or isNextPunctChar)) + ) + + can_open = left_flanking and ( + canSplitWord or (not right_flanking) or isLastPunctChar + ) + can_close = right_flanking and ( + canSplitWord or (not left_flanking) or isNextPunctChar + ) + + return Scanned(can_open, can_close, count) diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/strikethrough.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/strikethrough.py new file mode 100644 index 0000000000000000000000000000000000000000..c9875e043abbacd6ce627964be7d7c70028a8199 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/strikethrough.py @@ -0,0 +1,173 @@ +# ~~strike through~~ (and optionally ~single tilde~) +from __future__ import annotations + +from .state_inline import Delimiter, StateInline + + +def tokenize(state: StateInline, silent: bool) -> bool: + """Insert each marker as a separate text token, and add it to delimiter list. + + When the ``strikethrough_single_tilde`` option is enabled on the + ``MarkdownIt`` instance, single ``~`` delimiters are also accepted and + runs of three or more tildes are rejected (matching GitHub's rendering behaviour). + """ + start = state.pos + ch = state.src[start] + + if silent: + return False + + if ch != "~": + return False + + scanned = state.scanDelims(state.pos, True) + length = scanned.length + + single_tilde = state.md.options.get("strikethrough_single_tilde", False) + + if single_tilde: + # GitHub mode: only accept exactly 1 or 2 tildes. + if length < 1: + return False + if length > 2: + # Consume 3+ tildes as plain text so the parser doesn't + # re-enter and match a subset of them. This intentionally + # matches GitHub's rendering, where โ‰ฅ3 tildes are literal text. + token = state.push("text", "", 0) + token.content = ch * length + state.pos += scanned.length + return True + + token = state.push("text", "", 0) + token.content = ch * length + state.delimiters.append( + Delimiter( + marker=ord(ch), + length=0, # disable "rule of 3" length checks + token=len(state.tokens) - 1, + end=-1, + open=scanned.can_open, + close=scanned.can_close, + ) + ) + else: + # Original markdown-it behaviour: minimum 2, split odd runs. + if length < 2: + return False + + if length % 2: + token = state.push("text", "", 0) + token.content = ch + length -= 1 + + i = 0 + while i < length: + token = state.push("text", "", 0) + token.content = ch + ch + state.delimiters.append( + Delimiter( + marker=ord(ch), + length=0, # disable "rule of 3" length checks + token=len(state.tokens) - 1, + end=-1, + open=scanned.can_open, + close=scanned.can_close, + ) + ) + + i += 2 + + state.pos += scanned.length + + return True + + +def _postProcess(state: StateInline, delimiters: list[Delimiter]) -> None: + loneMarkers = [] + maximum = len(delimiters) + single_tilde = state.md.options.get("strikethrough_single_tilde", False) + + i = 0 + while i < maximum: + startDelim = delimiters[i] + + if startDelim.marker != 0x7E: # /* ~ */ + i += 1 + continue + + if startDelim.end == -1: + i += 1 + continue + + endDelim = delimiters[startDelim.end] + + # In single-tilde mode, opener and closer must have the same width + # (both `~` or both `~~`). The width is stored in the text token. + if single_tilde: + opener_content = state.tokens[startDelim.token].content + closer_content = state.tokens[endDelim.token].content + if opener_content != closer_content: + i += 1 + continue + + markup = state.tokens[startDelim.token].content + + token = state.tokens[startDelim.token] + token.type = "s_open" + token.tag = "s" + token.nesting = 1 + token.markup = markup + token.content = "" + + token = state.tokens[endDelim.token] + token.type = "s_close" + token.tag = "s" + token.nesting = -1 + token.markup = markup + token.content = "" + + if ( + state.tokens[endDelim.token - 1].type == "text" + and state.tokens[endDelim.token - 1].content == "~" + ): + loneMarkers.append(endDelim.token - 1) + + i += 1 + + # If a marker sequence has an odd number of characters, it's split + # like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the + # start of the sequence. + # + # So, we have to move all those markers after subsequent s_close tags. + # + while loneMarkers: + i = loneMarkers.pop() + j = i + 1 + + while (j < len(state.tokens)) and (state.tokens[j].type == "s_close"): + j += 1 + + j -= 1 + + if i != j: + token = state.tokens[j] + state.tokens[j] = state.tokens[i] + state.tokens[i] = token + + +def postProcess(state: StateInline) -> None: + """Walk through delimiter list and replace text tokens with tags.""" + tokens_meta = state.tokens_meta + maximum = len(state.tokens_meta) + _postProcess(state, state.delimiters) + + curr = 0 + while curr < maximum: + try: + curr_meta = tokens_meta[curr] + except IndexError: + pass + else: + if curr_meta and "delimiters" in curr_meta: + _postProcess(state, curr_meta["delimiters"]) + curr += 1 diff --git a/python/user_packages/Python313/site-packages/markdown_it/rules_inline/text.py b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/text.py new file mode 100644 index 0000000000000000000000000000000000000000..ef0cc9cec55e253a8eb17b37d593b1c320374cf5 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it/rules_inline/text.py @@ -0,0 +1,23 @@ +# Skip text characters for text token, place those to pending buffer +# and increment current pos +from .state_inline import StateInline + +# Rule to skip pure text + + +def text(state: StateInline, silent: bool) -> bool: + pos = state.pos + posMax = state.posMax + + terminator_char = state.md.inline.terminator_re.search(state.src, pos) + pos = terminator_char.start() if terminator_char else posMax + + if pos == state.pos: + return False + + if not silent: + state.pending += state.src[state.pos : pos] + + state.pos = pos + + return True diff --git a/python/user_packages/Python313/site-packages/markdown_it_py-4.2.0.dist-info/licenses/LICENSE b/python/user_packages/Python313/site-packages/markdown_it_py-4.2.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..582ddf59e08277fe6e78cee924d2c84805fe36fe --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it_py-4.2.0.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 ExecutableBookProject + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/python/user_packages/Python313/site-packages/markdown_it_py-4.2.0.dist-info/licenses/LICENSE.markdown-it b/python/user_packages/Python313/site-packages/markdown_it_py-4.2.0.dist-info/licenses/LICENSE.markdown-it new file mode 100644 index 0000000000000000000000000000000000000000..7ffa058cb78f8fb9beb974d9fd429004d2d2e585 --- /dev/null +++ b/python/user_packages/Python313/site-packages/markdown_it_py-4.2.0.dist-info/licenses/LICENSE.markdown-it @@ -0,0 +1,22 @@ +Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/python/user_packages/Python313/site-packages/markupsafe-3.0.3.dist-info/licenses/LICENSE.txt b/python/user_packages/Python313/site-packages/markupsafe-3.0.3.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..c4700f975c9f76ccf9dec953157a92c549f450cc --- /dev/null +++ b/python/user_packages/Python313/site-packages/markupsafe-3.0.3.dist-info/licenses/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2010 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/python/user_packages/Python313/site-packages/markupsafe/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/markupsafe/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f14d65a854cc4645a55b7fd4a7e3fdac9a798ac Binary files /dev/null and b/python/user_packages/Python313/site-packages/markupsafe/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/markupsafe/__pycache__/_native.cpython-313.pyc b/python/user_packages/Python313/site-packages/markupsafe/__pycache__/_native.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be9b3107e536f0c6174e0d830f2fe333cd4ce42c Binary files /dev/null and b/python/user_packages/Python313/site-packages/markupsafe/__pycache__/_native.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow-3.26.2.dist-info/licenses/LICENSE b/python/user_packages/Python313/site-packages/marshmallow-3.26.2.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b20df7cab259cfce3d02bd8da515ce65870612b7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/marshmallow-3.26.2.dist-info/licenses/LICENSE @@ -0,0 +1,19 @@ +Copyright Steven Loria and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab4a3225d1e1936446764c667cbf4494cb93bf82 Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/base.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/base.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfda8016143a299057763b52f5c30f45c801e23a Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/base.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/class_registry.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/class_registry.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98e479ff1b608b8720805d0b274d6cda3e8c6ffc Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/class_registry.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/decorators.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/decorators.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52fb471b4d4e1b87b1e587c9bf093e19b7ad5cde Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/decorators.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/error_store.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/error_store.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df2b01cb904a756308612b8535c27a3fab3646b0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/error_store.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/exceptions.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fe477c43c31d283dfe4ed54031331b99629b29c Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/exceptions.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/fields.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/fields.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f2e0cb9f79c1b97ab31db208f0339a6c13fb732 Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/fields.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/orderedset.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/orderedset.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89e095df394c1cf7dc67cb16809827aed108740c Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/orderedset.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/schema.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/schema.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a666ff7e99a40c1c8017f74e9c766c73867f32b Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/schema.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/types.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/types.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e20d30baa2c3393c250ed3926c1b8af5cb1cb1ba Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/types.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46df19e2c2a9f5c10cf4c28bfdadf89779c5e4aa Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/validate.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/validate.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94744550f5fad7fb9bdb9b1559de666e4dfca006 Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/validate.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/marshmallow/__pycache__/warnings.cpython-313.pyc b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/warnings.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5e9d591e03aa364a4f74e0271e2aa0bcf8077b7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/marshmallow/__pycache__/warnings.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mdurl/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mdurl/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e25a38d2536a81c04417701215eccfafa9d46c67 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mdurl/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mdurl/__pycache__/_decode.cpython-313.pyc b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_decode.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f84cd48490eb0e3b72fb3e00d64c46ae8170ecd6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_decode.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mdurl/__pycache__/_encode.cpython-313.pyc b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_encode.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53df281b70663ee14678e994e12ef40b8c751619 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_encode.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mdurl/__pycache__/_format.cpython-313.pyc b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_format.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15fe29e70946f53d142a8e1a05f5023f912306c3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_format.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mdurl/__pycache__/_parse.cpython-313.pyc b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_parse.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8d7b0b4c81486887931df1e40d00ebe939b2424 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_parse.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mdurl/__pycache__/_url.cpython-313.pyc b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_url.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25ded162d6e2029662005867efda843f9ca49f37 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mdurl/__pycache__/_url.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07a074db08533f29973cbdfbbb0aeca104c64974 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/addonmanager.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/addonmanager.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1ff54bc262bfb4763e237b44a35909793c2071a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/addonmanager.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/certs.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/certs.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2ddeaccdb77aa3f184f80d689b971077c9aaea8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/certs.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/command.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/command.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ac852bcaaccc4de8d089860cdbc0f7adbf0c32d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/command.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/command_lexer.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/command_lexer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6f5023b03fcd060db4ea76798cd9cfbc4131ab5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/command_lexer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/connection.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/connection.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..917e4af7225c4b568551dc4f5d45941bf7b0440d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/connection.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/ctx.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/ctx.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ce64cd766c1c0b6434cc22f0a1b3e8b626da20a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/ctx.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/dns.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/dns.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c8de1c403ea34892a1e886a786ee2126f3872a3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/dns.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/eventsequence.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/eventsequence.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2fb9cb0c7e3d64b19e02ae4b8b5c82ca6b20b3cc Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/eventsequence.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/exceptions.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9c78c9349eb10d1208c1b7579e6cc69ecef1168 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/exceptions.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/flow.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/flow.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76bc5ed6b5ba0dc5be38f2cb50de139d651adcd8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/flow.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/flowfilter.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/flowfilter.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85ff23c3e77631102af18975290ee30fff146668 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/flowfilter.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/hooks.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/hooks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..234025f1fd74c8a6bbecfbd569ec5e28c37f5ead Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/hooks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/http.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/http.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e057bcb9c04dde48ba9c4d226c54a8c0b0493691 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/http.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/log.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/log.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66b94000a937b902c93991250b8c8b3ccac75b52 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/log.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/master.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/master.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52149dd3986aeb791b4d1bf8d4d5afa1bff75af7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/master.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/options.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/options.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cf19df4fdede13d6b3e388bc43f3407303cf08c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/options.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/optmanager.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/optmanager.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acf97f702ded9ba4a5ac902a12f20260983dfd0d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/optmanager.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/tcp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/tcp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bdd6d71732f742fd56ea1471352ec7607546c28 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/tcp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/tls.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/tls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..992badd7bef25c86e129878b478044ee936b59a9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/tls.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/types.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/types.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..154022cc42da2bb54ba8cea6a865c0a0ac1d3f9d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/types.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/udp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/udp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ba960630c91dd288c5dbf70df007fa2dbd8e2f4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/udp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/version.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/version.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2fa5a029178c09f13affe6ffa465d72496f4217e Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/version.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/websocket.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/websocket.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca5f4f2507da67372cde601cd7f59744666d1e33 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/__pycache__/websocket.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9710488f725e78410835feb65e2fe41e72d2abf4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/anticache.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/anticache.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0772163cbbf18bbd4f801bf4b2383066cd95e433 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/anticache.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/anticomp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/anticomp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49c751f593e726c97abf9f42ce9510f962805c0c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/anticomp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/asgiapp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/asgiapp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cbba967d3a55e9f454716379e4461b7c6934e23 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/asgiapp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/block.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/block.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..204c7ea8ef2ed40d10ff52ab7e9a28c2d5578e1c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/block.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/blocklist.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/blocklist.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96dc585abc54c9c7273c76b0905130614017edb7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/blocklist.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/browser.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/browser.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03431f6e36f2a336a99c5fd20c8ba0695a014215 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/browser.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/clientplayback.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/clientplayback.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c066a9a3d1ed3e0e93634839a464adbc5ebdbf5c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/clientplayback.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/command_history.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/command_history.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e13510e8118dd0d8c590033fd5d4203135626ed5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/command_history.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/comment.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/comment.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a17e3c37fc34687f6032261020c5c153d842f23f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/comment.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/core.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/core.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f48ce8969acee8bef10431b14713627f51f4f68 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/core.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/cut.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/cut.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6588ccbaee95624f752f8cd331b45cfe01d555e1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/cut.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/disable_h2c.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/disable_h2c.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b043948e9f98deed1d0bb3762fe38be74785e95 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/disable_h2c.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/dns_resolver.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/dns_resolver.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..014123c25a037b5f24e73466e1095fb2eff575c8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/dns_resolver.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/dumper.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/dumper.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1a5fa3ea75ea9d5e5064e30622124eb4b2d1ca0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/dumper.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/errorcheck.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/errorcheck.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d77ad0476f9555a0c2ea76870c0ad7bd0fdbb239 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/errorcheck.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/eventstore.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/eventstore.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3dfa082a8e39deb0d1e22d35c419849dedc6a5f1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/eventstore.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/export.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/export.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9188c708d1a6d22b6799288c202437d87f668a3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/export.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/intercept.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/intercept.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f86514002e59f725a345f099506fb47a6cb27ff Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/intercept.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/keepserving.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/keepserving.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b6c3ef67c2370531126c548f571edbd13758618 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/keepserving.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/maplocal.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/maplocal.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d9c636841de75099d8668ddafce3acfada98bd9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/maplocal.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/mapremote.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/mapremote.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..976fd99396192e6224e440a7db2c88094613dabe Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/mapremote.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/modifybody.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/modifybody.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e25aeffe65fa2b9d297a59aff54db31acf4ed77 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/modifybody.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/modifyheaders.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/modifyheaders.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd446d64e0ffc6084717154300ead6c2c118e735 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/modifyheaders.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/next_layer.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/next_layer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31487c8388f2b093a9ab8cb56e9157277e9f0849 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/next_layer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/onboarding.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/onboarding.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c50aae22eb490f8203bc19c8adc75dd81330ce08 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/onboarding.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/proxyauth.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/proxyauth.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c13af8c5352486a9e1d56f7b2d58dc90faff210 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/proxyauth.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/proxyserver.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/proxyserver.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a22396d266fcca0ff51aa41d5eca8df580e5a826 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/proxyserver.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/readfile.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/readfile.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a4a8bc2704e7114c5bf7fb20035c2fbc15afe384 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/readfile.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/save.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/save.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2a536df0ff7cf63da09299dd4b1713391df19ce Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/save.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/savehar.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/savehar.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c2aa6e083be6c22537cb0eaf4ab1dbea0a7ec0e Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/savehar.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/script.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/script.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8b1f860b613d22c311f2882c27e2516e6bebd69b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/script.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/server_side_events.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/server_side_events.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46a3c2326ae58ba4e08eee5be8833835ff801f04 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/server_side_events.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/serverplayback.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/serverplayback.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62ce82c02b3d52e90e92bb83e01095ca9aa21324 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/serverplayback.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/stickyauth.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/stickyauth.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3847611abb1ac49847ab5a0aa736b28f4c2f7e5d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/stickyauth.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/stickycookie.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/stickycookie.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2434d3f817bb8f44bcbddeb43d1c6c3538d44f49 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/stickycookie.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/strip_dns_https_records.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/strip_dns_https_records.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b518a91a6dd3a2a633fa7888282462fe7f0894ae Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/strip_dns_https_records.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/termlog.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/termlog.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..448de440995988be45b02950744cd5ac8079e9e2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/termlog.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/tlsconfig.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/tlsconfig.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45fb37840b6c3497e67002d8d022729e3cb13e21 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/tlsconfig.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/update_alt_svc.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/update_alt_svc.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33f82a0fc0f416a9398064c6eecce350570ae4c1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/update_alt_svc.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/upstream_auth.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/upstream_auth.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1166514da0d16ab690876558f4a2b2beb9e3b3d9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/upstream_auth.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/view.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/view.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca28a064abf471d312d12a9f656f2cd1ae225165 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/__pycache__/view.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4d15351373c9ef35c5857644f9ff9d88c0320cee --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/__init__.py @@ -0,0 +1,63 @@ +import os + +from flask import Flask +from flask import render_template + +from mitmproxy.options import CONF_BASENAME +from mitmproxy.options import CONF_DIR +from mitmproxy.utils.magisk import write_magisk_module + +app = Flask(__name__) +# will be overridden in the addon, setting this here so that the Flask app can be run standalone. +app.config["CONFDIR"] = CONF_DIR + + +@app.route("/") +def index(): + return render_template("index.html") + + +@app.route("/cert/pem") +def pem(): + return read_cert("pem", "application/x-x509-ca-cert") + + +@app.route("/cert/p12") +def p12(): + return read_cert("p12", "application/x-pkcs12") + + +@app.route("/cert/cer") +def cer(): + return read_cert("cer", "application/x-x509-ca-cert") + + +@app.route("/cert/magisk") +def magisk(): + filename = CONF_BASENAME + f"-magisk-module.zip" + p = os.path.join(app.config["CONFDIR"], filename) + p = os.path.expanduser(p) + + if not os.path.exists(p): + write_magisk_module(p) + + with open(p, "rb") as f: + cert = f.read() + + return cert, { + "Content-Type": "application/zip", + "Content-Disposition": f"attachment; {filename=!s}", + } + + +def read_cert(ext, content_type): + filename = CONF_BASENAME + f"-ca-cert.{ext}" + p = os.path.join(app.config["CONFDIR"], filename) + p = os.path.expanduser(p) + with open(p, "rb") as f: + cert = f.read() + + return cert, { + "Content-Type": content_type, + "Content-Disposition": f"attachment; {filename=!s}", + } diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82256ffdb80e1949736af0c1f5b542ca6b94fa63 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/bootstrap.min.css b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/bootstrap.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6e314df12ca62e1534df73a9f87f4a665e903a5d --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v4.5.2 (https://getbootstrap.com/) + * Copyright 2011-2020 The Bootstrap Authors + * Copyright 2011-2020 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-sm-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-sm-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-md-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-md-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-md-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-md-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-md-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-md-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-lg-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-lg-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-xl-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-xl-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#0069d9;border-color:#0062cc;box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{color:#fff;background-color:#5a6268;border-color:#545b62;box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#218838;border-color:#1e7e34;box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#138496;border-color:#117a8b;box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{color:#212529;background-color:#e0a800;border-color:#d39e00;box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c82333;border-color:#bd2130;box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{color:#212529;background-color:#e2e6ea;border-color:#dae0e5;box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{color:#fff;background-color:#23272b;border-color:#1d2124;box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before,.custom-control-input[disabled]~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item,.nav-fill>.nav-link{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem;border-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom,.card-img-top{-ms-flex-negative:0;flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{-ms-flex:1 0 0%;flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion{overflow-anchor:none}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item{display:-ms-flexbox;display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{-ms-flex-preferred-size:350px;flex-basis:350px;max-width:350px;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05);border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal.modal-static .modal-dialog{-webkit-transform:scale(1.02);transform:scale(1.02)}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:-webkit-min-content;height:-moz-min-content;height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:-webkit-min-content;height:-moz-min-content;height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;-ms-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;overflow-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}} diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/images/favicon.ico b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..3c3b891cd05cf3e59be4d8ef72967ce99ba26e1d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/images/favicon.ico differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/mitmproxy.css b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/mitmproxy.css new file mode 100644 index 0000000000000000000000000000000000000000..0acf56deafea23ff18bf028a2f4169f585823649 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/static/mitmproxy.css @@ -0,0 +1,44 @@ +.media { + min-height: 110px; +} +.media svg { + width: 64px; + margin-right: 1rem !important; +} + +.instructions { + padding-top: 1rem; + padding-bottom: 1rem; +} + +/* CSS-only collapsible */ +.show-instructions:target, .hide-instructions, .instructions { + display: none; +} +.show-instructions:target ~ .hide-instructions { + display: inline-block; +} +.show-instructions:target ~ .instructions { + display: inherit; +} + +.fa-apple { + color: #666; +} + +.fa-windows { + color: #0078D7; +} + +.fa-firefox-browser { + color: #E25821; +} + +.fa-android { + margin-top: 10px; + color: #3DDC84; +} + +.fa-certificate { + color: #FFBB00; +} \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/android-brands.svg b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/android-brands.svg new file mode 100644 index 0000000000000000000000000000000000000000..91b2ca28a90a9bd6e42b68184e20bb436cb49400 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/android-brands.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/apple-brands.svg b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/apple-brands.svg new file mode 100644 index 0000000000000000000000000000000000000000..4adc2be9ab77efa787c6bf52bed5529da47b4d44 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/apple-brands.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/certificate-solid.svg b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/certificate-solid.svg new file mode 100644 index 0000000000000000000000000000000000000000..8032e9ad4f2f3423311439a50be993401bf766e4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/certificate-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/firefox-browser-brands.svg b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/firefox-browser-brands.svg new file mode 100644 index 0000000000000000000000000000000000000000..316a13c53009ae4d2e17340107d045d74413801f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/firefox-browser-brands.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/linux-brands.svg b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/linux-brands.svg new file mode 100644 index 0000000000000000000000000000000000000000..51bc12cc49bdd7824e5e9244d2431aebc42c41e9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/linux-brands.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/windows-brands.svg b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/windows-brands.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f20650494a792cd8d1a35d20ba2857f8c41f8e9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/icons/windows-brands.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/index.html b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..dc95257e3111b972504769316004a4ae171e972e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/index.html @@ -0,0 +1,143 @@ +{% extends "layout.html" %} +{% block content %} +
+
+ +

Install mitmproxy's Certificate Authority

+ +{% macro entry(title, icon, filetype="pem") -%} +
  • + {% include 'icons/' + icon + '-brands.svg' %} + +
  • +{%- endmacro %} + +
      + {% call entry('Windows', 'windows', 'p12') %} +
      Manual Installation
      +
        +
      1. Double-click the P12 file to start the import wizard.
      2. +
      3. Select a certificate store location. This determines who will trust the certificate – only the current + Windows user or everyone on the machine. Click Next. +
      4. +
      5. Click Next again.
      6. +
      7. Leave Password blank and click Next.
      8. +
      9. Select Place all certificates in the following store, + then click Browse, and select Trusted Root Certification Authorities.
        + Click OK and Next. +
      10. +
      11. Click Finish.
      12. +
      13. Click Yes to confirm the warning dialog.
      14. +
      +
      Automated Installation
      +
        +
      1. Run certutil.exe -addstore root mitmproxy-ca-cert.cer + (details). +
      2. +
      + {% endcall %} + {% call entry('Linux', 'linux') %} +
      Ubuntu/Debian
      +
        +
      1. mv mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy.crt
      2. +
      3. sudo update-ca-certificates
      4. +
      +
      Fedora
      +
        +
      1. mv mitmproxy-ca-cert.pem /etc/pki/ca-trust/source/anchors/
      2. +
      3. sudo update-ca-trust
      4. +
      +
      Arch Linux
      +
        + sudo trust anchor --store mitmproxy-ca-cert.pem +
      + {% endcall %} + {% call entry('macOS', 'apple') %} +
      Manual Installation
      +
        +
      1. Double-click the PEM file to open the Keychain Access application.
      2. +
      3. Locate the new certificate "mitmproxy" in the list and double-click it.
      4. +
      5. Change Secure Socket Layer (SSL) to Always Trust.
      6. +
      7. Close the dialog window and enter your password if prompted.
      8. +
      +
      Automated Installation
      +
        +
      1. sudo security add-trusted-cert -d -p ssl -p basic -k /Library/Keychains/System.keychain mitmproxy-ca-cert.pem
      2. +
      + {% endcall %} + {% call entry('iOS โ€“ please read the instructions!', 'apple') %} +
      iOS 13+
      +
        +
      1. Use Safari to download the certificate. Other browsers may not open the proper installation prompt.
      2. +
      3. Install the new Profile (Settings -> General -> VPN & Device Management).
      4. +
      5. Important: Go to Settings -> General -> About -> Certificate Trust Settings. + Toggle mitmproxy to ON.
      6. +
      + {% endcall %} + {% call entry('Android', 'android', 'cer') %} +
      Android 10+
      +
        +
      1. Open the downloaded CER file.
      2. +
      3. Enter mitmproxy (or anything else) as the certificate name.
      4. +
      5. For credential use, select VPN and apps.
      6. +
      7. Click OK.
      8. +
      + +

      Some Android distributions require you to install the certificate via Settings -> Security -> Advanced -> + Encryption and credentials -> Install a certificate -> CA certificate (or similar) instead.

      + + + {% endcall %} + {% call entry('Firefox (does not use the OS root certificates)', 'firefox-browser') %} +
      Firefox
      +
        +
      1. Open Options -> Privacy & Security and click View Certificates... + at the bottom of the page.
      2. +
      3. Click Import... and select the downloaded certificate.
      4. +
      5. Enable Trust this CA to identify websites and click OK.
      6. +
      + {% endcall %} +
    • + {% include 'icons/certificate-solid.svg' %} + +
    • +
    +
    + +
    +
    + +

    + Other mitmproxy users cannot intercept your connection. + + This page is served by your local mitmproxy instance. The certificate you are about to install has been uniquely + generated on mitmproxy's first run and is not shared + between mitmproxy installations. + +

    + + +{% endblock %} diff --git a/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/layout.html b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/layout.html new file mode 100644 index 0000000000000000000000000000000000000000..26bb8eb427a25479491e6ee7e9185c480408b84e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/addons/onboardingapp/templates/layout.html @@ -0,0 +1,29 @@ + + + + + + + mitmproxy + + + + + + + +
    + {% block content %} + {% endblock %} +
    + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fece57919734ee3614a971bc278fc3cbdc6217a4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__init__.py @@ -0,0 +1,195 @@ +""" +mitmproxy includes a set of content views which can be used to +format/decode/highlight/reencode data. While they are mostly used for HTTP message +bodies, the may be used in other contexts, e.g. to decode WebSocket messages. + +See "Custom Contentviews" in the mitmproxy documentation for examples. +""" + +import logging +import sys +import traceback +import warnings +from dataclasses import dataclass + +from ..addonmanager import cut_traceback +from ._api import Contentview +from ._api import InteractiveContentview +from ._api import Metadata +from ._api import SyntaxHighlight +from ._compat import get # noqa: F401 +from ._compat import LegacyContentview +from ._compat import remove # noqa: F401 +from ._registry import ContentviewRegistry +from ._utils import ContentviewMessage +from ._utils import get_data +from ._utils import make_metadata +from ._view_css import css +from ._view_dns import dns +from ._view_graphql import graphql +from ._view_http3 import http3 +from ._view_image import image +from ._view_javascript import javascript +from ._view_json import json_view +from ._view_mqtt import mqtt +from ._view_multipart import multipart +from ._view_query import query +from ._view_raw import raw +from ._view_socketio import socket_io +from ._view_urlencoded import urlencoded +from ._view_wbxml import wbxml +from ._view_xml_html import xml_html +from ._view_zip import zip +from .base import View +import mitmproxy_rs.contentviews +from mitmproxy import flow +from mitmproxy.utils import strutils + +logger = logging.getLogger(__name__) + + +@dataclass +class ContentviewResult: + text: str + syntax_highlight: SyntaxHighlight + view_name: str | None + description: str + + +registry = ContentviewRegistry() + + +def prettify_message( + message: ContentviewMessage, + flow: flow.Flow, + view_name: str = "auto", + registry: ContentviewRegistry = registry, +) -> ContentviewResult: + data, enc = get_data(message) + if data is None: + return ContentviewResult( + text="Content is missing.", + syntax_highlight="error", + description="", + view_name=None, + ) + + # Determine the correct view + metadata = make_metadata(message, flow) + view = registry.get_view(data, metadata, view_name) + + # Finally, we can pretty-print! + try: + ret = ContentviewResult( + text=view.prettify(data, metadata), + syntax_highlight=view.syntax_highlight, + view_name=view.name, + description=enc, + ) + except Exception as e: + logger.debug(f"Contentview {view.name!r} failed: {e}", exc_info=True) + if view_name == "auto": + # If the contentview was chosen as the best matching one, fall back to raw. + ret = ContentviewResult( + text=raw.prettify(data, metadata), + syntax_highlight=raw.syntax_highlight, + view_name=raw.name, + description=f"{enc}[failed to parse as {view.name}]", + ) + else: + # Cut the exception traceback for display. + exc, value, tb = sys.exc_info() + tb_cut = cut_traceback(tb, "prettify_message") + if ( + tb_cut == tb + ): # If there are no extra frames, just skip displaying the traceback. + tb_cut = None + # If the contentview has been set explicitly, we display a hard error. + err = "".join(traceback.format_exception(exc, value=value, tb=tb_cut)) + ret = ContentviewResult( + text=f"Couldn't parse as {view.name}:\n{err}", + syntax_highlight="error", + view_name=view.name, + description=enc, + ) + + ret.text = strutils.escape_control_characters(ret.text) + return ret + + +def reencode_message( + prettified: str, + message: ContentviewMessage, + flow: flow.Flow, + view_name: str, +) -> bytes: + metadata = make_metadata(message, flow) + view = registry[view_name.lower()] + if not isinstance(view, InteractiveContentview): + raise ValueError(f"Contentview {view.name} is not interactive.") + return view.reencode(prettified, metadata) + + +_views: list[Contentview] = [ + css, + dns, + graphql, + http3, + image, + javascript, + json_view, + mqtt, + multipart, + query, + raw, + socket_io, + urlencoded, + wbxml, + xml_html, + zip, +] +for view in _views: + registry.register(view) +for name in mitmproxy_rs.contentviews.__all__: + if name.startswith("_"): + continue + cv = getattr(mitmproxy_rs.contentviews, name) + if isinstance(cv, Contentview) and not isinstance(cv, type): + registry.register(cv) + + +def add(contentview: Contentview | type[Contentview]) -> None: + """ + Register a contentview for use in mitmproxy. + + You may pass a `Contentview` instance or the class itself. + When passing the class, its constructor will be invoked with no arguments. + """ + if isinstance(contentview, View): + warnings.warn( + f"`mitmproxy.contentviews.View` is deprecated since mitmproxy 12, " + f"migrate {contentview.__class__.__name__} to `mitmproxy.contentviews.Contentview` instead.", + stacklevel=2, + ) + contentview = LegacyContentview(contentview) + registry.register(contentview) + + +# hack: docstring where pdoc finds it. +SyntaxHighlight = SyntaxHighlight +""" +Syntax highlighting formats currently supported by mitmproxy. +Note that YAML is a superset of JSON; so if you'd like to highlight JSON, pick the YAML highlighter. + +*If you have a concrete use case for additional formats, please open an issue.* +""" + + +__all__ = [ + # Public Contentview API + "Contentview", + "InteractiveContentview", + "SyntaxHighlight", + "add", + "Metadata", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16ab5960792728df66ff1d8f89212a49cea10ab4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_api.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_api.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56f64011b1789e6a57b37cfe8c9027ba90eb4bad Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_api.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_compat.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_compat.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5afe240043681486ee911bfb48909893ae0a3de6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_compat.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_registry.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_registry.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a419979a687f49ce16d6f8f4ba156b27b84fcebc Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_registry.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91a17265bfaee306fb6d9ef3434eef743eace772 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_css.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_css.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39fbeb62caf6ba5fcbf23696056e5295d097aed0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_css.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_dns.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_dns.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f1a3e5e10cba660be7c324bac568bd1b6b75cdb Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_dns.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_graphql.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_graphql.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84df242aa1a4610dc97cc26f92a63b93f35eebf9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_graphql.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_http3.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_http3.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5addcf90463b35add62b5e5d2c5bbc5a58d7211 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_http3.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_javascript.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_javascript.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..286441f3487ae10532567a75003658f76a3a72d8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_javascript.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_json.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_json.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12915dadf83f41d6857e0038b084d07d5f3d4f61 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_json.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_mqtt.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_mqtt.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb9ca7da670711499750c206c925dc01403c2fb9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_mqtt.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_multipart.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_multipart.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d666f1e4dacd5cb25e862fbc9c5cb472d2b4e9e0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_multipart.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_query.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_query.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..164d3d3ae6b74153b53a1053d382b346885766b6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_query.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_raw.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_raw.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c892772b4fdf0ecd419bc25afac770fd1408340 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_raw.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_socketio.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_socketio.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..090644651a9ad25fc8336c07b22cfd5a4852d831 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_socketio.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_urlencoded.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_urlencoded.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0453e2536e8cd4a86533431f5cfeb658add83312 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_urlencoded.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_wbxml.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_wbxml.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5674c5d738042f3aca8efa116d3fe7bf664a4587 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_wbxml.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_xml_html.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_xml_html.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb354b7f4b8466cbecdd3dedd0a6fbd1e2046706 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_xml_html.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_zip.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_zip.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0dcbc50ebfd5b976a234a18584d0b399564c086f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/_view_zip.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/base.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/base.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a308290fa8e202c5bc339345218cbc80a8204978 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/__pycache__/base.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..02b42d0ae1c56bca5b2e714550cbe3e4f93e4255 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__init__.py @@ -0,0 +1,3 @@ +from .view import image + +__all__ = ["image"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2caee8b712fa4771e15c492862521873bc5b928 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/image_parser.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/image_parser.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de4ba56a36ef627cb83beb9a636c5457e39aaea3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/image_parser.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/view.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/view.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9da08244f4d560536991ebec74f2db2e96c32ab7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/__pycache__/view.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/image_parser.py b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/image_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..20d8aa3dc545a116d7fc92ad70390af21144c74f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/image_parser.py @@ -0,0 +1,119 @@ +import io + +from kaitaistruct import KaitaiStream + +from mitmproxy.contrib.kaitaistruct import gif +from mitmproxy.contrib.kaitaistruct import ico +from mitmproxy.contrib.kaitaistruct import jpeg +from mitmproxy.contrib.kaitaistruct import png + +type ImageMetadata = list[tuple[str, str]] + + +def parse_png(data: bytes) -> ImageMetadata: + img = png.Png(KaitaiStream(io.BytesIO(data))) + parts = [ + ("Format", "Portable network graphics"), + ("Size", f"{img.ihdr.width} x {img.ihdr.height} px"), + ] + for chunk in img.chunks: + if chunk.type == "gAMA": + parts.append(("gamma", str(chunk.body.gamma_int / 100000))) + elif chunk.type == "pHYs": + aspectx = chunk.body.pixels_per_unit_x + aspecty = chunk.body.pixels_per_unit_y + parts.append(("aspect", f"{aspectx} x {aspecty}")) + elif chunk.type == "tEXt": + parts.append((chunk.body.keyword, chunk.body.text)) + elif chunk.type == "iTXt": + parts.append((chunk.body.keyword, chunk.body.text)) + elif chunk.type == "zTXt": + parts.append( + (chunk.body.keyword, chunk.body.text_datastream.decode("iso8859-1")) + ) + return parts + + +def parse_gif(data: bytes) -> ImageMetadata: + img = gif.Gif(KaitaiStream(io.BytesIO(data))) + descriptor = img.logical_screen_descriptor + parts = [ + ("Format", "Compuserve GIF"), + ("Version", f"GIF{img.hdr.version}"), + ("Size", f"{descriptor.screen_width} x {descriptor.screen_height} px"), + ("background", str(descriptor.bg_color_index)), + ] + ext_blocks = [] + for block in img.blocks: + if block.block_type.name == "extension": + ext_blocks.append(block) + comment_blocks = [] + for block in ext_blocks: + if block.body.label._name_ == "comment": + comment_blocks.append(block) + for block in comment_blocks: + entries = block.body.body.entries + for entry in entries: + comment = entry.bytes + if comment != b"": + parts.append(("comment", str(comment))) + return parts + + +def parse_jpeg(data: bytes) -> ImageMetadata: + img = jpeg.Jpeg(KaitaiStream(io.BytesIO(data))) + parts = [("Format", "JPEG (ISO 10918)")] + for segment in img.segments: + if segment.marker._name_ == "sof0": + parts.append( + ("Size", f"{segment.data.image_width} x {segment.data.image_height} px") + ) + if segment.marker._name_ == "app0": + parts.append( + ( + "jfif_version", + f"({segment.data.version_major}, {segment.data.version_minor})", + ) + ) + parts.append( + ( + "jfif_density", + f"({segment.data.density_x}, {segment.data.density_y})", + ) + ) + parts.append(("jfif_unit", str(segment.data.density_units._value_))) + if segment.marker._name_ == "com": + parts.append(("comment", segment.data.decode("utf8", "backslashreplace"))) + if segment.marker._name_ == "app1": + if hasattr(segment.data, "body"): + for field in segment.data.body.data.body.ifd0.fields: + if field.data is not None: + parts.append( + (field.tag._name_, field.data.decode("UTF-8").strip("\x00")) + ) + return parts + + +def parse_ico(data: bytes) -> ImageMetadata: + img = ico.Ico(KaitaiStream(io.BytesIO(data))) + parts = [ + ("Format", "ICO"), + ("Number of images", str(img.num_images)), + ] + + for i, image in enumerate(img.images): + parts.append( + ( + f"Image {i + 1}", + "Size: {} x {}\n{: >18}Bits per pixel: {}\n{: >18}PNG: {}".format( + 256 if not image.width else image.width, + 256 if not image.height else image.height, + "", + image.bpp, + "", + image.is_png, + ), + ) + ) + + return parts diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/view.py b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/view.py new file mode 100644 index 0000000000000000000000000000000000000000..5389cba9589a17a680315864aaf30c928dfc399f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_image/view.py @@ -0,0 +1,57 @@ +from .._utils import merge_repeated_keys +from .._utils import yaml_dumps +from . import image_parser +from mitmproxy.contentviews._api import Contentview +from mitmproxy.contentviews._api import Metadata +from mitmproxy.contrib import imghdr + + +def test_ico(h, f): + if h.startswith(b"\x00\x00\x01\x00"): + return "ico" + return None + + +imghdr.tests.append(test_ico) + + +class ImageContentview(Contentview): + syntax_highlight = "yaml" + + def prettify( + self, + data: bytes, + metadata: Metadata, + ) -> str: + image_type = imghdr.what("", h=data) + if image_type == "png": + image_metadata = image_parser.parse_png(data) + elif image_type == "gif": + image_metadata = image_parser.parse_gif(data) + elif image_type == "jpeg": + image_metadata = image_parser.parse_jpeg(data) + elif image_type == "ico": + image_metadata = image_parser.parse_ico(data) + else: + image_metadata = [] + if image_type: + view_name = f"{image_type.upper()} Image" + else: + view_name = "Unknown Image" + return f"# {view_name}\n" + yaml_dumps(merge_repeated_keys(image_metadata)) + + def render_priority( + self, + data: bytes, + metadata: Metadata, + ) -> float: + return float( + bool( + metadata.content_type + and metadata.content_type.startswith("image/") + and not metadata.content_type.endswith("+xml") + ) + ) + + +image = ImageContentview() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_xml_html.py b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_xml_html.py new file mode 100644 index 0000000000000000000000000000000000000000..b43400772984ea03f2928748e1e601355604d8c2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_xml_html.py @@ -0,0 +1,278 @@ +import io +import re +import textwrap +from collections.abc import Iterable + +from mitmproxy.contentviews._api import Contentview +from mitmproxy.contentviews._api import Metadata +from mitmproxy.utils import sliding_window +from mitmproxy.utils import strutils + +""" +A custom XML/HTML prettifier. Compared to other prettifiers, its main features are: + +- Implemented in pure Python. +- Modifies whitespace only. +- Works with any input. +- Lazy evaluation. + +The implementation is split into two main parts: tokenization and formatting of tokens. +""" + +# http://www.xml.com/pub/a/2001/07/25/namingparts.html - this is close enough for what we do. +REGEX_TAG = re.compile(r"[a-zA-Z0-9._:\-]+(?!=)") +# https://www.w3.org/TR/html5/syntax.html#void-elements +HTML_VOID_ELEMENTS = { + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr", +} +NO_INDENT_TAGS = {"xml", "doctype", "html"} +INDENT = 2 + + +class Token: + def __init__(self, data): + self.data = data + + def __repr__(self): + return f"{type(self).__name__}({self.data})" + + +class Text(Token): + @property + def text(self): + return self.data.strip() + + +class Tag(Token): + @property + def tag(self): + t = REGEX_TAG.search(self.data) + if t is not None: + return t.group(0).lower() + return "" + + @property + def is_comment(self) -> bool: + return self.data.startswith("") + elif self.is_cdata: + return self.data.endswith("]]>") + else: + # This fails for attributes that contain an unescaped ">" + return self.data.endswith(">") + + +def tokenize(data: str) -> Iterable[Token]: + token: Token = Text("") + + i = 0 + + def readuntil(char, start, include=1): + nonlocal i + end = data.find(char, start) + if end == -1: + end = len(data) + ret = data[i : end + include] + i = end + include + return ret + + while i < len(data): + if isinstance(token, Text): + token.data = readuntil("<", i, 0) + if token.text: + yield token + token = Tag("") + elif isinstance(token, Tag): + token.data += readuntil(">", i, 1) + if token.done: + yield token + token = Text("") + if token.data.strip(): + yield token + + +def indent_text(data: str, prefix: str) -> str: + # Add spacing to first line so that we dedent in cases like this: + #
  • This is + # example text + # over multiple lines + #
  • + dedented = textwrap.dedent(" " * 32 + data).strip() + return textwrap.indent(dedented, prefix[:32]) + + +def is_inline_text(a: Token | None, b: Token | None, c: Token | None) -> bool: + if isinstance(a, Tag) and isinstance(b, Text) and isinstance(c, Tag): + if a.is_opening and "\n" not in b.data and c.is_closing and a.tag == c.tag: + return True + return False + + +def is_inline( + prev2: Token | None, + prev1: Token | None, + t: Token | None, + next1: Token | None, + next2: Token | None, +) -> bool: + if isinstance(t, Text): + return is_inline_text(prev1, t, next1) + elif isinstance(t, Tag): + if is_inline_text(prev2, prev1, t) or is_inline_text(t, next1, next2): + return True + if ( + isinstance(next1, Tag) + and t.is_opening + and next1.is_closing + and t.tag == next1.tag + ): + return True #
    (start tag) + if ( + isinstance(prev1, Tag) + and prev1.is_opening + and t.is_closing + and prev1.tag == t.tag + ): + return True #
    (end tag) + return False + + +class ElementStack: + """ + Keep track of how deeply nested our document is. + """ + + def __init__(self): + self.open_tags = [] + self.indent = "" + + def push_tag(self, tag: str): + if len(self.open_tags) > 16: + return + self.open_tags.append(tag) + if tag not in NO_INDENT_TAGS: + self.indent += " " * INDENT + + def pop_tag(self, tag: str): + if tag in self.open_tags: + remove_indent = 0 + while True: + t = self.open_tags.pop() + if t not in NO_INDENT_TAGS: + remove_indent += INDENT + if t == tag: + break + self.indent = self.indent[:-remove_indent] + else: + pass # this closing tag has no start tag. let's keep indentation as-is. + + +def format_xml(tokens: Iterable[Token]) -> str: + out = io.StringIO() + + context = ElementStack() + + for prev2, prev1, token, next1, next2 in sliding_window.window(tokens, 2, 2): + if isinstance(token, Tag): + if token.is_opening: + out.write(indent_text(token.data, context.indent)) + + if not is_inline(prev2, prev1, token, next1, next2): + out.write("\n") + + context.push_tag(token.tag) + elif token.is_closing: + context.pop_tag(token.tag) + + if is_inline(prev2, prev1, token, next1, next2): + out.write(token.data) + else: + out.write(indent_text(token.data, context.indent)) + out.write("\n") + + else: # self-closing + out.write(indent_text(token.data, context.indent)) + out.write("\n") + elif isinstance(token, Text): + if is_inline(prev2, prev1, token, next1, next2): + out.write(token.text) + else: + out.write(indent_text(token.data, context.indent)) + out.write("\n") + else: # pragma: no cover + raise RuntimeError() + + return out.getvalue() + + +class XmlHtmlContentview(Contentview): + __content_types = ("text/xml", "text/html") + name = "XML/HTML" + syntax_highlight = "xml" + + def prettify( + self, + data: bytes, + metadata: Metadata, + ) -> str: + if metadata.http_message: + data_str = metadata.http_message.get_text(strict=False) or "" + else: + data_str = data.decode("utf8", "backslashreplace") + tokens = tokenize(data_str) + return format_xml(tokens) + + def render_priority( + self, + data: bytes, + metadata: Metadata, + ) -> float: + if not data: + return 0 + if metadata.content_type in self.__content_types: + return 1 + elif strutils.is_xml(data): + return 0.4 + return 0 + + +xml_html = XmlHtmlContentview() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_zip.py b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_zip.py new file mode 100644 index 0000000000000000000000000000000000000000..2bff22169d8dfce3a93fb196980fd84858fa6d19 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contentviews/_view_zip.py @@ -0,0 +1,22 @@ +import io +import zipfile + +from mitmproxy.contentviews._api import Contentview +from mitmproxy.contentviews._api import Metadata +from mitmproxy.contentviews._utils import yaml_dumps + + +class ZipContentview(Contentview): + name = "ZIP Archive" + syntax_highlight = "yaml" + + def prettify(self, data: bytes, metadata: Metadata) -> str: + with zipfile.ZipFile(io.BytesIO(data), "r") as zip_file: + filenames = [info.filename for info in zip_file.infolist()] + return yaml_dumps(filenames) if filenames else "(empty zip file)" + + def render_priority(self, data: bytes, metadata: Metadata) -> float: + return 1.0 if data and metadata.content_type == "application/zip" else 0 + + +zip = ZipContentview() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/README.md b/python/user_packages/Python313/site-packages/mitmproxy/contrib/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d327a1f9ae39118e91050da8c39f3dd6804a4467 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/README.md @@ -0,0 +1,4 @@ +# mitmproxy/contrib + +This directory includes vendored code from other sources. +See the respective README and LICENSE files for details. diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6dc3f7d31fb474efa5ed997e46cc5829e9cd4c2c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/__pycache__/imghdr.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/__pycache__/imghdr.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9688f1ec105a69fbfd52ff5f69ca469e0dde59a3 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/__pycache__/imghdr.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/LICENSE.BSD-3 b/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/LICENSE.BSD-3 new file mode 100644 index 0000000000000000000000000000000000000000..d12a849186982399c537c5b9a8fd77bf2edd5eab --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/LICENSE.BSD-3 @@ -0,0 +1,28 @@ +Copyright 2014 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f32d0d964c7397a0dbcffd9c073e34d8cbe0c3ff --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/__init__.py @@ -0,0 +1,159 @@ +""" +SPDX-License-Identifier: BSD-3-Clause + +A vendored copy of click.style() @ 4f7b255 +""" +import typing as t + +_ansi_colors = { + "black": 30, + "red": 31, + "green": 32, + "yellow": 33, + "blue": 34, + "magenta": 35, + "cyan": 36, + "white": 37, + "reset": 39, + "bright_black": 90, + "bright_red": 91, + "bright_green": 92, + "bright_yellow": 93, + "bright_blue": 94, + "bright_magenta": 95, + "bright_cyan": 96, + "bright_white": 97, +} +_ansi_reset_all = "\033[0m" + + +def _interpret_color( + color: t.Union[int, t.Tuple[int, int, int], str], offset: int = 0 +) -> str: + if isinstance(color, int): + return f"{38 + offset};5;{color:d}" + + if isinstance(color, (tuple, list)): + r, g, b = color + return f"{38 + offset};2;{r:d};{g:d};{b:d}" + + return str(_ansi_colors[color] + offset) + + +def style( + text: t.Any, + fg: t.Optional[t.Union[int, t.Tuple[int, int, int], str]] = None, + bg: t.Optional[t.Union[int, t.Tuple[int, int, int], str]] = None, + bold: t.Optional[bool] = None, + dim: t.Optional[bool] = None, + underline: t.Optional[bool] = None, + overline: t.Optional[bool] = None, + italic: t.Optional[bool] = None, + blink: t.Optional[bool] = None, + reverse: t.Optional[bool] = None, + strikethrough: t.Optional[bool] = None, + reset: bool = True, +) -> str: + """Styles a text with ANSI styles and returns the new string. By + default the styling is self contained which means that at the end + of the string a reset code is issued. This can be prevented by + passing ``reset=False``. + Examples:: + click.echo(click.style('Hello World!', fg='green')) + click.echo(click.style('ATTENTION!', blink=True)) + click.echo(click.style('Some things', reverse=True, fg='cyan')) + click.echo(click.style('More colors', fg=(255, 12, 128), bg=117)) + Supported color names: + * ``black`` (might be a gray) + * ``red`` + * ``green`` + * ``yellow`` (might be an orange) + * ``blue`` + * ``magenta`` + * ``cyan`` + * ``white`` (might be light gray) + * ``bright_black`` + * ``bright_red`` + * ``bright_green`` + * ``bright_yellow`` + * ``bright_blue`` + * ``bright_magenta`` + * ``bright_cyan`` + * ``bright_white`` + * ``reset`` (reset the color code only) + If the terminal supports it, color may also be specified as: + - An integer in the interval [0, 255]. The terminal must support + 8-bit/256-color mode. + - An RGB tuple of three integers in [0, 255]. The terminal must + support 24-bit/true-color mode. + See https://en.wikipedia.org/wiki/ANSI_color and + https://gist.github.com/XVilka/8346728 for more information. + :param text: the string to style with ansi codes. + :param fg: if provided this will become the foreground color. + :param bg: if provided this will become the background color. + :param bold: if provided this will enable or disable bold mode. + :param dim: if provided this will enable or disable dim mode. This is + badly supported. + :param underline: if provided this will enable or disable underline. + :param overline: if provided this will enable or disable overline. + :param italic: if provided this will enable or disable italic. + :param blink: if provided this will enable or disable blinking. + :param reverse: if provided this will enable or disable inverse + rendering (foreground becomes background and the + other way round). + :param strikethrough: if provided this will enable or disable + striking through text. + :param reset: by default a reset-all code is added at the end of the + string which means that styles do not carry over. This + can be disabled to compose styles. + .. versionchanged:: 8.0 + A non-string ``message`` is converted to a string. + .. versionchanged:: 8.0 + Added support for 256 and RGB color codes. + .. versionchanged:: 8.0 + Added the ``strikethrough``, ``italic``, and ``overline`` + parameters. + .. versionchanged:: 7.0 + Added support for bright colors. + .. versionadded:: 2.0 + """ + if not isinstance(text, str): + text = str(text) + + bits = [] + + if fg: + try: + bits.append(f"\033[{_interpret_color(fg)}m") + except KeyError: + raise TypeError(f"Unknown color {fg!r}") from None + + if bg: + try: + bits.append(f"\033[{_interpret_color(bg, 10)}m") + except KeyError: + raise TypeError(f"Unknown color {bg!r}") from None + + if bold is not None: + bits.append(f"\033[{1 if bold else 22}m") + if dim is not None: + bits.append(f"\033[{2 if dim else 22}m") + if underline is not None: + bits.append(f"\033[{4 if underline else 24}m") + if overline is not None: + bits.append(f"\033[{53 if overline else 55}m") + if italic is not None: + bits.append(f"\033[{3 if italic else 23}m") + if blink is not None: + bits.append(f"\033[{5 if blink else 25}m") + if reverse is not None: + bits.append(f"\033[{7 if reverse else 27}m") + if strikethrough is not None: + bits.append(f"\033[{9 if strikethrough else 29}m") + bits.append(text) + if reset: + bits.append(_ansi_reset_all) + return "".join(bits) + + +__all__ = ["style"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44c2e56f0d082ea31367bbca88ecb55eb9fb65b2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/click/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/imghdr.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/imghdr.py new file mode 100644 index 0000000000000000000000000000000000000000..4634819405096de856bc5c2e885fb23160444fef --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/imghdr.py @@ -0,0 +1,142 @@ +# A vendored copy of Python's imghdr module, which is slated for removal in Python 3.13. +# +# Source: https://github.com/python/cpython/blob/3.12/Lib/imghdr.py +# SPDX-License-Identifier: PSF-2.0 + +"""Recognize image file formats based on their first few bytes.""" + +from os import PathLike +import warnings + +__all__ = ["what"] + + +# warnings._deprecated(__name__, remove=(3, 13)) + + +#-------------------------# +# Recognize image headers # +#-------------------------# + +def what(file, h=None): + """Return the type of image contained in a file or byte stream.""" + f = None + try: + if h is None: + if isinstance(file, (str, PathLike)): + f = open(file, 'rb') + h = f.read(32) + else: + location = file.tell() + h = file.read(32) + file.seek(location) + for tf in tests: + res = tf(h, f) + if res: + return res + finally: + if f: f.close() + return None + + +#---------------------------------# +# Subroutines per image file type # +#---------------------------------# + +tests = [] + +def test_jpeg(h, f): + """Test for JPEG data with JFIF or Exif markers; and raw JPEG.""" + if h[6:10] in (b'JFIF', b'Exif'): + return 'jpeg' + elif h[:4] == b'\xff\xd8\xff\xdb': + return 'jpeg' + +tests.append(test_jpeg) + +def test_png(h, f): + """Verify if the image is a PNG.""" + if h.startswith(b'\211PNG\r\n\032\n'): + return 'png' + +tests.append(test_png) + +def test_gif(h, f): + """Verify if the image is a GIF ('87 or '89 variants).""" + if h[:6] in (b'GIF87a', b'GIF89a'): + return 'gif' + +tests.append(test_gif) + +def test_tiff(h, f): + """Verify if the image is a TIFF (can be in Motorola or Intel byte order).""" + if h[:2] in (b'MM', b'II'): + return 'tiff' + +tests.append(test_tiff) + +def test_rgb(h, f): + """test for the SGI image library.""" + if h.startswith(b'\001\332'): + return 'rgb' + +tests.append(test_rgb) + +def test_pbm(h, f): + """Verify if the image is a PBM (portable bitmap).""" + if len(h) >= 3 and \ + h[0] == ord(b'P') and h[1] in b'14' and h[2] in b' \t\n\r': + return 'pbm' + +tests.append(test_pbm) + +def test_pgm(h, f): + """Verify if the image is a PGM (portable graymap).""" + if len(h) >= 3 and \ + h[0] == ord(b'P') and h[1] in b'25' and h[2] in b' \t\n\r': + return 'pgm' + +tests.append(test_pgm) + +def test_ppm(h, f): + """Verify if the image is a PPM (portable pixmap).""" + if len(h) >= 3 and \ + h[0] == ord(b'P') and h[1] in b'36' and h[2] in b' \t\n\r': + return 'ppm' + +tests.append(test_ppm) + +def test_rast(h, f): + """test for the Sun raster file.""" + if h.startswith(b'\x59\xA6\x6A\x95'): + return 'rast' + +tests.append(test_rast) + +def test_xbm(h, f): + """Verify if the image is a X bitmap (X10 or X11).""" + if h.startswith(b'#define '): + return 'xbm' + +tests.append(test_xbm) + +def test_bmp(h, f): + """Verify if the image is a BMP file.""" + if h.startswith(b'BM'): + return 'bmp' + +tests.append(test_bmp) + +def test_webp(h, f): + """Verify if the image is a WebP.""" + if h.startswith(b'RIFF') and h[8:12] == b'WEBP': + return 'webp' + +tests.append(test_webp) + +def test_exr(h, f): + """verify is the image ia a OpenEXR fileOpenEXR.""" + if h.startswith(b'\x76\x2f\x31\x01'): + return 'exr' + +tests.append(test_exr) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/LICENSE b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..45da807914319922966d5ae40f0aef0a8312d17c --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/LICENSE @@ -0,0 +1 @@ +Either MIT or CC-0 - see the individual .ksy files for the respective license. diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/README.md b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ed7104cd94cdd89b6d1674eea87e6ed96763af1d --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/README.md @@ -0,0 +1,3 @@ +# Kaitai Struct Formats + +Most of the formats here are vendored from https://github.com/kaitai-io/kaitai_struct_formats/. diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eae272af3640470356565bd0c8471a8dbad01e4e Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/dtls_client_hello.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/dtls_client_hello.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e71d05436c048ec245fec3cc12af9c57928dc465 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/dtls_client_hello.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/exif.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/exif.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7693d6971226f06cbe345360d638f13022a40090 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/exif.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/gif.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/gif.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d88fe7001a0601bba78b0467cfe9503307cec7a6 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/gif.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/google_protobuf.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/google_protobuf.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d90af81052c18839dc4a39ab4ace53d65372829 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/google_protobuf.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/ico.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/ico.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc701039836a886a7a3e23c1a1ce666c25ed7d22 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/ico.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/jpeg.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/jpeg.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44460519dada177c2ca3f876050b81fa98e01f4d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/jpeg.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/png.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/png.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f05331f00d53fa128b3b2db6fac1183007df527 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/png.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/tls_client_hello.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/tls_client_hello.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1cbe3f1587ea4bf68e5405b1b988377eb24dbe2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/tls_client_hello.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/vlq_base128_le.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/vlq_base128_le.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fb931d0febfe3245e352cbd585bc05559843c3f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/__pycache__/vlq_base128_le.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/dtls_client_hello.ksy b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/dtls_client_hello.ksy new file mode 100644 index 0000000000000000000000000000000000000000..43a77cf972035add904e1341c3e297522e2ff889 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/dtls_client_hello.ksy @@ -0,0 +1,140 @@ +meta: + id: dtls_client_hello + endian: be + license: MIT + +seq: + - id: version + type: version + + - id: random + type: random + + - id: session_id + type: session_id + + - id: cookie + type: cookie + + - id: cipher_suites + type: cipher_suites + + - id: compression_methods + type: compression_methods + + - id: extensions + type: extensions + if: _io.eof == false + +types: + version: + seq: + - id: major + type: u1 + + - id: minor + type: u1 + + random: + seq: + - id: gmt_unix_time + type: u4 + + - id: random + size: 28 + + session_id: + seq: + - id: len + type: u1 + + - id: sid + size: len + + cookie: + seq: + - id: len + type: u1 + + - id: cookie + size: len + + cipher_suites: + seq: + - id: len + type: u2 + + - id: cipher_suites + type: u2 + repeat: expr + repeat-expr: len/2 + + compression_methods: + seq: + - id: len + type: u1 + + - id: compression_methods + size: len + + extensions: + seq: + - id: len + type: u2 + + - id: extensions + type: extension + repeat: eos + + extension: + seq: + - id: type + type: u2 + + - id: len + type: u2 + + - id: body + size: len + type: + switch-on: type + cases: + 0: sni + 16: alpn + + sni: + seq: + - id: list_length + type: u2 + + - id: server_names + type: server_name + repeat: eos + + server_name: + seq: + - id: name_type + type: u1 + + - id: length + type: u2 + + - id: host_name + size: length + + alpn: + seq: + - id: ext_len + type: u2 + + - id: alpn_protocols + type: protocol + repeat: eos + + protocol: + seq: + - id: strlen + type: u1 + + - id: name + size: strlen diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/dtls_client_hello.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/dtls_client_hello.py new file mode 100644 index 0000000000000000000000000000000000000000..b581a08a7febb0bcb4d256c9a55bd33630f2b087 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/dtls_client_hello.py @@ -0,0 +1,202 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class DtlsClientHello(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.version = DtlsClientHello.Version(self._io, self, self._root) + self.random = DtlsClientHello.Random(self._io, self, self._root) + self.session_id = DtlsClientHello.SessionId(self._io, self, self._root) + self.cookie = DtlsClientHello.Cookie(self._io, self, self._root) + self.cipher_suites = DtlsClientHello.CipherSuites(self._io, self, self._root) + self.compression_methods = DtlsClientHello.CompressionMethods(self._io, self, self._root) + if self._io.is_eof() == False: + self.extensions = DtlsClientHello.Extensions(self._io, self, self._root) + + + class ServerName(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.name_type = self._io.read_u1() + self.length = self._io.read_u2be() + self.host_name = self._io.read_bytes(self.length) + + + class Random(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.gmt_unix_time = self._io.read_u4be() + self.random = self._io.read_bytes(28) + + + class SessionId(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u1() + self.sid = self._io.read_bytes(self.len) + + + class Sni(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.list_length = self._io.read_u2be() + self.server_names = [] + i = 0 + while not self._io.is_eof(): + self.server_names.append(DtlsClientHello.ServerName(self._io, self, self._root)) + i += 1 + + + + class CipherSuites(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u2be() + self.cipher_suites = [] + for i in range(self.len // 2): + self.cipher_suites.append(self._io.read_u2be()) + + + + class CompressionMethods(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u1() + self.compression_methods = self._io.read_bytes(self.len) + + + class Alpn(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.ext_len = self._io.read_u2be() + self.alpn_protocols = [] + i = 0 + while not self._io.is_eof(): + self.alpn_protocols.append(DtlsClientHello.Protocol(self._io, self, self._root)) + i += 1 + + + + class Extensions(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u2be() + self.extensions = [] + i = 0 + while not self._io.is_eof(): + self.extensions.append(DtlsClientHello.Extension(self._io, self, self._root)) + i += 1 + + + + class Version(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.major = self._io.read_u1() + self.minor = self._io.read_u1() + + + class Cookie(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u1() + self.cookie = self._io.read_bytes(self.len) + + + class Protocol(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.strlen = self._io.read_u1() + self.name = self._io.read_bytes(self.strlen) + + + class Extension(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.type = self._io.read_u2be() + self.len = self._io.read_u2be() + _on = self.type + if _on == 0: + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = DtlsClientHello.Sni(_io__raw_body, self, self._root) + elif _on == 16: + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = DtlsClientHello.Alpn(_io__raw_body, self, self._root) + else: + self.body = self._io.read_bytes(self.len) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/exif.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/exif.py new file mode 100644 index 0000000000000000000000000000000000000000..464849e420b18c26482809ea3b95a2c20a49893a --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/exif.py @@ -0,0 +1,654 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStream, KaitaiStruct +from enum import Enum + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class Exif(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.endianness = self._io.read_u2le() + self.body = Exif.ExifBody(self._io, self, self._root) + + class ExifBody(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + _on = self._root.endianness + if _on == 18761: + self._is_le = True + elif _on == 19789: + self._is_le = False + if not hasattr(self, '_is_le'): + raise kaitaistruct.UndecidedEndiannessError("/types/exif_body") + elif self._is_le == True: + self._read_le() + elif self._is_le == False: + self._read_be() + + def _read_le(self): + self.version = self._io.read_u2le() + self.ifd0_ofs = self._io.read_u4le() + + def _read_be(self): + self.version = self._io.read_u2be() + self.ifd0_ofs = self._io.read_u4be() + + class Ifd(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None, _is_le=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._is_le = _is_le + self._read() + + def _read(self): + if not hasattr(self, '_is_le'): + raise kaitaistruct.UndecidedEndiannessError("/types/exif_body/types/ifd") + elif self._is_le == True: + self._read_le() + elif self._is_le == False: + self._read_be() + + def _read_le(self): + self.num_fields = self._io.read_u2le() + self.fields = [] + for i in range(self.num_fields): + self.fields.append(Exif.ExifBody.IfdField(self._io, self, self._root, self._is_le)) + + self.next_ifd_ofs = self._io.read_u4le() + + def _read_be(self): + self.num_fields = self._io.read_u2be() + self.fields = [] + for i in range(self.num_fields): + self.fields.append(Exif.ExifBody.IfdField(self._io, self, self._root, self._is_le)) + + self.next_ifd_ofs = self._io.read_u4be() + + @property + def next_ifd(self): + if hasattr(self, '_m_next_ifd'): + return self._m_next_ifd + + if self.next_ifd_ofs != 0: + _pos = self._io.pos() + self._io.seek(self.next_ifd_ofs) + if self._is_le: + self._m_next_ifd = Exif.ExifBody.Ifd(self._io, self, self._root, self._is_le) + else: + self._m_next_ifd = Exif.ExifBody.Ifd(self._io, self, self._root, self._is_le) + self._io.seek(_pos) + + return getattr(self, '_m_next_ifd', None) + + + class IfdField(KaitaiStruct): + + class FieldTypeEnum(Enum): + byte = 1 + ascii_string = 2 + word = 3 + dword = 4 + rational = 5 + undefined = 7 + slong = 9 + srational = 10 + + class TagEnum(Enum): + image_width = 256 + image_height = 257 + bits_per_sample = 258 + compression = 259 + photometric_interpretation = 262 + thresholding = 263 + cell_width = 264 + cell_length = 265 + fill_order = 266 + document_name = 269 + image_description = 270 + make = 271 + model = 272 + strip_offsets = 273 + orientation = 274 + samples_per_pixel = 277 + rows_per_strip = 278 + strip_byte_counts = 279 + min_sample_value = 280 + max_sample_value = 281 + x_resolution = 282 + y_resolution = 283 + planar_configuration = 284 + page_name = 285 + x_position = 286 + y_position = 287 + free_offsets = 288 + free_byte_counts = 289 + gray_response_unit = 290 + gray_response_curve = 291 + t4_options = 292 + t6_options = 293 + resolution_unit = 296 + page_number = 297 + color_response_unit = 300 + transfer_function = 301 + software = 305 + modify_date = 306 + artist = 315 + host_computer = 316 + predictor = 317 + white_point = 318 + primary_chromaticities = 319 + color_map = 320 + halftone_hints = 321 + tile_width = 322 + tile_length = 323 + tile_offsets = 324 + tile_byte_counts = 325 + bad_fax_lines = 326 + clean_fax_data = 327 + consecutive_bad_fax_lines = 328 + sub_ifd = 330 + ink_set = 332 + ink_names = 333 + numberof_inks = 334 + dot_range = 336 + target_printer = 337 + extra_samples = 338 + sample_format = 339 + s_min_sample_value = 340 + s_max_sample_value = 341 + transfer_range = 342 + clip_path = 343 + x_clip_path_units = 344 + y_clip_path_units = 345 + indexed = 346 + jpeg_tables = 347 + opi_proxy = 351 + global_parameters_ifd = 400 + profile_type = 401 + fax_profile = 402 + coding_methods = 403 + version_year = 404 + mode_number = 405 + decode = 433 + default_image_color = 434 + t82_options = 435 + jpeg_tables2 = 437 + jpeg_proc = 512 + thumbnail_offset = 513 + thumbnail_length = 514 + jpeg_restart_interval = 515 + jpeg_lossless_predictors = 517 + jpeg_point_transforms = 518 + jpegq_tables = 519 + jpegdc_tables = 520 + jpegac_tables = 521 + y_cb_cr_coefficients = 529 + y_cb_cr_sub_sampling = 530 + y_cb_cr_positioning = 531 + reference_black_white = 532 + strip_row_counts = 559 + application_notes = 700 + uspto_miscellaneous = 999 + related_image_file_format = 4096 + related_image_width = 4097 + related_image_height = 4098 + rating = 18246 + xp_dip_xml = 18247 + stitch_info = 18248 + rating_percent = 18249 + sony_raw_file_type = 28672 + light_falloff_params = 28722 + chromatic_aberration_corr_params = 28725 + distortion_corr_params = 28727 + image_id = 32781 + wang_tag1 = 32931 + wang_annotation = 32932 + wang_tag3 = 32933 + wang_tag4 = 32934 + image_reference_points = 32953 + region_xform_tack_point = 32954 + warp_quadrilateral = 32955 + affine_transform_mat = 32956 + matteing = 32995 + data_type = 32996 + image_depth = 32997 + tile_depth = 32998 + image_full_width = 33300 + image_full_height = 33301 + texture_format = 33302 + wrap_modes = 33303 + fov_cot = 33304 + matrix_world_to_screen = 33305 + matrix_world_to_camera = 33306 + model2 = 33405 + cfa_repeat_pattern_dim = 33421 + cfa_pattern2 = 33422 + battery_level = 33423 + kodak_ifd = 33424 + copyright = 33432 + exposure_time = 33434 + f_number = 33437 + md_file_tag = 33445 + md_scale_pixel = 33446 + md_color_table = 33447 + md_lab_name = 33448 + md_sample_info = 33449 + md_prep_date = 33450 + md_prep_time = 33451 + md_file_units = 33452 + pixel_scale = 33550 + advent_scale = 33589 + advent_revision = 33590 + uic1_tag = 33628 + uic2_tag = 33629 + uic3_tag = 33630 + uic4_tag = 33631 + iptc_naa = 33723 + intergraph_packet_data = 33918 + intergraph_flag_registers = 33919 + intergraph_matrix = 33920 + ingr_reserved = 33921 + model_tie_point = 33922 + site = 34016 + color_sequence = 34017 + it8_header = 34018 + raster_padding = 34019 + bits_per_run_length = 34020 + bits_per_extended_run_length = 34021 + color_table = 34022 + image_color_indicator = 34023 + background_color_indicator = 34024 + image_color_value = 34025 + background_color_value = 34026 + pixel_intensity_range = 34027 + transparency_indicator = 34028 + color_characterization = 34029 + hc_usage = 34030 + trap_indicator = 34031 + cmyk_equivalent = 34032 + sem_info = 34118 + afcp_iptc = 34152 + pixel_magic_jbig_options = 34232 + jpl_carto_ifd = 34263 + model_transform = 34264 + wb_grgb_levels = 34306 + leaf_data = 34310 + photoshop_settings = 34377 + exif_offset = 34665 + icc_profile = 34675 + tiff_fx_extensions = 34687 + multi_profiles = 34688 + shared_data = 34689 + t88_options = 34690 + image_layer = 34732 + geo_tiff_directory = 34735 + geo_tiff_double_params = 34736 + geo_tiff_ascii_params = 34737 + jbig_options = 34750 + exposure_program = 34850 + spectral_sensitivity = 34852 + gps_info = 34853 + iso = 34855 + opto_electric_conv_factor = 34856 + interlace = 34857 + time_zone_offset = 34858 + self_timer_mode = 34859 + sensitivity_type = 34864 + standard_output_sensitivity = 34865 + recommended_exposure_index = 34866 + iso_speed = 34867 + iso_speed_latitudeyyy = 34868 + iso_speed_latitudezzz = 34869 + fax_recv_params = 34908 + fax_sub_address = 34909 + fax_recv_time = 34910 + fedex_edr = 34929 + leaf_sub_ifd = 34954 + exif_version = 36864 + date_time_original = 36867 + create_date = 36868 + google_plus_upload_code = 36873 + offset_time = 36880 + offset_time_original = 36881 + offset_time_digitized = 36882 + components_configuration = 37121 + compressed_bits_per_pixel = 37122 + shutter_speed_value = 37377 + aperture_value = 37378 + brightness_value = 37379 + exposure_compensation = 37380 + max_aperture_value = 37381 + subject_distance = 37382 + metering_mode = 37383 + light_source = 37384 + flash = 37385 + focal_length = 37386 + flash_energy = 37387 + spatial_frequency_response = 37388 + noise = 37389 + focal_plane_x_resolution = 37390 + focal_plane_y_resolution = 37391 + focal_plane_resolution_unit = 37392 + image_number = 37393 + security_classification = 37394 + image_history = 37395 + subject_area = 37396 + exposure_index = 37397 + tiff_ep_standard_id = 37398 + sensing_method = 37399 + cip3_data_file = 37434 + cip3_sheet = 37435 + cip3_side = 37436 + sto_nits = 37439 + maker_note = 37500 + user_comment = 37510 + sub_sec_time = 37520 + sub_sec_time_original = 37521 + sub_sec_time_digitized = 37522 + ms_document_text = 37679 + ms_property_set_storage = 37680 + ms_document_text_position = 37681 + image_source_data = 37724 + ambient_temperature = 37888 + humidity = 37889 + pressure = 37890 + water_depth = 37891 + acceleration = 37892 + camera_elevation_angle = 37893 + xp_title = 40091 + xp_comment = 40092 + xp_author = 40093 + xp_keywords = 40094 + xp_subject = 40095 + flashpix_version = 40960 + color_space = 40961 + exif_image_width = 40962 + exif_image_height = 40963 + related_sound_file = 40964 + interop_offset = 40965 + samsung_raw_pointers_offset = 40976 + samsung_raw_pointers_length = 40977 + samsung_raw_byte_order = 41217 + samsung_raw_unknown = 41218 + flash_energy2 = 41483 + spatial_frequency_response2 = 41484 + noise2 = 41485 + focal_plane_x_resolution2 = 41486 + focal_plane_y_resolution2 = 41487 + focal_plane_resolution_unit2 = 41488 + image_number2 = 41489 + security_classification2 = 41490 + image_history2 = 41491 + subject_location = 41492 + exposure_index2 = 41493 + tiff_ep_standard_id2 = 41494 + sensing_method2 = 41495 + file_source = 41728 + scene_type = 41729 + cfa_pattern = 41730 + custom_rendered = 41985 + exposure_mode = 41986 + white_balance = 41987 + digital_zoom_ratio = 41988 + focal_length_in35mm_format = 41989 + scene_capture_type = 41990 + gain_control = 41991 + contrast = 41992 + saturation = 41993 + sharpness = 41994 + device_setting_description = 41995 + subject_distance_range = 41996 + image_unique_id = 42016 + owner_name = 42032 + serial_number = 42033 + lens_info = 42034 + lens_make = 42035 + lens_model = 42036 + lens_serial_number = 42037 + gdal_metadata = 42112 + gdal_no_data = 42113 + gamma = 42240 + expand_software = 44992 + expand_lens = 44993 + expand_film = 44994 + expand_filter_lens = 44995 + expand_scanner = 44996 + expand_flash_lamp = 44997 + pixel_format = 48129 + transformation = 48130 + uncompressed = 48131 + image_type = 48132 + image_width2 = 48256 + image_height2 = 48257 + width_resolution = 48258 + height_resolution = 48259 + image_offset = 48320 + image_byte_count = 48321 + alpha_offset = 48322 + alpha_byte_count = 48323 + image_data_discard = 48324 + alpha_data_discard = 48325 + oce_scanjob_desc = 50215 + oce_application_selector = 50216 + oce_id_number = 50217 + oce_image_logic = 50218 + annotations = 50255 + print_im = 50341 + original_file_name = 50547 + uspto_original_content_type = 50560 + dng_version = 50706 + dng_backward_version = 50707 + unique_camera_model = 50708 + localized_camera_model = 50709 + cfa_plane_color = 50710 + cfa_layout = 50711 + linearization_table = 50712 + black_level_repeat_dim = 50713 + black_level = 50714 + black_level_delta_h = 50715 + black_level_delta_v = 50716 + white_level = 50717 + default_scale = 50718 + default_crop_origin = 50719 + default_crop_size = 50720 + color_matrix1 = 50721 + color_matrix2 = 50722 + camera_calibration1 = 50723 + camera_calibration2 = 50724 + reduction_matrix1 = 50725 + reduction_matrix2 = 50726 + analog_balance = 50727 + as_shot_neutral = 50728 + as_shot_white_xy = 50729 + baseline_exposure = 50730 + baseline_noise = 50731 + baseline_sharpness = 50732 + bayer_green_split = 50733 + linear_response_limit = 50734 + camera_serial_number = 50735 + dng_lens_info = 50736 + chroma_blur_radius = 50737 + anti_alias_strength = 50738 + shadow_scale = 50739 + sr2_private = 50740 + maker_note_safety = 50741 + raw_image_segmentation = 50752 + calibration_illuminant1 = 50778 + calibration_illuminant2 = 50779 + best_quality_scale = 50780 + raw_data_unique_id = 50781 + alias_layer_metadata = 50784 + original_raw_file_name = 50827 + original_raw_file_data = 50828 + active_area = 50829 + masked_areas = 50830 + as_shot_icc_profile = 50831 + as_shot_pre_profile_matrix = 50832 + current_icc_profile = 50833 + current_pre_profile_matrix = 50834 + colorimetric_reference = 50879 + s_raw_type = 50885 + panasonic_title = 50898 + panasonic_title2 = 50899 + camera_calibration_sig = 50931 + profile_calibration_sig = 50932 + profile_ifd = 50933 + as_shot_profile_name = 50934 + noise_reduction_applied = 50935 + profile_name = 50936 + profile_hue_sat_map_dims = 50937 + profile_hue_sat_map_data1 = 50938 + profile_hue_sat_map_data2 = 50939 + profile_tone_curve = 50940 + profile_embed_policy = 50941 + profile_copyright = 50942 + forward_matrix1 = 50964 + forward_matrix2 = 50965 + preview_application_name = 50966 + preview_application_version = 50967 + preview_settings_name = 50968 + preview_settings_digest = 50969 + preview_color_space = 50970 + preview_date_time = 50971 + raw_image_digest = 50972 + original_raw_file_digest = 50973 + sub_tile_block_size = 50974 + row_interleave_factor = 50975 + profile_look_table_dims = 50981 + profile_look_table_data = 50982 + opcode_list1 = 51008 + opcode_list2 = 51009 + opcode_list3 = 51022 + noise_profile = 51041 + time_codes = 51043 + frame_rate = 51044 + t_stop = 51058 + reel_name = 51081 + original_default_final_size = 51089 + original_best_quality_size = 51090 + original_default_crop_size = 51091 + camera_label = 51105 + profile_hue_sat_map_encoding = 51107 + profile_look_table_encoding = 51108 + baseline_exposure_offset = 51109 + default_black_render = 51110 + new_raw_image_digest = 51111 + raw_to_preview_gain = 51112 + default_user_crop = 51125 + padding = 59932 + offset_schema = 59933 + owner_name2 = 65000 + serial_number2 = 65001 + lens = 65002 + kdc_ifd = 65024 + raw_file = 65100 + converter = 65101 + white_balance2 = 65102 + exposure = 65105 + shadows = 65106 + brightness = 65107 + contrast2 = 65108 + saturation2 = 65109 + sharpness2 = 65110 + smoothness = 65111 + moire_filter = 65112 + def __init__(self, _io, _parent=None, _root=None, _is_le=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._is_le = _is_le + self._read() + + def _read(self): + if not hasattr(self, '_is_le'): + raise kaitaistruct.UndecidedEndiannessError("/types/exif_body/types/ifd_field") + elif self._is_le == True: + self._read_le() + elif self._is_le == False: + self._read_be() + + def _read_le(self): + self.tag = KaitaiStream.resolve_enum(Exif.ExifBody.IfdField.TagEnum, self._io.read_u2le()) + self.field_type = KaitaiStream.resolve_enum(Exif.ExifBody.IfdField.FieldTypeEnum, self._io.read_u2le()) + self.length = self._io.read_u4le() + self.ofs_or_data = self._io.read_u4le() + + def _read_be(self): + self.tag = KaitaiStream.resolve_enum(Exif.ExifBody.IfdField.TagEnum, self._io.read_u2be()) + self.field_type = KaitaiStream.resolve_enum(Exif.ExifBody.IfdField.FieldTypeEnum, self._io.read_u2be()) + self.length = self._io.read_u4be() + self.ofs_or_data = self._io.read_u4be() + + @property + def type_byte_length(self): + if hasattr(self, '_m_type_byte_length'): + return self._m_type_byte_length + + self._m_type_byte_length = (2 if self.field_type == Exif.ExifBody.IfdField.FieldTypeEnum.word else (4 if self.field_type == Exif.ExifBody.IfdField.FieldTypeEnum.dword else 1)) + return getattr(self, '_m_type_byte_length', None) + + @property + def byte_length(self): + if hasattr(self, '_m_byte_length'): + return self._m_byte_length + + self._m_byte_length = (self.length * self.type_byte_length) + return getattr(self, '_m_byte_length', None) + + @property + def is_immediate_data(self): + if hasattr(self, '_m_is_immediate_data'): + return self._m_is_immediate_data + + self._m_is_immediate_data = self.byte_length <= 4 + return getattr(self, '_m_is_immediate_data', None) + + @property + def data(self): + if hasattr(self, '_m_data'): + return self._m_data + + if not (self.is_immediate_data): + io = self._root._io + _pos = io.pos() + io.seek(self.ofs_or_data) + if self._is_le: + self._m_data = io.read_bytes(self.byte_length) + else: + self._m_data = io.read_bytes(self.byte_length) + io.seek(_pos) + + return getattr(self, '_m_data', None) + + + @property + def ifd0(self): + if hasattr(self, '_m_ifd0'): + return self._m_ifd0 + + _pos = self._io.pos() + self._io.seek(self.ifd0_ofs) + if self._is_le: + self._m_ifd0 = Exif.ExifBody.Ifd(self._io, self, self._root, self._is_le) + else: + self._m_ifd0 = Exif.ExifBody.Ifd(self._io, self, self._root, self._is_le) + self._io.seek(_pos) + return getattr(self, '_m_ifd0', None) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/gif.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/gif.py new file mode 100644 index 0000000000000000000000000000000000000000..09fa564816842b723cd1777f354b4231c2ed9915 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/gif.py @@ -0,0 +1,357 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO +from enum import Enum + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class Gif(KaitaiStruct): + """GIF (Graphics Interchange Format) is an image file format, developed + in 1987. It became popular in 1990s as one of the main image formats + used in World Wide Web. + + GIF format allows encoding of palette-based images up to 256 colors + (each of the colors can be chosen from a 24-bit RGB + colorspace). Image data stream uses LZW (Lempel-Ziv-Welch) lossless + compression. + + Over the years, several version of the format were published and + several extensions to it were made, namely, a popular Netscape + extension that allows to store several images in one file, switching + between them, which produces crude form of animation. + + Structurally, format consists of several mandatory headers and then + a stream of blocks follows. Blocks can carry additional + metainformation or image data. + """ + + class BlockType(Enum): + extension = 33 + local_image_descriptor = 44 + end_of_file = 59 + + class ExtensionLabel(Enum): + graphic_control = 249 + comment = 254 + application = 255 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.hdr = Gif.Header(self._io, self, self._root) + self.logical_screen_descriptor = Gif.LogicalScreenDescriptorStruct(self._io, self, self._root) + if self.logical_screen_descriptor.has_color_table: + self._raw_global_color_table = self._io.read_bytes((self.logical_screen_descriptor.color_table_size * 3)) + _io__raw_global_color_table = KaitaiStream(BytesIO(self._raw_global_color_table)) + self.global_color_table = Gif.ColorTable(_io__raw_global_color_table, self, self._root) + + self.blocks = [] + i = 0 + while True: + _ = Gif.Block(self._io, self, self._root) + self.blocks.append(_) + if ((self._io.is_eof()) or (_.block_type == Gif.BlockType.end_of_file)) : + break + i += 1 + + class ImageData(KaitaiStruct): + """ + .. seealso:: + - section 22 - https://www.w3.org/Graphics/GIF/spec-gif89a.txt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.lzw_min_code_size = self._io.read_u1() + self.subblocks = Gif.Subblocks(self._io, self, self._root) + + + class ColorTableEntry(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.red = self._io.read_u1() + self.green = self._io.read_u1() + self.blue = self._io.read_u1() + + + class LogicalScreenDescriptorStruct(KaitaiStruct): + """ + .. seealso:: + - section 18 - https://www.w3.org/Graphics/GIF/spec-gif89a.txt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.screen_width = self._io.read_u2le() + self.screen_height = self._io.read_u2le() + self.flags = self._io.read_u1() + self.bg_color_index = self._io.read_u1() + self.pixel_aspect_ratio = self._io.read_u1() + + @property + def has_color_table(self): + if hasattr(self, '_m_has_color_table'): + return self._m_has_color_table + + self._m_has_color_table = (self.flags & 128) != 0 + return getattr(self, '_m_has_color_table', None) + + @property + def color_table_size(self): + if hasattr(self, '_m_color_table_size'): + return self._m_color_table_size + + self._m_color_table_size = (2 << (self.flags & 7)) + return getattr(self, '_m_color_table_size', None) + + + class LocalImageDescriptor(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.left = self._io.read_u2le() + self.top = self._io.read_u2le() + self.width = self._io.read_u2le() + self.height = self._io.read_u2le() + self.flags = self._io.read_u1() + if self.has_color_table: + self._raw_local_color_table = self._io.read_bytes((self.color_table_size * 3)) + _io__raw_local_color_table = KaitaiStream(BytesIO(self._raw_local_color_table)) + self.local_color_table = Gif.ColorTable(_io__raw_local_color_table, self, self._root) + + self.image_data = Gif.ImageData(self._io, self, self._root) + + @property + def has_color_table(self): + if hasattr(self, '_m_has_color_table'): + return self._m_has_color_table + + self._m_has_color_table = (self.flags & 128) != 0 + return getattr(self, '_m_has_color_table', None) + + @property + def has_interlace(self): + if hasattr(self, '_m_has_interlace'): + return self._m_has_interlace + + self._m_has_interlace = (self.flags & 64) != 0 + return getattr(self, '_m_has_interlace', None) + + @property + def has_sorted_color_table(self): + if hasattr(self, '_m_has_sorted_color_table'): + return self._m_has_sorted_color_table + + self._m_has_sorted_color_table = (self.flags & 32) != 0 + return getattr(self, '_m_has_sorted_color_table', None) + + @property + def color_table_size(self): + if hasattr(self, '_m_color_table_size'): + return self._m_color_table_size + + self._m_color_table_size = (2 << (self.flags & 7)) + return getattr(self, '_m_color_table_size', None) + + + class Block(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.block_type = KaitaiStream.resolve_enum(Gif.BlockType, self._io.read_u1()) + _on = self.block_type + if _on == Gif.BlockType.extension: + self.body = Gif.Extension(self._io, self, self._root) + elif _on == Gif.BlockType.local_image_descriptor: + self.body = Gif.LocalImageDescriptor(self._io, self, self._root) + + + class ColorTable(KaitaiStruct): + """ + .. seealso:: + - section 19 - https://www.w3.org/Graphics/GIF/spec-gif89a.txt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.entries = [] + i = 0 + while not self._io.is_eof(): + self.entries.append(Gif.ColorTableEntry(self._io, self, self._root)) + i += 1 + + + + class Header(KaitaiStruct): + """ + .. seealso:: + - section 17 - https://www.w3.org/Graphics/GIF/spec-gif89a.txt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.magic = self._io.read_bytes(3) + if not self.magic == b"\x47\x49\x46": + raise kaitaistruct.ValidationNotEqualError(b"\x47\x49\x46", self.magic, self._io, u"/types/header/seq/0") + self.version = (self._io.read_bytes(3)).decode(u"ASCII") + + + class ExtGraphicControl(KaitaiStruct): + """ + .. seealso:: + - section 23 - https://www.w3.org/Graphics/GIF/spec-gif89a.txt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.block_size = self._io.read_bytes(1) + if not self.block_size == b"\x04": + raise kaitaistruct.ValidationNotEqualError(b"\x04", self.block_size, self._io, u"/types/ext_graphic_control/seq/0") + self.flags = self._io.read_u1() + self.delay_time = self._io.read_u2le() + self.transparent_idx = self._io.read_u1() + self.terminator = self._io.read_bytes(1) + if not self.terminator == b"\x00": + raise kaitaistruct.ValidationNotEqualError(b"\x00", self.terminator, self._io, u"/types/ext_graphic_control/seq/4") + + @property + def transparent_color_flag(self): + if hasattr(self, '_m_transparent_color_flag'): + return self._m_transparent_color_flag + + self._m_transparent_color_flag = (self.flags & 1) != 0 + return getattr(self, '_m_transparent_color_flag', None) + + @property + def user_input_flag(self): + if hasattr(self, '_m_user_input_flag'): + return self._m_user_input_flag + + self._m_user_input_flag = (self.flags & 2) != 0 + return getattr(self, '_m_user_input_flag', None) + + + class Subblock(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len_bytes = self._io.read_u1() + self.bytes = self._io.read_bytes(self.len_bytes) + + + class ApplicationId(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len_bytes = self._io.read_u1() + if not self.len_bytes == 11: + raise kaitaistruct.ValidationNotEqualError(11, self.len_bytes, self._io, u"/types/application_id/seq/0") + self.application_identifier = (self._io.read_bytes(8)).decode(u"ASCII") + self.application_auth_code = self._io.read_bytes(3) + + + class ExtApplication(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.application_id = Gif.ApplicationId(self._io, self, self._root) + self.subblocks = [] + i = 0 + while True: + _ = Gif.Subblock(self._io, self, self._root) + self.subblocks.append(_) + if _.len_bytes == 0: + break + i += 1 + + + class Subblocks(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.entries = [] + i = 0 + while True: + _ = Gif.Subblock(self._io, self, self._root) + self.entries.append(_) + if _.len_bytes == 0: + break + i += 1 + + + class Extension(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.label = KaitaiStream.resolve_enum(Gif.ExtensionLabel, self._io.read_u1()) + _on = self.label + if _on == Gif.ExtensionLabel.application: + self.body = Gif.ExtApplication(self._io, self, self._root) + elif _on == Gif.ExtensionLabel.comment: + self.body = Gif.Subblocks(self._io, self, self._root) + elif _on == Gif.ExtensionLabel.graphic_control: + self.body = Gif.ExtGraphicControl(self._io, self, self._root) + else: + self.body = Gif.Subblocks(self._io, self, self._root) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/google_protobuf.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/google_protobuf.py new file mode 100644 index 0000000000000000000000000000000000000000..48f5e0ec9b905c19c62f086522ade4bd7a75b505 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/google_protobuf.py @@ -0,0 +1,126 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStream, KaitaiStruct +from enum import Enum + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +from . import vlq_base128_le +class GoogleProtobuf(KaitaiStruct): + """Google Protocol Buffers (AKA protobuf) is a popular data + serialization scheme used for communication protocols, data storage, + etc. There are implementations are available for almost every + popular language. The focus points of this scheme are brevity (data + is encoded in a very size-efficient manner) and extensibility (one + can add keys to the structure, while keeping it readable in previous + version of software). + + Protobuf uses semi-self-describing encoding scheme for its + messages. It means that it is possible to parse overall structure of + the message (skipping over fields one can't understand), but to + fully understand the message, one needs a protocol definition file + (`.proto`). To be specific: + + * "Keys" in key-value pairs provided in the message are identified + only with an integer "field tag". `.proto` file provides info on + which symbolic field names these field tags map to. + * "Keys" also provide something called "wire type". It's not a data + type in its common sense (i.e. you can't, for example, distinguish + `sint32` vs `uint32` vs some enum, or `string` from `bytes`), but + it's enough information to determine how many bytes to + parse. Interpretation of the value should be done according to the + type specified in `.proto` file. + * There's no direct information on which fields are optional / + required, which fields may be repeated or constitute a map, what + restrictions are placed on fields usage in a single message, what + are the fields' default values, etc, etc. + + .. seealso:: + Source - https://developers.google.com/protocol-buffers/docs/encoding + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.pairs = [] + i = 0 + while not self._io.is_eof(): + self.pairs.append(GoogleProtobuf.Pair(self._io, self, self._root)) + i += 1 + + + class Pair(KaitaiStruct): + """Key-value pair.""" + + class WireTypes(Enum): + varint = 0 + bit_64 = 1 + len_delimited = 2 + group_start = 3 + group_end = 4 + bit_32 = 5 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.key = vlq_base128_le.VlqBase128Le(self._io) + _on = self.wire_type + if _on == GoogleProtobuf.Pair.WireTypes.varint: + self.value = vlq_base128_le.VlqBase128Le(self._io) + elif _on == GoogleProtobuf.Pair.WireTypes.len_delimited: + self.value = GoogleProtobuf.DelimitedBytes(self._io, self, self._root) + elif _on == GoogleProtobuf.Pair.WireTypes.bit_64: + self.value = self._io.read_u8le() + elif _on == GoogleProtobuf.Pair.WireTypes.bit_32: + self.value = self._io.read_u4le() + + @property + def wire_type(self): + """"Wire type" is a part of the "key" that carries enough + information to parse value from the wire, i.e. read correct + amount of bytes, but there's not enough informaton to + interprete in unambiguously. For example, one can't clearly + distinguish 64-bit fixed-sized integers from 64-bit floats, + signed zigzag-encoded varints from regular unsigned varints, + arbitrary bytes from UTF-8 encoded strings, etc. + """ + if hasattr(self, '_m_wire_type'): + return self._m_wire_type + + self._m_wire_type = KaitaiStream.resolve_enum(GoogleProtobuf.Pair.WireTypes, (self.key.value & 7)) + return getattr(self, '_m_wire_type', None) + + @property + def field_tag(self): + """Identifies a field of protocol. One can look up symbolic + field name in a `.proto` file by this field tag. + """ + if hasattr(self, '_m_field_tag'): + return self._m_field_tag + + self._m_field_tag = (self.key.value >> 3) + return getattr(self, '_m_field_tag', None) + + + class DelimitedBytes(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = vlq_base128_le.VlqBase128Le(self._io) + self.body = self._io.read_bytes(self.len.value) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/ico.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/ico.py new file mode 100644 index 0000000000000000000000000000000000000000..39b34ae49ac2ffdfc480820d3f6aeb3be05d9a90 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/ico.py @@ -0,0 +1,93 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class Ico(KaitaiStruct): + """Microsoft Windows uses specific file format to store applications + icons - ICO. This is a container that contains one or more image + files (effectively, DIB parts of BMP files or full PNG files are + contained inside). + + .. seealso:: + Source - https://docs.microsoft.com/en-us/previous-versions/ms997538(v=msdn.10) + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.magic = self._io.read_bytes(4) + if not self.magic == b"\x00\x00\x01\x00": + raise kaitaistruct.ValidationNotEqualError(b"\x00\x00\x01\x00", self.magic, self._io, u"/seq/0") + self.num_images = self._io.read_u2le() + self.images = [] + for i in range(self.num_images): + self.images.append(Ico.IconDirEntry(self._io, self, self._root)) + + + class IconDirEntry(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.width = self._io.read_u1() + self.height = self._io.read_u1() + self.num_colors = self._io.read_u1() + self.reserved = self._io.read_bytes(1) + if not self.reserved == b"\x00": + raise kaitaistruct.ValidationNotEqualError(b"\x00", self.reserved, self._io, u"/types/icon_dir_entry/seq/3") + self.num_planes = self._io.read_u2le() + self.bpp = self._io.read_u2le() + self.len_img = self._io.read_u4le() + self.ofs_img = self._io.read_u4le() + + @property + def img(self): + """Raw image data. Use `is_png` to determine whether this is an + embedded PNG file (true) or a DIB bitmap (false) and call a + relevant parser, if needed to parse image data further. + """ + if hasattr(self, '_m_img'): + return self._m_img + + _pos = self._io.pos() + self._io.seek(self.ofs_img) + self._m_img = self._io.read_bytes(self.len_img) + self._io.seek(_pos) + return getattr(self, '_m_img', None) + + @property + def png_header(self): + """Pre-reads first 8 bytes of the image to determine if it's an + embedded PNG file. + """ + if hasattr(self, '_m_png_header'): + return self._m_png_header + + _pos = self._io.pos() + self._io.seek(self.ofs_img) + self._m_png_header = self._io.read_bytes(8) + self._io.seek(_pos) + return getattr(self, '_m_png_header', None) + + @property + def is_png(self): + """True if this image is in PNG format.""" + if hasattr(self, '_m_is_png'): + return self._m_is_png + + self._m_is_png = self.png_header == b"\x89\x50\x4E\x47\x0D\x0A\x1A\x0A" + return getattr(self, '_m_is_png', None) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/jpeg.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/jpeg.py new file mode 100644 index 0000000000000000000000000000000000000000..60a45bfbf97322ea25ed7df8110e208a837d6745 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/jpeg.py @@ -0,0 +1,258 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO +from enum import Enum + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +from . import exif +class Jpeg(KaitaiStruct): + """JPEG File Interchange Format, or JFIF, or, more colloquially known + as just "JPEG" or "JPG", is a popular 2D bitmap image file format, + offering lossy compression which works reasonably well with + photographic images. + + Format is organized as a container format, serving multiple + "segments", each starting with a magic and a marker. JFIF standard + dictates order and mandatory apperance of segments: + + * SOI + * APP0 (with JFIF magic) + * APP0 (with JFXX magic, optional) + * everything else + * SOS + * JPEG-compressed stream + * EOI + """ + + class ComponentId(Enum): + y = 1 + cb = 2 + cr = 3 + i = 4 + q = 5 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.segments = [] + i = 0 + while not self._io.is_eof(): + self.segments.append(Jpeg.Segment(self._io, self, self._root)) + i += 1 + + + class Segment(KaitaiStruct): + + class MarkerEnum(Enum): + tem = 1 + sof0 = 192 + sof1 = 193 + sof2 = 194 + sof3 = 195 + dht = 196 + sof5 = 197 + sof6 = 198 + sof7 = 199 + soi = 216 + eoi = 217 + sos = 218 + dqt = 219 + dnl = 220 + dri = 221 + dhp = 222 + app0 = 224 + app1 = 225 + app2 = 226 + app3 = 227 + app4 = 228 + app5 = 229 + app6 = 230 + app7 = 231 + app8 = 232 + app9 = 233 + app10 = 234 + app11 = 235 + app12 = 236 + app13 = 237 + app14 = 238 + app15 = 239 + com = 254 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.magic = self._io.read_bytes(1) + if not self.magic == b"\xFF": + raise kaitaistruct.ValidationNotEqualError(b"\xFF", self.magic, self._io, u"/types/segment/seq/0") + self.marker = KaitaiStream.resolve_enum(Jpeg.Segment.MarkerEnum, self._io.read_u1()) + if ((self.marker != Jpeg.Segment.MarkerEnum.soi) and (self.marker != Jpeg.Segment.MarkerEnum.eoi)) : + self.length = self._io.read_u2be() + + if ((self.marker != Jpeg.Segment.MarkerEnum.soi) and (self.marker != Jpeg.Segment.MarkerEnum.eoi)) : + _on = self.marker + if _on == Jpeg.Segment.MarkerEnum.app1: + self._raw_data = self._io.read_bytes((self.length - 2)) + _io__raw_data = KaitaiStream(BytesIO(self._raw_data)) + self.data = Jpeg.SegmentApp1(_io__raw_data, self, self._root) + elif _on == Jpeg.Segment.MarkerEnum.app0: + self._raw_data = self._io.read_bytes((self.length - 2)) + _io__raw_data = KaitaiStream(BytesIO(self._raw_data)) + self.data = Jpeg.SegmentApp0(_io__raw_data, self, self._root) + elif _on == Jpeg.Segment.MarkerEnum.sof0: + self._raw_data = self._io.read_bytes((self.length - 2)) + _io__raw_data = KaitaiStream(BytesIO(self._raw_data)) + self.data = Jpeg.SegmentSof0(_io__raw_data, self, self._root) + elif _on == Jpeg.Segment.MarkerEnum.sos: + self._raw_data = self._io.read_bytes((self.length - 2)) + _io__raw_data = KaitaiStream(BytesIO(self._raw_data)) + self.data = Jpeg.SegmentSos(_io__raw_data, self, self._root) + else: + self.data = self._io.read_bytes((self.length - 2)) + + if self.marker == Jpeg.Segment.MarkerEnum.sos: + self.image_data = self._io.read_bytes_full() + + + + class SegmentSos(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.num_components = self._io.read_u1() + self.components = [] + for i in range(self.num_components): + self.components.append(Jpeg.SegmentSos.Component(self._io, self, self._root)) + + self.start_spectral_selection = self._io.read_u1() + self.end_spectral = self._io.read_u1() + self.appr_bit_pos = self._io.read_u1() + + class Component(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.id = KaitaiStream.resolve_enum(Jpeg.ComponentId, self._io.read_u1()) + self.huffman_table = self._io.read_u1() + + + + class SegmentApp1(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.magic = (self._io.read_bytes_term(0, False, True, True)).decode(u"ASCII") + _on = self.magic + if _on == u"Exif": + self.body = Jpeg.ExifInJpeg(self._io, self, self._root) + + + class SegmentSof0(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.bits_per_sample = self._io.read_u1() + self.image_height = self._io.read_u2be() + self.image_width = self._io.read_u2be() + self.num_components = self._io.read_u1() + self.components = [] + for i in range(self.num_components): + self.components.append(Jpeg.SegmentSof0.Component(self._io, self, self._root)) + + + class Component(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.id = KaitaiStream.resolve_enum(Jpeg.ComponentId, self._io.read_u1()) + self.sampling_factors = self._io.read_u1() + self.quantization_table_id = self._io.read_u1() + + @property + def sampling_x(self): + if hasattr(self, '_m_sampling_x'): + return self._m_sampling_x + + self._m_sampling_x = ((self.sampling_factors & 240) >> 4) + return getattr(self, '_m_sampling_x', None) + + @property + def sampling_y(self): + if hasattr(self, '_m_sampling_y'): + return self._m_sampling_y + + self._m_sampling_y = (self.sampling_factors & 15) + return getattr(self, '_m_sampling_y', None) + + + + class ExifInJpeg(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.extra_zero = self._io.read_bytes(1) + if not self.extra_zero == b"\x00": + raise kaitaistruct.ValidationNotEqualError(b"\x00", self.extra_zero, self._io, u"/types/exif_in_jpeg/seq/0") + self._raw_data = self._io.read_bytes_full() + _io__raw_data = KaitaiStream(BytesIO(self._raw_data)) + self.data = exif.Exif(_io__raw_data) + + + class SegmentApp0(KaitaiStruct): + + class DensityUnit(Enum): + no_units = 0 + pixels_per_inch = 1 + pixels_per_cm = 2 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.magic = (self._io.read_bytes(5)).decode(u"ASCII") + self.version_major = self._io.read_u1() + self.version_minor = self._io.read_u1() + self.density_units = KaitaiStream.resolve_enum(Jpeg.SegmentApp0.DensityUnit, self._io.read_u1()) + self.density_x = self._io.read_u2be() + self.density_y = self._io.read_u2be() + self.thumbnail_x = self._io.read_u1() + self.thumbnail_y = self._io.read_u1() + self.thumbnail = self._io.read_bytes(((self.thumbnail_x * self.thumbnail_y) * 3)) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/make.sh b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/make.sh new file mode 100644 index 0000000000000000000000000000000000000000..5dcbd089c13695ecb2beafb95c8c7564bf2faca8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/make.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/image/exif.ksy +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/image/gif.ksy +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/image/jpeg.ksy +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/image/png.ksy +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/image/ico.ksy +wget -N -P common/ https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/common/vlq_base128_le.ksy +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/serialization/google_protobuf.ksy +wget -N https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/master/network/tls_client_hello.ksy + +kaitai-struct-compiler --target python --opaque-types=true -I . --python-package . ./*.ksy diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/png.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/png.py new file mode 100644 index 0000000000000000000000000000000000000000..c88892e84616fb612ce49c50d0ee14c025c960a4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/png.py @@ -0,0 +1,527 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO +from enum import Enum +import zlib + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class Png(KaitaiStruct): + """Test files for APNG can be found at the following locations: + + * + * + """ + + class PhysUnit(Enum): + unknown = 0 + meter = 1 + + class BlendOpValues(Enum): + source = 0 + over = 1 + + class CompressionMethods(Enum): + zlib = 0 + + class DisposeOpValues(Enum): + none = 0 + background = 1 + previous = 2 + + class ColorType(Enum): + greyscale = 0 + truecolor = 2 + indexed = 3 + greyscale_alpha = 4 + truecolor_alpha = 6 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.magic = self._io.read_bytes(8) + if not self.magic == b"\x89\x50\x4E\x47\x0D\x0A\x1A\x0A": + raise kaitaistruct.ValidationNotEqualError(b"\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", self.magic, self._io, u"/seq/0") + self.ihdr_len = self._io.read_u4be() + if not self.ihdr_len == 13: + raise kaitaistruct.ValidationNotEqualError(13, self.ihdr_len, self._io, u"/seq/1") + self.ihdr_type = self._io.read_bytes(4) + if not self.ihdr_type == b"\x49\x48\x44\x52": + raise kaitaistruct.ValidationNotEqualError(b"\x49\x48\x44\x52", self.ihdr_type, self._io, u"/seq/2") + self.ihdr = Png.IhdrChunk(self._io, self, self._root) + self.ihdr_crc = self._io.read_bytes(4) + self.chunks = [] + i = 0 + while True: + _ = Png.Chunk(self._io, self, self._root) + self.chunks.append(_) + if ((_.type == u"IEND") or (self._io.is_eof())) : + break + i += 1 + + class Rgb(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.r = self._io.read_u1() + self.g = self._io.read_u1() + self.b = self._io.read_u1() + + + class Chunk(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u4be() + self.type = (self._io.read_bytes(4)).decode(u"UTF-8") + _on = self.type + if _on == u"iTXt": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.InternationalTextChunk(_io__raw_body, self, self._root) + elif _on == u"gAMA": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.GamaChunk(_io__raw_body, self, self._root) + elif _on == u"tIME": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.TimeChunk(_io__raw_body, self, self._root) + elif _on == u"PLTE": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.PlteChunk(_io__raw_body, self, self._root) + elif _on == u"bKGD": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.BkgdChunk(_io__raw_body, self, self._root) + elif _on == u"pHYs": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.PhysChunk(_io__raw_body, self, self._root) + elif _on == u"fdAT": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.FrameDataChunk(_io__raw_body, self, self._root) + elif _on == u"tEXt": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.TextChunk(_io__raw_body, self, self._root) + elif _on == u"cHRM": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.ChrmChunk(_io__raw_body, self, self._root) + elif _on == u"acTL": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.AnimationControlChunk(_io__raw_body, self, self._root) + elif _on == u"sRGB": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.SrgbChunk(_io__raw_body, self, self._root) + elif _on == u"zTXt": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.CompressedTextChunk(_io__raw_body, self, self._root) + elif _on == u"fcTL": + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = Png.FrameControlChunk(_io__raw_body, self, self._root) + else: + self.body = self._io.read_bytes(self.len) + self.crc = self._io.read_bytes(4) + + + class BkgdIndexed(KaitaiStruct): + """Background chunk for images with indexed palette.""" + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.palette_index = self._io.read_u1() + + + class Point(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.x_int = self._io.read_u4be() + self.y_int = self._io.read_u4be() + + @property + def x(self): + if hasattr(self, '_m_x'): + return self._m_x + + self._m_x = (self.x_int / 100000.0) + return getattr(self, '_m_x', None) + + @property + def y(self): + if hasattr(self, '_m_y'): + return self._m_y + + self._m_y = (self.y_int / 100000.0) + return getattr(self, '_m_y', None) + + + class BkgdGreyscale(KaitaiStruct): + """Background chunk for greyscale images.""" + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.value = self._io.read_u2be() + + + class ChrmChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11cHRM + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.white_point = Png.Point(self._io, self, self._root) + self.red = Png.Point(self._io, self, self._root) + self.green = Png.Point(self._io, self, self._root) + self.blue = Png.Point(self._io, self, self._root) + + + class IhdrChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11IHDR + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.width = self._io.read_u4be() + self.height = self._io.read_u4be() + self.bit_depth = self._io.read_u1() + self.color_type = KaitaiStream.resolve_enum(Png.ColorType, self._io.read_u1()) + self.compression_method = self._io.read_u1() + self.filter_method = self._io.read_u1() + self.interlace_method = self._io.read_u1() + + + class PlteChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11PLTE + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.entries = [] + i = 0 + while not self._io.is_eof(): + self.entries.append(Png.Rgb(self._io, self, self._root)) + i += 1 + + + + class SrgbChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11sRGB + """ + + class Intent(Enum): + perceptual = 0 + relative_colorimetric = 1 + saturation = 2 + absolute_colorimetric = 3 + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.render_intent = KaitaiStream.resolve_enum(Png.SrgbChunk.Intent, self._io.read_u1()) + + + class CompressedTextChunk(KaitaiStruct): + """Compressed text chunk effectively allows to store key-value + string pairs in PNG container, compressing "value" part (which + can be quite lengthy) with zlib compression. + + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11zTXt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.keyword = (self._io.read_bytes_term(0, False, True, True)).decode(u"UTF-8") + self.compression_method = KaitaiStream.resolve_enum(Png.CompressionMethods, self._io.read_u1()) + self._raw_text_datastream = self._io.read_bytes_full() + self.text_datastream = zlib.decompress(self._raw_text_datastream) + + + class FrameDataChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://wiki.mozilla.org/APNG_Specification#.60fdAT.60:_The_Frame_Data_Chunk + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.sequence_number = self._io.read_u4be() + self.frame_data = self._io.read_bytes_full() + + + class BkgdTruecolor(KaitaiStruct): + """Background chunk for truecolor images.""" + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.red = self._io.read_u2be() + self.green = self._io.read_u2be() + self.blue = self._io.read_u2be() + + + class GamaChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11gAMA + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.gamma_int = self._io.read_u4be() + + @property + def gamma_ratio(self): + if hasattr(self, '_m_gamma_ratio'): + return self._m_gamma_ratio + + self._m_gamma_ratio = (100000.0 / self.gamma_int) + return getattr(self, '_m_gamma_ratio', None) + + + class BkgdChunk(KaitaiStruct): + """Background chunk stores default background color to display this + image against. Contents depend on `color_type` of the image. + + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11bKGD + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + _on = self._root.ihdr.color_type + if _on == Png.ColorType.indexed: + self.bkgd = Png.BkgdIndexed(self._io, self, self._root) + elif _on == Png.ColorType.truecolor_alpha: + self.bkgd = Png.BkgdTruecolor(self._io, self, self._root) + elif _on == Png.ColorType.greyscale_alpha: + self.bkgd = Png.BkgdGreyscale(self._io, self, self._root) + elif _on == Png.ColorType.truecolor: + self.bkgd = Png.BkgdTruecolor(self._io, self, self._root) + elif _on == Png.ColorType.greyscale: + self.bkgd = Png.BkgdGreyscale(self._io, self, self._root) + + + class PhysChunk(KaitaiStruct): + """"Physical size" chunk stores data that allows to translate + logical pixels into physical units (meters, etc) and vice-versa. + + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11pHYs + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.pixels_per_unit_x = self._io.read_u4be() + self.pixels_per_unit_y = self._io.read_u4be() + self.unit = KaitaiStream.resolve_enum(Png.PhysUnit, self._io.read_u1()) + + + class FrameControlChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.sequence_number = self._io.read_u4be() + self.width = self._io.read_u4be() + if not self.width >= 1: + raise kaitaistruct.ValidationLessThanError(1, self.width, self._io, u"/types/frame_control_chunk/seq/1") + if not self.width <= self._root.ihdr.width: + raise kaitaistruct.ValidationGreaterThanError(self._root.ihdr.width, self.width, self._io, u"/types/frame_control_chunk/seq/1") + self.height = self._io.read_u4be() + if not self.height >= 1: + raise kaitaistruct.ValidationLessThanError(1, self.height, self._io, u"/types/frame_control_chunk/seq/2") + if not self.height <= self._root.ihdr.height: + raise kaitaistruct.ValidationGreaterThanError(self._root.ihdr.height, self.height, self._io, u"/types/frame_control_chunk/seq/2") + self.x_offset = self._io.read_u4be() + if not self.x_offset <= (self._root.ihdr.width - self.width): + raise kaitaistruct.ValidationGreaterThanError((self._root.ihdr.width - self.width), self.x_offset, self._io, u"/types/frame_control_chunk/seq/3") + self.y_offset = self._io.read_u4be() + if not self.y_offset <= (self._root.ihdr.height - self.height): + raise kaitaistruct.ValidationGreaterThanError((self._root.ihdr.height - self.height), self.y_offset, self._io, u"/types/frame_control_chunk/seq/4") + self.delay_num = self._io.read_u2be() + self.delay_den = self._io.read_u2be() + self.dispose_op = KaitaiStream.resolve_enum(Png.DisposeOpValues, self._io.read_u1()) + self.blend_op = KaitaiStream.resolve_enum(Png.BlendOpValues, self._io.read_u1()) + + @property + def delay(self): + """Time to display this frame, in seconds.""" + if hasattr(self, '_m_delay'): + return self._m_delay + + self._m_delay = (self.delay_num / (100.0 if self.delay_den == 0 else self.delay_den)) + return getattr(self, '_m_delay', None) + + + class InternationalTextChunk(KaitaiStruct): + """International text chunk effectively allows to store key-value string pairs in + PNG container. Both "key" (keyword) and "value" (text) parts are + given in pre-defined subset of iso8859-1 without control + characters. + + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11iTXt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.keyword = (self._io.read_bytes_term(0, False, True, True)).decode(u"UTF-8") + self.compression_flag = self._io.read_u1() + self.compression_method = KaitaiStream.resolve_enum(Png.CompressionMethods, self._io.read_u1()) + self.language_tag = (self._io.read_bytes_term(0, False, True, True)).decode(u"ASCII") + self.translated_keyword = (self._io.read_bytes_term(0, False, True, True)).decode(u"UTF-8") + self.text = (self._io.read_bytes_full()).decode(u"UTF-8") + + + class TextChunk(KaitaiStruct): + """Text chunk effectively allows to store key-value string pairs in + PNG container. Both "key" (keyword) and "value" (text) parts are + given in pre-defined subset of iso8859-1 without control + characters. + + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11tEXt + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.keyword = (self._io.read_bytes_term(0, False, True, True)).decode(u"iso8859-1") + self.text = (self._io.read_bytes_full()).decode(u"iso8859-1") + + + class AnimationControlChunk(KaitaiStruct): + """ + .. seealso:: + Source - https://wiki.mozilla.org/APNG_Specification#.60acTL.60:_The_Animation_Control_Chunk + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.num_frames = self._io.read_u4be() + self.num_plays = self._io.read_u4be() + + + class TimeChunk(KaitaiStruct): + """Time chunk stores time stamp of last modification of this image, + up to 1 second precision in UTC timezone. + + .. seealso:: + Source - https://www.w3.org/TR/PNG/#11tIME + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.year = self._io.read_u2be() + self.month = self._io.read_u1() + self.day = self._io.read_u1() + self.hour = self._io.read_u1() + self.minute = self._io.read_u1() + self.second = self._io.read_u1() + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/tls_client_hello.ksy b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/tls_client_hello.ksy new file mode 100644 index 0000000000000000000000000000000000000000..56461d8a300c7535a960240e3fbd3c334f8af04e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/tls_client_hello.ksy @@ -0,0 +1,132 @@ +meta: + id: tls_client_hello + xref: + rfc: 5246 # TLS 1.2 + wikidata: Q206494 # TLS + license: MIT + endian: be + +seq: + - id: version + type: version + + - id: random + type: random + + - id: session_id + type: session_id + + - id: cipher_suites + type: cipher_suites + + - id: compression_methods + type: compression_methods + + - id: extensions + type: extensions + if: _io.eof == false + +types: + version: + seq: + - id: major + type: u1 + + - id: minor + type: u1 + + random: + seq: + - id: gmt_unix_time + type: u4 + + - id: random + size: 28 + + session_id: + seq: + - id: len + type: u1 + + - id: sid + size: len + + cipher_suites: + seq: + - id: len + type: u2 + + - id: cipher_suites + type: u2 + repeat: expr + repeat-expr: len/2 + + compression_methods: + seq: + - id: len + type: u1 + + - id: compression_methods + size: len + + extensions: + seq: + - id: len + type: u2 + + - id: extensions + type: extension + repeat: eos + + extension: + seq: + - id: type + type: u2 + + - id: len + type: u2 + + - id: body + size: len + type: + switch-on: type + cases: + 0: sni + 16: alpn + + sni: + seq: + - id: list_length + type: u2 + + - id: server_names + type: server_name + repeat: eos + + server_name: + seq: + - id: name_type + type: u1 + + - id: length + type: u2 + + - id: host_name + size: length + + alpn: + seq: + - id: ext_len + type: u2 + + - id: alpn_protocols + type: protocol + repeat: eos + + protocol: + seq: + - id: strlen + type: u1 + + - id: name + size: strlen diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/tls_client_hello.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/tls_client_hello.py new file mode 100644 index 0000000000000000000000000000000000000000..fdcd7fe5a76a5daa08f2494f5e5686c3f8f37e02 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/tls_client_hello.py @@ -0,0 +1,189 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class TlsClientHello(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.version = TlsClientHello.Version(self._io, self, self._root) + self.random = TlsClientHello.Random(self._io, self, self._root) + self.session_id = TlsClientHello.SessionId(self._io, self, self._root) + self.cipher_suites = TlsClientHello.CipherSuites(self._io, self, self._root) + self.compression_methods = TlsClientHello.CompressionMethods(self._io, self, self._root) + if self._io.is_eof() == False: + self.extensions = TlsClientHello.Extensions(self._io, self, self._root) + + + class ServerName(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.name_type = self._io.read_u1() + self.length = self._io.read_u2be() + self.host_name = self._io.read_bytes(self.length) + + + class Random(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.gmt_unix_time = self._io.read_u4be() + self.random = self._io.read_bytes(28) + + + class SessionId(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u1() + self.sid = self._io.read_bytes(self.len) + + + class Sni(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.list_length = self._io.read_u2be() + self.server_names = [] + i = 0 + while not self._io.is_eof(): + self.server_names.append(TlsClientHello.ServerName(self._io, self, self._root)) + i += 1 + + + + class CipherSuites(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u2be() + self.cipher_suites = [] + for i in range(self.len // 2): + self.cipher_suites.append(self._io.read_u2be()) + + + + class CompressionMethods(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u1() + self.compression_methods = self._io.read_bytes(self.len) + + + class Alpn(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.ext_len = self._io.read_u2be() + self.alpn_protocols = [] + i = 0 + while not self._io.is_eof(): + self.alpn_protocols.append(TlsClientHello.Protocol(self._io, self, self._root)) + i += 1 + + + + class Extensions(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.len = self._io.read_u2be() + self.extensions = [] + i = 0 + while not self._io.is_eof(): + self.extensions.append(TlsClientHello.Extension(self._io, self, self._root)) + i += 1 + + + + class Version(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.major = self._io.read_u1() + self.minor = self._io.read_u1() + + + class Protocol(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.strlen = self._io.read_u1() + self.name = self._io.read_bytes(self.strlen) + + + class Extension(KaitaiStruct): + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.type = self._io.read_u2be() + self.len = self._io.read_u2be() + _on = self.type + if _on == 0: + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = TlsClientHello.Sni(_io__raw_body, self, self._root) + elif _on == 16: + self._raw_body = self._io.read_bytes(self.len) + _io__raw_body = KaitaiStream(BytesIO(self._raw_body)) + self.body = TlsClientHello.Alpn(_io__raw_body, self, self._root) + else: + self.body = self._io.read_bytes(self.len) + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/vlq_base128_le.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/vlq_base128_le.py new file mode 100644 index 0000000000000000000000000000000000000000..78f28c28d3f81b48ccff47737a87504a59ef1f7f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/kaitaistruct/vlq_base128_le.py @@ -0,0 +1,115 @@ +# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild + +import kaitaistruct +from kaitaistruct import KaitaiStruct + + +if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): + raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__)) + +class VlqBase128Le(KaitaiStruct): + """A variable-length unsigned/signed integer using base128 encoding. 1-byte groups + consist of 1-bit flag of continuation and 7-bit value chunk, and are ordered + "least significant group first", i.e. in "little-endian" manner. + + This particular encoding is specified and used in: + + * DWARF debug file format, where it's dubbed "unsigned LEB128" or "ULEB128". + http://dwarfstd.org/doc/dwarf-2.0.0.pdf - page 139 + * Google Protocol Buffers, where it's called "Base 128 Varints". + https://developers.google.com/protocol-buffers/docs/encoding?csw=1#varints + * Apache Lucene, where it's called "VInt" + https://lucene.apache.org/core/3_5_0/fileformats.html#VInt + * Apache Avro uses this as a basis for integer encoding, adding ZigZag on + top of it for signed ints + https://avro.apache.org/docs/current/spec.html#binary_encode_primitive + + More information on this encoding is available at https://en.wikipedia.org/wiki/LEB128 + + This particular implementation supports serialized values to up 8 bytes long. + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.groups = [] + i = 0 + while True: + _ = VlqBase128Le.Group(self._io, self, self._root) + self.groups.append(_) + if not (_.has_next): + break + i += 1 + + class Group(KaitaiStruct): + """One byte group, clearly divided into 7-bit "value" chunk and 1-bit "continuation" flag. + """ + def __init__(self, _io, _parent=None, _root=None): + self._io = _io + self._parent = _parent + self._root = _root if _root else self + self._read() + + def _read(self): + self.b = self._io.read_u1() + + @property + def has_next(self): + """If true, then we have more bytes to read.""" + if hasattr(self, '_m_has_next'): + return self._m_has_next + + self._m_has_next = (self.b & 128) != 0 + return getattr(self, '_m_has_next', None) + + @property + def value(self): + """The 7-bit (base128) numeric value chunk of this group.""" + if hasattr(self, '_m_value'): + return self._m_value + + self._m_value = (self.b & 127) + return getattr(self, '_m_value', None) + + + @property + def len(self): + if hasattr(self, '_m_len'): + return self._m_len + + self._m_len = len(self.groups) + return getattr(self, '_m_len', None) + + @property + def value(self): + """Resulting unsigned value as normal integer.""" + if hasattr(self, '_m_value'): + return self._m_value + + self._m_value = (((((((self.groups[0].value + ((self.groups[1].value << 7) if self.len >= 2 else 0)) + ((self.groups[2].value << 14) if self.len >= 3 else 0)) + ((self.groups[3].value << 21) if self.len >= 4 else 0)) + ((self.groups[4].value << 28) if self.len >= 5 else 0)) + ((self.groups[5].value << 35) if self.len >= 6 else 0)) + ((self.groups[6].value << 42) if self.len >= 7 else 0)) + ((self.groups[7].value << 49) if self.len >= 8 else 0)) + return getattr(self, '_m_value', None) + + @property + def sign_bit(self): + if hasattr(self, '_m_sign_bit'): + return self._m_sign_bit + + self._m_sign_bit = (1 << ((7 * self.len) - 1)) + return getattr(self, '_m_sign_bit', None) + + @property + def value_signed(self): + """ + .. seealso:: + Source - https://graphics.stanford.edu/~seander/bithacks.html#VariableSignExtend + """ + if hasattr(self, '_m_value_signed'): + return self._m_value_signed + + self._m_value_signed = ((self.value ^ self.sign_bit) - self.sign_bit) + return getattr(self, '_m_value_signed', None) + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASCommandResponse.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASCommandResponse.py new file mode 100644 index 0000000000000000000000000000000000000000..34755cbe673ad20835a566f74c89a9941dbe8579 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASCommandResponse.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +''' +@author: David Shaw, shawd@vmware.com + +Inspired by EAS Inspector for Fiddler +https://easinspectorforfiddler.codeplex.com + +----- The MIT License (MIT) ----- +Filename: ASCommandResponse.py +Copyright (c) 2014, David P. Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' +from .ASWBXML import ASWBXML +import logging + +class ASCommandResponse: + + def __init__(self, response): + self.wbxmlBody = response + try: + if ( len(response) > 0): + self.xmlString = self.decodeWBXML(self.wbxmlBody) + else: + raise ValueError("Empty WBXML body passed") + except Exception as e: + self.xmlString = None + raise ValueError("Error: {0}".format(e)) + + def getWBXMLBytes(self): + return self.wbxmlBytes + + def getXMLString(self): + return self.xmlString + + def decodeWBXML(self, body): + self.instance = ASWBXML() + self.instance.loadBytes(body) + return self.instance.getXml() + +if __name__ == "__main__": + import os + logging.basicConfig(level=logging.INFO) + + projectDir = os.path.dirname(os.path.realpath(".")) + samplesDir = os.path.join(projectDir, "Samples/") + listOfSamples = os.listdir(samplesDir) + + for filename in listOfSamples: + with open(samplesDir + os.sep + filename, "rb") as f: + byteWBXML = f.read() + + logging.info("-"*100) + logging.info(filename) + logging.info("-"*100) + instance = ASCommandResponse(byteWBXML) + logging.info(instance.xmlString) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXML.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXML.py new file mode 100644 index 0000000000000000000000000000000000000000..b63838a75a32ca6ec4dea29557eb1a9688e6f762 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXML.py @@ -0,0 +1,903 @@ +#!/usr/bin/env python3 +''' +@author: David Shaw, shawd@vmware.com + +Inspired by EAS Inspector for Fiddler +https://easinspectorforfiddler.codeplex.com + +----- The MIT License (MIT) ----- +Filename: ASWBXML.py +Copyright (c) 2014, David P. Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' +import xml.dom.minidom +import logging + +from .ASWBXMLCodePage import ASWBXMLCodePage +from .ASWBXMLByteQueue import ASWBXMLByteQueue +from .GlobalTokens import GlobalTokens +from .InvalidDataException import InvalidDataException + +class ASWBXML: + versionByte = 0x03 + publicIdentifierByte = 0x01 + characterSetByte = 0x6A + stringTableLengthByte = 0x00 + + def __init__(self): + + # empty on init + self.xmlDoc = xml.dom.minidom.Document() + self.currentCodePage = 0 + self.defaultCodePage = -1 + + # Load up code pages + # Currently there are 25 code pages as per MS-ASWBXML + self.codePages = [] + + # region Code Page Initialization + # Code Page 0: AirSync + # region AirSync Code Page + page = ASWBXMLCodePage() + page.namespace = "AirSync:" + page.xmlns = "airsync" + + page.addToken(0x05, "Sync") + page.addToken(0x06, "Responses") + page.addToken(0x07, "Add") + page.addToken(0x08, "Change") + page.addToken(0x09, "Delete") + page.addToken(0x0A, "Fetch") + page.addToken(0x0B, "SyncKey") + page.addToken(0x0C, "ClientId") + page.addToken(0x0D, "ServerId") + page.addToken(0x0E, "Status") + page.addToken(0x0F, "Collection") + page.addToken(0x10, "Class") + page.addToken(0x12, "CollectionId") + page.addToken(0x13, "GetChanges") + page.addToken(0x14, "MoreAvailable") + page.addToken(0x15, "WindowSize") + page.addToken(0x16, "Commands") + page.addToken(0x17, "Options") + page.addToken(0x18, "FilterType") + page.addToken(0x1B, "Conflict") + page.addToken(0x1C, "Collections") + page.addToken(0x1D, "ApplicationData") + page.addToken(0x1E, "DeletesAsMoves") + page.addToken(0x20, "Supported") + page.addToken(0x21, "SoftDelete") + page.addToken(0x22, "MIMESupport") + page.addToken(0x23, "MIMETruncation") + page.addToken(0x24, "Wait") + page.addToken(0x25, "Limit") + page.addToken(0x26, "Partial") + page.addToken(0x27, "ConversationMode") + page.addToken(0x28, "MaxItems") + page.addToken(0x29, "HeartbeatInterval") + self.codePages.append(page) + # endregion + + # Code Page 1: Contacts + # region Contacts Code Page + page = ASWBXMLCodePage() + page.namespace = "Contacts:" + page.xmlns = "contacts" + + page.addToken(0x05, "Anniversary") + page.addToken(0x06, "AssistantName") + page.addToken(0x07, "AssistantTelephoneNumber") + page.addToken(0x08, "Birthday") + page.addToken(0x0C, "Business2PhoneNumber") + page.addToken(0x0D, "BusinessCity") + page.addToken(0x0E, "BusinessCountry") + page.addToken(0x0F, "BusinessPostalCode") + page.addToken(0x10, "BusinessState") + page.addToken(0x11, "BusinessStreet") + page.addToken(0x12, "BusinessFaxNumber") + page.addToken(0x13, "BusinessPhoneNumber") + page.addToken(0x14, "CarPhoneNumber") + page.addToken(0x15, "Categories") + page.addToken(0x16, "Category") + page.addToken(0x17, "Children") + page.addToken(0x18, "Child") + page.addToken(0x19, "CompanyName") + page.addToken(0x1A, "Department") + page.addToken(0x1B, "Email1Address") + page.addToken(0x1C, "Email2Address") + page.addToken(0x1D, "Email3Address") + page.addToken(0x1E, "FileAs") + page.addToken(0x1F, "FirstName") + page.addToken(0x20, "Home2PhoneNumber") + page.addToken(0x21, "HomeCity") + page.addToken(0x22, "HomeCountry") + page.addToken(0x23, "HomePostalCode") + page.addToken(0x24, "HomeState") + page.addToken(0x25, "HomeStreet") + page.addToken(0x26, "HomeFaxNumber") + page.addToken(0x27, "HomePhoneNumber") + page.addToken(0x28, "JobTitle") + page.addToken(0x29, "LastName") + page.addToken(0x2A, "MiddleName") + page.addToken(0x2B, "MobilePhoneNumber") + page.addToken(0x2C, "OfficeLocation") + page.addToken(0x2D, "OtherCity") + page.addToken(0x2E, "OtherCountry") + page.addToken(0x2F, "OtherPostalCode") + page.addToken(0x30, "OtherState") + page.addToken(0x31, "OtherStreet") + page.addToken(0x32, "PagerNumber") + page.addToken(0x33, "RadioPhoneNumber") + page.addToken(0x34, "Spouse") + page.addToken(0x35, "Suffix") + page.addToken(0x36, "Title") + page.addToken(0x37, "Webpage") + page.addToken(0x38, "YomiCompanyName") + page.addToken(0x39, "YomiFirstName") + page.addToken(0x3A, "YomiLastName") + page.addToken(0x3C, "Picture") + page.addToken(0x3D, "Alias") + page.addToken(0x3E, "WeightedRank") + self.codePages.append(page) + # endregion + + # Code Page 2: Email + # region Email Code Page + page = ASWBXMLCodePage() + page.namespace = "Email:" + page.xmlns = "email" + + page.addToken(0x0F, "DateReceived") + page.addToken(0x11, "DisplayTo") + page.addToken(0x12, "Importance") + page.addToken(0x13, "MessageClass") + page.addToken(0x14, "Subject") + page.addToken(0x15, "Read") + page.addToken(0x16, "To") + page.addToken(0x17, "CC") + page.addToken(0x18, "From") + page.addToken(0x19, "ReplyTo") + page.addToken(0x1A, "AllDayEvent") + page.addToken(0x1B, "Categories") + page.addToken(0x1C, "Category") + page.addToken(0x1D, "DTStamp") + page.addToken(0x1E, "EndTime") + page.addToken(0x1F, "InstanceType") + page.addToken(0x20, "BusyStatus") + page.addToken(0x21, "Location") + page.addToken(0x22, "MeetingRequest") + page.addToken(0x23, "Organizer") + page.addToken(0x24, "RecurrenceId") + page.addToken(0x25, "Reminder") + page.addToken(0x26, "ResponseRequested") + page.addToken(0x27, "Recurrences") + page.addToken(0x28, "Recurrence") + page.addToken(0x29, "Recurrence_Type") + page.addToken(0x2A, "Recurrence_Until") + page.addToken(0x2B, "Recurrence_Occurrences") + page.addToken(0x2C, "Recurrence_Interval") + page.addToken(0x2D, "Recurrence_DayOfWeek") + page.addToken(0x2E, "Recurrence_DayOfMonth") + page.addToken(0x2F, "Recurrence_WeekOfMonth") + page.addToken(0x30, "Recurrence_MonthOfYear") + page.addToken(0x31, "StartTime") + page.addToken(0x32, "Sensitivity") + page.addToken(0x33, "TimeZone") + page.addToken(0x34, "GlobalObjId") + page.addToken(0x35, "ThreadTopic") + page.addToken(0x39, "InternetCPID") + page.addToken(0x3A, "Flag") + page.addToken(0x3B, "FlagStatus") + page.addToken(0x3C, "ContentClass") + page.addToken(0x3D, "FlagType") + page.addToken(0x3E, "CompleteTime") + page.addToken(0x3F, "DisallowNewTimeProposal") + self.codePages.append(page) + # endregion + + # Code Page 3: AirNotify - retired + # region AirNotify Code Page + page = ASWBXMLCodePage() + page.namespace = "" + page.xmlns = "" + self.codePages.append(page) + # endregion + + # Code Page 4: Calendar + # region Calendar Code Page + page = ASWBXMLCodePage() + page.namespace = "Calendar:" + page.xmlns = "calendar" + + page.addToken(0x05, "TimeZone") + page.addToken(0x06, "AllDayEvent") + page.addToken(0x07, "Attendees") + page.addToken(0x08, "Attendee") + page.addToken(0x09, "Attendee_Email") + page.addToken(0x0A, "Attendee_Name") + page.addToken(0x0D, "BusyStatus") + page.addToken(0x0E, "Categories") + page.addToken(0x0F, "Category") + page.addToken(0x11, "DTStamp") + page.addToken(0x12, "EndTime") + page.addToken(0x13, "Exception") + page.addToken(0x14, "Exceptions") + page.addToken(0x15, "Exception_Deleted") + page.addToken(0x16, "Exception_StartTime") + page.addToken(0x17, "Location") + page.addToken(0x18, "MeetingStatus") + page.addToken(0x19, "Organizer_Email") + page.addToken(0x1A, "Organizer_Name") + page.addToken(0x1B, "Recurrence") + page.addToken(0x1C, "Recurrence_Type") + page.addToken(0x1D, "Recurrence_Until") + page.addToken(0x1E, "Recurrence_Occurrences") + page.addToken(0x1F, "Recurrence_Interval") + page.addToken(0x20, "Recurrence_DayOfWeek") + page.addToken(0x21, "Recurrence_DayOfMonth") + page.addToken(0x22, "Recurrence_WeekOfMonth") + page.addToken(0x23, "Recurrence_MonthOfYear") + page.addToken(0x24, "Reminder") + page.addToken(0x25, "Sensitivity") + page.addToken(0x26, "Subject") + page.addToken(0x27, "StartTime") + page.addToken(0x28, "UID") + page.addToken(0x29, "Attendee_Status") + page.addToken(0x2A, "Attendee_Type") + page.addToken(0x33, "DisallowNewTimeProposal") + page.addToken(0x34, "ResponseRequested") + page.addToken(0x35, "AppointmentReplyTime") + page.addToken(0x36, "ResponseType") + page.addToken(0x37, "CalendarType") + page.addToken(0x38, "IsLeapMonth") + page.addToken(0x39, "FirstDayOfWeek") + page.addToken(0x3A, "OnlineMeetingConfLink") + page.addToken(0x3B, "OnlineMeetingExternalLink") + self.codePages.append(page) + # endregion + + # Code Page 5: Move + # region Move Code Page + page = ASWBXMLCodePage() + page.namespace = "Move:" + page.xmlns = "move" + + page.addToken(0x05, "MoveItems") + page.addToken(0x06, "Move") + page.addToken(0x07, "SrcMsgId") + page.addToken(0x08, "SrcFldId") + page.addToken(0x09, "DstFldId") + page.addToken(0x0A, "Response") + page.addToken(0x0B, "Status") + page.addToken(0x0C, "DstMsgId") + self.codePages.append(page) + # endregion + + # Code Page 6: ItemEstimate + # region ItemEstimate Code Page + page = ASWBXMLCodePage() + page.namespace = "GetItemEstimate:" + page.xmlns = "getitemestimate" + + page.addToken(0x05, "GetItemEstimate") + page.addToken(0x06, "Version") + page.addToken(0x07, "Collections") + page.addToken(0x08, "Collection") + page.addToken(0x09, "Class") + page.addToken(0x0A, "CollectionId") + page.addToken(0x0B, "DateTime") + page.addToken(0x0C, "Estimate") + page.addToken(0x0D, "Response") + page.addToken(0x0E, "Status") + self.codePages.append(page) + # endregion + + # Code Page 7: FolderHierarchy + # region FolderHierarchy Code Page + page = ASWBXMLCodePage() + page.namespace = "FolderHierarchy:" + page.xmlns = "folderhierarchy" + + page.addToken(0x07, "DisplayName") + page.addToken(0x08, "ServerId") + page.addToken(0x09, "ParentId") + page.addToken(0x0A, "Type") + page.addToken(0x0C, "Status") + page.addToken(0x0E, "Changes") + page.addToken(0x0F, "Add") + page.addToken(0x10, "Delete") + page.addToken(0x11, "Update") + page.addToken(0x12, "SyncKey") + page.addToken(0x13, "FolderCreate") + page.addToken(0x14, "FolderDelete") + page.addToken(0x15, "FolderUpdate") + page.addToken(0x16, "FolderSync") + page.addToken(0x17, "Count") + + self.codePages.append(page) + # endregion + + # Code Page 8: MeetingResponse + # region MeetingResponse Code Page + page = ASWBXMLCodePage() + page.namespace = "MeetingResponse:" + page.xmlns = "meetingresponse" + + page.addToken(0x05, "CalendarId") + page.addToken(0x06, "CollectionId") + page.addToken(0x07, "MeetingResponse") + page.addToken(0x08, "RequestId") + page.addToken(0x09, "Request") + page.addToken(0x0A, "Result") + page.addToken(0x0B, "Status") + page.addToken(0x0C, "UserResponse") + page.addToken(0x0E, "InstanceId") + self.codePages.append(page) + # endregion + + # Code Page 9: Tasks + # region Tasks Code Page + page = ASWBXMLCodePage() + page.namespace = "Tasks:" + page.xmlns = "tasks" + + page.addToken(0x08, "Categories") + page.addToken(0x09, "Category") + page.addToken(0x0A, "Complete") + page.addToken(0x0B, "DateCompleted") + page.addToken(0x0C, "DueDate") + page.addToken(0x0D, "UTCDueDate") + page.addToken(0x0E, "Importance") + page.addToken(0x0F, "Recurrence") + page.addToken(0x10, "Recurrence_Type") + page.addToken(0x11, "Recurrence_Start") + page.addToken(0x12, "Recurrence_Until") + page.addToken(0x13, "Recurrence_Occurrences") + page.addToken(0x14, "Recurrence_Interval") + page.addToken(0x15, "Recurrence_DayOfMonth") + page.addToken(0x16, "Recurrence_DayOfWeek") + page.addToken(0x17, "Recurrence_WeekOfMonth") + page.addToken(0x18, "Recurrence_MonthOfYear") + page.addToken(0x19, "Recurrence_Regenerate") + page.addToken(0x1A, "Recurrence_DeadOccur") + page.addToken(0x1B, "ReminderSet") + page.addToken(0x1C, "ReminderTime") + page.addToken(0x1D, "Sensitivity") + page.addToken(0x1E, "StartDate") + page.addToken(0x1F, "UTCStartDate") + page.addToken(0x20, "Subject") + page.addToken(0x22, "OrdinalDate") + page.addToken(0x23, "SubOrdinalDate") + page.addToken(0x24, "CalendarType") + page.addToken(0x25, "IsLeapMonth") + page.addToken(0x26, "FirstDayOfWeek") + self.codePages.append(page) + # endregion + + # Code Page 10: ResolveRecipients + # region ResolveRecipients Code Page + page = ASWBXMLCodePage() + page.namespace = "ResolveRecipients:" + page.xmlns = "resolverecipients" + + page.addToken(0x05, "ResolveRecipients") + page.addToken(0x06, "Response") + page.addToken(0x07, "Status") + page.addToken(0x08, "Type") + page.addToken(0x09, "Recipient") + page.addToken(0x0A, "DisplayName") + page.addToken(0x0B, "EmailAddress") + page.addToken(0x0C, "Certificates") + page.addToken(0x0D, "Certificate") + page.addToken(0x0E, "MiniCertificate") + page.addToken(0x0F, "Options") + page.addToken(0x10, "To") + page.addToken(0x11, "CertificateRetrieval") + page.addToken(0x12, "RecipientCount") + page.addToken(0x13, "MaxCertificates") + page.addToken(0x14, "MaxAmbiguousRecipients") + page.addToken(0x15, "CertificateCount") + page.addToken(0x16, "Availability") + page.addToken(0x17, "StartTime") + page.addToken(0x18, "EndTime") + page.addToken(0x19, "MergedFreeBusy") + page.addToken(0x1A, "Picture") + page.addToken(0x1B, "MaxSize") + page.addToken(0x1C, "Data") + page.addToken(0x1D, "MaxPictures") + self.codePages.append(page) + # endregion + + # Code Page 11: ValidateCert + # region ValidateCert Code Page + page = ASWBXMLCodePage() + page.namespace = "ValidateCert:" + page.xmlns = "validatecert" + + page.addToken(0x05, "ValidateCert") + page.addToken(0x06, "Certificates") + page.addToken(0x07, "Certificate") + page.addToken(0x08, "CertificateChain") + page.addToken(0x09, "CheckCRL") + page.addToken(0x0A, "Status") + self.codePages.append(page) + # endregion + + # Code Page 12: Contacts2 + # region Contacts2 Code Page + page = ASWBXMLCodePage() + page.namespace = "Contacts2:" + page.xmlns = "contacts2" + + page.addToken(0x05, "CustomerId") + page.addToken(0x06, "GovernmentId") + page.addToken(0x07, "IMAddress") + page.addToken(0x08, "IMAddress2") + page.addToken(0x09, "IMAddress3") + page.addToken(0x0A, "ManagerName") + page.addToken(0x0B, "CompanyMainPhone") + page.addToken(0x0C, "AccountName") + page.addToken(0x0D, "NickName") + page.addToken(0x0E, "MMS") + self.codePages.append(page) + # endregion + + # Code Page 13: Ping + # region Ping Code Page + page = ASWBXMLCodePage() + page.namespace = "Ping:" + page.xmlns = "ping" + + page.addToken(0x05, "Ping") + page.addToken(0x06, "AutdState") # Per MS-ASWBXML, this tag is not used by protocol + page.addToken(0x07, "Status") + page.addToken(0x08, "HeartbeatInterval") + page.addToken(0x09, "Folders") + page.addToken(0x0A, "Folder") + page.addToken(0x0B, "Id") + page.addToken(0x0C, "Class") + page.addToken(0x0D, "MaxFolders") + self.codePages.append(page) + # endregion + + # Code Page 14: Provision + # region Provision Code Page + page = ASWBXMLCodePage() + page.namespace = "Provision:" + page.xmlns = "provision" + + page.addToken(0x05, "Provision") + page.addToken(0x06, "Policies") + page.addToken(0x07, "Policy") + page.addToken(0x08, "PolicyType") + page.addToken(0x09, "PolicyKey") + page.addToken(0x0A, "Data") + page.addToken(0x0B, "Status") + page.addToken(0x0C, "RemoteWipe") + page.addToken(0x0D, "EASProvisionDoc") + page.addToken(0x0E, "DevicePasswordEnabled") + page.addToken(0x0F, "AlphanumericDevicePasswordRequired") + page.addToken(0x10, "RequireStorageCardEncryption") + page.addToken(0x11, "PasswordRecoveryEnabled") + page.addToken(0x13, "AttachmentsEnabled") + page.addToken(0x14, "MinDevicePasswordLength") + page.addToken(0x15, "MaxInactivityTimeDeviceLock") + page.addToken(0x16, "MaxDevicePasswordFailedAttempts") + page.addToken(0x17, "MaxAttachmentSize") + page.addToken(0x18, "AllowSimpleDevicePassword") + page.addToken(0x19, "DevicePasswordExpiration") + page.addToken(0x1A, "DevicePasswordHistory") + page.addToken(0x1B, "AllowStorageCard") + page.addToken(0x1C, "AllowCamera") + page.addToken(0x1D, "RequireDeviceEncryption") + page.addToken(0x1E, "AllowUnsignedApplications") + page.addToken(0x1F, "AllowUnsignedInstallationPackages") + page.addToken(0x20, "MinDevicePasswordComplexCharacters") + page.addToken(0x21, "AllowWiFi") + page.addToken(0x22, "AllowTextMessaging") + page.addToken(0x23, "AllowPOPIMAPEmail") + page.addToken(0x24, "AllowBluetooth") + page.addToken(0x25, "AllowIrDA") + page.addToken(0x26, "RequireManualSyncWhenRoaming") + page.addToken(0x27, "AllowDesktopSync") + page.addToken(0x28, "MaxCalendarAgeFilter") + page.addToken(0x29, "AllowHTMLEmail") + page.addToken(0x2A, "MaxEmailAgeFilter") + page.addToken(0x2B, "MaxEmailBodyTruncationSize") + page.addToken(0x2C, "MaxEmailHTMLBodyTruncationSize") + page.addToken(0x2D, "RequireSignedSMIMEMessages") + page.addToken(0x2E, "RequireEncryptedSMIMEMessages") + page.addToken(0x2F, "RequireSignedSMIMEAlgorithm") + page.addToken(0x30, "RequireEncryptionSMIMEAlgorithm") + page.addToken(0x31, "AllowSMIMEEncryptionAlgorithmNegotiation") + page.addToken(0x32, "AllowSMIMESoftCerts") + page.addToken(0x33, "AllowBrowser") + page.addToken(0x34, "AllowConsumerEmail") + page.addToken(0x35, "AllowRemoteDesktop") + page.addToken(0x36, "AllowInternetSharing") + page.addToken(0x37, "UnapprovedInROMApplicationList") + page.addToken(0x38, "ApplicationName") + page.addToken(0x39, "ApprovedApplicationList") + page.addToken(0x3A, "Hash") + self.codePages.append(page) + # endregion + + # Code Page 15: Search + # region Search Code Page + page = ASWBXMLCodePage() + page.namespace = "Search:" + page.xmlns = "search" + + page.addToken(0x05, "Search") + page.addToken(0x07, "Store") + page.addToken(0x08, "Name") + page.addToken(0x09, "Query") + page.addToken(0x0A, "Options") + page.addToken(0x0B, "Range") + page.addToken(0x0C, "Status") + page.addToken(0x0D, "Response") + page.addToken(0x0E, "Result") + page.addToken(0x0F, "Properties") + page.addToken(0x10, "Total") + page.addToken(0x11, "EqualTo") + page.addToken(0x12, "Value") + page.addToken(0x13, "And") + page.addToken(0x14, "Or") + page.addToken(0x15, "FreeText") + page.addToken(0x17, "DeepTraversal") + page.addToken(0x18, "LongId") + page.addToken(0x19, "RebuildResults") + page.addToken(0x1A, "LessThan") + page.addToken(0x1B, "GreaterThan") + page.addToken(0x1E, "UserName") + page.addToken(0x1F, "Password") + page.addToken(0x20, "ConversationId") + page.addToken(0x21, "Picture") + page.addToken(0x22, "MaxSize") + page.addToken(0x23, "MaxPictures") + self.codePages.append(page) + # endregion + + # Code Page 16: GAL + # region GAL Code Page + page = ASWBXMLCodePage() + page.namespace = "GAL:" + page.xmlns = "gal" + + page.addToken(0x05, "DisplayName") + page.addToken(0x06, "Phone") + page.addToken(0x07, "Office") + page.addToken(0x08, "Title") + page.addToken(0x09, "Company") + page.addToken(0x0A, "Alias") + page.addToken(0x0B, "FirstName") + page.addToken(0x0C, "LastName") + page.addToken(0x0D, "HomePhone") + page.addToken(0x0E, "MobilePhone") + page.addToken(0x0F, "EmailAddress") + page.addToken(0x10, "Picture") + page.addToken(0x11, "Status") + page.addToken(0x12, "Data") + self.codePages.append(page) + # endregion + + # Code Page 17: AirSyncBase + # region AirSyncBase Code Page + page = ASWBXMLCodePage() + page.namespace = "AirSyncBase:" + page.xmlns = "airsyncbase" + + page.addToken(0x05, "BodyPreference") + page.addToken(0x06, "Type") + page.addToken(0x07, "TruncationSize") + page.addToken(0x08, "AllOrNone") + page.addToken(0x0A, "Body") + page.addToken(0x0B, "Data") + page.addToken(0x0C, "EstimatedDataSize") + page.addToken(0x0D, "Truncated") + page.addToken(0x0E, "Attachments") + page.addToken(0x0F, "Attachment") + page.addToken(0x10, "DisplayName") + page.addToken(0x11, "FileReference") + page.addToken(0x12, "Method") + page.addToken(0x13, "ContentId") + page.addToken(0x14, "ContentLocation") + page.addToken(0x15, "IsInline") + page.addToken(0x16, "NativeBodyType") + page.addToken(0x17, "ContentType") + page.addToken(0x18, "Preview") + page.addToken(0x19, "BodyPartPreference") + page.addToken(0x1A, "BodyPart") + page.addToken(0x1B, "Status") + self.codePages.append(page) + # endregion + + # Code Page 18: Settings + # region Settings Code Page + page = ASWBXMLCodePage() + page.namespace = "Settings:" + page.xmlns = "settings" + + page.addToken(0x05, "Settings") + page.addToken(0x06, "Status") + page.addToken(0x07, "Get") + page.addToken(0x08, "Set") + page.addToken(0x09, "Oof") + page.addToken(0x0A, "OofState") + page.addToken(0x0B, "StartTime") + page.addToken(0x0C, "EndTime") + page.addToken(0x0D, "OofMessage") + page.addToken(0x0E, "AppliesToInternal") + page.addToken(0x0F, "AppliesToExternalKnown") + page.addToken(0x10, "AppliesToExternalUnknown") + page.addToken(0x11, "Enabled") + page.addToken(0x12, "ReplyMessage") + page.addToken(0x13, "BodyType") + page.addToken(0x14, "DevicePassword") + page.addToken(0x15, "Password") + page.addToken(0x16, "DeviceInformation") + page.addToken(0x17, "Model") + page.addToken(0x18, "IMEI") + page.addToken(0x19, "FriendlyName") + page.addToken(0x1A, "OS") + page.addToken(0x1B, "OSLanguage") + page.addToken(0x1C, "PhoneNumber") + page.addToken(0x1D, "UserInformation") + page.addToken(0x1E, "EmailAddresses") + page.addToken(0x1F, "SmtpAddress") + page.addToken(0x20, "UserAgent") + page.addToken(0x21, "EnableOutboundSMS") + page.addToken(0x22, "MobileOperator") + page.addToken(0x23, "PrimarySmtpAddress") + page.addToken(0x24, "Accounts") + page.addToken(0x25, "Account") + page.addToken(0x26, "AccountId") + page.addToken(0x27, "AccountName") + page.addToken(0x28, "UserDisplayName") + page.addToken(0x29, "SendDisabled") + page.addToken(0x2B, "RightsManagementInformation") + self.codePages.append(page) + # endregion + + # Code Page 19: DocumentLibrary + # region DocumentLibrary Code Page + page = ASWBXMLCodePage() + page.namespace = "DocumentLibrary:" + page.xmlns = "documentlibrary" + + page.addToken(0x05, "LinkId") + page.addToken(0x06, "DisplayName") + page.addToken(0x07, "IsFolder") + page.addToken(0x08, "CreationDate") + page.addToken(0x09, "LastModifiedDate") + page.addToken(0x0A, "IsHidden") + page.addToken(0x0B, "ContentLength") + page.addToken(0x0C, "ContentType") + self.codePages.append(page) + # endregion + + # Code Page 20: ItemOperations + # region ItemOperations Code Page + page = ASWBXMLCodePage() + page.namespace = "ItemOperations:" + page.xmlns = "itemoperations" + + page.addToken(0x05, "ItemOperations") + page.addToken(0x06, "Fetch") + page.addToken(0x07, "Store") + page.addToken(0x08, "Options") + page.addToken(0x09, "Range") + page.addToken(0x0A, "Total") + page.addToken(0x0B, "Properties") + page.addToken(0x0C, "Data") + page.addToken(0x0D, "Status") + page.addToken(0x0E, "Response") + page.addToken(0x0F, "Version") + page.addToken(0x10, "Schema") + page.addToken(0x11, "Part") + page.addToken(0x12, "EmptyFolderContents") + page.addToken(0x13, "DeleteSubFolders") + page.addToken(0x14, "UserName") + page.addToken(0x15, "Password") + page.addToken(0x16, "Move") + page.addToken(0x17, "DstFldId") + page.addToken(0x18, "ConversationId") + page.addToken(0x19, "MoveAlways") + self.codePages.append(page) + # endregion + + # Code Page 21: ComposeMail + # region ComposeMail Code Page + page = ASWBXMLCodePage() + page.namespace = "ComposeMail:" + page.xmlns = "composemail" + + page.addToken(0x05, "SendMail") + page.addToken(0x06, "SmartForward") + page.addToken(0x07, "SmartReply") + page.addToken(0x08, "SaveInSentItems") + page.addToken(0x09, "ReplaceMime") + page.addToken(0x0B, "Source") + page.addToken(0x0C, "FolderId") + page.addToken(0x0D, "ItemId") + page.addToken(0x0E, "LongId") + page.addToken(0x0F, "InstanceId") + page.addToken(0x10, "MIME") + page.addToken(0x11, "ClientId") + page.addToken(0x12, "Status") + page.addToken(0x13, "AccountId") + self.codePages.append(page) + # endregion + + # Code Page 22: Email2 + # region Email2 Code Page + page = ASWBXMLCodePage() + page.namespace = "Email2:" + page.xmlns = "email2" + + page.addToken(0x05, "UmCallerID") + page.addToken(0x06, "UmUserNotes") + page.addToken(0x07, "UmAttDuration") + page.addToken(0x08, "UmAttOrder") + page.addToken(0x09, "ConversationId") + page.addToken(0x0A, "ConversationIndex") + page.addToken(0x0B, "LastVerbExecuted") + page.addToken(0x0C, "LastVerbExecutionTime") + page.addToken(0x0D, "ReceivedAsBcc") + page.addToken(0x0E, "Sender") + page.addToken(0x0F, "CalendarType") + page.addToken(0x10, "IsLeapMonth") + page.addToken(0x11, "AccountId") + page.addToken(0x12, "FirstDayOfWeek") + page.addToken(0x13, "MeetingMessageType") + self.codePages.append(page) + # endregion + + # Code Page 23: Notes + # region Notes Code Page + page = ASWBXMLCodePage() + page.namespace = "Notes:" + page.xmlns = "notes" + + page.addToken(0x05, "Subject") + page.addToken(0x06, "MessageClass") + page.addToken(0x07, "LastModifiedDate") + page.addToken(0x08, "Categories") + page.addToken(0x09, "Category") + self.codePages.append(page) + # endregion + + # Code Page 24: RightsManagement + # region RightsManagement Code Page + page = ASWBXMLCodePage() + page.namespace = "RightsManagement:" + page.xmlns = "rightsmanagement" + + page.addToken(0x05, "RightsManagementSupport") + page.addToken(0x06, "RightsManagementTemplates") + page.addToken(0x07, "RightsManagementTemplate") + page.addToken(0x08, "RightsManagementLicense") + page.addToken(0x09, "EditAllowed") + page.addToken(0x0A, "ReplyAllowed") + page.addToken(0x0B, "ReplyAllAllowed") + page.addToken(0x0C, "ForwardAllowed") + page.addToken(0x0D, "ModifyRecipientsAllowed") + page.addToken(0x0E, "ExtractAllowed") + page.addToken(0x0F, "PrintAllowed") + page.addToken(0x10, "ExportAllowed") + page.addToken(0x11, "ProgrammaticAccessAllowed") + page.addToken(0x12, "RMOwner") + page.addToken(0x13, "ContentExpiryDate") + page.addToken(0x14, "TemplateID") + page.addToken(0x15, "TemplateName") + page.addToken(0x16, "TemplateDescription") + page.addToken(0x17, "ContentOwner") + page.addToken(0x18, "RemoveRightsManagementDistribution") + self.codePages.append(page) + # endregion + # endregion + + def loadXml(self, strXML): + # note xmlDoc has .childNodes and .parentNode + self.xmlDoc = xml.dom.minidom.parseString(strXML) + + def getXml(self): + if (self.xmlDoc != None): + try: + return self.xmlDoc.toprettyxml(indent=" ", newl="\n") + except: + return self.xmlDoc.toxml() + + def loadBytes(self, byteWBXML): + + currentNode = self.xmlDoc + + wbXMLBytes = ASWBXMLByteQueue(byteWBXML) + # Version is ignored + version = wbXMLBytes.dequeueAndLog() + + # Public Identifier is ignored + publicId = wbXMLBytes.dequeueMultibyteInt() + + logging.debug("Version: %d, Public Identifier: %d" % (version, publicId)) + + # Character set + # Currently only UTF-8 is supported, throw if something else + charset = wbXMLBytes.dequeueMultibyteInt() + if (charset != 0x6A): + raise InvalidDataException("ASWBXML only supports UTF-8 encoded XML.") + + # String table length + # This should be 0, MS-ASWBXML does not use string tables + stringTableLength = wbXMLBytes.dequeueMultibyteInt() + if (stringTableLength != 0): + raise InvalidDataException("WBXML data contains a string table.") + + # Now we should be at the body of the data. + # Add the declaration + unusedArray = [GlobalTokens.ENTITY, GlobalTokens.EXT_0, GlobalTokens.EXT_1, GlobalTokens.EXT_2, GlobalTokens.EXT_I_0, GlobalTokens.EXT_I_1, GlobalTokens.EXT_I_2, GlobalTokens.EXT_T_0, GlobalTokens.EXT_T_1, GlobalTokens.EXT_T_2, GlobalTokens.LITERAL, GlobalTokens.LITERAL_A, GlobalTokens.LITERAL_AC, GlobalTokens.LITERAL_C, GlobalTokens.PI, GlobalTokens.STR_T] + + while ( wbXMLBytes.qsize() > 0): + currentByte = wbXMLBytes.dequeueAndLog() + if ( currentByte == GlobalTokens.SWITCH_PAGE ): + newCodePage = wbXMLBytes.dequeueAndLog() + if (newCodePage >= 0 and newCodePage < 25): + self.currentCodePage = newCodePage + else: + raise InvalidDataException("Unknown code page ID 0x{0:X} encountered in WBXML".format(currentByte)) + elif ( currentByte == GlobalTokens.END ): + if (currentNode != None and currentNode.parentNode != None): + currentNode = currentNode.parentNode + else: + raise InvalidDataException("END global token encountered out of sequence") + break + elif ( currentByte == GlobalTokens.OPAQUE ): + CDATALength = wbXMLBytes.dequeueMultibyteInt() + newOpaqueNode = self.xmlDoc.createCDATASection(wbXMLBytes.dequeueString(CDATALength)) + currentNode.appendChild(newOpaqueNode) + + elif ( currentByte == GlobalTokens.STR_I ): + newTextNode = self.xmlDoc.createTextNode(wbXMLBytes.dequeueString()) + currentNode.appendChild(newTextNode) + + elif ( currentByte in unusedArray): + raise InvalidDataException("Encountered unknown global token 0x{0:X}.".format(currentByte)) + else: + hasAttributes = (currentByte & 0x80) > 0 + hasContent = (currentByte & 0x40) > 0 + + token = currentByte & 0x3F + if (hasAttributes): + raise InvalidDataException("Token 0x{0:X} has attributes.".format(token)) + + strTag = self.codePages[self.currentCodePage].getTag(token) + if (strTag == None): + strTag = "UNKNOWN_TAG_{0,2:X}".format(token) + + newNode = self.xmlDoc.createElement(strTag) + # not sure if this should be set on every node or not + #newNode.setAttribute("xmlns", self.codePages[self.currentCodePage].xmlns) + + currentNode.appendChild(newNode) + + if (hasContent): + currentNode = newNode + + logging.debug("Total bytes dequeued: %d" % wbXMLBytes.bytesDequeued) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py new file mode 100644 index 0000000000000000000000000000000000000000..e457fc5092ffc4383ab9c1178f345010034a17dc --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +''' +@author: David Shaw, shawd@vmware.com + +Inspired by EAS Inspector for Fiddler +https://easinspectorforfiddler.codeplex.com + +----- The MIT License (MIT) ----- +Filename: ASWBXMLByteQueue.py +Copyright (c) 2014, David P. Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' +from queue import Queue +import logging + +class ASWBXMLByteQueue(Queue): + + def __init__(self, wbxmlBytes): + + self.bytesDequeued = 0 + self.bytesEnqueued = 0 + + Queue.__init__(self) + + for byte in wbxmlBytes: + self.put(byte) + self.bytesEnqueued += 1 + + + logging.debug("Array byte count: %d, enqueued: %d" % (self.qsize(), self.bytesEnqueued)) + + """ + Created to debug the dequeueing of bytes + """ + def dequeueAndLog(self): + singleByte = self.get() + self.bytesDequeued += 1 + logging.debug("Dequeued byte 0x{0:X} ({1} total)".format(singleByte, self.bytesDequeued)) + return singleByte + + """ + Return true if the continuation bit is set in the byte + """ + def checkContinuationBit(self, byteval): + continuationBitmask = 0x80 + return (continuationBitmask & byteval) != 0 + + def dequeueMultibyteInt(self): + iReturn = 0 + singleByte = 0xFF + + while True: + iReturn <<= 7 + if (self.qsize() == 0): + break + else: + singleByte = self.dequeueAndLog() + iReturn += int(singleByte & 0x7F) + if not self.checkContinuationBit(singleByte): + return iReturn + + def dequeueString(self, length=None): + if ( length != None): + currentByte = 0x00 + strReturn = "" + for i in range(0, length): + # TODO: Improve this handling. We are technically UTF-8, meaning + # that characters could be more than one byte long. This will fail if we have + # characters outside of the US-ASCII range + if ( self.qsize() == 0 ): + break + currentByte = self.dequeueAndLog() + strReturn += chr(currentByte) + + else: + currentByte = 0x00 + strReturn = "" + while True: + currentByte = self.dequeueAndLog() + if (currentByte != 0x00): + strReturn += chr(currentByte) + else: + break + + return strReturn diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py new file mode 100644 index 0000000000000000000000000000000000000000..061e1fbb813c2273d4c8b0d65ca261f8b0955e07 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +''' +@author: David Shaw, shawd@vmware.com + +Inspired by EAS Inspector for Fiddler +https://easinspectorforfiddler.codeplex.com + +----- The MIT License (MIT) ----- +Filename: ASWBXMLCodePage.py +Copyright (c) 2014, David P. Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' +class ASWBXMLCodePage: + def __init__(self): + self.namespace = "" + self.xmlns = "" + self.tokenLookup = {} + self.tagLookup = {} + + def addToken(self, token, tag): + self.tokenLookup[token] = tag + self.tagLookup[tag] = token + + def getToken(self, tag): + if tag in self.tagLookup: + return self.tagLookup[tag] + return 0xFF + + def getTag(self, token): + if token in self.tokenLookup: + return self.tokenLookup[token] + return None + + def __repr__(self): + return str(self.tokenLookup) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/GlobalTokens.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/GlobalTokens.py new file mode 100644 index 0000000000000000000000000000000000000000..cebcd24779dc9bea045bba729158f51be9350044 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/GlobalTokens.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +''' +@author: David Shaw, shawd@vmware.com + +Inspired by EAS Inspector for Fiddler +https://easinspectorforfiddler.codeplex.com + +----- The MIT License (MIT) ----- +Filename: GlobalTokens.py +Copyright (c) 2014, David P. Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' +class GlobalTokens: + SWITCH_PAGE = 0x00 + END = 0x01 + ENTITY = 0x02 + STR_I = 0x03 + LITERAL = 0x04 + EXT_I_0 = 0x40 + EXT_I_1 = 0x41 + EXT_I_2 = 0x42 + PI = 0x43 + LITERAL_C = 0x44 + EXT_T_0 = 0x80 + EXT_T_1 = 0x81 + EXT_T_2 = 0x82 + STR_T = 0x83 + LITERAL_A = 0x84 + EXT_0 = 0xC0 + EXT_1 = 0xC1 + EXT_2 = 0xC2 + OPAQUE = 0xC3 + LITERAL_AC = 0xC4 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/InvalidDataException.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/InvalidDataException.py new file mode 100644 index 0000000000000000000000000000000000000000..d4296b40f6377d468cfeb240cb939e2b0b0f8468 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/InvalidDataException.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +''' +@author: David Shaw, shawd@vmware.com + +Inspired by EAS Inspector for Fiddler +https://easinspectorforfiddler.codeplex.com + +----- The MIT License (MIT) ----- +Filename: InvalidDataException.py +Copyright (c) 2014, David P. Shaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +''' +class InvalidDataException(Exception): + pass diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASCommandResponse.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASCommandResponse.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..60c91e7d2d48a97960ead308c5ffd749586eb06f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASCommandResponse.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXML.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXML.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a53ed66b96c9d152f49ccbc5d93ab74ee49d088d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXML.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXMLByteQueue.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXMLByteQueue.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05b673e69d0a124a5adabb4cebfc53c0b06b800b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXMLByteQueue.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXMLCodePage.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXMLCodePage.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..044272466abf51d9ab55c3312b4420080f817c42 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/ASWBXMLCodePage.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/GlobalTokens.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/GlobalTokens.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74642544e7d51f5a5236d44a7ea1a9c415104fbc Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/GlobalTokens.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/InvalidDataException.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/InvalidDataException.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..477162026481abc700372fdf1ec4cd8c4cad5332 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/InvalidDataException.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..368fedce7d438ae0245bcbf8c3c541bf76c46bfe Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/contrib/wbxml/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ed04595619aa1916fe1323bf8e4cb0eeab1410e Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/bidi.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/bidi.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8ddca8a9dc85227a47e0146b6d84f8ce47f75b1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/bidi.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/multidict.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/multidict.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08281e326dbe8b4c31120ccd4a48d2e7294da0e1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/multidict.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/serializable.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/serializable.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df6d5deacfc3f75eecba8ecded96435f5c5b5472 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/__pycache__/serializable.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/bidi.py b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/bidi.py new file mode 100644 index 0000000000000000000000000000000000000000..5423f68c9c0fef9db9ee6002dff0264166ad95f9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/bidi.py @@ -0,0 +1,26 @@ +class BiDi: + """ + A wee utility class for keeping bi-directional mappings, like field + constants in protocols. Names are attributes on the object, dict-like + access maps values to names: + + CONST = BiDi(a=1, b=2) + assert CONST.a == 1 + assert CONST.get_name(1) == "a" + """ + + def __init__(self, **kwargs): + self.names = kwargs + self.values = {} + for k, v in kwargs.items(): + self.values[v] = k + if len(self.names) != len(self.values): + raise ValueError("Duplicate values not allowed.") + + def __getattr__(self, k): + if k in self.names: + return self.names[k] + raise AttributeError("No such attribute: %s", k) + + def get_name(self, n, default=None): + return self.values.get(n, default) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/multidict.py b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/multidict.py new file mode 100644 index 0000000000000000000000000000000000000000..8a90c7327b034317d0e209c3b72fc60fe55abede --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/multidict.py @@ -0,0 +1,206 @@ +from abc import ABCMeta +from abc import abstractmethod +from collections.abc import Iterator +from collections.abc import MutableMapping +from collections.abc import Sequence +from typing import TypeVar + +from mitmproxy.coretypes import serializable + +KT = TypeVar("KT") +VT = TypeVar("VT") + + +class _MultiDict(MutableMapping[KT, VT], metaclass=ABCMeta): + """ + A MultiDict is a dictionary-like data structure that supports multiple values per key. + """ + + fields: tuple[tuple[KT, VT], ...] + """The underlying raw datastructure.""" + + def __repr__(self): + fields = (repr(field) for field in self.fields) + return "{cls}[{fields}]".format( + cls=type(self).__name__, fields=", ".join(fields) + ) + + @staticmethod + @abstractmethod + def _reduce_values(values: Sequence[VT]) -> VT: + """ + If a user accesses multidict["foo"], this method + reduces all values for "foo" to a single value that is returned. + For example, HTTP headers are folded, whereas we will just take + the first cookie we found with that name. + """ + + @staticmethod + @abstractmethod + def _kconv(key: KT) -> KT: + """ + This method converts a key to its canonical representation. + For example, HTTP headers are case-insensitive, so this method returns key.lower(). + """ + + def __getitem__(self, key: KT) -> VT: + values = self.get_all(key) + if not values: + raise KeyError(key) + return self._reduce_values(values) + + def __setitem__(self, key: KT, value: VT) -> None: + self.set_all(key, [value]) + + def __delitem__(self, key: KT) -> None: + if key not in self: + raise KeyError(key) + key = self._kconv(key) + self.fields = tuple( + field for field in self.fields if key != self._kconv(field[0]) + ) + + def __iter__(self) -> Iterator[KT]: + seen = set() + for key, _ in self.fields: + key_kconv = self._kconv(key) + if key_kconv not in seen: + seen.add(key_kconv) + yield key + + def __len__(self) -> int: + return len({self._kconv(key) for key, _ in self.fields}) + + def __eq__(self, other) -> bool: + if isinstance(other, MultiDict): + return self.fields == other.fields + return False + + def get_all(self, key: KT) -> list[VT]: + """ + Return the list of all values for a given key. + If that key is not in the MultiDict, the return value will be an empty list. + """ + key = self._kconv(key) + return [value for k, value in self.fields if self._kconv(k) == key] + + def set_all(self, key: KT, values: list[VT]) -> None: + """ + Remove the old values for a key and add new ones. + """ + key_kconv = self._kconv(key) + + new_fields: list[tuple[KT, VT]] = [] + for field in self.fields: + if self._kconv(field[0]) == key_kconv: + if values: + new_fields.append((field[0], values.pop(0))) + else: + new_fields.append(field) + while values: + new_fields.append((key, values.pop(0))) + self.fields = tuple(new_fields) + + def add(self, key: KT, value: VT) -> None: + """ + Add an additional value for the given key at the bottom. + """ + self.insert(len(self.fields), key, value) + + def insert(self, index: int, key: KT, value: VT) -> None: + """ + Insert an additional value for the given key at the specified position. + """ + item = (key, value) + self.fields = self.fields[:index] + (item,) + self.fields[index:] + + def keys(self, multi: bool = False): + """ + Get all keys. + + If `multi` is True, one key per value will be returned. + If `multi` is False, duplicate keys will only be returned once. + """ + return (k for k, _ in self.items(multi)) + + def values(self, multi: bool = False): + """ + Get all values. + + If `multi` is True, all values will be returned. + If `multi` is False, only the first value per key will be returned. + """ + return (v for _, v in self.items(multi)) + + def items(self, multi: bool = False): + """ + Get all (key, value) tuples. + + If `multi` is True, all `(key, value)` pairs will be returned. + If False, only one tuple per key is returned. + """ + if multi: + return self.fields + else: + return super().items() + + +class MultiDict(_MultiDict[KT, VT], serializable.Serializable): + """A concrete MultiDict, storing its own data.""" + + def __init__(self, fields=()): + super().__init__() + self.fields = tuple(tuple(i) for i in fields) # type: ignore + + @staticmethod + def _reduce_values(values): + return values[0] + + @staticmethod + def _kconv(key): + return key + + def get_state(self): + return self.fields + + def set_state(self, state): + self.fields = tuple(tuple(x) for x in state) # type: ignore + + @classmethod + def from_state(cls, state): + return cls(state) + + +class MultiDictView(_MultiDict[KT, VT]): + """ + The MultiDictView provides the MultiDict interface over calculated data. + The view itself contains no state - data is retrieved from the parent on + request, and stored back to the parent on change. + """ + + def __init__(self, getter, setter): + self._getter = getter + self._setter = setter + super().__init__() + + @staticmethod + def _kconv(key): + # All request-attributes are case-sensitive. + return key + + @staticmethod + def _reduce_values(values): + # We just return the first element if + # multiple elements exist with the same key. + return values[0] + + @property # type: ignore + def fields(self): + return self._getter() + + @fields.setter + def fields(self, value): + self._setter(value) + + def copy(self) -> "MultiDict[KT,VT]": + return MultiDict(self.fields) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/coretypes/serializable.py b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/serializable.py new file mode 100644 index 0000000000000000000000000000000000000000..0fc38eca11fdd171be0b4cd168972b5f437781df --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/coretypes/serializable.py @@ -0,0 +1,199 @@ +import abc +import collections.abc +import dataclasses +import enum +import typing +import uuid +from functools import cache +from typing import TypeVar + +try: + from types import NoneType + from types import UnionType +except ImportError: # pragma: no cover + + class UnionType: # type: ignore + pass + + NoneType = type(None) # type: ignore + +T = TypeVar("T", bound="Serializable") + +State = typing.Any + + +class Serializable(metaclass=abc.ABCMeta): + """ + Abstract Base Class that defines an API to save an object's state and restore it later on. + """ + + @classmethod + @abc.abstractmethod + def from_state(cls: type[T], state) -> T: + """ + Create a new object from the given state. + Consumes the passed state. + """ + raise NotImplementedError() + + @abc.abstractmethod + def get_state(self) -> State: + """ + Retrieve object state. + """ + raise NotImplementedError() + + @abc.abstractmethod + def set_state(self, state): + """ + Set object state to the given state. Consumes the passed state. + May return a `dataclasses.FrozenInstanceError` if the object is immutable. + """ + raise NotImplementedError() + + def copy(self: T) -> T: + state = self.get_state() + if isinstance(state, dict) and "id" in state: + state["id"] = str(uuid.uuid4()) + return self.from_state(state) + + +U = TypeVar("U", bound="SerializableDataclass") + + +class SerializableDataclass(Serializable): + @classmethod + @cache + def __fields(cls) -> tuple[dataclasses.Field, ...]: + # with from __future__ import annotations, `field.type` is a string, + # see https://github.com/python/cpython/issues/83623. + hints = typing.get_type_hints(cls) + fields = [] + # noinspection PyDataclass + for field in dataclasses.fields(cls): # type: ignore[arg-type] + if field.metadata.get("serialize", True) is False: + continue + if isinstance(field.type, str): + field.type = hints[field.name] + fields.append(field) + return tuple(fields) + + def get_state(self) -> State: + state: dict[str, State] = {} + for field in self.__fields(): + val = getattr(self, field.name) + state[field.name] = _to_state(val, field.type, field.name) + return state + + @classmethod + def from_state(cls: type[U], state) -> U: + # state = state.copy() + for field in cls.__fields(): + state[field.name] = _to_val(state[field.name], field.type, field.name) + try: + return cls(**state) # type: ignore + except TypeError as e: + raise ValueError(f"Invalid state for {cls}: {e} ({state=})") from e + + def set_state(self, state: State) -> None: + for field in self.__fields(): + current = getattr(self, field.name) + f_state = state.pop(field.name) + if isinstance(current, Serializable) and f_state is not None: + try: + current.set_state(f_state) + continue + except dataclasses.FrozenInstanceError: + pass + val: typing.Any = _to_val(f_state, field.type, field.name) + try: + setattr(self, field.name, val) + except dataclasses.FrozenInstanceError: + state[field.name] = f_state # restore state dict. + raise + + if state: + raise ValueError( + f"Unexpected fields in {type(self).__name__}.set_state: {state}" + ) + + +def _process( + attr_val: typing.Any, attr_type: typing.Any, attr_name: str, make: bool +) -> typing.Any: + origin = typing.get_origin(attr_type) + if origin is typing.Literal: + if attr_val not in typing.get_args(attr_type): + raise ValueError( + f"Invalid value for {attr_name}: {attr_val!r} does not match any literal value." + ) + return attr_val + if origin in (UnionType, typing.Union): + attr_type, nt = typing.get_args(attr_type) + assert nt is NoneType, ( + f"{attr_name}: only `x | None` union types are supported`" + ) + if attr_val is None: + return None # type: ignore + else: + return _process(attr_val, attr_type, attr_name, make) + else: + if attr_val is None: + raise ValueError(f"Attribute {attr_name} must not be None.") + + if make and hasattr(attr_type, "from_state"): + return attr_type.from_state(attr_val) # type: ignore + elif not make and hasattr(attr_type, "get_state"): + return attr_val.get_state() + + if origin in (list, collections.abc.Sequence): + (T,) = typing.get_args(attr_type) + return [_process(x, T, attr_name, make) for x in attr_val] # type: ignore + elif origin is tuple: + # We don't have a good way to represent tuple[str,int] | tuple[str,int,int,int], so we do a dirty hack here. + if attr_name in ("peername", "sockname"): + return tuple( + _process(x, T, attr_name, make) + for x, T in zip(attr_val, [str, int, int, int]) + ) # type: ignore + Ts = typing.get_args(attr_type) + if len(Ts) != len(attr_val): + raise ValueError( + f"Invalid data for {attr_name}. Expected {Ts}, got {attr_val}." + ) + return tuple(_process(x, T, attr_name, make) for T, x in zip(Ts, attr_val)) # type: ignore + elif origin is dict: + k_cls, v_cls = typing.get_args(attr_type) + return { + _process(k, k_cls, attr_name, make): _process(v, v_cls, attr_name, make) + for k, v in attr_val.items() + } # type: ignore + elif attr_type in (int, float): + if not isinstance(attr_val, (int, float)): + raise ValueError( + f"Invalid value for {attr_name}. Expected {attr_type}, got {attr_val} ({type(attr_val)})." + ) + return attr_type(attr_val) # type: ignore + elif attr_type in (str, bytes, bool): + if not isinstance(attr_val, attr_type): + raise ValueError( + f"Invalid value for {attr_name}. Expected {attr_type}, got {attr_val} ({type(attr_val)})." + ) + return attr_type(attr_val) # type: ignore + elif isinstance(attr_type, type) and issubclass(attr_type, enum.Enum): + if make: + return attr_type(attr_val) # type: ignore + else: + return attr_val.value + else: + raise TypeError(f"Unexpected type for {attr_name}: {attr_type!r}") + + +def _to_val(state: typing.Any, attr_type: typing.Any, attr_name: str) -> typing.Any: + """Create an object based on the state given in val.""" + return _process(state, attr_type, attr_name, True) + + +def _to_state(value: typing.Any, attr_type: typing.Any, attr_name: str) -> typing.Any: + """Get the state of the object given as val.""" + return _process(value, attr_type, attr_name, False) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/io/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bd95ab16fa5007f64ebff857159b4fbeff6d57fb --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/io/__init__.py @@ -0,0 +1,6 @@ +from .io import FilteredFlowWriter +from .io import FlowReader +from .io import FlowWriter +from .io import read_flows_from_paths + +__all__ = ["FlowWriter", "FlowReader", "FilteredFlowWriter", "read_flows_from_paths"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4482bb6ceb17eb1b68349ae32c37840e4e5890c2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/compat.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/compat.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a048d1ce97a1d8bfab51d8866ff6d03b4fb4bec1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/compat.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/har.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/har.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f842963948cd937e43d1637792a09fb2f7790a38 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/har.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/io.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/io.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..861ae14aaba4bbafaf4683aeee1495cbd5e4d73d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/io.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/tnetstring.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/tnetstring.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac85d224ba8afb7c5a141d7671b2971e8ecefda7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/io/__pycache__/tnetstring.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/compat.py b/python/user_packages/Python313/site-packages/mitmproxy/io/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..37d2ae6852f74db5e1b09506f142a3378fabc56f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/io/compat.py @@ -0,0 +1,528 @@ +""" +This module handles the import of mitmproxy flows generated by old versions. + +The flow file version is decoupled from the mitmproxy release cycle (since +v3.0.0dev) and versioning. Every change or migration gets a new flow file +version number, this prevents issues with developer builds and snapshots. +""" + +import copy +import uuid +from typing import Any + +from mitmproxy import version +from mitmproxy.utils import strutils + + +def convert_011_012(data): + data[b"version"] = (0, 12) + return data + + +def convert_012_013(data): + data[b"version"] = (0, 13) + return data + + +def convert_013_014(data): + data[b"request"][b"first_line_format"] = data[b"request"].pop(b"form_in") + data[b"request"][b"http_version"] = ( + b"HTTP/" + + ".".join(str(x) for x in data[b"request"].pop(b"httpversion")).encode() + ) + data[b"response"][b"http_version"] = ( + b"HTTP/" + + ".".join(str(x) for x in data[b"response"].pop(b"httpversion")).encode() + ) + data[b"response"][b"status_code"] = data[b"response"].pop(b"code") + data[b"response"][b"body"] = data[b"response"].pop(b"content") + data[b"server_conn"].pop(b"state") + data[b"server_conn"][b"via"] = None + data[b"version"] = (0, 14) + return data + + +def convert_014_015(data): + data[b"version"] = (0, 15) + return data + + +def convert_015_016(data): + for m in (b"request", b"response"): + if b"body" in data[m]: + data[m][b"content"] = data[m].pop(b"body") + if b"msg" in data[b"response"]: + data[b"response"][b"reason"] = data[b"response"].pop(b"msg") + data[b"request"].pop(b"form_out", None) + data[b"version"] = (0, 16) + return data + + +def convert_016_017(data): + data[b"server_conn"][b"peer_address"] = None + data[b"version"] = (0, 17) + return data + + +def convert_017_018(data): + # convert_unicode needs to be called for every dual release and the first py3-only release + data = convert_unicode(data) + + data["server_conn"]["ip_address"] = data["server_conn"].pop("peer_address", None) + data["marked"] = False + data["version"] = (0, 18) + return data + + +def convert_018_019(data): + # convert_unicode needs to be called for every dual release and the first py3-only release + data = convert_unicode(data) + + data["request"].pop("stickyauth", None) + data["request"].pop("stickycookie", None) + data["client_conn"]["sni"] = None + data["client_conn"]["alpn_proto_negotiated"] = None + data["client_conn"]["cipher_name"] = None + data["client_conn"]["tls_version"] = None + data["server_conn"]["alpn_proto_negotiated"] = None + if data["server_conn"]["via"]: + data["server_conn"]["via"]["alpn_proto_negotiated"] = None + data["mode"] = "regular" + data["metadata"] = dict() + data["version"] = (0, 19) + return data + + +def convert_019_100(data): + # convert_unicode needs to be called for every dual release and the first py3-only release + data = convert_unicode(data) + + data["version"] = (1, 0, 0) + return data + + +def convert_100_200(data): + data["version"] = (2, 0, 0) + data["client_conn"]["address"] = data["client_conn"]["address"]["address"] + data["server_conn"]["address"] = data["server_conn"]["address"]["address"] + data["server_conn"]["source_address"] = data["server_conn"]["source_address"][ + "address" + ] + if data["server_conn"]["ip_address"]: + data["server_conn"]["ip_address"] = data["server_conn"]["ip_address"]["address"] + + if data["server_conn"]["via"]: + data["server_conn"]["via"]["address"] = data["server_conn"]["via"]["address"][ + "address" + ] + data["server_conn"]["via"]["source_address"] = data["server_conn"]["via"][ + "source_address" + ]["address"] + if data["server_conn"]["via"]["ip_address"]: + data["server_conn"]["via"]["ip_address"] = data["server_conn"]["via"][ + "ip_address" + ]["address"] + + return data + + +def convert_200_300(data): + data["version"] = (3, 0, 0) + data["client_conn"]["mitmcert"] = None + data["server_conn"]["tls_version"] = None + if data["server_conn"]["via"]: + data["server_conn"]["via"]["tls_version"] = None + return data + + +def convert_300_4(data): + data["version"] = 4 + # This is an empty migration to transition to the new versioning scheme. + return data + + +client_connections: dict[tuple[str, ...], str] = {} +server_connections: dict[tuple[str, ...], str] = {} + + +def convert_4_5(data): + data["version"] = 5 + client_conn_key = ( + data["client_conn"]["timestamp_start"], + *data["client_conn"]["address"], + ) + server_conn_key = ( + data["server_conn"]["timestamp_start"], + *data["server_conn"]["source_address"], + ) + data["client_conn"]["id"] = client_connections.setdefault( + client_conn_key, str(uuid.uuid4()) + ) + data["server_conn"]["id"] = server_connections.setdefault( + server_conn_key, str(uuid.uuid4()) + ) + + if data["server_conn"]["via"]: + server_conn_key = ( + data["server_conn"]["via"]["timestamp_start"], + *data["server_conn"]["via"]["source_address"], + ) + data["server_conn"]["via"]["id"] = server_connections.setdefault( + server_conn_key, str(uuid.uuid4()) + ) + + return data + + +def convert_5_6(data): + data["version"] = 6 + data["client_conn"]["tls_established"] = data["client_conn"].pop("ssl_established") + data["client_conn"]["timestamp_tls_setup"] = data["client_conn"].pop( + "timestamp_ssl_setup" + ) + data["server_conn"]["tls_established"] = data["server_conn"].pop("ssl_established") + data["server_conn"]["timestamp_tls_setup"] = data["server_conn"].pop( + "timestamp_ssl_setup" + ) + if data["server_conn"]["via"]: + data["server_conn"]["via"]["tls_established"] = data["server_conn"]["via"].pop( + "ssl_established" + ) + data["server_conn"]["via"]["timestamp_tls_setup"] = data["server_conn"][ + "via" + ].pop("timestamp_ssl_setup") + return data + + +def convert_6_7(data): + data["version"] = 7 + data["client_conn"]["tls_extensions"] = None + return data + + +def convert_7_8(data): + data["version"] = 8 + if "request" in data and data["request"] is not None: + data["request"]["trailers"] = None + if "response" in data and data["response"] is not None: + data["response"]["trailers"] = None + return data + + +def convert_8_9(data): + data["version"] = 9 + is_request_replay = False + if "request" in data: + data["request"].pop("first_line_format") + data["request"]["authority"] = b"" + is_request_replay = data["request"].pop("is_replay", False) + is_response_replay = False + if "response" in data and data["response"] is not None: + is_response_replay = data["response"].pop("is_replay", False) + if is_request_replay: # pragma: no cover + data["is_replay"] = "request" + elif is_response_replay: # pragma: no cover + data["is_replay"] = "response" + else: + data["is_replay"] = None + return data + + +def convert_9_10(data): + data["version"] = 10 + + def conv_conn(conn): + conn["state"] = 0 + conn["error"] = None + conn["tls"] = conn["tls_established"] + alpn = conn["alpn_proto_negotiated"] + conn["alpn_offers"] = [alpn] if alpn else None + cipher = conn["cipher_name"] + conn["cipher_list"] = [cipher] if cipher else None + + def conv_cconn(conn): + conn["sockname"] = ("", 0) + cc = conn.pop("clientcert", None) + conn["certificate_list"] = [cc] if cc else [] + conv_conn(conn) + + def conv_sconn(conn): + crt = conn.pop("cert", None) + conn["certificate_list"] = [crt] if crt else [] + conn["cipher_name"] = None + conn["via2"] = None + conv_conn(conn) + + conv_cconn(data["client_conn"]) + conv_sconn(data["server_conn"]) + if data["server_conn"]["via"]: + conv_sconn(data["server_conn"]["via"]) + + return data + + +def convert_10_11(data): + data["version"] = 11 + + def conv_conn(conn): + conn["sni"] = strutils.always_str(conn["sni"], "ascii", "backslashreplace") + conn["alpn"] = conn.pop("alpn_proto_negotiated") + conn["alpn_offers"] = conn["alpn_offers"] or [] + conn["cipher_list"] = conn["cipher_list"] or [] + + conv_conn(data["client_conn"]) + conv_conn(data["server_conn"]) + if data["server_conn"]["via"]: + conv_conn(data["server_conn"]["via"]) + + return data + + +_websocket_handshakes = {} + + +def convert_11_12(data): + data["version"] = 12 + + if "websocket" in data["metadata"]: + _websocket_handshakes[data["id"]] = copy.deepcopy(data) + + if "websocket_handshake" in data["metadata"]: + ws_flow = data + try: + data = _websocket_handshakes.pop(data["metadata"]["websocket_handshake"]) + except KeyError: + # The handshake flow is missing, which should never really happen. We make up a dummy. + data = { + "client_conn": data["client_conn"], + "error": data["error"], + "id": data["id"], + "intercepted": data["intercepted"], + "is_replay": data["is_replay"], + "marked": data["marked"], + "metadata": {}, + "mode": "transparent", + "request": { + "authority": b"", + "content": None, + "headers": [], + "host": b"unknown", + "http_version": b"HTTP/1.1", + "method": b"GET", + "path": b"/", + "port": 80, + "scheme": b"http", + "timestamp_end": 0, + "timestamp_start": 0, + "trailers": None, + }, + "response": None, + "server_conn": data["server_conn"], + "type": "http", + "version": 12, + } + data["metadata"]["duplicated"] = ( + "This WebSocket flow has been migrated from an old file format version " + "and may appear duplicated." + ) + data["websocket"] = { + "messages": ws_flow["messages"], + "closed_by_client": ws_flow["close_sender"] == "client", + "close_code": ws_flow["close_code"], + "close_reason": ws_flow["close_reason"], + "timestamp_end": data.get("server_conn", {}).get("timestamp_end", None), + } + + else: + data["websocket"] = None + + return data + + +def convert_12_13(data): + data["version"] = 13 + if data["marked"]: + data["marked"] = ":default:" + else: + data["marked"] = "" + return data + + +def convert_13_14(data): + data["version"] = 14 + data["comment"] = "" + # bugfix for https://github.com/mitmproxy/mitmproxy/issues/4576 + if data.get("response", None) and data["response"]["timestamp_start"] is None: + data["response"]["timestamp_start"] = data["request"]["timestamp_end"] + data["response"]["timestamp_end"] = data["request"]["timestamp_end"] + 1 + return data + + +def convert_14_15(data): + data["version"] = 15 + if data.get("websocket", None): + # Add "injected" attribute. + data["websocket"]["messages"] = [ + msg + [False] for msg in data["websocket"]["messages"] + ] + return data + + +def convert_15_16(data): + data["version"] = 16 + data["timestamp_created"] = data.get("request", data["client_conn"])[ + "timestamp_start" + ] + return data + + +def convert_16_17(data): + data["version"] = 17 + data.pop("mode", None) + return data + + +def convert_17_18(data): + data["version"] = 18 + data["client_conn"]["proxy_mode"] = "regular" + return data + + +def convert_18_19(data): + data["version"] = 19 + data["client_conn"]["peername"] = data["client_conn"].pop("address", None) + if data["client_conn"].get("timestamp_start") is None: + data["client_conn"]["timestamp_start"] = 0.0 + data["client_conn"].pop("tls_extensions") + + data["server_conn"]["peername"] = data["server_conn"].pop("ip_address", None) + data["server_conn"]["sockname"] = data["server_conn"].pop("source_address", None) + data["server_conn"]["via"] = data["server_conn"].pop("via2", None) + + for conn in ["client_conn", "server_conn"]: + data[conn].pop("tls_established") + + data[conn]["cipher"] = data[conn].pop("cipher_name", None) + data[conn].setdefault("transport_protocol", "tcp") + + for name in ["peername", "sockname", "address"]: + if data[conn].get(name) and isinstance(data[conn][name][0], bytes): + data[conn][name][0] = data[conn][name][0].decode( + errors="backslashreplace" + ) + + if data["server_conn"]["sni"] is True: + data["server_conn"]["sni"] = data["server_conn"]["address"][0] + + return data + + +def convert_19_20(data): + data["version"] = 20 + data["client_conn"].pop("state", None) + data["server_conn"].pop("state", None) + return data + + +def convert_20_21(data): + data["version"] = 21 + if data["client_conn"]["tls_version"] == "QUIC": + data["client_conn"]["tls_version"] = "QUICv1" + if data["server_conn"]["tls_version"] == "QUIC": + data["server_conn"]["tls_version"] = "QUICv1" + return data + + +def _convert_dict_keys(o: Any) -> Any: + if isinstance(o, dict): + return {strutils.always_str(k): _convert_dict_keys(v) for k, v in o.items()} + else: + return o + + +def _convert_dict_vals(o: dict, values_to_convert: dict) -> dict: + for k, v in values_to_convert.items(): + if not o or k not in o: + continue # pragma: no cover + if v is True: + o[k] = strutils.always_str(o[k]) + else: + _convert_dict_vals(o[k], v) + return o + + +def convert_unicode(data: dict) -> dict: + """ + This method converts between Python 3 and Python 2 dumpfiles. + """ + data = _convert_dict_keys(data) + data = _convert_dict_vals( + data, + { + "type": True, + "id": True, + "request": {"first_line_format": True}, + "error": {"msg": True}, + }, + ) + return data + + +converters = { + (0, 11): convert_011_012, + (0, 12): convert_012_013, + (0, 13): convert_013_014, + (0, 14): convert_014_015, + (0, 15): convert_015_016, + (0, 16): convert_016_017, + (0, 17): convert_017_018, + (0, 18): convert_018_019, + (0, 19): convert_019_100, + (1, 0): convert_100_200, + (2, 0): convert_200_300, + (3, 0): convert_300_4, + 4: convert_4_5, + 5: convert_5_6, + 6: convert_6_7, + 7: convert_7_8, + 8: convert_8_9, + 9: convert_9_10, + 10: convert_10_11, + 11: convert_11_12, + 12: convert_12_13, + 13: convert_13_14, + 14: convert_14_15, + 15: convert_15_16, + 16: convert_16_17, + 17: convert_17_18, + 18: convert_18_19, + 19: convert_19_20, + 20: convert_20_21, +} + + +def migrate_flow(flow_data: dict[bytes | str, Any]) -> dict[bytes | str, Any]: + while True: + flow_version = flow_data.get(b"version", flow_data.get("version")) + + # Historically, we used the mitmproxy minor version tuple as the flow format version. + if not isinstance(flow_version, int): + flow_version = tuple(flow_version)[:2] # type: ignore + + if flow_version == version.FLOW_FORMAT_VERSION: + break + elif flow_version in converters: + flow_data = converters[flow_version](flow_data) + else: + should_upgrade = ( + isinstance(flow_version, int) + and flow_version > version.FLOW_FORMAT_VERSION + ) + raise ValueError( + "{} cannot read files with flow format version {}{}.".format( + version.MITMPROXY, + flow_version, + ", please update mitmproxy" if should_upgrade else "", + ) + ) + return flow_data diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/har.py b/python/user_packages/Python313/site-packages/mitmproxy/io/har.py new file mode 100644 index 0000000000000000000000000000000000000000..287aeb86bbe0744e3875e9af908db050db0f8d8f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/io/har.py @@ -0,0 +1,159 @@ +"""Reads HAR files into flow objects""" + +import base64 +import logging +import time +from datetime import datetime + +from mitmproxy import connection +from mitmproxy import exceptions +from mitmproxy import http +from mitmproxy.net.http.headers import infer_content_encoding + +logger = logging.getLogger(__name__) + + +def fix_headers( + request_headers: list[dict[str, str]] | list[tuple[str, str]], +) -> http.Headers: + """Converts provided headers into (b"header-name", b"header-value") tuples""" + flow_headers: list[tuple[bytes, bytes]] = [] + for header in request_headers: + # Applications that use the {"name":item,"value":item} notation are Brave,Chrome,Edge,Firefox,Charles,Fiddler,Insomnia,Safari + if isinstance(header, dict): + key = header["name"] + value = header["value"] + + # Application that uses the [name, value] notation is Slack + + else: + try: + key = header[0] + value = header[1] + except IndexError as e: + raise exceptions.OptionsError(str(e)) from e + flow_headers.append((key.encode(), value.encode())) + + return http.Headers(flow_headers) + + +def request_to_flow(request_json: dict) -> http.HTTPFlow: + """ + Creates a HTTPFlow object from a given entry in HAR file + """ + + timestamp_start = datetime.fromisoformat( + request_json["startedDateTime"].replace("Z", "+00:00") + ).timestamp() + timestamp_end = timestamp_start + request_json["time"] / 1000.0 + request_method = request_json["request"]["method"] + request_url = request_json["request"]["url"] + server_address = request_json.get("serverIPAddress", None) + request_headers = fix_headers(request_json["request"]["headers"]) + + http_version_req = request_json["request"]["httpVersion"] + http_version_resp = request_json["response"]["httpVersion"] + + request_content = "" + # List contains all the representations of an http request across different HAR files + if request_url.startswith("http://"): + port = 80 + else: + port = 443 + + client_conn = connection.Client( + peername=("127.0.0.1", 0), + sockname=("127.0.0.1", 0), + # TODO Get time info from HAR File + timestamp_start=time.time(), + ) + + if server_address: + server_conn = connection.Server(address=(server_address, port)) + else: + server_conn = connection.Server(address=None) + + new_flow = http.HTTPFlow(client_conn, server_conn) + + if "postData" in request_json["request"]: + request_content = request_json["request"]["postData"]["text"] + + new_flow.request = http.Request.make( + request_method, request_url, request_content, request_headers + ) + + response_code = request_json["response"]["status"] + + # In Firefox HAR files images don't include response bodies + response_content = request_json["response"]["content"].get("text", "") + content_encoding = request_json["response"]["content"].get("encoding", None) + response_headers = fix_headers(request_json["response"]["headers"]) + + if content_encoding == "base64": + response_content = base64.b64decode(response_content) + elif isinstance(response_content, str): + # Convert text to bytes, as in `Response.set_text` + try: + response_content = http.encoding.encode( + response_content, + ( + content_encoding + or infer_content_encoding(response_headers.get("content-type", "")) + ), + ) + except ValueError: + # Fallback to UTF-8 + response_content = response_content.encode( + "utf-8", errors="surrogateescape" + ) + + # Then encode the content, as in `Response.set_content` + response_content = http.encoding.encode( + response_content, response_headers.get("content-encoding") or "identity" + ) + + new_flow.response = http.Response( + b"HTTP/1.1", + response_code, + http.status_codes.RESPONSES.get(response_code, "").encode(), + response_headers, + response_content, + None, + timestamp_start, + timestamp_end, + ) + + # Update timestamps + + new_flow.request.timestamp_start = timestamp_start + new_flow.request.timestamp_end = timestamp_end + + new_flow.client_conn.timestamp_start = timestamp_start + new_flow.client_conn.timestamp_end = timestamp_end + + # Update HTTP version + + match http_version_req: + case "http/2.0": + new_flow.request.http_version = "HTTP/2" + case "HTTP/2": + new_flow.request.http_version = "HTTP/2" + case "HTTP/3": + new_flow.request.http_version = "HTTP/3" + case _: + new_flow.request.http_version = "HTTP/1.1" + match http_version_resp: + case "http/2.0": + new_flow.response.http_version = "HTTP/2" + case "HTTP/2": + new_flow.response.http_version = "HTTP/2" + case "HTTP/3": + new_flow.response.http_version = "HTTP/3" + case _: + new_flow.response.http_version = "HTTP/1.1" + + # Remove compression because that may generate different sizes between versions + new_flow.request.decode() + new_flow.response.decode() + + return new_flow diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/io.py b/python/user_packages/Python313/site-packages/mitmproxy/io/io.py new file mode 100644 index 0000000000000000000000000000000000000000..af89577d9a9b15a81b7fa0657f1697f64a288ec8 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/io/io.py @@ -0,0 +1,114 @@ +import json +import os +from collections.abc import Iterable +from io import BufferedReader +from typing import Any +from typing import BinaryIO +from typing import cast +from typing import Union + +from mitmproxy import exceptions +from mitmproxy import flow +from mitmproxy import flowfilter +from mitmproxy.io import compat +from mitmproxy.io import tnetstring +from mitmproxy.io.har import request_to_flow + + +class FlowWriter: + def __init__(self, fo): + self.fo = fo + + def add(self, f: flow.Flow) -> None: + d = f.get_state() + tnetstring.dump(d, self.fo) + + +class FlowReader: + fo: BinaryIO + + def __init__(self, fo: BinaryIO): + self.fo = fo + + def peek(self, n: int) -> bytes: + try: + return cast(BufferedReader, self.fo).peek(n) + except AttributeError: + # https://github.com/python/cpython/issues/90533: io.BytesIO does not have peek() + pos = self.fo.tell() + ret = self.fo.read(n) + self.fo.seek(pos) + return ret + + def stream(self) -> Iterable[flow.Flow]: + """ + Yields Flow objects from the dump. + """ + + if self.peek(4).startswith( + b"\xef\xbb\xbf{" + ): # skip BOM, usually added by Fiddler + self.fo.read(3) + if self.peek(1).startswith(b"{"): + try: + har_file = json.loads(self.fo.read().decode("utf-8")) + + for request_json in har_file["log"]["entries"]: + yield request_to_flow(request_json) + + except Exception: + raise exceptions.FlowReadException( + "Unable to read HAR file. Please provide a valid HAR file" + ) + + else: + try: + while True: + # FIXME: This cast hides a lack of dynamic type checking + loaded = cast( + dict[Union[bytes, str], Any], + tnetstring.load(self.fo), + ) + try: + if not isinstance(loaded, dict): + raise ValueError(f"Invalid flow: {loaded=}") + yield flow.Flow.from_state(compat.migrate_flow(loaded)) + except ValueError as e: + raise exceptions.FlowReadException(e) from e + except (ValueError, TypeError, IndexError) as e: + if str(e) == "not a tnetstring: empty file": + return # Error is due to EOF + raise exceptions.FlowReadException("Invalid data format.") from e + + +class FilteredFlowWriter: + def __init__(self, fo: BinaryIO, flt: flowfilter.TFilter | None): + self.fo = fo + self.flt = flt + + def add(self, f: flow.Flow) -> None: + if self.flt and not flowfilter.match(self.flt, f): + return + d = f.get_state() + tnetstring.dump(d, self.fo) + self.fo.flush() + + +def read_flows_from_paths(paths) -> list[flow.Flow]: + """ + Given a list of filepaths, read all flows and return a list of them. + From a performance perspective, streaming would be advisable - + however, if there's an error with one of the files, we want it to be raised immediately. + + Raises: + FlowReadException, if any error occurs. + """ + try: + flows: list[flow.Flow] = [] + for path in paths: + path = os.path.expanduser(path) + with open(path, "rb") as f: + flows.extend(FlowReader(f).stream()) + except OSError as e: + raise exceptions.FlowReadException(e.strerror) + return flows diff --git a/python/user_packages/Python313/site-packages/mitmproxy/io/tnetstring.py b/python/user_packages/Python313/site-packages/mitmproxy/io/tnetstring.py new file mode 100644 index 0000000000000000000000000000000000000000..e5d62a47d9c582a2867cfedf7605cbb3518e117a --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/io/tnetstring.py @@ -0,0 +1,261 @@ +""" +tnetstring: data serialization using typed netstrings +====================================================== + +This is a custom Python 3 implementation of tnetstrings. +Compared to other implementations, the main difference +is that this implementation supports a custom unicode datatype. + +An ordinary tnetstring is a blob of data prefixed with its length and postfixed +with its type. Here are some examples: + + >>> tnetstring.dumps("hello world") + 11:hello world, + >>> tnetstring.dumps(12345) + 5:12345# + >>> tnetstring.dumps([12345, True, 0]) + 19:5:12345#4:true!1:0#] + +This module gives you the following functions: + + :dump: dump an object as a tnetstring to a file + :dumps: dump an object as a tnetstring to a string + :load: load a tnetstring-encoded object from a file + :loads: load a tnetstring-encoded object from a string + +Note that since parsing a tnetstring requires reading all the data into memory +at once, there's no efficiency gain from using the file-based versions of these +functions. They're only here so you can use load() to read precisely one +item from a file or socket without consuming any extra data. + +The tnetstrings specification explicitly states that strings are binary blobs +and forbids the use of unicode at the protocol level. +**This implementation decodes dictionary keys as surrogate-escaped ASCII**, +all other strings are returned as plain bytes. + +:Copyright: (c) 2012-2013 by Ryan Kelly . +:Copyright: (c) 2014 by Carlo Pires . +:Copyright: (c) 2016 by Maximilian Hils . + +:License: MIT +""" + +import collections +from typing import BinaryIO +from typing import Union + +TSerializable = Union[None, str, bool, int, float, bytes, list, tuple, dict] + + +def dumps(value: TSerializable) -> bytes: + """ + This function dumps a python object as a tnetstring. + """ + # This uses a deque to collect output fragments in reverse order, + # then joins them together at the end. It's measurably faster + # than creating all the intermediate strings. + q: collections.deque = collections.deque() + _rdumpq(q, 0, value) + return b"".join(q) + + +def dump(value: TSerializable, file_handle: BinaryIO) -> None: + """ + This function dumps a python object as a tnetstring and + writes it to the given file. + """ + file_handle.write(dumps(value)) + + +def _rdumpq(q: collections.deque, size: int, value: TSerializable) -> int: + """ + Dump value as a tnetstring, to a deque instance, last chunks first. + + This function generates the tnetstring representation of the given value, + pushing chunks of the output onto the given deque instance. It pushes + the last chunk first, then recursively generates more chunks. + + When passed in the current size of the string in the queue, it will return + the new size of the string in the queue. + + Operating last-chunk-first makes it easy to calculate the size written + for recursive structures without having to build their representation as + a string. This is measurably faster than generating the intermediate + strings, especially on deeply nested structures. + """ + write = q.appendleft + if value is None: + write(b"0:~") + return size + 3 + elif value is True: + write(b"4:true!") + return size + 7 + elif value is False: + write(b"5:false!") + return size + 8 + elif isinstance(value, int): + data = str(value).encode() + ldata = len(data) + span = str(ldata).encode() + write(b"%s:%s#" % (span, data)) + return size + 2 + len(span) + ldata + elif isinstance(value, float): + # Use repr() for float rather than str(). + # It round-trips more accurately. + # Probably unnecessary in later python versions that + # use David Gay's ftoa routines. + data = repr(value).encode() + ldata = len(data) + span = str(ldata).encode() + write(b"%s:%s^" % (span, data)) + return size + 2 + len(span) + ldata + elif isinstance(value, bytes): + data = value + ldata = len(data) + span = str(ldata).encode() + write(b",") + write(data) + write(b":") + write(span) + return size + 2 + len(span) + ldata + elif isinstance(value, str): + data = value.encode("utf8") + ldata = len(data) + span = str(ldata).encode() + write(b";") + write(data) + write(b":") + write(span) + return size + 2 + len(span) + ldata + elif isinstance(value, (list, tuple)): + write(b"]") + init_size = size = size + 1 + for item in reversed(value): + size = _rdumpq(q, size, item) + span = str(size - init_size).encode() + write(b":") + write(span) + return size + 1 + len(span) + elif isinstance(value, dict): + write(b"}") + init_size = size = size + 1 + for k, v in value.items(): + size = _rdumpq(q, size, v) + size = _rdumpq(q, size, k) + span = str(size - init_size).encode() + write(b":") + write(span) + return size + 1 + len(span) + else: + raise ValueError(f"unserializable object: {value} ({type(value)})") + + +def loads(string: bytes) -> TSerializable: + """ + This function parses a tnetstring into a python object. + """ + return pop(memoryview(string))[0] + + +def load(file_handle: BinaryIO) -> TSerializable: + """load(file) -> object + + This function reads a tnetstring from a file and parses it into a + python object. The file must support the read() method, and this + function promises not to read more data than necessary. + """ + # Read the length prefix one char at a time. + # Note that the netstring spec explicitly forbids padding zeros. + c = file_handle.read(1) + if c == b"": # we want to detect this special case. + raise ValueError("not a tnetstring: empty file") + data_length = b"" + while c.isdigit(): + data_length += c + if len(data_length) > 12: + raise ValueError("not a tnetstring: absurdly large length prefix") + c = file_handle.read(1) + if c != b":": + raise ValueError("not a tnetstring: missing or invalid length prefix") + + data = memoryview(file_handle.read(int(data_length))) + data_type = file_handle.read(1)[0] + + return parse(data_type, data) + + +def parse(data_type: int, data: memoryview) -> TSerializable: + if data_type == ord(b","): + return data.tobytes() + if data_type == ord(b";"): + return str(data, "utf8") + if data_type == ord(b"#"): + try: + return int(data) + except ValueError: + raise ValueError(f"not a tnetstring: invalid integer literal: {data!r}") + if data_type == ord(b"^"): + try: + return float(data) + except ValueError: + raise ValueError(f"not a tnetstring: invalid float literal: {data!r}") + if data_type == ord(b"!"): + if data == b"true": + return True + elif data == b"false": + return False + else: + raise ValueError(f"not a tnetstring: invalid boolean literal: {data!r}") + if data_type == ord(b"~"): + if data: + raise ValueError(f"not a tnetstring: invalid null literal: {data!r}") + return None + if data_type == ord(b"]"): + lst = [] + while data: + item, data = pop(data) + lst.append(item) # type: ignore + return lst + if data_type == ord(b"}"): + d = {} + while data: + key, data = pop(data) + val, data = pop(data) + d[key] = val # type: ignore + return d + raise ValueError(f"unknown type tag: {data_type}") + + +def split(data: memoryview, sep: bytes) -> tuple[int, memoryview]: + i = 0 + try: + ord_sep = ord(sep) + while data[i] != ord_sep: + i += 1 + # here i is the position of b":" in the memoryview + return int(data[:i]), data[i + 1 :] + except (IndexError, ValueError): + raise ValueError( + f"not a tnetstring: missing or invalid length prefix: {data.tobytes()!r}" + ) + + +def pop(data: memoryview) -> tuple[TSerializable, memoryview]: + """ + This function parses a tnetstring into a python object. + It returns a tuple giving the parsed object and a string + containing any unparsed data from the end of the string. + """ + # Parse out data length, type and remaining string. + length, data = split(data, b":") + try: + data, data_type, remain = data[:length], data[length], data[length + 1 :] + except IndexError: + # This fires if len(data) < dlen, meaning we don't need + # to further validate that data is the right length. + raise ValueError(f"not a tnetstring: invalid length prefix: {length}") + # Parse the data based on the type tag. + return parse(data_type, data), remain + + +__all__ = ["dump", "dumps", "load", "loads", "pop"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/net/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2eab68abe41f45b25c580c4995c193d5b2d85fdc Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/check.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/check.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..feede89595a7943520eb6cd15a05be3693db79f7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/check.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/encoding.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/encoding.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd7d4cc668edb330026128ef39a42a19b71aecf7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/encoding.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/free_port.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/free_port.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b121f85c4113b2191e8e377c4cc7e77c4fcc5221 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/free_port.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/local_ip.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/local_ip.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..789c559726ea121d43474babb2a55936f804ac8a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/local_ip.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/server_spec.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/server_spec.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b54ba0a82a1346124868de798a4a2f6715c1443f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/server_spec.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/tls.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/tls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..499891205035ff43f5d71926e103a9c5168eaac0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/__pycache__/tls.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/check.py b/python/user_packages/Python313/site-packages/mitmproxy/net/check.py new file mode 100644 index 0000000000000000000000000000000000000000..476170032ff48a173811489c4b38a27949766543 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/check.py @@ -0,0 +1,43 @@ +import ipaddress +import re +from typing import AnyStr + +# Allow underscore in host name +# Note: This could be a DNS label, a hostname, a FQDN, or an IP + +_label_valid = re.compile(rb"[A-Z\d\-_]{1,63}$", re.IGNORECASE) + + +def is_valid_host(host: AnyStr) -> bool: + """ + Checks if the passed bytes are a valid DNS hostname or an IPv4/IPv6 address. + """ + if isinstance(host, str): + try: + host_bytes = host.encode("idna") + except UnicodeError: + return False + else: + host_bytes = host + try: + host_bytes.decode("idna") + except ValueError: + return False + # RFC1035: 255 bytes or less. + if len(host_bytes) > 255: + return False + if host_bytes and host_bytes.endswith(b"."): + host_bytes = host_bytes[:-1] + # DNS hostname + if all(_label_valid.match(x) for x in host_bytes.split(b".")): + return True + # IPv4/IPv6 address + try: + ipaddress.ip_address(host_bytes.decode("idna")) + return True + except ValueError: + return False + + +def is_valid_port(port: int) -> bool: + return 0 <= port <= 65535 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e218743b5016ed2bdf1a9708fc2ed626924313b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/classes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/classes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42fcb763082ee6676a12fc9a49104a2e7829b8cc Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/classes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/domain_names.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/domain_names.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89b3d287dd8f096da43503d085ef1a2fae61c57f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/domain_names.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/https_records.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/https_records.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e434a73c2efa9df223fb4d2fb566a291cfb09e10 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/https_records.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/op_codes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/op_codes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7eb2696824865889c7a91c4bde8b496610ece8b8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/op_codes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/response_codes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/response_codes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b45a01155d71e86f8c09bdd8bf09394cee97626b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/response_codes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/types.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/types.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a5b8a6f72649696e242687217b8709859cce6ce Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/__pycache__/types.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/classes.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/classes.py new file mode 100644 index 0000000000000000000000000000000000000000..1f2258c91b9dc5185b6612ed06a997ca5e41345b --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/classes.py @@ -0,0 +1,19 @@ +IN = 1 +CH = 3 +HS = 4 +NONE = 254 +ANY = 255 + +_STRINGS = {IN: "IN", CH: "CH", HS: "HS", NONE: "NONE", ANY: "ANY"} +_INTS = {v: k for k, v in _STRINGS.items()} + + +def to_str(class_: int) -> str: + return _STRINGS.get(class_, f"CLASS({class_})") + + +def from_str(class_: str) -> int: + try: + return _INTS[class_] + except KeyError: + return int(class_.removeprefix("CLASS(").removesuffix(")")) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/domain_names.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/domain_names.py new file mode 100644 index 0000000000000000000000000000000000000000..520fb65e15b5b6f1055f4f61baed03e5af3a1d25 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/domain_names.py @@ -0,0 +1,169 @@ +import struct +from typing import Optional + +from . import types + +_LABEL_SIZE = struct.Struct("!B") +_POINTER_OFFSET = struct.Struct("!H") +_POINTER_INDICATOR = 0b11000000 + + +Cache = dict[int, Optional[tuple[str, int]]] + + +def cache() -> Cache: + return dict() + + +def _unpack_label_into(labels: list[str], buffer: bytes, offset: int) -> int: + (size,) = _LABEL_SIZE.unpack_from(buffer, offset) + if size >= 64: + raise struct.error(f"unpack encountered a label of length {size}") + elif size == 0: + return _LABEL_SIZE.size + else: + offset += _LABEL_SIZE.size + end_label = offset + size + if len(buffer) < end_label: + raise struct.error(f"unpack requires a label buffer of {size} bytes") + try: + labels.append(buffer[offset:end_label].decode("idna")) + except UnicodeDecodeError: + raise struct.error( + f"unpack encountered an illegal characters at offset {offset}" + ) + return _LABEL_SIZE.size + size + + +def unpack_from_with_compression( + buffer: bytes, offset: int, cache: Cache +) -> tuple[str, int]: + if offset in cache: + result = cache[offset] + if result is None: + raise struct.error(f"unpack encountered domain name loop") + else: + cache[offset] = None # this will indicate that the offset is being unpacked + start_offset = offset + labels = [] + while True: + (size,) = _LABEL_SIZE.unpack_from(buffer, offset) + if size & _POINTER_INDICATOR == _POINTER_INDICATOR: + (pointer,) = _POINTER_OFFSET.unpack_from(buffer, offset) + offset += _POINTER_OFFSET.size + label, _ = unpack_from_with_compression( + buffer, pointer & ~(_POINTER_INDICATOR << 8), cache + ) + labels.append(label) + break + else: + offset += _unpack_label_into(labels, buffer, offset) + if size == 0: + break + result = ".".join(labels), (offset - start_offset) + cache[start_offset] = result + return result + + +def unpack_from(buffer: bytes, offset: int) -> tuple[str, int]: + """Converts RDATA into a domain name without pointer compression from a given offset and also returns the binary size.""" + labels: list[str] = [] + while True: + (size,) = _LABEL_SIZE.unpack_from(buffer, offset) + if size & _POINTER_INDICATOR == _POINTER_INDICATOR: + raise struct.error( + f"unpack encountered a pointer which is not supported in RDATA" + ) + else: + offset += _unpack_label_into(labels, buffer, offset) + if size == 0: + break + return ".".join(labels), offset + + +def unpack(buffer: bytes) -> str: + """Converts RDATA into a domain name without pointer compression.""" + name, length = unpack_from(buffer, 0) + if length != len(buffer): + raise struct.error(f"unpack requires a buffer of {length} bytes") + return name + + +def pack(name: str) -> bytes: + """Converts a domain name into RDATA without pointer compression.""" + buffer = bytearray() + if len(name) > 0: + for part in name.split("."): + label = part.encode("idna") + size = len(label) + if size == 0: + raise ValueError(f"domain name '{name}' contains empty labels") + if size >= 64: # pragma: no cover + # encoding with 'idna' will already have raised an exception earlier + raise ValueError( + f"encoded label '{part}' of domain name '{name}' is too long ({size} bytes)" + ) + buffer.extend(_LABEL_SIZE.pack(size)) + buffer.extend(label) + buffer.extend(_LABEL_SIZE.pack(0)) + return bytes(buffer) + + +def record_data_can_have_compression(record_type: int) -> bool: + if record_type in ( + types.CNAME, + types.HINFO, + types.MB, + types.MD, + types.MF, + types.MG, + types.MINFO, + types.MR, + types.MX, + types.NS, + types.PTR, + types.SOA, + types.TXT, + types.RP, + types.AFSDB, + types.RT, + types.SIG, + types.PX, + types.NXT, + types.NAPTR, + types.SRV, + ): + return True + return False + + +def decompress_from_record_data( + buffer: bytes, offset: int, end_data: int, cached_names: Cache +) -> bytes: + # we decompress compression pointers in RDATA by iterating through each byte and checking + # if it has a leading 0b11, if so we try to decompress it and update it in the data variable. + data = bytearray(buffer[offset:end_data]) + data_offset = 0 + decompress_size = 0 + while data_offset < end_data - offset: + if buffer[offset + data_offset] & _POINTER_INDICATOR == _POINTER_INDICATOR: + try: + ( + rr_name, + rr_name_len, + ) = unpack_from_with_compression( + buffer, offset + data_offset, cached_names + ) + data[ + data_offset + decompress_size : data_offset + + decompress_size + + rr_name_len + ] = pack(rr_name) + decompress_size += len(rr_name) + data_offset += rr_name_len + continue + except struct.error: + # the byte isn't actually a domain name compression pointer but some other data type + pass + data_offset += 1 + return bytes(data) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/https_records.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/https_records.py new file mode 100644 index 0000000000000000000000000000000000000000..acf0bad32472b0e29d5d7e342c707b341e7b2652 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/https_records.py @@ -0,0 +1,134 @@ +import enum +import struct +from dataclasses import dataclass +from typing import Self + +from ...utils import strutils +from . import domain_names + +""" +HTTPS records are formatted as follows (as per RFC9460): +- a 2-octet field for SvcPriority as an integer in network byte order. +- the uncompressed, fully qualified TargetName, represented as a sequence of length-prefixed labels per Section 3.1 of [RFC1035]. +- the SvcParams, consuming the remainder of the record (so smaller than 65535 octets and constrained by the RDATA and DNS message sizes). + +When the list of SvcParams is non-empty, it contains a series of SvcParamKey=SvcParamValue pairs, represented as: +- a 2-octet field containing the SvcParamKey as an integer in network byte order. (See Section 14.3.2 for the defined values.) +- a 2-octet field containing the length of the SvcParamValue as an integer between 0 and 65535 in network byte order. +- an octet string of this length whose contents are the SvcParamValue in a format determined by the SvcParamKey. + + https://datatracker.ietf.org/doc/rfc9460/ + https://datatracker.ietf.org/doc/rfc1035/ +""" + + +class SVCParamKeys(enum.Enum): + MANDATORY = 0 + ALPN = 1 + NO_DEFAULT_ALPN = 2 + PORT = 3 + IPV4HINT = 4 + ECH = 5 + IPV6HINT = 6 + + +type HTTPSRecordJSON = dict[str | int, str | int] + + +@dataclass +class HTTPSRecord: + priority: int + target_name: str + params: dict[int, bytes] + + def __repr__(self): + return str(self.to_json()) + + def to_json(self) -> HTTPSRecordJSON: + ret: HTTPSRecordJSON = { + "target_name": self.target_name, + "priority": self.priority, + } + typ: str | int + for typ, val in self.params.items(): + try: + typ = SVCParamKeys(typ).name.lower() + except ValueError: + pass + ret[typ] = strutils.bytes_to_escaped_str(val) + return ret + + @classmethod + def from_json(cls, data: HTTPSRecordJSON) -> Self: + target_name = data.pop("target_name") + assert isinstance(target_name, str) + priority = data.pop("priority") + assert isinstance(priority, int) + params: dict[int, bytes] = {} + for k, v in data.items(): + if isinstance(k, str): + k = SVCParamKeys[k.upper()].value + assert isinstance(v, str) + params[k] = strutils.escaped_str_to_bytes(v) + return cls(target_name=target_name, priority=priority, params=params) + + +def _unpack_params(data: bytes, offset: int) -> dict[int, bytes]: + """Unpacks the service parameters from the given offset.""" + params = {} + while offset < len(data): + param_type = struct.unpack("!H", data[offset : offset + 2])[0] + offset += 2 + param_length = struct.unpack("!H", data[offset : offset + 2])[0] + offset += 2 + if offset + param_length > len(data): + raise struct.error( + "unpack requires a buffer of %i bytes" % (offset + param_length) + ) + param_value = data[offset : offset + param_length] + offset += param_length + params[param_type] = param_value + return params + + +def unpack(data: bytes) -> HTTPSRecord: + """ + Unpacks HTTPS RDATA from byte data. + + Raises: + struct.error if the record is malformed. + """ + offset = 0 + + # Priority (2 bytes) + priority = struct.unpack("!h", data[offset : offset + 2])[0] + offset += 2 + + # TargetName (variable length) + target_name, offset = domain_names.unpack_from(data, offset) + + # Service Parameters (remaining bytes) + params = _unpack_params(data, offset) + + return HTTPSRecord(priority=priority, target_name=target_name, params=params) + + +def _pack_params(params: dict[int, bytes]) -> bytes: + """Converts the service parameters into the raw byte format""" + buffer = bytearray() + + for k, v in params.items(): + buffer.extend(struct.pack("!H", k)) + buffer.extend(struct.pack("!H", len(v))) + buffer.extend(v) + + return bytes(buffer) + + +def pack(record: HTTPSRecord) -> bytes: + """Packs the HTTPS record into its bytes form.""" + buffer = bytearray() + buffer.extend(struct.pack("!h", record.priority)) + buffer.extend(domain_names.pack(record.target_name)) + buffer.extend(_pack_params(record.params)) + return bytes(buffer) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/op_codes.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/op_codes.py new file mode 100644 index 0000000000000000000000000000000000000000..ed2a6b757a6648f4d61eb3ef49aac486dcd4c010 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/op_codes.py @@ -0,0 +1,27 @@ +QUERY = 0 +IQUERY = 1 +STATUS = 2 +NOTIFY = 4 +UPDATE = 5 +DSO = 6 + +_STRINGS = { + QUERY: "QUERY", + IQUERY: "IQUERY", + STATUS: "STATUS", + NOTIFY: "NOTIFY", + UPDATE: "UPDATE", + DSO: "DSO", +} +_INTS = {v: k for k, v in _STRINGS.items()} + + +def to_str(op_code: int) -> str: + return _STRINGS.get(op_code, f"OPCODE({op_code})") + + +def from_str(op_code: str) -> int: + try: + return _INTS[op_code] + except KeyError: + return int(op_code.removeprefix("OPCODE(").removesuffix(")")) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/response_codes.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/response_codes.py new file mode 100644 index 0000000000000000000000000000000000000000..d41b84de76895187da8f7f03d6b68a40f26df487 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/response_codes.py @@ -0,0 +1,58 @@ +NOERROR = 0 +FORMERR = 1 +SERVFAIL = 2 +NXDOMAIN = 3 +NOTIMP = 4 +REFUSED = 5 +YXDOMAIN = 6 +YXRRSET = 7 +NXRRSET = 8 +NOTAUTH = 9 +NOTZONE = 10 +DSOTYPENI = 11 + +_CODES = { + NOERROR: 200, + FORMERR: 400, + SERVFAIL: 500, + NXDOMAIN: 404, + NOTIMP: 501, + REFUSED: 403, + YXDOMAIN: 409, + YXRRSET: 409, + NXRRSET: 410, + NOTAUTH: 401, + NOTZONE: 404, + DSOTYPENI: 501, +} + +_STRINGS = { + NOERROR: "NOERROR", + FORMERR: "FORMERR", + SERVFAIL: "SERVFAIL", + NXDOMAIN: "NXDOMAIN", + NOTIMP: "NOTIMP", + REFUSED: "REFUSED", + YXDOMAIN: "YXDOMAIN", + YXRRSET: "YXRRSET", + NXRRSET: "NXRRSET", + NOTAUTH: "NOTAUTH", + NOTZONE: "NOTZONE", + DSOTYPENI: "DSOTYPENI", +} +_INTS = {v: k for k, v in _STRINGS.items()} + + +def http_equiv_status_code(response_code: int) -> int: + return _CODES.get(response_code, 500) + + +def to_str(response_code: int) -> str: + return _STRINGS.get(response_code, f"RCODE({response_code})") + + +def from_str(response_code: str) -> int: + try: + return _INTS[response_code] + except KeyError: + return int(response_code.removeprefix("RCODE(").removesuffix(")")) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/dns/types.py b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/types.py new file mode 100644 index 0000000000000000000000000000000000000000..94294a016a176cd896273fd917b19ea3bcf7902e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/dns/types.py @@ -0,0 +1,193 @@ +A = 1 +NS = 2 +MD = 3 +MF = 4 +CNAME = 5 +SOA = 6 +MB = 7 +MG = 8 +MR = 9 +NULL = 10 +WKS = 11 +PTR = 12 +HINFO = 13 +MINFO = 14 +MX = 15 +TXT = 16 +RP = 17 +AFSDB = 18 +X25 = 19 +ISDN = 20 +RT = 21 +NSAP = 22 +NSAP_PTR = 23 +SIG = 24 +KEY = 25 +PX = 26 +GPOS = 27 +AAAA = 28 +LOC = 29 +NXT = 30 +EID = 31 +NIMLOC = 32 +SRV = 33 +ATMA = 34 +NAPTR = 35 +KX = 36 +CERT = 37 +A6 = 38 +DNAME = 39 +SINK = 40 +OPT = 41 +APL = 42 +DS = 43 +SSHFP = 44 +IPSECKEY = 45 +RRSIG = 46 +NSEC = 47 +DNSKEY = 48 +DHCID = 49 +NSEC3 = 50 +NSEC3PARAM = 51 +TLSA = 52 +SMIMEA = 53 +HIP = 55 +NINFO = 56 +RKEY = 57 +TALINK = 58 +CDS = 59 +CDNSKEY = 60 +OPENPGPKEY = 61 +CSYNC = 62 +ZONEMD = 63 +SVCB = 64 +HTTPS = 65 +SPF = 99 +UINFO = 100 +UID = 101 +GID = 102 +UNSPEC = 103 +NID = 104 +L32 = 105 +L64 = 106 +LP = 107 +EUI48 = 108 +EUI64 = 109 +TKEY = 249 +TSIG = 250 +IXFR = 251 +AXFR = 252 +MAILB = 253 +MAILA = 254 +ANY = 255 +URI = 256 +CAA = 257 +AVC = 258 +DOA = 259 +AMTRELAY = 260 +TA = 32768 +DLV = 32769 + +_STRINGS = { + A: "A", + NS: "NS", + MD: "MD", + MF: "MF", + CNAME: "CNAME", + SOA: "SOA", + MB: "MB", + MG: "MG", + MR: "MR", + NULL: "NULL", + WKS: "WKS", + PTR: "PTR", + HINFO: "HINFO", + MINFO: "MINFO", + MX: "MX", + TXT: "TXT", + RP: "RP", + AFSDB: "AFSDB", + X25: "X25", + ISDN: "ISDN", + RT: "RT", + NSAP: "NSAP", + NSAP_PTR: "NSAP_PTR", + SIG: "SIG", + KEY: "KEY", + PX: "PX", + GPOS: "GPOS", + AAAA: "AAAA", + LOC: "LOC", + NXT: "NXT", + EID: "EID", + NIMLOC: "NIMLOC", + SRV: "SRV", + ATMA: "ATMA", + NAPTR: "NAPTR", + KX: "KX", + CERT: "CERT", + A6: "A6", + DNAME: "DNAME", + SINK: "SINK", + OPT: "OPT", + APL: "APL", + DS: "DS", + SSHFP: "SSHFP", + IPSECKEY: "IPSECKEY", + RRSIG: "RRSIG", + NSEC: "NSEC", + DNSKEY: "DNSKEY", + DHCID: "DHCID", + NSEC3: "NSEC3", + NSEC3PARAM: "NSEC3PARAM", + TLSA: "TLSA", + SMIMEA: "SMIMEA", + HIP: "HIP", + NINFO: "NINFO", + RKEY: "RKEY", + TALINK: "TALINK", + CDS: "CDS", + CDNSKEY: "CDNSKEY", + OPENPGPKEY: "OPENPGPKEY", + CSYNC: "CSYNC", + ZONEMD: "ZONEMD", + SVCB: "SVCB", + HTTPS: "HTTPS", + SPF: "SPF", + UINFO: "UINFO", + UID: "UID", + GID: "GID", + UNSPEC: "UNSPEC", + NID: "NID", + L32: "L32", + L64: "L64", + LP: "LP", + EUI48: "EUI48", + EUI64: "EUI64", + TKEY: "TKEY", + TSIG: "TSIG", + IXFR: "IXFR", + AXFR: "AXFR", + MAILB: "MAILB", + MAILA: "MAILA", + ANY: "ANY", + URI: "URI", + CAA: "CAA", + AVC: "AVC", + DOA: "DOA", + AMTRELAY: "AMTRELAY", + TA: "TA", + DLV: "DLV", +} +_INTS = {v: k for k, v in _STRINGS.items()} + + +def to_str(type_: int) -> str: + return _STRINGS.get(type_, f"TYPE({type_})") + + +def from_str(type_: str) -> int: + try: + return _INTS[type_] + except KeyError: + return int(type_.removeprefix("TYPE(").removesuffix(")")) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/encoding.py b/python/user_packages/Python313/site-packages/mitmproxy/net/encoding.py new file mode 100644 index 0000000000000000000000000000000000000000..7be30d3d508834f83e3e8c5753625974d18919ab --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/encoding.py @@ -0,0 +1,239 @@ +""" +Utility functions for decoding response bodies. +""" + +import codecs +import collections +import gzip +import zlib +from io import BytesIO +from typing import overload + +import brotli +import zstandard as zstd + +# We have a shared single-element cache for encoding and decoding. +# This is quite useful in practice, e.g. +# flow.request.content = flow.request.content.replace(b"foo", b"bar") +# does not require an .encode() call if content does not contain b"foo" +CachedDecode = collections.namedtuple("CachedDecode", "encoded encoding errors decoded") +_cache = CachedDecode(None, None, None, None) + + +@overload +def decode(encoded: None, encoding: str, errors: str = "strict") -> None: ... + + +@overload +def decode(encoded: str, encoding: str, errors: str = "strict") -> str: ... + + +@overload +def decode(encoded: bytes, encoding: str, errors: str = "strict") -> str | bytes: ... + + +def decode( + encoded: None | str | bytes, encoding: str, errors: str = "strict" +) -> None | str | bytes: + """ + Decode the given input object + + Returns: + The decoded value + + Raises: + ValueError, if decoding fails. + """ + if encoded is None: + return None + encoding = encoding.lower() + + global _cache + cached = ( + isinstance(encoded, bytes) + and _cache.encoded == encoded + and _cache.encoding == encoding + and _cache.errors == errors + ) + if cached: + return _cache.decoded + try: + try: + decoded = custom_decode[encoding](encoded) + except KeyError: + decoded = codecs.decode(encoded, encoding, errors) # type: ignore + if encoding in ("gzip", "deflate", "deflateraw", "br", "zstd"): + _cache = CachedDecode(encoded, encoding, errors, decoded) + return decoded + except TypeError: + raise + except Exception as e: + raise ValueError( + "{} when decoding {} with {}: {}".format( + type(e).__name__, + repr(encoded)[:10], + repr(encoding), + repr(e), + ) + ) + + +@overload +def encode(decoded: None, encoding: str, errors: str = "strict") -> None: ... + + +@overload +def encode(decoded: str, encoding: str, errors: str = "strict") -> str | bytes: ... + + +@overload +def encode(decoded: bytes, encoding: str, errors: str = "strict") -> bytes: ... + + +def encode( + decoded: None | str | bytes, encoding, errors="strict" +) -> None | str | bytes: + """ + Encode the given input object + + Returns: + The encoded value + + Raises: + ValueError, if encoding fails. + """ + if decoded is None: + return None + encoding = encoding.lower() + + global _cache + cached = ( + isinstance(decoded, bytes) + and _cache.decoded == decoded + and _cache.encoding == encoding + and _cache.errors == errors + ) + if cached: + return _cache.encoded + try: + try: + encoded = custom_encode[encoding](decoded) + except KeyError: + encoded = codecs.encode(decoded, encoding, errors) # type: ignore + if encoding in ("gzip", "deflate", "deflateraw", "br", "zstd"): + _cache = CachedDecode(encoded, encoding, errors, decoded) + return encoded + except TypeError: + raise + except Exception as e: + raise ValueError( + "{} when encoding {} with {}: {}".format( + type(e).__name__, + repr(decoded)[:10], + repr(encoding), + repr(e), + ) + ) + + +def identity(content): + """ + Returns content unchanged. Identity is the default value of + Accept-Encoding headers. + """ + return content + + +def decode_gzip(content: bytes) -> bytes: + """Decode gzip or zlib-compressed data using zlib's auto-detection.""" + if not content: + return b"" + + try: + # Using wbits=47 (32 + 15) tells zlib to automatically detect both gzip and zlib headers. + # This simplifies decoding and avoids the need for a separate gzip.GzipFile fallback. + # Reference: https://docs.python.org/3/library/zlib.html#zlib.decompress + decompressor = zlib.decompressobj(47) + return decompressor.decompress(content) + decompressor.flush() + except zlib.error as e: + raise ValueError(f"Decompression failed: {e}") + + +def encode_gzip(content: bytes) -> bytes: + s = BytesIO() + # set mtime to 0 so that gzip encoding is deterministic. + # Use compresslevel=1 for fastest compression speed. + with gzip.GzipFile(fileobj=s, mode="wb", mtime=0, compresslevel=1) as f: + f.write(content) + return s.getvalue() + + +def decode_brotli(content: bytes) -> bytes: + if not content: + return b"" + return brotli.decompress(content) + + +def encode_brotli(content: bytes) -> bytes: + # Use quality=0 for fastest compression speed. + return brotli.compress(content, quality=0) + + +def decode_zstd(content: bytes) -> bytes: + if not content: + return b"" + zstd_ctx = zstd.ZstdDecompressor() + return zstd_ctx.stream_reader(BytesIO(content), read_across_frames=True).read() + + +def encode_zstd(content: bytes) -> bytes: + # Use level=1 for fastest compression speed. + zstd_ctx = zstd.ZstdCompressor(level=1) + return zstd_ctx.compress(content) + + +def decode_deflate(content: bytes) -> bytes: + """ + Returns decompressed data for DEFLATE. Some servers may respond with + compressed data without a zlib header or checksum. An undocumented + feature of zlib permits the lenient decompression of data missing both + values. + + http://bugs.python.org/issue5784 + """ + if not content: + return b"" + try: + return zlib.decompress(content) + except zlib.error: + return zlib.decompress(content, -15) + + +def encode_deflate(content: bytes) -> bytes: + """ + Returns compressed content, always including zlib header and checksum. + """ + # Use level=1 for fastest compression speed. + return zlib.compress(content, level=1) + + +custom_decode = { + "none": identity, + "identity": identity, + "gzip": decode_gzip, + "deflate": decode_deflate, + "deflateraw": decode_deflate, + "br": decode_brotli, + "zstd": decode_zstd, +} +custom_encode = { + "none": identity, + "identity": identity, + "gzip": encode_gzip, + "deflate": encode_deflate, + "deflateraw": encode_deflate, + "br": encode_brotli, + "zstd": encode_zstd, +} + +__all__ = ["encode", "decode"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/free_port.py b/python/user_packages/Python313/site-packages/mitmproxy/net/free_port.py new file mode 100644 index 0000000000000000000000000000000000000000..16cfb1745ab657ec2c69832e3e8e695ba4ee9bfe --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/free_port.py @@ -0,0 +1,25 @@ +import socket + + +def get_free_port() -> int: + """ + Get a port that's free for both TCP and UDP. + + This method never raises. If no free port can be found, 0 is returned. + """ + for _ in range(10): + tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + + try: + tcp.bind(("", 0)) + port: int = tcp.getsockname()[1] + udp.bind(("", port)) + udp.close() + return port + except OSError: + pass + finally: + tcp.close() + + return 0 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b00dca382aad15512fc2c04f6de2f9144fe7cd6a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/cookies.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/cookies.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1f8cf9f6d6d0160cc179926831c7b3ebd714e00 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/cookies.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/headers.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/headers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91f9f9af6fca682bcce1a7fdd7217d0c54585748 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/headers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/multipart.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/multipart.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f864719f6a365de089ef9b51b7e48aeeed6a502 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/multipart.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/status_codes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/status_codes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54e2b1bccaf4f85c6c20c61934fe3fccc3d31526 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/status_codes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/url.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/url.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7b792682c1a2a55673e7e1d2db3029d3361984c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/url.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/user_agents.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/user_agents.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eef0dbd575621644d537d59fe6efa4625bba4d3a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/user_agents.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/validate.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/validate.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d4e35f19ae1bbec488817b2044aef43106b6302 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/__pycache__/validate.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/cookies.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/cookies.py new file mode 100644 index 0000000000000000000000000000000000000000..0c615febcb7fc1bd7dc326c657f8e4deeb11acd2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/cookies.py @@ -0,0 +1,387 @@ +import email.utils +import re +import time +from collections.abc import Iterable + +from mitmproxy.coretypes import multidict + +""" +A flexible module for cookie parsing and manipulation. + +This module differs from usual standards-compliant cookie modules in a number +of ways. We try to be as permissive as possible, and to retain even mal-formed +information. Duplicate cookies are preserved in parsing, and can be set in +formatting. We do attempt to escape and quote values where needed, but will not +reject data that violate the specs. + +Parsing accepts the formats in RFC6265 and partially RFC2109 and RFC2965. We +also parse the comma-separated variant of Set-Cookie that allows multiple +cookies to be set in a single header. Serialization follows RFC6265. + + http://tools.ietf.org/html/rfc6265 + http://tools.ietf.org/html/rfc2109 + http://tools.ietf.org/html/rfc2965 +""" + +_cookie_params = { + "expires", + "path", + "comment", + "max-age", + "secure", + "httponly", + "version", +} + +ESCAPE = re.compile(r"([\"\\])") + + +class CookieAttrs(multidict.MultiDict): + @staticmethod + def _kconv(key): + return key.lower() + + @staticmethod + def _reduce_values(values): + # See the StickyCookieTest for a weird cookie that only makes sense + # if we take the last part. + return values[-1] + + +TSetCookie = tuple[str, str | None, CookieAttrs] +TPairs = list[tuple[str, str | None]] + + +def _read_until(s, start, term): + """ + Read until one of the characters in term is reached. + """ + if start == len(s): + return "", start + 1 + for i in range(start, len(s)): + if s[i] in term: + return s[start:i], i + return s[start : i + 1], i + 1 + + +def _read_quoted_string(s, start): + """ + start: offset to the first quote of the string to be read + + A sort of loose super-set of the various quoted string specifications. + + RFC6265 disallows backslashes or double quotes within quoted strings. + Prior RFCs use backslashes to escape. This leaves us free to apply + backslash escaping by default and be compatible with everything. + """ + escaping = False + ret = [] + # Skip the first quote + i = start # initialize in case the loop doesn't run. + for i in range(start + 1, len(s)): + if escaping: + ret.append(s[i]) + escaping = False + elif s[i] == '"': + break + elif s[i] == "\\": + escaping = True + else: + ret.append(s[i]) + return "".join(ret), i + 1 + + +def _read_key(s, start, delims=";="): + """ + Read a key - the LHS of a token/value pair in a cookie. + """ + return _read_until(s, start, delims) + + +def _read_value(s, start, delims): + """ + Reads a value - the RHS of a token/value pair in a cookie. + """ + if start >= len(s): + return "", start + elif s[start] == '"': + return _read_quoted_string(s, start) + else: + return _read_until(s, start, delims) + + +def _read_cookie_pairs(s, off=0): + """ + Read pairs of lhs=rhs values from Cookie headers. + + off: start offset + """ + pairs = [] + + while True: + lhs, off = _read_key(s, off) + lhs = lhs.lstrip() + + rhs = "" + if off < len(s) and s[off] == "=": + rhs, off = _read_value(s, off + 1, ";") + if rhs or lhs: + pairs.append([lhs, rhs]) + + off += 1 + + if not off < len(s): + break + + return pairs, off + + +def _read_set_cookie_pairs(s: str, off=0) -> tuple[list[TPairs], int]: + """ + Read pairs of lhs=rhs values from SetCookie headers while handling multiple cookies. + + off: start offset + specials: attributes that are treated specially + """ + cookies: list[TPairs] = [] + pairs: TPairs = [] + + while True: + lhs, off = _read_key(s, off, ";=,") + lhs = lhs.lstrip() + + rhs = "" + if off < len(s) and s[off] == "=": + rhs, off = _read_value(s, off + 1, ";,") + + # Special handling of attributes + if lhs.lower() == "expires": + # 'expires' values can contain commas in them so they need to + # be handled separately. + + # We actually bank on the fact that the expires value WILL + # contain a comma. Things will fail, if they don't. + + # '3' is just a heuristic we use to determine whether we've + # only read a part of the expires value and we should read more. + if len(rhs) <= 3: + trail, off = _read_value(s, off + 1, ";,") + rhs = rhs + "," + trail + + # as long as there's a "=", we consider it a pair + pairs.append((lhs, rhs)) + + elif lhs: + pairs.append((lhs, None)) + + # comma marks the beginning of a new cookie + if off < len(s) and s[off] == ",": + cookies.append(pairs) + pairs = [] + + off += 1 + + if not off < len(s): + break + + if pairs or not cookies: + cookies.append(pairs) + + return cookies, off + + +def _has_special(s: str) -> bool: + for i in s: + if i in '",;\\': + return True + o = ord(i) + if o < 0x21 or o > 0x7E: + return True + return False + + +def _format_pairs(pairs, specials=(), sep="; "): + """ + specials: A lower-cased list of keys that will not be quoted. + """ + vals = [] + for k, v in pairs: + if v is None: + val = k + elif k.lower() not in specials and _has_special(v): + v = ESCAPE.sub(r"\\\1", v) + v = '"%s"' % v + val = f"{k}={v}" + else: + val = f"{k}={v}" + vals.append(val) + return sep.join(vals) + + +def _format_set_cookie_pairs(lst): + return _format_pairs(lst, specials=("expires", "path")) + + +def parse_cookie_header(line): + """ + Parse a Cookie header value. + Returns a list of (lhs, rhs) tuples. + """ + pairs, off_ = _read_cookie_pairs(line) + return pairs + + +def parse_cookie_headers(cookie_headers): + cookie_list = [] + for header in cookie_headers: + cookie_list.extend(parse_cookie_header(header)) + return cookie_list + + +def format_cookie_header(lst): + """ + Formats a Cookie header value. + """ + return _format_pairs(lst) + + +def parse_set_cookie_header(line: str) -> list[TSetCookie]: + """ + Parse a Set-Cookie header value + + Returns: + A list of (name, value, attrs) tuples, where attrs is a + CookieAttrs dict of attributes. No attempt is made to parse attribute + values - they are treated purely as strings. + """ + cookie_pairs, off = _read_set_cookie_pairs(line) + cookies = [] + for pairs in cookie_pairs: + if pairs: + cookie, *attrs = pairs + cookies.append((cookie[0], cookie[1], CookieAttrs(attrs))) + return cookies + + +def parse_set_cookie_headers(headers: Iterable[str]) -> list[TSetCookie]: + rv = [] + for header in headers: + cookies = parse_set_cookie_header(header) + rv.extend(cookies) + return rv + + +def format_set_cookie_header(set_cookies: list[TSetCookie]) -> str: + """ + Formats a Set-Cookie header value. + """ + + rv = [] + + for name, value, attrs in set_cookies: + pairs = [(name, value)] + pairs.extend(attrs.fields if hasattr(attrs, "fields") else attrs) + + rv.append(_format_set_cookie_pairs(pairs)) + + return ", ".join(rv) + + +def refresh_set_cookie_header(c: str, delta: int) -> str: + """ + Args: + c: A Set-Cookie string + delta: Time delta in seconds + Returns: + A refreshed Set-Cookie string + Raises: + ValueError, if the cookie is invalid. + """ + cookies = parse_set_cookie_header(c) + for cookie in cookies: + name, value, attrs = cookie + if not name or not value: + raise ValueError("Invalid Cookie") + + if "expires" in attrs: + e = email.utils.parsedate_tz(attrs["expires"]) + if e: + f = email.utils.mktime_tz(e) + delta + attrs.set_all("expires", [email.utils.formatdate(f, usegmt=True)]) + else: + # This can happen when the expires tag is invalid. + # reddit.com sends a an expires tag like this: "Thu, 31 Dec + # 2037 23:59:59 GMT", which is valid RFC 1123, but not + # strictly correct according to the cookie spec. Browsers + # appear to parse this tolerantly - maybe we should too. + # For now, we just ignore this. + del attrs["expires"] + return format_set_cookie_header(cookies) + + +def get_expiration_ts(cookie_attrs): + """ + Determines the time when the cookie will be expired. + + Considering both 'expires' and 'max-age' parameters. + + Returns: timestamp of when the cookie will expire. + None, if no expiration time is set. + """ + if "expires" in cookie_attrs: + e = email.utils.parsedate_tz(cookie_attrs["expires"]) + if e: + return email.utils.mktime_tz(e) + + elif "max-age" in cookie_attrs: + try: + max_age = int(cookie_attrs["Max-Age"]) + except ValueError: + pass + else: + now_ts = time.time() + return now_ts + max_age + + return None + + +def is_expired(cookie_attrs): + """ + Determines whether a cookie has expired. + + Returns: boolean + """ + + exp_ts = get_expiration_ts(cookie_attrs) + now_ts = time.time() + + # If no expiration information was provided with the cookie + if exp_ts is None: + return False + else: + return exp_ts <= now_ts + + +def group_cookies(pairs): + """ + Converts a list of pairs to a (name, value, attrs) for each cookie. + """ + + if not pairs: + return [] + + cookie_list = [] + + # First pair is always a new cookie + name, value = pairs[0] + attrs = [] + + for k, v in pairs[1:]: + if k.lower() in _cookie_params: + attrs.append((k, v)) + else: + cookie_list.append((name, value, CookieAttrs(attrs))) + name, value, attrs = k, v, [] + + cookie_list.append((name, value, CookieAttrs(attrs))) + return cookie_list diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/headers.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/headers.py new file mode 100644 index 0000000000000000000000000000000000000000..3bad1d2b5bf99fb3aa58e81324299b0b490058c2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/headers.py @@ -0,0 +1,113 @@ +import collections +import re + + +def parse_content_type(c: str) -> tuple[str, str, dict[str, str]] | None: + """ + A simple parser for content-type values. Returns a (type, subtype, + parameters) tuple, where type and subtype are strings, and parameters + is a dict. If the string could not be parsed, return None. + + E.g. the following string: + + text/html; charset=UTF-8 + + Returns: + + ("text", "html", {"charset": "UTF-8"}) + """ + parts = c.split(";", 1) + ts = parts[0].split("/", 1) + if len(ts) != 2: + return None + d = collections.OrderedDict() + if len(parts) == 2: + for i in parts[1].split(";"): + clause = i.split("=", 1) + if len(clause) == 2: + d[clause[0].strip()] = clause[1].strip() + return ts[0].lower(), ts[1].lower(), d + + +def assemble_content_type(type, subtype, parameters): + if not parameters: + return f"{type}/{subtype}" + params = "; ".join(f"{k}={v}" for k, v in parameters.items()) + return f"{type}/{subtype}; {params}" + + +def infer_content_encoding(content_type: str, content: bytes = b"") -> str: + """ + Infer the encoding of content from the content-type header. + """ + enc = None + + # BOM has the highest priority + if content.startswith(b"\x00\x00\xfe\xff"): + enc = "utf-32be" + elif content.startswith(b"\xff\xfe\x00\x00"): + enc = "utf-32le" + elif content.startswith(b"\xfe\xff"): + enc = "utf-16be" + elif content.startswith(b"\xff\xfe"): + enc = "utf-16le" + elif content.startswith(b"\xef\xbb\xbf"): + # 'utf-8-sig' will strip the BOM on decode + enc = "utf-8-sig" + elif parsed_content_type := parse_content_type(content_type): + # Use the charset from the header if possible + enc = parsed_content_type[2].get("charset") + + # Otherwise, infer the encoding + if not enc and "json" in content_type: + enc = "utf8" + + if not enc and "html" in content_type: + meta_charset = re.search( + rb"""]+charset=['"]?([^'">]+)""", content, re.IGNORECASE + ) + if meta_charset: + enc = meta_charset.group(1).decode("ascii", "ignore") + else: + # Fallback to utf8 for html + # Ref: https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding + # > 9. [snip] the comprehensive UTF-8 encoding is suggested. + enc = "utf8" + + if not enc and "xml" in content_type: + if xml_encoding := re.search( + rb"""<\?xml[^\?>]+encoding=['"]([^'"\?>]+)""", content, re.IGNORECASE + ): + enc = xml_encoding.group(1).decode("ascii", "ignore") + else: + # Fallback to utf8 for xml + # Ref: https://datatracker.ietf.org/doc/html/rfc7303#section-8.5 + # > the XML processor [snip] to determine an encoding of UTF-8. + enc = "utf8" + + if not enc and ("javascript" in content_type or "ecmascript" in content_type): + # Fallback to utf8 for javascript + # Ref: https://datatracker.ietf.org/doc/html/rfc9239#section-4.2 + # > 3. Else, the character encoding scheme is assumed to be UTF-8 + enc = "utf8" + + if not enc and "text/css" in content_type: + # @charset rule must be the very first thing. + css_charset = re.match(rb"""@charset "([^"]+)";""", content, re.IGNORECASE) + if css_charset: + enc = css_charset.group(1).decode("ascii", "ignore") + else: + # Fallback to utf8 for css + # Ref: https://drafts.csswg.org/css-syntax/#determine-the-fallback-encoding + # > 4. Otherwise, return utf-8 + enc = "utf8" + + # Fallback to latin-1 + if not enc: + enc = "latin-1" + + # Use GB 18030 as the superset of GB2312 and GBK to fix common encoding problems on Chinese websites. + if enc.lower() in ("gb2312", "gbk"): + enc = "gb18030" + + return enc diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..01c543afb5df7f640806599c4e6c261a65e3a3b1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__init__.py @@ -0,0 +1,21 @@ +from .assemble import assemble_body +from .assemble import assemble_request +from .assemble import assemble_request_head +from .assemble import assemble_response +from .assemble import assemble_response_head +from .read import connection_close +from .read import expected_http_body_size +from .read import read_request_head +from .read import read_response_head + +__all__ = [ + "read_request_head", + "read_response_head", + "connection_close", + "expected_http_body_size", + "assemble_request", + "assemble_request_head", + "assemble_response", + "assemble_response_head", + "assemble_body", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5a8c6047ce65c72a46d63fc760381e6b53bc790 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/assemble.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/assemble.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40d8b0ff03bf25fb1826f38a871efdb6fd349b49 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/assemble.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/read.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/read.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fc066a43d321bd2f38943b43d7cf8421fa8d164 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/__pycache__/read.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/assemble.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/assemble.py new file mode 100644 index 0000000000000000000000000000000000000000..4760a258247d13694898747fe2e807f411728bad --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/assemble.py @@ -0,0 +1,99 @@ +def assemble_request(request): + if request.data.content is None: + raise ValueError("Cannot assemble flow with missing content") + head = assemble_request_head(request) + body = b"".join( + assemble_body( + request.data.headers, [request.data.content], request.data.trailers + ) + ) + return head + body + + +def assemble_request_head(request): + first_line = _assemble_request_line(request.data) + headers = _assemble_request_headers(request.data) + return b"%s\r\n%s\r\n" % (first_line, headers) + + +def assemble_response(response): + if response.data.content is None: + raise ValueError("Cannot assemble flow with missing content") + head = assemble_response_head(response) + body = b"".join( + assemble_body( + response.data.headers, [response.data.content], response.data.trailers + ) + ) + return head + body + + +def assemble_response_head(response): + first_line = _assemble_response_line(response.data) + headers = _assemble_response_headers(response.data) + return b"%s\r\n%s\r\n" % (first_line, headers) + + +def assemble_body(headers, body_chunks, trailers): + if "chunked" in headers.get("transfer-encoding", "").lower(): + for chunk in body_chunks: + if chunk: + yield b"%x\r\n%s\r\n" % (len(chunk), chunk) + if trailers: + yield b"0\r\n%s\r\n" % trailers + else: + yield b"0\r\n\r\n" + else: + if trailers: + raise ValueError( + "Sending HTTP/1.1 trailer headers requires transfer-encoding: chunked" + ) + for chunk in body_chunks: + yield chunk + + +def _assemble_request_line(request_data): + """ + Args: + request_data (mitmproxy.net.http.request.RequestData) + """ + if request_data.method.upper() == b"CONNECT": + return b"%s %s %s" % ( + request_data.method, + request_data.authority, + request_data.http_version, + ) + elif request_data.authority: + return b"%s %s://%s%s %s" % ( + request_data.method, + request_data.scheme, + request_data.authority, + request_data.path, + request_data.http_version, + ) + else: + return b"%s %s %s" % ( + request_data.method, + request_data.path, + request_data.http_version, + ) + + +def _assemble_request_headers(request_data): + """ + Args: + request_data (mitmproxy.net.http.request.RequestData) + """ + return bytes(request_data.headers) + + +def _assemble_response_line(response_data): + return b"%s %d %s" % ( + response_data.http_version, + response_data.status_code, + response_data.reason, + ) + + +def _assemble_response_headers(response): + return bytes(response.headers) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/read.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/read.py new file mode 100644 index 0000000000000000000000000000000000000000..dc061ca632623dd1a0d35264b73ac279f85571af --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/http1/read.py @@ -0,0 +1,308 @@ +import re +import time +import typing +from collections.abc import Iterable + +from mitmproxy.http import Headers +from mitmproxy.http import Request +from mitmproxy.http import Response +from mitmproxy.net.http import url +from mitmproxy.net.http import validate + + +def get_header_tokens(headers, key): + """ + Retrieve all tokens for a header key. A number of different headers + follow a pattern where each header line can containe comma-separated + tokens, and headers can be set multiple times. + """ + if key not in headers: + return [] + tokens = headers[key].split(",") + return [token.strip() for token in tokens] + + +def connection_close(http_version, headers): + """ + Checks the message to see if the client connection should be closed + according to RFC 2616 Section 8.1. + If we don't have a Connection header, HTTP 1.1 connections are assumed + to be persistent. + """ + if "connection" in headers: + tokens = get_header_tokens(headers, "connection") + if "close" in tokens: + return True + elif "keep-alive" in tokens: + return False + + return http_version not in ( + "HTTP/1.1", + b"HTTP/1.1", + "HTTP/2.0", + b"HTTP/2.0", + ) + + +def expected_http_body_size( + request: Request, response: Response | None = None +) -> int | None: + """ + Returns: + The expected body length: + - a positive integer, if the size is known in advance + - None, if the size in unknown in advance (chunked encoding) + - -1, if all data should be read until end of stream. + + Raises: + ValueError, if the content-length or transfer-encoding header is invalid + """ + # Determine response size according to http://tools.ietf.org/html/rfc7230#section-3.3, which is inlined below. + if not response: + headers = request.headers + else: + headers = response.headers + + # 1. Any response to a HEAD request and any response with a 1xx + # (Informational), 204 (No Content), or 304 (Not Modified) status + # code is always terminated by the first empty line after the + # header fields, regardless of the header fields present in the + # message, and thus cannot contain a message body. + if request.method.upper() == "HEAD": + return 0 + if 100 <= response.status_code <= 199: + return 0 + if response.status_code in (204, 304): + return 0 + + # 2. Any 2xx (Successful) response to a CONNECT request implies that + # the connection will become a tunnel immediately after the empty + # line that concludes the header fields. A client MUST ignore any + # Content-Length or Transfer-Encoding header fields received in + # such a message. + if 200 <= response.status_code <= 299 and request.method.upper() == "CONNECT": + return 0 + + # 3. If a Transfer-Encoding header field is present and the chunked + # transfer coding (Section 4.1) is the final encoding, the message + # body length is determined by reading and decoding the chunked + # data until the transfer coding indicates the data is complete. + # + # If a Transfer-Encoding header field is present in a response and + # the chunked transfer coding is not the final encoding, the + # message body length is determined by reading the connection until + # it is closed by the server. If a Transfer-Encoding header field + # is present in a request and the chunked transfer coding is not + # the final encoding, the message body length cannot be determined + # reliably; the server MUST respond with the 400 (Bad Request) + # status code and then close the connection. + # + # If a message is received with both a Transfer-Encoding and a + # Content-Length header field, the Transfer-Encoding overrides the + # Content-Length. Such a message might indicate an attempt to + # perform request smuggling (Section 9.5) or response splitting + # (Section 9.4) and ought to be handled as an error. A sender MUST + # remove the received Content-Length field prior to forwarding such + # a message downstream. + # + if te_str := headers.get("transfer-encoding"): + te = validate.parse_transfer_encoding(te_str) + match te: + case "chunked" | "compress,chunked" | "deflate,chunked" | "gzip,chunked": + return None + case "compress" | "deflate" | "gzip" | "identity": + if response: + return -1 + # These values are valid for responses only (not requests), which is ensured in + # mitmproxy.net.http.validate. If users have explicitly disabled header validation, + # we strive for maximum compatibility with weird clients. + if te == "identity" or "content-length" in headers: + pass # Content-Length or 0 + else: + return ( + -1 + ) # compress/deflate/gzip with no content-length -> read until eof + case other: # pragma: no cover + typing.assert_never(other) + + # 4. If a message is received without Transfer-Encoding and with + # either multiple Content-Length header fields having differing + # field-values or a single Content-Length header field having an + # invalid value, then the message framing is invalid and the + # recipient MUST treat it as an unrecoverable error. If this is a + # request message, the server MUST respond with a 400 (Bad Request) + # status code and then close the connection. If this is a response + # message received by a proxy, the proxy MUST close the connection + # to the server, discard the received response, and send a 502 (Bad + # Gateway) response to the client. If this is a response message + # received by a user agent, the user agent MUST close the + # connection to the server and discard the received response. + # + # 5. If a valid Content-Length header field is present without + # Transfer-Encoding, its decimal value defines the expected message + # body length in octets. If the sender closes the connection or + # the recipient times out before the indicated number of octets are + # received, the recipient MUST consider the message to be + # incomplete and close the connection. + if cl := headers.get("content-length"): + return validate.parse_content_length(cl) + # 6. If this is a request message and none of the above are true, then + # the message body length is zero (no message body is present). + if not response: + return 0 + + # 7. Otherwise, this is a response message without a declared message + # body length, so the message body length is determined by the + # number of octets received prior to the server closing the + # connection. + return -1 + + +def raise_if_http_version_unknown(http_version: bytes) -> None: + if not re.match(rb"^HTTP/\d\.\d$", http_version): + raise ValueError(f"Unknown HTTP version: {http_version!r}") + + +def _read_request_line( + line: bytes, +) -> tuple[str, int, bytes, bytes, bytes, bytes, bytes]: + try: + method, target, http_version = line.split() + port: int | None + + if target == b"*" or target.startswith(b"/"): + scheme, authority, path = b"", b"", target + host, port = "", 0 + elif method == b"CONNECT": + scheme, authority, path = b"", target, b"" + host, port = url.parse_authority(authority, check=True) + if not port: + raise ValueError + else: + scheme, rest = target.split(b"://", maxsplit=1) + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.1 + # An implementation should accept uppercase letters as equivalent to lowercase in scheme names + # (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce + # lowercase scheme names for consistency. + scheme = scheme.lower() + authority, _, path_ = rest.partition(b"/") + path = b"/" + path_ + host, port = url.parse_authority(authority, check=True) + port = port or url.default_port(scheme) + if not port: + raise ValueError + # TODO: we can probably get rid of this check? + url.parse(target) + + raise_if_http_version_unknown(http_version) + except ValueError as e: + raise ValueError(f"Bad HTTP request line: {line!r}") from e + + return host, port, method, scheme, authority, path, http_version + + +def _read_response_line(line: bytes) -> tuple[bytes, int, bytes]: + try: + parts = line.split(None, 2) + if len(parts) == 2: # handle missing message gracefully + parts.append(b"") + + http_version, status_code_str, reason = parts + status_code = int(status_code_str) + raise_if_http_version_unknown(http_version) + except ValueError as e: + raise ValueError(f"Bad HTTP response line: {line!r}") from e + + return http_version, status_code, reason + + +def _read_headers(lines: Iterable[bytes]) -> Headers: + """ + Read a set of headers. + Stop once a blank line is reached. + + Returns: + A headers object + + Raises: + exceptions.HttpSyntaxException + """ + ret: list[tuple[bytes, bytes]] = [] + for line in lines: + if line[0] in b" \t": + if not ret: + raise ValueError("Invalid headers") + # continued header + ret[-1] = (ret[-1][0], ret[-1][1] + b"\r\n " + line.strip()) + else: + try: + name, value = line.split(b":", 1) + value = value.strip() + if not name: + raise ValueError() + ret.append((name, value)) + except ValueError: + raise ValueError(f"Invalid header line: {line!r}") + return Headers(ret) + + +def read_request_head(lines: list[bytes]) -> Request: + """ + Parse an HTTP request head (request line + headers) from an iterable of lines + + Args: + lines: The input lines + + Returns: + The HTTP request object (without body) + + Raises: + ValueError: The input is malformed. + """ + host, port, method, scheme, authority, path, http_version = _read_request_line( + lines[0] + ) + headers = _read_headers(lines[1:]) + + return Request( + host=host, + port=port, + method=method, + scheme=scheme, + authority=authority, + path=path, + http_version=http_version, + headers=headers, + content=None, + trailers=None, + timestamp_start=time.time(), + timestamp_end=None, + ) + + +def read_response_head(lines: list[bytes]) -> Response: + """ + Parse an HTTP response head (response line + headers) from an iterable of lines + + Args: + lines: The input lines + + Returns: + The HTTP response object (without body) + + Raises: + ValueError: The input is malformed. + """ + http_version, status_code, reason = _read_response_line(lines[0]) + headers = _read_headers(lines[1:]) + + return Response( + http_version=http_version, + status_code=status_code, + reason=reason, + headers=headers, + content=None, + trailers=None, + timestamp_start=time.time(), + timestamp_end=None, + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/multipart.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/multipart.py new file mode 100644 index 0000000000000000000000000000000000000000..c2c0a8bbfadc61008a3b272554ab9aed0ddd8fa2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/multipart.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +import mimetypes +import re +import warnings +from urllib.parse import quote + +from mitmproxy.net.http import headers + + +def encode_multipart(content_type: str, parts: list[tuple[bytes, bytes]]) -> bytes: + if content_type: + ct = headers.parse_content_type(content_type) + if ct is not None: + try: + raw_boundary = ct[2]["boundary"].encode("ascii") + boundary = quote(raw_boundary) + except (KeyError, UnicodeError): + return b"" + hdrs = [] + for key, value in parts: + file_type = ( + mimetypes.guess_type(str(key))[0] or "text/plain; charset=utf-8" + ) + + if key: + hdrs.append(b"--%b" % boundary.encode("utf-8")) + disposition = b'form-data; name="%b"' % key + hdrs.append(b"Content-Disposition: %b" % disposition) + hdrs.append(b"Content-Type: %b" % file_type.encode("utf-8")) + hdrs.append(b"") + hdrs.append(value) + hdrs.append(b"") + + if value is not None: + # If boundary is found in value then raise ValueError + if re.search( + rb"^--%b$" % re.escape(boundary.encode("utf-8")), value + ): + raise ValueError(b"boundary found in encoded string") + + hdrs.append(b"--%b--\r\n" % boundary.encode("utf-8")) + temp = b"\r\n".join(hdrs) + return temp + return b"" + + +def decode_multipart( + content_type: str | None, content: bytes +) -> list[tuple[bytes, bytes]]: + """ + Takes a multipart boundary encoded string and returns list of (key, value) tuples. + """ + if content_type: + ct = headers.parse_content_type(content_type) + if not ct: + return [] + try: + boundary = ct[2]["boundary"].encode("ascii") + except (KeyError, UnicodeError): + return [] + + rx = re.compile(rb'\bname="([^"]+)"') + r = [] + if content is not None: + for i in content.split(b"--" + boundary): + parts = i.splitlines() + if len(parts) > 1 and parts[0][0:2] != b"--": + match = rx.search(parts[1]) + if match: + key = match.group(1) + value = b"".join(parts[3 + parts[2:].index(b"") :]) + r.append((key, value)) + return r + return [] + + +def encode(ct, parts): # pragma: no cover + # 2023-02 + warnings.warn( + "multipart.encode is deprecated, use multipart.encode_multipart instead.", + DeprecationWarning, + stacklevel=2, + ) + return encode_multipart(ct, parts) + + +def decode(ct, content): # pragma: no cover + # 2023-02 + warnings.warn( + "multipart.decode is deprecated, use multipart.decode_multipart instead.", + DeprecationWarning, + stacklevel=2, + ) + return encode_multipart(ct, content) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/status_codes.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/status_codes.py new file mode 100644 index 0000000000000000000000000000000000000000..df806ffce5af7e206519eb27c3c067554095a817 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/status_codes.py @@ -0,0 +1,146 @@ +# Covered status codes: +# - official HTTP status codes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status +# - custom codes: +# - 444 No Response +# - 499 Client Closed Request +CONTINUE = 100 +SWITCHING = 101 +PROCESSING = 102 +EARLY_HINTS = 103 + +OK = 200 +CREATED = 201 +ACCEPTED = 202 +NON_AUTHORITATIVE_INFORMATION = 203 +NO_CONTENT = 204 +RESET_CONTENT = 205 +PARTIAL_CONTENT = 206 +MULTI_STATUS = 207 +ALREADY_REPORTED = 208 +IM_USED = 226 + +MULTIPLE_CHOICE = 300 +MOVED_PERMANENTLY = 301 +FOUND = 302 +SEE_OTHER = 303 +NOT_MODIFIED = 304 +USE_PROXY = 305 +TEMPORARY_REDIRECT = 307 +PERMANENT_REDIRECT = 308 + +BAD_REQUEST = 400 +UNAUTHORIZED = 401 +PAYMENT_REQUIRED = 402 +FORBIDDEN = 403 +NOT_FOUND = 404 +NOT_ALLOWED = 405 +NOT_ACCEPTABLE = 406 +PROXY_AUTH_REQUIRED = 407 +REQUEST_TIMEOUT = 408 +CONFLICT = 409 +GONE = 410 +LENGTH_REQUIRED = 411 +PRECONDITION_FAILED = 412 +PAYLOAD_TOO_LARGE = 413 +REQUEST_URI_TOO_LONG = 414 +UNSUPPORTED_MEDIA_TYPE = 415 +REQUESTED_RANGE_NOT_SATISFIABLE = 416 +EXPECTATION_FAILED = 417 +IM_A_TEAPOT = 418 +MISDIRECTED_REQUEST = 421 +UNPROCESSABLE_CONTENT = 422 +LOCKED = 423 +FAILED_DEPENDENCY = 424 +TOO_EARLY = 425 +UPGRADE_REQUIRED = 426 +PRECONDITION_REQUIRED = 428 +TOO_MANY_REQUESTS = 429 +REQUEST_HEADER_FIELDS_TOO_LARGE = 431 +UNAVAILABLE_FOR_LEGAL_REASONS = 451 +NO_RESPONSE = 444 +CLIENT_CLOSED_REQUEST = 499 + +INTERNAL_SERVER_ERROR = 500 +NOT_IMPLEMENTED = 501 +BAD_GATEWAY = 502 +SERVICE_UNAVAILABLE = 503 +GATEWAY_TIMEOUT = 504 +HTTP_VERSION_NOT_SUPPORTED = 505 +VARIANT_ALSO_NEGOTIATES = 506 +INSUFFICIENT_STORAGE_SPACE = 507 +LOOP_DETECTED = 508 +NOT_EXTENDED = 510 +NETWORK_AUTHENTICATION_REQUIRED = 511 + +RESPONSES = { + # 100 + CONTINUE: "Continue", + SWITCHING: "Switching Protocols", + PROCESSING: "Processing", + EARLY_HINTS: "Early Hints", + # 200 + OK: "OK", + CREATED: "Created", + ACCEPTED: "Accepted", + NON_AUTHORITATIVE_INFORMATION: "Non-Authoritative Information", + NO_CONTENT: "No Content", + RESET_CONTENT: "Reset Content", + PARTIAL_CONTENT: "Partial Content", + MULTI_STATUS: "Multi-Status", + ALREADY_REPORTED: "Already Reported", + IM_USED: "IM Used", + # 300 + MULTIPLE_CHOICE: "Multiple Choices", + MOVED_PERMANENTLY: "Moved Permanently", + FOUND: "Found", + SEE_OTHER: "See Other", + NOT_MODIFIED: "Not Modified", + USE_PROXY: "Use Proxy", + # 306 not defined?? + TEMPORARY_REDIRECT: "Temporary Redirect", + PERMANENT_REDIRECT: "Permanent Redirect", + # 400 + BAD_REQUEST: "Bad Request", + UNAUTHORIZED: "Unauthorized", + PAYMENT_REQUIRED: "Payment Required", + FORBIDDEN: "Forbidden", + NOT_FOUND: "Not Found", + NOT_ALLOWED: "Method Not Allowed", + NOT_ACCEPTABLE: "Not Acceptable", + PROXY_AUTH_REQUIRED: "Proxy Authentication Required", + REQUEST_TIMEOUT: "Request Time-out", + CONFLICT: "Conflict", + GONE: "Gone", + LENGTH_REQUIRED: "Length Required", + PRECONDITION_FAILED: "Precondition Failed", + PAYLOAD_TOO_LARGE: "Payload Too Large", + REQUEST_URI_TOO_LONG: "Request-URI Too Long", + UNSUPPORTED_MEDIA_TYPE: "Unsupported Media Type", + REQUESTED_RANGE_NOT_SATISFIABLE: "Requested Range not satisfiable", + EXPECTATION_FAILED: "Expectation Failed", + IM_A_TEAPOT: "I'm a teapot", + MISDIRECTED_REQUEST: "Misdirected Request", + UNPROCESSABLE_CONTENT: "Unprocessable Content", + LOCKED: "Locked", + FAILED_DEPENDENCY: "Failed Dependency", + TOO_EARLY: "Too Early", + UPGRADE_REQUIRED: "Upgrade Required", + PRECONDITION_REQUIRED: "Precondition Required", + TOO_MANY_REQUESTS: "Too Many Requests", + REQUEST_HEADER_FIELDS_TOO_LARGE: "Request Header Fields Too Large", + UNAVAILABLE_FOR_LEGAL_REASONS: "Unavailable For Legal Reasons", + NO_RESPONSE: "No Response", + CLIENT_CLOSED_REQUEST: "Client Closed Request", + # 500 + INTERNAL_SERVER_ERROR: "Internal Server Error", + NOT_IMPLEMENTED: "Not Implemented", + BAD_GATEWAY: "Bad Gateway", + SERVICE_UNAVAILABLE: "Service Unavailable", + GATEWAY_TIMEOUT: "Gateway Time-out", + HTTP_VERSION_NOT_SUPPORTED: "HTTP Version not supported", + VARIANT_ALSO_NEGOTIATES: "Variant Also Negotiates", + INSUFFICIENT_STORAGE_SPACE: "Insufficient Storage Space", + LOOP_DETECTED: "Loop Detected", + NOT_EXTENDED: "Not Extended", + NETWORK_AUTHENTICATION_REQUIRED: "Network Authentication Required", +} diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/url.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/url.py new file mode 100644 index 0000000000000000000000000000000000000000..8c145ae4eb822cd8467d639983cc88f9ae7ea4b7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/url.py @@ -0,0 +1,200 @@ +from __future__ import annotations + +import re +import urllib.parse +from collections.abc import Sequence +from typing import AnyStr +from typing import overload + +from mitmproxy.net import check +from mitmproxy.net.check import is_valid_host +from mitmproxy.net.check import is_valid_port +from mitmproxy.utils.strutils import always_str + +# This regex extracts & splits the host header into host and port. +# Handles the edge case of IPv6 addresses containing colons. +# https://bugzilla.mozilla.org/show_bug.cgi?id=45891 + +_authority_re = re.compile(r"^(?P[^:]+|\[.+\])(?::(?P\d+))?$") + + +def parse(url: str | bytes) -> tuple[bytes, bytes, int, bytes]: + """ + URL-parsing function that checks that + - port is an integer 0-65535 + - host is a valid IDNA-encoded hostname with no null-bytes + - path is valid ASCII + + Args: + A URL (as bytes or as unicode) + + Returns: + A (scheme, host, port, path) tuple + + Raises: + ValueError, if the URL is not properly formatted. + """ + # FIXME: We shouldn't rely on urllib here. + + # Size of Ascii character after encoding is 1 byte which is same as its size + # But non-Ascii character's size after encoding will be more than its size + def ascii_check(x): + if len(x) == len(str(x).encode()): + return True + return False + + if isinstance(url, bytes): + url = url.decode() + if not ascii_check(url): + url = urllib.parse.urlsplit(url) # type: ignore + url = list(url) # type: ignore + url[3] = urllib.parse.quote(url[3]) # type: ignore + url = urllib.parse.urlunsplit(url) # type: ignore + + parsed: urllib.parse.ParseResult = urllib.parse.urlparse(url) + if not parsed.hostname: + raise ValueError("No hostname given") + else: + host = parsed.hostname.encode("idna") + + parsed_b: urllib.parse.ParseResultBytes = parsed.encode("ascii") # type: ignore + + port = parsed_b.port + if not port: + port = 443 if parsed_b.scheme == b"https" else 80 + + full_path: bytes = urllib.parse.urlunparse( + (b"", b"", parsed_b.path, parsed_b.params, parsed_b.query, parsed_b.fragment) # type: ignore + ) + if not full_path.startswith(b"/"): + full_path = b"/" + full_path # type: ignore + + if not check.is_valid_host(host): + raise ValueError("Invalid Host") + + return parsed_b.scheme, host, port, full_path + + +@overload +def unparse(scheme: str, host: str, port: int, path) -> str: ... + + +@overload +def unparse(scheme: bytes, host: bytes, port: int, path) -> bytes: ... + + +def unparse(scheme, host, port, path): + """ + Returns a URL string, constructed from the specified components. + """ + authority = hostport(scheme, host, port) + + if isinstance(scheme, str): + return f"{scheme}://{authority}{path}" + else: + return b"%s://%s%s" % (scheme, authority, path) + + +def encode(s: Sequence[tuple[str, str]], similar_to: str | None = None) -> str: + """ + Takes a list of (key, value) tuples and returns a urlencoded string. + If similar_to is passed, the output is formatted similar to the provided urlencoded string. + """ + + remove_trailing_equal = False + if similar_to: + remove_trailing_equal = any("=" not in param for param in similar_to.split("&")) + + encoded = urllib.parse.urlencode(s, False, errors="surrogateescape") + + if encoded and remove_trailing_equal: + encoded = encoded.replace("=&", "&") + if encoded[-1] == "=": + encoded = encoded[:-1] + + return encoded + + +def decode(s): + """ + Takes a urlencoded string and returns a list of surrogate-escaped (key, value) tuples. + """ + return urllib.parse.parse_qsl(s, keep_blank_values=True, errors="surrogateescape") + + +def quote(b: str, safe: str = "/") -> str: + """ + Returns: + An ascii-encodable str. + """ + return urllib.parse.quote(b, safe=safe, errors="surrogateescape") + + +def unquote(s: str) -> str: + """ + Args: + s: A surrogate-escaped str + Returns: + A surrogate-escaped str + """ + return urllib.parse.unquote(s, errors="surrogateescape") + + +def hostport(scheme: AnyStr, host: AnyStr, port: int) -> AnyStr: + """ + Returns the host component, with a port specification if needed. + """ + if default_port(scheme) == port: + return host + else: + if isinstance(host, bytes): + return b"%s:%d" % (host, port) + else: + return "%s:%d" % (host, port) + + +def default_port(scheme: AnyStr) -> int | None: + return { + "http": 80, + b"http": 80, + "https": 443, + b"https": 443, + }.get(scheme, None) + + +def parse_authority(authority: AnyStr, check: bool) -> tuple[str, int | None]: + """Extract the host and port from host header/authority information + + Raises: + ValueError, if check is True and the authority information is malformed. + """ + try: + if isinstance(authority, bytes): + m = _authority_re.match(authority.decode("utf-8")) + if not m: + raise ValueError + host = m["host"].encode("utf-8").decode("idna") + else: + m = _authority_re.match(authority) + if not m: + raise ValueError + host = m.group("host") + + if host.startswith("[") and host.endswith("]"): + host = host[1:-1] + if not is_valid_host(host): + raise ValueError + + if m.group("port"): + port = int(m.group("port")) + if not is_valid_port(port): + raise ValueError + return host, port + else: + return host, None + + except ValueError: + if check: + raise + else: + return always_str(authority, "utf-8", "surrogateescape"), None diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/user_agents.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/user_agents.py new file mode 100644 index 0000000000000000000000000000000000000000..65b8d0cfe4bec233a647a8d749c7803f8d82b3ab --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/user_agents.py @@ -0,0 +1,60 @@ +""" +A small collection of useful user-agent header strings. These should be +kept reasonably current to reflect common usage. +""" +# pylint: line-too-long +# A collection of (name, shortcut, string) tuples. + +UASTRINGS = [ + ( + "android", + "a", + "Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Nexus 7 Build/JRO03D) AFL/01.04.02", + ), + ( + "blackberry", + "l", + "Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+", + ), + ( + "bingbot", + "b", + "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)", + ), + ( + "chrome", + "c", + "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1", + ), + ( + "firefox", + "f", + "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:14.0) Gecko/20120405 Firefox/14.0a1", + ), + ("googlebot", "g", "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"), + ("ie9", "i", "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US)"), + ( + "ipad", + "p", + "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3", + ), + ( + "iphone", + "h", + "Mozilla/5.0 (iPhone; CPU iPhone OS 4_2_1 like Mac OS X) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5", # noqa + ), + ( + "safari", + "s", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10", + ), +] + + +def get_by_shortcut(s): + """ + Retrieve a user agent entry by shortcut. + """ + for i in UASTRINGS: + if s == i[1]: + return i diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/http/validate.py b/python/user_packages/Python313/site-packages/mitmproxy/net/http/validate.py new file mode 100644 index 0000000000000000000000000000000000000000..7a333d279e66b255b237d99d2f0719608a12e670 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/http/validate.py @@ -0,0 +1,141 @@ +import logging +import re +import typing + +from mitmproxy.http import Message +from mitmproxy.http import Request +from mitmproxy.http import Response + +logger = logging.getLogger(__name__) + +# https://datatracker.ietf.org/doc/html/rfc7230#section-3.2: Header fields are tokens. +# "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA +_valid_header_name = re.compile(rb"^[!#$%&'*+\-.^_`|~0-9a-zA-Z]+$") + +_valid_content_length = re.compile(rb"^(?:0|[1-9][0-9]*)$") +_valid_content_length_str = re.compile(r"^(?:0|[1-9][0-9]*)$") + +# https://datatracker.ietf.org/doc/html/rfc9112#section-6.1: +# > A sender MUST NOT apply the chunked transfer coding more than once to a message body (i.e., chunking an already +# > chunked message is not allowed). If any transfer coding other than chunked is applied to a request's content, the +# > sender MUST apply chunked as the final transfer coding to ensure that the message is properly framed. If any +# > transfer coding other than chunked is applied to a response's content, the sender MUST either apply chunked as the +# > final transfer coding or terminate the message by closing the connection. +# +# The RFC technically still allows for fun encodings, we are a bit stricter and only accept a known subset by default. +TransferEncoding = typing.Literal[ + "chunked", + "compress,chunked", + "deflate,chunked", + "gzip,chunked", + "compress", + "deflate", + "gzip", + "identity", +] +_HTTP_1_1_TRANSFER_ENCODINGS = frozenset(typing.get_args(TransferEncoding)) + + +def parse_content_length(value: str | bytes) -> int: + """Parse a content-length header value, or raise a ValueError if it is invalid.""" + if isinstance(value, str): + valid = bool(_valid_content_length_str.match(value)) + else: + valid = bool(_valid_content_length.match(value)) + if not valid: + raise ValueError(f"invalid content-length header: {value!r}") + return int(value) + + +def parse_transfer_encoding(value: str | bytes) -> TransferEncoding: + """Parse a transfer-encoding header value, or raise a ValueError if it is invalid or unknown.""" + # guard against .lower() transforming non-ascii to ascii + if not value.isascii(): + raise ValueError(f"invalid transfer-encoding header: {value!r}") + if isinstance(value, str): + te = value + else: + te = value.decode() + te = te.lower() + te = re.sub(r"[\t ]*,[\t ]*", ",", te) + if te not in _HTTP_1_1_TRANSFER_ENCODINGS: + raise ValueError(f"unknown transfer-encoding header: {value!r}") + return typing.cast(TransferEncoding, te) + + +def validate_headers(message: Message) -> None: + """ + Validate HTTP message headers to avoid request smuggling attacks. + + Raises a ValueError if they are malformed. + """ + + te = [] + cl = [] + + for name, value in message.headers.fields: + if not _valid_header_name.match(name): + raise ValueError(f"invalid header name: {name!r}") + match name.lower(): + case b"transfer-encoding": + te.append(value) + case b"content-length": + cl.append(value) + + if te and cl: + # > A server MAY reject a request that contains both Content-Length and Transfer-Encoding or process such a + # > request in accordance with the Transfer-Encoding alone. + + # > A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header + # > field. + raise ValueError( + "message with both transfer-encoding and content-length headers" + ) + elif te: + if len(te) > 1: + raise ValueError(f"multiple transfer-encoding headers: {te!r}") + # > Transfer-Encoding was added in HTTP/1.1. It is generally assumed that implementations advertising only + # > HTTP/1.0 support will not understand how to process transfer-encoded content, and that an HTTP/1.0 message + # > received with a Transfer-Encoding is likely to have been forwarded without proper handling of the chunked + # > transfer coding in transit. + # + # > A client MUST NOT send a request containing Transfer-Encoding unless it knows the server will handle + # > HTTP/1.1 requests (or later minor revisions); such knowledge might be in the form of specific user + # > configuration or by remembering the version of a prior received response. A server MUST NOT send a response + # > containing Transfer-Encoding unless the corresponding request indicates HTTP/1.1 (or later minor revisions). + if not message.is_http11: + raise ValueError( + f"unexpected HTTP transfer-encoding {te[0]!r} for {message.http_version}" + ) + # > A server MUST NOT send a Transfer-Encoding header field in any response with a status code of 1xx + # > (Informational) or 204 (No Content). + if isinstance(message, Response) and ( + 100 <= message.status_code <= 199 or message.status_code == 204 + ): + raise ValueError( + f"unexpected HTTP transfer-encoding {te[0]!r} for response with status code {message.status_code}" + ) + # > If a Transfer-Encoding header field is present in a request and the chunked transfer coding is not the final + # > encoding, the message body length cannot be determined reliably; the server MUST respond with the 400 (Bad + # > Request) status code and then close the connection. + te_parsed = parse_transfer_encoding(te[0]) + match te_parsed: + case "chunked" | "compress,chunked" | "deflate,chunked" | "gzip,chunked": + pass + case "compress" | "deflate" | "gzip" | "identity": + if isinstance(message, Request): + raise ValueError( + f"unexpected HTTP transfer-encoding {te_parsed!r} for request" + ) + case other: # pragma: no cover + typing.assert_never(other) + elif cl: + # > If a message is received without Transfer-Encoding and with an invalid Content-Length header field, then the + # > message framing is invalid and the recipient MUST treat it as an unrecoverable error, unless the field value + # > can be successfully parsed as a comma-separated list (Section 5.6.1 of [HTTP]), all values in the list are + # > valid, and all values in the list are the same (in which case, the message is processed with that single + # > value used as the Content-Length field value). + # We are stricter here and reject comma-separated lists. + if len(cl) > 1: + raise ValueError(f"multiple content-length headers: {cl!r}") + parse_content_length(cl[0]) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/local_ip.py b/python/user_packages/Python313/site-packages/mitmproxy/net/local_ip.py new file mode 100644 index 0000000000000000000000000000000000000000..865cf3e2519c131ae9fd941e175033d3af787a4e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/local_ip.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import socket + + +def get_local_ip(reachable: str = "8.8.8.8") -> str | None: + """ + Get the default local outgoing IPv4 address without sending any packets. + This will fail if the target address is known to be unreachable. + We use Google DNS's IPv4 address as the default. + """ + # https://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib + s = None + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect((reachable, 80)) + return s.getsockname()[0] # pragma: no cover + except OSError: + return None # pragma: no cover + finally: + if s is not None: + s.close() + + +def get_local_ip6(reachable: str = "2001:4860:4860::8888") -> str | None: + """ + Get the default local outgoing IPv6 address without sending any packets. + This will fail if the target address is known to be unreachable. + We use Google DNS's IPv6 address as the default. + """ + s = None + try: + s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) + s.connect((reachable, 80)) + return s.getsockname()[0] # pragma: no cover + except OSError: # pragma: no cover + return None + finally: + if s is not None: + s.close() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/server_spec.py b/python/user_packages/Python313/site-packages/mitmproxy/net/server_spec.py new file mode 100644 index 0000000000000000000000000000000000000000..254811ff3f7c063972c0ba161980f31053ba6882 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/server_spec.py @@ -0,0 +1,85 @@ +""" +Server specs are used to describe an upstream proxy or server. +""" + +import re +from functools import cache +from typing import Literal + +from mitmproxy.net import check + +ServerSpec = tuple[ + Literal["http", "https", "http3", "tls", "dtls", "tcp", "udp", "dns", "quic"], + tuple[str, int], +] + +server_spec_re = re.compile( + r""" + ^ + (?:(?P\w+)://)? # scheme is optional + (?P[^:/]+|\[.+\]) # hostname can be DNS name, IPv4, or IPv6 address. + (?::(?P\d+))? # port is optional + /? # we allow a trailing backslash, but no path + $ + """, + re.VERBOSE, +) + + +@cache +def parse(server_spec: str, default_scheme: str) -> ServerSpec: + """ + Parses a server mode specification, e.g.: + + - http://example.com/ + - example.org + - example.com:443 + + *Raises:* + - ValueError, if the server specification is invalid. + """ + m = server_spec_re.match(server_spec) + if not m: + raise ValueError(f"Invalid server specification: {server_spec}") + + if m.group("scheme"): + scheme = m.group("scheme") + else: + scheme = default_scheme + if scheme not in ( + "http", + "https", + "http3", + "tls", + "dtls", + "tcp", + "udp", + "dns", + "quic", + ): + raise ValueError(f"Invalid server scheme: {scheme}") + + host = m.group("host") + # IPv6 brackets + if host.startswith("[") and host.endswith("]"): + host = host[1:-1] + if not check.is_valid_host(host): + raise ValueError(f"Invalid hostname: {host}") + + if m.group("port"): + port = int(m.group("port")) + else: + try: + port = { + "http": 80, + "https": 443, + "quic": 443, + "http3": 443, + "dns": 53, + }[scheme] + except KeyError: + raise ValueError(f"Port specification missing.") + if not check.is_valid_port(port): + raise ValueError(f"Invalid port: {port}") + + return scheme, (host, port) # type: ignore diff --git a/python/user_packages/Python313/site-packages/mitmproxy/net/tls.py b/python/user_packages/Python313/site-packages/mitmproxy/net/tls.py new file mode 100644 index 0000000000000000000000000000000000000000..14c0553ca23eee556ff084a4c6dea3c3ac60a1ae --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/net/tls.py @@ -0,0 +1,330 @@ +import os +import threading +import typing +from collections.abc import Callable +from collections.abc import Iterable +from enum import Enum +from functools import cache +from functools import lru_cache +from pathlib import Path +from typing import Any +from typing import BinaryIO + +import certifi +import OpenSSL +from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve +from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurveOID +from cryptography.hazmat.primitives.asymmetric.ec import get_curve_for_oid +from cryptography.x509 import ObjectIdentifier +from OpenSSL import SSL + +from mitmproxy import certs + +# Remove once pyOpenSSL 23.3.0 is released and bump version in pyproject.toml. +try: # pragma: no cover + from OpenSSL.SSL import OP_LEGACY_SERVER_CONNECT # type: ignore +except ImportError: + OP_LEGACY_SERVER_CONNECT = 0x4 + + +# redeclared here for strict type checking +class Method(Enum): + TLS_SERVER_METHOD = SSL.TLS_SERVER_METHOD + TLS_CLIENT_METHOD = SSL.TLS_CLIENT_METHOD + # Type-pyopenssl does not know about these DTLS constants. + DTLS_SERVER_METHOD = SSL.DTLS_SERVER_METHOD # type: ignore + DTLS_CLIENT_METHOD = SSL.DTLS_CLIENT_METHOD # type: ignore + + +try: + SSL._lib.TLS_server_method # type: ignore +except AttributeError as e: # pragma: no cover + raise RuntimeError( + "Your installation of the cryptography Python package is outdated." + ) from e + + +class Version(Enum): + UNBOUNDED = 0 + SSL3 = SSL.SSL3_VERSION + TLS1 = SSL.TLS1_VERSION + TLS1_1 = SSL.TLS1_1_VERSION + TLS1_2 = SSL.TLS1_2_VERSION + TLS1_3 = SSL.TLS1_3_VERSION + + +INSECURE_TLS_MIN_VERSIONS: tuple[Version, ...] = ( + Version.UNBOUNDED, + Version.SSL3, + Version.TLS1, + Version.TLS1_1, +) + + +class Verify(Enum): + VERIFY_NONE = SSL.VERIFY_NONE + VERIFY_PEER = SSL.VERIFY_PEER + + +DEFAULT_MIN_VERSION = Version.TLS1_2 +DEFAULT_MAX_VERSION = Version.UNBOUNDED +DEFAULT_OPTIONS = SSL.OP_CIPHER_SERVER_PREFERENCE | SSL.OP_NO_COMPRESSION + + +@cache +def is_supported_version(version: Version): + client_ctx = SSL.Context(SSL.TLS_CLIENT_METHOD) + # Without SECLEVEL, recent OpenSSL versions forbid old TLS versions. + # https://github.com/pyca/cryptography/issues/9523 + client_ctx.set_cipher_list(b"@SECLEVEL=0:ALL") + client_ctx.set_min_proto_version(version.value) + client_ctx.set_max_proto_version(version.value) + client_conn = SSL.Connection(client_ctx) + client_conn.set_connect_state() + + try: + client_conn.recv(4096) + except SSL.WantReadError: + return True + except SSL.Error: + return False + + +EC_CURVES: dict[str, EllipticCurve] = {} +for oid in EllipticCurveOID.__dict__.values(): + if isinstance(oid, ObjectIdentifier): + curve = get_curve_for_oid(oid)() + EC_CURVES[curve.name] = curve + + +@typing.overload +def get_curve(name: str) -> EllipticCurve: ... + + +@typing.overload +def get_curve(name: None) -> None: ... + + +def get_curve(name: str | None) -> EllipticCurve | None: + if name is None: + return None + return EC_CURVES[name] + + +class MasterSecretLogger: + def __init__(self, filename: Path): + self.filename = filename.expanduser() + self.f: BinaryIO | None = None + self.lock = threading.Lock() + + # required for functools.wraps, which pyOpenSSL uses. + __name__ = "MasterSecretLogger" + + def __call__(self, connection: SSL.Connection, keymaterial: bytes) -> None: + with self.lock: + if self.f is None: + self.filename.parent.mkdir(parents=True, exist_ok=True) + self.f = self.filename.open("ab") + self.f.write(b"\n") + self.f.write(keymaterial + b"\n") + self.f.flush() + + def close(self): + with self.lock: + if self.f is not None: + self.f.close() + + +def make_master_secret_logger(filename: str | None) -> MasterSecretLogger | None: + if filename: + return MasterSecretLogger(Path(filename)) + return None + + +log_master_secret = make_master_secret_logger( + os.getenv("MITMPROXY_SSLKEYLOGFILE") or os.getenv("SSLKEYLOGFILE") +) + + +def _create_ssl_context( + *, + method: Method, + min_version: Version, + max_version: Version, + cipher_list: Iterable[str] | None, + ecdh_curve: EllipticCurve | None, +) -> SSL.Context: + context = SSL.Context(method.value) + + ok = SSL._lib.SSL_CTX_set_min_proto_version(context._context, min_version.value) # type: ignore + ok += SSL._lib.SSL_CTX_set_max_proto_version(context._context, max_version.value) # type: ignore + if ok != 2: + raise RuntimeError( + f"Error setting TLS versions ({min_version=}, {max_version=}). " + "The version you specified may be unavailable in your libssl." + ) + + # Options + context.set_options(DEFAULT_OPTIONS) + + # ECDHE for Key exchange + if ecdh_curve is not None: + try: + context.set_tmp_ecdh(ecdh_curve) + except ValueError as e: + raise RuntimeError(f"Elliptic curve specification error: {e}") from e + + # Cipher List + if cipher_list is not None: + try: + context.set_cipher_list(b":".join(x.encode() for x in cipher_list)) + except SSL.Error as e: + raise RuntimeError(f"SSL cipher specification error: {e}") from e + + # SSLKEYLOGFILE + if log_master_secret: + context.set_keylog_callback(log_master_secret) + + return context + + +@lru_cache(256) +def create_proxy_server_context( + *, + method: Method, + min_version: Version, + max_version: Version, + cipher_list: tuple[str, ...] | None, + ecdh_curve: EllipticCurve | None, + verify: Verify, + ca_path: str | None, + ca_pemfile: str | None, + client_cert: str | None, + legacy_server_connect: bool, +) -> SSL.Context: + context: SSL.Context = _create_ssl_context( + method=method, + min_version=min_version, + max_version=max_version, + cipher_list=cipher_list, + ecdh_curve=ecdh_curve, + ) + context.set_verify(verify.value, None) + + if ca_path is None and ca_pemfile is None: + ca_pemfile = certifi.where() + try: + context.load_verify_locations(ca_pemfile, ca_path) + except SSL.Error as e: + raise RuntimeError( + f"Cannot load trusted certificates ({ca_pemfile=}, {ca_path=})." + ) from e + + # Client Certs + if client_cert: + try: + context.use_privatekey_file(client_cert) + context.use_certificate_chain_file(client_cert) + except SSL.Error as e: + raise RuntimeError(f"Cannot load TLS client certificate: {e}") from e + + # https://github.com/mitmproxy/mitmproxy/discussions/7550 + SSL._lib.SSL_CTX_set_post_handshake_auth(context._context, 1) # type: ignore + + if legacy_server_connect: + context.set_options(OP_LEGACY_SERVER_CONNECT) + + return context + + +@lru_cache(256) +def create_client_proxy_context( + *, + method: Method, + min_version: Version, + max_version: Version, + cipher_list: tuple[str, ...] | None, + ecdh_curve: EllipticCurve | None, + chain_file: Path | None, + alpn_select_callback: Callable[[SSL.Connection, list[bytes]], Any] | None, + request_client_cert: bool, + extra_chain_certs: tuple[certs.Cert, ...], + dhparams: certs.DHParams, +) -> SSL.Context: + context: SSL.Context = _create_ssl_context( + method=method, + min_version=min_version, + max_version=max_version, + cipher_list=cipher_list, + ecdh_curve=ecdh_curve, + ) + + if chain_file is not None: + try: + context.load_verify_locations(str(chain_file), None) + except SSL.Error as e: + raise RuntimeError(f"Cannot load certificate chain ({chain_file}).") from e + + if alpn_select_callback is not None: + assert callable(alpn_select_callback) + context.set_alpn_select_callback(alpn_select_callback) + + if request_client_cert: + # The request_client_cert argument requires some explanation. We're + # supposed to be able to do this with no negative effects - if the + # client has no cert to present, we're notified and proceed as usual. + # Unfortunately, Android seems to have a bug (tested on 4.2.2) - when + # an Android client is asked to present a certificate it does not + # have, it hangs up, which is frankly bogus. Some time down the track + # we may be able to make the proper behaviour the default again, but + # until then we're conservative. + context.set_verify(Verify.VERIFY_PEER.value, accept_all) + else: + context.set_verify(Verify.VERIFY_NONE.value, None) + + for i in extra_chain_certs: + context.add_extra_chain_cert(i.to_cryptography()) + + if dhparams: + res = SSL._lib.SSL_CTX_set_tmp_dh(context._context, dhparams) # type: ignore + SSL._openssl_assert(res == 1) # type: ignore + + return context + + +def accept_all( + conn_: SSL.Connection, + x509: OpenSSL.crypto.X509, + errno: int, + err_depth: int, + is_cert_verified: int, +) -> bool: + # Return true to prevent cert verification error + return True + + +def starts_like_tls_record(d: bytes) -> bool: + """ + Returns: + True, if the passed bytes could be the start of a TLS record + False, otherwise. + """ + # TLS ClientHello magic, works for SSLv3, TLSv1.0, TLSv1.1, TLSv1.2, and TLSv1.3 + # http://www.moserware.com/2009/06/first-few-milliseconds-of-https.html#client-hello + # https://tls13.ulfheim.net/ + # We assume that a client sending less than 3 bytes initially is not a TLS client. + return len(d) > 2 and d[0] == 0x16 and d[1] == 0x03 and 0x00 <= d[2] <= 0x03 + + +def starts_like_dtls_record(d: bytes) -> bool: + """ + Returns: + True, if the passed bytes could be the start of a DTLS record + False, otherwise. + """ + # TLS ClientHello magic, works for DTLS 1.1, DTLS 1.2, and DTLS 1.3. + # https://www.rfc-editor.org/rfc/rfc4347#section-4.1 + # https://www.rfc-editor.org/rfc/rfc6347#section-4.1 + # https://www.rfc-editor.org/rfc/rfc9147#section-4-6.2 + # We assume that a client sending less than 3 bytes initially is not a DTLS client. + return len(d) > 2 and d[0] == 0x16 and d[1] == 0xFE and 0xFD <= d[2] <= 0xFE diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/platform/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f3660b18c6719df4bcc2250f800e3094b62d221 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/platform/__init__.py @@ -0,0 +1,40 @@ +import re +import socket +import sys +from collections.abc import Callable + + +def init_transparent_mode() -> None: + """ + Initialize transparent mode. + """ + + +original_addr: Callable[[socket.socket], tuple[str, int]] | None +""" +Get the original destination for the given socket. +This function will be None if transparent mode is not supported. +""" + +if re.match(r"linux(?:2)?", sys.platform): + from . import linux + + original_addr = linux.original_addr +elif sys.platform == "darwin" or sys.platform.startswith("freebsd"): + from . import osx + + original_addr = osx.original_addr +elif sys.platform.startswith("openbsd"): + from . import openbsd + + original_addr = openbsd.original_addr +elif sys.platform == "win32": + from . import windows + + resolver = windows.Resolver() + init_transparent_mode = resolver.setup # noqa + original_addr = resolver.original_addr +else: + original_addr = None + +__all__ = ["original_addr", "init_transparent_mode"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28c52362c44c3130fd4573e02ed728ddd23d75b4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/linux.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/linux.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..878a5f8bf73b6da0c63ef13bcaf3703493cdf402 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/linux.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/openbsd.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/openbsd.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b18946a393b7d07aa07083a8456eb8ea7392a587 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/openbsd.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/osx.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/osx.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b0ab845bcda16f204bbb5bd9e9f5f34e6bbc632 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/osx.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/pf.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/pf.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59843975343bf0dceda874c9cfc7f93c7fad3670 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/pf.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/windows.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/windows.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..070d1452f9bbe2366391fcaf559ddcaf6923db8c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/platform/__pycache__/windows.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/linux.py b/python/user_packages/Python313/site-packages/mitmproxy/platform/linux.py new file mode 100644 index 0000000000000000000000000000000000000000..577021ac5d63b678462adf6240c89699d2b76ab1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/platform/linux.py @@ -0,0 +1,33 @@ +import socket +import struct + +# Python's socket module does not have these constants +SO_ORIGINAL_DST = 80 +SOL_IPV6 = 41 + + +def original_addr(csock: socket.socket) -> tuple[str, int]: + # Get the original destination on Linux. + # In theory, this can be done using the following syscalls: + # sock.getsockopt(socket.SOL_IP, SO_ORIGINAL_DST, 16) + # sock.getsockopt(SOL_IPV6, SO_ORIGINAL_DST, 28) + # + # In practice, it is a bit more complex: + # 1. We cannot rely on sock.family to decide which syscall to use because of IPv4-mapped + # IPv6 addresses. If sock.family is AF_INET6 while sock.getsockname() is ::ffff:127.0.0.1, + # we need to call the IPv4 version to get a result. + # 2. We can't just try the IPv4 syscall and then do IPv6 if that doesn't work, + # because doing the wrong syscall can apparently crash the whole Python runtime. + # As such, we use a heuristic to check which syscall to do. + is_ipv4 = "." in csock.getsockname()[0] # either 127.0.0.1 or ::ffff:127.0.0.1 + if is_ipv4: + # the struct returned here should only have 8 bytes, but invoking sock.getsockopt + # with buflen=8 doesn't work. + dst = csock.getsockopt(socket.SOL_IP, SO_ORIGINAL_DST, 16) + port, raw_ip = struct.unpack_from("!2xH4s", dst) + ip = socket.inet_ntop(socket.AF_INET, raw_ip) + else: + dst = csock.getsockopt(SOL_IPV6, SO_ORIGINAL_DST, 28) + port, raw_ip = struct.unpack_from("!2xH4x16s", dst) + ip = socket.inet_ntop(socket.AF_INET6, raw_ip) + return ip, port diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/openbsd.py b/python/user_packages/Python313/site-packages/mitmproxy/platform/openbsd.py new file mode 100644 index 0000000000000000000000000000000000000000..e8f5ff8ee89303708c380b6073a0cc05f4b79dbb --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/platform/openbsd.py @@ -0,0 +1,2 @@ +def original_addr(csock): + return csock.getsockname() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/osx.py b/python/user_packages/Python313/site-packages/mitmproxy/platform/osx.py new file mode 100644 index 0000000000000000000000000000000000000000..b2ed9068c36687c30900052b39e16c8650690607 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/platform/osx.py @@ -0,0 +1,39 @@ +import subprocess + +from . import pf + +""" + Doing this the "right" way by using DIOCNATLOOK on the pf device turns out + to be a pain. Apple has made a number of modifications to the data + structures returned, and compiling userspace tools to test and work with + this turns out to be a pain in the ass. Parsing pfctl output is short, + simple, and works. + + Note: Also Tested with FreeBSD 10 pkgng Python 2.7.x. + Should work almost exactly as on Mac OS X and except with some changes to + the output processing of pfctl (see pf.py). +""" + +STATECMD = ("sudo", "-n", "/sbin/pfctl", "-s", "state") + + +def original_addr(csock): + peer = csock.getpeername() + try: + stxt = subprocess.check_output(STATECMD, stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + if "sudo: a password is required" in e.output.decode(errors="replace"): + insufficient_priv = True + else: + raise RuntimeError("Error getting pfctl state: " + repr(e)) + else: + insufficient_priv = "sudo: a password is required" in stxt.decode( + errors="replace" + ) + + if insufficient_priv: + raise RuntimeError( + "Insufficient privileges to access pfctl. " + "See https://mitmproxy.org/docs/latest/howto-transparent/#macos for details." + ) + return pf.lookup(peer[0], peer[1], stxt) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/pf.py b/python/user_packages/Python313/site-packages/mitmproxy/platform/pf.py new file mode 100644 index 0000000000000000000000000000000000000000..baf674030f773f6f4dd937e1f4b0f7098a4dab7f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/platform/pf.py @@ -0,0 +1,42 @@ +import re +import sys + + +def lookup(address, port, s): + """ + Parse the pfctl state output s, to look up the destination host + matching the client (address, port). + + Returns an (address, port) tuple, or None. + """ + # We may get an ipv4-mapped ipv6 address here, e.g. ::ffff:127.0.0.1. + # Those still appear as "127.0.0.1" in the table, so we need to strip the prefix. + address = re.sub(r"^::ffff:(?=\d+.\d+.\d+.\d+$)", "", address) + s = s.decode() + + # ALL tcp 192.168.1.13:57474 -> 23.205.82.58:443 ESTABLISHED:ESTABLISHED + specv4 = f"{address}:{port}" + + # ALL tcp 2a01:e35:8bae:50f0:9d9b:ef0d:2de3:b733[58505] -> 2606:4700:30::681f:4ad0[443] ESTABLISHED:ESTABLISHED + specv6 = f"{address}[{port}]" + + for i in s.split("\n"): + if "ESTABLISHED:ESTABLISHED" in i and specv4 in i: + s = i.split() + if len(s) > 4: + if sys.platform.startswith("freebsd"): + # strip parentheses for FreeBSD pfctl + s = s[3][1:-1].split(":") + else: + s = s[4].split(":") + + if len(s) == 2: + return s[0], int(s[1]) + elif "ESTABLISHED:ESTABLISHED" in i and specv6 in i: + s = i.split() + if len(s) > 4: + s = s[4].split("[") + port = s[1].split("]") + port = port[0] + return s[0], int(port) + raise RuntimeError("Could not resolve original destination.") diff --git a/python/user_packages/Python313/site-packages/mitmproxy/platform/windows.py b/python/user_packages/Python313/site-packages/mitmproxy/platform/windows.py new file mode 100644 index 0000000000000000000000000000000000000000..2f34a29cd3bd5ed6796a8fc48e8badce711c3bae --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/platform/windows.py @@ -0,0 +1,599 @@ +from __future__ import annotations + +import collections.abc +import contextlib +import ctypes.wintypes +import json +import logging +import os +import re +import socket +import socketserver +import threading +import time +from collections.abc import Callable +from io import BufferedIOBase +from typing import Any +from typing import cast +from typing import ClassVar + +import pydivert.consts + +from mitmproxy.net.local_ip import get_local_ip +from mitmproxy.net.local_ip import get_local_ip6 + +REDIRECT_API_HOST = "127.0.0.1" +REDIRECT_API_PORT = 8085 + + +logger = logging.getLogger(__name__) + + +########################## +# Resolver + + +def read(rfile: BufferedIOBase) -> Any: + x = rfile.readline().strip() + if not x: + return None + return json.loads(x) + + +def write(data, wfile: BufferedIOBase) -> None: + wfile.write(json.dumps(data).encode() + b"\n") + wfile.flush() + + +class Resolver: + sock: socket.socket | None + lock: threading.RLock + + def __init__(self): + self.sock = None + self.lock = threading.RLock() + + def setup(self): + with self.lock: + TransparentProxy.setup() + self._connect() + + def _connect(self): + if self.sock: + self.sock.close() + self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.sock.connect((REDIRECT_API_HOST, REDIRECT_API_PORT)) + + self.wfile = self.sock.makefile("wb") + self.rfile = self.sock.makefile("rb") + write(os.getpid(), self.wfile) + + def original_addr(self, csock: socket.socket): + ip, port = csock.getpeername()[:2] + ip = re.sub(r"^::ffff:(?=\d+.\d+.\d+.\d+$)", "", ip) + ip = ip.split("%", 1)[0] + with self.lock: + try: + write((ip, port), self.wfile) + addr = read(self.rfile) + if addr is None: + raise RuntimeError("Cannot resolve original destination.") + return tuple(addr) + except (EOFError, OSError, AttributeError): + self._connect() + return self.original_addr(csock) + + +class APIRequestHandler(socketserver.StreamRequestHandler): + """ + TransparentProxy API: Returns the pickled server address, port tuple + for each received pickled client address, port tuple. + """ + + server: APIServer + + def handle(self) -> None: + proxifier: TransparentProxy = self.server.proxifier + try: + pid: int = read(self.rfile) + if pid is None: + return + with proxifier.exempt(pid): + while True: + c = read(self.rfile) + if c is None: + return + try: + server = proxifier.client_server_map[ + cast(tuple[str, int], tuple(c)) + ] + except KeyError: + server = None + write(server, self.wfile) + except (EOFError, OSError): + pass + + +class APIServer(socketserver.ThreadingMixIn, socketserver.TCPServer): + def __init__(self, proxifier, *args, **kwargs): + super().__init__(*args, **kwargs) + self.proxifier = proxifier + self.daemon_threads = True + + +########################## +# Windows API + +# from Windows' error.h +ERROR_INSUFFICIENT_BUFFER = 0x7A + +IN6_ADDR = ctypes.c_ubyte * 16 +IN4_ADDR = ctypes.c_ubyte * 4 + + +# +# IPv6 +# + + +# https://msdn.microsoft.com/en-us/library/windows/desktop/aa366896(v=vs.85).aspx +class MIB_TCP6ROW_OWNER_PID(ctypes.Structure): + _fields_ = [ + ("ucLocalAddr", IN6_ADDR), + ("dwLocalScopeId", ctypes.wintypes.DWORD), + ("dwLocalPort", ctypes.wintypes.DWORD), + ("ucRemoteAddr", IN6_ADDR), + ("dwRemoteScopeId", ctypes.wintypes.DWORD), + ("dwRemotePort", ctypes.wintypes.DWORD), + ("dwState", ctypes.wintypes.DWORD), + ("dwOwningPid", ctypes.wintypes.DWORD), + ] + + +# https://msdn.microsoft.com/en-us/library/windows/desktop/aa366905(v=vs.85).aspx +def MIB_TCP6TABLE_OWNER_PID(size): + class _MIB_TCP6TABLE_OWNER_PID(ctypes.Structure): + _fields_ = [ + ("dwNumEntries", ctypes.wintypes.DWORD), + ("table", MIB_TCP6ROW_OWNER_PID * size), + ] + + return _MIB_TCP6TABLE_OWNER_PID() + + +# +# IPv4 +# + + +# https://msdn.microsoft.com/en-us/library/windows/desktop/aa366913(v=vs.85).aspx +class MIB_TCPROW_OWNER_PID(ctypes.Structure): + _fields_ = [ + ("dwState", ctypes.wintypes.DWORD), + ("ucLocalAddr", IN4_ADDR), + ("dwLocalPort", ctypes.wintypes.DWORD), + ("ucRemoteAddr", IN4_ADDR), + ("dwRemotePort", ctypes.wintypes.DWORD), + ("dwOwningPid", ctypes.wintypes.DWORD), + ] + + +# https://msdn.microsoft.com/en-us/library/windows/desktop/aa366921(v=vs.85).aspx +def MIB_TCPTABLE_OWNER_PID(size): + class _MIB_TCPTABLE_OWNER_PID(ctypes.Structure): + _fields_ = [ + ("dwNumEntries", ctypes.wintypes.DWORD), + ("table", MIB_TCPROW_OWNER_PID * size), + ] + + return _MIB_TCPTABLE_OWNER_PID() + + +TCP_TABLE_OWNER_PID_CONNECTIONS = 4 + + +class TcpConnectionTable(collections.abc.Mapping): + DEFAULT_TABLE_SIZE = 4096 + + def __init__(self): + self._tcp = MIB_TCPTABLE_OWNER_PID(self.DEFAULT_TABLE_SIZE) + self._tcp_size = ctypes.wintypes.DWORD(self.DEFAULT_TABLE_SIZE) + self._tcp6 = MIB_TCP6TABLE_OWNER_PID(self.DEFAULT_TABLE_SIZE) + self._tcp6_size = ctypes.wintypes.DWORD(self.DEFAULT_TABLE_SIZE) + self._map = {} + + def __getitem__(self, item): + return self._map[item] + + def __iter__(self): + return self._map.__iter__() + + def __len__(self): + return self._map.__len__() + + def refresh(self): + self._map = {} + self._refresh_ipv4() + self._refresh_ipv6() + + def _refresh_ipv4(self): + ret = ctypes.windll.iphlpapi.GetExtendedTcpTable( # type: ignore + ctypes.byref(self._tcp), + ctypes.byref(self._tcp_size), + False, + socket.AF_INET, + TCP_TABLE_OWNER_PID_CONNECTIONS, + 0, + ) + if ret == 0: + for row in self._tcp.table[: self._tcp.dwNumEntries]: + local_ip = socket.inet_ntop(socket.AF_INET, bytes(row.ucLocalAddr)) + local_port = socket.htons(row.dwLocalPort) + self._map[(local_ip, local_port)] = row.dwOwningPid + elif ret == ERROR_INSUFFICIENT_BUFFER: + self._tcp = MIB_TCPTABLE_OWNER_PID(self._tcp_size.value) + # no need to update size, that's already done. + self._refresh_ipv4() + else: + raise RuntimeError( + "[IPv4] Unknown GetExtendedTcpTable return code: %s" % ret + ) + + def _refresh_ipv6(self): + ret = ctypes.windll.iphlpapi.GetExtendedTcpTable( # type: ignore + ctypes.byref(self._tcp6), + ctypes.byref(self._tcp6_size), + False, + socket.AF_INET6, + TCP_TABLE_OWNER_PID_CONNECTIONS, + 0, + ) + if ret == 0: + for row in self._tcp6.table[: self._tcp6.dwNumEntries]: + local_ip = socket.inet_ntop(socket.AF_INET6, bytes(row.ucLocalAddr)) + local_port = socket.htons(row.dwLocalPort) + self._map[(local_ip, local_port)] = row.dwOwningPid + elif ret == ERROR_INSUFFICIENT_BUFFER: + self._tcp6 = MIB_TCP6TABLE_OWNER_PID(self._tcp6_size.value) + # no need to update size, that's already done. + self._refresh_ipv6() + else: + raise RuntimeError( + "[IPv6] Unknown GetExtendedTcpTable return code: %s" % ret + ) + + +class Redirect(threading.Thread): + daemon = True + windivert: pydivert.WinDivert + + def __init__( + self, + handle: Callable[[pydivert.Packet], None], + filter: str, + layer: pydivert.Layer = pydivert.Layer.NETWORK, + flags: pydivert.Flag = 0, + ) -> None: + self.handle = handle + self.windivert = pydivert.WinDivert(filter, layer, flags=flags) + super().__init__() + + def start(self): + self.windivert.open() + super().start() + + def run(self): + while True: + try: + packet = self.windivert.recv() + except OSError as e: + if getattr(e, "winerror", None) == 995: + return + else: + raise + else: + self.handle(packet) + + def shutdown(self): + self.windivert.close() + + def recv(self) -> pydivert.Packet | None: + """ + Convenience function that receives a packet from the passed handler and handles error codes. + If the process has been shut down, None is returned. + """ + try: + return self.windivert.recv() + except OSError as e: + if e.winerror == 995: # type: ignore + return None + else: + raise + + +class RedirectLocal(Redirect): + trusted_pids: set[int] + + def __init__( + self, redirect_request: Callable[[pydivert.Packet], None], filter: str + ) -> None: + self.tcp_connections = TcpConnectionTable() + self.trusted_pids = set() + self.redirect_request = redirect_request + super().__init__(self.handle, filter) + + def handle(self, packet): + client = (packet.src_addr, packet.src_port) + + if client not in self.tcp_connections: + self.tcp_connections.refresh() + + # If this fails, we most likely have a connection from an external client. + # In this, case we always want to proxy the request. + pid = self.tcp_connections.get(client, None) + + if pid not in self.trusted_pids: + self.redirect_request(packet) + else: + # It's not really clear why we need to recalculate the checksum here, + # but this was identified as necessary in https://github.com/mitmproxy/mitmproxy/pull/3174. + self.windivert.send(packet, recalculate_checksum=True) + + +TConnection = tuple[str, int] + + +class ClientServerMap: + """A thread-safe LRU dict.""" + + connection_cache_size: ClassVar[int] = 65536 + + def __init__(self): + self._lock = threading.Lock() + self._map = collections.OrderedDict() + + def __getitem__(self, item: TConnection) -> TConnection: + with self._lock: + return self._map[item] + + def __setitem__(self, key: TConnection, value: TConnection) -> None: + with self._lock: + self._map[key] = value + self._map.move_to_end(key) + while len(self._map) > self.connection_cache_size: + self._map.popitem(False) + + +class TransparentProxy: + """ + Transparent Windows Proxy for mitmproxy based on WinDivert/PyDivert. This module can be used to + redirect both traffic that is forwarded by the host and traffic originating from the host itself. + + Requires elevated (admin) privileges. Can be started separately by manually running the file. + + How it works: + + (1) First, we intercept all packages that match our filter. + We both consider traffic that is forwarded by the OS (WinDivert's NETWORK_FORWARD layer) as well + as traffic sent from the local machine (WinDivert's NETWORK layer). In the case of traffic from + the local machine, we need to exempt packets sent from the proxy to not create a redirect loop. + To accomplish this, we use Windows' GetExtendedTcpTable syscall and determine the source + application's PID. + + For each intercepted package, we + 1. Store the source -> destination mapping (address and port) + 2. Remove the package from the network (by not reinjecting it). + 3. Re-inject the package into the local network stack, but with the destination address + changed to the proxy. + + (2) Next, the proxy receives the forwarded packet, but does not know the real destination yet + (which we overwrote with the proxy's address). On Linux, we would now call + getsockopt(SO_ORIGINAL_DST). We now access the redirect module's API (see APIRequestHandler), + submit the source information and get the actual destination back (which we stored in 1.1). + + (3) The proxy now establishes the upstream connection as usual. + + (4) Finally, the proxy sends the response back to the client. To make it work, we need to change + the packet's source address back to the original destination (using the mapping from 1.1), + to which the client believes it is talking to. + + Limitations: + + - We assume that ephemeral TCP ports are not re-used for multiple connections at the same time. + The proxy will fail if an application connects to example.com and example.org from + 192.168.0.42:4242 simultaneously. This could be mitigated by introducing unique "meta-addresses" + which mitmproxy sees, but this would remove the correct client info from mitmproxy. + """ + + local: RedirectLocal | None = None + # really weird linting error here. + forward: Redirect | None = None + response: Redirect + icmp: Redirect + + proxy_port: int + filter: str + + client_server_map: ClientServerMap + + def __init__( + self, + local: bool = True, + forward: bool = True, + proxy_port: int = 8080, + filter: str | None = "tcp.DstPort == 80 or tcp.DstPort == 443", + ) -> None: + self.proxy_port = proxy_port + self.filter = ( + filter + or f"tcp.DstPort != {proxy_port} and tcp.DstPort != {REDIRECT_API_PORT} and tcp.DstPort < 49152" + ) + + self.ipv4_address = get_local_ip() + self.ipv6_address = get_local_ip6() + # print(f"IPv4: {self.ipv4_address}, IPv6: {self.ipv6_address}") + self.client_server_map = ClientServerMap() + + self.api = APIServer( + self, (REDIRECT_API_HOST, REDIRECT_API_PORT), APIRequestHandler + ) + self.api_thread = threading.Thread(target=self.api.serve_forever) + self.api_thread.daemon = True + + if forward: + self.forward = Redirect( + self.redirect_request, self.filter, pydivert.Layer.NETWORK_FORWARD + ) + if local: + self.local = RedirectLocal(self.redirect_request, self.filter) + + # The proxy server responds to the client. To the client, + # this response should look like it has been sent by the real target + self.response = Redirect( + self.redirect_response, + f"outbound and tcp.SrcPort == {proxy_port}", + ) + + # Block all ICMP requests (which are sent on Windows by default). + # If we don't do this, our proxy machine may send an ICMP redirect to the client, + # which instructs the client to directly connect to the real gateway + # if they are on the same network. + self.icmp = Redirect(lambda _: None, "icmp", flags=pydivert.Flag.DROP) + + @classmethod + def setup(cls): + # TODO: Make sure that server can be killed cleanly. That's a bit difficult as we don't have access to + # controller.should_exit when this is called. + logger.warning( + "Transparent mode on Windows is unsupported, flaky, and deprecated. " + "Consider using local redirect mode or WireGuard mode instead." + ) + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + server_unavailable = s.connect_ex((REDIRECT_API_HOST, REDIRECT_API_PORT)) + if server_unavailable: + proxifier = TransparentProxy() + proxifier.start() + + def start(self): + self.api_thread.start() + self.icmp.start() + self.response.start() + if self.forward: + self.forward.start() + if self.local: + self.local.start() + + def shutdown(self): + if self.local: + self.local.shutdown() + if self.forward: + self.forward.shutdown() + self.response.shutdown() + self.icmp.shutdown() + self.api.shutdown() + + def redirect_request(self, packet: pydivert.Packet): + # print(" * Redirect client -> server to proxy") + # print(f"{packet.src_addr}:{packet.src_port} -> {packet.dst_addr}:{packet.dst_port}") + client = (packet.src_addr, packet.src_port) + + self.client_server_map[client] = (packet.dst_addr, packet.dst_port) + + # We do need to inject to an external IP here, 127.0.0.1 does not work. + if packet.address_family == socket.AF_INET: + assert self.ipv4_address + packet.dst_addr = self.ipv4_address + elif packet.address_family == socket.AF_INET6: + if not self.ipv6_address: + self.ipv6_address = get_local_ip6(packet.src_addr) + assert self.ipv6_address + packet.dst_addr = self.ipv6_address + else: + raise RuntimeError("Unknown address family") + packet.dst_port = self.proxy_port + packet.direction = pydivert.consts.Direction.INBOUND + + # We need a handle on the NETWORK layer. the local handle is not guaranteed to exist, + # so we use the response handle. + self.response.windivert.send(packet) + + def redirect_response(self, packet: pydivert.Packet): + """ + If the proxy responds to the client, let the client believe the target server sent the + packets. + """ + # print(" * Adjust proxy -> client") + client = (packet.dst_addr, packet.dst_port) + try: + packet.src_addr, packet.src_port = self.client_server_map[client] + except KeyError: + print(f"Warning: Previously unseen connection from proxy to {client}") + else: + packet.recalculate_checksums() + + self.response.windivert.send(packet, recalculate_checksum=False) + + @contextlib.contextmanager + def exempt(self, pid: int): + if self.local: + self.local.trusted_pids.add(pid) + try: + yield + finally: + if self.local: + self.local.trusted_pids.remove(pid) + + +if __name__ == "__main__": + import click + + @click.group() + def cli(): + pass + + @cli.command() + @click.option( + "--local/--no-local", default=True, help="Redirect the host's own traffic." + ) + @click.option( + "--forward/--no-forward", + default=True, + help="Redirect traffic that's forwarded by the host.", + ) + @click.option( + "--filter", + type=str, + metavar="WINDIVERT_FILTER", + help="Custom WinDivert interception rule.", + ) + @click.option( + "-p", + "--proxy-port", + type=int, + metavar="8080", + default=8080, + help="The port mitmproxy is listening on.", + ) + def redirect(**options): + """Redirect flows to mitmproxy.""" + proxy = TransparentProxy(**options) + proxy.start() + print(f" * Redirection active.") + print(f" Filter: {proxy.filter}") + try: + while True: + time.sleep(1) + except KeyboardInterrupt: + print(" * Shutting down...") + proxy.shutdown() + print(" * Shut down.") + + @cli.command() + def connections(): + """List all TCP connections and the associated PIDs.""" + connections = TcpConnectionTable() + connections.refresh() + for (ip, port), pid in connections.items(): + print(f"{ip}:{port} -> {pid}") + + cli() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a38937d805690e4ac2e25c063ea67078571a6b81 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__init__.py @@ -0,0 +1,20 @@ +""" +This module contains mitmproxy's core network proxy. + +The most important primitives are: + + - Layers: represent protocol layers, e.g. one for TCP, TLS, and so on. Layers are nested, so + a typical configuration might be ReverseProxy/TLS/TCP. + Most importantly, layers are implemented using the sans-io pattern (https://sans-io.readthedocs.io/). + This means that calls return immediately, there is no blocking sync or async code. + - Server: the proxy server handles all I/O. This is implemented using `asyncio`, but could be done any other way. + The `ConnectionHandler` is subclassed in the `Proxyserver` addon, which handles the communication with the + rest of mitmproxy. + - Events: When I/O actions occur at the proxy server, they are passed to the outermost layer as events, + e.g. `DataReceived` or `ConnectionClosed`. + - Commands: In the other direction, layers can emit commands to higher layers or the proxy server. + This is used to e.g. send data, request for new connections to be opened, or to call mitmproxy's + event hooks. + - Context: The context is the connection context each layer is provided with, which is always a client connection + and sometimes also a server connection. +""" diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ed295aa69a46ac924a6be41ac7522e36de91101 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/commands.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/commands.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64e4b6ed32f75a3fa753af961e8234adba7e8fde Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/commands.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/context.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/context.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7cd9d72464eb1cd02ff834d7c17f7defb35f0df Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/context.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/events.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/events.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..248c9327418d217c83737e46a726b23b4f5ae4d4 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/events.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/layer.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/layer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a02aca8a82e8f14e9dcbe6ee4dfb13611ae618b7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/layer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/mode_servers.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/mode_servers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dec1a0d48f99d61a13be4e71dc4df96a7e7d8dde Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/mode_servers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/mode_specs.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/mode_specs.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98f14147259387b6e9bf85d0ec7a04108923a1f1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/mode_specs.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/server.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/server.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f933dec19569593a7e4f0113f9e00d1e613f51e9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/server.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/server_hooks.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/server_hooks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5aa82f579a4061dd344418c62f896c5c1177040f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/server_hooks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/tunnel.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/tunnel.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e773de0576bac6655aef08ee15c4b42a2727a4c0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/tunnel.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/utils.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..400449d61efcdf3ee776e90d6233f50a73bebe7c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/__pycache__/utils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/commands.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/commands.py new file mode 100644 index 0000000000000000000000000000000000000000..f191f9f7b40c2d3e9befa2eb2bd70f540809014e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/commands.py @@ -0,0 +1,159 @@ +""" +Commands make it possible for layers to communicate with the "outer world", +e.g. to perform IO or to ask the master. +A command is issued by a proxy layer and is then passed upwards to the proxy server, and from there +possibly to the master and addons. + +The counterpart to commands are events. +""" + +import logging +import warnings +from typing import TYPE_CHECKING +from typing import Union + +import mitmproxy.hooks +from mitmproxy.connection import Connection +from mitmproxy.connection import Server + +if TYPE_CHECKING: + import mitmproxy.proxy.layer + + +class Command: + """ + Base class for all commands + """ + + blocking: Union[bool, "mitmproxy.proxy.layer.Layer"] = False + """ + Determines if the command blocks until it has been completed. + For practical purposes, this attribute should be thought of as a boolean value, + layers may swap out `True` with a reference to themselves to signal to outer layers + that they do not need to block as well. + + Example: + + reply = yield Hook("requestheaders", flow) # blocking command + yield Log("hello world", "info") # non-blocking + """ + + def __repr__(self): + x = self.__dict__.copy() + x.pop("blocking", None) + return f"{type(self).__name__}({x!r})" + + +class RequestWakeup(Command): + """ + Request a `Wakeup` event after the specified amount of seconds. + """ + + delay: float + + def __init__(self, delay: float): + self.delay = delay + + +class ConnectionCommand(Command): + """ + Commands involving a specific connection + """ + + connection: Connection + + def __init__(self, connection: Connection): + self.connection = connection + + +class SendData(ConnectionCommand): + """ + Send data to a remote peer + """ + + data: bytes + + def __init__(self, connection: Connection, data: bytes): + super().__init__(connection) + self.data = data + + def __repr__(self): + target = str(self.connection).split("(", 1)[0].lower() + return f"SendData({target}, {self.data!r})" + + +class OpenConnection(ConnectionCommand): + """ + Open a new connection + """ + + connection: Server + blocking = True + + +class CloseConnection(ConnectionCommand): + """ + Close a connection. If the client connection is closed, + all other connections will ultimately be closed during cleanup. + """ + + +class CloseTcpConnection(CloseConnection): + half_close: bool + """ + If True, only close our half of the connection by sending a FIN packet. + This is required from some protocols which close their end to signal completion and then continue reading, + for example HTTP/1.0 without Content-Length header. + """ + + def __init__(self, connection: Connection, half_close: bool = False): + super().__init__(connection) + self.half_close = half_close + + +class StartHook(Command, mitmproxy.hooks.Hook): + """ + Start an event hook in the mitmproxy core. + This triggers a particular function (derived from the class name) in all addons. + """ + + name = "" + blocking = True + + def __new__(cls, *args, **kwargs): + if cls is StartHook: + raise TypeError("StartHook may not be instantiated directly.") + return super().__new__(cls, *args, **kwargs) + + +class Log(Command): + """ + Log a message. + + Layers could technically call `logging.log` directly, but the use of a command allows us to + write more expressive playbook tests. Put differently, by using commands we can assert that + a specific log message is a direct consequence of a particular I/O event. + This could also be implemented with some more playbook magic in the future, + but for now we keep the current approach as the fully sans-io one. + """ + + message: str + level: int + + def __init__( + self, + message: str, + level: int = logging.INFO, + ): + if isinstance(level, str): # pragma: no cover + warnings.warn( + "commands.Log() now expects an integer log level, not a string.", + DeprecationWarning, + stacklevel=2, + ) + level = getattr(logging, level.upper()) + self.message = message + self.level = level + + def __repr__(self): + return f"Log({self.message!r}, {logging.getLevelName(self.level).lower()})" diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/context.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/context.py new file mode 100644 index 0000000000000000000000000000000000000000..29987418fcc7266e87224235032e8a8065f29cb2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/context.py @@ -0,0 +1,58 @@ +from typing import TYPE_CHECKING + +from mitmproxy import connection +from mitmproxy.options import Options + +if TYPE_CHECKING: + import mitmproxy.proxy.layer + + +class Context: + """ + The context object provided to each protocol layer in the proxy core. + """ + + client: connection.Client + """The client connection.""" + server: connection.Server + """ + The server connection. + + For practical reasons this attribute is always set, even if there is not server connection yet. + In this case the server address is `None`. + """ + options: Options + """ + Provides access to options for proxy layers. Not intended for use by addons, use `mitmproxy.ctx.options` instead. + """ + layers: list["mitmproxy.proxy.layer.Layer"] + """ + The protocol layer stack. + """ + + def __init__( + self, + client: connection.Client, + options: Options, + ) -> None: + self.client = client + self.options = options + self.server = connection.Server( + address=None, transport_protocol=client.transport_protocol + ) + self.layers = [] + + def fork(self) -> "Context": + ret = Context(self.client, self.options) + ret.server = self.server + ret.layers = self.layers.copy() + return ret + + def __repr__(self): + return ( + f"Context(\n" + f" {self.client!r},\n" + f" {self.server!r},\n" + f" layers=[{self.layers!r}]\n" + f")" + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/events.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/events.py new file mode 100644 index 0000000000000000000000000000000000000000..38c71c4229877955302c2381d7d9487633d5c870 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/events.py @@ -0,0 +1,138 @@ +""" +When IO actions occur at the proxy server, they are passed down to layers as events. +Events represent the only way for layers to receive new data from sockets. +The counterpart to events are commands. +""" + +import typing +import warnings +from dataclasses import dataclass +from dataclasses import is_dataclass +from typing import Any +from typing import Generic +from typing import TypeVar + +from mitmproxy import flow +from mitmproxy.connection import Connection +from mitmproxy.proxy import commands + + +class Event: + """ + Base class for all events. + """ + + def __repr__(self): + return f"{type(self).__name__}({self.__dict__!r})" + + +class Start(Event): + """ + Every layer initially receives a start event. + This is useful to emit events on startup. + """ + + +@dataclass +class ConnectionEvent(Event): + """ + All events involving connection IO. + """ + + connection: Connection + + +@dataclass +class DataReceived(ConnectionEvent): + """ + Remote has sent some data. + """ + + data: bytes + + def __repr__(self): + target = type(self.connection).__name__.lower() + return f"DataReceived({target}, {self.data!r})" + + +class ConnectionClosed(ConnectionEvent): + """ + Remote has closed a connection. + """ + + +class CommandCompleted(Event): + """ + Emitted when a command has been finished, e.g. + when the master has replied or when we have established a server connection. + """ + + command: commands.Command + reply: Any + + def __new__(cls, *args, **kwargs): + if cls is CommandCompleted: + raise TypeError("CommandCompleted may not be instantiated directly.") + assert is_dataclass(cls) + return super().__new__(cls) + + def __init_subclass__(cls, **kwargs): + command_cls = typing.get_type_hints(cls).get("command", None) + valid_command_subclass = ( + isinstance(command_cls, type) + and issubclass(command_cls, commands.Command) + and command_cls is not commands.Command + ) + if not valid_command_subclass: + warnings.warn( + f"{cls} needs a properly annotated command attribute.", + RuntimeWarning, + ) + if command_cls in command_reply_subclasses: + other = command_reply_subclasses[command_cls] + warnings.warn( + f"Two conflicting subclasses for {command_cls}: {cls} and {other}", + RuntimeWarning, + ) + command_reply_subclasses[command_cls] = cls # type: ignore + + def __repr__(self): + return f"Reply({self.command!r}, {self.reply!r})" + + +command_reply_subclasses: dict[commands.Command, type[CommandCompleted]] = {} + + +@dataclass(repr=False) +class OpenConnectionCompleted(CommandCompleted): + command: commands.OpenConnection + reply: str | None + """error message""" + + +@dataclass(repr=False) +class HookCompleted(CommandCompleted): + command: commands.StartHook + reply: None = None + + +T = TypeVar("T") + + +@dataclass +class MessageInjected(Event, Generic[T]): + """ + The user has injected a custom WebSocket/TCP/... message. + """ + + flow: flow.Flow + message: T + + +@dataclass +class Wakeup(CommandCompleted): + """ + Event sent to layers that requested a wakeup using RequestWakeup. + """ + + command: commands.RequestWakeup diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layer.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layer.py new file mode 100644 index 0000000000000000000000000000000000000000..ae0d8a02239268e5dc867d04bfd933246b217214 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layer.py @@ -0,0 +1,340 @@ +""" +Base class for protocol layers. +""" + +import collections +import textwrap +from abc import abstractmethod +from collections.abc import Callable +from collections.abc import Generator +from dataclasses import dataclass +from logging import DEBUG +from typing import Any +from typing import ClassVar +from typing import NamedTuple +from typing import TypeVar + +from mitmproxy.connection import Connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy.commands import Command +from mitmproxy.proxy.commands import StartHook +from mitmproxy.proxy.context import Context + +T = TypeVar("T") +CommandGenerator = Generator[Command, Any, T] +""" +A function annotated with CommandGenerator[bool] may yield commands and ultimately return a boolean value. +""" + + +MAX_LOG_STATEMENT_SIZE = 2048 +"""Maximum size of individual log statements before they will be truncated.""" + + +class Paused(NamedTuple): + """ + State of a layer that's paused because it is waiting for a command reply. + """ + + command: commands.Command + generator: CommandGenerator + + +class Layer: + """ + The base class for all protocol layers. + + Layers interface with their child layer(s) by calling .handle_event(event), + which returns a list (more precisely: a generator) of commands. + Most layers do not implement .directly, but instead implement ._handle_event, which + is called by the default implementation of .handle_event. + The default implementation of .handle_event allows layers to emulate blocking code: + When ._handle_event yields a command that has its blocking attribute set to True, .handle_event pauses + the execution of ._handle_event and waits until it is called with the corresponding CommandCompleted event. + All events encountered in the meantime are buffered and replayed after execution is resumed. + + The result is code that looks like blocking code, but is not blocking: + + def _handle_event(self, event): + err = yield OpenConnection(server) # execution continues here after a connection has been established. + + Technically this is very similar to how coroutines are implemented. + """ + + __last_debug_message: ClassVar[str] = "" + context: Context + _paused: Paused | None + """ + If execution is currently paused, this attribute stores the paused coroutine + and the command for which we are expecting a reply. + """ + _paused_event_queue: collections.deque[events.Event] + """ + All events that have occurred since execution was paused. + These will be replayed to ._child_layer once we resume. + """ + debug: str | None = None + """ + Enable debug logging by assigning a prefix string for log messages. + Different amounts of whitespace for different layers work well. + """ + + def __init__(self, context: Context) -> None: + self.context = context + self.context.layers.append(self) + self._paused = None + self._paused_event_queue = collections.deque() + + show_debug_output = getattr(context.options, "proxy_debug", False) + if show_debug_output: # pragma: no cover + self.debug = " " * len(context.layers) + + def __repr__(self): + statefun = getattr(self, "state", self._handle_event) + state = getattr(statefun, "__name__", "") + state = state.replace("state_", "") + if state == "_handle_event": + state = "" + else: + state = f"state: {state}" + return f"{type(self).__name__}({state})" + + def __debug(self, message): + """yield a Log command indicating what message is passing through this layer.""" + if len(message) > MAX_LOG_STATEMENT_SIZE: + message = message[:MAX_LOG_STATEMENT_SIZE] + "โ€ฆ" + if Layer.__last_debug_message == message: + message = message.split("\n", 1)[0].strip() + if len(message) > 256: + message = message[:256] + "โ€ฆ" + else: + Layer.__last_debug_message = message + assert self.debug is not None + return commands.Log(textwrap.indent(message, self.debug), DEBUG) + + @property + def stack_pos(self) -> str: + """repr() for this layer and all its parent layers, only useful for debugging.""" + try: + idx = self.context.layers.index(self) + except ValueError: + return repr(self) + else: + return " >> ".join(repr(x) for x in self.context.layers[: idx + 1]) + + @abstractmethod + def _handle_event(self, event: events.Event) -> CommandGenerator[None]: + """Handle a proxy server event""" + yield from () # pragma: no cover + + def handle_event(self, event: events.Event) -> CommandGenerator[None]: + if self._paused: + # did we just receive the reply we were waiting for? + pause_finished = ( + isinstance(event, events.CommandCompleted) + and event.command is self._paused.command + ) + if self.debug is not None: + yield self.__debug(f"{'>>' if pause_finished else '>!'} {event}") + if pause_finished: + assert isinstance(event, events.CommandCompleted) + yield from self.__continue(event) + else: + self._paused_event_queue.append(event) + else: + if self.debug is not None: + yield self.__debug(f">> {event}") + command_generator = self._handle_event(event) + send = None + + # inlined copy of __process to reduce call stack. + # <โœ‚โœ‚โœ‚> + try: + # Run ._handle_event to the next yield statement. + # If you are not familiar with generators and their .send() method, + # https://stackoverflow.com/a/12638313/934719 has a good explanation. + command = command_generator.send(send) + except StopIteration: + return + + while True: + if self.debug is not None: + if not isinstance(command, commands.Log): + yield self.__debug(f"<< {command}") + if command.blocking is True: + # We only want this layer to block, the outer layers should not block. + # For example, take an HTTP/2 connection: If we intercept one particular request, + # we don't want all other requests in the connection to be blocked a well. + # We signal to outer layers that this command is already handled by assigning our layer to + # `.blocking` here (upper layers explicitly check for `is True`). + command.blocking = self + self._paused = Paused( + command, + command_generator, + ) + yield command + return + else: + yield command + try: + command = next(command_generator) + except StopIteration: + return + # + + def __process(self, command_generator: CommandGenerator, send=None): + """ + Yield commands from a generator. + If a command is blocking, execution is paused and this function returns without + processing any further commands. + """ + try: + # Run ._handle_event to the next yield statement. + # If you are not familiar with generators and their .send() method, + # https://stackoverflow.com/a/12638313/934719 has a good explanation. + command = command_generator.send(send) + except StopIteration: + return + + while True: + if self.debug is not None: + if not isinstance(command, commands.Log): + yield self.__debug(f"<< {command}") + if command.blocking is True: + # We only want this layer to block, the outer layers should not block. + # For example, take an HTTP/2 connection: If we intercept one particular request, + # we don't want all other requests in the connection to be blocked a well. + # We signal to outer layers that this command is already handled by assigning our layer to + # `.blocking` here (upper layers explicitly check for `is True`). + command.blocking = self + self._paused = Paused( + command, + command_generator, + ) + yield command + return + else: + yield command + try: + command = next(command_generator) + except StopIteration: + return + + def __continue(self, event: events.CommandCompleted): + """ + Continue processing events after being paused. + The tricky part here is that events in the event queue may trigger commands which again pause the execution, + so we may not be able to process the entire queue. + """ + assert self._paused is not None + command_generator = self._paused.generator + self._paused = None + yield from self.__process(command_generator, event.reply) + + while not self._paused and self._paused_event_queue: + ev = self._paused_event_queue.popleft() + if self.debug is not None: + yield self.__debug(f"!> {ev}") + command_generator = self._handle_event(ev) + yield from self.__process(command_generator) + + +mevents = ( + events # alias here because autocomplete above should not have aliased version. +) + + +class NextLayer(Layer): + layer: Layer | None + """The next layer. To be set by an addon.""" + + events: list[mevents.Event] + """All events that happened before a decision was made.""" + + _ask_on_start: bool + + def __init__(self, context: Context, ask_on_start: bool = False) -> None: + super().__init__(context) + self.context.layers.remove(self) + self.layer = None + self.events = [] + self._ask_on_start = ask_on_start + self._handle: Callable[[mevents.Event], CommandGenerator[None]] | None = None + + def __repr__(self): + return f"NextLayer:{self.layer!r}" + + def handle_event(self, event: mevents.Event): + if self._handle is not None: + yield from self._handle(event) + else: + yield from super().handle_event(event) + + def _handle_event(self, event: mevents.Event): + self.events.append(event) + + # We receive new data. Let's find out if we can determine the next layer now? + if self._ask_on_start and isinstance(event, events.Start): + yield from self._ask() + elif ( + isinstance(event, mevents.ConnectionClosed) + and event.connection == self.context.client + ): + # If we have not determined the next protocol yet and the client already closes the connection, + # we abort everything. + yield commands.CloseConnection(self.context.client) + elif isinstance(event, mevents.DataReceived): + # For now, we only ask if we have received new data to reduce hook noise. + yield from self._ask() + + def _ask(self): + """ + Manually trigger a next_layer hook. + The only use at the moment is to make sure that the top layer is initialized. + """ + yield NextLayerHook(self) + + # Has an addon decided on the next layer yet? + if self.layer: + if self.debug: + yield commands.Log(f"{self.debug}[nextlayer] {self.layer!r}", DEBUG) + for e in self.events: + yield from self.layer.handle_event(e) + self.events.clear() + + # Why do we need three assignments here? + # 1. When this function here is invoked we may have paused events. Those should be + # forwarded to the sublayer right away, so we reassign ._handle_event. + # 2. This layer is not needed anymore, so we directly reassign .handle_event. + # 3. Some layers may however still have a reference to the old .handle_event. + # ._handle is just an optimization to reduce the callstack in these cases. + self.handle_event = self.layer.handle_event # type: ignore + self._handle_event = self.layer.handle_event # type: ignore + self._handle = self.layer.handle_event + + # Utility methods for whoever decides what the next layer is going to be. + def data_client(self): + return self._data(self.context.client) + + def data_server(self): + return self._data(self.context.server) + + def _data(self, connection: Connection): + data = ( + e.data + for e in self.events + if isinstance(e, mevents.DataReceived) and e.connection == connection + ) + return b"".join(data) + + +@dataclass +class NextLayerHook(StartHook): + """ + Network layers are being switched. You may change which layer will be used by setting data.layer. + + (by default, this is done by mitmproxy.addons.NextLayer) + """ + + data: NextLayer diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e21ba60e084ea424f39872802b91b73074d21a71 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__init__.py @@ -0,0 +1,27 @@ +from . import modes +from .dns import DNSLayer +from .http import HttpLayer +from .quic import ClientQuicLayer +from .quic import QuicStreamLayer +from .quic import RawQuicLayer +from .quic import ServerQuicLayer +from .tcp import TCPLayer +from .tls import ClientTLSLayer +from .tls import ServerTLSLayer +from .udp import UDPLayer +from .websocket import WebsocketLayer + +__all__ = [ + "modes", + "DNSLayer", + "HttpLayer", + "QuicStreamLayer", + "RawQuicLayer", + "TCPLayer", + "UDPLayer", + "ClientQuicLayer", + "ClientTLSLayer", + "ServerQuicLayer", + "ServerTLSLayer", + "WebsocketLayer", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7557489b15f7d223390d78f42e341a2c9b04c4ad Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/dns.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/dns.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bb602d230efc2faad7a698b50baa0bd6614b9bb Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/dns.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/modes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/modes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2adfd0bfc44d8b4410e98b90841f10c42d00bac Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/modes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/tcp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/tcp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1d37ef33aefa7f2d42b32ac9bcb3ac8fc0ec451 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/tcp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/tls.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/tls.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d4e6cf60cec58d96c351b83d374e417b562bdfd Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/tls.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/udp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/udp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d473becd96d7d5183cfc6739b1beac461eec799 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/udp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/websocket.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/websocket.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32f15534c8804e98817fd125430493ab041c4695 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/__pycache__/websocket.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/dns.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/dns.py new file mode 100644 index 0000000000000000000000000000000000000000..48e1a66a1c23d76821fb7d4e1b57d3b8b70e644a --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/dns.py @@ -0,0 +1,190 @@ +import struct +import time +from dataclasses import dataclass +from typing import List +from typing import Literal + +from mitmproxy import dns +from mitmproxy import flow as mflow +from mitmproxy.net.dns import response_codes +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.context import Context +from mitmproxy.proxy.utils import expect + +_LENGTH_LABEL = struct.Struct("!H") + + +@dataclass +class DnsRequestHook(commands.StartHook): + """ + A DNS query has been received. + """ + + flow: dns.DNSFlow + + +@dataclass +class DnsResponseHook(commands.StartHook): + """ + A DNS response has been received or set. + """ + + flow: dns.DNSFlow + + +@dataclass +class DnsErrorHook(commands.StartHook): + """ + A DNS error has occurred. + """ + + flow: dns.DNSFlow + + +def pack_message( + message: dns.DNSMessage, transport_protocol: Literal["tcp", "udp"] +) -> bytes: + packed = message.packed + if transport_protocol == "tcp": + return struct.pack("!H", len(packed)) + packed + else: + return packed + + +class DNSLayer(layer.Layer): + """ + Layer that handles resolving DNS queries. + """ + + flows: dict[int, dns.DNSFlow] + req_buf: bytearray + resp_buf: bytearray + + def __init__(self, context: Context): + super().__init__(context) + self.flows = {} + self.req_buf = bytearray() + self.resp_buf = bytearray() + + def handle_request( + self, flow: dns.DNSFlow, msg: dns.DNSMessage + ) -> layer.CommandGenerator[None]: + flow.request = msg # if already set, continue and query upstream again + yield DnsRequestHook(flow) + if flow.response: + yield from self.handle_response(flow, flow.response) + elif flow.error: + yield from self.handle_error(flow, flow.error.msg) + elif not self.context.server.address: + yield from self.handle_error( + flow, "No hook has set a response and there is no upstream server." + ) + else: + if not self.context.server.connected: + err = yield commands.OpenConnection(self.context.server) + if err: + yield from self.handle_error(flow, str(err)) + # cannot recover from this + return + packed = pack_message(flow.request, flow.server_conn.transport_protocol) + yield commands.SendData(self.context.server, packed) + + def handle_response( + self, flow: dns.DNSFlow, msg: dns.DNSMessage + ) -> layer.CommandGenerator[None]: + flow.response = msg + yield DnsResponseHook(flow) + if flow.response: + packed = pack_message(flow.response, flow.client_conn.transport_protocol) + yield commands.SendData(self.context.client, packed) + + def handle_error(self, flow: dns.DNSFlow, err: str) -> layer.CommandGenerator[None]: + flow.error = mflow.Error(err) + yield DnsErrorHook(flow) + servfail = flow.request.fail(response_codes.SERVFAIL) + yield commands.SendData( + self.context.client, + pack_message(servfail, flow.client_conn.transport_protocol), + ) + + def unpack_message(self, data: bytes, from_client: bool) -> List[dns.DNSMessage]: + msgs: List[dns.DNSMessage] = [] + + buf = self.req_buf if from_client else self.resp_buf + + if self.context.client.transport_protocol == "udp": + msgs.append(dns.DNSMessage.unpack(data, timestamp=time.time())) + elif self.context.client.transport_protocol == "tcp": + buf.extend(data) + size = len(buf) + offset = 0 + + while True: + if size - offset < _LENGTH_LABEL.size: + break + (expected_size,) = _LENGTH_LABEL.unpack_from(buf, offset) + offset += _LENGTH_LABEL.size + if expected_size == 0: + raise struct.error("Message length field cannot be zero") + + if size - offset < expected_size: + offset -= _LENGTH_LABEL.size + break + + data = bytes(buf[offset : expected_size + offset]) + offset += expected_size + msgs.append(dns.DNSMessage.unpack(data, timestamp=time.time())) + + del buf[:offset] + return msgs + + @expect(events.Start) + def state_start(self, _) -> layer.CommandGenerator[None]: + self._handle_event = self.state_query + yield from () + + @expect(events.DataReceived, events.ConnectionClosed) + def state_query(self, event: events.Event) -> layer.CommandGenerator[None]: + assert isinstance(event, events.ConnectionEvent) + from_client = event.connection is self.context.client + + if isinstance(event, events.DataReceived): + msgs: List[dns.DNSMessage] = [] + try: + msgs = self.unpack_message(event.data, from_client) + except struct.error as e: + yield commands.Log(f"{event.connection} sent an invalid message: {e}") + yield commands.CloseConnection(event.connection) + self._handle_event = self.state_done + else: + for msg in msgs: + try: + flow = self.flows[msg.id] + except KeyError: + flow = dns.DNSFlow( + self.context.client, self.context.server, live=True + ) + self.flows[msg.id] = flow + if from_client: + yield from self.handle_request(flow, msg) + else: + yield from self.handle_response(flow, msg) + + elif isinstance(event, events.ConnectionClosed): + other_conn = self.context.server if from_client else self.context.client + if other_conn.connected: + yield commands.CloseConnection(other_conn) + self._handle_event = self.state_done + for flow in self.flows.values(): + flow.live = False + + else: + raise AssertionError(f"Unexpected event: {event}") + + @expect(events.DataReceived, events.ConnectionClosed) + def state_done(self, _) -> layer.CommandGenerator[None]: + yield from () + + _handle_event = state_start diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9b91f242b9578e1048328cccd1a0b24a1914b22 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__init__.py @@ -0,0 +1,1210 @@ +import collections +import enum +import time +from dataclasses import dataclass +from functools import cached_property +from logging import DEBUG +from logging import WARNING + +import wsproto.handshake + +from ...context import Context +from ...mode_specs import ReverseMode +from ...mode_specs import UpstreamMode +from ..quic import QuicStreamEvent +from ._base import HttpCommand +from ._base import HttpConnection +from ._base import ReceiveHttp +from ._base import StreamId +from ._events import ErrorCode +from ._events import HttpEvent +from ._events import RequestData +from ._events import RequestEndOfMessage +from ._events import RequestHeaders +from ._events import RequestProtocolError +from ._events import RequestTrailers +from ._events import ResponseData +from ._events import ResponseEndOfMessage +from ._events import ResponseHeaders +from ._events import ResponseProtocolError +from ._events import ResponseTrailers +from ._hooks import HttpConnectedHook +from ._hooks import HttpConnectErrorHook +from ._hooks import HttpConnectHook +from ._hooks import HttpErrorHook +from ._hooks import HttpRequestHeadersHook +from ._hooks import HttpRequestHook +from ._hooks import HttpResponseHeadersHook +from ._hooks import HttpResponseHook +from ._http1 import Http1Client +from ._http1 import Http1Connection +from ._http1 import Http1Server +from ._http2 import Http2Client +from ._http2 import Http2Server +from ._http3 import Http3Client +from ._http3 import Http3Server +from mitmproxy import flow +from mitmproxy import http +from mitmproxy.connection import Connection +from mitmproxy.connection import Server +from mitmproxy.connection import TransportProtocol +from mitmproxy.net import server_spec +from mitmproxy.net.http import url +from mitmproxy.net.http.http1 import expected_http_body_size +from mitmproxy.net.http.validate import validate_headers +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy import tunnel +from mitmproxy.proxy.layers import quic +from mitmproxy.proxy.layers import tcp +from mitmproxy.proxy.layers import tls +from mitmproxy.proxy.layers import websocket +from mitmproxy.proxy.layers.http import _upstream_proxy +from mitmproxy.proxy.utils import expect +from mitmproxy.proxy.utils import ReceiveBuffer +from mitmproxy.utils import human +from mitmproxy.websocket import WebSocketData + + +class HTTPMode(enum.Enum): + regular = 1 + transparent = 2 + upstream = 3 + + +def validate_request( + mode: HTTPMode, request: http.Request, validate_inbound_headers: bool +) -> str | None: + if request.scheme not in ("http", "https", ""): + return f"Invalid request scheme: {request.scheme}" + if mode is HTTPMode.transparent and request.method == "CONNECT": + return ( + f"mitmproxy received an HTTP CONNECT request even though it is not running in regular/upstream mode. " + f"This usually indicates a misconfiguration, please see the mitmproxy mode documentation for details." + ) + if validate_inbound_headers: + try: + validate_headers(request) + except ValueError as e: + return ( + f"Received {e} from client, refusing to prevent request smuggling attacks. " + "Disable the validate_inbound_headers option to skip this security check." + ) + return None + + +def is_h3_alpn(alpn: bytes | None) -> bool: + return alpn == b"h3" or (alpn is not None and alpn.startswith(b"h3-")) + + +@dataclass +class GetHttpConnection(HttpCommand): + """ + Open an HTTP Connection. This may not actually open a connection, but return an existing HTTP connection instead. + """ + + blocking = True + address: tuple[str, int] + tls: bool + via: server_spec.ServerSpec | None + transport_protocol: TransportProtocol = "tcp" + + def __hash__(self): + return id(self) + + def connection_spec_matches(self, connection: Connection) -> bool: + return ( + isinstance(connection, Server) + and self.address == connection.address + and self.tls == connection.tls + and self.via == connection.via + and self.transport_protocol == connection.transport_protocol + ) + + +@dataclass +class GetHttpConnectionCompleted(events.CommandCompleted): + command: GetHttpConnection + reply: tuple[None, str] | tuple[Connection, None] + """connection object, error message""" + + +@dataclass +class RegisterHttpConnection(HttpCommand): + """ + Register that a HTTP connection attempt has been completed. + """ + + connection: Connection + err: str | None + + +@dataclass +class SendHttp(HttpCommand): + event: HttpEvent + connection: Connection + + def __repr__(self) -> str: + return f"Send({self.event})" + + +@dataclass +class DropStream(HttpCommand): + """Signal to the HTTP layer that this stream is done processing and can be dropped from memory.""" + + stream_id: StreamId + + +class HttpStream(layer.Layer): + request_body_buf: ReceiveBuffer + response_body_buf: ReceiveBuffer + flow: http.HTTPFlow + stream_id: StreamId + child_layer: layer.Layer | None = None + + @cached_property + def mode(self) -> HTTPMode: + i = self.context.layers.index(self) + parent = self.context.layers[i - 1] + assert isinstance(parent, HttpLayer) + return parent.mode + + def __init__(self, context: Context, stream_id: int) -> None: + super().__init__(context) + self.request_body_buf = ReceiveBuffer() + self.response_body_buf = ReceiveBuffer() + self.client_state = self.state_uninitialized + self.server_state = self.state_uninitialized + self.stream_id = stream_id + + def __repr__(self): + if self._handle_event == self.passthrough: + return f"HttpStream(id={self.stream_id}, passthrough)" + else: + return ( + f"HttpStream(" + f"id={self.stream_id}, " + f"client_state={self.client_state.__name__}, " + f"server_state={self.server_state.__name__}" + f")" + ) + + @expect(events.Start, HttpEvent) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, events.Start): + self.client_state = self.state_wait_for_request_headers + elif isinstance(event, (RequestProtocolError, ResponseProtocolError)): + yield from self.handle_protocol_error(event) + elif isinstance( + event, (RequestHeaders, RequestData, RequestTrailers, RequestEndOfMessage) + ): + yield from self.client_state(event) + else: + yield from self.server_state(event) + + @expect(RequestHeaders) + def state_wait_for_request_headers( + self, event: RequestHeaders + ) -> layer.CommandGenerator[None]: + if not event.replay_flow: + self.flow = http.HTTPFlow(self.context.client, self.context.server) + + else: + self.flow = event.replay_flow + self.flow.request = event.request + self.flow.live = True + + if (yield from self.check_invalid(True)): + return + + if self.flow.request.method == "CONNECT": + return (yield from self.handle_connect()) + + if self.mode is HTTPMode.transparent: + # Determine .scheme, .host and .port attributes for transparent requests + assert self.context.server.address + self.flow.request.data.host = self.context.server.address[0] + self.flow.request.data.port = self.context.server.address[1] + self.flow.request.scheme = "https" if self.context.server.tls else "http" + elif not self.flow.request.host: + # We need to extract destination information from the host header. + try: + host, port = url.parse_authority( + self.flow.request.host_header or "", check=True + ) + except ValueError: + yield SendHttp( + ResponseProtocolError( + self.stream_id, + "HTTP request has no host header, destination unknown.", + ErrorCode.DESTINATION_UNKNOWN, + ), + self.context.client, + ) + self.client_state = self.state_errored + return + else: + if port is None: + port = 443 if self.context.client.tls else 80 + self.flow.request.data.host = host + self.flow.request.data.port = port + self.flow.request.scheme = ( + "https" if self.context.client.tls else "http" + ) + + if self.mode is HTTPMode.regular and not ( + self.flow.request.is_http2 or self.flow.request.is_http3 + ): + # Set the request target to origin-form for HTTP/1, some servers don't support absolute-form requests. + # see https://github.com/mitmproxy/mitmproxy/issues/1759 + self.flow.request.authority = "" + + # update host header in reverse proxy mode + if ( + isinstance(self.context.client.proxy_mode, ReverseMode) + and not self.context.options.keep_host_header + ): + assert self.context.server.address + self.flow.request.host_header = url.hostport( + "https" if self.context.server.tls else "http", + self.context.server.address[0], + self.context.server.address[1], + ) + + if not event.end_stream and (yield from self.check_body_size(True)): + return + + yield HttpRequestHeadersHook(self.flow) + if (yield from self.check_killed(True)): + return + + if self.flow.request.headers.get("expect", "").lower() == "100-continue": + continue_response = http.Response.make(100) + continue_response.headers.clear() + yield SendHttp( + ResponseHeaders(self.stream_id, continue_response), self.context.client + ) + self.flow.request.headers.pop("expect") + + if self.flow.request.stream and not event.end_stream: + yield from self.start_request_stream() + else: + self.client_state = self.state_consume_request_body + self.server_state = self.state_wait_for_response_headers + + def start_request_stream(self) -> layer.CommandGenerator[None]: + if self.flow.response: + raise NotImplementedError( + "Can't set a response and enable streaming at the same time." + ) + ok = yield from self.make_server_connection() + if not ok: + self.client_state = self.state_errored + return + yield SendHttp( + RequestHeaders(self.stream_id, self.flow.request, end_stream=False), + self.context.server, + ) + yield commands.Log(f"Streaming request to {self.flow.request.host}.") + self.client_state = self.state_stream_request_body + + @expect(RequestData, RequestTrailers, RequestEndOfMessage) + def state_stream_request_body( + self, event: RequestData | RequestEndOfMessage + ) -> layer.CommandGenerator[None]: + if isinstance(event, RequestData): + if callable(self.flow.request.stream): + chunks = self.flow.request.stream(event.data) + if isinstance(chunks, bytes): + chunks = [chunks] + else: + chunks = [event.data] + for chunk in chunks: + if self.context.options.store_streamed_bodies: + self.request_body_buf += chunk + yield SendHttp(RequestData(self.stream_id, chunk), self.context.server) + elif isinstance(event, RequestTrailers): + # we don't do anything further here, we wait for RequestEndOfMessage first to trigger the request hook. + self.flow.request.trailers = event.trailers + elif isinstance(event, RequestEndOfMessage): + if callable(self.flow.request.stream): + chunks = self.flow.request.stream(b"") + if chunks == b"": + chunks = [] + elif isinstance(chunks, bytes): + chunks = [chunks] + for chunk in chunks: + if self.context.options.store_streamed_bodies: + self.request_body_buf += chunk + yield SendHttp( + RequestData(self.stream_id, chunk), self.context.server + ) + + if self.context.options.store_streamed_bodies: + self.flow.request.data.content = bytes(self.request_body_buf) + self.request_body_buf.clear() + self.flow.request.timestamp_end = time.time() + yield HttpRequestHook(self.flow) + self.client_state = self.state_done + + if self.flow.request.trailers: + # we've delayed sending trailers until after `request` has been triggered. + yield SendHttp( + RequestTrailers(self.stream_id, self.flow.request.trailers), + self.context.server, + ) + yield SendHttp(event, self.context.server) + + if self.server_state == self.state_done: + yield from self.flow_done() + + @expect(RequestData, RequestTrailers, RequestEndOfMessage) + def state_consume_request_body( + self, event: events.Event + ) -> layer.CommandGenerator[None]: + if isinstance(event, RequestData): + self.request_body_buf += event.data + yield from self.check_body_size(True) + elif isinstance(event, RequestTrailers): + assert self.flow.request + self.flow.request.trailers = event.trailers + elif isinstance(event, RequestEndOfMessage): + self.flow.request.timestamp_end = time.time() + self.flow.request.data.content = bytes(self.request_body_buf) + self.request_body_buf.clear() + self.client_state = self.state_done + yield HttpRequestHook(self.flow) + if (yield from self.check_killed(True)): + return + elif self.flow.response: + # response was set by an inline script. + # we now need to emulate the responseheaders hook. + self.flow.response.timestamp_start = time.time() + yield HttpResponseHeadersHook(self.flow) + if (yield from self.check_killed(True)): + return + yield from self.send_response() + else: + ok = yield from self.make_server_connection() + if not ok: + return + + content = self.flow.request.raw_content + done_after_headers = not (content or self.flow.request.trailers) + yield SendHttp( + RequestHeaders( + self.stream_id, self.flow.request, done_after_headers + ), + self.context.server, + ) + if content: + yield SendHttp( + RequestData(self.stream_id, content), self.context.server + ) + if self.flow.request.trailers: + yield SendHttp( + RequestTrailers(self.stream_id, self.flow.request.trailers), + self.context.server, + ) + yield SendHttp(RequestEndOfMessage(self.stream_id), self.context.server) + + @expect(ResponseHeaders) + def state_wait_for_response_headers( + self, event: ResponseHeaders + ) -> layer.CommandGenerator[None]: + self.flow.response = event.response + + if not event.end_stream and (yield from self.check_body_size(False)): + return + if (yield from self.check_invalid(False)): + return + + yield HttpResponseHeadersHook(self.flow) + if (yield from self.check_killed(True)): + return + + elif self.flow.response.stream and not event.end_stream: + yield from self.start_response_stream() + else: + self.server_state = self.state_consume_response_body + + def start_response_stream(self) -> layer.CommandGenerator[None]: + assert self.flow.response + yield SendHttp( + ResponseHeaders(self.stream_id, self.flow.response, end_stream=False), + self.context.client, + ) + yield commands.Log(f"Streaming response from {self.flow.request.host}.") + self.server_state = self.state_stream_response_body + + @expect(ResponseData, ResponseTrailers, ResponseEndOfMessage) + def state_stream_response_body( + self, event: events.Event + ) -> layer.CommandGenerator[None]: + assert self.flow.response + if isinstance(event, ResponseData): + if callable(self.flow.response.stream): + chunks = self.flow.response.stream(event.data) + if isinstance(chunks, bytes): + chunks = [chunks] + else: + chunks = [event.data] + for chunk in chunks: + if self.context.options.store_streamed_bodies: + self.response_body_buf += chunk + yield SendHttp(ResponseData(self.stream_id, chunk), self.context.client) + elif isinstance(event, ResponseTrailers): + self.flow.response.trailers = event.trailers + # will be sent in send_response() after the response hook. + elif isinstance(event, ResponseEndOfMessage): + if callable(self.flow.response.stream): + chunks = self.flow.response.stream(b"") + if chunks == b"": + chunks = [] + elif isinstance(chunks, bytes): + chunks = [chunks] + for chunk in chunks: + if self.context.options.store_streamed_bodies: + self.response_body_buf += chunk + yield SendHttp( + ResponseData(self.stream_id, chunk), self.context.client + ) + if self.context.options.store_streamed_bodies: + self.flow.response.data.content = bytes(self.response_body_buf) + self.response_body_buf.clear() + yield from self.send_response(already_streamed=True) + + @expect(ResponseData, ResponseTrailers, ResponseEndOfMessage) + def state_consume_response_body( + self, event: events.Event + ) -> layer.CommandGenerator[None]: + if isinstance(event, ResponseData): + self.response_body_buf += event.data + yield from self.check_body_size(False) + elif isinstance(event, ResponseTrailers): + assert self.flow.response + self.flow.response.trailers = event.trailers + elif isinstance(event, ResponseEndOfMessage): + assert self.flow.response + self.flow.response.data.content = bytes(self.response_body_buf) + self.response_body_buf.clear() + yield from self.send_response() + + def send_response(self, already_streamed: bool = False): + """We have either consumed the entire response from the server or the response was set by an addon.""" + assert self.flow.response + self.flow.response.timestamp_end = time.time() + + is_websocket = ( + self.flow.response.status_code == 101 + and self.flow.response.headers.get("upgrade", "").lower() == "websocket" + and self.flow.request.headers.get("Sec-WebSocket-Version", "").encode() + == wsproto.handshake.WEBSOCKET_VERSION + and self.context.options.websocket + ) + if is_websocket: + # We need to set this before calling the response hook + # so that addons can determine if a WebSocket connection is following up. + self.flow.websocket = WebSocketData() + + yield HttpResponseHook(self.flow) + self.server_state = self.state_done + if (yield from self.check_killed(False)): + return + + if not already_streamed: + content = self.flow.response.raw_content + done_after_headers = not (content or self.flow.response.trailers) + yield SendHttp( + ResponseHeaders(self.stream_id, self.flow.response, done_after_headers), + self.context.client, + ) + if content: + yield SendHttp( + ResponseData(self.stream_id, content), self.context.client + ) + + if self.flow.response.trailers: + yield SendHttp( + ResponseTrailers(self.stream_id, self.flow.response.trailers), + self.context.client, + ) + + if self.client_state == self.state_done: + yield from self.flow_done() + + def flow_done(self) -> layer.CommandGenerator[None]: + if not self.flow.websocket: + self.flow.live = False + + assert self.flow.response + if self.flow.response.status_code == 101: + if self.flow.websocket: + self.child_layer = websocket.WebsocketLayer(self.context, self.flow) + elif self.context.options.rawtcp: + self.child_layer = tcp.TCPLayer(self.context) + else: + yield commands.Log( + f"Sent HTTP 101 response, but no protocol is enabled to upgrade to.", + WARNING, + ) + yield commands.CloseConnection(self.context.client) + self.client_state = self.server_state = self.state_errored + return + if self.debug: + yield commands.Log( + f"{self.debug}[http] upgrading to {self.child_layer}", DEBUG + ) + self._handle_event = self.passthrough + yield from self.child_layer.handle_event(events.Start()) + else: + yield DropStream(self.stream_id) + + # delay sending EOM until the child layer is set up, + # we may get data immediately and need to be prepared to handle it. + yield SendHttp(ResponseEndOfMessage(self.stream_id), self.context.client) + + def check_body_size(self, request: bool) -> layer.CommandGenerator[bool]: + """ + Check if the body size exceeds limits imposed by stream_large_bodies or body_size_limit. + + Returns `True` if the body size exceeds body_size_limit and further processing should be stopped. + """ + if not ( + self.context.options.stream_large_bodies + or self.context.options.body_size_limit + ): + return False + + # Step 1: Determine the expected body size. This can either come from a known content-length header, + # or from the amount of currently buffered bytes (e.g. for chunked encoding). + response = not request + expected_size: int | None + # the 'late' case: we already started consuming the body + if request and self.request_body_buf: + expected_size = len(self.request_body_buf) + elif response and self.response_body_buf: + expected_size = len(self.response_body_buf) + else: + # the 'early' case: we have not started consuming the body + try: + expected_size = expected_http_body_size( + self.flow.request, self.flow.response if response else None + ) + except ValueError: # pragma: no cover + # we just don't stream/kill malformed content-length headers. + expected_size = None + + if expected_size is None or expected_size <= 0: + return False + + # Step 2: Do we need to abort this? + max_total_size = human.parse_size(self.context.options.body_size_limit) + if max_total_size is not None and expected_size > max_total_size: + if request and not self.request_body_buf: + yield HttpRequestHeadersHook(self.flow) + if response and not self.response_body_buf: + yield HttpResponseHeadersHook(self.flow) + + err_msg = f"{'Request' if request else 'Response'} body exceeds mitmproxy's body_size_limit." + err_code = ( + ErrorCode.REQUEST_TOO_LARGE if request else ErrorCode.RESPONSE_TOO_LARGE + ) + + self.flow.error = flow.Error(err_msg) + yield HttpErrorHook(self.flow) + yield SendHttp( + ResponseProtocolError(self.stream_id, err_msg, err_code), + self.context.client, + ) + self.client_state = self.state_errored + if response: + yield SendHttp( + RequestProtocolError(self.stream_id, err_msg, err_code), + self.context.server, + ) + self.server_state = self.state_errored + self.flow.live = False + return True + + # Step 3: Do we need to stream this? + max_stream_size = human.parse_size(self.context.options.stream_large_bodies) + if max_stream_size is not None and expected_size > max_stream_size: + if request: + self.flow.request.stream = True + if self.request_body_buf: + # clear buffer and then fake a DataReceived event with everything we had in the buffer so far. + body_buf = bytes(self.request_body_buf) + self.request_body_buf.clear() + yield from self.start_request_stream() + yield from self.handle_event(RequestData(self.stream_id, body_buf)) + if response: + assert self.flow.response + self.flow.response.stream = True + if self.response_body_buf: + body_buf = bytes(self.response_body_buf) + self.response_body_buf.clear() + yield from self.start_response_stream() + yield from self.handle_event(ResponseData(self.stream_id, body_buf)) + return False + + def check_invalid(self, request: bool) -> layer.CommandGenerator[bool]: + err: str | None = None + if request: + err = validate_request( + self.mode, + self.flow.request, + self.context.options.validate_inbound_headers, + ) + elif self.context.options.validate_inbound_headers: + assert self.flow.response is not None + try: + validate_headers(self.flow.response) + except ValueError as e: + err = ( + f"Received {e} from server, refusing to prevent request smuggling attacks. " + "Disable the validate_inbound_headers option to skip this security check." + ) + + if err: + self.flow.error = flow.Error(err) + + if request: + # flow has not been seen yet, register it. + yield HttpRequestHeadersHook(self.flow) + else: + # immediately kill server connection + yield commands.CloseConnection(self.flow.server_conn) + yield HttpErrorHook(self.flow) + yield SendHttp( + ResponseProtocolError( + self.stream_id, + err, + ErrorCode.REQUEST_VALIDATION_FAILED + if request + else ErrorCode.RESPONSE_VALIDATION_FAILED, + ), + self.context.client, + ) + self.flow.live = False + self.client_state = self.server_state = self.state_errored + return True + else: + return False + + def check_killed(self, emit_error_hook: bool) -> layer.CommandGenerator[bool]: + killed_by_us = ( + self.flow.error and self.flow.error.msg == flow.Error.KILLED_MESSAGE + ) + # The client may have closed the connection while we were waiting for the hook to complete. + # We peek into the event queue to see if that is the case. + killed_by_remote = None + for evt in self._paused_event_queue: + if isinstance(evt, RequestProtocolError): + killed_by_remote = evt.message + break + + if killed_by_remote: + if not self.flow.error: + self.flow.error = flow.Error(killed_by_remote) + if killed_by_us or killed_by_remote: + if emit_error_hook: + yield HttpErrorHook(self.flow) + yield SendHttp( + ResponseProtocolError(self.stream_id, "killed", ErrorCode.KILL), + self.context.client, + ) + self.flow.live = False + self.client_state = self.server_state = self.state_errored + return True + return False + + def handle_protocol_error( + self, event: RequestProtocolError | ResponseProtocolError + ) -> layer.CommandGenerator[None]: + is_client_error_but_we_already_talk_upstream = ( + isinstance(event, RequestProtocolError) + and self.client_state in (self.state_stream_request_body, self.state_done) + and self.server_state not in (self.state_done, self.state_errored) + ) + need_error_hook = not ( + self.client_state == self.state_errored + or self.server_state in (self.state_done, self.state_errored) + ) + + if is_client_error_but_we_already_talk_upstream: + yield SendHttp(event, self.context.server) + self.client_state = self.state_errored + + if need_error_hook: + # We don't want to trigger both a response hook and an error hook, + # so we need to check if the response is done yet or not. + self.flow.error = flow.Error(event.message) + yield HttpErrorHook(self.flow) + + if (yield from self.check_killed(False)): + return + + if isinstance(event, ResponseProtocolError): + if self.client_state != self.state_errored: + yield SendHttp(event, self.context.client) + self.server_state = self.state_errored + + self.flow.live = False + yield DropStream(self.stream_id) + + def make_server_connection(self) -> layer.CommandGenerator[bool]: + connection, err = yield GetHttpConnection( + (self.flow.request.host, self.flow.request.port), + self.flow.request.scheme == "https", + self.flow.server_conn.via, + self.flow.server_conn.transport_protocol, + ) + if err: + yield from self.handle_protocol_error( + ResponseProtocolError(self.stream_id, err, ErrorCode.CONNECT_FAILED) + ) + return False + else: + self.context.server = self.flow.server_conn = connection + return True + + def handle_connect(self) -> layer.CommandGenerator[None]: + self.client_state = self.state_done + yield HttpConnectHook(self.flow) + if (yield from self.check_killed(False)): + return + + self.context.server.address = (self.flow.request.host, self.flow.request.port) + + if self.mode == HTTPMode.regular: + yield from self.handle_connect_regular() + else: + yield from self.handle_connect_upstream() + + def handle_connect_regular(self): + if ( + not self.flow.response + and self.context.options.connection_strategy == "eager" + ): + err = yield commands.OpenConnection(self.context.server) + if err: + self.flow.response = http.Response.make( + 502, + f"Cannot connect to {human.format_address(self.context.server.address)}: {err} " + f"If you plan to redirect requests away from this server, " + f"consider setting `connection_strategy` to `lazy` to suppress early connections.", + ) + self.child_layer = layer.NextLayer(self.context) + yield from self.handle_connect_finish() + + def handle_connect_upstream(self): + self.child_layer = _upstream_proxy.HttpUpstreamProxy.make(self.context, True)[0] + yield from self.handle_connect_finish() + + def handle_connect_finish(self): + if not self.flow.response: + # Do not send any response headers as it breaks proxying non-80 ports on + # Android emulators using the -http-proxy option. + self.flow.response = http.Response( + self.flow.request.data.http_version, + 200, + b"Connection established", + http.Headers(), + b"", + None, + time.time(), + time.time(), + ) + + if 200 <= self.flow.response.status_code < 300: + yield HttpConnectedHook(self.flow) + self.child_layer = self.child_layer or layer.NextLayer(self.context) + self._handle_event = self.passthrough + yield from self.child_layer.handle_event(events.Start()) + else: + yield HttpConnectErrorHook(self.flow) + self.client_state = self.state_errored + self.flow.live = False + + content = self.flow.response.raw_content + done_after_headers = not (content or self.flow.response.trailers) + yield SendHttp( + ResponseHeaders(self.stream_id, self.flow.response, done_after_headers), + self.context.client, + ) + if content: + yield SendHttp(ResponseData(self.stream_id, content), self.context.client) + + if self.flow.response.trailers: + yield SendHttp( + ResponseTrailers(self.stream_id, self.flow.response.trailers), + self.context.client, + ) + yield SendHttp(ResponseEndOfMessage(self.stream_id), self.context.client) + + @expect(RequestData, RequestEndOfMessage, events.Event) + def passthrough(self, event: events.Event) -> layer.CommandGenerator[None]: + assert self.flow.response + assert self.child_layer + # HTTP events -> normal connection events + if isinstance(event, RequestData): + event = events.DataReceived(self.context.client, event.data) + elif isinstance(event, ResponseData): + event = events.DataReceived(self.context.server, event.data) + elif isinstance(event, RequestEndOfMessage): + event = events.ConnectionClosed(self.context.client) + elif isinstance(event, ResponseEndOfMessage): + event = events.ConnectionClosed(self.context.server) + + for command in self.child_layer.handle_event(event): + # normal connection events -> HTTP events + if isinstance(command, commands.SendData): + if command.connection == self.context.client: + yield SendHttp( + ResponseData(self.stream_id, command.data), self.context.client + ) + elif ( + command.connection == self.context.server + and self.flow.response.status_code == 101 + ): + # there only is a HTTP server connection if we have switched protocols, + # not if a connection is established via CONNECT. + yield SendHttp( + RequestData(self.stream_id, command.data), self.context.server + ) + else: + yield command + elif isinstance(command, commands.CloseConnection): + if command.connection == self.context.client: + yield SendHttp( + ResponseProtocolError( + self.stream_id, "EOF", ErrorCode.PASSTHROUGH_CLOSE + ), + self.context.client, + ) + elif ( + command.connection == self.context.server + and self.flow.response.status_code == 101 + ): + yield SendHttp( + RequestProtocolError( + self.stream_id, "EOF", ErrorCode.PASSTHROUGH_CLOSE + ), + self.context.server, + ) + else: + # If we are running TCP over HTTP we want to be consistent with half-closes. + # The easiest approach for this is to just always full close for now. + # Alternatively, we could signal that we want a half close only through ResponseProtocolError, + # but that is more complex to implement. + if isinstance(command, commands.CloseTcpConnection): + command = commands.CloseConnection(command.connection) + yield command + else: + yield command + + @expect() + def state_uninitialized(self, _) -> layer.CommandGenerator[None]: + yield from () + + @expect() + def state_done(self, _) -> layer.CommandGenerator[None]: + yield from () + + def state_errored(self, _) -> layer.CommandGenerator[None]: + # silently consume every event. + yield from () + + +class HttpLayer(layer.Layer): + """ + ConnectionEvent: We have received b"GET /\r\n\r\n" from the client. + HttpEvent: We have received request headers + HttpCommand: Send request headers to X + ConnectionCommand: Send b"GET /\r\n\r\n" to server. + + ConnectionEvent -> HttpEvent -> HttpCommand -> ConnectionCommand + """ + + mode: HTTPMode + command_sources: dict[commands.Command, layer.Layer] + streams: dict[int, HttpStream] + connections: dict[Connection, layer.Layer] + waiting_for_establishment: collections.defaultdict[ + Connection, list[GetHttpConnection] + ] + + def __init__(self, context: Context, mode: HTTPMode): + super().__init__(context) + self.mode = mode + + self.waiting_for_establishment = collections.defaultdict(list) + self.streams = {} + self.command_sources = {} + self.connections = {} + + def __repr__(self): + return f"HttpLayer({self.mode.name}, conns: {len(self.connections)})" + + def _handle_event(self, event: events.Event): + if isinstance(event, events.Start): + http_conn: HttpConnection + if is_h3_alpn(self.context.client.alpn): + http_conn = Http3Server(self.context.fork()) + elif self.context.client.alpn == b"h2": + http_conn = Http2Server(self.context.fork()) + else: + http_conn = Http1Server(self.context.fork()) + + # may have been set by client playback. + self.connections.setdefault(self.context.client, http_conn) + yield from self.event_to_child(self.connections[self.context.client], event) + if self.mode is HTTPMode.upstream: + proxy_mode = self.context.client.proxy_mode + assert isinstance(proxy_mode, UpstreamMode) + self.context.server.via = (proxy_mode.scheme, proxy_mode.address) + elif isinstance(event, events.CommandCompleted): + stream = self.command_sources.pop(event.command) + yield from self.event_to_child(stream, event) + elif isinstance(event, events.MessageInjected): + # For injected messages we pass the HTTP stacks entirely and directly address the stream. + try: + conn = self.connections[event.flow.server_conn] + except KeyError: + # We have a miss for the server connection, which means we're looking at a connection object + # that is tunneled over another connection (for example: over an upstream HTTP proxy). + # We now take the stream associated with the client connection. That won't work for HTTP/2, + # but it's good enough for HTTP/1. + conn = self.connections[event.flow.client_conn] + if isinstance(conn, HttpStream): + stream_id = conn.stream_id + else: + # We reach to the end of the connection's child stack to get the HTTP/1 client layer, + # which tells us which stream we are dealing with. + conn = conn.context.layers[-1] + assert isinstance(conn, Http1Connection) + assert conn.stream_id + stream_id = conn.stream_id + yield from self.event_to_child(self.streams[stream_id], event) + elif isinstance(event, events.ConnectionEvent): + if ( + event.connection == self.context.server + and self.context.server not in self.connections + ): + # We didn't do anything with this connection yet, now the peer is doing something. + if isinstance(event, events.ConnectionClosed): + # The peer has closed it - let's close it too! + yield commands.CloseConnection(event.connection) + elif isinstance(event, (events.DataReceived, QuicStreamEvent)): + # The peer has sent data or another connection activity occurred. + # This can happen with HTTP/2 servers that already send a settings frame. + child_layer: HttpConnection + if is_h3_alpn(self.context.server.alpn): + child_layer = Http3Client(self.context.fork()) + elif self.context.server.alpn == b"h2": + child_layer = Http2Client(self.context.fork()) + else: + child_layer = Http1Client(self.context.fork()) + self.connections[self.context.server] = child_layer + yield from self.event_to_child(child_layer, events.Start()) + yield from self.event_to_child(child_layer, event) + else: + raise AssertionError(f"Unexpected event: {event}") + else: + handler = self.connections[event.connection] + yield from self.event_to_child(handler, event) + else: + raise AssertionError(f"Unexpected event: {event}") + + def event_to_child( + self, + child: layer.Layer | HttpStream, + event: events.Event, + ) -> layer.CommandGenerator[None]: + for command in child.handle_event(event): + assert isinstance(command, commands.Command) + # Streams may yield blocking commands, which ultimately generate CommandCompleted events. + # Those need to be routed back to the correct stream, so we need to keep track of that. + + if command.blocking or isinstance(command, commands.RequestWakeup): + self.command_sources[command] = child + + if isinstance(command, ReceiveHttp): + if isinstance(command.event, RequestHeaders): + yield from self.make_stream(command.event.stream_id) + try: + stream = self.streams[command.event.stream_id] + except KeyError: + # We may be getting data or errors for a stream even though we've already finished handling it, + # see for example https://github.com/mitmproxy/mitmproxy/issues/5343. + pass + else: + yield from self.event_to_child(stream, command.event) + elif isinstance(command, SendHttp): + conn = self.connections[command.connection] + yield from self.event_to_child(conn, command.event) + elif isinstance(command, DropStream): + self.streams.pop(command.stream_id, None) + elif isinstance(command, GetHttpConnection): + yield from self.get_connection(command) + elif isinstance(command, RegisterHttpConnection): + yield from self.register_connection(command) + elif isinstance(command, commands.OpenConnection): + self.connections[command.connection] = child + yield command + elif isinstance(command, commands.Command): + yield command + else: + raise AssertionError(f"Not a command: {event}") + + def make_stream(self, stream_id: int) -> layer.CommandGenerator[None]: + ctx = self.context.fork() + self.streams[stream_id] = HttpStream(ctx, stream_id) + yield from self.event_to_child(self.streams[stream_id], events.Start()) + + def get_connection( + self, event: GetHttpConnection, *, reuse: bool = True + ) -> layer.CommandGenerator[None]: + # Do we already have a connection we can re-use? + if reuse: + for connection in self.connections: + connection_suitable = event.connection_spec_matches(connection) + if connection_suitable: + if connection in self.waiting_for_establishment: + self.waiting_for_establishment[connection].append(event) + return + elif connection.error: + stream = self.command_sources.pop(event) + yield from self.event_to_child( + stream, + GetHttpConnectionCompleted(event, (None, connection.error)), + ) + return + elif connection.connected: + # see "tricky multiplexing edge case" in make_http_connection for an explanation + h2_to_h1 = ( + self.context.client.alpn == b"h2" + and connection.alpn != b"h2" + ) + if not h2_to_h1: + stream = self.command_sources.pop(event) + yield from self.event_to_child( + stream, + GetHttpConnectionCompleted(event, (connection, None)), + ) + return + else: + pass # the connection is at least half-closed already, we want a new one. + + context_connection_matches = ( + self.context.server not in self.connections + and event.connection_spec_matches(self.context.server) + ) + can_use_context_connection = ( + context_connection_matches and self.context.server.connected + ) + if context_connection_matches and self.context.server.error: + stream = self.command_sources.pop(event) + yield from self.event_to_child( + stream, + GetHttpConnectionCompleted(event, (None, self.context.server.error)), + ) + return + + context = self.context.fork() + + stack = tunnel.LayerStack() + + if not can_use_context_connection: + context.server = Server( + address=event.address, transport_protocol=event.transport_protocol + ) + + if event.via: + context.server.via = event.via + # We always send a CONNECT request, *except* for plaintext absolute-form HTTP requests in upstream mode. + send_connect = event.tls or self.mode != HTTPMode.upstream + stack /= _upstream_proxy.HttpUpstreamProxy.make(context, send_connect) + if event.tls: + # Assume that we are in transparent mode and lazily did not open a connection yet. + # We don't want the IP (which is the address) as the upstream SNI, but the client's SNI instead. + if ( + self.mode == HTTPMode.transparent + and event.address == self.context.server.address + ): + # reverse proxy mode may set self.context.server.sni, which takes precedence. + context.server.sni = ( + self.context.server.sni + or self.context.client.sni + or event.address[0] + ) + else: + context.server.sni = event.address[0] + if context.server.transport_protocol == "tcp": + stack /= tls.ServerTLSLayer(context) + elif context.server.transport_protocol == "udp": + stack /= quic.ServerQuicLayer(context) + else: + raise AssertionError( + context.server.transport_protocol + ) # pragma: no cover + + stack /= HttpClient(context) + + self.connections[context.server] = stack[0] + self.waiting_for_establishment[context.server].append(event) + + yield from self.event_to_child(stack[0], events.Start()) + + def register_connection( + self, command: RegisterHttpConnection + ) -> layer.CommandGenerator[None]: + waiting = self.waiting_for_establishment.pop(command.connection) + + reply: tuple[None, str] | tuple[Connection, None] + if command.err: + reply = (None, command.err) + else: + reply = (command.connection, None) + + for cmd in waiting: + stream = self.command_sources.pop(cmd) + yield from self.event_to_child( + stream, GetHttpConnectionCompleted(cmd, reply) + ) + + # Tricky multiplexing edge case: Assume we are doing HTTP/2 -> HTTP/1 proxying and the destination server + # only serves responses with HTTP read-until-EOF semantics. In this case we can't process two flows on the + # same connection. The only workaround left is to open a separate connection for each flow. + if ( + not command.err + and self.context.client.alpn == b"h2" + and command.connection.alpn != b"h2" + ): + for cmd in waiting[1:]: + yield from self.get_connection(cmd, reuse=False) + break + + +class HttpClient(layer.Layer): + child_layer: layer.Layer + + @expect(events.Start) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + err: str | None + if self.context.server.connected: + err = None + else: + err = yield commands.OpenConnection(self.context.server) + if not err: + if is_h3_alpn(self.context.server.alpn): + self.child_layer = Http3Client(self.context) + elif self.context.server.alpn == b"h2": + self.child_layer = Http2Client(self.context) + else: + self.child_layer = Http1Client(self.context) + self._handle_event = self.child_layer.handle_event + yield from self._handle_event(event) + yield RegisterHttpConnection(self.context.server, err) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db9b3d2a7e8910efc6a8b57d4892ec673f970ab9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_base.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_base.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab3ef19bf6c5d8736fe406d9cf227f6240945685 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_base.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_events.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_events.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0e1e222e4884468793da42a85e6252490aa2946 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_events.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_hooks.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_hooks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c92f2f7b5af020b05b345a3512f05ed45c9594ed Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_hooks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http1.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http1.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e5286ac70a7aa715c0882c44d3cd28a01249b65 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http1.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http2.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http2.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f60f695794cfccacc83006bd4dad9d66c6c8c08 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http2.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http3.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http3.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b22b89febfecc6d669370b30575f2d84feb5c56 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http3.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http_h2.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http_h2.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43a389309775588a5c7a315e8cbe6dd2e1157117 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http_h2.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http_h3.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http_h3.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..259eaea4ab462e15cb53300c15ff652653a3e417 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_http_h3.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_upstream_proxy.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_upstream_proxy.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d14757aaeea7814b448653e922b1c5495216182 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/__pycache__/_upstream_proxy.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_base.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_base.py new file mode 100644 index 0000000000000000000000000000000000000000..198fa77fb27ae4e96f796fe4539c75c9a309f7fa --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_base.py @@ -0,0 +1,61 @@ +import html +import textwrap +from dataclasses import dataclass + +from mitmproxy import http +from mitmproxy.connection import Connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.context import Context + +StreamId = int + + +@dataclass +class HttpEvent(events.Event): + # we need stream ids on every event to avoid race conditions + stream_id: StreamId + + +class HttpConnection(layer.Layer): + conn: Connection + + def __init__(self, context: Context, conn: Connection): + super().__init__(context) + self.conn = conn + + +class HttpCommand(commands.Command): + pass + + +class ReceiveHttp(HttpCommand): + event: HttpEvent + + def __init__(self, event: HttpEvent): + self.event = event + + def __repr__(self) -> str: + return f"Receive({self.event})" + + +def format_error(status_code: int, message: str) -> bytes: + reason = http.status_codes.RESPONSES.get(status_code, "Unknown") + return ( + textwrap.dedent( + f""" + + + {status_code} {reason} + + +

    {status_code} {reason}

    +

    {html.escape(message)}

    + + + """ + ) + .strip() + .encode("utf8", "replace") + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_events.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_events.py new file mode 100644 index 0000000000000000000000000000000000000000..2299695420d8a37f8896892f68183d223f0f71fd --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_events.py @@ -0,0 +1,167 @@ +import enum +import typing +from dataclasses import dataclass + +from ._base import HttpEvent +from mitmproxy import http +from mitmproxy.http import HTTPFlow +from mitmproxy.net.http import status_codes + + +@dataclass +class RequestHeaders(HttpEvent): + request: http.Request + end_stream: bool + """ + If True, we already know at this point that there is no message body. This is useful for HTTP/2, where it allows + us to set END_STREAM on headers already (and some servers - Akamai - implicitly expect that). + In either case, this event will nonetheless be followed by RequestEndOfMessage. + """ + replay_flow: HTTPFlow | None = None + """If set, the current request headers belong to a replayed flow, which should be reused.""" + + +@dataclass +class ResponseHeaders(HttpEvent): + response: http.Response + end_stream: bool = False + + +# explicit constructors below to facilitate type checking in _http1/_http2 + + +@dataclass +class RequestData(HttpEvent): + data: bytes + + def __init__(self, stream_id: int, data: bytes): + self.stream_id = stream_id + self.data = data + + +@dataclass +class ResponseData(HttpEvent): + data: bytes + + def __init__(self, stream_id: int, data: bytes): + self.stream_id = stream_id + self.data = data + + +@dataclass +class RequestTrailers(HttpEvent): + trailers: http.Headers + + def __init__(self, stream_id: int, trailers: http.Headers): + self.stream_id = stream_id + self.trailers = trailers + + +@dataclass +class ResponseTrailers(HttpEvent): + trailers: http.Headers + + def __init__(self, stream_id: int, trailers: http.Headers): + self.stream_id = stream_id + self.trailers = trailers + + +@dataclass +class RequestEndOfMessage(HttpEvent): + def __init__(self, stream_id: int): + self.stream_id = stream_id + + +@dataclass +class ResponseEndOfMessage(HttpEvent): + def __init__(self, stream_id: int): + self.stream_id = stream_id + + +class ErrorCode(enum.Enum): + GENERIC_CLIENT_ERROR = 1 + GENERIC_SERVER_ERROR = 2 + REQUEST_TOO_LARGE = 3 + RESPONSE_TOO_LARGE = 4 + CONNECT_FAILED = 5 + PASSTHROUGH_CLOSE = 6 + KILL = 7 + HTTP_1_1_REQUIRED = 8 + """Client should fall back to HTTP/1.1 to perform request.""" + DESTINATION_UNKNOWN = 9 + """Proxy does not know where to send request to.""" + CLIENT_DISCONNECTED = 10 + """Client disconnected before receiving entire response.""" + CANCEL = 11 + """Client or server cancelled h2/h3 stream.""" + REQUEST_VALIDATION_FAILED = 12 + RESPONSE_VALIDATION_FAILED = 13 + + def http_status_code(self) -> int | None: + match self: + # Client Errors + case ( + ErrorCode.GENERIC_CLIENT_ERROR + | ErrorCode.REQUEST_VALIDATION_FAILED + | ErrorCode.DESTINATION_UNKNOWN + ): + return status_codes.BAD_REQUEST + case ErrorCode.REQUEST_TOO_LARGE: + return status_codes.PAYLOAD_TOO_LARGE + case ( + ErrorCode.CONNECT_FAILED + | ErrorCode.GENERIC_SERVER_ERROR + | ErrorCode.RESPONSE_VALIDATION_FAILED + | ErrorCode.RESPONSE_TOO_LARGE + ): + return status_codes.BAD_GATEWAY + case ( + ErrorCode.PASSTHROUGH_CLOSE + | ErrorCode.KILL + | ErrorCode.HTTP_1_1_REQUIRED + | ErrorCode.CLIENT_DISCONNECTED + | ErrorCode.CANCEL + ): + return None + case other: # pragma: no cover + typing.assert_never(other) + + +@dataclass +class RequestProtocolError(HttpEvent): + message: str + code: ErrorCode = ErrorCode.GENERIC_CLIENT_ERROR + + def __init__(self, stream_id: int, message: str, code: ErrorCode): + assert isinstance(code, ErrorCode) + self.stream_id = stream_id + self.message = message + self.code = code + + +@dataclass +class ResponseProtocolError(HttpEvent): + message: str + code: ErrorCode = ErrorCode.GENERIC_SERVER_ERROR + + def __init__(self, stream_id: int, message: str, code: ErrorCode): + assert isinstance(code, ErrorCode) + self.stream_id = stream_id + self.message = message + self.code = code + + +__all__ = [ + "ErrorCode", + "HttpEvent", + "RequestHeaders", + "RequestData", + "RequestEndOfMessage", + "ResponseHeaders", + "ResponseData", + "RequestTrailers", + "ResponseTrailers", + "ResponseEndOfMessage", + "RequestProtocolError", + "ResponseProtocolError", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_hooks.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..501491cb3fa086c41c7df66d224aaeae5e202c6a --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_hooks.py @@ -0,0 +1,122 @@ +from dataclasses import dataclass + +from mitmproxy import http +from mitmproxy.proxy import commands + + +@dataclass +class HttpRequestHeadersHook(commands.StartHook): + """ + HTTP request headers were successfully read. At this point, the body is empty. + """ + + name = "requestheaders" + flow: http.HTTPFlow + + +@dataclass +class HttpRequestHook(commands.StartHook): + """ + The full HTTP request has been read. + + Note: If request streaming is active, this event fires after the entire body has been streamed. + HTTP trailers, if present, have not been transmitted to the server yet and can still be modified. + Enabling streaming may cause unexpected event sequences: For example, `response` may now occur + before `request` because the server replied with "413 Payload Too Large" during upload. + """ + + name = "request" + flow: http.HTTPFlow + + +@dataclass +class HttpResponseHeadersHook(commands.StartHook): + """ + HTTP response headers were successfully read. At this point, the body is empty. + """ + + name = "responseheaders" + flow: http.HTTPFlow + + +@dataclass +class HttpResponseHook(commands.StartHook): + """ + The full HTTP response has been read. + + Note: If response streaming is active, this event fires after the entire body has been streamed. + HTTP trailers, if present, have not been transmitted to the client yet and can still be modified. + """ + + name = "response" + flow: http.HTTPFlow + + +@dataclass +class HttpErrorHook(commands.StartHook): + """ + An HTTP error has occurred, e.g. invalid server responses, or + interrupted connections. This is distinct from a valid server HTTP + error response, which is simply a response with an HTTP error code. + + Every flow will receive either an error or an response event, but not both. + """ + + name = "error" + flow: http.HTTPFlow + + +@dataclass +class HttpConnectHook(commands.StartHook): + """ + An HTTP CONNECT request was received. This event can be ignored for most practical purposes. + + This event only occurs in regular and upstream proxy modes + when the client instructs mitmproxy to open a connection to an upstream host. + Setting a non 2xx response on the flow will return the response to the client and abort the connection. + + CONNECT requests are HTTP proxy instructions for mitmproxy itself + and not forwarded. They do not generate the usual HTTP handler events, + but all requests going over the newly opened connection will. + """ + + flow: http.HTTPFlow + + +@dataclass +class HttpConnectUpstreamHook(commands.StartHook): + """ + An HTTP CONNECT request is about to be sent to an upstream proxy. + This event can be ignored for most practical purposes. + + This event can be used to set custom authentication headers for upstream proxies. + + CONNECT requests do not generate the usual HTTP handler events, + but all requests going over the newly opened connection will. + """ + + flow: http.HTTPFlow + + +@dataclass +class HttpConnectedHook(commands.StartHook): + """ + HTTP CONNECT was successful + + > [!WARNING] + > This may fire before an upstream connection has been established + > if `connection_strategy` is set to `lazy` (default) + """ + + flow: http.HTTPFlow + + +@dataclass +class HttpConnectErrorHook(commands.StartHook): + """ + HTTP CONNECT has failed. + This can happen when the upstream server is unreachable or proxy authentication is required. + In contrast to the `error` hook, `flow.error` is not guaranteed to be set. + """ + + flow: http.HTTPFlow diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http1.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http1.py new file mode 100644 index 0000000000000000000000000000000000000000..78add856730f66d46fa79991b81e4da0ead4ea60 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http1.py @@ -0,0 +1,502 @@ +import abc +from collections.abc import Callable +from typing import Union + +import h11 +from h11._readers import ChunkedReader +from h11._readers import ContentLengthReader +from h11._readers import Http10Reader +from h11._receivebuffer import ReceiveBuffer + +from ...context import Context +from ._base import format_error +from ._base import HttpConnection +from ._events import ErrorCode +from ._events import HttpEvent +from ._events import RequestData +from ._events import RequestEndOfMessage +from ._events import RequestHeaders +from ._events import RequestProtocolError +from ._events import ResponseData +from ._events import ResponseEndOfMessage +from ._events import ResponseHeaders +from ._events import ResponseProtocolError +from mitmproxy import http +from mitmproxy import version +from mitmproxy.connection import Connection +from mitmproxy.connection import ConnectionState +from mitmproxy.net.http import http1 +from mitmproxy.net.http import status_codes +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.layers.http._base import ReceiveHttp +from mitmproxy.proxy.layers.http._base import StreamId +from mitmproxy.proxy.utils import expect +from mitmproxy.utils import human + +TBodyReader = Union[ChunkedReader, Http10Reader, ContentLengthReader] + + +class Http1Connection(HttpConnection, metaclass=abc.ABCMeta): + stream_id: StreamId | None = None + request: http.Request | None = None + response: http.Response | None = None + request_done: bool = False + response_done: bool = False + # this is a bit of a hack to make both mypy and PyCharm happy. + state: Callable[[events.Event], layer.CommandGenerator[None]] | Callable + body_reader: TBodyReader + buf: ReceiveBuffer + + ReceiveProtocolError: type[RequestProtocolError | ResponseProtocolError] + ReceiveData: type[RequestData | ResponseData] + ReceiveEndOfMessage: type[RequestEndOfMessage | ResponseEndOfMessage] + + def __init__(self, context: Context, conn: Connection): + super().__init__(context, conn) + self.buf = ReceiveBuffer() + + @abc.abstractmethod + def send(self, event: HttpEvent) -> layer.CommandGenerator[None]: + yield from () # pragma: no cover + + @abc.abstractmethod + def read_headers( + self, event: events.ConnectionEvent + ) -> layer.CommandGenerator[None]: + yield from () # pragma: no cover + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, HttpEvent): + yield from self.send(event) + else: + if ( + isinstance(event, events.DataReceived) + and self.state != self.passthrough + ): + self.buf += event.data + yield from self.state(event) + + @expect(events.Start) + def start(self, _) -> layer.CommandGenerator[None]: + self.state = self.read_headers + yield from () + + state = start + + def read_body(self, event: events.Event) -> layer.CommandGenerator[None]: + assert self.stream_id is not None + while True: + try: + if isinstance(event, events.DataReceived): + h11_event = self.body_reader(self.buf) + elif isinstance(event, events.ConnectionClosed): + h11_event = self.body_reader.read_eof() + else: + raise AssertionError(f"Unexpected event: {event}") + except h11.ProtocolError as e: + yield commands.CloseConnection(self.conn) + yield ReceiveHttp( + self.ReceiveProtocolError( + self.stream_id, + f"HTTP/1 protocol error: {e}", + code=self.ReceiveProtocolError.code, + ) + ) + return + + if h11_event is None: + return + elif isinstance(h11_event, h11.Data): + data: bytes = bytes(h11_event.data) + if data: + yield ReceiveHttp(self.ReceiveData(self.stream_id, data)) + elif isinstance(h11_event, h11.EndOfMessage): + assert self.request + if h11_event.headers: + raise NotImplementedError(f"HTTP trailers are not implemented yet.") + if self.request.data.method.upper() != b"CONNECT": + yield ReceiveHttp(self.ReceiveEndOfMessage(self.stream_id)) + is_request = isinstance(self, Http1Server) + yield from self.mark_done(request=is_request, response=not is_request) + return + + def wait(self, event: events.Event) -> layer.CommandGenerator[None]: + """ + We wait for the current flow to be finished before parsing the next message, + as we may want to upgrade to WebSocket or plain TCP before that. + """ + assert self.stream_id + if isinstance(event, events.DataReceived): + return + elif isinstance(event, events.ConnectionClosed): + # for practical purposes, we assume that a peer which sent at least a FIN + # is not interested in any more data from us, see + # see https://github.com/httpwg/http-core/issues/22 + if event.connection.state is not ConnectionState.CLOSED: + yield commands.CloseConnection(event.connection) + yield ReceiveHttp( + self.ReceiveProtocolError( + self.stream_id, + f"Client disconnected.", + code=ErrorCode.CLIENT_DISCONNECTED, + ) + ) + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event}") + + def done(self, event: events.ConnectionEvent) -> layer.CommandGenerator[None]: + yield from () # pragma: no cover + + def make_pipe(self) -> layer.CommandGenerator[None]: + self.state = self.passthrough + if self.buf: + already_received = self.buf.maybe_extract_at_most(len(self.buf)) or b"" + # Some clients send superfluous newlines after CONNECT, we want to eat those. + already_received = already_received.lstrip(b"\r\n") + if already_received: + yield from self.state(events.DataReceived(self.conn, already_received)) + + def passthrough(self, event: events.Event) -> layer.CommandGenerator[None]: + assert self.stream_id + if isinstance(event, events.DataReceived): + yield ReceiveHttp(self.ReceiveData(self.stream_id, event.data)) + elif isinstance(event, events.ConnectionClosed): + if isinstance(self, Http1Server): + yield ReceiveHttp(RequestEndOfMessage(self.stream_id)) + else: + yield ReceiveHttp(ResponseEndOfMessage(self.stream_id)) + + def mark_done( + self, *, request: bool = False, response: bool = False + ) -> layer.CommandGenerator[None]: + if request: + self.request_done = True + if response: + self.response_done = True + if self.request_done and self.response_done: + assert self.request + assert self.response + if should_make_pipe(self.request, self.response): + yield from self.make_pipe() + return + try: + read_until_eof_semantics = ( + http1.expected_http_body_size(self.request, self.response) == -1 + ) + except ValueError: + # this may raise only now (and not earlier) because an addon set invalid headers, + # in which case it's not really clear what we are supposed to do. + read_until_eof_semantics = False + connection_done = ( + read_until_eof_semantics + or http1.connection_close( + self.request.http_version, self.request.headers + ) + or http1.connection_close( + self.response.http_version, self.response.headers + ) + # If we proxy HTTP/2 to HTTP/1, we only use upstream connections for one request. + # This simplifies our connection management quite a bit as we can rely on + # the proxyserver's max-connection-per-server throttling. + or ( + (self.request.is_http2 or self.request.is_http3) + and isinstance(self, Http1Client) + ) + ) + if connection_done: + yield commands.CloseConnection(self.conn) + self.state = self.done + return + self.request_done = self.response_done = False + self.request = self.response = None + if isinstance(self, Http1Server): + self.stream_id += 2 + else: + self.stream_id = None + self.state = self.read_headers + if self.buf: + yield from self.state(events.DataReceived(self.conn, b"")) + + +class Http1Server(Http1Connection): + """A simple HTTP/1 server with no pipelining support.""" + + ReceiveProtocolError = RequestProtocolError + ReceiveData = RequestData + ReceiveEndOfMessage = RequestEndOfMessage + stream_id: int + + def __init__(self, context: Context): + super().__init__(context, context.client) + self.stream_id = 1 + + def send(self, event: HttpEvent) -> layer.CommandGenerator[None]: + assert event.stream_id == self.stream_id + if isinstance(event, ResponseHeaders): + self.response = response = event.response + + if response.is_http2 or response.is_http3: + response = response.copy() + # Convert to an HTTP/1 response. + response.http_version = "HTTP/1.1" + # not everyone supports empty reason phrases, so we better make up one. + response.reason = status_codes.RESPONSES.get(response.status_code, "") + # Shall we set a Content-Length header here if there is none? + # For now, let's try to modify as little as possible. + + raw = http1.assemble_response_head(response) + yield commands.SendData(self.conn, raw) + elif isinstance(event, ResponseData): + assert self.response + if "chunked" in self.response.headers.get("transfer-encoding", "").lower(): + raw = b"%x\r\n%s\r\n" % (len(event.data), event.data) + else: + raw = event.data + if raw: + yield commands.SendData(self.conn, raw) + elif isinstance(event, ResponseEndOfMessage): + assert self.request + assert self.response + if ( + self.request.method.upper() != "HEAD" + and "chunked" + in self.response.headers.get("transfer-encoding", "").lower() + ): + yield commands.SendData(self.conn, b"0\r\n\r\n") + yield from self.mark_done(response=True) + elif isinstance(event, ResponseProtocolError): + if not (self.conn.state & ConnectionState.CAN_WRITE): + return + status = event.code.http_status_code() + if not self.response and status is not None: + yield commands.SendData( + self.conn, make_error_response(status, event.message) + ) + yield commands.CloseConnection(self.conn) + else: + raise AssertionError(f"Unexpected event: {event}") + + def read_headers( + self, event: events.ConnectionEvent + ) -> layer.CommandGenerator[None]: + if isinstance(event, events.DataReceived): + request_head = self.buf.maybe_extract_lines() + if request_head: + try: + self.request = http1.read_request_head( + [bytes(x) for x in request_head] + ) + expected_body_size = http1.expected_http_body_size(self.request) + except ValueError as e: + yield commands.SendData(self.conn, make_error_response(400, str(e))) + yield commands.CloseConnection(self.conn) + if self.request: + # we have headers that we can show in the ui + yield ReceiveHttp( + RequestHeaders(self.stream_id, self.request, False) + ) + yield ReceiveHttp( + RequestProtocolError( + self.stream_id, str(e), ErrorCode.GENERIC_CLIENT_ERROR + ) + ) + else: + yield commands.Log( + f"{human.format_address(self.conn.peername)}: {e}" + ) + self.state = self.done + return + yield ReceiveHttp( + RequestHeaders( + self.stream_id, self.request, expected_body_size == 0 + ) + ) + self.body_reader = make_body_reader(expected_body_size) + self.state = self.read_body + yield from self.state(event) + else: + pass # FIXME: protect against header size DoS + elif isinstance(event, events.ConnectionClosed): + buf = bytes(self.buf) + if buf.strip(): + yield commands.Log( + f"Client closed connection before completing request headers: {buf!r}" + ) + yield commands.CloseConnection(self.conn) + else: + raise AssertionError(f"Unexpected event: {event}") + + def mark_done( + self, *, request: bool = False, response: bool = False + ) -> layer.CommandGenerator[None]: + yield from super().mark_done(request=request, response=response) + if self.request_done and not self.response_done: + self.state = self.wait + + +class Http1Client(Http1Connection): + """A simple HTTP/1 client with no pipelining support.""" + + ReceiveProtocolError = ResponseProtocolError + ReceiveData = ResponseData + ReceiveEndOfMessage = ResponseEndOfMessage + + def __init__(self, context: Context): + super().__init__(context, context.server) + + def send(self, event: HttpEvent) -> layer.CommandGenerator[None]: + if isinstance(event, RequestProtocolError): + yield commands.CloseConnection(self.conn) + return + + if self.stream_id is None: + assert isinstance(event, RequestHeaders) + self.stream_id = event.stream_id + self.request = event.request + assert self.stream_id == event.stream_id + + if isinstance(event, RequestHeaders): + request = event.request + if request.is_http2 or request.is_http3: + # Convert to an HTTP/1 request. + request = ( + request.copy() + ) # (we could probably be a bit more efficient here.) + request.http_version = "HTTP/1.1" + if "Host" not in request.headers and request.authority: + request.headers.insert(0, "Host", request.authority) + request.authority = "" + cookie_headers = request.headers.get_all("Cookie") + if len(cookie_headers) > 1: + # Only HTTP/2 supports multiple cookie headers, HTTP/1.x does not. + # see: https://www.rfc-editor.org/rfc/rfc6265#section-5.4 + # https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2.5 + request.headers["Cookie"] = "; ".join(cookie_headers) + raw = http1.assemble_request_head(request) + yield commands.SendData(self.conn, raw) + elif isinstance(event, RequestData): + assert self.request + if "chunked" in self.request.headers.get("transfer-encoding", "").lower(): + raw = b"%x\r\n%s\r\n" % (len(event.data), event.data) + else: + raw = event.data + if raw: + yield commands.SendData(self.conn, raw) + elif isinstance(event, RequestEndOfMessage): + assert self.request + if "chunked" in self.request.headers.get("transfer-encoding", "").lower(): + yield commands.SendData(self.conn, b"0\r\n\r\n") + elif http1.expected_http_body_size(self.request, self.response) == -1: + yield commands.CloseTcpConnection(self.conn, half_close=True) + yield from self.mark_done(request=True) + else: + raise AssertionError(f"Unexpected event: {event}") + + def read_headers( + self, event: events.ConnectionEvent + ) -> layer.CommandGenerator[None]: + if isinstance(event, events.DataReceived): + if not self.request: + # we just received some data for an unknown request. + yield commands.Log(f"Unexpected data from server: {bytes(self.buf)!r}") + yield commands.CloseConnection(self.conn) + return + assert self.stream_id is not None + + response_head = self.buf.maybe_extract_lines() + if response_head: + try: + self.response = http1.read_response_head( + [bytes(x) for x in response_head] + ) + expected_size = http1.expected_http_body_size( + self.request, self.response + ) + except ValueError as e: + yield commands.CloseConnection(self.conn) + yield ReceiveHttp( + ResponseProtocolError( + self.stream_id, + f"Cannot parse HTTP response: {e}", + ErrorCode.GENERIC_SERVER_ERROR, + ) + ) + return + yield ReceiveHttp( + ResponseHeaders(self.stream_id, self.response, expected_size == 0) + ) + self.body_reader = make_body_reader(expected_size) + + self.state = self.read_body + yield from self.state(event) + else: + pass # FIXME: protect against header size DoS + elif isinstance(event, events.ConnectionClosed): + if self.conn.state & ConnectionState.CAN_WRITE: + yield commands.CloseConnection(self.conn) + if self.stream_id: + if self.buf: + yield ReceiveHttp( + ResponseProtocolError( + self.stream_id, + f"unexpected server response: {bytes(self.buf)!r}", + ErrorCode.GENERIC_SERVER_ERROR, + ) + ) + else: + # The server has closed the connection to prevent us from continuing. + # We need to signal that to the stream. + # https://tools.ietf.org/html/rfc7231#section-6.5.11 + yield ReceiveHttp( + ResponseProtocolError( + self.stream_id, + "server closed connection", + ErrorCode.GENERIC_SERVER_ERROR, + ) + ) + else: + return + else: + raise AssertionError(f"Unexpected event: {event}") + + +def should_make_pipe(request: http.Request, response: http.Response) -> bool: + if response.status_code == 101: + return True + elif response.status_code == 200 and request.method.upper() == "CONNECT": + return True + else: + return False + + +def make_body_reader(expected_size: int | None) -> TBodyReader: + if expected_size is None: + return ChunkedReader() + elif expected_size == -1: + return Http10Reader() + else: + return ContentLengthReader(expected_size) + + +def make_error_response( + status_code: int, + message: str = "", +) -> bytes: + resp = http.Response.make( + status_code, + format_error(status_code, message), + http.Headers( + Server=version.MITMPROXY, + Connection="close", + Content_Type="text/html", + ), + ) + return http1.assemble_response(resp) + + +__all__ = [ + "Http1Client", + "Http1Server", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http2.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http2.py new file mode 100644 index 0000000000000000000000000000000000000000..516f3ce6cb0120db1849152b55913786c48dcba9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http2.py @@ -0,0 +1,714 @@ +import collections +import time +from collections.abc import Sequence +from enum import Enum +from logging import DEBUG +from logging import ERROR +from typing import Any +from typing import assert_never +from typing import ClassVar + +import h2.config +import h2.connection +import h2.errors +import h2.events +import h2.exceptions +import h2.settings +import h2.stream +import h2.utilities + +from ...commands import CloseConnection +from ...commands import Log +from ...commands import RequestWakeup +from ...commands import SendData +from ...context import Context +from ...events import ConnectionClosed +from ...events import DataReceived +from ...events import Event +from ...events import Start +from ...events import Wakeup +from ...layer import CommandGenerator +from ...utils import expect +from . import ErrorCode +from . import RequestData +from . import RequestEndOfMessage +from . import RequestHeaders +from . import RequestProtocolError +from . import RequestTrailers +from . import ResponseData +from . import ResponseEndOfMessage +from . import ResponseHeaders +from . import ResponseProtocolError +from . import ResponseTrailers +from ._base import format_error +from ._base import HttpConnection +from ._base import HttpEvent +from ._base import ReceiveHttp +from ._http_h2 import BufferedH2Connection +from ._http_h2 import H2ConnectionLogger +from mitmproxy import http +from mitmproxy import version +from mitmproxy.connection import Connection +from mitmproxy.net.http import status_codes +from mitmproxy.net.http import url +from mitmproxy.utils import human + + +class StreamState(Enum): + EXPECTING_HEADERS = 1 + HEADERS_RECEIVED = 2 + + +CATCH_HYPER_H2_ERRORS = (ValueError, IndexError) + + +class Http2Connection(HttpConnection): + h2_conf: ClassVar[h2.config.H2Configuration] + h2_conf_defaults: dict[str, Any] = dict( + header_encoding=False, + validate_outbound_headers=False, + # validate_inbound_headers is controlled by the validate_inbound_headers option. + normalize_inbound_headers=False, # changing this to True is required to pass h2spec + normalize_outbound_headers=False, + ) + h2_conn: BufferedH2Connection + streams: dict[int, StreamState] + """keep track of all active stream ids to send protocol errors on teardown""" + + ReceiveProtocolError: type[RequestProtocolError | ResponseProtocolError] + ReceiveData: type[RequestData | ResponseData] + ReceiveTrailers: type[RequestTrailers | ResponseTrailers] + ReceiveEndOfMessage: type[RequestEndOfMessage | ResponseEndOfMessage] + + def __init__(self, context: Context, conn: Connection): + super().__init__(context, conn) + if self.debug: + self.h2_conf.logger = H2ConnectionLogger( + self.context.client.peername, self.__class__.__name__ + ) + self.h2_conf.validate_inbound_headers = ( + self.context.options.validate_inbound_headers + ) + self.h2_conn = BufferedH2Connection(self.h2_conf) + self.streams = {} + + def is_closed(self, stream_id: int) -> bool: + """Check if a non-idle stream is closed""" + stream = self.h2_conn.streams.get(stream_id, None) + if ( + stream is not None + and stream.state_machine.state is not h2.stream.StreamState.CLOSED + and self.h2_conn.state_machine.state + is not h2.connection.ConnectionState.CLOSED + ): + return False + else: + return True + + def is_open_for_us(self, stream_id: int) -> bool: + """Check if we can write to a non-idle stream.""" + stream = self.h2_conn.streams.get(stream_id, None) + if ( + stream is not None + and stream.state_machine.state + is not h2.stream.StreamState.HALF_CLOSED_LOCAL + and stream.state_machine.state is not h2.stream.StreamState.CLOSED + and self.h2_conn.state_machine.state + is not h2.connection.ConnectionState.CLOSED + ): + return True + else: + return False + + def _handle_event(self, event: Event) -> CommandGenerator[None]: + if isinstance(event, Start): + self.h2_conn.initiate_connection() + yield SendData(self.conn, self.h2_conn.data_to_send()) + + elif isinstance(event, HttpEvent): + if isinstance(event, (RequestData, ResponseData)): + if self.is_open_for_us(event.stream_id): + self.h2_conn.send_data(event.stream_id, event.data) + elif isinstance(event, (RequestTrailers, ResponseTrailers)): + if self.is_open_for_us(event.stream_id): + trailers = [*event.trailers.fields] + self.h2_conn.send_trailers(event.stream_id, trailers) + elif isinstance(event, (RequestEndOfMessage, ResponseEndOfMessage)): + if self.is_open_for_us(event.stream_id): + self.h2_conn.end_stream(event.stream_id) + elif isinstance(event, (RequestProtocolError, ResponseProtocolError)): + if not self.is_closed(event.stream_id): + stream: h2.stream.H2Stream = self.h2_conn.streams[event.stream_id] + status = event.code.http_status_code() + if ( + isinstance(event, ResponseProtocolError) + and self.is_open_for_us(event.stream_id) + and not stream.state_machine.headers_sent + and status is not None + ): + self.h2_conn.send_headers( + event.stream_id, + [ + (b":status", b"%d" % status), + (b"server", version.MITMPROXY.encode()), + (b"content-type", b"text/html"), + ], + ) + self.h2_conn.send_data( + event.stream_id, + format_error(status, event.message), + end_stream=True, + ) + else: + match event.code: + case ErrorCode.CANCEL | ErrorCode.CLIENT_DISCONNECTED: + error_code = h2.errors.ErrorCodes.CANCEL + case ErrorCode.KILL: + # XXX: Debateable whether this is the best error code. + error_code = h2.errors.ErrorCodes.INTERNAL_ERROR + case ErrorCode.HTTP_1_1_REQUIRED: + error_code = h2.errors.ErrorCodes.HTTP_1_1_REQUIRED + case ErrorCode.PASSTHROUGH_CLOSE: + # FIXME: This probably shouldn't be a protocol error, but an EOM event. + error_code = h2.errors.ErrorCodes.CANCEL + case ( + ErrorCode.GENERIC_CLIENT_ERROR + | ErrorCode.GENERIC_SERVER_ERROR + | ErrorCode.REQUEST_TOO_LARGE + | ErrorCode.RESPONSE_TOO_LARGE + | ErrorCode.CONNECT_FAILED + | ErrorCode.DESTINATION_UNKNOWN + | ErrorCode.REQUEST_VALIDATION_FAILED + | ErrorCode.RESPONSE_VALIDATION_FAILED + ): + error_code = h2.errors.ErrorCodes.INTERNAL_ERROR + case other: # pragma: no cover + assert_never(other) + self.h2_conn.reset_stream(event.stream_id, error_code.value) + else: + raise AssertionError(f"Unexpected event: {event}") + data_to_send = self.h2_conn.data_to_send() + if data_to_send: + yield SendData(self.conn, data_to_send) + + elif isinstance(event, DataReceived): + try: + try: + events = self.h2_conn.receive_data(event.data) + except CATCH_HYPER_H2_ERRORS as e: # pragma: no cover + # this should never raise a ValueError, but we triggered one while fuzzing: + # https://github.com/python-hyper/hyper-h2/issues/1231 + # this stays here as defense-in-depth. + raise h2.exceptions.ProtocolError( + f"uncaught hyper-h2 error: {e}" + ) from e + except h2.exceptions.ProtocolError as e: + events = [e] + + for h2_event in events: + if self.debug: + yield Log(f"{self.debug}[h2] {h2_event}", DEBUG) + if (yield from self.handle_h2_event(h2_event)): + if self.debug: + yield Log(f"{self.debug}[h2] done", DEBUG) + return + + data_to_send = self.h2_conn.data_to_send() + if data_to_send: + yield SendData(self.conn, data_to_send) + + elif isinstance(event, ConnectionClosed): + yield from self.close_connection("peer closed connection") + else: + raise AssertionError(f"Unexpected event: {event!r}") + + def handle_h2_event(self, event: h2.events.Event) -> CommandGenerator[bool]: + """returns true if further processing should be stopped.""" + if isinstance(event, h2.events.DataReceived): + state = self.streams.get(event.stream_id, None) + if state is StreamState.HEADERS_RECEIVED: + is_empty_eos_data_frame = event.stream_ended and not event.data + if not is_empty_eos_data_frame: + yield ReceiveHttp(self.ReceiveData(event.stream_id, event.data)) + elif state is StreamState.EXPECTING_HEADERS: + yield from self.protocol_error( + f"Received HTTP/2 data frame, expected headers." + ) + return True + self.h2_conn.acknowledge_received_data( + event.flow_controlled_length, event.stream_id + ) + elif isinstance(event, h2.events.TrailersReceived): + trailers = http.Headers(event.headers) + yield ReceiveHttp(self.ReceiveTrailers(event.stream_id, trailers)) + elif isinstance(event, h2.events.StreamEnded): + state = self.streams.get(event.stream_id, None) + if state is StreamState.HEADERS_RECEIVED: + yield ReceiveHttp(self.ReceiveEndOfMessage(event.stream_id)) + elif state is StreamState.EXPECTING_HEADERS: + raise AssertionError("unreachable") + if self.is_closed(event.stream_id): + self.streams.pop(event.stream_id, None) + elif isinstance(event, h2.events.StreamReset): + if event.stream_id in self.streams: + try: + err_str = h2.errors.ErrorCodes(event.error_code).name + except ValueError: + err_str = str(event.error_code) + match event.error_code: + case h2.errors.ErrorCodes.CANCEL: + err_code = ErrorCode.CANCEL + case h2.errors.ErrorCodes.HTTP_1_1_REQUIRED: + err_code = ErrorCode.HTTP_1_1_REQUIRED + case _: + err_code = self.ReceiveProtocolError.code + yield ReceiveHttp( + self.ReceiveProtocolError( + event.stream_id, + f"stream reset by client ({err_str})", + code=err_code, + ) + ) + self.streams.pop(event.stream_id) + else: + pass # We don't track priority frames which could be followed by a stream reset here. + elif isinstance(event, h2.exceptions.ProtocolError): + yield from self.protocol_error(f"HTTP/2 protocol error: {event}") + return True + elif isinstance(event, h2.events.ConnectionTerminated): + yield from self.close_connection(f"HTTP/2 connection closed: {event!r}") + return True + # The implementation above isn't really ideal, we should probably only terminate streams > last_stream_id? + # We currently lack a mechanism to signal that connections are still active but cannot be reused. + # for stream_id in self.streams: + # if stream_id > event.last_stream_id: + # yield ReceiveHttp(self.ReceiveProtocolError(stream_id, f"HTTP/2 connection closed: {event!r}")) + # self.streams.pop(stream_id) + elif isinstance(event, h2.events.RemoteSettingsChanged): + pass + elif isinstance(event, h2.events.SettingsAcknowledged): + pass + elif isinstance(event, h2.events.PriorityUpdated): + pass + elif isinstance(event, h2.events.PingReceived): + pass + elif isinstance(event, h2.events.PingAckReceived): + pass + elif isinstance(event, h2.events.PushedStreamReceived): + yield Log( + "Received HTTP/2 push promise, even though we signalled no support.", + ERROR, + ) + elif isinstance(event, h2.events.UnknownFrameReceived): + # https://http2.github.io/http2-spec/#rfc.section.4.1 + # Implementations MUST ignore and discard any frame that has a type that is unknown. + yield Log(f"Ignoring unknown HTTP/2 frame type: {event.frame.type}") + elif isinstance(event, h2.events.AlternativeServiceAvailable): + yield Log( + "Received HTTP/2 Alt-Svc frame, which will not be forwarded.", DEBUG + ) + else: + raise AssertionError(f"Unexpected event: {event!r}") + return False + + def protocol_error( + self, + message: str, + error_code: int = h2.errors.ErrorCodes.PROTOCOL_ERROR, + ) -> CommandGenerator[None]: + yield Log(f"{human.format_address(self.conn.peername)}: {message}") + self.h2_conn.close_connection(error_code, message.encode()) + yield SendData(self.conn, self.h2_conn.data_to_send()) + yield from self.close_connection(message) + + def close_connection(self, msg: str) -> CommandGenerator[None]: + yield CloseConnection(self.conn) + for stream_id in self.streams: + yield ReceiveHttp( + self.ReceiveProtocolError( + stream_id, msg, self.ReceiveProtocolError.code + ) + ) + self.streams.clear() + self._handle_event = self.done # type: ignore + + @expect(DataReceived, HttpEvent, ConnectionClosed, Wakeup) + def done(self, _) -> CommandGenerator[None]: + yield from () + + +def normalize_h1_headers( + headers: list[tuple[bytes, bytes]], is_client: bool +) -> list[tuple[bytes, bytes]]: + # HTTP/1 servers commonly send capitalized headers (Content-Length vs content-length), + # which isn't valid HTTP/2. As such we normalize. + # Make sure that this is not just an iterator but an iterable, + # otherwise hyper-h2 will silently drop headers. + return list( + h2.utilities.normalize_outbound_headers( + headers, + h2.utilities.HeaderValidationFlags(is_client, False, not is_client, False), + ) + ) + + +def normalize_h2_headers(headers: list[tuple[bytes, bytes]]) -> CommandGenerator[None]: + for i in range(len(headers)): + if not headers[i][0].islower(): + yield Log( + f"Lowercased {repr(headers[i][0]).lstrip('b')} header as uppercase is not allowed with HTTP/2." + ) + headers[i] = (headers[i][0].lower(), headers[i][1]) + + +def format_h2_request_headers( + context: Context, + event: RequestHeaders, +) -> CommandGenerator[list[tuple[bytes, bytes]]]: + pseudo_headers = [ + (b":method", event.request.data.method), + (b":scheme", event.request.data.scheme), + (b":path", event.request.data.path), + ] + if event.request.authority: + pseudo_headers.append((b":authority", event.request.data.authority)) + + if event.request.is_http2 or event.request.is_http3: + hdrs = list(event.request.headers.fields) + if context.options.normalize_outbound_headers: + yield from normalize_h2_headers(hdrs) + else: + headers = event.request.headers + if not event.request.authority and "host" in headers: + headers = headers.copy() + pseudo_headers.append((b":authority", headers.pop(b"host"))) + hdrs = normalize_h1_headers(list(headers.fields), True) + + return pseudo_headers + hdrs + + +def format_h2_response_headers( + context: Context, + event: ResponseHeaders, +) -> CommandGenerator[list[tuple[bytes, bytes]]]: + headers = [ + (b":status", b"%d" % event.response.status_code), + *event.response.headers.fields, + ] + if event.response.is_http2 or event.response.is_http3: + if context.options.normalize_outbound_headers: + yield from normalize_h2_headers(headers) + else: + headers = normalize_h1_headers(headers, False) + return headers + + +class Http2Server(Http2Connection): + h2_conf = h2.config.H2Configuration( + **Http2Connection.h2_conf_defaults, + client_side=False, + ) + + ReceiveProtocolError = RequestProtocolError + ReceiveData = RequestData + ReceiveTrailers = RequestTrailers + ReceiveEndOfMessage = RequestEndOfMessage + + def __init__(self, context: Context): + super().__init__(context, context.client) + + def _handle_event(self, event: Event) -> CommandGenerator[None]: + if isinstance(event, ResponseHeaders): + if self.is_open_for_us(event.stream_id): + self.h2_conn.send_headers( + event.stream_id, + headers=( + yield from format_h2_response_headers(self.context, event) + ), + end_stream=event.end_stream, + ) + yield SendData(self.conn, self.h2_conn.data_to_send()) + else: + yield from super()._handle_event(event) + + def handle_h2_event(self, event: h2.events.Event) -> CommandGenerator[bool]: + if isinstance(event, h2.events.RequestReceived): + try: + ( + host, + port, + method, + scheme, + authority, + path, + headers, + ) = parse_h2_request_headers(event.headers) + except ValueError as e: + yield from self.protocol_error(f"Invalid HTTP/2 request headers: {e}") + return True + request = http.Request( + host=host, + port=port, + method=method, + scheme=scheme, + authority=authority, + path=path, + http_version=b"HTTP/2.0", + headers=headers, + content=None, + trailers=None, + timestamp_start=time.time(), + timestamp_end=None, + ) + self.streams[event.stream_id] = StreamState.HEADERS_RECEIVED + yield ReceiveHttp( + RequestHeaders( + event.stream_id, request, end_stream=bool(event.stream_ended) + ) + ) + return False + else: + return (yield from super().handle_h2_event(event)) + + +class Http2Client(Http2Connection): + h2_conf = h2.config.H2Configuration( + **Http2Connection.h2_conf_defaults, + client_side=True, + ) + + ReceiveProtocolError = ResponseProtocolError + ReceiveData = ResponseData + ReceiveTrailers = ResponseTrailers + ReceiveEndOfMessage = ResponseEndOfMessage + + our_stream_id: dict[int, int] + their_stream_id: dict[int, int] + stream_queue: collections.defaultdict[int, list[Event]] + """Queue of streams that we haven't sent yet because we have reached MAX_CONCURRENT_STREAMS""" + provisional_max_concurrency: int | None = 10 + """A provisional currency limit before we get the server's first settings frame.""" + last_activity: float + """Timestamp of when we've last seen network activity on this connection.""" + + def __init__(self, context: Context): + super().__init__(context, context.server) + # Disable HTTP/2 push for now to keep things simple. + # don't send here, that is done as part of initiate_connection(). + self.h2_conn.local_settings.enable_push = 0 + # hyper-h2 pitfall: we need to acknowledge here, otherwise its sends out the old settings. + self.h2_conn.local_settings.acknowledge() + self.our_stream_id = {} + self.their_stream_id = {} + self.stream_queue = collections.defaultdict(list) + + def _handle_event(self, event: Event) -> CommandGenerator[None]: + # We can't reuse stream ids from the client because they may arrived reordered here + # and HTTP/2 forbids opening a stream on a lower id than what was previously sent (see test_stream_concurrency). + # To mitigate this, we transparently map the outside's stream id to our stream id. + if isinstance(event, HttpEvent): + ours = self.our_stream_id.get(event.stream_id, None) + if ours is None: + no_free_streams = self.h2_conn.open_outbound_streams >= ( + self.provisional_max_concurrency + or self.h2_conn.remote_settings.max_concurrent_streams + ) + if no_free_streams: + self.stream_queue[event.stream_id].append(event) + return + ours = self.h2_conn.get_next_available_stream_id() + self.our_stream_id[event.stream_id] = ours + self.their_stream_id[ours] = event.stream_id + event.stream_id = ours + + for cmd in self._handle_event2(event): + if isinstance(cmd, ReceiveHttp): + cmd.event.stream_id = self.their_stream_id[cmd.event.stream_id] + yield cmd + + can_resume_queue = self.stream_queue and self.h2_conn.open_outbound_streams < ( + self.provisional_max_concurrency + or self.h2_conn.remote_settings.max_concurrent_streams + ) + if can_resume_queue: + # popitem would be LIFO, but we want FIFO. + events = self.stream_queue.pop(next(iter(self.stream_queue))) + for event in events: + yield from self._handle_event(event) + + def _handle_event2(self, event: Event) -> CommandGenerator[None]: + if isinstance(event, Wakeup): + send_ping_now = ( + # add one second to avoid unnecessary roundtrip, we don't need to be super correct here. + time.time() - self.last_activity + 1 + > self.context.options.http2_ping_keepalive + ) + if send_ping_now: + # PING frames MUST contain 8 octets of opaque data in the payload. + # A sender can include any value it chooses and use those octets in any fashion. + self.last_activity = time.time() + self.h2_conn.ping(b"0" * 8) + data = self.h2_conn.data_to_send() + if data is not None: + yield Log( + f"Send HTTP/2 keep-alive PING to {human.format_address(self.conn.peername)}", + DEBUG, + ) + yield SendData(self.conn, data) + time_until_next_ping = self.context.options.http2_ping_keepalive - ( + time.time() - self.last_activity + ) + yield RequestWakeup(time_until_next_ping) + return + + self.last_activity = time.time() + if isinstance(event, Start): + if self.context.options.http2_ping_keepalive > 0: + yield RequestWakeup(self.context.options.http2_ping_keepalive) + yield from super()._handle_event(event) + elif isinstance(event, RequestHeaders): + self.h2_conn.send_headers( + event.stream_id, + headers=(yield from format_h2_request_headers(self.context, event)), + end_stream=event.end_stream, + ) + self.streams[event.stream_id] = StreamState.EXPECTING_HEADERS + yield SendData(self.conn, self.h2_conn.data_to_send()) + else: + yield from super()._handle_event(event) + + def handle_h2_event(self, event: h2.events.Event) -> CommandGenerator[bool]: + if isinstance(event, h2.events.ResponseReceived): + if ( + self.streams.get(event.stream_id, None) + is not StreamState.EXPECTING_HEADERS + ): + yield from self.protocol_error(f"Received unexpected HTTP/2 response.") + return True + + try: + status_code, headers = parse_h2_response_headers(event.headers) + except ValueError as e: + yield from self.protocol_error(f"Invalid HTTP/2 response headers: {e}") + return True + + response = http.Response( + http_version=b"HTTP/2.0", + status_code=status_code, + reason=b"", + headers=headers, + content=None, + trailers=None, + timestamp_start=time.time(), + timestamp_end=None, + ) + self.streams[event.stream_id] = StreamState.HEADERS_RECEIVED + yield ReceiveHttp( + ResponseHeaders(event.stream_id, response, bool(event.stream_ended)) + ) + return False + elif isinstance(event, h2.events.InformationalResponseReceived): + # We violate the spec here ("A proxy MUST forward 1xx responses", RFC 7231), + # but that's probably fine: + # - 100 Continue is sent by mitmproxy to clients (irrespective of what the server does). + # - 101 Switching Protocols is not allowed for HTTP/2. + # - 102 Processing is WebDAV only and also ignorable. + # - 103 Early Hints is not mission-critical. + headers = http.Headers(event.headers) + status: str | int = "" + try: + status = int(headers[":status"]) + reason = status_codes.RESPONSES.get(status, "") + except (KeyError, ValueError): + reason = "" + yield Log(f"Swallowing HTTP/2 informational response: {status} {reason}") + return False + elif isinstance(event, h2.events.RequestReceived): + yield from self.protocol_error( + f"HTTP/2 protocol error: received request from server" + ) + return True + elif isinstance(event, h2.events.RemoteSettingsChanged): + # We have received at least one settings from now, + # which means we can rely on the max concurrency in remote_settings + self.provisional_max_concurrency = None + return (yield from super().handle_h2_event(event)) + else: + return (yield from super().handle_h2_event(event)) + + +def split_pseudo_headers( + h2_headers: Sequence[tuple[bytes, bytes]], +) -> tuple[dict[bytes, bytes], http.Headers]: + pseudo_headers: dict[bytes, bytes] = {} + i = 0 + for header, value in h2_headers: + if header.startswith(b":"): + if header in pseudo_headers: + raise ValueError(f"Duplicate HTTP/2 pseudo header: {header!r}") + pseudo_headers[header] = value + i += 1 + else: + # Pseudo-headers must be at the start, we are done here. + break + + headers = http.Headers(h2_headers[i:]) + + return pseudo_headers, headers + + +def parse_h2_request_headers( + h2_headers: Sequence[tuple[bytes, bytes]], +) -> tuple[str, int, bytes, bytes, bytes, bytes, http.Headers]: + """Split HTTP/2 pseudo-headers from the actual headers and parse them.""" + pseudo_headers, headers = split_pseudo_headers(h2_headers) + + try: + method: bytes = pseudo_headers.pop(b":method") + scheme: bytes = pseudo_headers.pop( + b":scheme" + ) # this raises for HTTP/2 CONNECT requests + path: bytes = pseudo_headers.pop(b":path") + authority: bytes = pseudo_headers.pop(b":authority", b"") + except KeyError as e: + raise ValueError(f"Required pseudo header is missing: {e}") + + if pseudo_headers: + raise ValueError(f"Unknown pseudo headers: {pseudo_headers}") + + if authority: + host, port = url.parse_authority(authority, check=True) + if port is None: + port = 80 if scheme == b"http" else 443 + else: + host = "" + port = 0 + + return host, port, method, scheme, authority, path, headers + + +def parse_h2_response_headers( + h2_headers: Sequence[tuple[bytes, bytes]], +) -> tuple[int, http.Headers]: + """Split HTTP/2 pseudo-headers from the actual headers and parse them.""" + pseudo_headers, headers = split_pseudo_headers(h2_headers) + + try: + status_code: int = int(pseudo_headers.pop(b":status")) + except KeyError as e: + raise ValueError(f"Required pseudo header is missing: {e}") + + if pseudo_headers: + raise ValueError(f"Unknown pseudo headers: {pseudo_headers}") + + return status_code, headers + + +__all__ = [ + "format_h2_request_headers", + "format_h2_response_headers", + "parse_h2_request_headers", + "parse_h2_response_headers", + "Http2Client", + "Http2Server", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http3.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http3.py new file mode 100644 index 0000000000000000000000000000000000000000..273237fd5e98212f7cc4e4faffafd081ddba72c3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http3.py @@ -0,0 +1,309 @@ +import time +from abc import abstractmethod +from typing import assert_never + +from aioquic.h3.connection import ErrorCode as H3ErrorCode +from aioquic.h3.connection import FrameUnexpected as H3FrameUnexpected +from aioquic.h3.events import DataReceived +from aioquic.h3.events import HeadersReceived +from aioquic.h3.events import PushPromiseReceived + +from . import ErrorCode +from . import RequestData +from . import RequestEndOfMessage +from . import RequestHeaders +from . import RequestProtocolError +from . import RequestTrailers +from . import ResponseData +from . import ResponseEndOfMessage +from . import ResponseHeaders +from . import ResponseProtocolError +from . import ResponseTrailers +from ._base import format_error +from ._base import HttpConnection +from ._base import HttpEvent +from ._base import ReceiveHttp +from ._http2 import format_h2_request_headers +from ._http2 import format_h2_response_headers +from ._http2 import parse_h2_request_headers +from ._http2 import parse_h2_response_headers +from ._http_h3 import LayeredH3Connection +from ._http_h3 import StreamClosed +from ._http_h3 import TrailersReceived +from mitmproxy import connection +from mitmproxy import http +from mitmproxy import version +from mitmproxy.proxy import commands +from mitmproxy.proxy import context +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.layers.quic import error_code_to_str +from mitmproxy.proxy.layers.quic import QuicConnectionClosed +from mitmproxy.proxy.layers.quic import QuicStreamEvent +from mitmproxy.proxy.utils import expect + + +class Http3Connection(HttpConnection): + h3_conn: LayeredH3Connection + + ReceiveData: type[RequestData | ResponseData] + ReceiveEndOfMessage: type[RequestEndOfMessage | ResponseEndOfMessage] + ReceiveProtocolError: type[RequestProtocolError | ResponseProtocolError] + ReceiveTrailers: type[RequestTrailers | ResponseTrailers] + + def __init__(self, context: context.Context, conn: connection.Connection): + super().__init__(context, conn) + self.h3_conn = LayeredH3Connection( + self.conn, is_client=self.conn is self.context.server + ) + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, events.Start): + yield from self.h3_conn.transmit() + + # send mitmproxy HTTP events over the H3 connection + elif isinstance(event, HttpEvent): + try: + if isinstance(event, (RequestData, ResponseData)): + self.h3_conn.send_data(event.stream_id, event.data) + elif isinstance(event, (RequestHeaders, ResponseHeaders)): + headers = yield from ( + format_h2_request_headers(self.context, event) + if isinstance(event, RequestHeaders) + else format_h2_response_headers(self.context, event) + ) + self.h3_conn.send_headers( + event.stream_id, headers, end_stream=event.end_stream + ) + elif isinstance(event, (RequestTrailers, ResponseTrailers)): + self.h3_conn.send_trailers( + event.stream_id, [*event.trailers.fields] + ) + elif isinstance(event, (RequestEndOfMessage, ResponseEndOfMessage)): + self.h3_conn.end_stream(event.stream_id) + elif isinstance(event, (RequestProtocolError, ResponseProtocolError)): + status = event.code.http_status_code() + if ( + isinstance(event, ResponseProtocolError) + and not self.h3_conn.has_sent_headers(event.stream_id) + and status is not None + ): + self.h3_conn.send_headers( + event.stream_id, + [ + (b":status", b"%d" % status), + (b"server", version.MITMPROXY.encode()), + (b"content-type", b"text/html"), + ], + ) + self.h3_conn.send_data( + event.stream_id, + format_error(status, event.message), + end_stream=True, + ) + else: + match event.code: + case ErrorCode.CANCEL | ErrorCode.CLIENT_DISCONNECTED: + error_code = H3ErrorCode.H3_REQUEST_CANCELLED + case ErrorCode.KILL: + error_code = H3ErrorCode.H3_INTERNAL_ERROR + case ErrorCode.HTTP_1_1_REQUIRED: + error_code = H3ErrorCode.H3_VERSION_FALLBACK + case ErrorCode.PASSTHROUGH_CLOSE: + # FIXME: This probably shouldn't be a protocol error, but an EOM event. + error_code = H3ErrorCode.H3_REQUEST_CANCELLED + case ( + ErrorCode.GENERIC_CLIENT_ERROR + | ErrorCode.GENERIC_SERVER_ERROR + | ErrorCode.REQUEST_TOO_LARGE + | ErrorCode.RESPONSE_TOO_LARGE + | ErrorCode.CONNECT_FAILED + | ErrorCode.DESTINATION_UNKNOWN + | ErrorCode.REQUEST_VALIDATION_FAILED + | ErrorCode.RESPONSE_VALIDATION_FAILED + ): + error_code = H3ErrorCode.H3_INTERNAL_ERROR + case other: # pragma: no cover + assert_never(other) + self.h3_conn.close_stream(event.stream_id, error_code.value) + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event!r}") + + except H3FrameUnexpected as e: + # Http2Connection also ignores HttpEvents that violate the current stream state + yield commands.Log(f"Received {event!r} unexpectedly: {e}") + + else: + # transmit buffered data + yield from self.h3_conn.transmit() + + # forward stream messages from the QUIC layer to the H3 connection + elif isinstance(event, QuicStreamEvent): + h3_events = self.h3_conn.handle_stream_event(event) + for h3_event in h3_events: + if isinstance(h3_event, StreamClosed): + err_str = error_code_to_str(h3_event.error_code) + match h3_event.error_code: + case H3ErrorCode.H3_REQUEST_CANCELLED: + err_code = ErrorCode.CANCEL + case H3ErrorCode.H3_VERSION_FALLBACK: + err_code = ErrorCode.HTTP_1_1_REQUIRED + case _: + err_code = self.ReceiveProtocolError.code + yield ReceiveHttp( + self.ReceiveProtocolError( + h3_event.stream_id, + f"stream closed by client ({err_str})", + code=err_code, + ) + ) + elif isinstance(h3_event, DataReceived): + if h3_event.data: + yield ReceiveHttp( + self.ReceiveData(h3_event.stream_id, h3_event.data) + ) + if h3_event.stream_ended: + yield ReceiveHttp(self.ReceiveEndOfMessage(h3_event.stream_id)) + elif isinstance(h3_event, HeadersReceived): + try: + receive_event = self.parse_headers(h3_event) + except ValueError as e: + self.h3_conn.close_connection( + error_code=H3ErrorCode.H3_GENERAL_PROTOCOL_ERROR, + reason_phrase=f"Invalid HTTP/3 request headers: {e}", + ) + else: + yield ReceiveHttp(receive_event) + if h3_event.stream_ended: + yield ReceiveHttp( + self.ReceiveEndOfMessage(h3_event.stream_id) + ) + elif isinstance(h3_event, TrailersReceived): + yield ReceiveHttp( + self.ReceiveTrailers( + h3_event.stream_id, http.Headers(h3_event.trailers) + ) + ) + if h3_event.stream_ended: + yield ReceiveHttp(self.ReceiveEndOfMessage(h3_event.stream_id)) + elif isinstance(h3_event, PushPromiseReceived): # pragma: no cover + self.h3_conn.close_connection( + error_code=H3ErrorCode.H3_GENERAL_PROTOCOL_ERROR, + reason_phrase=f"Received HTTP/3 push promise, even though we signalled no support.", + ) + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event!r}") + yield from self.h3_conn.transmit() + + # report a protocol error for all remaining open streams when a connection is closed + elif isinstance(event, QuicConnectionClosed): + self._handle_event = self.done # type: ignore + self.h3_conn.handle_connection_closed(event) + msg = event.reason_phrase or error_code_to_str(event.error_code) + for stream_id in self.h3_conn.get_open_stream_ids(): + yield ReceiveHttp( + self.ReceiveProtocolError( + stream_id, msg, self.ReceiveProtocolError.code + ) + ) + + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event!r}") + + @expect(HttpEvent, QuicStreamEvent, QuicConnectionClosed) + def done(self, _) -> layer.CommandGenerator[None]: + yield from () + + @abstractmethod + def parse_headers(self, event: HeadersReceived) -> RequestHeaders | ResponseHeaders: + pass # pragma: no cover + + +class Http3Server(Http3Connection): + ReceiveData = RequestData + ReceiveEndOfMessage = RequestEndOfMessage + ReceiveProtocolError = RequestProtocolError + ReceiveTrailers = RequestTrailers + + def __init__(self, context: context.Context): + super().__init__(context, context.client) + + def parse_headers(self, event: HeadersReceived) -> RequestHeaders | ResponseHeaders: + # same as HTTP/2 + ( + host, + port, + method, + scheme, + authority, + path, + headers, + ) = parse_h2_request_headers(event.headers) + request = http.Request( + host=host, + port=port, + method=method, + scheme=scheme, + authority=authority, + path=path, + http_version=b"HTTP/3", + headers=headers, + content=None, + trailers=None, + timestamp_start=time.time(), + timestamp_end=None, + ) + return RequestHeaders(event.stream_id, request, end_stream=event.stream_ended) + + +class Http3Client(Http3Connection): + ReceiveData = ResponseData + ReceiveEndOfMessage = ResponseEndOfMessage + ReceiveProtocolError = ResponseProtocolError + ReceiveTrailers = ResponseTrailers + + our_stream_id: dict[int, int] + their_stream_id: dict[int, int] + + def __init__(self, context: context.Context): + super().__init__(context, context.server) + self.our_stream_id = {} + self.their_stream_id = {} + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + # QUIC and HTTP/3 would actually allow for direct stream ID mapping, but since we want + # to support H2<->H3, we need to translate IDs. + # NOTE: We always create bidirectional streams, as we can't safely infer unidirectionality. + if isinstance(event, HttpEvent): + ours = self.our_stream_id.get(event.stream_id, None) + if ours is None: + ours = self.h3_conn.get_next_available_stream_id() + self.our_stream_id[event.stream_id] = ours + self.their_stream_id[ours] = event.stream_id + event.stream_id = ours + + for cmd in super()._handle_event(event): + if isinstance(cmd, ReceiveHttp): + cmd.event.stream_id = self.their_stream_id[cmd.event.stream_id] + yield cmd + + def parse_headers(self, event: HeadersReceived) -> RequestHeaders | ResponseHeaders: + # same as HTTP/2 + status_code, headers = parse_h2_response_headers(event.headers) + response = http.Response( + http_version=b"HTTP/3", + status_code=status_code, + reason=b"", + headers=headers, + content=None, + trailers=None, + timestamp_start=time.time(), + timestamp_end=None, + ) + return ResponseHeaders(event.stream_id, response, event.stream_ended) + + +__all__ = [ + "Http3Client", + "Http3Server", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http_h2.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http_h2.py new file mode 100644 index 0000000000000000000000000000000000000000..d554eeb83d2198f84bd2b95b2acb543f9b8d187b --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http_h2.py @@ -0,0 +1,207 @@ +import collections +import logging +from typing import NamedTuple + +import h2.config +import h2.connection +import h2.events +import h2.exceptions +import h2.settings +import h2.stream + +logger = logging.getLogger(__name__) + + +class H2ConnectionLogger(h2.config.DummyLogger): + def __init__(self, peername: tuple, conn_type: str): + super().__init__() + self.peername = peername + self.conn_type = conn_type + + def debug(self, fmtstr, *args): + logger.debug( + f"{self.conn_type} {fmtstr}", *args, extra={"client": self.peername} + ) + + def trace(self, fmtstr, *args): + logger.log( + logging.DEBUG - 1, + f"{self.conn_type} {fmtstr}", + *args, + extra={"client": self.peername}, + ) + + +class SendH2Data(NamedTuple): + data: bytes + end_stream: bool + + +class BufferedH2Connection(h2.connection.H2Connection): + """ + This class wrap's hyper-h2's H2Connection and adds internal send buffers. + + To simplify implementation, padding is unsupported. + """ + + stream_buffers: collections.defaultdict[int, collections.deque[SendH2Data]] + stream_trailers: dict[int, list[tuple[bytes, bytes]]] + + def __init__(self, config: h2.config.H2Configuration): + super().__init__(config) + self.local_settings.initial_window_size = 2**31 - 1 + self.local_settings.max_frame_size = 2**17 + self.max_inbound_frame_size = 2**17 + # hyper-h2 pitfall: we need to acknowledge here, otherwise its sends out the old settings. + self.local_settings.acknowledge() + self.stream_buffers = collections.defaultdict(collections.deque) + self.stream_trailers = {} + + def initiate_connection(self): + super().initiate_connection() + # We increase the flow-control window for new streams with a setting, + # but we need to increase the overall connection flow-control window as well. + self.increment_flow_control_window( + 2**31 - 1 - self.inbound_flow_control_window + ) # maximum - default + + def send_data( + self, + stream_id: int, + data: bytes, + end_stream: bool = False, + pad_length: None = None, + ) -> None: + """ + Send data on a given stream. + + In contrast to plain hyper-h2, this method will not raise if the data cannot be sent immediately. + Data is split up and buffered internally. + """ + frame_size = len(data) + assert pad_length is None + + if frame_size > self.max_outbound_frame_size: + for start in range(0, frame_size, self.max_outbound_frame_size): + chunk = data[start : start + self.max_outbound_frame_size] + self.send_data(stream_id, chunk, end_stream=False) + + return + + if self.stream_buffers.get(stream_id, None): + # We already have some data buffered, let's append. + self.stream_buffers[stream_id].append(SendH2Data(data, end_stream)) + else: + available_window = self.local_flow_control_window(stream_id) + if frame_size <= available_window: + super().send_data(stream_id, data, end_stream) + else: + if available_window: + can_send_now = data[:available_window] + super().send_data(stream_id, can_send_now, end_stream=False) + data = data[available_window:] + # We can't send right now, so we buffer. + self.stream_buffers[stream_id].append(SendH2Data(data, end_stream)) + + def send_trailers(self, stream_id: int, trailers: list[tuple[bytes, bytes]]): + if self.stream_buffers.get(stream_id, None): + # Though trailers are not subject to flow control, we need to queue them and send strictly after data frames + self.stream_trailers[stream_id] = trailers + else: + self.send_headers(stream_id, trailers, end_stream=True) + + def end_stream(self, stream_id: int) -> None: + if stream_id in self.stream_trailers: + return # we already have trailers queued up that will end the stream. + self.send_data(stream_id, b"", end_stream=True) + + def reset_stream(self, stream_id: int, error_code: int = 0) -> None: + self.stream_buffers.pop(stream_id, None) + super().reset_stream(stream_id, error_code) + + def receive_data(self, data: bytes): + events = super().receive_data(data) + ret = [] + for event in events: + if isinstance(event, h2.events.WindowUpdated): + if event.stream_id == 0: + self.connection_window_updated() + else: + self.stream_window_updated(event.stream_id) + continue + elif isinstance(event, h2.events.RemoteSettingsChanged): + if ( + h2.settings.SettingCodes.INITIAL_WINDOW_SIZE + in event.changed_settings + ): + self.connection_window_updated() + elif isinstance(event, h2.events.StreamReset): + self.stream_buffers.pop(event.stream_id, None) + elif isinstance(event, h2.events.ConnectionTerminated): + self.stream_buffers.clear() + ret.append(event) + return ret + + def stream_window_updated(self, stream_id: int) -> bool: + """ + The window for a specific stream has updated. Send as much buffered data as possible. + """ + # If the stream has been reset in the meantime, we just clear the buffer. + try: + stream: h2.stream.H2Stream = self.streams[stream_id] + except KeyError: + stream_was_reset = True + else: + stream_was_reset = stream.state_machine.state not in ( + h2.stream.StreamState.OPEN, + h2.stream.StreamState.HALF_CLOSED_REMOTE, + ) + if stream_was_reset: + self.stream_buffers.pop(stream_id, None) + return False + + available_window = self.local_flow_control_window(stream_id) + sent_any_data = False + while available_window > 0 and stream_id in self.stream_buffers: + chunk: SendH2Data = self.stream_buffers[stream_id].popleft() + if len(chunk.data) > available_window: + # We can't send the entire chunk, so we have to put some bytes back into the buffer. + self.stream_buffers[stream_id].appendleft( + SendH2Data( + data=chunk.data[available_window:], + end_stream=chunk.end_stream, + ) + ) + chunk = SendH2Data( + data=chunk.data[:available_window], + end_stream=False, + ) + + super().send_data(stream_id, data=chunk.data, end_stream=chunk.end_stream) + + available_window -= len(chunk.data) + if not self.stream_buffers[stream_id]: + del self.stream_buffers[stream_id] + if stream_id in self.stream_trailers: + self.send_headers( + stream_id, self.stream_trailers.pop(stream_id), end_stream=True + ) + sent_any_data = True + + return sent_any_data + + def connection_window_updated(self) -> None: + """ + The connection window has updated. Send data from buffers in a round-robin fashion. + """ + sent_any_data = True + while sent_any_data: + sent_any_data = False + for stream_id in list(self.stream_buffers): + self.stream_buffers[stream_id] = self.stream_buffers.pop( + stream_id + ) # move to end of dict + if self.stream_window_updated(stream_id): + sent_any_data = True + if self.outbound_flow_control_window == 0: + return diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http_h3.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http_h3.py new file mode 100644 index 0000000000000000000000000000000000000000..3ab4b35af6f965739acffd3070c1fa6583f91b4d --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_http_h3.py @@ -0,0 +1,321 @@ +from collections.abc import Iterable +from dataclasses import dataclass + +from aioquic.h3.connection import FrameUnexpected +from aioquic.h3.connection import H3Connection +from aioquic.h3.connection import H3Event +from aioquic.h3.connection import H3Stream +from aioquic.h3.connection import Headers +from aioquic.h3.connection import HeadersState +from aioquic.h3.events import HeadersReceived +from aioquic.quic.configuration import QuicConfiguration +from aioquic.quic.events import StreamDataReceived +from aioquic.quic.packet import QuicErrorCode + +from mitmproxy import connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import layer +from mitmproxy.proxy.layers.quic import CloseQuicConnection +from mitmproxy.proxy.layers.quic import QuicConnectionClosed +from mitmproxy.proxy.layers.quic import QuicStreamDataReceived +from mitmproxy.proxy.layers.quic import QuicStreamEvent +from mitmproxy.proxy.layers.quic import QuicStreamReset +from mitmproxy.proxy.layers.quic import QuicStreamStopSending +from mitmproxy.proxy.layers.quic import ResetQuicStream +from mitmproxy.proxy.layers.quic import SendQuicStreamData +from mitmproxy.proxy.layers.quic import StopSendingQuicStream + + +@dataclass +class TrailersReceived(H3Event): + """ + The TrailersReceived event is fired whenever trailers are received. + """ + + trailers: Headers + "The trailers." + + stream_id: int + "The ID of the stream the trailers were received for." + + stream_ended: bool + "Whether the STREAM frame had the FIN bit set." + + +@dataclass +class StreamClosed(H3Event): + """ + The StreamReset event is fired when the peer is sending a CLOSE_STREAM + or a STOP_SENDING frame. For HTTP/3, we don't differentiate between the two. + """ + + stream_id: int + "The ID of the stream that was reset." + + error_code: int + """The error code indicating why the stream was closed.""" + + +class MockQuic: + """ + aioquic intermingles QUIC and HTTP/3. This is something we don't want to do because that makes testing much harder. + Instead, we mock our QUIC connection object here and then take out the wire data to be sent. + """ + + def __init__(self, conn: connection.Connection, is_client: bool) -> None: + self.conn = conn + self.pending_commands: list[commands.Command] = [] + self._next_stream_id: list[int] = [0, 1, 2, 3] + self._is_client = is_client + + # the following fields are accessed by H3Connection + self.configuration = QuicConfiguration(is_client=is_client) + self._quic_logger = None + self._remote_max_datagram_frame_size = 0 + + def close( + self, + error_code: int = QuicErrorCode.NO_ERROR, + frame_type: int | None = None, + reason_phrase: str = "", + ) -> None: + # we'll get closed if a protocol error occurs in `H3Connection.handle_event` + # we note the error on the connection and yield a CloseConnection + # this will then call `QuicConnection.close` with the proper values + # once the `Http3Connection` receives `ConnectionClosed`, it will send out `ProtocolError` + self.pending_commands.append( + CloseQuicConnection(self.conn, error_code, frame_type, reason_phrase) + ) + + def get_next_available_stream_id(self, is_unidirectional: bool = False) -> int: + # since we always reserve the ID, we have to "find" the next ID like `QuicConnection` does + index = (int(is_unidirectional) << 1) | int(not self._is_client) + stream_id = self._next_stream_id[index] + self._next_stream_id[index] = stream_id + 4 + return stream_id + + def reset_stream(self, stream_id: int, error_code: int) -> None: + self.pending_commands.append(ResetQuicStream(self.conn, stream_id, error_code)) + + def stop_send(self, stream_id: int, error_code: int) -> None: + self.pending_commands.append( + StopSendingQuicStream(self.conn, stream_id, error_code) + ) + + def send_stream_data( + self, stream_id: int, data: bytes, end_stream: bool = False + ) -> None: + self.pending_commands.append( + SendQuicStreamData(self.conn, stream_id, data, end_stream) + ) + + +class LayeredH3Connection(H3Connection): + """ + Creates a H3 connection using a fake QUIC connection, which allows layer separation. + Also ensures that headers, data and trailers are sent in that order. + """ + + def __init__( + self, + conn: connection.Connection, + is_client: bool, + enable_webtransport: bool = False, + ) -> None: + self._mock = MockQuic(conn, is_client) + self._closed_streams: set[int] = set() + """ + We keep track of all stream IDs for which we have requested + STOP_SENDING to silently discard incoming data. + """ + super().__init__(self._mock, enable_webtransport) # type: ignore + + # aioquic's constructor sets and then uses _max_push_id. + # This is a hack to forcibly disable it. + @property + def _max_push_id(self) -> int | None: + return None + + @_max_push_id.setter + def _max_push_id(self, value): + pass + + def _after_send(self, stream_id: int, end_stream: bool) -> None: + # if the stream ended, `QuicConnection` has an assert that no further data is being sent + # to catch this more early on, we set the header state on the `H3Stream` + if end_stream: + self._stream[stream_id].headers_send_state = HeadersState.AFTER_TRAILERS + + def _handle_request_or_push_frame( + self, + frame_type: int, + frame_data: bytes | None, + stream: H3Stream, + stream_ended: bool, + ) -> list[H3Event]: + # turn HeadersReceived into TrailersReceived for trailers + events = super()._handle_request_or_push_frame( + frame_type, frame_data, stream, stream_ended + ) + for index, event in enumerate(events): + if ( + isinstance(event, HeadersReceived) + and self._stream[event.stream_id].headers_recv_state + == HeadersState.AFTER_TRAILERS + ): + events[index] = TrailersReceived( + event.headers, event.stream_id, event.stream_ended + ) + return events + + def close_connection( + self, + error_code: int = QuicErrorCode.NO_ERROR, + frame_type: int | None = None, + reason_phrase: str = "", + ) -> None: + """Closes the underlying QUIC connection and ignores any incoming events.""" + + self._is_done = True + self._quic.close(error_code, frame_type, reason_phrase) + + def end_stream(self, stream_id: int) -> None: + """Ends the given stream if not already done so.""" + + stream = self._get_or_create_stream(stream_id) + if stream.headers_send_state != HeadersState.AFTER_TRAILERS: + super().send_data(stream_id, b"", end_stream=True) + stream.headers_send_state = HeadersState.AFTER_TRAILERS + + def get_next_available_stream_id(self, is_unidirectional: bool = False): + """Reserves and returns the next available stream ID.""" + + return self._quic.get_next_available_stream_id(is_unidirectional) + + def get_open_stream_ids(self) -> Iterable[int]: + """Iterates over all non-special open streams""" + + return ( + stream.stream_id + for stream in self._stream.values() + if ( + stream.stream_type is None + and not ( + stream.headers_recv_state == HeadersState.AFTER_TRAILERS + and stream.headers_send_state == HeadersState.AFTER_TRAILERS + ) + ) + ) + + def handle_connection_closed(self, event: QuicConnectionClosed) -> None: + self._is_done = True + + def handle_stream_event(self, event: QuicStreamEvent) -> list[H3Event]: + # don't do anything if we're done + if self._is_done: + return [] + + elif isinstance(event, (QuicStreamReset, QuicStreamStopSending)): + self.close_stream( + event.stream_id, + event.error_code, + stop_send=isinstance(event, QuicStreamStopSending), + ) + stream = self._get_or_create_stream(event.stream_id) + stream.ended = True + stream.headers_recv_state = HeadersState.AFTER_TRAILERS + return [StreamClosed(event.stream_id, event.error_code)] + + # convert data events from the QUIC layer back to aioquic events + elif isinstance(event, QuicStreamDataReceived): + # Discard contents if we have already sent STOP_SENDING on this stream. + if event.stream_id in self._closed_streams: + return [] + elif self._get_or_create_stream(event.stream_id).ended: + # aioquic will not send us any data events once a stream has ended. + # Instead, it will close the connection. We simulate this here for H3 tests. + self.close_connection( + error_code=QuicErrorCode.PROTOCOL_VIOLATION, + reason_phrase="stream already ended", + ) + return [] + else: + return self.handle_event( + StreamDataReceived(event.data, event.end_stream, event.stream_id) + ) + + # should never happen + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event!r}") + + def has_sent_headers(self, stream_id: int) -> bool: + """Indicates whether headers have been sent over the given stream.""" + + try: + return self._stream[stream_id].headers_send_state != HeadersState.INITIAL + except KeyError: + return False + + def close_stream( + self, stream_id: int, error_code: int, stop_send: bool = True + ) -> None: + """Close a stream that hasn't been closed locally yet.""" + if stream_id not in self._closed_streams: + self._closed_streams.add(stream_id) + + stream = self._get_or_create_stream(stream_id) + stream.headers_send_state = HeadersState.AFTER_TRAILERS + # https://www.rfc-editor.org/rfc/rfc9000.html#section-3.5-8 + # An endpoint that wishes to terminate both directions of + # a bidirectional stream can terminate one direction by + # sending a RESET_STREAM frame, and it can encourage prompt + # termination in the opposite direction by sending a + # STOP_SENDING frame. + self._mock.reset_stream(stream_id=stream_id, error_code=error_code) + if stop_send: + self._mock.stop_send(stream_id=stream_id, error_code=error_code) + + def send_data(self, stream_id: int, data: bytes, end_stream: bool = False) -> None: + """Sends data over the given stream.""" + + super().send_data(stream_id, data, end_stream) + self._after_send(stream_id, end_stream) + + def send_datagram(self, flow_id: int, data: bytes) -> None: + # supporting datagrams would require additional information from the underlying QUIC connection + raise NotImplementedError() # pragma: no cover + + def send_headers( + self, stream_id: int, headers: Headers, end_stream: bool = False + ) -> None: + """Sends headers over the given stream.""" + + # ensure we haven't sent something before + stream = self._get_or_create_stream(stream_id) + if stream.headers_send_state != HeadersState.INITIAL: + raise FrameUnexpected("initial HEADERS frame is not allowed in this state") + super().send_headers(stream_id, headers, end_stream) + self._after_send(stream_id, end_stream) + + def send_trailers(self, stream_id: int, trailers: Headers) -> None: + """Sends trailers over the given stream and ends it.""" + + # ensure we got some headers first + stream = self._get_or_create_stream(stream_id) + if stream.headers_send_state != HeadersState.AFTER_HEADERS: + raise FrameUnexpected("trailing HEADERS frame is not allowed in this state") + super().send_headers(stream_id, trailers, end_stream=True) + self._after_send(stream_id, end_stream=True) + + def transmit(self) -> layer.CommandGenerator[None]: + """Yields all pending commands for the upper QUIC layer.""" + + while self._mock.pending_commands: + yield self._mock.pending_commands.pop(0) + + +__all__ = [ + "LayeredH3Connection", + "StreamClosed", + "TrailersReceived", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_upstream_proxy.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_upstream_proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..f40b26ce6ee1f5b02f1cdd5bc3de4653090eccc3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/http/_upstream_proxy.py @@ -0,0 +1,105 @@ +import time +from logging import DEBUG + +from h11._receivebuffer import ReceiveBuffer + +from mitmproxy import connection +from mitmproxy import http +from mitmproxy.net.http import http1 +from mitmproxy.proxy import commands +from mitmproxy.proxy import context +from mitmproxy.proxy import layer +from mitmproxy.proxy import tunnel +from mitmproxy.proxy.layers import tls +from mitmproxy.proxy.layers.http._hooks import HttpConnectUpstreamHook +from mitmproxy.utils import human + + +class HttpUpstreamProxy(tunnel.TunnelLayer): + buf: ReceiveBuffer + send_connect: bool + conn: connection.Server + tunnel_connection: connection.Server + + def __init__( + self, ctx: context.Context, tunnel_conn: connection.Server, send_connect: bool + ): + super().__init__(ctx, tunnel_connection=tunnel_conn, conn=ctx.server) + self.buf = ReceiveBuffer() + self.send_connect = send_connect + + @classmethod + def make(cls, ctx: context.Context, send_connect: bool) -> tunnel.LayerStack: + assert ctx.server.via + scheme, address = ctx.server.via + assert scheme in ("http", "https") + + http_proxy = connection.Server(address=address) + + stack = tunnel.LayerStack() + if scheme == "https": + http_proxy.alpn_offers = tls.HTTP1_ALPNS + http_proxy.sni = address[0] + stack /= tls.ServerTLSLayer(ctx, http_proxy) + stack /= cls(ctx, http_proxy, send_connect) + + return stack + + def start_handshake(self) -> layer.CommandGenerator[None]: + if not self.send_connect: + return (yield from super().start_handshake()) + assert self.conn.address + flow = http.HTTPFlow(self.context.client, self.tunnel_connection) + authority = ( + self.conn.address[0].encode("idna") + f":{self.conn.address[1]}".encode() + ) + headers = http.Headers() + if self.context.options.http_connect_send_host_header: + headers.insert(0, b"Host", authority) + flow.request = http.Request( + host=self.conn.address[0], + port=self.conn.address[1], + method=b"CONNECT", + scheme=b"", + authority=authority, + path=b"", + http_version=b"HTTP/1.1", + headers=headers, + content=b"", + trailers=None, + timestamp_start=time.time(), + timestamp_end=time.time(), + ) + yield HttpConnectUpstreamHook(flow) + raw = http1.assemble_request(flow.request) + yield commands.SendData(self.tunnel_connection, raw) + + def receive_handshake_data( + self, data: bytes + ) -> layer.CommandGenerator[tuple[bool, str | None]]: + if not self.send_connect: + return (yield from super().receive_handshake_data(data)) + self.buf += data + response_head = self.buf.maybe_extract_lines() + if response_head: + try: + response = http1.read_response_head([bytes(x) for x in response_head]) + except ValueError as e: + proxyaddr = human.format_address(self.tunnel_connection.address) + yield commands.Log(f"{proxyaddr}: {e}") + return False, f"Error connecting to {proxyaddr}: {e}" + if 200 <= response.status_code < 300: + if self.buf: + yield from self.receive_data(bytes(self.buf)) + del self.buf + return True, None + else: + proxyaddr = human.format_address(self.tunnel_connection.address) + raw_resp = b"\n".join(response_head) + yield commands.Log(f"{proxyaddr}: {raw_resp!r}", DEBUG) + return ( + False, + f"Upstream proxy {proxyaddr} refused HTTP CONNECT request: {response.status_code} {response.reason}", + ) + else: + return False, None diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/modes.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/modes.py new file mode 100644 index 0000000000000000000000000000000000000000..0f917cd78b2340ea502497df7ad3b12506c9df0e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/modes.py @@ -0,0 +1,303 @@ +from __future__ import annotations + +import socket +import struct +import sys +from abc import ABCMeta +from collections.abc import Callable +from dataclasses import dataclass + +from mitmproxy import connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.commands import StartHook +from mitmproxy.proxy.mode_specs import ReverseMode +from mitmproxy.proxy.utils import expect + +if sys.version_info < (3, 11): + from typing_extensions import assert_never +else: + from typing import assert_never + + +class HttpProxy(layer.Layer): + @expect(events.Start) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + child_layer = layer.NextLayer(self.context) + self._handle_event = child_layer.handle_event + yield from child_layer.handle_event(event) + + +class HttpUpstreamProxy(layer.Layer): + @expect(events.Start) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + child_layer = layer.NextLayer(self.context) + self._handle_event = child_layer.handle_event + yield from child_layer.handle_event(event) + + +class DestinationKnown(layer.Layer, metaclass=ABCMeta): + """Base layer for layers that gather connection destination info and then delegate.""" + + child_layer: layer.Layer + + def finish_start(self) -> layer.CommandGenerator[str | None]: + if ( + self.context.options.connection_strategy == "eager" + and self.context.server.address + and self.context.server.transport_protocol == "tcp" + ): + err = yield commands.OpenConnection(self.context.server) + if err: + self._handle_event = self.done # type: ignore + return err + + self._handle_event = self.child_layer.handle_event # type: ignore + yield from self.child_layer.handle_event(events.Start()) + return None + + @expect(events.DataReceived, events.ConnectionClosed) + def done(self, _) -> layer.CommandGenerator[None]: + yield from () + + +class ReverseProxy(DestinationKnown): + @expect(events.Start) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + spec = self.context.client.proxy_mode + assert isinstance(spec, ReverseMode) + self.context.server.address = spec.address + + self.child_layer = layer.NextLayer(self.context) + + # For secure protocols, set SNI if keep_host_header is false + match spec.scheme: + case "http3" | "quic" | "https" | "tls" | "dtls": + if not self.context.options.keep_host_header: + self.context.server.sni = spec.address[0] + case "tcp" | "http" | "udp" | "dns": + pass + case _: # pragma: no cover + assert_never(spec.scheme) + + err = yield from self.finish_start() + if err: + yield commands.CloseConnection(self.context.client) + + +class TransparentProxy(DestinationKnown): + @expect(events.Start) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + assert self.context.server.address, "No server address set." + self.child_layer = layer.NextLayer(self.context) + err = yield from self.finish_start() + if err: + yield commands.CloseConnection(self.context.client) + + +SOCKS5_VERSION = 0x05 + +SOCKS5_METHOD_NO_AUTHENTICATION_REQUIRED = 0x00 +SOCKS5_METHOD_USER_PASSWORD_AUTHENTICATION = 0x02 +SOCKS5_METHOD_NO_ACCEPTABLE_METHODS = 0xFF + +SOCKS5_ATYP_IPV4_ADDRESS = 0x01 +SOCKS5_ATYP_DOMAINNAME = 0x03 +SOCKS5_ATYP_IPV6_ADDRESS = 0x04 + +SOCKS5_REP_HOST_UNREACHABLE = 0x04 +SOCKS5_REP_COMMAND_NOT_SUPPORTED = 0x07 +SOCKS5_REP_ADDRESS_TYPE_NOT_SUPPORTED = 0x08 + + +@dataclass +class Socks5AuthData: + client_conn: connection.Client + username: str + password: str + valid: bool = False + + +@dataclass +class Socks5AuthHook(StartHook): + """ + Mitmproxy has received username/password SOCKS5 credentials. + + This hook decides whether they are valid by setting `data.valid`. + """ + + data: Socks5AuthData + + +class Socks5Proxy(DestinationKnown): + buf: bytes = b"" + + def socks_err( + self, + message: str, + reply_code: int | None = None, + ) -> layer.CommandGenerator[None]: + if reply_code is not None: + yield commands.SendData( + self.context.client, + bytes([SOCKS5_VERSION, reply_code]) + + b"\x00\x01\x00\x00\x00\x00\x00\x00", + ) + yield commands.CloseConnection(self.context.client) + yield commands.Log(message) + self._handle_event = self.done + + @expect(events.Start, events.DataReceived, events.ConnectionClosed) + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, events.Start): + pass + elif isinstance(event, events.DataReceived): + self.buf += event.data + yield from self.state() + elif isinstance(event, events.ConnectionClosed): + if self.buf: + yield commands.Log( + f"Client closed connection before completing SOCKS5 handshake: {self.buf!r}" + ) + yield commands.CloseConnection(event.connection) + else: + raise AssertionError(f"Unknown event: {event}") + + def state_greet(self) -> layer.CommandGenerator[None]: + if len(self.buf) < 2: + return + + if self.buf[0] != SOCKS5_VERSION: + if self.buf[:3].isupper(): + guess = "Probably not a SOCKS request but a regular HTTP request. " + else: + guess = "" + yield from self.socks_err( + guess + "Invalid SOCKS version. Expected 0x05, got 0x%x" % self.buf[0] + ) + return + + n_methods = self.buf[1] + if len(self.buf) < 2 + n_methods: + return + + if "proxyauth" in self.context.options and self.context.options.proxyauth: + method = SOCKS5_METHOD_USER_PASSWORD_AUTHENTICATION + self.state = self.state_auth + else: + method = SOCKS5_METHOD_NO_AUTHENTICATION_REQUIRED + self.state = self.state_connect + + if method not in self.buf[2 : 2 + n_methods]: + method_str = ( + "user/password" + if method == SOCKS5_METHOD_USER_PASSWORD_AUTHENTICATION + else "no" + ) + yield from self.socks_err( + f"Client does not support SOCKS5 with {method_str} authentication.", + SOCKS5_METHOD_NO_ACCEPTABLE_METHODS, + ) + return + yield commands.SendData(self.context.client, bytes([SOCKS5_VERSION, method])) + self.buf = self.buf[2 + n_methods :] + yield from self.state() + + state: Callable[..., layer.CommandGenerator[None]] = state_greet + + def state_auth(self) -> layer.CommandGenerator[None]: + if len(self.buf) < 3: + return + + # Parsing username and password, which is somewhat atrocious + user_len = self.buf[1] + if len(self.buf) < 3 + user_len: + return + pass_len = self.buf[2 + user_len] + if len(self.buf) < 3 + user_len + pass_len: + return + user = self.buf[2 : (2 + user_len)].decode("utf-8", "backslashreplace") + password = self.buf[(3 + user_len) : (3 + user_len + pass_len)].decode( + "utf-8", "backslashreplace" + ) + + data = Socks5AuthData(self.context.client, user, password) + yield Socks5AuthHook(data) + if not data.valid: + # The VER field contains the current **version of the subnegotiation**, which is X'01'. + yield commands.SendData(self.context.client, b"\x01\x01") + yield from self.socks_err("authentication failed") + return + + yield commands.SendData(self.context.client, b"\x01\x00") + self.buf = self.buf[3 + user_len + pass_len :] + self.state = self.state_connect + yield from self.state() + + def state_connect(self) -> layer.CommandGenerator[None]: + # Parse Connect Request + if len(self.buf) < 5: + return + + if self.buf[:3] != b"\x05\x01\x00": + yield from self.socks_err( + f"Unsupported SOCKS5 request: {self.buf!r}", + SOCKS5_REP_COMMAND_NOT_SUPPORTED, + ) + return + + # Determine message length + atyp = self.buf[3] + message_len: int + if atyp == SOCKS5_ATYP_IPV4_ADDRESS: + message_len = 4 + 4 + 2 + elif atyp == SOCKS5_ATYP_IPV6_ADDRESS: + message_len = 4 + 16 + 2 + elif atyp == SOCKS5_ATYP_DOMAINNAME: + message_len = 4 + 1 + self.buf[4] + 2 + else: + yield from self.socks_err( + f"Unknown address type: {atyp}", SOCKS5_REP_ADDRESS_TYPE_NOT_SUPPORTED + ) + return + + # Do we have enough bytes yet? + if len(self.buf) < message_len: + return + + # Parse host and port + msg, self.buf = self.buf[:message_len], self.buf[message_len:] + + host: str + if atyp == SOCKS5_ATYP_IPV4_ADDRESS: + host = socket.inet_ntop(socket.AF_INET, msg[4:-2]) + elif atyp == SOCKS5_ATYP_IPV6_ADDRESS: + host = socket.inet_ntop(socket.AF_INET6, msg[4:-2]) + else: + host_bytes = msg[5:-2] + host = host_bytes.decode("ascii", "replace") + + (port,) = struct.unpack("!H", msg[-2:]) + + # We now have all we need, let's get going. + self.context.server.address = (host, port) + self.child_layer = layer.NextLayer(self.context) + + # this already triggers the child layer's Start event, + # but that's not a problem in practice... + err = yield from self.finish_start() + if err: + yield commands.SendData( + self.context.client, b"\x05\x04\x00\x01\x00\x00\x00\x00\x00\x00" + ) + yield commands.CloseConnection(self.context.client) + else: + yield commands.SendData( + self.context.client, b"\x05\x00\x00\x01\x00\x00\x00\x00\x00\x00" + ) + if self.buf: + yield from self.child_layer.handle_event( + events.DataReceived(self.context.client, self.buf) + ) + del self.buf diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..28a3ce3be76f51ed842576066750b9fcc5b36003 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__init__.py @@ -0,0 +1,41 @@ +from ._client_hello_parser import quic_parse_client_hello_from_datagrams +from ._commands import CloseQuicConnection +from ._commands import ResetQuicStream +from ._commands import SendQuicStreamData +from ._commands import StopSendingQuicStream +from ._events import QuicConnectionClosed +from ._events import QuicStreamDataReceived +from ._events import QuicStreamEvent +from ._events import QuicStreamReset +from ._events import QuicStreamStopSending +from ._hooks import QuicStartClientHook +from ._hooks import QuicStartServerHook +from ._hooks import QuicTlsData +from ._hooks import QuicTlsSettings +from ._raw_layers import QuicStreamLayer +from ._raw_layers import RawQuicLayer +from ._stream_layers import ClientQuicLayer +from ._stream_layers import error_code_to_str +from ._stream_layers import ServerQuicLayer + +__all__ = [ + "quic_parse_client_hello_from_datagrams", + "CloseQuicConnection", + "ResetQuicStream", + "SendQuicStreamData", + "StopSendingQuicStream", + "QuicConnectionClosed", + "QuicStreamDataReceived", + "QuicStreamEvent", + "QuicStreamReset", + "QuicStreamStopSending", + "QuicStartClientHook", + "QuicStartServerHook", + "QuicTlsData", + "QuicTlsSettings", + "QuicStreamLayer", + "RawQuicLayer", + "ClientQuicLayer", + "error_code_to_str", + "ServerQuicLayer", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a3327f5ab8671a96b4af4b5f1038170b00f264e Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_client_hello_parser.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_client_hello_parser.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edefacd697f8b4d7495dfa7900aee81c8082f496 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_client_hello_parser.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_commands.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_commands.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..347f2db79b5bef49099df7266610bf03fad7d27f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_commands.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_events.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_events.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36e3e91fab28b600e634af9ed8d45985e05d5217 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_events.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_hooks.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_hooks.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..524292066b4d133cbd3fcc39432edcb725908140 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_hooks.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_raw_layers.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_raw_layers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fffbdcefca996a68897b0d93250191827f71d46 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_raw_layers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_stream_layers.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_stream_layers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36d3e314817700d397fadd77f216ecdb8bdb06f9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/__pycache__/_stream_layers.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_client_hello_parser.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_client_hello_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..46dd615084c748c2caffab9b4536fd92e555815e --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_client_hello_parser.py @@ -0,0 +1,111 @@ +""" +This module contains a very terrible QUIC client hello parser. + +Nothing is more permanent than a temporary solution! +""" + +from __future__ import annotations + +import time +from dataclasses import dataclass +from typing import Optional + +from aioquic.buffer import Buffer as QuicBuffer +from aioquic.quic.configuration import QuicConfiguration +from aioquic.quic.connection import QuicConnection +from aioquic.quic.connection import QuicConnectionError +from aioquic.quic.logger import QuicLogger +from aioquic.quic.packet import PACKET_TYPE_INITIAL +from aioquic.quic.packet import pull_quic_header +from aioquic.tls import HandshakeType + +from mitmproxy.tls import ClientHello + + +@dataclass +class QuicClientHello(Exception): + """Helper error only used in `quic_parse_client_hello_from_datagrams`.""" + + data: bytes + + +def quic_parse_client_hello_from_datagrams( + datagrams: list[bytes], +) -> Optional[ClientHello]: + """ + Check if the supplied bytes contain a full ClientHello message, + and if so, parse it. + + Args: + - msgs: list of ClientHello fragments received from client + + Returns: + - A ClientHello object on success + - None, if the QUIC record is incomplete + + Raises: + - A ValueError, if the passed ClientHello is invalid + """ + + # ensure the first packet is indeed the initial one + buffer = QuicBuffer(data=datagrams[0]) + header = pull_quic_header(buffer, 8) + if header.packet_type != PACKET_TYPE_INITIAL: + raise ValueError("Packet is not initial one.") + + # patch aioquic to intercept the client hello + quic = QuicConnection( + configuration=QuicConfiguration( + is_client=False, + certificate="", + private_key="", + quic_logger=QuicLogger(), + ), + original_destination_connection_id=header.destination_cid, + ) + _initialize = quic._initialize + + def server_handle_hello_replacement( + input_buf: QuicBuffer, + initial_buf: QuicBuffer, + handshake_buf: QuicBuffer, + onertt_buf: QuicBuffer, + ) -> None: + assert input_buf.pull_uint8() == HandshakeType.CLIENT_HELLO + length = 0 + for b in input_buf.pull_bytes(3): + length = (length << 8) | b + offset = input_buf.tell() + raise QuicClientHello(input_buf.data_slice(offset, offset + length)) + + def initialize_replacement(peer_cid: bytes) -> None: + try: + return _initialize(peer_cid) + finally: + quic.tls._server_handle_hello = server_handle_hello_replacement # type: ignore + + quic._initialize = initialize_replacement # type: ignore + try: + for dgm in datagrams: + quic.receive_datagram(dgm, ("0.0.0.0", 0), now=time.time()) + except QuicClientHello as hello: + try: + return ClientHello(hello.data) + except EOFError as e: + raise ValueError("Invalid ClientHello data.") from e + except QuicConnectionError as e: + raise ValueError(e.reason_phrase) from e + + quic_logger = quic._configuration.quic_logger + assert isinstance(quic_logger, QuicLogger) + traces = quic_logger.to_dict().get("traces") + assert isinstance(traces, list) + for trace in traces: + quic_events = trace.get("events") + for event in quic_events: + if event["name"] == "transport:packet_dropped": + raise ValueError( + f"Invalid ClientHello packet: {event['data']['trigger']}" + ) + + return None # pragma: no cover # FIXME: this should have test coverage diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_commands.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_commands.py new file mode 100644 index 0000000000000000000000000000000000000000..1f952c3c66823d26e380c933707ccf70244e1d2b --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_commands.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from mitmproxy import connection +from mitmproxy.proxy import commands + + +class QuicStreamCommand(commands.ConnectionCommand): + """Base class for all QUIC stream commands.""" + + stream_id: int + """The ID of the stream the command was issued for.""" + + def __init__(self, connection: connection.Connection, stream_id: int) -> None: + super().__init__(connection) + self.stream_id = stream_id + + +class SendQuicStreamData(QuicStreamCommand): + """Command that sends data on a stream.""" + + data: bytes + """The data which should be sent.""" + end_stream: bool + """Whether the FIN bit should be set in the STREAM frame.""" + + def __init__( + self, + connection: connection.Connection, + stream_id: int, + data: bytes, + end_stream: bool = False, + ) -> None: + super().__init__(connection, stream_id) + self.data = data + self.end_stream = end_stream + + def __repr__(self): + target = repr(self.connection).partition("(")[0].lower() + end_stream = "[end_stream] " if self.end_stream else "" + return f"SendQuicStreamData({target} on {self.stream_id}, {end_stream}{self.data!r})" + + +class ResetQuicStream(QuicStreamCommand): + """Abruptly terminate the sending part of a stream.""" + + error_code: int + """An error code indicating why the stream is being reset.""" + + def __init__( + self, connection: connection.Connection, stream_id: int, error_code: int + ) -> None: + super().__init__(connection, stream_id) + self.error_code = error_code + + +class StopSendingQuicStream(QuicStreamCommand): + """Request termination of the receiving part of a stream.""" + + error_code: int + """An error code indicating why the stream is being stopped.""" + + def __init__( + self, connection: connection.Connection, stream_id: int, error_code: int + ) -> None: + super().__init__(connection, stream_id) + self.error_code = error_code + + +class CloseQuicConnection(commands.CloseConnection): + """Close a QUIC connection.""" + + error_code: int + "The error code which was specified when closing the connection." + + frame_type: int | None + "The frame type which caused the connection to be closed, or `None`." + + reason_phrase: str + "The human-readable reason for which the connection was closed." + + # XXX: A bit much boilerplate right now. Should switch to dataclasses. + def __init__( + self, + conn: connection.Connection, + error_code: int, + frame_type: int | None, + reason_phrase: str, + ) -> None: + super().__init__(conn) + self.error_code = error_code + self.frame_type = frame_type + self.reason_phrase = reason_phrase diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_events.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_events.py new file mode 100644 index 0000000000000000000000000000000000000000..67a4d4a8e0af805091276244c2b90653025178c2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_events.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from dataclasses import dataclass + +from mitmproxy import connection +from mitmproxy.proxy import events + + +@dataclass +class QuicStreamEvent(events.ConnectionEvent): + """Base class for all QUIC stream events.""" + + stream_id: int + """The ID of the stream the event was fired for.""" + + +@dataclass +class QuicStreamDataReceived(QuicStreamEvent): + """Event that is fired whenever data is received on a stream.""" + + data: bytes + """The data which was received.""" + end_stream: bool + """Whether the STREAM frame had the FIN bit set.""" + + def __repr__(self): + target = repr(self.connection).partition("(")[0].lower() + end_stream = "[end_stream] " if self.end_stream else "" + return f"QuicStreamDataReceived({target} on {self.stream_id}, {end_stream}{self.data!r})" + + +@dataclass +class QuicStreamReset(QuicStreamEvent): + """Event that is fired when the remote peer resets a stream.""" + + error_code: int + """The error code that triggered the reset.""" + + +@dataclass +class QuicStreamStopSending(QuicStreamEvent): + """Event that is fired when the remote peer sends a STOP_SENDING frame.""" + + error_code: int + """The application protocol error code.""" + + +class QuicConnectionClosed(events.ConnectionClosed): + """QUIC connection has been closed.""" + + error_code: int + "The error code which was specified when closing the connection." + + frame_type: int | None + "The frame type which caused the connection to be closed, or `None`." + + reason_phrase: str + "The human-readable reason for which the connection was closed." + + def __init__( + self, + conn: connection.Connection, + error_code: int, + frame_type: int | None, + reason_phrase: str, + ) -> None: + super().__init__(conn) + self.error_code = error_code + self.frame_type = frame_type + self.reason_phrase = reason_phrase diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_hooks.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..9c84e74d52cbc8311d19080f2d457af0b45bdd55 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_hooks.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from dataclasses import dataclass +from dataclasses import field +from ssl import VerifyMode + +from aioquic.tls import CipherSuite +from cryptography import x509 +from cryptography.hazmat.primitives.asymmetric import dsa +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.primitives.asymmetric import rsa + +from mitmproxy.proxy import commands +from mitmproxy.tls import TlsData + + +@dataclass +class QuicTlsSettings: + """ + Settings necessary to establish QUIC's TLS context. + """ + + alpn_protocols: list[str] | None = None + """A list of supported ALPN protocols.""" + certificate: x509.Certificate | None = None + """The certificate to use for the connection.""" + certificate_chain: list[x509.Certificate] = field(default_factory=list) + """A list of additional certificates to send to the peer.""" + certificate_private_key: ( + dsa.DSAPrivateKey | ec.EllipticCurvePrivateKey | rsa.RSAPrivateKey | None + ) = None + """The certificate's private key.""" + cipher_suites: list[CipherSuite] | None = None + """An optional list of allowed/advertised cipher suites.""" + ca_path: str | None = None + """An optional path to a directory that contains the necessary information to verify the peer certificate.""" + ca_file: str | None = None + """An optional path to a PEM file that will be used to verify the peer certificate.""" + verify_mode: VerifyMode | None = None + """An optional flag that specifies how/if the peer's certificate should be validated.""" + + +@dataclass +class QuicTlsData(TlsData): + """ + Event data for `quic_start_client` and `quic_start_server` event hooks. + """ + + settings: QuicTlsSettings | None = None + """ + The associated `QuicTlsSettings` object. + This will be set by an addon in the `quic_start_*` event hooks. + """ + + +@dataclass +class QuicStartClientHook(commands.StartHook): + """ + TLS negotiation between mitmproxy and a client over QUIC is about to start. + + An addon is expected to initialize data.settings. + (by default, this is done by `mitmproxy.addons.tlsconfig`) + """ + + data: QuicTlsData + + +@dataclass +class QuicStartServerHook(commands.StartHook): + """ + TLS negotiation between mitmproxy and a server over QUIC is about to start. + + An addon is expected to initialize data.settings. + (by default, this is done by `mitmproxy.addons.tlsconfig`) + """ + + data: QuicTlsData diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_raw_layers.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_raw_layers.py new file mode 100644 index 0000000000000000000000000000000000000000..81f34e7f82ed3068a0e84866ad06c8cd1aedddbf --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_raw_layers.py @@ -0,0 +1,433 @@ +""" +This module contains the proxy layers for raw QUIC proxying. +This is used if we want to speak QUIC, but we do not want to do HTTP. +""" + +from __future__ import annotations + +import time + +from aioquic.quic.connection import QuicErrorCode +from aioquic.quic.connection import stream_is_client_initiated +from aioquic.quic.connection import stream_is_unidirectional + +from ._commands import CloseQuicConnection +from ._commands import ResetQuicStream +from ._commands import SendQuicStreamData +from ._commands import StopSendingQuicStream +from ._events import QuicConnectionClosed +from ._events import QuicStreamDataReceived +from ._events import QuicStreamEvent +from ._events import QuicStreamReset +from mitmproxy import connection +from mitmproxy.connection import Connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import context +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy import tunnel +from mitmproxy.proxy.layers.tcp import TCPLayer +from mitmproxy.proxy.layers.udp import UDPLayer + + +class QuicStreamNextLayer(layer.NextLayer): + """`NextLayer` variant that callbacks `QuicStreamLayer` after layer decision.""" + + def __init__( + self, + context: context.Context, + stream: QuicStreamLayer, + ask_on_start: bool = False, + ) -> None: + super().__init__(context, ask_on_start) + self._stream = stream + self._layer: layer.Layer | None = None + + @property # type: ignore + def layer(self) -> layer.Layer | None: # type: ignore + return self._layer + + @layer.setter + def layer(self, value: layer.Layer | None) -> None: + self._layer = value + if self._layer: + self._stream.refresh_metadata() + + +class QuicStreamLayer(layer.Layer): + """ + Layer for QUIC streams. + Serves as a marker for NextLayer and keeps track of the connection states. + """ + + client: connection.Client + """Virtual client connection for this stream. Use this in QuicRawLayer instead of `context.client`.""" + server: connection.Server + """Virtual server connection for this stream. Use this in QuicRawLayer instead of `context.server`.""" + child_layer: layer.Layer + """The stream's child layer.""" + + def __init__( + self, context: context.Context, force_raw: bool, stream_id: int + ) -> None: + # we mustn't reuse the client from the QUIC connection, as the state and protocol differs + self.client = context.client = context.client.copy() + self.client.transport_protocol = "tcp" + self.client.state = connection.ConnectionState.OPEN + + # unidirectional client streams are not fully open, set the appropriate state + if stream_is_unidirectional(stream_id): + self.client.state = ( + connection.ConnectionState.CAN_READ + if stream_is_client_initiated(stream_id) + else connection.ConnectionState.CAN_WRITE + ) + self._client_stream_id = stream_id + + # start with a closed server + self.server = context.server = connection.Server( + address=context.server.address, + transport_protocol="tcp", + ) + self._server_stream_id: int | None = None + + super().__init__(context) + self.child_layer = ( + TCPLayer(context) if force_raw else QuicStreamNextLayer(context, self) + ) + self.refresh_metadata() + + # we don't handle any events, pass everything to the child layer + self.handle_event = self.child_layer.handle_event # type: ignore + self._handle_event = self.child_layer._handle_event # type: ignore + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + raise AssertionError # pragma: no cover + + def open_server_stream(self, server_stream_id) -> None: + assert self._server_stream_id is None + self._server_stream_id = server_stream_id + self.server.timestamp_start = time.time() + self.server.state = ( + ( + connection.ConnectionState.CAN_WRITE + if stream_is_client_initiated(server_stream_id) + else connection.ConnectionState.CAN_READ + ) + if stream_is_unidirectional(server_stream_id) + else connection.ConnectionState.OPEN + ) + self.refresh_metadata() + + def refresh_metadata(self) -> None: + # find the first transport layer + child_layer: layer.Layer | None = self.child_layer + while True: + if isinstance(child_layer, layer.NextLayer): + child_layer = child_layer.layer + elif isinstance(child_layer, tunnel.TunnelLayer): + child_layer = child_layer.child_layer + else: + break # pragma: no cover + if isinstance(child_layer, (UDPLayer, TCPLayer)) and child_layer.flow: + child_layer.flow.metadata["quic_is_unidirectional"] = ( + stream_is_unidirectional(self._client_stream_id) + ) + child_layer.flow.metadata["quic_initiator"] = ( + "client" + if stream_is_client_initiated(self._client_stream_id) + else "server" + ) + child_layer.flow.metadata["quic_stream_id_client"] = self._client_stream_id + child_layer.flow.metadata["quic_stream_id_server"] = self._server_stream_id + + def stream_id(self, client: bool) -> int | None: + return self._client_stream_id if client else self._server_stream_id + + +class RawQuicLayer(layer.Layer): + """ + This layer is responsible for de-multiplexing QUIC streams into an individual layer stack per stream. + """ + + force_raw: bool + """Indicates whether traffic should be treated as raw TCP/UDP without further protocol detection.""" + datagram_layer: layer.Layer + """ + The layer that is handling datagrams over QUIC. It's like a child_layer, but with a forked context. + Instead of having a datagram-equivalent for all `QuicStream*` classes, we use `SendData` and `DataReceived` instead. + There is also no need for another `NextLayer` marker, as a missing `QuicStreamLayer` implies UDP, + and the connection state is the same as the one of the underlying QUIC connection. + """ + client_stream_ids: dict[int, QuicStreamLayer] + """Maps stream IDs from the client connection to stream layers.""" + server_stream_ids: dict[int, QuicStreamLayer] + """Maps stream IDs from the server connection to stream layers.""" + connections: dict[connection.Connection, layer.Layer] + """Maps connections to layers.""" + command_sources: dict[commands.Command, layer.Layer] + """Keeps track of blocking commands and wakeup requests.""" + next_stream_id: list[int] + """List containing the next stream ID for all four is_unidirectional/is_client combinations.""" + + def __init__(self, context: context.Context, force_raw: bool = False) -> None: + super().__init__(context) + self.force_raw = force_raw + self.datagram_layer = ( + UDPLayer(self.context.fork()) + if force_raw + else layer.NextLayer(self.context.fork()) + ) + self.client_stream_ids = {} + self.server_stream_ids = {} + self.connections = { + context.client: self.datagram_layer, + context.server: self.datagram_layer, + } + self.command_sources = {} + self.next_stream_id = [0, 1, 2, 3] + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + # we treat the datagram layer as child layer, so forward Start + if isinstance(event, events.Start): + if self.context.server.timestamp_start is None: + err = yield commands.OpenConnection(self.context.server) + if err: + yield commands.CloseConnection(self.context.client) + self._handle_event = self.done # type: ignore + return + yield from self.event_to_child(self.datagram_layer, event) + + # properly forward completion events based on their command + elif isinstance(event, events.CommandCompleted): + yield from self.event_to_child( + self.command_sources.pop(event.command), event + ) + + # route injected messages based on their connections (prefer client, fallback to server) + elif isinstance(event, events.MessageInjected): + if event.flow.client_conn in self.connections: + yield from self.event_to_child( + self.connections[event.flow.client_conn], event + ) + elif event.flow.server_conn in self.connections: + yield from self.event_to_child( + self.connections[event.flow.server_conn], event + ) + else: + raise AssertionError(f"Flow not associated: {event.flow!r}") + + # handle stream events targeting this context + elif isinstance(event, QuicStreamEvent) and ( + event.connection is self.context.client + or event.connection is self.context.server + ): + from_client = event.connection is self.context.client + + # fetch or create the layer + stream_ids = ( + self.client_stream_ids if from_client else self.server_stream_ids + ) + if event.stream_id in stream_ids: + stream_layer = stream_ids[event.stream_id] + else: + # ensure we haven't just forgotten to register the ID + assert stream_is_client_initiated(event.stream_id) == from_client + + # for server-initiated streams we need to open the client as well + if from_client: + client_stream_id = event.stream_id + server_stream_id = None + else: + client_stream_id = self.get_next_available_stream_id( + is_client=False, + is_unidirectional=stream_is_unidirectional(event.stream_id), + ) + server_stream_id = event.stream_id + + # create, register and start the layer + stream_layer = QuicStreamLayer( + self.context.fork(), + force_raw=self.force_raw, + stream_id=client_stream_id, + ) + self.client_stream_ids[client_stream_id] = stream_layer + if server_stream_id is not None: + stream_layer.open_server_stream(server_stream_id) + self.server_stream_ids[server_stream_id] = stream_layer + self.connections[stream_layer.client] = stream_layer + self.connections[stream_layer.server] = stream_layer + yield from self.event_to_child(stream_layer, events.Start()) + + # forward data and close events + conn: Connection = ( + stream_layer.client if from_client else stream_layer.server + ) + if isinstance(event, QuicStreamDataReceived): + if event.data: + yield from self.event_to_child( + stream_layer, events.DataReceived(conn, event.data) + ) + if event.end_stream: + yield from self.close_stream_layer(stream_layer, from_client) + elif isinstance(event, QuicStreamReset): + # preserve stream resets + for command in self.close_stream_layer(stream_layer, from_client): + if ( + isinstance(command, SendQuicStreamData) + and command.stream_id == stream_layer.stream_id(not from_client) + and command.end_stream + and not command.data + ): + yield ResetQuicStream( + command.connection, command.stream_id, event.error_code + ) + else: + yield command + else: + raise AssertionError(f"Unexpected stream event: {event!r}") + + # handle close events that target this context + elif isinstance(event, QuicConnectionClosed) and ( + event.connection is self.context.client + or event.connection is self.context.server + ): + from_client = event.connection is self.context.client + other_conn = self.context.server if from_client else self.context.client + + # be done if both connections are closed + if other_conn.connected: + yield CloseQuicConnection( + other_conn, event.error_code, event.frame_type, event.reason_phrase + ) + else: + self._handle_event = self.done # type: ignore + + # always forward to the datagram layer and swallow `CloseConnection` commands + for command in self.event_to_child(self.datagram_layer, event): + if ( + not isinstance(command, commands.CloseConnection) + or command.connection is not other_conn + ): + yield command + + # forward to either the client or server connection of stream layers and swallow empty stream end + for conn, child_layer in self.connections.items(): + if isinstance(child_layer, QuicStreamLayer) and ( + (conn is child_layer.client) + if from_client + else (conn is child_layer.server) + ): + conn.state &= ~connection.ConnectionState.CAN_WRITE + for command in self.close_stream_layer(child_layer, from_client): + if not isinstance(command, SendQuicStreamData) or command.data: + yield command + + # all other connection events are routed to their corresponding layer + elif isinstance(event, events.ConnectionEvent): + yield from self.event_to_child(self.connections[event.connection], event) + + else: + raise AssertionError(f"Unexpected event: {event!r}") + + def close_stream_layer( + self, stream_layer: QuicStreamLayer, client: bool + ) -> layer.CommandGenerator[None]: + """Closes the incoming part of a connection.""" + + conn = stream_layer.client if client else stream_layer.server + conn.state &= ~connection.ConnectionState.CAN_READ + assert conn.timestamp_start is not None + if conn.timestamp_end is None: + conn.timestamp_end = time.time() + yield from self.event_to_child(stream_layer, events.ConnectionClosed(conn)) + + def event_to_child( + self, child_layer: layer.Layer, event: events.Event + ) -> layer.CommandGenerator[None]: + """Forwards events to child layers and translates commands.""" + + for command in child_layer.handle_event(event): + # intercept commands for streams connections + if ( + isinstance(child_layer, QuicStreamLayer) + and isinstance(command, commands.ConnectionCommand) + and ( + command.connection is child_layer.client + or command.connection is child_layer.server + ) + ): + # get the target connection and stream ID + to_client = command.connection is child_layer.client + quic_conn = self.context.client if to_client else self.context.server + stream_id = child_layer.stream_id(to_client) + + # write data and check CloseConnection wasn't called before + if isinstance(command, commands.SendData): + assert stream_id is not None + if command.connection.state & connection.ConnectionState.CAN_WRITE: + yield SendQuicStreamData(quic_conn, stream_id, command.data) + + # send a FIN and optionally also a STOP frame + elif isinstance(command, commands.CloseConnection): + assert stream_id is not None + if command.connection.state & connection.ConnectionState.CAN_WRITE: + command.connection.state &= ( + ~connection.ConnectionState.CAN_WRITE + ) + yield SendQuicStreamData( + quic_conn, stream_id, b"", end_stream=True + ) + # XXX: Use `command.connection.state & connection.ConnectionState.CAN_READ` instead? + only_close_our_half = ( + isinstance(command, commands.CloseTcpConnection) + and command.half_close + ) + if not only_close_our_half: + if stream_is_client_initiated( + stream_id + ) == to_client or not stream_is_unidirectional(stream_id): + yield StopSendingQuicStream( + quic_conn, stream_id, QuicErrorCode.NO_ERROR + ) + yield from self.close_stream_layer(child_layer, to_client) + + # open server connections by reserving the next stream ID + elif isinstance(command, commands.OpenConnection): + assert not to_client + assert stream_id is None + client_stream_id = child_layer.stream_id(client=True) + assert client_stream_id is not None + stream_id = self.get_next_available_stream_id( + is_client=True, + is_unidirectional=stream_is_unidirectional(client_stream_id), + ) + child_layer.open_server_stream(stream_id) + self.server_stream_ids[stream_id] = child_layer + yield from self.event_to_child( + child_layer, events.OpenConnectionCompleted(command, None) + ) + + else: + raise AssertionError( + f"Unexpected stream connection command: {command!r}" + ) + + # remember blocking and wakeup commands + else: + if command.blocking or isinstance(command, commands.RequestWakeup): + self.command_sources[command] = child_layer + if isinstance(command, commands.OpenConnection): + self.connections[command.connection] = child_layer + yield command + + def get_next_available_stream_id( + self, is_client: bool, is_unidirectional: bool = False + ) -> int: + index = (int(is_unidirectional) << 1) | int(not is_client) + stream_id = self.next_stream_id[index] + self.next_stream_id[index] = stream_id + 4 + return stream_id + + def done(self, _) -> layer.CommandGenerator[None]: # pragma: no cover + yield from () diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_stream_layers.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_stream_layers.py new file mode 100644 index 0000000000000000000000000000000000000000..0763e8ca0c40c38c901cbb34b33b009efc119f24 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/quic/_stream_layers.py @@ -0,0 +1,638 @@ +""" +This module contains the client and server proxy layers for QUIC streams +which decrypt and encrypt traffic. Decrypted stream data is then forwarded +to either the raw layers, or the HTTP/3 client in ../http/_http3.py. +""" + +from __future__ import annotations + +import time +from collections.abc import Callable +from logging import DEBUG +from logging import ERROR +from logging import WARNING + +from aioquic.buffer import Buffer as QuicBuffer +from aioquic.h3.connection import ErrorCode as H3ErrorCode +from aioquic.quic import events as quic_events +from aioquic.quic.configuration import QuicConfiguration +from aioquic.quic.connection import QuicConnection +from aioquic.quic.connection import QuicConnectionState +from aioquic.quic.connection import QuicErrorCode +from aioquic.quic.packet import encode_quic_version_negotiation +from aioquic.quic.packet import PACKET_TYPE_INITIAL +from aioquic.quic.packet import pull_quic_header +from cryptography import x509 + +from ._client_hello_parser import quic_parse_client_hello_from_datagrams +from ._commands import CloseQuicConnection +from ._commands import QuicStreamCommand +from ._commands import ResetQuicStream +from ._commands import SendQuicStreamData +from ._commands import StopSendingQuicStream +from ._events import QuicConnectionClosed +from ._events import QuicStreamDataReceived +from ._events import QuicStreamReset +from ._events import QuicStreamStopSending +from ._hooks import QuicStartClientHook +from ._hooks import QuicStartServerHook +from ._hooks import QuicTlsData +from ._hooks import QuicTlsSettings +from mitmproxy import certs +from mitmproxy import connection +from mitmproxy import ctx +from mitmproxy.net import tls +from mitmproxy.proxy import commands +from mitmproxy.proxy import context +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy import tunnel +from mitmproxy.proxy.layers.tls import TlsClienthelloHook +from mitmproxy.proxy.layers.tls import TlsEstablishedClientHook +from mitmproxy.proxy.layers.tls import TlsEstablishedServerHook +from mitmproxy.proxy.layers.tls import TlsFailedClientHook +from mitmproxy.proxy.layers.tls import TlsFailedServerHook +from mitmproxy.proxy.layers.udp import UDPLayer +from mitmproxy.tls import ClientHelloData + +SUPPORTED_QUIC_VERSIONS_SERVER = QuicConfiguration(is_client=False).supported_versions + + +class QuicLayer(tunnel.TunnelLayer): + quic: QuicConnection | None = None + tls: QuicTlsSettings | None = None + + def __init__( + self, + context: context.Context, + conn: connection.Connection, + time: Callable[[], float] | None, + ) -> None: + super().__init__(context, tunnel_connection=conn, conn=conn) + self.child_layer = layer.NextLayer(self.context, ask_on_start=True) + self._time = time or ctx.master.event_loop.time + self._wakeup_commands: dict[commands.RequestWakeup, float] = dict() + conn.tls = True + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, events.Wakeup) and event.command in self._wakeup_commands: + # TunnelLayer has no understanding of wakeups, so we turn this into an empty DataReceived event + # which TunnelLayer recognizes as belonging to our connection. + assert self.quic + scheduled_time = self._wakeup_commands.pop(event.command) + if self.quic._state is not QuicConnectionState.TERMINATED: + # weird quirk: asyncio sometimes returns a bit ahead of time. + now = max(scheduled_time, self._time()) + self.quic.handle_timer(now) + yield from super()._handle_event( + events.DataReceived(self.tunnel_connection, b"") + ) + else: + yield from super()._handle_event(event) + + def event_to_child(self, event: events.Event) -> layer.CommandGenerator[None]: + # the parent will call _handle_command multiple times, we transmit cumulative afterwards + # this will reduce the number of sends, especially if data=b"" and end_stream=True + yield from super().event_to_child(event) + if self.quic: + yield from self.tls_interact() + + def _handle_command( + self, command: commands.Command + ) -> layer.CommandGenerator[None]: + """Turns stream commands into aioquic connection invocations.""" + if isinstance(command, QuicStreamCommand) and command.connection is self.conn: + assert self.quic + if isinstance(command, SendQuicStreamData): + self.quic.send_stream_data( + command.stream_id, command.data, command.end_stream + ) + elif isinstance(command, ResetQuicStream): + stream = self.quic._get_or_create_stream_for_send(command.stream_id) + existing_reset_error_code = stream.sender._reset_error_code + if existing_reset_error_code is None: + self.quic.reset_stream(command.stream_id, command.error_code) + elif self.debug: # pragma: no cover + yield commands.Log( + f"{self.debug}[quic] stream {stream.stream_id} already reset ({existing_reset_error_code=}, {command.error_code=})", + DEBUG, + ) + elif isinstance(command, StopSendingQuicStream): + # the stream might have already been closed, check before stopping + if command.stream_id in self.quic._streams: + self.quic.stop_stream(command.stream_id, command.error_code) + else: + raise AssertionError(f"Unexpected stream command: {command!r}") + else: + yield from super()._handle_command(command) + + def start_tls( + self, original_destination_connection_id: bytes | None + ) -> layer.CommandGenerator[None]: + """Initiates the aioquic connection.""" + + # must only be called if QUIC is uninitialized + assert not self.quic + assert not self.tls + + # query addons to provide the necessary TLS settings + tls_data = QuicTlsData(self.conn, self.context) + if self.conn is self.context.client: + yield QuicStartClientHook(tls_data) + else: + yield QuicStartServerHook(tls_data) + if not tls_data.settings: + yield commands.Log( + f"No QUIC context was provided, failing connection.", ERROR + ) + yield commands.CloseConnection(self.conn) + return + + # build the aioquic connection + configuration = tls_settings_to_configuration( + settings=tls_data.settings, + is_client=self.conn is self.context.server, + server_name=self.conn.sni, + ) + self.quic = QuicConnection( + configuration=configuration, + original_destination_connection_id=original_destination_connection_id, + ) + self.tls = tls_data.settings + + # if we act as client, connect to upstream + if original_destination_connection_id is None: + self.quic.connect(self.conn.peername, now=self._time()) + yield from self.tls_interact() + + def tls_interact(self) -> layer.CommandGenerator[None]: + """Retrieves all pending outgoing packets from aioquic and sends the data.""" + + # send all queued datagrams + assert self.quic + now = self._time() + + for data, addr in self.quic.datagrams_to_send(now=now): + assert addr == self.conn.peername + yield commands.SendData(self.tunnel_connection, data) + + timer = self.quic.get_timer() + if timer is not None: + # smooth wakeups a bit. + smoothed = timer + 0.002 + # request a new wakeup if all pending requests trigger at a later time + if not any( + existing <= smoothed for existing in self._wakeup_commands.values() + ): + command = commands.RequestWakeup(timer - now) + self._wakeup_commands[command] = timer + yield command + + def receive_handshake_data( + self, data: bytes + ) -> layer.CommandGenerator[tuple[bool, str | None]]: + assert self.quic + + # forward incoming data to aioquic + if data: + self.quic.receive_datagram(data, self.conn.peername, now=self._time()) + + # handle pre-handshake events + while event := self.quic.next_event(): + if isinstance(event, quic_events.ConnectionTerminated): + err = event.reason_phrase or error_code_to_str(event.error_code) + return False, err + elif isinstance(event, quic_events.HandshakeCompleted): + # concatenate all peer certificates + all_certs: list[x509.Certificate] = [] + if self.quic.tls._peer_certificate: + all_certs.append(self.quic.tls._peer_certificate) + all_certs.extend(self.quic.tls._peer_certificate_chain) + + # set the connection's TLS properties + self.conn.timestamp_tls_setup = time.time() + if event.alpn_protocol: + self.conn.alpn = event.alpn_protocol.encode("ascii") + self.conn.certificate_list = [certs.Cert(cert) for cert in all_certs] + assert self.quic.tls.key_schedule + self.conn.cipher = self.quic.tls.key_schedule.cipher_suite.name + self.conn.tls_version = "QUICv1" + + # log the result and report the success to addons + if self.debug: + yield commands.Log( + f"{self.debug}[quic] tls established: {self.conn}", DEBUG + ) + if self.conn is self.context.client: + yield TlsEstablishedClientHook( + QuicTlsData(self.conn, self.context, settings=self.tls) + ) + else: + yield TlsEstablishedServerHook( + QuicTlsData(self.conn, self.context, settings=self.tls) + ) + + yield from self.tls_interact() + return True, None + elif isinstance( + event, + ( + quic_events.ConnectionIdIssued, + quic_events.ConnectionIdRetired, + quic_events.PingAcknowledged, + quic_events.ProtocolNegotiated, + ), + ): + pass + else: + raise AssertionError(f"Unexpected event: {event!r}") + + # transmit buffered data and re-arm timer + yield from self.tls_interact() + return False, None + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + self.conn.error = err + if self.conn is self.context.client: + yield TlsFailedClientHook( + QuicTlsData(self.conn, self.context, settings=self.tls) + ) + else: + yield TlsFailedServerHook( + QuicTlsData(self.conn, self.context, settings=self.tls) + ) + yield from super().on_handshake_error(err) + + def receive_data(self, data: bytes) -> layer.CommandGenerator[None]: + assert self.quic + + # forward incoming data to aioquic + if data: + self.quic.receive_datagram(data, self.conn.peername, now=self._time()) + + # handle post-handshake events + while event := self.quic.next_event(): + if isinstance(event, quic_events.ConnectionTerminated): + if self.debug: + reason = event.reason_phrase or error_code_to_str(event.error_code) + yield commands.Log( + f"{self.debug}[quic] close_notify {self.conn} ({reason=!s})", + DEBUG, + ) + # We don't rely on `ConnectionTerminated` to dispatch `QuicConnectionClosed`, because + # after aioquic receives a termination frame, it still waits for the next `handle_timer` + # before returning `ConnectionTerminated` in `next_event`. In the meantime, the underlying + # connection could be closed. Therefore, we instead dispatch on `ConnectionClosed` and simply + # close the connection here. + yield commands.CloseConnection(self.tunnel_connection) + return # we don't handle any further events, nor do/can we transmit data, so exit + elif isinstance(event, quic_events.DatagramFrameReceived): + yield from self.event_to_child( + events.DataReceived(self.conn, event.data) + ) + elif isinstance(event, quic_events.StreamDataReceived): + yield from self.event_to_child( + QuicStreamDataReceived( + self.conn, event.stream_id, event.data, event.end_stream + ) + ) + elif isinstance(event, quic_events.StreamReset): + yield from self.event_to_child( + QuicStreamReset(self.conn, event.stream_id, event.error_code) + ) + elif isinstance(event, quic_events.StopSendingReceived): + yield from self.event_to_child( + QuicStreamStopSending(self.conn, event.stream_id, event.error_code) + ) + elif isinstance( + event, + ( + quic_events.ConnectionIdIssued, + quic_events.ConnectionIdRetired, + quic_events.PingAcknowledged, + quic_events.ProtocolNegotiated, + ), + ): + pass + else: + raise AssertionError(f"Unexpected event: {event!r}") + + # transmit buffered data and re-arm timer + yield from self.tls_interact() + + def receive_close(self) -> layer.CommandGenerator[None]: + assert self.quic + # if `_close_event` is not set, the underlying connection has been closed + # we turn this into a QUIC close event as well + close_event = self.quic._close_event or quic_events.ConnectionTerminated( + QuicErrorCode.NO_ERROR, None, "Connection closed." + ) + yield from self.event_to_child( + QuicConnectionClosed( + self.conn, + close_event.error_code, + close_event.frame_type, + close_event.reason_phrase, + ) + ) + + def send_data(self, data: bytes) -> layer.CommandGenerator[None]: + # non-stream data uses datagram frames + assert self.quic + if data: + self.quic.send_datagram_frame(data) + yield from self.tls_interact() + + def send_close( + self, command: commands.CloseConnection + ) -> layer.CommandGenerator[None]: + # properly close the QUIC connection + if self.quic: + if isinstance(command, CloseQuicConnection): + self.quic.close( + command.error_code, command.frame_type, command.reason_phrase + ) + else: + self.quic.close() + yield from self.tls_interact() + yield from super().send_close(command) + + +class ServerQuicLayer(QuicLayer): + """ + This layer establishes QUIC for a single server connection. + """ + + wait_for_clienthello: bool = False + + def __init__( + self, + context: context.Context, + conn: connection.Server | None = None, + time: Callable[[], float] | None = None, + ): + super().__init__(context, conn or context.server, time) + + def start_handshake(self) -> layer.CommandGenerator[None]: + wait_for_clienthello = not self.command_to_reply_to and isinstance( + self.child_layer, ClientQuicLayer + ) + if wait_for_clienthello: + self.wait_for_clienthello = True + self.tunnel_state = tunnel.TunnelState.CLOSED + else: + yield from self.start_tls(None) + + def event_to_child(self, event: events.Event) -> layer.CommandGenerator[None]: + if self.wait_for_clienthello: + for command in super().event_to_child(event): + if ( + isinstance(command, commands.OpenConnection) + and command.connection == self.conn + ): + self.wait_for_clienthello = False + else: + yield command + else: + yield from super().event_to_child(event) + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + yield commands.Log(f"Server QUIC handshake failed. {err}", level=WARNING) + yield from super().on_handshake_error(err) + + +class ClientQuicLayer(QuicLayer): + """ + This layer establishes QUIC on a single client connection. + """ + + server_tls_available: bool + """Indicates whether the parent layer is a ServerQuicLayer.""" + handshake_datagram_buf: list[bytes] + + def __init__( + self, context: context.Context, time: Callable[[], float] | None = None + ) -> None: + # same as ClientTLSLayer, we might be nested in some other transport + if context.client.tls: + context.client.alpn = None + context.client.cipher = None + context.client.sni = None + context.client.timestamp_tls_setup = None + context.client.tls_version = None + context.client.certificate_list = [] + context.client.mitmcert = None + context.client.alpn_offers = [] + context.client.cipher_list = [] + + super().__init__(context, context.client, time) + self.server_tls_available = len(self.context.layers) >= 2 and isinstance( + self.context.layers[-2], ServerQuicLayer + ) + self.handshake_datagram_buf = [] + + def start_handshake(self) -> layer.CommandGenerator[None]: + yield from () + + def receive_handshake_data( + self, data: bytes + ) -> layer.CommandGenerator[tuple[bool, str | None]]: + if not self.context.options.http3: + yield commands.Log( + f"Swallowing QUIC handshake because HTTP/3 is disabled.", DEBUG + ) + return False, None + + # if we already had a valid client hello, don't process further packets + if self.tls: + return (yield from super().receive_handshake_data(data)) + + # fail if the received data is not a QUIC packet + buffer = QuicBuffer(data=data) + try: + header = pull_quic_header(buffer) + except TypeError: + return False, f"Cannot parse QUIC header: Malformed head ({data.hex()})" + except ValueError as e: + return False, f"Cannot parse QUIC header: {e} ({data.hex()})" + + # negotiate version, support all versions known to aioquic + if ( + header.version is not None + and header.version not in SUPPORTED_QUIC_VERSIONS_SERVER + ): + yield commands.SendData( + self.tunnel_connection, + encode_quic_version_negotiation( + source_cid=header.destination_cid, + destination_cid=header.source_cid, + supported_versions=SUPPORTED_QUIC_VERSIONS_SERVER, + ), + ) + return False, None + + # ensure it's (likely) a client handshake packet + if len(data) < 1200 or header.packet_type != PACKET_TYPE_INITIAL: + return ( + False, + f"Invalid handshake received, roaming not supported. ({data.hex()})", + ) + + self.handshake_datagram_buf.append(data) + # extract the client hello + try: + client_hello = quic_parse_client_hello_from_datagrams( + self.handshake_datagram_buf + ) + except ValueError as e: + msgs = b"\n".join(self.handshake_datagram_buf) + dbg = f"Cannot parse ClientHello: {e} ({msgs.hex()})" + self.handshake_datagram_buf.clear() + return False, dbg + + if not client_hello: + return False, None + + # copy the client hello information + self.conn.sni = client_hello.sni + self.conn.alpn_offers = client_hello.alpn_protocols + + # check with addons what we shall do + tls_clienthello = ClientHelloData(self.context, client_hello) + yield TlsClienthelloHook(tls_clienthello) + + # replace the QUIC layer with an UDP layer if requested + if tls_clienthello.ignore_connection: + self.conn = self.tunnel_connection = connection.Client( + peername=("ignore-conn", 0), + sockname=("ignore-conn", 0), + transport_protocol="udp", + state=connection.ConnectionState.OPEN, + ) + + # we need to replace the server layer as well, if there is one + parent_layer = self.context.layers[self.context.layers.index(self) - 1] + if isinstance(parent_layer, ServerQuicLayer): + parent_layer.conn = parent_layer.tunnel_connection = connection.Server( + address=None + ) + replacement_layer = UDPLayer(self.context, ignore=True) + parent_layer.handle_event = replacement_layer.handle_event # type: ignore + parent_layer._handle_event = replacement_layer._handle_event # type: ignore + yield from parent_layer.handle_event(events.Start()) + for dgm in self.handshake_datagram_buf: + yield from parent_layer.handle_event( + events.DataReceived(self.context.client, dgm) + ) + self.handshake_datagram_buf.clear() + return True, None + + # start the server QUIC connection if demanded and available + if ( + tls_clienthello.establish_server_tls_first + and not self.context.server.tls_established + ): + err = yield from self.start_server_tls() + if err: + yield commands.Log( + f"Unable to establish QUIC connection with server ({err}). " + f"Trying to establish QUIC with client anyway. " + f"If you plan to redirect requests away from this server, " + f"consider setting `connection_strategy` to `lazy` to suppress early connections." + ) + + # start the client QUIC connection + yield from self.start_tls(header.destination_cid) + # XXX copied from TLS, we assume that `CloseConnection` in `start_tls` takes effect immediately + if not self.conn.connected: + return False, "connection closed early" + + # send the client hello to aioquic + assert self.quic + for dgm in self.handshake_datagram_buf: + self.quic.receive_datagram(dgm, self.conn.peername, now=self._time()) + self.handshake_datagram_buf.clear() + + # handle events emanating from `self.quic` + return (yield from super().receive_handshake_data(b"")) + + def start_server_tls(self) -> layer.CommandGenerator[str | None]: + if not self.server_tls_available: + return f"No server QUIC available." + err = yield commands.OpenConnection(self.context.server) + return err + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + yield commands.Log(f"Client QUIC handshake failed. {err}", level=WARNING) + yield from super().on_handshake_error(err) + self.event_to_child = self.errored # type: ignore + + def errored(self, event: events.Event) -> layer.CommandGenerator[None]: + if self.debug is not None: + yield commands.Log( + f"{self.debug}[quic] Swallowing {event} as handshake failed.", DEBUG + ) + + +class QuicSecretsLogger: + logger: tls.MasterSecretLogger + + def __init__(self, logger: tls.MasterSecretLogger) -> None: + super().__init__() + self.logger = logger + + def write(self, s: str) -> int: + if s[-1:] == "\n": + s = s[:-1] + data = s.encode("ascii") + self.logger(None, data) # type: ignore + return len(data) + 1 + + def flush(self) -> None: + # done by the logger during write + pass + + +def error_code_to_str(error_code: int) -> str: + """Returns the corresponding name of the given error code or a string containing its numeric value.""" + + try: + return H3ErrorCode(error_code).name + except ValueError: + try: + return QuicErrorCode(error_code).name + except ValueError: + return f"unknown error (0x{error_code:x})" + + +def is_success_error_code(error_code: int) -> bool: + """Returns whether the given error code actually indicates no error.""" + + return error_code in (QuicErrorCode.NO_ERROR, H3ErrorCode.H3_NO_ERROR) + + +def tls_settings_to_configuration( + settings: QuicTlsSettings, + is_client: bool, + server_name: str | None = None, +) -> QuicConfiguration: + """Converts `QuicTlsSettings` to `QuicConfiguration`.""" + + return QuicConfiguration( + alpn_protocols=settings.alpn_protocols, + is_client=is_client, + secrets_log_file=( + QuicSecretsLogger(tls.log_master_secret) # type: ignore + if tls.log_master_secret is not None + else None + ), + server_name=server_name, + cafile=settings.ca_file, + capath=settings.ca_path, + certificate=settings.certificate, + certificate_chain=settings.certificate_chain, + cipher_suites=settings.cipher_suites, + private_key=settings.certificate_private_key, + verify_mode=settings.verify_mode, + max_datagram_frame_size=65536, + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/tcp.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/tcp.py new file mode 100644 index 0000000000000000000000000000000000000000..f0dfc47a197a76c150bc97330b7a80399f06031b --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/tcp.py @@ -0,0 +1,143 @@ +from dataclasses import dataclass + +from mitmproxy import flow +from mitmproxy import tcp +from mitmproxy.connection import Connection +from mitmproxy.connection import ConnectionState +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.commands import StartHook +from mitmproxy.proxy.context import Context +from mitmproxy.proxy.events import MessageInjected +from mitmproxy.proxy.utils import expect + + +@dataclass +class TcpStartHook(StartHook): + """ + A TCP connection has started. + """ + + flow: tcp.TCPFlow + + +@dataclass +class TcpMessageHook(StartHook): + """ + A TCP connection has received a message. The most recent message + will be flow.messages[-1]. The message is user-modifiable. + """ + + flow: tcp.TCPFlow + + +@dataclass +class TcpEndHook(StartHook): + """ + A TCP connection has ended. + """ + + flow: tcp.TCPFlow + + +@dataclass +class TcpErrorHook(StartHook): + """ + A TCP error has occurred. + + Every TCP flow will receive either a tcp_error or a tcp_end event, but not both. + """ + + flow: tcp.TCPFlow + + +class TcpMessageInjected(MessageInjected[tcp.TCPMessage]): + """ + The user has injected a custom TCP message. + """ + + +class TCPLayer(layer.Layer): + """ + Simple TCP layer that just relays messages right now. + """ + + flow: tcp.TCPFlow | None + + def __init__(self, context: Context, ignore: bool = False): + super().__init__(context) + if ignore: + self.flow = None + else: + self.flow = tcp.TCPFlow(self.context.client, self.context.server, True) + + @expect(events.Start) + def start(self, _) -> layer.CommandGenerator[None]: + if self.flow: + yield TcpStartHook(self.flow) + + if self.context.server.timestamp_start is None: + err = yield commands.OpenConnection(self.context.server) + if err: + if self.flow: + self.flow.error = flow.Error(str(err)) + yield TcpErrorHook(self.flow) + yield commands.CloseConnection(self.context.client) + self._handle_event = self.done + return + self._handle_event = self.relay_messages + + _handle_event = start + + @expect(events.DataReceived, events.ConnectionClosed, TcpMessageInjected) + def relay_messages(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, TcpMessageInjected): + # we just spoof that we received data here and then process that regularly. + event = events.DataReceived( + self.context.client + if event.message.from_client + else self.context.server, + event.message.content, + ) + + assert isinstance(event, events.ConnectionEvent) + + from_client = event.connection == self.context.client + send_to: Connection + if from_client: + send_to = self.context.server + else: + send_to = self.context.client + + if isinstance(event, events.DataReceived): + if self.flow: + tcp_message = tcp.TCPMessage(from_client, event.data) + self.flow.messages.append(tcp_message) + yield TcpMessageHook(self.flow) + yield commands.SendData(send_to, tcp_message.content) + else: + yield commands.SendData(send_to, event.data) + + elif isinstance(event, events.ConnectionClosed): + all_done = not ( + (self.context.client.state & ConnectionState.CAN_READ) + or (self.context.server.state & ConnectionState.CAN_READ) + ) + if all_done: + self._handle_event = self.done + if self.context.server.state is not ConnectionState.CLOSED: + yield commands.CloseConnection(self.context.server) + if self.context.client.state is not ConnectionState.CLOSED: + yield commands.CloseConnection(self.context.client) + if self.flow: + yield TcpEndHook(self.flow) + self.flow.live = False + else: + yield commands.CloseTcpConnection(send_to, half_close=True) + else: + raise AssertionError(f"Unexpected event: {event}") + + @expect(events.DataReceived, events.ConnectionClosed, TcpMessageInjected) + def done(self, _) -> layer.CommandGenerator[None]: + yield from () diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/tls.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/tls.py new file mode 100644 index 0000000000000000000000000000000000000000..2c0cdc393619b35b21c1a6b85275e515e217c7d1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/tls.py @@ -0,0 +1,692 @@ +import struct +import time +import typing +from collections.abc import Iterator +from dataclasses import dataclass +from logging import DEBUG +from logging import ERROR +from logging import INFO +from logging import WARNING + +from OpenSSL import SSL + +from mitmproxy import certs +from mitmproxy import connection +from mitmproxy.connection import TlsVersion +from mitmproxy.net.tls import starts_like_dtls_record +from mitmproxy.net.tls import starts_like_tls_record +from mitmproxy.proxy import commands +from mitmproxy.proxy import context +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy import tunnel +from mitmproxy.proxy.commands import StartHook +from mitmproxy.proxy.layers import tcp +from mitmproxy.proxy.layers import udp +from mitmproxy.tls import ClientHello +from mitmproxy.tls import ClientHelloData +from mitmproxy.tls import TlsData +from mitmproxy.utils import human + + +def handshake_record_contents(data: bytes) -> Iterator[bytes]: + """ + Returns a generator that yields the bytes contained in each handshake record. + This will raise an error on the first non-handshake record, so fully exhausting this + generator is a bad idea. + """ + offset = 0 + while True: + if len(data) < offset + 5: + return + record_header = data[offset : offset + 5] + if not starts_like_tls_record(record_header): + raise ValueError(f"Expected TLS record, got {record_header!r} instead.") + record_size = struct.unpack("!H", record_header[3:])[0] + if record_size == 0: + raise ValueError("Record must not be empty.") + offset += 5 + + if len(data) < offset + record_size: + return + record_body = data[offset : offset + record_size] + yield record_body + offset += record_size + + +def get_client_hello(data: bytes) -> bytes | None: + """ + Read all TLS records that contain the initial ClientHello. + Returns the raw handshake packet bytes, without TLS record headers. + """ + client_hello = b"" + for d in handshake_record_contents(data): + client_hello += d + if len(client_hello) >= 4: + client_hello_size = struct.unpack("!I", b"\x00" + client_hello[1:4])[0] + 4 + if len(client_hello) >= client_hello_size: + return client_hello[:client_hello_size] + return None + + +def parse_client_hello(data: bytes) -> ClientHello | None: + """ + Check if the supplied bytes contain a full ClientHello message, + and if so, parse it. + + Returns: + - A ClientHello object on success + - None, if the TLS record is not complete + + Raises: + - A ValueError, if the passed ClientHello is invalid + """ + # Check if ClientHello is complete + client_hello = get_client_hello(data) + if client_hello: + try: + return ClientHello(client_hello[4:]) + except EOFError as e: + raise ValueError("Invalid ClientHello") from e + return None + + +def dtls_handshake_record_contents(data: bytes) -> Iterator[bytes]: + """ + Returns a generator that yields the bytes contained in each handshake record. + This will raise an error on the first non-handshake record, so fully exhausting this + generator is a bad idea. + """ + offset = 0 + while True: + # DTLS includes two new fields, totaling 8 bytes, between Version and Length + if len(data) < offset + 13: + return + record_header = data[offset : offset + 13] + if not starts_like_dtls_record(record_header): + raise ValueError(f"Expected DTLS record, got {record_header!r} instead.") + # Length fields starts at 11 + record_size = struct.unpack("!H", record_header[11:])[0] + if record_size == 0: + raise ValueError("Record must not be empty.") + offset += 13 + + if len(data) < offset + record_size: + return + record_body = data[offset : offset + record_size] + yield record_body + offset += record_size + + +def get_dtls_client_hello(data: bytes) -> bytes | None: + """ + Read all DTLS records that contain the initial ClientHello. + Returns the raw handshake packet bytes, without TLS record headers. + """ + client_hello = b"" + for d in dtls_handshake_record_contents(data): + client_hello += d + if len(client_hello) >= 13: + # comment about slicing: we skip the epoch and sequence number + client_hello_size = ( + struct.unpack("!I", b"\x00" + client_hello[9:12])[0] + 12 + ) + if len(client_hello) >= client_hello_size: + return client_hello[:client_hello_size] + return None + + +def dtls_parse_client_hello(data: bytes) -> ClientHello | None: + """ + Check if the supplied bytes contain a full ClientHello message, + and if so, parse it. + + Returns: + - A ClientHello object on success + - None, if the TLS record is not complete + + Raises: + - A ValueError, if the passed ClientHello is invalid + """ + # Check if ClientHello is complete + client_hello = get_dtls_client_hello(data) + if client_hello: + try: + return ClientHello(client_hello[12:], dtls=True) + except EOFError as e: + raise ValueError("Invalid ClientHello") from e + return None + + +HTTP1_ALPNS = (b"http/1.1", b"http/1.0", b"http/0.9") +HTTP2_ALPN = b"h2" +HTTP3_ALPN = b"h3" +HTTP_ALPNS = (HTTP3_ALPN, HTTP2_ALPN, *HTTP1_ALPNS) + + +# We need these classes as hooks can only have one argument at the moment. + + +@dataclass +class TlsClienthelloHook(StartHook): + """ + Mitmproxy has received a TLS ClientHello message. + + This hook decides whether a server connection is needed + to negotiate TLS with the client (data.establish_server_tls_first) + """ + + data: ClientHelloData + + +@dataclass +class TlsStartClientHook(StartHook): + """ + TLS negotation between mitmproxy and a client is about to start. + + An addon is expected to initialize data.ssl_conn. + (by default, this is done by `mitmproxy.addons.tlsconfig`) + """ + + data: TlsData + + +@dataclass +class TlsStartServerHook(StartHook): + """ + TLS negotation between mitmproxy and a server is about to start. + + An addon is expected to initialize data.ssl_conn. + (by default, this is done by `mitmproxy.addons.tlsconfig`) + """ + + data: TlsData + + +@dataclass +class TlsEstablishedClientHook(StartHook): + """ + The TLS handshake with the client has been completed successfully. + """ + + data: TlsData + + +@dataclass +class TlsEstablishedServerHook(StartHook): + """ + The TLS handshake with the server has been completed successfully. + """ + + data: TlsData + + +@dataclass +class TlsFailedClientHook(StartHook): + """ + The TLS handshake with the client has failed. + """ + + data: TlsData + + +@dataclass +class TlsFailedServerHook(StartHook): + """ + The TLS handshake with the server has failed. + """ + + data: TlsData + + +class TLSLayer(tunnel.TunnelLayer): + tls: SSL.Connection = None # type: ignore + """The OpenSSL connection object""" + + def __init__(self, context: context.Context, conn: connection.Connection): + super().__init__( + context, + tunnel_connection=conn, + conn=conn, + ) + + conn.tls = True + + def __repr__(self): + return ( + super().__repr__().replace(")", f" {self.conn.sni!r} {self.conn.alpn!r})") + ) + + @property + def is_dtls(self): + return self.conn.transport_protocol == "udp" + + @property + def proto_name(self): + return "DTLS" if self.is_dtls else "TLS" + + def start_tls(self) -> layer.CommandGenerator[None]: + assert not self.tls + + tls_start = TlsData(self.conn, self.context, is_dtls=self.is_dtls) + if self.conn == self.context.client: + yield TlsStartClientHook(tls_start) + else: + yield TlsStartServerHook(tls_start) + if not tls_start.ssl_conn: + yield commands.Log( + f"No {self.proto_name} context was provided, failing connection.", ERROR + ) + yield commands.CloseConnection(self.conn) + return + assert tls_start.ssl_conn + self.tls = tls_start.ssl_conn + + def tls_interact(self) -> layer.CommandGenerator[None]: + while True: + try: + data = self.tls.bio_read(65535) + except SSL.WantReadError: + return # Okay, nothing more waiting to be sent. + else: + yield commands.SendData(self.conn, data) + + def receive_handshake_data( + self, data: bytes + ) -> layer.CommandGenerator[tuple[bool, str | None]]: + # bio_write errors for b"", so we need to check first if we actually received something. + if data: + self.tls.bio_write(data) + try: + self.tls.do_handshake() + except SSL.WantReadError: + yield from self.tls_interact() + return False, None + except SSL.Error as e: + # provide more detailed information for some errors. + last_err = ( + e.args and isinstance(e.args[0], list) and e.args[0] and e.args[0][-1] + ) + if last_err in [ + ( + "SSL routines", + "tls_process_server_certificate", + "certificate verify failed", + ), + ("SSL routines", "", "certificate verify failed"), # OpenSSL 3+ + ]: + verify_result = SSL._lib.SSL_get_verify_result(self.tls._ssl) # type: ignore + error = SSL._ffi.string( # type: ignore + SSL._lib.X509_verify_cert_error_string(verify_result) # type: ignore + ).decode() + err = f"Certificate verify failed: {error}" + elif last_err in [ + ("SSL routines", "ssl3_read_bytes", "tlsv1 alert unknown ca"), + ("SSL routines", "ssl3_read_bytes", "sslv3 alert bad certificate"), + ("SSL routines", "ssl3_read_bytes", "ssl/tls alert bad certificate"), + ("SSL routines", "", "tlsv1 alert unknown ca"), # OpenSSL 3+ + ("SSL routines", "", "sslv3 alert bad certificate"), # OpenSSL 3+ + ("SSL routines", "", "ssl/tls alert bad certificate"), # OpenSSL 3.2+ + ]: + assert isinstance(last_err, tuple) + err = last_err[2] + elif ( + last_err + in [ + ("SSL routines", "ssl3_get_record", "wrong version number"), + ("SSL routines", "", "wrong version number"), # OpenSSL 3+ + ("SSL routines", "", "packet length too long"), # OpenSSL 3+ + ("SSL routines", "", "record layer failure"), # OpenSSL 3+ + ] + and data[:4].isascii() + ): + err = f"The remote server does not speak TLS." + elif last_err in [ + ("SSL routines", "ssl3_read_bytes", "tlsv1 alert protocol version"), + ("SSL routines", "", "tlsv1 alert protocol version"), # OpenSSL 3+ + ]: + err = ( + f"The remote server and mitmproxy cannot agree on a TLS version to use. " + f"You may need to adjust mitmproxy's tls_version_server_min option." + ) + else: + err = f"OpenSSL {e!r}" + return False, err + else: + # Here we set all attributes that are only known *after* the handshake. + + # Get all peer certificates. + # https://www.openssl.org/docs/man1.1.1/man3/SSL_get_peer_cert_chain.html + # If called on the client side, the stack also contains the peer's certificate; if called on the server + # side, the peer's certificate must be obtained separately using SSL_get_peer_certificate(3). + all_certs = self.tls.get_peer_cert_chain() or [] + if self.conn == self.context.client: + cert = self.tls.get_peer_certificate() + if cert: + all_certs.insert(0, cert) + self.conn.certificate_list = [] + for cert in all_certs: + try: + # This may fail for weird certs, https://github.com/mitmproxy/mitmproxy/issues/6968. + parsed_cert = certs.Cert.from_pyopenssl(cert) + except ValueError as e: + yield commands.Log( + f"{self.debug}[tls] failed to parse certificate: {e}", WARNING + ) + else: + self.conn.certificate_list.append(parsed_cert) + + self.conn.timestamp_tls_setup = time.time() + self.conn.alpn = self.tls.get_alpn_proto_negotiated() + self.conn.cipher = self.tls.get_cipher_name() + self.conn.tls_version = typing.cast( + TlsVersion, self.tls.get_protocol_version_name() + ) + if self.debug: + yield commands.Log( + f"{self.debug}[tls] tls established: {self.conn}", DEBUG + ) + if self.conn == self.context.client: + yield TlsEstablishedClientHook( + TlsData(self.conn, self.context, self.tls) + ) + else: + yield TlsEstablishedServerHook( + TlsData(self.conn, self.context, self.tls) + ) + yield from self.receive_data(b"") + return True, None + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + self.conn.error = err + if self.conn == self.context.client: + yield TlsFailedClientHook(TlsData(self.conn, self.context, self.tls)) + else: + yield TlsFailedServerHook(TlsData(self.conn, self.context, self.tls)) + yield from super().on_handshake_error(err) + + def receive_data(self, data: bytes) -> layer.CommandGenerator[None]: + if data: + self.tls.bio_write(data) + + plaintext = bytearray() + close = False + while True: + try: + plaintext.extend(self.tls.recv(65535)) + except SSL.WantReadError: + break + except SSL.ZeroReturnError: + close = True + break + except SSL.Error as e: + # This may be happening because the other side send an alert. + # There's somewhat ugly behavior with Firefox on Android here, + # which upon mistrusting a certificate still completes the handshake + # and then sends an alert in the next packet. At this point we have unfortunately + # already fired out `tls_established_client` hook. + yield commands.Log(f"TLS Error: {e}", WARNING) + break + + # Can we send something? + # Note that this must happen after `recv()`, which may have advanced the state machine. + # https://github.com/mitmproxy/mitmproxy/discussions/7550 + yield from self.tls_interact() + + if plaintext: + yield from self.event_to_child( + events.DataReceived(self.conn, bytes(plaintext)) + ) + if close: + self.conn.state &= ~connection.ConnectionState.CAN_READ + if self.debug: + yield commands.Log(f"{self.debug}[tls] close_notify {self.conn}", DEBUG) + yield from self.event_to_child(events.ConnectionClosed(self.conn)) + + def receive_close(self) -> layer.CommandGenerator[None]: + if self.tls.get_shutdown() & SSL.RECEIVED_SHUTDOWN: + pass # We have already dispatched a ConnectionClosed to the child layer. + else: + yield from super().receive_close() + + def send_data(self, data: bytes) -> layer.CommandGenerator[None]: + try: + self.tls.sendall(data) + except (SSL.ZeroReturnError, SSL.SysCallError): + # The other peer may still be trying to send data over, which we discard here. + pass + yield from self.tls_interact() + + def send_close( + self, command: commands.CloseConnection + ) -> layer.CommandGenerator[None]: + # We should probably shutdown the TLS connection properly here. + yield from super().send_close(command) + + +class ServerTLSLayer(TLSLayer): + """ + This layer establishes TLS for a single server connection. + """ + + wait_for_clienthello: bool = False + + def __init__(self, context: context.Context, conn: connection.Server | None = None): + super().__init__(context, conn or context.server) + + def start_handshake(self) -> layer.CommandGenerator[None]: + wait_for_clienthello = ( + # if command_to_reply_to is set, we've been instructed to open the connection from the child layer. + # in that case any potential ClientHello is already parsed (by the ClientTLS child layer). + not self.command_to_reply_to + # if command_to_reply_to is not set, the connection was already open when this layer received its Start + # event (eager connection strategy). We now want to establish TLS right away, _unless_ we already know + # that there's TLS on the client side as well (we check if our immediate child layer is set to be ClientTLS) + # In this case want to wait for ClientHello to be parsed, so that we can incorporate SNI/ALPN from there. + and isinstance(self.child_layer, ClientTLSLayer) + ) + if wait_for_clienthello: + self.wait_for_clienthello = True + self.tunnel_state = tunnel.TunnelState.CLOSED + else: + yield from self.start_tls() + if self.tls: + yield from self.receive_handshake_data(b"") + + def event_to_child(self, event: events.Event) -> layer.CommandGenerator[None]: + if self.wait_for_clienthello: + for command in super().event_to_child(event): + if ( + isinstance(command, commands.OpenConnection) + and command.connection == self.conn + ): + self.wait_for_clienthello = False + # swallow OpenConnection here by not re-yielding it. + else: + yield command + else: + yield from super().event_to_child(event) + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + yield commands.Log(f"Server TLS handshake failed. {err}", level=WARNING) + yield from super().on_handshake_error(err) + + +class ClientTLSLayer(TLSLayer): + """ + This layer establishes TLS on a single client connection. + + โ”Œโ”€โ”€โ”€โ”€โ”€โ” + โ”‚Startโ”‚ + โ””โ”ฌโ”€โ”€โ”€โ”€โ”˜ + โ†“ + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” + โ”‚Wait for ClientHelloโ”‚ + โ””โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + โ†“ + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” + โ”‚Process messagesโ”‚ + โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + + """ + + recv_buffer: bytearray + server_tls_available: bool + client_hello_parsed: bool = False + + def __init__(self, context: context.Context): + if context.client.tls: + # In the case of TLS-over-TLS, we already have client TLS. As the outer TLS connection between client + # and proxy isn't that interesting to us, we just unset the attributes here and keep the inner TLS + # session's attributes. + # Alternatively we could create a new Client instance, + # but for now we keep it simple. There is a proof-of-concept at + # https://github.com/mitmproxy/mitmproxy/commit/9b6e2a716888b7787514733b76a5936afa485352. + context.client.alpn = None + context.client.cipher = None + context.client.sni = None + context.client.timestamp_tls_setup = None + context.client.tls_version = None + context.client.certificate_list = [] + context.client.mitmcert = None + context.client.alpn_offers = [] + context.client.cipher_list = [] + + super().__init__(context, context.client) + self.server_tls_available = isinstance(self.context.layers[-2], ServerTLSLayer) + self.recv_buffer = bytearray() + + def start_handshake(self) -> layer.CommandGenerator[None]: + yield from () + + def receive_handshake_data( + self, data: bytes + ) -> layer.CommandGenerator[tuple[bool, str | None]]: + if self.client_hello_parsed: + return (yield from super().receive_handshake_data(data)) + self.recv_buffer.extend(data) + try: + if self.is_dtls: + client_hello = dtls_parse_client_hello(self.recv_buffer) + else: + client_hello = parse_client_hello(self.recv_buffer) + except ValueError: + return False, f"Cannot parse ClientHello: {self.recv_buffer.hex()}" + + if client_hello: + self.client_hello_parsed = True + else: + return False, None + + self.conn.sni = client_hello.sni + self.conn.alpn_offers = client_hello.alpn_protocols + tls_clienthello = ClientHelloData(self.context, client_hello) + yield TlsClienthelloHook(tls_clienthello) + + if tls_clienthello.ignore_connection: + # we've figured out that we don't want to intercept this connection, so we assign fake connection objects + # to all TLS layers. This makes the real connection contents just go through. + self.conn = self.tunnel_connection = connection.Client( + peername=("ignore-conn", 0), sockname=("ignore-conn", 0) + ) + parent_layer = self.context.layers[self.context.layers.index(self) - 1] + if isinstance(parent_layer, ServerTLSLayer): + parent_layer.conn = parent_layer.tunnel_connection = connection.Server( + address=None + ) + if self.is_dtls: + self.child_layer = udp.UDPLayer(self.context, ignore=True) + else: + self.child_layer = tcp.TCPLayer(self.context, ignore=True) + yield from self.event_to_child( + events.DataReceived(self.context.client, bytes(self.recv_buffer)) + ) + self.recv_buffer.clear() + return True, None + if ( + tls_clienthello.establish_server_tls_first + and not self.context.server.tls_established + ): + err = yield from self.start_server_tls() + if err: + yield commands.Log( + f"Unable to establish {self.proto_name} connection with server ({err}). " + f"Trying to establish {self.proto_name} with client anyway. " + f"If you plan to redirect requests away from this server, " + f"consider setting `connection_strategy` to `lazy` to suppress early connections." + ) + + yield from self.start_tls() + if not self.conn.connected: + return False, "connection closed early" + + ret = yield from super().receive_handshake_data(bytes(self.recv_buffer)) + self.recv_buffer.clear() + return ret + + def start_server_tls(self) -> layer.CommandGenerator[str | None]: + """ + We often need information from the upstream connection to establish TLS with the client. + For example, we need to check if the client does ALPN or not. + """ + if not self.server_tls_available: + return f"No server {self.proto_name} available." + err = yield commands.OpenConnection(self.context.server) + return err + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + if self.conn.sni: + dest = self.conn.sni + else: + dest = human.format_address(self.context.server.address) + level: int = WARNING + if err.startswith("Cannot parse ClientHello"): + pass + elif ( + "('SSL routines', 'tls_early_post_process_client_hello', 'unsupported protocol')" + in err + or "('SSL routines', '', 'unsupported protocol')" in err # OpenSSL 3+ + ): + err = ( + f"Client and mitmproxy cannot agree on a TLS version to use. " + f"You may need to adjust mitmproxy's tls_version_client_min option." + ) + elif ( + "unknown ca" in err + or "bad certificate" in err + or "certificate unknown" in err + ): + err = ( + f"The client does not trust the proxy's certificate for {dest} ({err})" + ) + elif err == "connection closed": + err = ( + f"The client disconnected during the handshake. If this happens consistently for {dest}, " + f"this may indicate that the client does not trust the proxy's certificate." + ) + level = INFO + elif err == "connection closed early": + pass + else: + err = f"The client may not trust the proxy's certificate for {dest} ({err})" + if err != "connection closed early": + yield commands.Log(f"Client TLS handshake failed. {err}", level=level) + yield from super().on_handshake_error(err) + self.event_to_child = self.errored # type: ignore + + def errored(self, event: events.Event) -> layer.CommandGenerator[None]: + if self.debug is not None: + yield commands.Log( + f"{self.debug}[tls] Swallowing {event} as handshake failed.", DEBUG + ) + + +class MockTLSLayer(TLSLayer): + """Mock layer to disable actual TLS and use cleartext in tests. + + Use like so: + monkeypatch.setattr(tls, "ServerTLSLayer", tls.MockTLSLayer) + """ + + def __init__(self, ctx: context.Context): + super().__init__(ctx, connection.Server(address=None)) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/udp.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/udp.py new file mode 100644 index 0000000000000000000000000000000000000000..e7a889c84771d74492579b98bb0ab8577a7142ae --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/udp.py @@ -0,0 +1,132 @@ +from dataclasses import dataclass + +from mitmproxy import flow +from mitmproxy import udp +from mitmproxy.connection import Connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.commands import StartHook +from mitmproxy.proxy.context import Context +from mitmproxy.proxy.events import MessageInjected +from mitmproxy.proxy.utils import expect + + +@dataclass +class UdpStartHook(StartHook): + """ + A UDP connection has started. + """ + + flow: udp.UDPFlow + + +@dataclass +class UdpMessageHook(StartHook): + """ + A UDP connection has received a message. The most recent message + will be flow.messages[-1]. The message is user-modifiable. + """ + + flow: udp.UDPFlow + + +@dataclass +class UdpEndHook(StartHook): + """ + A UDP connection has ended. + """ + + flow: udp.UDPFlow + + +@dataclass +class UdpErrorHook(StartHook): + """ + A UDP error has occurred. + + Every UDP flow will receive either a udp_error or a udp_end event, but not both. + """ + + flow: udp.UDPFlow + + +class UdpMessageInjected(MessageInjected[udp.UDPMessage]): + """ + The user has injected a custom UDP message. + """ + + +class UDPLayer(layer.Layer): + """ + Simple UDP layer that just relays messages right now. + """ + + flow: udp.UDPFlow | None + + def __init__(self, context: Context, ignore: bool = False): + super().__init__(context) + if ignore: + self.flow = None + else: + self.flow = udp.UDPFlow(self.context.client, self.context.server, True) + + @expect(events.Start) + def start(self, _) -> layer.CommandGenerator[None]: + if self.flow: + yield UdpStartHook(self.flow) + + if self.context.server.timestamp_start is None: + err = yield commands.OpenConnection(self.context.server) + if err: + if self.flow: + self.flow.error = flow.Error(str(err)) + yield UdpErrorHook(self.flow) + yield commands.CloseConnection(self.context.client) + self._handle_event = self.done + return + self._handle_event = self.relay_messages + + _handle_event = start + + @expect(events.DataReceived, events.ConnectionClosed, UdpMessageInjected) + def relay_messages(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, UdpMessageInjected): + # we just spoof that we received data here and then process that regularly. + event = events.DataReceived( + self.context.client + if event.message.from_client + else self.context.server, + event.message.content, + ) + + assert isinstance(event, events.ConnectionEvent) + + from_client = event.connection == self.context.client + send_to: Connection + if from_client: + send_to = self.context.server + else: + send_to = self.context.client + + if isinstance(event, events.DataReceived): + if self.flow: + udp_message = udp.UDPMessage(from_client, event.data) + self.flow.messages.append(udp_message) + yield UdpMessageHook(self.flow) + yield commands.SendData(send_to, udp_message.content) + else: + yield commands.SendData(send_to, event.data) + + elif isinstance(event, events.ConnectionClosed): + self._handle_event = self.done + yield commands.CloseConnection(send_to) + if self.flow: + yield UdpEndHook(self.flow) + self.flow.live = False + else: + raise AssertionError(f"Unexpected event: {event}") + + @expect(events.DataReceived, events.ConnectionClosed, UdpMessageInjected) + def done(self, _) -> layer.CommandGenerator[None]: + yield from () diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/websocket.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/websocket.py new file mode 100644 index 0000000000000000000000000000000000000000..85b63b4bdbad7a9bfeea1493255264fe654456e4 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/layers/websocket.py @@ -0,0 +1,272 @@ +import time +from collections.abc import Iterator +from dataclasses import dataclass + +import wsproto.extensions +import wsproto.frame_protocol +import wsproto.utilities +from wsproto import ConnectionState +from wsproto.frame_protocol import Opcode + +from mitmproxy import connection +from mitmproxy import http +from mitmproxy import websocket +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.commands import StartHook +from mitmproxy.proxy.context import Context +from mitmproxy.proxy.events import MessageInjected +from mitmproxy.proxy.utils import expect + + +@dataclass +class WebsocketStartHook(StartHook): + """ + A WebSocket connection has commenced. + """ + + flow: http.HTTPFlow + + +@dataclass +class WebsocketMessageHook(StartHook): + """ + Called when a WebSocket message is received from the client or + server. The most recent message will be flow.messages[-1]. The + message is user-modifiable. Currently there are two types of + messages, corresponding to the BINARY and TEXT frame types. + """ + + flow: http.HTTPFlow + + +@dataclass +class WebsocketEndHook(StartHook): + """ + A WebSocket connection has ended. + You can check `flow.websocket.close_code` to determine why it ended. + """ + + flow: http.HTTPFlow + + +class WebSocketMessageInjected(MessageInjected[websocket.WebSocketMessage]): + """ + The user has injected a custom WebSocket message. + """ + + +class WebsocketConnection(wsproto.Connection): + """ + A very thin wrapper around wsproto.Connection: + + - we keep the underlying connection as an attribute for easy access. + - we add a framebuffer for incomplete messages + - we wrap .send() so that we can directly yield it. + """ + + conn: connection.Connection + frame_buf: list[bytes] + + def __init__(self, *args, conn: connection.Connection, **kwargs): + super().__init__(*args, **kwargs) + self.conn = conn + self.frame_buf = [b""] + + def send2(self, event: wsproto.events.Event) -> commands.SendData: + data = self.send(event) + return commands.SendData(self.conn, data) + + def __repr__(self): + return f"WebsocketConnection<{self.state.name}, {self.conn}>" + + +class WebsocketLayer(layer.Layer): + """ + WebSocket layer that intercepts and relays messages. + """ + + flow: http.HTTPFlow + client_ws: WebsocketConnection + server_ws: WebsocketConnection + + def __init__(self, context: Context, flow: http.HTTPFlow): + super().__init__(context) + self.flow = flow + + @expect(events.Start) + def start(self, _) -> layer.CommandGenerator[None]: + client_extensions = [] + server_extensions = [] + + # Parse extension headers. We only support deflate at the moment and ignore everything else. + assert self.flow.response # satisfy type checker + ext_header = self.flow.response.headers.get("Sec-WebSocket-Extensions", "") + if ext_header: + for ext in wsproto.utilities.split_comma_header( + ext_header.encode("ascii", "replace") + ): + ext_name = ext.split(";", 1)[0].strip() + if ext_name == wsproto.extensions.PerMessageDeflate.name: + client_deflate = wsproto.extensions.PerMessageDeflate() + client_deflate.finalize(ext) + client_extensions.append(client_deflate) + server_deflate = wsproto.extensions.PerMessageDeflate() + server_deflate.finalize(ext) + server_extensions.append(server_deflate) + else: + yield commands.Log( + f"Ignoring unknown WebSocket extension {ext_name!r}." + ) + + self.client_ws = WebsocketConnection( + wsproto.ConnectionType.SERVER, client_extensions, conn=self.context.client + ) + self.server_ws = WebsocketConnection( + wsproto.ConnectionType.CLIENT, server_extensions, conn=self.context.server + ) + + yield WebsocketStartHook(self.flow) + + self._handle_event = self.relay_messages + + _handle_event = start + + @expect(events.DataReceived, events.ConnectionClosed, WebSocketMessageInjected) + def relay_messages(self, event: events.Event) -> layer.CommandGenerator[None]: + assert self.flow.websocket # satisfy type checker + + if isinstance(event, events.ConnectionEvent): + from_client = event.connection == self.context.client + injected = False + elif isinstance(event, WebSocketMessageInjected): + from_client = event.message.from_client + injected = True + else: + raise AssertionError(f"Unexpected event: {event}") + + from_str = "client" if from_client else "server" + if from_client: + src_ws = self.client_ws + dst_ws = self.server_ws + else: + src_ws = self.server_ws + dst_ws = self.client_ws + + if isinstance(event, events.DataReceived): + src_ws.receive_data(event.data) + elif isinstance(event, events.ConnectionClosed): + src_ws.receive_data(None) + elif isinstance(event, WebSocketMessageInjected): + fragmentizer = Fragmentizer([], event.message.type == Opcode.TEXT) + src_ws._events.extend(fragmentizer(event.message.content)) + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event}") + + for ws_event in src_ws.events(): + if isinstance(ws_event, wsproto.events.Message): + is_text = isinstance(ws_event.data, str) + if is_text: + typ = Opcode.TEXT + src_ws.frame_buf[-1] += ws_event.data.encode() + else: + typ = Opcode.BINARY + src_ws.frame_buf[-1] += ws_event.data + + if ws_event.message_finished: + content = b"".join(src_ws.frame_buf) + + fragmentizer = Fragmentizer(src_ws.frame_buf, is_text) + src_ws.frame_buf = [b""] + + message = websocket.WebSocketMessage( + typ, from_client, content, injected=injected + ) + self.flow.websocket.messages.append(message) + yield WebsocketMessageHook(self.flow) + + if not message.dropped: + for msg in fragmentizer(message.content): + yield dst_ws.send2(msg) + + elif ws_event.frame_finished: + src_ws.frame_buf.append(b"") + + elif isinstance(ws_event, (wsproto.events.Ping, wsproto.events.Pong)): + yield commands.Log( + f"Received WebSocket {ws_event.__class__.__name__.lower()} from {from_str} " + f"(payload: {bytes(ws_event.payload)!r})" + ) + yield dst_ws.send2(ws_event) + elif isinstance(ws_event, wsproto.events.CloseConnection): + self.flow.websocket.timestamp_end = time.time() + self.flow.websocket.closed_by_client = from_client + self.flow.websocket.close_code = ws_event.code + self.flow.websocket.close_reason = ws_event.reason + + for ws in [self.server_ws, self.client_ws]: + if ws.state in { + ConnectionState.OPEN, + ConnectionState.REMOTE_CLOSING, + }: + # response == original event, so no need to differentiate here. + yield ws.send2(ws_event) + yield commands.CloseConnection(ws.conn) + yield WebsocketEndHook(self.flow) + self.flow.live = False + self._handle_event = self.done + else: # pragma: no cover + raise AssertionError(f"Unexpected WebSocket event: {ws_event}") + + @expect(events.DataReceived, events.ConnectionClosed, WebSocketMessageInjected) + def done(self, _) -> layer.CommandGenerator[None]: + yield from () + + +class Fragmentizer: + """ + Theory (RFC 6455): + Unless specified otherwise by an extension, frames have no semantic + meaning. An intermediary might coalesce and/or split frames, [...] + + Practice: + Some WebSocket servers reject large payload sizes. + Other WebSocket servers reject CONTINUATION frames. + + As a workaround, we either retain the original chunking or, if the payload has been modified, use ~4kB chunks. + If one deals with web servers that do not support CONTINUATION frames, addons need to monkeypatch FRAGMENT_SIZE + if they need to modify the message. + """ + + # A bit less than 4kb to accommodate for headers. + FRAGMENT_SIZE = 4000 + + def __init__(self, fragments: list[bytes], is_text: bool): + self.fragment_lengths = [len(x) for x in fragments] + self.is_text = is_text + + def msg(self, data: bytes, message_finished: bool): + if self.is_text: + data_str = data.decode(errors="replace") + return wsproto.events.TextMessage( + data_str, message_finished=message_finished + ) + else: + return wsproto.events.BytesMessage(data, message_finished=message_finished) + + def __call__(self, content: bytes) -> Iterator[wsproto.events.Message]: + if len(content) == sum(self.fragment_lengths): + # message has the same length, we can reuse the same sizes + offset = 0 + for fl in self.fragment_lengths[:-1]: + yield self.msg(content[offset : offset + fl], False) + offset += fl + yield self.msg(content[offset:], True) + else: + offset = 0 + total = len(content) - self.FRAGMENT_SIZE + while offset < total: + yield self.msg(content[offset : offset + self.FRAGMENT_SIZE], False) + offset += self.FRAGMENT_SIZE + yield self.msg(content[offset:], True) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/mode_servers.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/mode_servers.py new file mode 100644 index 0000000000000000000000000000000000000000..389a9b04032736166e94f60b1ec6ea28cffb0a0b --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/mode_servers.py @@ -0,0 +1,546 @@ +""" +This module defines "server instances", which manage +the TCP/UDP servers spawned by mitmproxy as specified by the proxy mode. + +Example: + + mode = ProxyMode.parse("reverse:https://example.com") + inst = ServerInstance.make(mode, manager_that_handles_callbacks) + await inst.start() + # TCP server is running now. +""" + +from __future__ import annotations + +import asyncio +import errno +import json +import logging +import os +import socket +import sys +import textwrap +import typing +from abc import ABCMeta +from abc import abstractmethod +from contextlib import contextmanager +from pathlib import Path +from typing import cast +from typing import ClassVar +from typing import Generic +from typing import get_args +from typing import TYPE_CHECKING +from typing import TypeVar + +import mitmproxy_rs +from mitmproxy import ctx +from mitmproxy import flow +from mitmproxy import platform +from mitmproxy.connection import Address +from mitmproxy.net import local_ip +from mitmproxy.net.free_port import get_free_port +from mitmproxy.proxy import commands +from mitmproxy.proxy import layers +from mitmproxy.proxy import mode_specs +from mitmproxy.proxy import server +from mitmproxy.proxy.context import Context +from mitmproxy.proxy.layer import Layer +from mitmproxy.utils import human + +if sys.version_info < (3, 11): + from typing_extensions import Self # pragma: no cover +else: + from typing import Self + +if TYPE_CHECKING: + from mitmproxy.master import Master + +logger = logging.getLogger(__name__) + + +class ProxyConnectionHandler(server.LiveConnectionHandler): + master: Master + + def __init__(self, master, r, w, options, mode): + self.master = master + super().__init__(r, w, options, mode) + self.log_prefix = f"{human.format_address(self.client.peername)}: " + + async def handle_hook(self, hook: commands.StartHook) -> None: + with self.timeout_watchdog.disarm(): + # We currently only support single-argument hooks. + (data,) = hook.args() + await self.master.addons.handle_lifecycle(hook) + if isinstance(data, flow.Flow): + await data.wait_for_resume() # pragma: no cover + + +M = TypeVar("M", bound=mode_specs.ProxyMode) + + +class ServerManager(typing.Protocol): + # temporary workaround: for UDP, we use the 4-tuple because we don't have a uuid. + connections: dict[tuple | str, ProxyConnectionHandler] + + @contextmanager + def register_connection( + self, connection_id: tuple | str, handler: ProxyConnectionHandler + ): ... # pragma: no cover + + +class ServerInstance(Generic[M], metaclass=ABCMeta): + __modes: ClassVar[dict[str, type[ServerInstance]]] = {} + + last_exception: Exception | None = None + + def __init__(self, mode: M, manager: ServerManager): + self.mode: M = mode + self.manager: ServerManager = manager + + def __init_subclass__(cls, **kwargs): + """Register all subclasses so that make() finds them.""" + # extract mode from Generic[Mode]. + mode = get_args(cls.__orig_bases__[0])[0] # type: ignore + if not isinstance(mode, TypeVar): + assert issubclass(mode, mode_specs.ProxyMode) + assert mode.type_name not in ServerInstance.__modes + ServerInstance.__modes[mode.type_name] = cls + + @classmethod + def make( + cls, + mode: mode_specs.ProxyMode | str, + manager: ServerManager, + ) -> Self: + if isinstance(mode, str): + mode = mode_specs.ProxyMode.parse(mode) + inst = ServerInstance.__modes[mode.type_name](mode, manager) + + if not isinstance(inst, cls): + raise ValueError(f"{mode!r} is not a spec for a {cls.__name__} server.") + + return inst + + @property + @abstractmethod + def is_running(self) -> bool: + pass + + async def start(self) -> None: + try: + await self._start() + except Exception as e: + self.last_exception = e + raise + else: + self.last_exception = None + if self.listen_addrs: + addrs = " and ".join({human.format_address(a) for a in self.listen_addrs}) + logger.info(f"{self.mode.description} listening at {addrs}.") + else: + logger.info(f"{self.mode.description} started.") + + async def stop(self) -> None: + listen_addrs = self.listen_addrs + try: + await self._stop() + except Exception as e: + self.last_exception = e + raise + else: + self.last_exception = None + if listen_addrs: + addrs = " and ".join({human.format_address(a) for a in listen_addrs}) + logger.info(f"{self.mode.description} at {addrs} stopped.") + else: + logger.info(f"{self.mode.description} stopped.") + + @abstractmethod + async def _start(self) -> None: + pass + + @abstractmethod + async def _stop(self) -> None: + pass + + @property + @abstractmethod + def listen_addrs(self) -> tuple[Address, ...]: + pass + + @abstractmethod + def make_top_layer(self, context: Context) -> Layer: + pass + + def to_json(self) -> dict: + return { + "type": self.mode.type_name, + "description": self.mode.description, + "full_spec": self.mode.full_spec, + "is_running": self.is_running, + "last_exception": str(self.last_exception) if self.last_exception else None, + "listen_addrs": self.listen_addrs, + } + + async def handle_stream( + self, + reader: asyncio.StreamReader | mitmproxy_rs.Stream, + writer: asyncio.StreamWriter | mitmproxy_rs.Stream | None = None, + ) -> None: + if writer is None: + assert isinstance(reader, mitmproxy_rs.Stream) + writer = reader + handler = ProxyConnectionHandler( + ctx.master, reader, writer, ctx.options, self.mode + ) + handler.layer = self.make_top_layer(handler.layer.context) + if isinstance(self.mode, mode_specs.TransparentMode): + assert isinstance(writer, asyncio.StreamWriter) + s = cast(socket.socket, writer.get_extra_info("socket")) + try: + assert platform.original_addr + original_dst = platform.original_addr(s) + except Exception as e: + logger.error(f"Transparent mode failure: {e!r}") + writer.close() + return + else: + handler.layer.context.client.sockname = original_dst + handler.layer.context.server.address = original_dst + elif isinstance( + self.mode, + (mode_specs.WireGuardMode, mode_specs.LocalMode, mode_specs.TunMode), + ): # pragma: no cover on platforms without wg-test-client + handler.layer.context.server.address = writer.get_extra_info( + "remote_endpoint", handler.layer.context.client.sockname + ) + + with self.manager.register_connection(handler.layer.context.client.id, handler): + await handler.handle_client() + + +class AsyncioServerInstance(ServerInstance[M], metaclass=ABCMeta): + _servers: list[ + asyncio.Server + | mitmproxy_rs.udp.UdpServer + | mitmproxy_rs.wireguard.WireGuardServer + ] + + def __init__(self, *args, **kwargs) -> None: + self._servers = [] + super().__init__(*args, **kwargs) + + @property + def is_running(self) -> bool: + return bool(self._servers) + + @property + def listen_addrs(self) -> tuple[Address, ...]: + addrs = [] + for s in self._servers: + if isinstance( + s, (mitmproxy_rs.udp.UdpServer, mitmproxy_rs.wireguard.WireGuardServer) + ): + addrs.append(s.getsockname()) + else: + try: + addrs.extend(sock.getsockname() for sock in s.sockets) + except OSError: # pragma: no cover + pass # this can fail during shutdown, see https://github.com/mitmproxy/mitmproxy/issues/6529 + return tuple(addrs) + + async def _start(self) -> None: + assert not self._servers + host = self.mode.listen_host(ctx.options.listen_host) + port = self.mode.listen_port(ctx.options.listen_port) + assert port is not None + try: + self._servers = await self.listen(host, port) + except OSError as e: + message = f"{self.mode.description} failed to listen on {host or '*'}:{port} with {e}" + if e.errno == errno.EADDRINUSE and self.mode.custom_listen_port is None: + assert ( + self.mode.custom_listen_host is None + ) # since [@ [listen_addr:]listen_port] + message += f"\nTry specifying a different port by using `--mode {self.mode.full_spec}@{port + 2}`." + raise OSError(e.errno, message, e.filename) from e + + async def _stop(self) -> None: + assert self._servers + try: + for s in self._servers: + s.close() + # https://github.com/python/cpython/issues/104344 + # await asyncio.gather(*[s.wait_closed() for s in self._servers]) + finally: + # we always reset _server and ignore failures + self._servers = [] + + async def listen( + self, host: str, port: int + ) -> list[ + asyncio.Server + | mitmproxy_rs.udp.UdpServer + | mitmproxy_rs.wireguard.WireGuardServer + ]: + if self.mode.transport_protocol not in ("tcp", "udp", "both"): + raise AssertionError(self.mode.transport_protocol) + + # workaround for https://github.com/python/cpython/issues/89856: + # We want both IPv4 and IPv6 sockets to bind to the same port. + # This may fail (https://github.com/mitmproxy/mitmproxy/pull/5542#issuecomment-1222803291), + # so we try to cover the 99% case and then give up and fall back to what asyncio does. + if port == 0: + try: + return await self.listen(host, get_free_port()) + except Exception as e: + logger.debug( + f"Failed to listen on a single port ({e!r}), falling back to default behavior." + ) + + servers: list[ + asyncio.Server + | mitmproxy_rs.udp.UdpServer + | mitmproxy_rs.wireguard.WireGuardServer + ] = [] + if self.mode.transport_protocol in ("tcp", "both"): + servers.append(await asyncio.start_server(self.handle_stream, host, port)) + if self.mode.transport_protocol in ("udp", "both"): + # we start two servers for dual-stack support. + # On Linux, this would also be achievable by toggling IPV6_V6ONLY off, but this here works cross-platform. + if host == "": + ipv4 = await self.start_udp_based_server("0.0.0.0", port) + servers.append(ipv4) + try: + ipv6 = await self.start_udp_based_server( + "::", ipv4.getsockname()[1] + ) + servers.append(ipv6) # pragma: no cover + except Exception: # pragma: no cover + logger.debug("Failed to listen on '::', listening on IPv4 only.") + else: + servers.append(await self.start_udp_based_server(host, port)) + + return servers + + async def start_udp_based_server( + self, host, port + ) -> mitmproxy_rs.udp.UdpServer | mitmproxy_rs.wireguard.WireGuardServer: + return await mitmproxy_rs.udp.start_udp_server( + host, + port, + self.handle_stream, + ) + + +class WireGuardServerInstance(AsyncioServerInstance[mode_specs.WireGuardMode]): + server_key: str + client_key: str + pubkey: str + + def make_top_layer( + self, context: Context + ) -> Layer: # pragma: no cover on platforms without wg-test-client + return layers.modes.TransparentProxy(context) + + async def _start(self) -> None: + if self.mode.data: + conf_path = Path(self.mode.data).expanduser() + else: + conf_path = Path(ctx.options.confdir).expanduser() / "wireguard.conf" + + if not conf_path.exists(): + conf_path.parent.mkdir(parents=True, exist_ok=True) + conf_path.write_text( + json.dumps( + { + "server_key": mitmproxy_rs.wireguard.genkey(), + "client_key": mitmproxy_rs.wireguard.genkey(), + }, + indent=4, + ) + ) + + try: + c = json.loads(conf_path.read_text()) + self.server_key = c["server_key"] + self.client_key = c["client_key"] + except Exception as e: + raise ValueError(f"Invalid configuration file ({conf_path}): {e}") from e + + # error early on invalid keys + self.pubkey = mitmproxy_rs.wireguard.pubkey(self.client_key) + _ = mitmproxy_rs.wireguard.pubkey(self.server_key) + + await super()._start() + + conf = self.client_conf() + assert conf + logger.info("-" * 60 + "\n" + conf + "\n" + "-" * 60) + + async def start_udp_based_server( + self, host, port + ) -> mitmproxy_rs.wireguard.WireGuardServer: + return await mitmproxy_rs.wireguard.start_wireguard_server( + host, + port, + self.server_key, + [self.pubkey], + self.handle_stream, + self.handle_stream, + ) + + def client_conf(self) -> str | None: + if not self._servers: + return None + host = ( + self.mode.listen_host(ctx.options.listen_host) + or local_ip.get_local_ip() + or local_ip.get_local_ip6() + ) + port = self.mode.listen_port(ctx.options.listen_port) + return textwrap.dedent( + f""" + [Interface] + PrivateKey = {self.client_key} + Address = 10.0.0.1/32 + DNS = 10.0.0.53 + + [Peer] + PublicKey = {mitmproxy_rs.wireguard.pubkey(self.server_key)} + AllowedIPs = 0.0.0.0/0 + Endpoint = {host}:{port} + """ + ).strip() + + def to_json(self) -> dict: + return {"wireguard_conf": self.client_conf(), **super().to_json()} + + +class LocalRedirectorInstance(ServerInstance[mode_specs.LocalMode]): + _server: ClassVar[mitmproxy_rs.local.LocalRedirector | None] = None + """The local redirector daemon. Will be started once and then reused for all future instances.""" + _instance: ClassVar[LocalRedirectorInstance | None] = None + """The current LocalRedirectorInstance. Will be unset again if an instance is stopped.""" + listen_addrs = () + + @property + def is_running(self) -> bool: + return self._instance is not None + + def make_top_layer(self, context: Context) -> Layer: + return layers.modes.TransparentProxy(context) + + @classmethod + async def redirector_handle_stream( + cls, + stream: mitmproxy_rs.Stream, + ) -> None: + if cls._instance is not None: + await cls._instance.handle_stream(stream) + + async def _start(self) -> None: + if self._instance: + raise RuntimeError("Cannot spawn more than one local redirector.") + + if self.mode.data: + spec = f"{self.mode.data},!{os.getpid()}" + else: + spec = f"!{os.getpid()}" + + cls = self.__class__ + cls._instance = self # assign before awaiting to avoid races + if cls._server is None: + try: + cls._server = await mitmproxy_rs.local.start_local_redirector( + cls.redirector_handle_stream, + cls.redirector_handle_stream, + ) + except Exception: + cls._instance = None + raise + + cls._server.set_intercept(spec) + + async def _stop(self) -> None: + assert self._instance + assert self._server + self.__class__._instance = None + # We're not shutting down the server because we want to avoid additional UAC prompts. + self._server.set_intercept("") + + +class RegularInstance(AsyncioServerInstance[mode_specs.RegularMode]): + def make_top_layer(self, context: Context) -> Layer: + return layers.modes.HttpProxy(context) + + +class UpstreamInstance(AsyncioServerInstance[mode_specs.UpstreamMode]): + def make_top_layer(self, context: Context) -> Layer: + return layers.modes.HttpUpstreamProxy(context) + + +class TransparentInstance(AsyncioServerInstance[mode_specs.TransparentMode]): + def make_top_layer(self, context: Context) -> Layer: + return layers.modes.TransparentProxy(context) + + +class ReverseInstance(AsyncioServerInstance[mode_specs.ReverseMode]): + def make_top_layer(self, context: Context) -> Layer: + return layers.modes.ReverseProxy(context) + + +class Socks5Instance(AsyncioServerInstance[mode_specs.Socks5Mode]): + def make_top_layer(self, context: Context) -> Layer: + return layers.modes.Socks5Proxy(context) + + +class DnsInstance(AsyncioServerInstance[mode_specs.DnsMode]): + def make_top_layer(self, context: Context) -> Layer: + return layers.DNSLayer(context) + + +class TunInstance(ServerInstance[mode_specs.TunMode]): + _server: mitmproxy_rs.tun.TunInterface | None = None + listen_addrs = () + + def make_top_layer( + self, context: Context + ) -> Layer: # pragma: no cover mocked in tests + return layers.modes.TransparentProxy(context) + + @property + def is_running(self) -> bool: + return self._server is not None + + @property + def tun_name(self) -> str | None: + if self._server: + return self._server.tun_name() + else: + return None + + def to_json(self) -> dict: + return {"tun_name": self.tun_name, **super().to_json()} + + async def _start(self) -> None: + assert self._server is None + self._server = await mitmproxy_rs.tun.create_tun_interface( + self.handle_stream, + self.handle_stream, + tun_name=self.mode.data or None, + ) + logger.info(f"TUN interface created: {self._server.tun_name()}") + + async def _stop(self) -> None: + assert self._server is not None + try: + self._server.close() + await self._server.wait_closed() + finally: + self._server = None + + +# class Http3Instance(AsyncioServerInstance[mode_specs.Http3Mode]): +# def make_top_layer(self, context: Context) -> Layer: +# return layers.modes.HttpProxy(context) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/mode_specs.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/mode_specs.py new file mode 100644 index 0000000000000000000000000000000000000000..c1fa60fedab0adb8df208972ade42321192eced2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/mode_specs.py @@ -0,0 +1,336 @@ +""" +This module is responsible for parsing proxy mode specifications such as +`"regular"`, `"reverse:https://example.com"`, or `"socks5@1234"`. The general syntax is + + mode [: mode_configuration] [@ [listen_addr:]listen_port] + +For a full example, consider `reverse:https://example.com@127.0.0.1:443`. +This would spawn a reverse proxy on port 443 bound to localhost. +The mode is `reverse`, and the mode data is `https://example.com`. +Examples: + + mode = ProxyMode.parse("regular@1234") + assert mode.listen_port == 1234 + assert isinstance(mode, RegularMode) + + ProxyMode.parse("reverse:example.com@invalid-port") # ValueError + + RegularMode.parse("regular") # ok + RegularMode.parse("socks5") # ValueError + +""" + +from __future__ import annotations + +import dataclasses +import platform +import re +import sys +from abc import ABCMeta +from abc import abstractmethod +from dataclasses import dataclass +from functools import cache +from typing import ClassVar +from typing import Literal + +import mitmproxy_rs +from mitmproxy.coretypes.serializable import Serializable +from mitmproxy.net import server_spec + +if sys.version_info < (3, 11): + from typing_extensions import Self # pragma: no cover +else: + from typing import Self + + +@dataclass(frozen=True) # type: ignore +class ProxyMode(Serializable, metaclass=ABCMeta): + """ + Parsed representation of a proxy mode spec. Subclassed for each specific mode, + which then does its own data validation. + """ + + full_spec: str + """The full proxy mode spec as entered by the user.""" + data: str + """The (raw) mode data, i.e. the part after the mode name.""" + custom_listen_host: str | None + """A custom listen host, if specified in the spec.""" + custom_listen_port: int | None + """A custom listen port, if specified in the spec.""" + + type_name: ClassVar[ + str + ] # automatically derived from the class name in __init_subclass__ + """The unique name for this proxy mode, e.g. "regular" or "reverse".""" + __types: ClassVar[dict[str, type[ProxyMode]]] = {} + + def __init_subclass__(cls, **kwargs): + cls.type_name = cls.__name__.removesuffix("Mode").lower() + assert cls.type_name not in ProxyMode.__types + ProxyMode.__types[cls.type_name] = cls + + def __repr__(self): + return f"ProxyMode.parse({self.full_spec!r})" + + @abstractmethod + def __post_init__(self) -> None: + """Validation of data happens here.""" + + @property + @abstractmethod + def description(self) -> str: + """The mode description that will be used in server logs and UI.""" + + @property + def default_port(self) -> int | None: + """ + Default listen port of servers for this mode, see `ProxyMode.listen_port()`. + """ + return 8080 + + @property + @abstractmethod + def transport_protocol(self) -> Literal["tcp", "udp", "both"]: + """The transport protocol used by this mode's server.""" + + @classmethod + @cache + def parse(cls, spec: str) -> Self: + """ + Parse a proxy mode specification and return the corresponding `ProxyMode` instance. + """ + head, _, listen_at = spec.rpartition("@") + if not head: + head = listen_at + listen_at = "" + + mode, _, data = head.partition(":") + + if listen_at: + if ":" in listen_at: + host, _, port_str = listen_at.rpartition(":") + else: + host = None + port_str = listen_at + try: + port = int(port_str) + if port < 0 or 65535 < port: + raise ValueError + except ValueError: + raise ValueError(f"invalid port: {port_str}") + else: + host = None + port = None + + try: + mode_cls = ProxyMode.__types[mode.lower()] + except KeyError: + raise ValueError(f"unknown mode") + + if not issubclass(mode_cls, cls): + raise ValueError(f"{mode!r} is not a spec for a {cls.type_name} mode") + + return mode_cls( + full_spec=spec, data=data, custom_listen_host=host, custom_listen_port=port + ) + + def listen_host(self, default: str | None = None) -> str: + """ + Return the address a server for this mode should listen on. This can be either directly + specified in the spec or taken from a user-configured global default (`options.listen_host`). + By default, return an empty string to listen on all hosts. + """ + if self.custom_listen_host is not None: + return self.custom_listen_host + elif default is not None: + return default + else: + return "" + + def listen_port(self, default: int | None = None) -> int | None: + """ + Return the port a server for this mode should listen on. This can be either directly + specified in the spec, taken from a user-configured global default (`options.listen_port`), + or from `ProxyMode.default_port`. + May be `None` for modes that don't bind to a specific address, e.g. local redirect mode. + """ + if self.custom_listen_port is not None: + return self.custom_listen_port + elif default is not None: + return default + else: + return self.default_port + + @classmethod + def from_state(cls, state): + return ProxyMode.parse(state) + + def get_state(self): + return self.full_spec + + def set_state(self, state): + if state != self.full_spec: + raise dataclasses.FrozenInstanceError("Proxy modes are immutable.") + + +TCP: Literal["tcp", "udp", "both"] = "tcp" +UDP: Literal["tcp", "udp", "both"] = "udp" +BOTH: Literal["tcp", "udp", "both"] = "both" + + +def _check_empty(data): + if data: + raise ValueError("mode takes no arguments") + + +class RegularMode(ProxyMode): + """A regular HTTP(S) proxy that is interfaced with `HTTP CONNECT` calls (or absolute-form HTTP requests).""" + + description = "HTTP(S) proxy" + transport_protocol = TCP + + def __post_init__(self) -> None: + _check_empty(self.data) + + +class TransparentMode(ProxyMode): + """A transparent proxy, see https://docs.mitmproxy.org/dev/howto-transparent/""" + + description = "Transparent Proxy" + transport_protocol = TCP + + def __post_init__(self) -> None: + _check_empty(self.data) + + +class UpstreamMode(ProxyMode): + """A regular HTTP(S) proxy, but all connections are forwarded to a second upstream HTTP(S) proxy.""" + + description = "HTTP(S) proxy (upstream mode)" + transport_protocol = TCP + scheme: Literal["http", "https"] + address: tuple[str, int] + + # noinspection PyDataclass + def __post_init__(self) -> None: + scheme, self.address = server_spec.parse(self.data, default_scheme="http") + if scheme != "http" and scheme != "https": + raise ValueError("invalid upstream proxy scheme") + self.scheme = scheme + + +class ReverseMode(ProxyMode): + """A reverse proxy. This acts like a normal server, but redirects all requests to a fixed target.""" + + description = "reverse proxy" + transport_protocol = TCP + scheme: Literal[ + "http", "https", "http3", "tls", "dtls", "tcp", "udp", "dns", "quic" + ] + address: tuple[str, int] + + # noinspection PyDataclass + def __post_init__(self) -> None: + self.scheme, self.address = server_spec.parse(self.data, default_scheme="https") + if self.scheme in ("http3", "dtls", "udp", "quic"): + self.transport_protocol = UDP + elif self.scheme in ("dns", "https"): + self.transport_protocol = BOTH + self.description = f"{self.description} to {self.data}" + + @property + def default_port(self) -> int | None: + if self.scheme == "dns": + return 53 + return super().default_port + + +class Socks5Mode(ProxyMode): + """A SOCKSv5 proxy.""" + + description = "SOCKS v5 proxy" + default_port = 1080 + transport_protocol = TCP + + def __post_init__(self) -> None: + _check_empty(self.data) + + +class DnsMode(ProxyMode): + """A DNS server.""" + + description = "DNS server" + default_port = 53 + transport_protocol = BOTH + + def __post_init__(self) -> None: + _check_empty(self.data) + + +# class Http3Mode(ProxyMode): +# """ +# A regular HTTP3 proxy that is interfaced with absolute-form HTTP requests. +# (This class will be merged into `RegularMode` once the UDP implementation is deemed stable enough.) +# """ +# +# description = "HTTP3 proxy" +# transport_protocol = UDP +# +# def __post_init__(self) -> None: +# _check_empty(self.data) + + +class WireGuardMode(ProxyMode): + """Proxy Server based on WireGuard""" + + description = "WireGuard server" + default_port = 51820 + transport_protocol = UDP + + def __post_init__(self) -> None: + pass + + +class LocalMode(ProxyMode): + """OS-level transparent proxy.""" + + description = "Local redirector" + transport_protocol = BOTH + default_port = None + + def __post_init__(self) -> None: + # should not raise + mitmproxy_rs.local.LocalRedirector.describe_spec(self.data) + + +class TunMode(ProxyMode): + """A Tun interface.""" + + description = "TUN interface" + default_port = None + transport_protocol = BOTH + + def __post_init__(self) -> None: + invalid_tun_name = self.data and ( + # The Rust side is Linux only for the moment, but eventually we may need this. + platform.system() == "Darwin" and not re.match(r"^utun\d+$", self.data) + ) + if invalid_tun_name: # pragma: no cover + raise ValueError( + f"Invalid tun name: {self.data}. " + f"On macOS, the tun name must be the form utunx where x is a number, such as utun3." + ) + + +class OsProxyMode(ProxyMode): # pragma: no cover + """Deprecated alias for LocalMode""" + + description = "Deprecated alias for LocalMode" + transport_protocol = BOTH + default_port = None + + def __post_init__(self) -> None: + raise ValueError( + "osproxy mode has been renamed to local mode. Thanks for trying our experimental features!" + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/server.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/server.py new file mode 100644 index 0000000000000000000000000000000000000000..88ba700a37da224550ae89c775e992ce7958e88a --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/server.py @@ -0,0 +1,610 @@ +""" +Proxy Server Implementation using asyncio. +The very high level overview is as follows: + + - Spawn one coroutine per client connection and create a reverse proxy layer to example.com + - Process any commands from layer (such as opening a server connection) + - Wait for any IO and send it as events to top layer. +""" + +import abc +import asyncio +import collections +import logging +import time +from collections.abc import Awaitable +from collections.abc import Callable +from collections.abc import MutableMapping +from contextlib import contextmanager +from dataclasses import dataclass +from types import TracebackType +from typing import Literal + +from OpenSSL import SSL + +import mitmproxy_rs +from mitmproxy import http +from mitmproxy import options as moptions +from mitmproxy import tls +from mitmproxy.connection import Address +from mitmproxy.connection import Client +from mitmproxy.connection import Connection +from mitmproxy.connection import ConnectionState +from mitmproxy.proxy import commands +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy import layers +from mitmproxy.proxy import mode_specs +from mitmproxy.proxy import server_hooks +from mitmproxy.proxy.context import Context +from mitmproxy.proxy.layers.http import HTTPMode +from mitmproxy.utils import asyncio_utils +from mitmproxy.utils import human +from mitmproxy.utils.data import pkg_data + +logger = logging.getLogger(__name__) + +UDP_TIMEOUT = 20 + + +class TimeoutWatchdog: + last_activity: float + timeout: int + can_timeout: asyncio.Event + blocker: int + + def __init__(self, timeout: int, callback: Callable[[], Awaitable]): + self.timeout = timeout + self.callback = callback + self.last_activity = time.time() + self.can_timeout = asyncio.Event() + self.can_timeout.set() + self.blocker = 0 + + def register_activity(self): + self.last_activity = time.time() + + async def watch(self): + try: + while True: + await self.can_timeout.wait() + await asyncio.sleep(self.timeout - (time.time() - self.last_activity)) + if self.last_activity + self.timeout < time.time(): + await self.callback() + return + except asyncio.CancelledError: + return + + @contextmanager + def disarm(self): + self.can_timeout.clear() + self.blocker += 1 + try: + yield + finally: + self.blocker -= 1 + if self.blocker == 0: + self.register_activity() + self.can_timeout.set() + + +@dataclass +class ConnectionIO: + handler: asyncio.Task | None = None + reader: asyncio.StreamReader | mitmproxy_rs.Stream | None = None + writer: asyncio.StreamWriter | mitmproxy_rs.Stream | None = None + + +class ConnectionHandler(metaclass=abc.ABCMeta): + transports: MutableMapping[Connection, ConnectionIO] + timeout_watchdog: TimeoutWatchdog + client: Client + max_conns: collections.defaultdict[Address, asyncio.Semaphore] + layer: "layer.Layer" + wakeup_timer: set[asyncio.Task] + + def __init__(self, context: Context) -> None: + self.client = context.client + self.transports = {} + self.max_conns = collections.defaultdict(lambda: asyncio.Semaphore(5)) + self.wakeup_timer = set() + + # Ask for the first layer right away. + # In a reverse proxy scenario, this is necessary as we would otherwise hang + # on protocols that start with a server greeting. + self.layer = layer.NextLayer(context, ask_on_start=True) + if self.client.transport_protocol == "tcp": + timeout = context.options.tcp_timeout + else: + timeout = UDP_TIMEOUT + self.timeout_watchdog = TimeoutWatchdog(timeout, self.on_timeout) + + self._server_event_lock = asyncio.Lock() + + # workaround for https://bugs.python.org/issue40124 / https://bugs.python.org/issue29930 + self._drain_lock = asyncio.Lock() + + async def handle_client(self) -> None: + asyncio_utils.set_current_task_debug_info( + name=f"client handler", + client=self.client.peername, + ) + watch = asyncio_utils.create_task( + self.timeout_watchdog.watch(), + name="timeout watchdog", + keep_ref=False, + client=self.client.peername, + ) + + self.log("client connect") + await self.handle_hook(server_hooks.ClientConnectedHook(self.client)) + if self.client.error: + self.log("client kill connection") + writer = self.transports.pop(self.client).writer + assert writer + writer.close() + else: + await self.server_event(events.Start()) + handler = asyncio_utils.create_task( + self.handle_connection(self.client), + name=f"client connection handler", + keep_ref=False, + client=self.client.peername, + ) + self.transports[self.client].handler = handler + await asyncio.wait([handler]) + if not handler.cancelled() and (e := handler.exception()): + self.log( + f"connection handler has crashed: {e}", + logging.ERROR, + exc_info=(type(e), e, e.__traceback__), + ) + + watch.cancel() + while self.wakeup_timer: + timer = self.wakeup_timer.pop() + timer.cancel() + + self.log("client disconnect") + self.client.timestamp_end = time.time() + await self.handle_hook(server_hooks.ClientDisconnectedHook(self.client)) + + if self.transports: + self.log("closing transports...", logging.DEBUG) + for io in self.transports.values(): + if io.handler: + io.handler.cancel("client disconnected") + await asyncio.wait( + [x.handler for x in self.transports.values() if x.handler] + ) + self.log("transports closed!", logging.DEBUG) + + async def open_connection(self, command: commands.OpenConnection) -> None: + if not command.connection.address: + self.log(f"Cannot open connection, no hostname given.") + await self.server_event( + events.OpenConnectionCompleted( + command, f"Cannot open connection, no hostname given." + ) + ) + return + + hook_data = server_hooks.ServerConnectionHookData( + client=self.client, server=command.connection + ) + await self.handle_hook(server_hooks.ServerConnectHook(hook_data)) + if err := command.connection.error: + self.log( + f"server connection to {human.format_address(command.connection.address)} killed before connect: {err}" + ) + await self.handle_hook(server_hooks.ServerConnectErrorHook(hook_data)) + await self.server_event( + events.OpenConnectionCompleted(command, f"Connection killed: {err}") + ) + return + + async with self.max_conns[command.connection.address]: + reader: asyncio.StreamReader | mitmproxy_rs.Stream + writer: asyncio.StreamWriter | mitmproxy_rs.Stream + try: + command.connection.timestamp_start = time.time() + if command.connection.transport_protocol == "tcp": + reader, writer = await asyncio.open_connection( + *command.connection.address, + local_addr=command.connection.sockname, + ) + elif command.connection.transport_protocol == "udp": + reader = writer = await mitmproxy_rs.udp.open_udp_connection( + *command.connection.address, + local_addr=command.connection.sockname, + ) + else: + raise AssertionError(command.connection.transport_protocol) + except (OSError, asyncio.CancelledError) as e: + err = str(e) + if not err: # str(CancelledError()) returns empty string. + err = "connection cancelled" + self.log(f"error establishing server connection: {err}") + command.connection.error = err + await self.handle_hook(server_hooks.ServerConnectErrorHook(hook_data)) + await self.server_event(events.OpenConnectionCompleted(command, err)) + if isinstance(e, asyncio.CancelledError): + # From https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.CancelledError: + # > In almost all situations the exception must be re-raised. + # It is not really defined what almost means here, but we play safe. + raise + else: + if command.connection.transport_protocol == "tcp": + # TODO: Rename to `timestamp_setup` and make it agnostic for both TCP (SYN/ACK) and UDP (DNS resl.) + command.connection.timestamp_tcp_setup = time.time() + command.connection.state = ConnectionState.OPEN + command.connection.peername = writer.get_extra_info("peername") + command.connection.sockname = writer.get_extra_info("sockname") + self.transports[command.connection] = ConnectionIO( + handler=asyncio.current_task(), + reader=reader, + writer=writer, + ) + + assert command.connection.peername + if command.connection.address[0] != command.connection.peername[0]: + addr = f"{human.format_address(command.connection.address)} ({human.format_address(command.connection.peername)})" + else: + addr = human.format_address(command.connection.address) + self.log(f"server connect {addr}") + await self.handle_hook(server_hooks.ServerConnectedHook(hook_data)) + await self.server_event(events.OpenConnectionCompleted(command, None)) + + try: + await self.handle_connection(command.connection) + finally: + self.log(f"server disconnect {addr}") + command.connection.timestamp_end = time.time() + await self.handle_hook( + server_hooks.ServerDisconnectedHook(hook_data) + ) + + async def wakeup(self, request: commands.RequestWakeup) -> None: + await asyncio.sleep(request.delay) + task = asyncio.current_task() + assert task is not None + self.wakeup_timer.discard(task) + await self.server_event(events.Wakeup(request)) + + async def handle_connection(self, connection: Connection) -> None: + """ + Handle a connection for its entire lifetime. + This means we read until EOF, + but then possibly also keep on waiting for our side of the connection to be closed. + """ + cancelled = None + reader = self.transports[connection].reader + assert reader + while True: + try: + data = await reader.read(65535) + if not data: + raise OSError("Connection closed by peer.") + except OSError: + break + except asyncio.CancelledError as e: + cancelled = e + break + + await self.server_event(events.DataReceived(connection, data)) + + try: + await self.drain_writers() + except asyncio.CancelledError as e: + cancelled = e + break + + if cancelled is None and connection.transport_protocol == "tcp": + # TCP connections can be half-closed. + connection.state &= ~ConnectionState.CAN_READ + else: + connection.state = ConnectionState.CLOSED + + await self.server_event(events.ConnectionClosed(connection)) + + if connection.state is ConnectionState.CAN_WRITE: + # we may still use this connection to *send* stuff, + # even though the remote has closed their side of the connection. + # to make this work we keep this task running and wait for cancellation. + try: + await asyncio.Event().wait() + except asyncio.CancelledError as e: + cancelled = e + + try: + writer = self.transports[connection].writer + assert writer + writer.close() + except OSError: + pass + self.transports.pop(connection) + + if cancelled: + raise cancelled + + async def drain_writers(self): + """ + Drain all writers to create some backpressure. We won't continue reading until there's space available in our + write buffers, so if we cannot write fast enough our own read buffers run full and the TCP recv stream is throttled. + """ + async with self._drain_lock: + for transport in list(self.transports.values()): + if transport.writer is not None: + try: + await transport.writer.drain() + except OSError as e: + if transport.handler is not None: + transport.handler.cancel(f"Error sending data: {e}") + + async def on_timeout(self) -> None: + try: + handler = self.transports[self.client].handler + except KeyError: # pragma: no cover + # there is a super short window between connection close and watchdog cancellation + pass + else: + if self.client.transport_protocol == "tcp": + self.log(f"Closing connection due to inactivity: {self.client}") + assert handler + handler.cancel("timeout") + + async def hook_task(self, hook: commands.StartHook) -> None: + await self.handle_hook(hook) + if hook.blocking: + await self.server_event(events.HookCompleted(hook)) + + @abc.abstractmethod + async def handle_hook(self, hook: commands.StartHook) -> None: + pass + + def log( + self, + message: str, + level: int = logging.INFO, + exc_info: Literal[True] + | tuple[type[BaseException], BaseException, TracebackType | None] + | None = None, + ) -> None: + logger.log( + level, message, extra={"client": self.client.peername}, exc_info=exc_info + ) + + async def server_event(self, event: events.Event) -> None: + # server_event is supposed to be completely sync without any `await` that could pause execution. + # However, create_task with an [eager task factory] will schedule tasks immediately, + # which causes [reentrancy issues]. So we put the entire thing behind a lock. + # + # [eager task factory]: https://docs.python.org/3/library/asyncio-task.html#eager-task-factory + # [reentrancy issues]: https://github.com/mitmproxy/mitmproxy/issues/7027. + async with self._server_event_lock: + # No `await` beyond this point. + + self.timeout_watchdog.register_activity() + try: + layer_commands = self.layer.handle_event(event) + for command in layer_commands: + if isinstance(command, commands.OpenConnection): + assert command.connection not in self.transports + handler = asyncio_utils.create_task( + self.open_connection(command), + name=f"server connection handler {command.connection.address}", + keep_ref=False, + client=self.client.peername, + ) + self.transports[command.connection] = ConnectionIO( + handler=handler + ) + elif isinstance(command, commands.RequestWakeup): + task = asyncio_utils.create_task( + self.wakeup(command), + name=f"wakeup timer ({command.delay:.1f}s)", + keep_ref=False, + client=self.client.peername, + ) + assert task is not None + self.wakeup_timer.add(task) + elif ( + isinstance(command, commands.ConnectionCommand) + and command.connection not in self.transports + ): + pass # The connection has already been closed. + elif isinstance(command, commands.SendData): + writer = self.transports[command.connection].writer + assert writer + if not writer.is_closing(): + writer.write(command.data) + elif isinstance(command, commands.CloseTcpConnection): + self.close_connection(command.connection, command.half_close) + elif isinstance(command, commands.CloseConnection): + self.close_connection(command.connection, False) + elif isinstance(command, commands.StartHook): + asyncio_utils.create_task( + self.hook_task(command), + name=f"handle_hook({command.name})", + keep_ref=True, + client=self.client.peername, + ) + elif isinstance(command, commands.Log): + self.log(command.message, command.level) + else: + raise RuntimeError(f"Unexpected command: {command}") + except Exception: + self.log(f"mitmproxy has crashed!", logging.ERROR, exc_info=True) + + def close_connection( + self, connection: Connection, half_close: bool = False + ) -> None: + if half_close: + if not connection.state & ConnectionState.CAN_WRITE: + return + self.log(f"half-closing {connection}", logging.DEBUG) + try: + writer = self.transports[connection].writer + assert writer + if not writer.is_closing(): + writer.write_eof() + except OSError: + # if we can't write to the socket anymore we presume it completely dead. + connection.state = ConnectionState.CLOSED + else: + connection.state &= ~ConnectionState.CAN_WRITE + else: + connection.state = ConnectionState.CLOSED + + if connection.state is ConnectionState.CLOSED: + handler = self.transports[connection].handler + assert handler + handler.cancel("closed by command") + + +class LiveConnectionHandler(ConnectionHandler, metaclass=abc.ABCMeta): + def __init__( + self, + reader: asyncio.StreamReader | mitmproxy_rs.Stream, + writer: asyncio.StreamWriter | mitmproxy_rs.Stream, + options: moptions.Options, + mode: mode_specs.ProxyMode, + ) -> None: + client = Client( + transport_protocol=writer.get_extra_info("transport_protocol", "tcp"), + peername=writer.get_extra_info("peername"), + sockname=writer.get_extra_info("sockname"), + timestamp_start=time.time(), + proxy_mode=mode, + state=ConnectionState.OPEN, + ) + context = Context(client, options) + super().__init__(context) + self.transports[client] = ConnectionIO( + handler=None, reader=reader, writer=writer + ) + + +class SimpleConnectionHandler(LiveConnectionHandler): # pragma: no cover + """Simple handler that does not really process any hooks.""" + + hook_handlers: dict[str, Callable] + + def __init__(self, reader, writer, options, mode, hook_handlers): + super().__init__(reader, writer, options, mode) + self.hook_handlers = hook_handlers + + async def handle_hook(self, hook: commands.StartHook) -> None: + if hook.name in self.hook_handlers: + self.hook_handlers[hook.name](*hook.args()) + + +if __name__ == "__main__": # pragma: no cover + # simple standalone implementation for testing. + loop = asyncio.get_event_loop() + + opts = moptions.Options() + # options duplicated here to simplify testing setup + opts.add_option( + "store_streamed_bodies", + bool, + False, + "", + ) + opts.add_option( + "connection_strategy", + str, + "lazy", + "Determine when server connections should be established.", + choices=("eager", "lazy"), + ) + opts.add_option( + "keep_host_header", + bool, + False, + """ + Reverse Proxy: Keep the original host header instead of rewriting it + to the reverse proxy target. + """, + ) + + async def handle(reader, writer): + layer_stack = [ + # lambda ctx: layers.ServerTLSLayer(ctx), + # lambda ctx: layers.HttpLayer(ctx, HTTPMode.regular), + # lambda ctx: setattr(ctx.server, "tls", True) or layers.ServerTLSLayer(ctx), + # lambda ctx: layers.ClientTLSLayer(ctx), + lambda ctx: layers.modes.ReverseProxy(ctx), + lambda ctx: layers.HttpLayer(ctx, HTTPMode.transparent), + ] + + def next_layer(nl: layer.NextLayer): + layr = layer_stack.pop(0)(nl.context) + layr.debug = " " * len(nl.context.layers) + nl.layer = layr + + def request(flow: http.HTTPFlow): + if "cached" in flow.request.path: + flow.response = http.Response.make(418, f"(cached) {flow.request.text}") + if "toggle-tls" in flow.request.path: + if flow.request.url.startswith("https://"): + flow.request.url = flow.request.url.replace("https://", "http://") + else: + flow.request.url = flow.request.url.replace("http://", "https://") + if "redirect" in flow.request.path: + flow.request.host = "httpbin.org" + + def tls_start_client(tls_start: tls.TlsData): + # INSECURE + ssl_context = SSL.Context(SSL.SSLv23_METHOD) + ssl_context.use_privatekey_file( + pkg_data.path( + "../test/mitmproxy/data/verificationcerts/trusted-leaf.key" + ) + ) + ssl_context.use_certificate_chain_file( + pkg_data.path( + "../test/mitmproxy/data/verificationcerts/trusted-leaf.crt" + ) + ) + tls_start.ssl_conn = SSL.Connection(ssl_context) + tls_start.ssl_conn.set_accept_state() + + def tls_start_server(tls_start: tls.TlsData): + # INSECURE + ssl_context = SSL.Context(SSL.SSLv23_METHOD) + tls_start.ssl_conn = SSL.Connection(ssl_context) + tls_start.ssl_conn.set_connect_state() + if tls_start.context.client.sni is not None: + tls_start.ssl_conn.set_tlsext_host_name( + tls_start.context.client.sni.encode() + ) + + await SimpleConnectionHandler( + reader, + writer, + opts, + mode_specs.ProxyMode.parse("reverse:http://127.0.0.1:3000/"), + { + "next_layer": next_layer, + "request": request, + "tls_start_client": tls_start_client, + "tls_start_server": tls_start_server, + }, + ).handle_client() + + coro = asyncio.start_server(handle, "127.0.0.1", 8080, loop=loop) + server = loop.run_until_complete(coro) + + # Serve requests until Ctrl+C is pressed + assert server.sockets + print(f"Serving on {human.format_address(server.sockets[0].getsockname())}") + try: + loop.run_forever() + except KeyboardInterrupt: + pass + + # Close the server + server.close() + loop.run_until_complete(server.wait_closed()) + loop.close() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/server_hooks.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/server_hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..1da4b60f225c903607d46a15309a48518a1b14c1 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/server_hooks.py @@ -0,0 +1,76 @@ +from dataclasses import dataclass + +from . import commands +from mitmproxy import connection + + +@dataclass +class ClientConnectedHook(commands.StartHook): + """ + A client has connected to mitmproxy. Note that a connection can + correspond to multiple HTTP requests. + + Setting client.error kills the connection. + """ + + client: connection.Client + + +@dataclass +class ClientDisconnectedHook(commands.StartHook): + """ + A client connection has been closed (either by us or the client). + """ + + client: connection.Client + + +@dataclass +class ServerConnectionHookData: + """Event data for server connection event hooks.""" + + server: connection.Server + """The server connection this hook is about.""" + client: connection.Client + """The client on the other end.""" + + +@dataclass +class ServerConnectHook(commands.StartHook): + """ + Mitmproxy is about to connect to a server. + Note that a connection can correspond to multiple requests. + + Setting data.server.error kills the connection. + """ + + data: ServerConnectionHookData + + +@dataclass +class ServerConnectedHook(commands.StartHook): + """ + Mitmproxy has connected to a server. + """ + + data: ServerConnectionHookData + + +@dataclass +class ServerDisconnectedHook(commands.StartHook): + """ + A server connection has been closed (either by us or the server). + """ + + data: ServerConnectionHookData + + +@dataclass +class ServerConnectErrorHook(commands.StartHook): + """ + Mitmproxy failed to connect to a server. + + Every server connection will receive either a server_connected or a server_connect_error event, but not both. + """ + + data: ServerConnectionHookData diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/tunnel.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/tunnel.py new file mode 100644 index 0000000000000000000000000000000000000000..bdda421543f1b0baeab8b44ddb2dd57b1c5d0a08 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/tunnel.py @@ -0,0 +1,201 @@ +import time +from enum import auto +from enum import Enum +from typing import Union + +from mitmproxy import connection +from mitmproxy.proxy import commands +from mitmproxy.proxy import context +from mitmproxy.proxy import events +from mitmproxy.proxy import layer +from mitmproxy.proxy.layer import Layer + + +class TunnelState(Enum): + INACTIVE = auto() + ESTABLISHING = auto() + OPEN = auto() + CLOSED = auto() + + +class TunnelLayer(layer.Layer): + """ + A specialized layer that simplifies the implementation of tunneling protocols such as SOCKS, upstream HTTP proxies, + or TLS. + """ + + child_layer: layer.Layer + tunnel_connection: connection.Connection + """The 'outer' connection which provides the tunnel protocol I/O""" + conn: connection.Connection + """The 'inner' connection which provides data I/O""" + tunnel_state: TunnelState = TunnelState.INACTIVE + command_to_reply_to: commands.OpenConnection | None = None + _event_queue: list[events.Event] + """ + If the connection already exists when we receive the start event, + we buffer commands until we have established the tunnel. + """ + + def __init__( + self, + context: context.Context, + tunnel_connection: connection.Connection, + conn: connection.Connection, + ): + super().__init__(context) + self.tunnel_connection = tunnel_connection + self.conn = conn + self.child_layer = layer.NextLayer(self.context) + self._event_queue = [] + + def __repr__(self): + return f"{type(self).__name__}({self.tunnel_state.name.lower()})" + + def _handle_event(self, event: events.Event) -> layer.CommandGenerator[None]: + if isinstance(event, events.Start): + if self.tunnel_connection.state is not connection.ConnectionState.CLOSED: + # we might be in the interesting state here where the connection is already half-closed, + # for example because next_layer buffered events and the client disconnected in the meantime. + # we still expect a close event to arrive, so we carry on here as normal for now. + self.tunnel_state = TunnelState.ESTABLISHING + yield from self.start_handshake() + yield from self.event_to_child(event) + elif ( + isinstance(event, events.ConnectionEvent) + and event.connection == self.tunnel_connection + ): + if isinstance(event, events.DataReceived): + if self.tunnel_state is TunnelState.ESTABLISHING: + done, err = yield from self.receive_handshake_data(event.data) + if done: + if self.conn != self.tunnel_connection: + self.conn.state = connection.ConnectionState.OPEN + self.conn.timestamp_start = time.time() + if err: + if self.conn != self.tunnel_connection: + self.conn.state = connection.ConnectionState.CLOSED + self.conn.timestamp_start = time.time() + yield from self.on_handshake_error(err) + if done or err: + yield from self._handshake_finished(err) + else: + yield from self.receive_data(event.data) + elif isinstance(event, events.ConnectionClosed): + if self.conn != self.tunnel_connection: + self.conn.state &= ~connection.ConnectionState.CAN_READ + self.conn.timestamp_end = time.time() + if self.tunnel_state is TunnelState.OPEN: + yield from self.receive_close() + elif self.tunnel_state is TunnelState.ESTABLISHING: + err = "connection closed" + yield from self.on_handshake_error(err) + yield from self._handshake_finished(err) + self.tunnel_state = TunnelState.CLOSED + else: # pragma: no cover + raise AssertionError(f"Unexpected event: {event}") + else: + yield from self.event_to_child(event) + + def _handshake_finished(self, err: str | None) -> layer.CommandGenerator[None]: + if err: + self.tunnel_state = TunnelState.CLOSED + else: + self.tunnel_state = TunnelState.OPEN + if self.command_to_reply_to: + yield from self.event_to_child( + events.OpenConnectionCompleted(self.command_to_reply_to, err) + ) + self.command_to_reply_to = None + else: + for evt in self._event_queue: + yield from self.event_to_child(evt) + self._event_queue.clear() + + def _handle_command( + self, command: commands.Command + ) -> layer.CommandGenerator[None]: + if ( + isinstance(command, commands.ConnectionCommand) + and command.connection == self.conn + ): + if isinstance(command, commands.SendData): + yield from self.send_data(command.data) + elif isinstance(command, commands.CloseConnection): + if self.conn != self.tunnel_connection: + self.conn.state &= ~connection.ConnectionState.CAN_WRITE + command.connection = self.tunnel_connection + yield from self.send_close(command) + elif isinstance(command, commands.OpenConnection): + # create our own OpenConnection command object that blocks here. + self.command_to_reply_to = command + self.tunnel_state = TunnelState.ESTABLISHING + err = yield commands.OpenConnection(self.tunnel_connection) + if err: + yield from self.event_to_child( + events.OpenConnectionCompleted(command, err) + ) + self.tunnel_state = TunnelState.CLOSED + else: + yield from self.start_handshake() + else: # pragma: no cover + raise AssertionError(f"Unexpected command: {command}") + else: + yield command + + def event_to_child(self, event: events.Event) -> layer.CommandGenerator[None]: + if ( + self.tunnel_state is TunnelState.ESTABLISHING + and not self.command_to_reply_to + ): + self._event_queue.append(event) + return + for command in self.child_layer.handle_event(event): + yield from self._handle_command(command) + + def start_handshake(self) -> layer.CommandGenerator[None]: + yield from self._handle_event(events.DataReceived(self.tunnel_connection, b"")) + + def receive_handshake_data( + self, data: bytes + ) -> layer.CommandGenerator[tuple[bool, str | None]]: + """returns a (done, err) tuple""" + yield from () + return True, None + + def on_handshake_error(self, err: str) -> layer.CommandGenerator[None]: + """Called if either receive_handshake_data returns an error or we receive a close during handshake.""" + yield commands.CloseConnection(self.tunnel_connection) + + def receive_data(self, data: bytes) -> layer.CommandGenerator[None]: + yield from self.event_to_child(events.DataReceived(self.conn, data)) + + def receive_close(self) -> layer.CommandGenerator[None]: + yield from self.event_to_child(events.ConnectionClosed(self.conn)) + + def send_data(self, data: bytes) -> layer.CommandGenerator[None]: + yield commands.SendData(self.tunnel_connection, data) + + def send_close( + self, command: commands.CloseConnection + ) -> layer.CommandGenerator[None]: + yield command + + +class LayerStack: + def __init__(self) -> None: + self._stack: list[Layer] = [] + + def __getitem__(self, item: int) -> Layer: + return self._stack.__getitem__(item) + + def __truediv__(self, other: Union[Layer, "LayerStack"]) -> "LayerStack": + if isinstance(other, Layer): + if self._stack: + self._stack[-1].child_layer = other # type: ignore + self._stack.append(other) + else: + if self._stack: + self._stack[-1].child_layer = other[0] # type: ignore + self._stack.extend(other._stack) + return self diff --git a/python/user_packages/Python313/site-packages/mitmproxy/proxy/utils.py b/python/user_packages/Python313/site-packages/mitmproxy/proxy/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..114a8e15556dd750f0ab76bf0e33aee69c120b4b --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/proxy/utils.py @@ -0,0 +1,68 @@ +""" +Utility decorators that help build state machines +""" + +import functools + +from mitmproxy.proxy import events + + +def expect(*event_types): + """ + Only allow the given event type. + If another event is passed, an AssertionError is raised. + """ + + def decorator(f): + if __debug__ is True: + + @functools.wraps(f) + def _check_event_type(self, event: events.Event): + if isinstance(event, event_types): + return f(self, event) + else: + event_types_str = ( + "|".join(e.__name__ for e in event_types) or "no events" + ) + raise AssertionError( + f"Unexpected event type at {f.__qualname__}: " + f"Expected {event_types_str}, got {event}." + ) + + return _check_event_type + else: # pragma: no cover + return f + + return decorator + + +class ReceiveBuffer: + """ + A data structure to collect stream contents efficiently in O(n). + """ + + _chunks: list[bytes] + _len: int + + def __init__(self): + self._chunks = [] + self._len = 0 + + def __iadd__(self, other: bytes): + assert isinstance(other, bytes) + self._chunks.append(other) + self._len += len(other) + return self + + def __len__(self): + return self._len + + def __bytes__(self): + return b"".join(self._chunks) + + def __bool__(self): + return self._len > 0 + + def clear(self): + self._chunks.clear() + self._len = 0 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/script/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/script/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e75f282aef4f42cb7f8371ecbf2b26fab7bc4626 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/script/__init__.py @@ -0,0 +1,5 @@ +from .concurrent import concurrent + +__all__ = [ + "concurrent", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/script/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/script/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7879f7c8fdb1be039ae2e958e2ab1cce68488a46 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/script/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/script/__pycache__/concurrent.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/script/__pycache__/concurrent.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16f6534d36ecb54fb42c044c935ce1a332bb5299 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/script/__pycache__/concurrent.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/script/concurrent.py b/python/user_packages/Python313/site-packages/mitmproxy/script/concurrent.py new file mode 100644 index 0000000000000000000000000000000000000000..757548b6436eee97017aaa955634215975e6afab --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/script/concurrent.py @@ -0,0 +1,32 @@ +""" +This module provides a @concurrent decorator primitive to +offload computations from mitmproxy's main master thread. +""" + +import asyncio +import inspect + +from mitmproxy import hooks + + +def concurrent(fn): + if fn.__name__ not in set(hooks.all_hooks.keys()) - {"load", "configure"}: + raise NotImplementedError( + "Concurrent decorator not supported for '%s' method." % fn.__name__ + ) + + async def _concurrent(*args): + def run(): + if inspect.iscoroutinefunction(fn): + # Run the async function in a new event loop + loop = asyncio.new_event_loop() + try: + loop.run_until_complete(fn(*args)) + finally: + loop.close() + else: + fn(*args) + + await asyncio.get_running_loop().run_in_executor(None, run) + + return _concurrent diff --git a/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/taddons.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/taddons.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc82e511585544e58f6f3551d74524ec893f395d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/taddons.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/tflow.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/tflow.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eeaac277f72b573afc6a64c1f59802a85e2b53a2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/tflow.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/tutils.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/tutils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7244ca9873ea0820b726aa56bd9cfd26569342f0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/test/__pycache__/tutils.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/test/taddons.py b/python/user_packages/Python313/site-packages/mitmproxy/test/taddons.py new file mode 100644 index 0000000000000000000000000000000000000000..37bc14ba4b45de6d01e50ab8b740d750ee66c042 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/test/taddons.py @@ -0,0 +1,82 @@ +import asyncio + +import mitmproxy.master +import mitmproxy.options +from mitmproxy import command +from mitmproxy import eventsequence +from mitmproxy import hooks +from mitmproxy.addons import core +from mitmproxy.addons import script + + +class context: + """ + A context for testing addons, which sets up the mitmproxy.ctx module so + handlers can run as they would within mitmproxy. The context also + provides a number of helper methods for common testing scenarios. + """ + + def __init__(self, *addons, options=None, loadcore=True): + self.owns_loop = False + try: + loop = asyncio.get_running_loop() + except RuntimeError: + self.owns_loop = True + loop = asyncio.new_event_loop() + + options = options or mitmproxy.options.Options() + self.master = mitmproxy.master.Master(options, event_loop=loop) + self.options = self.master.options + + if loadcore: + self.master.addons.add(core.Core()) + + for a in addons: + self.master.addons.add(a) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + if self.owns_loop and not self.master.event_loop.is_closed(): + # Close the loop if we created it + self.master.event_loop.close() + return False + + async def cycle(self, addon, f): + """ + Cycles the flow through the events for the flow. Stops if the flow + is intercepted. + """ + for evt in eventsequence.iterate(f): + await self.master.addons.invoke_addon(addon, evt) + if f.intercepted: + return + + def configure(self, addon, **kwargs): + """ + A helper for testing configure methods. Modifies the registered + Options object with the given keyword arguments, then calls the + configure method on the addon with the updated value. + """ + if addon not in self.master.addons: + self.master.addons.register(addon) + with self.options.rollback(kwargs.keys(), reraise=True): + if kwargs: + self.options.update(**kwargs) + else: + self.master.addons.invoke_addon_sync(addon, hooks.ConfigureHook(set())) + + def script(self, path): + """ + Loads a script from path, and returns the enclosed addon. + """ + sc = script.Script(path, False) + return sc.addons[0] if sc.addons else None + + def command(self, func, *args): + """ + Invoke a command function with a list of string arguments within a command context, mimicking the actual command environment. + """ + cmd = command.Command(self.master.commands, "test.command", func) + return cmd.call(args) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/test/tflow.py b/python/user_packages/Python313/site-packages/mitmproxy/test/tflow.py new file mode 100644 index 0000000000000000000000000000000000000000..ec779da876b9f925408cb3566e72796f87c100c2 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/test/tflow.py @@ -0,0 +1,300 @@ +import time +import uuid + +from wsproto.frame_protocol import Opcode + +from mitmproxy import connection +from mitmproxy import dns +from mitmproxy import flow +from mitmproxy import http +from mitmproxy import tcp +from mitmproxy import udp +from mitmproxy import websocket +from mitmproxy.connection import ConnectionState +from mitmproxy.proxy.mode_specs import ProxyMode +from mitmproxy.test.tutils import tdnsreq +from mitmproxy.test.tutils import tdnsresp +from mitmproxy.test.tutils import treq +from mitmproxy.test.tutils import tresp + + +def ttcpflow( + client_conn=True, server_conn=True, messages=True, err=None +) -> tcp.TCPFlow: + if client_conn is True: + client_conn = tclient_conn() + if server_conn is True: + server_conn = tserver_conn() + if messages is True: + messages = [ + tcp.TCPMessage(True, b"hello", 946681204.2), + tcp.TCPMessage(False, b"it's me", 946681204.5), + ] + if err is True: + err = terr() + + f = tcp.TCPFlow(client_conn, server_conn) + f.timestamp_created = client_conn.timestamp_start + f.messages = messages + f.error = err + f.live = True + return f + + +def tudpflow( + client_conn=True, server_conn=True, messages=True, err=None +) -> udp.UDPFlow: + if client_conn is True: + client_conn = tclient_conn() + if server_conn is True: + server_conn = tserver_conn() + if messages is True: + messages = [ + udp.UDPMessage(True, b"hello", 946681204.2), + udp.UDPMessage(False, b"it's me", 946681204.5), + ] + if err is True: + err = terr() + + f = udp.UDPFlow(client_conn, server_conn) + f.timestamp_created = client_conn.timestamp_start + f.messages = messages + f.error = err + f.live = True + return f + + +def twebsocketflow( + messages=True, err=None, close_code=None, close_reason="" +) -> http.HTTPFlow: + flow = http.HTTPFlow(tclient_conn(), tserver_conn()) + flow.request = http.Request( + "example.com", + 80, + b"GET", + b"http", + b"example.com", + b"/ws", + b"HTTP/1.1", + headers=http.Headers( + connection="upgrade", + upgrade="websocket", + sec_websocket_version="13", + sec_websocket_key="1234", + ), + content=b"", + trailers=None, + timestamp_start=946681200, + timestamp_end=946681201, + ) + flow.response = http.Response( + b"HTTP/1.1", + 101, + reason=b"Switching Protocols", + headers=http.Headers( + connection="upgrade", + upgrade="websocket", + sec_websocket_accept=b"", + ), + content=b"", + trailers=None, + timestamp_start=946681202, + timestamp_end=946681203, + ) + + flow.websocket = twebsocket() + + flow.websocket.close_reason = close_reason + + if close_code is not None: + flow.websocket.close_code = close_code + else: + if err is True: + # ABNORMAL_CLOSURE + flow.websocket.close_code = 1006 + else: + # NORMAL_CLOSURE + flow.websocket.close_code = 1000 + + flow.live = True + return flow + + +def tdnsflow( + *, + client_conn: connection.Client | None = None, + server_conn: connection.Server | None = None, + req: dns.DNSMessage | None = None, + resp: bool | dns.DNSMessage = False, + err: bool | flow.Error = False, + live: bool = True, +) -> dns.DNSFlow: + """Create a DNS flow for testing.""" + if client_conn is None: + client_conn = tclient_conn() + client_conn.proxy_mode = ProxyMode.parse("dns") + client_conn.transport_protocol = "udp" + if server_conn is None: + server_conn = tserver_conn() + server_conn.transport_protocol = "udp" + if req is None: + req = tdnsreq() + + if resp is True: + resp = tdnsresp() + if err is True: + err = terr() + + assert resp is False or isinstance(resp, dns.DNSMessage) + assert err is False or isinstance(err, flow.Error) + + f = dns.DNSFlow(client_conn, server_conn) + f.timestamp_created = req.timestamp or time.time() + f.request = req + f.response = resp or None + f.error = err or None + f.live = live + return f + + +def tflow( + *, + client_conn: connection.Client | None = None, + server_conn: connection.Server | None = None, + req: http.Request | None = None, + resp: bool | http.Response = False, + err: bool | flow.Error = False, + ws: bool | websocket.WebSocketData = False, + live: bool = True, +) -> http.HTTPFlow: + """Create a flow for testing.""" + if client_conn is None: + client_conn = tclient_conn() + if server_conn is None: + server_conn = tserver_conn() + if req is None: + req = treq() + + if resp is True: + resp = tresp() + if err is True: + err = terr() + if ws is True: + ws = twebsocket() + + assert resp is False or isinstance(resp, http.Response) + assert err is False or isinstance(err, flow.Error) + assert ws is False or isinstance(ws, websocket.WebSocketData) + + f = http.HTTPFlow(client_conn, server_conn) + f.timestamp_created = req.timestamp_start + f.request = req + f.response = resp or None + f.error = err or None + f.websocket = ws or None + f.live = live + return f + + +class DummyFlow(flow.Flow): + """A flow that is neither HTTP nor TCP.""" + + +def tdummyflow(client_conn=True, server_conn=True, err=None) -> DummyFlow: + if client_conn is True: + client_conn = tclient_conn() + if server_conn is True: + server_conn = tserver_conn() + if err is True: + err = terr() + + f = DummyFlow(client_conn, server_conn) + f.error = err + f.live = True + return f + + +def tclient_conn() -> connection.Client: + c = connection.Client( + id=str(uuid.uuid4()), + peername=("127.0.0.1", 22), + sockname=("", 0), + mitmcert=None, + timestamp_start=946681200, + timestamp_tls_setup=946681201, + timestamp_end=946681206, + sni="address", + cipher="cipher", + alpn=b"http/1.1", + tls_version="TLSv1.2", + state=ConnectionState.OPEN, + error=None, + tls=False, + certificate_list=[], + alpn_offers=[], + cipher_list=[], + proxy_mode=ProxyMode.parse("regular"), + ) + return c + + +def tserver_conn() -> connection.Server: + c = connection.Server( + id=str(uuid.uuid4()), + address=("address", 22), + peername=("192.168.0.1", 22), + sockname=("address", 22), + timestamp_start=946681202, + timestamp_tcp_setup=946681203, + timestamp_tls_setup=946681204, + timestamp_end=946681205, + sni="address", + alpn=None, + tls_version="TLSv1.2", + via=None, + state=ConnectionState.CLOSED, + error=None, + tls=False, + certificate_list=[], + alpn_offers=[], + cipher=None, + cipher_list=[], + ) + return c + + +def terr(content: str = "error") -> flow.Error: + err = flow.Error(content, 946681207) + return err + + +def twebsocket(messages: bool = True) -> websocket.WebSocketData: + ws = websocket.WebSocketData() + + if messages: + ws.messages = [ + websocket.WebSocketMessage(Opcode.BINARY, True, b"hello binary", 946681203), + websocket.WebSocketMessage(Opcode.TEXT, True, b"hello text", 946681204), + websocket.WebSocketMessage(Opcode.TEXT, False, b"it's me", 946681205), + ] + ws.close_reason = "Close Reason" + ws.close_code = 1000 + ws.closed_by_client = False + ws.timestamp_end = 946681205 + + return ws + + +def tflows() -> list[flow.Flow]: + return [ + tflow(resp=True), + tflow(err=True), + tflow(ws=True), + ttcpflow(), + ttcpflow(err=True), + tudpflow(), + tudpflow(err=True), + tdnsflow(resp=True), + tdnsflow(req=tdnsreq(questions=[])), + tdnsflow(err=True), + ] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/test/tutils.py b/python/user_packages/Python313/site-packages/mitmproxy/test/tutils.py new file mode 100644 index 0000000000000000000000000000000000000000..62abfb1e940ed7b558171a13a2c2ec3fa4bff0d3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/test/tutils.py @@ -0,0 +1,95 @@ +from mitmproxy import dns +from mitmproxy import http + + +def tdnsreq(**kwargs) -> dns.DNSMessage: + default = dict( + timestamp=946681200, + id=42, + query=True, + op_code=dns.op_codes.QUERY, + authoritative_answer=False, + truncation=False, + recursion_desired=True, + recursion_available=False, + reserved=0, + response_code=dns.response_codes.NOERROR, + questions=[dns.Question("dns.google", dns.types.A, dns.classes.IN)], + answers=[], + authorities=[], + additionals=[], + ) + default.update(kwargs) + return dns.DNSMessage(**default) # type: ignore + + +def tdnsresp(**kwargs) -> dns.DNSMessage: + default = dict( + timestamp=946681201, + id=42, + query=False, + op_code=dns.op_codes.QUERY, + authoritative_answer=False, + truncation=False, + recursion_desired=True, + recursion_available=True, + reserved=0, + response_code=dns.response_codes.NOERROR, + questions=[dns.Question("dns.google", dns.types.A, dns.classes.IN)], + answers=[ + dns.ResourceRecord( + "dns.google", dns.types.A, dns.classes.IN, 32, b"\x08\x08\x08\x08" + ), + dns.ResourceRecord( + "dns.google", dns.types.A, dns.classes.IN, 32, b"\x08\x08\x04\x04" + ), + ], + authorities=[], + additionals=[], + ) + default.update(kwargs) + return dns.DNSMessage(**default) # type: ignore + + +def treq(**kwargs) -> http.Request: + """ + Returns: + mitmproxy.net.http.Request + """ + default = dict( + host="address", + port=22, + method=b"GET", + scheme=b"http", + authority=b"", + path=b"/path", + http_version=b"HTTP/1.1", + headers=http.Headers(((b"header", b"qvalue"), (b"content-length", b"7"))), + content=b"content", + trailers=None, + timestamp_start=946681200, + timestamp_end=946681201, + ) + default.update(kwargs) + return http.Request(**default) # type: ignore + + +def tresp(**kwargs) -> http.Response: + """ + Returns: + mitmproxy.net.http.Response + """ + default = dict( + http_version=b"HTTP/1.1", + status_code=200, + reason=b"OK", + headers=http.Headers( + ((b"header-response", b"svalue"), (b"content-length", b"7")) + ), + content=b"message", + trailers=None, + timestamp_start=946681202, + timestamp_end=946681203, + ) + default.update(kwargs) + return http.Response(**default) # type: ignore diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..865e54b2549265a99287c123dca7980afadb933c Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/cmdline.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/cmdline.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa9d3b2f130502adae4710a86293b3e2a9145fda Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/cmdline.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/dump.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/dump.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cda098538582698aae3e977ae5305b8bb46191e5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/dump.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/main.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e9555f88718f122cd20c2003f807770baebf16b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/__pycache__/main.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/cmdline.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/cmdline.py new file mode 100644 index 0000000000000000000000000000000000000000..e5c2d9e3164529e2abfd2dff9a0b15449b770694 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/cmdline.py @@ -0,0 +1,152 @@ +import argparse + + +def common_options(parser, opts): + parser.add_argument( + "--version", + action="store_true", + help="show version number and exit", + dest="version", + ) + parser.add_argument( + "--options", + action="store_true", + help="Show all options and their default values", + ) + parser.add_argument( + "--commands", + action="store_true", + help="Show all commands and their signatures", + ) + parser.add_argument( + "--set", + type=str, + dest="setoptions", + default=[], + action="append", + metavar="option[=value]", + help=""" + Set an option. When the value is omitted, booleans are set to true, + strings and integers are set to None (if permitted), and sequences + are emptied. Boolean values can be true, false or toggle. + Sequences are set using multiple invocations to set for + the same option. + """, + ) + parser.add_argument( + "-q", "--quiet", action="store_true", dest="quiet", help="Quiet." + ) + parser.add_argument( + "-v", + "--verbose", + action="store_const", + dest="verbose", + const="debug", + help="Increase log verbosity.", + ) + + # Basic options + opts.make_parser(parser, "mode", short="m") + opts.make_parser(parser, "anticache") + opts.make_parser(parser, "showhost") + opts.make_parser(parser, "show_ignored_hosts") + opts.make_parser(parser, "rfile", metavar="PATH", short="r") + opts.make_parser(parser, "scripts", metavar="SCRIPT", short="s") + opts.make_parser(parser, "stickycookie", metavar="FILTER") + opts.make_parser(parser, "stickyauth", metavar="FILTER") + opts.make_parser(parser, "save_stream_file", metavar="PATH", short="w") + opts.make_parser(parser, "anticomp") + + # Proxy options + group = parser.add_argument_group("Proxy Options") + opts.make_parser(group, "listen_host", metavar="HOST") + opts.make_parser(group, "listen_port", metavar="PORT", short="p") + opts.make_parser(group, "server", short="n") + opts.make_parser(group, "ignore_hosts", metavar="HOST") + opts.make_parser(group, "allow_hosts", metavar="HOST") + opts.make_parser(group, "tcp_hosts", metavar="HOST") + opts.make_parser(group, "upstream_auth", metavar="USER:PASS") + opts.make_parser(group, "proxyauth", metavar="SPEC") + opts.make_parser(group, "store_streamed_bodies") + opts.make_parser(group, "rawtcp") + opts.make_parser(group, "http2") + + # Proxy SSL options + group = parser.add_argument_group("SSL") + opts.make_parser(group, "certs", metavar="SPEC") + opts.make_parser(group, "cert_passphrase", metavar="PASS") + opts.make_parser(group, "ssl_insecure", short="k") + + # Client replay + group = parser.add_argument_group("Client Replay") + opts.make_parser(group, "client_replay", metavar="PATH", short="C") + + # Server replay + group = parser.add_argument_group("Server Replay") + opts.make_parser(group, "server_replay", metavar="PATH", short="S") + opts.make_parser(group, "server_replay_kill_extra") + opts.make_parser(group, "server_replay_extra") + opts.make_parser(group, "server_replay_reuse") + opts.make_parser(group, "server_replay_refresh") + + # Map Remote + group = parser.add_argument_group("Map Remote") + opts.make_parser(group, "map_remote", metavar="PATTERN", short="M") + + # Map Local + group = parser.add_argument_group("Map Local") + opts.make_parser(group, "map_local", metavar="PATTERN") + + # Modify Body + group = parser.add_argument_group("Modify Body") + opts.make_parser(group, "modify_body", metavar="PATTERN", short="B") + + # Modify headers + group = parser.add_argument_group("Modify Headers") + opts.make_parser(group, "modify_headers", metavar="PATTERN", short="H") + + +def mitmproxy(opts): + parser = argparse.ArgumentParser(usage="%(prog)s [options]") + common_options(parser, opts) + + opts.make_parser(parser, "console_layout") + opts.make_parser(parser, "console_layout_headers") + group = parser.add_argument_group( + "Filters", "See help in mitmproxy for filter expression syntax." + ) + opts.make_parser(group, "intercept", metavar="FILTER") + opts.make_parser(group, "view_filter", metavar="FILTER") + return parser + + +def mitmdump(opts): + parser = argparse.ArgumentParser(usage="%(prog)s [options] [filter]") + + common_options(parser, opts) + opts.make_parser(parser, "flow_detail", metavar="LEVEL") + parser.add_argument( + "filter_args", + nargs="...", + help=""" + Filter expression, equivalent to setting both the view_filter + and save_stream_filter options. + """, + ) + return parser + + +def mitmweb(opts): + parser = argparse.ArgumentParser(usage="%(prog)s [options]") + + group = parser.add_argument_group("Mitmweb") + opts.make_parser(group, "web_open_browser") + opts.make_parser(group, "web_port", metavar="PORT") + opts.make_parser(group, "web_host", metavar="HOST") + + common_options(parser, opts) + group = parser.add_argument_group( + "Filters", "See help in mitmproxy for filter expression syntax." + ) + opts.make_parser(group, "intercept", metavar="FILTER") + return parser diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a656793e528824629594273ad728e515d52debe7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__init__.py @@ -0,0 +1,3 @@ +from mitmproxy.tools.console import master + +__all__ = ["master"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02b428ebcd86bd244c77d253cab2344b36f99f8f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/commandexecutor.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/commandexecutor.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..606cff117aad74525e6497a2a0ff186ff95274ff Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/commandexecutor.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/commands.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/commands.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43f1a465af0ec7bb4857035639920b95bacab285 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/commands.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/common.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/common.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b6d407ebeb19b59578264ed8794b618974d801a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/common.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/consoleaddons.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/consoleaddons.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95d5e13c8cec369525b380d405731409390a8ad5 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/consoleaddons.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/defaultkeys.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/defaultkeys.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..04a00da91871594ec042b83e4e05ea14ca53d56b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/defaultkeys.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/eventlog.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/eventlog.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d27993c423d771379e53baf659a8a3b52ed90cc8 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/eventlog.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowdetailview.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowdetailview.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e11c1ca80a1cae3c9e405a1a156baee631074cae Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowdetailview.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowlist.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowlist.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22e7289f5ae4e4e458a65bdc24ac0981bc7600e7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowlist.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowview.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowview.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8382d07f2e95d2fa91c823acfe9fab71263a95f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/flowview.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/help.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/help.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc7aa643989fec1ae06c413805f9810f177e107d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/help.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/keybindings.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/keybindings.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec6f04bacca4a8862f399edd8f1eeba725579bbc Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/keybindings.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/keymap.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/keymap.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a82eac226d18d0310ae1b5056f2b7d4d25fa2c1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/keymap.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/layoutwidget.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/layoutwidget.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f00ee50828cb6ea9349c6dfad24bc3a999d381d Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/layoutwidget.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/master.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/master.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e83758f78f95cd1c817404fad202147a3d43e5b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/master.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/options.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/options.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dfeeaffc089e0d09752633e05d67e832132aeb1f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/options.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/overlay.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/overlay.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83f11fb9fbfd3aa9275025b6b267fb60973173a1 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/overlay.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/palettes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/palettes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69c05719d78d514351653103db2c9ecb2db28c50 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/palettes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/quickhelp.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/quickhelp.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4cad7894fe077b6a36811e467106ba020858d0b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/quickhelp.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/searchable.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/searchable.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ee4a6e90ec2e4fe33b1a21ddf48c405c3c86091 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/searchable.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/signals.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/signals.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66dbf4203ee302605e6cec5fcef0ee6f86779a65 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/signals.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/statusbar.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/statusbar.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..71f363bfa6cd63a16eb96ff9fdef154dc06ce3ae Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/statusbar.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/tabs.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/tabs.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fa81d540ae9ae5af53b8eedeba66b4c494d02b2 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/tabs.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/window.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/window.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..262fb1c99a338154be3713b4930139873504b29e Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/__pycache__/window.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55e7fa204cf951630fd41e81bded3d5a3dd55c47 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__pycache__/commander.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__pycache__/commander.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f76180b00ee529b157617761d08bb84577cf1f9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/__pycache__/commander.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/commander.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/commander.py new file mode 100644 index 0000000000000000000000000000000000000000..11f2b6792688598667cb5f6a9164c8d94337a22c --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commander/commander.py @@ -0,0 +1,260 @@ +import abc +from collections.abc import Sequence +from typing import NamedTuple + +import urwid +from urwid.text_layout import calc_coords + +import mitmproxy.command +import mitmproxy.flow +import mitmproxy.master +import mitmproxy.types + + +class Completer: + @abc.abstractmethod + def cycle(self, forward: bool = True) -> str: + raise NotImplementedError() + + +class ListCompleter(Completer): + def __init__( + self, + start: str, + options: Sequence[str], + ) -> None: + self.start = start + self.options: list[str] = [] + for o in options: + if o.startswith(start): + self.options.append(o) + self.options.sort() + self.pos = -1 + + def cycle(self, forward: bool = True) -> str: + if not self.options: + return self.start + if self.pos == -1: + self.pos = 0 if forward else len(self.options) - 1 + else: + delta = 1 if forward else -1 + self.pos = (self.pos + delta) % len(self.options) + return self.options[self.pos] + + +class CompletionState(NamedTuple): + completer: Completer + parsed: Sequence[mitmproxy.command.ParseResult] + + +class CommandBuffer: + def __init__(self, master: mitmproxy.master.Master, start: str = "") -> None: + self.master = master + self.text = start + # Cursor is always within the range [0:len(buffer)]. + self._cursor = len(self.text) + self.completion: CompletionState | None = None + + @property + def cursor(self) -> int: + return self._cursor + + @cursor.setter + def cursor(self, x) -> None: + if x < 0: + self._cursor = 0 + elif x > len(self.text): + self._cursor = len(self.text) + else: + self._cursor = x + + def set_text(self, text: str) -> None: + self.text = text + self._cursor = len(self.text) + self.render() + + def render(self): + parts, remaining = self.master.commands.parse_partial(self.text) + ret = [] + if not parts: + # Means we just received the leader, so we need to give a blank + # text to the widget to render or it crashes + ret.append(("text", "")) + else: + for p in parts: + if p.valid: + if p.type == mitmproxy.types.Cmd: + ret.append(("commander_command", p.value)) + else: + ret.append(("text", p.value)) + elif p.value: + ret.append(("commander_invalid", p.value)) + + if remaining: + if parts[-1].type != mitmproxy.types.Space: + ret.append(("text", " ")) + for param in remaining: + ret.append(("commander_hint", f"{param} ")) + + return ret + + def left(self) -> None: + self.cursor = self.cursor - 1 + + def right(self) -> None: + self.cursor = self.cursor + 1 + + def cycle_completion(self, forward: bool = True) -> None: + if not self.completion: + parts, remaining = self.master.commands.parse_partial( + self.text[: self.cursor] + ) + if parts and parts[-1].type != mitmproxy.types.Space: + type_to_complete = parts[-1].type + cycle_prefix = parts[-1].value + parsed = parts[:-1] + elif remaining: + type_to_complete = remaining[0].type + cycle_prefix = "" + parsed = parts + else: + return + ct = mitmproxy.types.CommandTypes.get(type_to_complete, None) + if ct: + self.completion = CompletionState( + completer=ListCompleter( + cycle_prefix, + ct.completion( + self.master.commands, type_to_complete, cycle_prefix + ), + ), + parsed=parsed, + ) + if self.completion: + nxt = self.completion.completer.cycle(forward) + buf = "".join([i.value for i in self.completion.parsed]) + nxt + self.text = buf + self.cursor = len(self.text) + + def backspace(self) -> None: + if self.cursor == 0: + return + self.text = self.text[: self.cursor - 1] + self.text[self.cursor :] + self.cursor = self.cursor - 1 + self.completion = None + + def delete(self) -> None: + if self.cursor == len(self.text): + return + self.text = self.text[: self.cursor] + self.text[self.cursor + 1 :] + self.completion = None + + def insert(self, k: str) -> None: + """ + Inserts text at the cursor. + """ + + # We don't want to insert a space before the command + if k == " " and self.text[0 : self.cursor].strip() == "": + return + + self.text = self.text[: self.cursor] + k + self.text[self.cursor :] + self.cursor += len(k) + self.completion = None + + +class CommandEdit(urwid.WidgetWrap): + leader = ": " + + def __init__(self, master: mitmproxy.master.Master, text: str) -> None: + super().__init__(urwid.Text(self.leader)) + self.master = master + self.active_filter = False + self.filter_str = "" + self.cbuf = CommandBuffer(master, text) + self.update() + + def keypress(self, size, key) -> None: + if key == "delete": + self.cbuf.delete() + elif key == "ctrl a" or key == "home": + self.cbuf.cursor = 0 + elif key == "ctrl e" or key == "end": + self.cbuf.cursor = len(self.cbuf.text) + elif key == "meta b": + self.cbuf.cursor = self.cbuf.text.rfind(" ", 0, self.cbuf.cursor) + elif key == "meta f": + pos = self.cbuf.text.find(" ", self.cbuf.cursor + 1) + if pos == -1: + pos = len(self.cbuf.text) + self.cbuf.cursor = pos + elif key == "ctrl w": + prev_cursor = self.cbuf.cursor + pos = self.cbuf.text.rfind(" ", 0, self.cbuf.cursor - 1) + if pos == -1: + new_text = self.cbuf.text[self.cbuf.cursor :] + cursor_pos = 0 + else: + txt_after = self.cbuf.text[self.cbuf.cursor :] + txt_before = self.cbuf.text[0:pos] + new_text = f"{txt_before} {txt_after}" + cursor_pos = prev_cursor - (prev_cursor - pos) + 1 + self.cbuf.set_text(new_text) + self.cbuf.cursor = cursor_pos + elif key == "backspace": + self.cbuf.backspace() + if self.cbuf.text == "": + self.active_filter = False + self.master.commands.call("commands.history.filter", "") + self.filter_str = "" + elif key == "left" or key == "ctrl b": + self.cbuf.left() + elif key == "right" or key == "ctrl f": + self.cbuf.right() + elif key == "up" or key == "ctrl p": + if self.active_filter is False: + self.active_filter = True + self.filter_str = self.cbuf.text + self.master.commands.call("commands.history.filter", self.cbuf.text) + cmd = self.master.commands.execute("commands.history.prev") + self.cbuf = CommandBuffer(self.master, cmd) + elif key == "down" or key == "ctrl n": + prev_cmd = self.cbuf.text + cmd = self.master.commands.execute("commands.history.next") + + if cmd == "": + if prev_cmd == self.filter_str: + self.cbuf = CommandBuffer(self.master, prev_cmd) + else: + self.active_filter = False + self.master.commands.call("commands.history.filter", "") + self.filter_str = "" + self.cbuf = CommandBuffer(self.master, "") + else: + self.cbuf = CommandBuffer(self.master, cmd) + elif key == "shift tab": + self.cbuf.cycle_completion(False) + elif key == "tab": + self.cbuf.cycle_completion() + elif len(key) == 1: + self.cbuf.insert(key) + self.update() + + def update(self) -> None: + self._w.set_text([self.leader, self.cbuf.render()]) + + def render(self, size, focus=False) -> urwid.Canvas: + (maxcol,) = size + canv = self._w.render((maxcol,)) + canv = urwid.CompositeCanvas(canv) + canv.cursor = self.get_cursor_coords((maxcol,)) + return canv + + def get_cursor_coords(self, size) -> tuple[int, int]: + p = self.cbuf.cursor + len(self.leader) + trans = self._w.get_line_translation(size[0]) + x, y = calc_coords(self._w.get_text()[0], trans, p) + return x, y + + def get_edit_text(self) -> str: + return self.cbuf.text diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commandexecutor.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commandexecutor.py new file mode 100644 index 0000000000000000000000000000000000000000..f047f54bca78f66ec474ff5b9fd3daa1d6c18a63 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commandexecutor.py @@ -0,0 +1,35 @@ +import logging +from collections.abc import Sequence + +from mitmproxy import exceptions +from mitmproxy import flow +from mitmproxy.tools.console import overlay +from mitmproxy.tools.console import signals + + +class CommandExecutor: + def __init__(self, master): + self.master = master + + def __call__(self, cmd: str) -> None: + if cmd.strip(): + try: + ret = self.master.commands.execute(cmd) + except exceptions.CommandError as e: + logging.error(str(e)) + else: + if ret is not None: + if type(ret) == Sequence[flow.Flow]: # noqa: E721 + signals.status_message.send( + message="Command returned %s flows" % len(ret) + ) + elif type(ret) is flow.Flow: + signals.status_message.send(message="Command returned 1 flow") + else: + self.master.overlay( + overlay.DataViewerOverlay( + self.master, + ret, + ), + valign="top", + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commands.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commands.py new file mode 100644 index 0000000000000000000000000000000000000000..67c1f18993e51a2bedba6857c385022b967196bc --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/commands.py @@ -0,0 +1,156 @@ +import textwrap + +import urwid + +from mitmproxy import command +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import signals +from mitmproxy.utils import signals as utils_signals + +HELP_HEIGHT = 5 + +command_focus_change = utils_signals.SyncSignal(lambda text: None) + + +class CommandItem(urwid.WidgetWrap): + def __init__(self, walker, cmd: command.Command, focused: bool): + self.walker, self.cmd, self.focused = walker, cmd, focused + super().__init__(self.get_widget()) + + def get_widget(self): + parts = [("focus", ">> " if self.focused else " "), ("title", self.cmd.name)] + if self.cmd.parameters: + parts += [ + ("text", " "), + ("text", " ".join(str(param) for param in self.cmd.parameters)), + ] + if self.cmd.return_type: + parts += [ + ("title", " -> "), + ("text", command.typename(self.cmd.return_type)), + ] + + return urwid.AttrMap(urwid.Padding(urwid.Text(parts)), "text") + + def get_edit_text(self): + return self._w[1].get_edit_text() + + def selectable(self): + return True + + def keypress(self, size, key): + return key + + +class CommandListWalker(urwid.ListWalker): + def __init__(self, master): + self.master = master + self.index = 0 + self.refresh() + + def refresh(self): + self.cmds = list(self.master.commands.commands.values()) + self.cmds.sort(key=lambda x: x.signature_help()) + self.set_focus(self.index) + + def get_edit_text(self): + return self.focus_obj.get_edit_text() + + def _get(self, pos): + cmd = self.cmds[pos] + return CommandItem(self, cmd, pos == self.index) + + def get_focus(self): + return self.focus_obj, self.index + + def set_focus(self, index: int) -> None: + cmd = self.cmds[index] + self.index = index + self.focus_obj = self._get(self.index) + command_focus_change.send(cmd.help or "") + + def get_next(self, pos): + if pos >= len(self.cmds) - 1: + return None, None + pos = pos + 1 + return self._get(pos), pos + + def get_prev(self, pos): + pos = pos - 1 + if pos < 0: + return None, None + return self._get(pos), pos + + +class CommandsList(urwid.ListBox): + def __init__(self, master): + self.master = master + self.walker = CommandListWalker(master) + super().__init__(self.walker) + + def keypress(self, size: int, key: str): + if key == "m_select": + foc, idx = self.get_focus() + signals.status_prompt_command.send(partial=foc.cmd.name + " ") + elif key == "m_start": + self.set_focus(0) + self.walker._modified() + elif key == "m_end": + self.set_focus(len(self.walker.cmds) - 1) + self.walker._modified() + return super().keypress(size, key) + + +class CommandHelp(urwid.Frame): + def __init__(self, master): + self.master = master + super().__init__(self.widget("")) + self.set_active(False) + command_focus_change.connect(self.sig_mod) + + def set_active(self, val): + h = urwid.Text("Command Help") + style = "heading" if val else "heading_inactive" + self.header = urwid.AttrMap(h, style) + + def widget(self, txt): + cols, _ = self.master.ui.get_cols_rows() + return urwid.ListBox([urwid.Text(i) for i in textwrap.wrap(txt, cols)]) + + def sig_mod(self, txt): + self.body = self.widget(txt) + + +class Commands(urwid.Pile, layoutwidget.LayoutWidget): + title = "Command Reference" + keyctx = "commands" + + focus_position: int + + def __init__(self, master): + oh = CommandHelp(master) + super().__init__( + [ + CommandsList(master), + (HELP_HEIGHT, oh), + ] + ) + self.master = master + + def layout_pushed(self, prev): + self.widget_list[0].walker.refresh() + + def keypress(self, size, key): + if key == "m_next": + self.focus_position = (self.focus_position + 1) % len(self.widget_list) + self.widget_list[1].set_active(self.focus_position == 1) + key = None + + # This is essentially a copypasta from urwid.Pile's keypress handler. + # So much for "closed for modification, but open for extension". + item_rows = None + if len(size) == 2: + item_rows = self.get_item_rows(size, focus=True) + i = self.widget_list.index(self.focus_item) + tsize = self.get_item_size(size, i, True, item_rows) + return self.focus_item.keypress(tsize, key) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/common.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/common.py new file mode 100644 index 0000000000000000000000000000000000000000..e28100b268270cead0ff811d4a7f978ed6f4e0d7 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/common.py @@ -0,0 +1,863 @@ +import enum +import math +import platform +from collections.abc import Iterable +from functools import lru_cache + +import urwid.util +from publicsuffix2 import get_sld +from publicsuffix2 import get_tld + +from mitmproxy import dns +from mitmproxy import flow +from mitmproxy.dns import DNSFlow +from mitmproxy.http import HTTPFlow +from mitmproxy.tcp import TCPFlow +from mitmproxy.udp import UDPFlow +from mitmproxy.utils import emoji +from mitmproxy.utils import human + +# Detect Windows Subsystem for Linux and Windows +IS_WINDOWS_OR_WSL = ( + "Microsoft" in platform.platform() or "Windows" in platform.platform() +) + + +def is_keypress(k): + """ + Is this input event a keypress? + """ + if isinstance(k, str): + return True + + +def highlight_key(text, key, textattr="text", keyattr="key"): + lst = [] + parts = text.split(key, 1) + if parts[0]: + lst.append((textattr, parts[0])) + lst.append((keyattr, key)) + if parts[1]: + lst.append((textattr, parts[1])) + return lst + + +KEY_MAX = 30 + + +def format_keyvals( + entries: Iterable[tuple[str, None | str | urwid.Widget]], + key_format: str = "key", + value_format: str = "text", + indent: int = 0, +) -> list[urwid.Columns]: + """ + Format a list of (key, value) tuples. + + Args: + entries: The list to format. keys must be strings, values can also be None or urwid widgets. + The latter makes it possible to use the result of format_keyvals() as a value. + key_format: The display attribute for the key. + value_format: The display attribute for the value. + indent: Additional indent to apply. + """ + max_key_len = max((len(k) for k, v in entries if k is not None), default=0) + max_key_len = min(max_key_len, KEY_MAX) + + if indent > 2: + indent -= 2 # We use dividechars=2 below, which already adds two empty spaces + + ret = [] + for k, v in entries: + if v is None: + v = urwid.Text("") + elif not isinstance(v, urwid.Widget): + v = urwid.Text([(value_format, v)]) + ret.append( + urwid.Columns( + [ + ("fixed", indent, urwid.Text("")), + ("fixed", max_key_len, urwid.Text([(key_format, k)])), + v, + ], + dividechars=2, + ) + ) + return ret + + +def fcol(s: str, attr: str) -> tuple[str, int, urwid.Text]: + s = str(s) + return ("fixed", len(s), urwid.Text([(attr, s)])) + + +if urwid.util.detected_encoding: + SYMBOL_REPLAY = "\u21ba" + SYMBOL_RETURN = "\u2190" + SYMBOL_MARK = "\u25cf" + SYMBOL_UP = "\u21e7" + SYMBOL_DOWN = "\u21e9" + SYMBOL_ELLIPSIS = "\u2026" + SYMBOL_FROM_CLIENT = "\u21d2" + SYMBOL_TO_CLIENT = "\u21d0" +else: + SYMBOL_REPLAY = "[r]" + SYMBOL_RETURN = "<-" + SYMBOL_MARK = "#" + SYMBOL_UP = "^" + SYMBOL_DOWN = " " + SYMBOL_ELLIPSIS = "~" + SYMBOL_FROM_CLIENT = "->" + SYMBOL_TO_CLIENT = "<-" + +SCHEME_STYLES = { + "http": "scheme_http", + "https": "scheme_https", + "ws": "scheme_ws", + "wss": "scheme_wss", + "tcp": "scheme_tcp", + "udp": "scheme_udp", + "dns": "scheme_dns", + "quic": "scheme_quic", +} +HTTP_REQUEST_METHOD_STYLES = { + "GET": "method_get", + "POST": "method_post", + "DELETE": "method_delete", + "HEAD": "method_head", + "PUT": "method_put", +} +HTTP_RESPONSE_CODE_STYLE = { + 2: "code_200", + 3: "code_300", + 4: "code_400", + 5: "code_500", +} + + +class RenderMode(enum.Enum): + TABLE = 1 + """The flow list in table format, i.e. one row per flow.""" + LIST = 2 + """The flow list in list format, i.e. potentially multiple rows per flow.""" + DETAILVIEW = 3 + """The top lines in the detail view.""" + + +def fixlen(s: str, maxlen: int) -> str: + if len(s) <= maxlen: + return s.ljust(maxlen) + else: + return s[0 : maxlen - len(SYMBOL_ELLIPSIS)] + SYMBOL_ELLIPSIS + + +def fixlen_r(s: str, maxlen: int) -> str: + if len(s) <= maxlen: + return s.rjust(maxlen) + else: + return SYMBOL_ELLIPSIS + s[len(s) - maxlen + len(SYMBOL_ELLIPSIS) :] + + +def render_marker(marker: str) -> str: + rendered = emoji.emoji.get(marker, SYMBOL_MARK) + + # The marker can only be one glyph. Some emoji that use zero-width joiners (ZWJ) + # will not be rendered as a single glyph and instead will show + # multiple glyphs. Just use the first glyph as a fallback. + # https://emojipedia.org/emoji-zwj-sequence/ + return rendered[0] + + +class TruncatedText(urwid.Widget): + def __init__(self, text, attr, align="left"): + self.text = text + self.attr = attr + self.align = align + super().__init__() + + def pack(self, size, focus=False): + return (len(self.text), 1) + + def rows(self, size, focus=False): + return 1 + + def render(self, size, focus=False): + text = self.text + attr = self.attr + if self.align == "right": + text = text[::-1] + attr = attr[::-1] + + text_len = urwid.calc_width(text, 0, len(text)) + if size is not None and len(size) > 0: + width = size[0] + else: + width = text_len + + if width >= text_len: + remaining = width - text_len + if remaining > 0: + c_text = text + " " * remaining + c_attr = attr + [("text", remaining)] + else: + c_text = text + c_attr = attr + else: + trim = urwid.util.calc_trim_text(text, 0, width - 1, 0, width - 1) + visible_text = text[0 : trim[1]] + if trim[3] == 1: + visible_text += " " + c_text = visible_text + SYMBOL_ELLIPSIS + c_attr = urwid.util.rle_subseg(attr, 0, len(visible_text.encode())) + [ + ("focus", len(SYMBOL_ELLIPSIS.encode())) + ] + + if self.align == "right": + c_text = c_text[::-1] + c_attr = c_attr[::-1] + + return urwid.TextCanvas([c_text.encode()], [c_attr], maxcol=width) + + +def truncated_plain(text, attr, align="left"): + return TruncatedText(text, [(attr, len(text.encode()))], align) + + +# Work around https://github.com/urwid/urwid/pull/330 +def rle_append_beginning_modify(rle, a_r): + """ + Append (a, r) (unpacked from *a_r*) to BEGINNING of rle. + Merge with first run when possible + + MODIFIES rle parameter contents. Returns None. + """ + a, r = a_r + if not rle: + rle[:] = [(a, r)] + else: + al, run = rle[0] + if a == al: + rle[0] = (a, run + r) + else: + rle[0:0] = [(a, r)] + + +def colorize_host(host: str): + if not host: + return [] + + tld = get_tld(host) + sld = get_sld(host) + + attr: list = [] + + tld_size = len(tld) + sld_size = len(sld) - tld_size + + for letter in reversed(range(len(host))): + character = host[letter] + if tld_size > 0: + style = "url_domain" + tld_size -= 1 + elif tld_size == 0: + style = "text" + tld_size -= 1 + elif sld_size > 0: + sld_size -= 1 + style = "url_extension" + else: + style = "text" + rle_append_beginning_modify(attr, (style, len(character.encode()))) + return attr + + +def colorize_req(s: str): + path = s.split("?", 2)[0] + i_query = len(path) + i_last_slash = path.rfind("/") + i_ext = path[i_last_slash + 1 :].rfind(".") + i_ext = i_last_slash + i_ext if i_ext >= 0 else len(s) + in_val = False + attr: list = [] + for i in range(len(s)): + c = s[i] + if ( + (i < i_query and c == "/") + or (i < i_query and i > i_last_slash and c == ".") + or (i == i_query) + ): + a = "url_punctuation" + elif i > i_query: + if in_val: + if c == "&": + in_val = False + a = "url_punctuation" + else: + a = "url_query_value" + else: + if c == "=": + in_val = True + a = "url_punctuation" + else: + a = "url_query_key" + elif i > i_ext: + a = "url_extension" + elif i > i_last_slash: + a = "url_filename" + else: + a = "text" + urwid.util.rle_append_modify(attr, (a, len(c.encode()))) + return attr + + +def format_http_content_type(content_type: str) -> tuple[str, str]: + content_type = content_type.split(";")[0] + if content_type.endswith("/javascript"): + style = "content_script" + elif content_type.startswith("text/"): + style = "content_text" + elif ( + content_type.startswith("image/") + or content_type.startswith("video/") + or content_type.startswith("font/") + or "/x-font-" in content_type + ): + style = "content_media" + elif content_type.endswith("/json") or content_type.endswith("/xml"): + style = "content_data" + elif content_type.startswith("application/"): + style = "content_raw" + else: + style = "content_other" + return content_type, style + + +def format_duration(duration: float) -> tuple[str, str]: + pretty_duration = human.pretty_duration(duration) + style = "gradient_%02d" % int( + 99 - 100 * min(math.log2(max(1.0, 1000 * duration)) / 12, 0.99) + ) + return pretty_duration, style + + +def format_size(num_bytes: int) -> tuple[str, str]: + pretty_size = human.pretty_size(num_bytes) + style = "gradient_%02d" % int(99 - 100 * min(math.log2(1 + num_bytes) / 20, 0.99)) + return pretty_size, style + + +def format_left_indicators(*, focused: bool, intercepted: bool, timestamp: float): + indicators: list[str | tuple[str, str]] = [] + if focused: + indicators.append(("focus", ">>")) + else: + indicators.append(" ") + pretty_timestamp = human.format_timestamp(timestamp)[-8:] + if intercepted: + indicators.append(("intercept", pretty_timestamp)) + else: + indicators.append(("text", pretty_timestamp)) + return "fixed", 10, urwid.Text(indicators) + + +def format_right_indicators( + *, + replay: bool, + marked: str, +): + indicators: list[str | tuple[str, str]] = [] + if replay: + indicators.append(("replay", SYMBOL_REPLAY)) + else: + indicators.append(" ") + if bool(marked): + indicators.append(("mark", render_marker(marked))) + else: + indicators.append(" ") + return "fixed", 3, urwid.Text(indicators) + + +@lru_cache(maxsize=800) +def format_http_flow_list( + *, + render_mode: RenderMode, + focused: bool, + marked: str, + is_replay: bool, + request_method: str, + request_scheme: str, + request_host: str, + request_path: str, + request_url: str, + request_http_version: str, + request_timestamp: float, + request_is_push_promise: bool, + intercepted: bool, + response_code: int | None, + response_reason: str | None, + response_content_length: int | None, + response_content_type: str | None, + duration: float | None, + error_message: str | None, +) -> urwid.Widget: + req = [] + + if render_mode is RenderMode.DETAILVIEW: + req.append(fcol(human.format_timestamp(request_timestamp), "highlight")) + else: + if focused: + req.append(fcol(">>", "focus")) + else: + req.append(fcol(" ", "focus")) + + method_style = HTTP_REQUEST_METHOD_STYLES.get(request_method, "method_other") + req.append(fcol(request_method, method_style)) + + if request_is_push_promise: + req.append(fcol("PUSH_PROMISE", "method_http2_push")) + + preamble_len = sum(x[1] for x in req) + len(req) - 1 + + if request_http_version not in ("HTTP/1.0", "HTTP/1.1"): + request_url += " " + request_http_version + if intercepted and not response_code: + url_style = "intercept" + elif response_code or error_message: + url_style = "text" + else: + url_style = "title" + + if render_mode is RenderMode.DETAILVIEW: + req.append(urwid.Text([(url_style, request_url)])) + else: + req.append(truncated_plain(request_url, url_style)) + + req.append(format_right_indicators(replay=is_replay, marked=marked)) + + resp = [("fixed", preamble_len, urwid.Text(""))] + if response_code: + if intercepted: + style = "intercept" + else: + style = "" + + status_style = style or HTTP_RESPONSE_CODE_STYLE.get( + response_code // 100, "code_other" + ) + resp.append(fcol(SYMBOL_RETURN, status_style)) + resp.append(fcol(str(response_code), status_style)) + if response_reason and render_mode is RenderMode.DETAILVIEW: + resp.append(fcol(response_reason, status_style)) + + if response_content_type: + ct, ct_style = format_http_content_type(response_content_type) + resp.append(fcol(ct, style or ct_style)) + + if response_content_length: + size, size_style = format_size(response_content_length) + elif response_content_length == 0: + size = "[no content]" + size_style = "text" + else: + size = "[content missing]" + size_style = "text" + resp.append(fcol(size, style or size_style)) + + if duration: + dur, dur_style = format_duration(duration) + resp.append(fcol(dur, style or dur_style)) + elif error_message: + resp.append(fcol(SYMBOL_RETURN, "error")) + resp.append(urwid.Text([("error", error_message)])) + + return urwid.Pile( + [urwid.Columns(req, dividechars=1), urwid.Columns(resp, dividechars=1)] + ) + + +@lru_cache(maxsize=800) +def format_http_flow_table( + *, + render_mode: RenderMode, + focused: bool, + marked: str, + is_replay: str | None, + request_method: str, + request_scheme: str, + request_host: str, + request_path: str, + request_url: str, + request_http_version: str, + request_timestamp: float, + request_is_push_promise: bool, + intercepted: bool, + response_code: int | None, + response_reason: str | None, + response_content_length: int | None, + response_content_type: str | None, + duration: float | None, + error_message: str | None, +) -> urwid.Widget: + items = [ + format_left_indicators( + focused=focused, intercepted=intercepted, timestamp=request_timestamp + ) + ] + + if intercepted and not response_code: + request_style = "intercept" + else: + request_style = "" + + scheme_style = request_style or SCHEME_STYLES.get(request_scheme, "scheme_other") + items.append(fcol(fixlen(request_scheme.upper(), 5), scheme_style)) + + if request_is_push_promise: + method_style = "method_http2_push" + else: + method_style = request_style or HTTP_REQUEST_METHOD_STYLES.get( + request_method, "method_other" + ) + items.append(fcol(fixlen(request_method, 4), method_style)) + + items.append( + ( + "weight", + 0.25, + TruncatedText(request_host, colorize_host(request_host), "right"), + ) + ) + items.append( + ("weight", 1.0, TruncatedText(request_path, colorize_req(request_path), "left")) + ) + + if intercepted and response_code: + response_style = "intercept" + else: + response_style = "" + + if response_code: + status = str(response_code) + status_style = response_style or HTTP_RESPONSE_CODE_STYLE.get( + response_code // 100, "code_other" + ) + + if response_content_length and response_content_type: + content, content_style = format_http_content_type(response_content_type) + content_style = response_style or content_style + elif response_content_length: + content = "" + content_style = "content_none" + elif response_content_length == 0: + content = "[no content]" + content_style = "content_none" + else: + content = "[content missing]" + content_style = "content_none" + + elif error_message: + status = "err" + status_style = "error" + content = error_message + content_style = "error" + + else: + status = "" + status_style = "text" + content = "" + content_style = "" + + items.append(fcol(fixlen(status, 3), status_style)) + items.append(("weight", 0.15, truncated_plain(content, content_style, "right"))) + + if response_content_length: + size, size_style = format_size(response_content_length) + items.append(fcol(fixlen_r(size, 5), response_style or size_style)) + else: + items.append(("fixed", 5, urwid.Text(""))) + + if duration: + duration_pretty, duration_style = format_duration(duration) + items.append( + fcol(fixlen_r(duration_pretty, 5), response_style or duration_style) + ) + else: + items.append(("fixed", 5, urwid.Text(""))) + + items.append( + format_right_indicators( + replay=bool(is_replay), + marked=marked, + ) + ) + return urwid.Columns(items, dividechars=1, min_width=15) + + +@lru_cache(maxsize=800) +def format_message_flow( + *, + render_mode: RenderMode, + focused: bool, + timestamp_start: float, + marked: str, + protocol: str, + client_address, + server_address, + total_size: int, + duration: float | None, + error_message: str | None, +): + conn = f"{human.format_address(client_address)} <-> {human.format_address(server_address)}" + + items = [] + + if render_mode in (RenderMode.TABLE, RenderMode.DETAILVIEW): + items.append( + format_left_indicators( + focused=focused, intercepted=False, timestamp=timestamp_start + ) + ) + else: + if focused: + items.append(fcol(">>", "focus")) + else: + items.append(fcol(" ", "focus")) + + if render_mode is RenderMode.TABLE: + items.append(fcol(fixlen(protocol.upper(), 5), SCHEME_STYLES[protocol])) + else: + items.append(fcol(protocol.upper(), SCHEME_STYLES[protocol])) + + items.append(("weight", 1.0, truncated_plain(conn, "text", "left"))) + if error_message: + items.append(("weight", 1.0, truncated_plain(error_message, "error", "left"))) + + if total_size: + size, size_style = format_size(total_size) + items.append(fcol(fixlen_r(size, 5), size_style)) + else: + items.append(("fixed", 5, urwid.Text(""))) + + if duration: + duration_pretty, duration_style = format_duration(duration) + items.append(fcol(fixlen_r(duration_pretty, 5), duration_style)) + else: + items.append(("fixed", 5, urwid.Text(""))) + + items.append(format_right_indicators(replay=False, marked=marked)) + + return urwid.Pile([urwid.Columns(items, dividechars=1, min_width=15)]) + + +@lru_cache(maxsize=800) +def format_dns_flow( + *, + render_mode: RenderMode, + focused: bool, + intercepted: bool, + marked: str, + is_replay: str | None, + op_code: str, + request_timestamp: float, + domain: str, + type: str, + response_code: str | None, + response_code_http_equiv: int, + answer: str | None, + error_message: str, + duration: float | None, +): + items = [] + + if render_mode in (RenderMode.TABLE, RenderMode.DETAILVIEW): + items.append( + format_left_indicators( + focused=focused, intercepted=intercepted, timestamp=request_timestamp + ) + ) + else: + items.append(fcol(">>" if focused else " ", "focus")) + + scheme_style = "intercepted" if intercepted else SCHEME_STYLES["dns"] + t = f"DNS {op_code}" + if render_mode is RenderMode.TABLE: + t = fixlen(t, 10) + items.append(fcol(t, scheme_style)) + items.append(("weight", 0.5, TruncatedText(domain, colorize_host(domain), "right"))) + items.append(fcol("(" + fixlen(type, 5)[: len(type)] + ") =", "text")) + + items.append( + ( + "weight", + 1, + ( + truncated_plain( + "..." if answer is None else "?" if not answer else answer, "text" + ) + if error_message is None + else truncated_plain(error_message, "error") + ), + ) + ) + status_style = ( + "intercepted" + if intercepted + else HTTP_RESPONSE_CODE_STYLE.get(response_code_http_equiv // 100, "code_other") + ) + items.append( + fcol(fixlen("" if response_code is None else response_code, 9), status_style) + ) + + if duration: + duration_pretty, duration_style = format_duration(duration) + items.append(fcol(fixlen_r(duration_pretty, 5), duration_style)) + else: + items.append(("fixed", 5, urwid.Text(""))) + + items.append( + format_right_indicators( + replay=bool(is_replay), + marked=marked, + ) + ) + return urwid.Pile([urwid.Columns(items, dividechars=1, min_width=15)]) + + +def format_flow( + f: flow.Flow, + *, + render_mode: RenderMode, + hostheader: bool = False, # pass options directly if we need more stuff from them + focused: bool = True, +) -> urwid.Widget: + """ + This functions calls the proper renderer depending on the flow type. + We also want to cache the renderer output, so we extract all attributes + relevant for display and call the render with only that. This assures that rows + are updated if the flow is changed. + """ + duration: float | None + error_message: str | None + if f.error: + error_message = f.error.msg + else: + error_message = None + + if isinstance(f, (TCPFlow, UDPFlow)): + total_size = 0 + for message in f.messages: + total_size += len(message.content) + if f.messages: + duration = f.messages[-1].timestamp - f.client_conn.timestamp_start + else: + duration = None + if f.client_conn.tls_version == "QUICv1": + protocol = "quic" + else: + protocol = f.type + return format_message_flow( + render_mode=render_mode, + focused=focused, + timestamp_start=f.client_conn.timestamp_start, + marked=f.marked, + protocol=protocol, + client_address=f.client_conn.peername, + server_address=f.server_conn.address, + total_size=total_size, + duration=duration, + error_message=error_message, + ) + elif isinstance(f, DNSFlow): + if f.request.timestamp and f.response and f.response.timestamp: + duration = f.response.timestamp - f.request.timestamp + else: + duration = None + if f.response: + response_code_str: str | None = dns.response_codes.to_str( + f.response.response_code + ) + response_code_http_equiv = dns.response_codes.http_equiv_status_code( + f.response.response_code + ) + answer = ", ".join(str(x) for x in f.response.answers) + else: + response_code_str = None + response_code_http_equiv = 0 + answer = None + return format_dns_flow( + render_mode=render_mode, + focused=focused, + intercepted=f.intercepted, + marked=f.marked, + is_replay=f.is_replay, + op_code=dns.op_codes.to_str(f.request.op_code), + request_timestamp=f.request.timestamp, + domain=f.request.questions[0].name if f.request.questions else "", + type=dns.types.to_str(f.request.questions[0].type) + if f.request.questions + else "", + response_code=response_code_str, + response_code_http_equiv=response_code_http_equiv, + answer=answer, + error_message=error_message, + duration=duration, + ) + elif isinstance(f, HTTPFlow): + intercepted = f.intercepted + response_content_length: int | None + if f.response: + if f.response.raw_content is not None: + response_content_length = len(f.response.raw_content) + else: + response_content_length = None + response_code: int | None = f.response.status_code + response_reason: str | None = f.response.reason + response_content_type = f.response.headers.get("content-type") + if f.response.timestamp_end: + duration = max( + [f.response.timestamp_end - f.request.timestamp_start, 0] + ) + else: + duration = None + else: + response_content_length = None + response_code = None + response_reason = None + response_content_type = None + duration = None + + scheme = f.request.scheme + if f.websocket is not None: + if scheme == "https": + scheme = "wss" + elif scheme == "http": + scheme = "ws" + + if render_mode in (RenderMode.LIST, RenderMode.DETAILVIEW): + render_func = format_http_flow_list + else: + render_func = format_http_flow_table + return render_func( + render_mode=render_mode, + focused=focused, + marked=f.marked, + is_replay=f.is_replay, + request_method=f.request.method, + request_scheme=scheme, + request_host=f.request.pretty_host if hostheader else f.request.host, + request_path=f.request.path, + request_url=f.request.pretty_url if hostheader else f.request.url, + request_http_version=f.request.http_version, + request_timestamp=f.request.timestamp_start, + request_is_push_promise="h2-pushed-stream" in f.metadata, + intercepted=intercepted, + response_code=response_code, + response_reason=response_reason, + response_content_length=response_content_length, + response_content_type=response_content_type, + duration=duration, + error_message=error_message, + ) + + else: + raise NotImplementedError() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/consoleaddons.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/consoleaddons.py new file mode 100644 index 0000000000000000000000000000000000000000..0dc3722c2030ccf9c38d0fc262ca36bd0e07167d --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/consoleaddons.py @@ -0,0 +1,763 @@ +import csv +import logging +import re +from collections.abc import Sequence + +import mitmproxy.types +from mitmproxy import command +from mitmproxy import command_lexer +from mitmproxy import contentviews +from mitmproxy import ctx +from mitmproxy import dns +from mitmproxy import exceptions +from mitmproxy import flow +from mitmproxy import http +from mitmproxy import log +from mitmproxy import tcp +from mitmproxy import udp +from mitmproxy.contentviews import ContentviewMessage +from mitmproxy.exceptions import CommandError +from mitmproxy.log import ALERT +from mitmproxy.tools.console import keymap +from mitmproxy.tools.console import overlay +from mitmproxy.tools.console import signals +from mitmproxy.utils import strutils + +logger = logging.getLogger(__name__) + + +console_palettes = [ + "lowlight", + "lowdark", + "light", + "dark", + "solarized_light", + "solarized_dark", +] +console_layouts = [ + "single", + "vertical", + "horizontal", +] + +console_flowlist_layout = ["default", "table", "list"] + + +class ConsoleAddon: + """ + An addon that exposes console-specific commands, and hooks into required + events. + """ + + def __init__(self, master): + self.master = master + self.started = False + + def load(self, loader): + loader.add_option( + "console_default_contentview", + str, + "auto", + "The default content view mode.", + choices=contentviews.registry.available_views(), + ) + loader.add_option( + "console_eventlog_verbosity", + str, + "info", + "EventLog verbosity.", + choices=log.LogLevels, + ) + loader.add_option( + "console_layout", + str, + "single", + "Console layout.", + choices=sorted(console_layouts), + ) + loader.add_option( + "console_layout_headers", + bool, + True, + "Show layout component headers", + ) + loader.add_option( + "console_focus_follow", bool, False, "Focus follows new flows." + ) + loader.add_option( + "console_palette", + str, + "solarized_dark", + "Color palette.", + choices=sorted(console_palettes), + ) + loader.add_option( + "console_palette_transparent", + bool, + True, + "Set transparent background for palette.", + ) + loader.add_option("console_mouse", bool, True, "Console mouse interaction.") + loader.add_option( + "console_flowlist_layout", + str, + "default", + "Set the flowlist layout", + choices=sorted(console_flowlist_layout), + ) + loader.add_option( + "console_strip_trailing_newlines", + bool, + False, + "Strip trailing newlines from edited request/response bodies.", + ) + loader.add_option( + "console_quickhelp_visible", + bool, + True, + "Show the quick help bar at the bottom of the console.", + ) + + @command.command("console.layout.options") + def layout_options(self) -> Sequence[str]: + """ + Returns the available options for the console_layout option. + """ + return ["single", "vertical", "horizontal"] + + @command.command("console.layout.cycle") + def layout_cycle(self) -> None: + """ + Cycle through the console layout options. + """ + opts = self.layout_options() + off = self.layout_options().index(ctx.options.console_layout) + ctx.options.update(console_layout=opts[(off + 1) % len(opts)]) + + @command.command("console.panes.next") + def panes_next(self) -> None: + """ + Go to the next layout pane. + """ + self.master.window.switch() + + @command.command("console.panes.prev") + def panes_prev(self) -> None: + """ + Go to the previous layout pane. + """ + return self.panes_next() + + @command.command("console.options.reset.focus") + def options_reset_current(self) -> None: + """ + Reset the current option in the options editor. + """ + fv = self.master.window.current("options") + if not fv: + raise exceptions.CommandError("Not viewing options.") + self.master.commands.call_strings("options.reset.one", [fv.current_name()]) + + @command.command("console.nav.start") + def nav_start(self) -> None: + """ + Go to the start of a list or scrollable. + """ + self.master.inject_key("m_start") + + @command.command("console.nav.end") + def nav_end(self) -> None: + """ + Go to the end of a list or scrollable. + """ + self.master.inject_key("m_end") + + @command.command("console.nav.next") + def nav_next(self) -> None: + """ + Go to the next navigatable item. + """ + self.master.inject_key("m_next") + + @command.command("console.nav.select") + def nav_select(self) -> None: + """ + Select a navigable item for viewing or editing. + """ + self.master.inject_key("m_select") + + @command.command("console.nav.up") + def nav_up(self) -> None: + """ + Go up. + """ + self.master.inject_key("up") + + @command.command("console.nav.down") + def nav_down(self) -> None: + """ + Go down. + """ + self.master.inject_key("down") + + @command.command("console.nav.pageup") + def nav_pageup(self) -> None: + """ + Go up. + """ + self.master.inject_key("page up") + + @command.command("console.nav.pagedown") + def nav_pagedown(self) -> None: + """ + Go down. + """ + self.master.inject_key("page down") + + @command.command("console.nav.left") + def nav_left(self) -> None: + """ + Go left. + """ + self.master.inject_key("left") + + @command.command("console.nav.right") + def nav_right(self) -> None: + """ + Go right. + """ + self.master.inject_key("right") + + @command.command("console.choose") + def console_choose( + self, + prompt: str, + choices: Sequence[str], + cmd: mitmproxy.types.Cmd, + *args: mitmproxy.types.CmdArgs, + ) -> None: + """ + Prompt the user to choose from a specified list of strings, then + invoke another command with all occurrences of {choice} replaced by + the choice the user made. + """ + + def callback(opt): + # We're now outside of the call context... + repl = [arg.replace("{choice}", opt) for arg in args] + try: + self.master.commands.call_strings(cmd, repl) + except exceptions.CommandError as e: + logger.error(str(e)) + + self.master.overlay(overlay.Chooser(self.master, prompt, choices, "", callback)) + + @command.command("console.choose.cmd") + def console_choose_cmd( + self, + prompt: str, + choicecmd: mitmproxy.types.Cmd, + subcmd: mitmproxy.types.Cmd, + *args: mitmproxy.types.CmdArgs, + ) -> None: + """ + Prompt the user to choose from a list of strings returned by a + command, then invoke another command with all occurrences of {choice} + replaced by the choice the user made. + """ + choices = ctx.master.commands.execute(choicecmd) + + def callback(opt): + # We're now outside of the call context... + repl = [arg.replace("{choice}", opt) for arg in args] + try: + self.master.commands.call_strings(subcmd, repl) + except exceptions.CommandError as e: + logger.error(str(e)) + + self.master.overlay(overlay.Chooser(self.master, prompt, choices, "", callback)) + + @command.command("console.command") + def console_command(self, *command_str: str) -> None: + """ + Prompt the user to edit a command with a (possibly empty) starting value. + """ + quoted = " ".join(command_lexer.quote(x) for x in command_str) + if quoted: + quoted += " " + signals.status_prompt_command.send(partial=quoted) + + @command.command("console.command.confirm") + def console_command_confirm( + self, + prompt: str, + cmd: mitmproxy.types.Cmd, + *args: mitmproxy.types.CmdArgs, + ) -> None: + """ + Prompt the user before running the specified command. + """ + + def callback(opt): + if opt == "n": + return + try: + self.master.commands.call_strings(cmd, args) + except exceptions.CommandError as e: + logger.exception(str(e)) + + self.master.prompt_for_user_choice(prompt, callback) + + @command.command("console.command.set") + def console_command_set(self, option_name: str) -> None: + """ + Prompt the user to set an option. + """ + option_value = getattr(self.master.options, option_name, None) or "" + set_command = f"set {option_name} {option_value!r}" + cursor = len(set_command) - 1 + signals.status_prompt_command.send(partial=set_command, cursor=cursor) + + @command.command("console.view.keybindings") + def view_keybindings(self) -> None: + """View the commands list.""" + self.master.switch_view("keybindings") + + @command.command("console.view.commands") + def view_commands(self) -> None: + """View the commands list.""" + self.master.switch_view("commands") + + @command.command("console.view.options") + def view_options(self) -> None: + """View the options editor.""" + self.master.switch_view("options") + + @command.command("console.view.eventlog") + def view_eventlog(self) -> None: + """View the event log.""" + self.master.switch_view("eventlog") + + @command.command("console.view.help") + def view_help(self) -> None: + """View help.""" + self.master.switch_view("help") + + @command.command("console.view.flow") + def view_flow(self, flow: flow.Flow) -> None: + """View a flow.""" + if isinstance(flow, (http.HTTPFlow, tcp.TCPFlow, udp.UDPFlow, dns.DNSFlow)): + self.master.switch_view("flowview") + else: + logger.warning(f"No detail view for {type(flow).__name__}.") + + @command.command("console.exit") + def exit(self) -> None: + """Exit mitmproxy.""" + self.master.shutdown() + + @command.command("console.view.pop") + def view_pop(self) -> None: + """ + Pop a view off the console stack. At the top level, this prompts the + user to exit mitmproxy. + """ + signals.pop_view_state.send() + + @command.command("console.bodyview") + @command.argument("part", type=mitmproxy.types.Choice("console.bodyview.options")) + def bodyview(self, flow: flow.Flow, part: str) -> None: + """ + Spawn an external viewer for a flow request or response body based + on the detected MIME type. We use the mailcap system to find the + correct viewer, and fall back to the programs in $PAGER or $EDITOR + if necessary. + """ + fpart = getattr(flow, part, None) + if not fpart: + raise exceptions.CommandError( + "Part must be either request or response, not %s." % part + ) + t = fpart.headers.get("content-type") + content = fpart.get_content(strict=False) + if not content: + raise exceptions.CommandError("No content to view.") + self.master.spawn_external_viewer(content, t) + + @command.command("console.bodyview.options") + def bodyview_options(self) -> Sequence[str]: + """ + Possible parts for console.bodyview. + """ + return ["request", "response"] + + @command.command("console.edit.focus.options") + def edit_focus_options(self) -> Sequence[str]: + """ + Possible components for console.edit.focus. + """ + flow = self.master.view.focus.flow + focus_options = [] + + try: + view_name = self.master.commands.call("console.flowview.mode") + except CommandError: + view_name = "auto" + + def add_message_edit_option( + message_name: str, message: ContentviewMessage | None + ) -> None: + if message is None: + return + data, _ = contentviews.get_data(message) + cv = contentviews.registry.get_view( + data or b"", + contentviews.make_metadata(message, flow), + view_name, + ) + if isinstance(cv, contentviews.InteractiveContentview): + focus_options.append(f"{message_name} ({cv.name})") + + if flow is None: + raise exceptions.CommandError("No flow selected.") + + if isinstance(flow, tcp.TCPFlow): + focus_options.append("tcp-message") + add_message_edit_option("tcp-message", flow.messages[-1]) + elif isinstance(flow, udp.UDPFlow): + focus_options.append("udp-message") + add_message_edit_option("udp-message", flow.messages[-1]) + elif isinstance(flow, http.HTTPFlow): + focus_options.extend( + [ + "cookies", + "urlencoded form", + "multipart form", + "path", + "method", + "query", + "reason", + "request-headers", + "response-headers", + "request-body", + "response-body", + "status_code", + "set-cookies", + "url", + ] + ) + add_message_edit_option("request-body", flow.request) + add_message_edit_option("response-body", flow.response) + if flow.websocket: + add_message_edit_option( + "websocket-message", flow.websocket.messages[-1] + ) + elif isinstance(flow, dns.DNSFlow): + raise exceptions.CommandError( + "Cannot edit DNS flows yet, please submit a patch." + ) + + focus_options.append("comment") + + return focus_options + + @command.command("console.edit.focus") + @command.argument( + "flow_part", type=mitmproxy.types.Choice("console.edit.focus.options") + ) + def edit_focus(self, flow_part: str) -> None: + """ + Edit a component of the currently focused flow. + """ + flow = self.master.view.focus.flow + # This shouldn't be necessary once this command is "console.edit @focus", + # but for now it is. + if not flow: + raise exceptions.CommandError("No flow selected.") + flow.backup() + + require_dummy_response = ( + flow_part in ("response-headers", "response-body", "set-cookies") + and flow.response is None + ) + if require_dummy_response: + flow.response = http.Response.make() + if flow_part == "comment": + self.master.switch_view("edit_focus_comment") + elif flow_part == "cookies": + self.master.switch_view("edit_focus_cookies") + elif flow_part == "urlencoded form": + self.master.switch_view("edit_focus_urlencoded_form") + elif flow_part == "multipart form": + self.master.switch_view("edit_focus_multipart_form") + elif flow_part == "path": + self.master.switch_view("edit_focus_path") + elif flow_part == "query": + self.master.switch_view("edit_focus_query") + elif flow_part == "request-headers": + self.master.switch_view("edit_focus_request_headers") + elif flow_part == "response-headers": + self.master.switch_view("edit_focus_response_headers") + elif m := re.match( + r"(?P(request|response)-body|(tcp|udp|websocket)-message) \((?P.+)\)", + flow_part, + ): + match m["message"]: + case "request-body": + message = flow.request + case "response-body": + message = flow.response + case "tcp-message" | "udp-message": + message = flow.messages[-1] + case "websocket-message": + message = flow.websocket.messages[-1] + case _: + assert False, "should be exhaustive" + + cv = contentviews.registry.get(m["contentview"]) + if not cv or not isinstance(cv, contentviews.InteractiveContentview): + raise CommandError( + f"Contentview {m['contentview']} is not bidirectional." + ) + + pretty = contentviews.prettify_message(message, flow, cv.name) + prettified = self.master.spawn_editor(pretty.text) + + message.content = contentviews.reencode_message( + prettified, + message, + flow, + cv.name, + ) + + elif flow_part in ("request-body", "response-body"): + if flow_part == "request-body": + message = flow.request + else: + message = flow.response + c = self.master.spawn_editor(message.get_content(strict=False) or b"") + # Many editors make it hard to save a file without a terminating + # newline on the last line. When editing message bodies, this can + # cause problems. We strip trailing newlines by default, but this + # behavior is configurable. + if self.master.options.console_strip_trailing_newlines: + c = c.rstrip(b"\n") + message.content = c + elif flow_part == "set-cookies": + self.master.switch_view("edit_focus_setcookies") + elif flow_part == "url": + url = flow.request.url.encode() + edited_url = self.master.spawn_editor(url) + url = edited_url.rstrip(b"\n") + flow.request.url = url.decode() + elif flow_part in ["method", "status_code", "reason"]: + self.master.commands.call_strings( + "console.command", ["flow.set", "@focus", flow_part] + ) + elif flow_part in ["tcp-message", "udp-message", "websocket-message"]: + if flow_part == "websocket-message": + message = flow.websocket.messages[-1] + else: + message = flow.messages[-1] + c = self.master.spawn_editor(message.content or b"") + if self.master.options.console_strip_trailing_newlines: + c = c.rstrip(b"\n") + message.content = c.rstrip(b"\n") + + def _grideditor(self): + gewidget = self.master.window.current("grideditor") + if not gewidget: + raise exceptions.CommandError("Not in a grideditor.") + return gewidget.key_responder() + + @command.command("console.grideditor.add") + def grideditor_add(self) -> None: + """ + Add a row after the cursor. + """ + self._grideditor().cmd_add() + + @command.command("console.grideditor.insert") + def grideditor_insert(self) -> None: + """ + Insert a row before the cursor. + """ + self._grideditor().cmd_insert() + + @command.command("console.grideditor.delete") + def grideditor_delete(self) -> None: + """ + Delete row + """ + self._grideditor().cmd_delete() + + @command.command("console.grideditor.load") + def grideditor_load(self, path: mitmproxy.types.Path) -> None: + """ + Read a file into the current cell. + """ + self._grideditor().cmd_read_file(path) + + @command.command("console.grideditor.load_escaped") + def grideditor_load_escaped(self, path: mitmproxy.types.Path) -> None: + """ + Read a file containing a Python-style escaped string into the + current cell. + """ + self._grideditor().cmd_read_file_escaped(path) + + @command.command("console.grideditor.save") + def grideditor_save(self, path: mitmproxy.types.Path) -> None: + """ + Save data to file as a CSV. + """ + rows = self._grideditor().value + try: + with open(path, "w", newline="", encoding="utf8") as fp: + writer = csv.writer(fp) + for row in rows: + writer.writerow( + [strutils.always_str(x) or "" for x in row] # type: ignore + ) + logger.log(ALERT, "Saved %s rows as CSV." % (len(rows))) + except OSError as e: + logger.error(str(e)) + + @command.command("console.grideditor.editor") + def grideditor_editor(self) -> None: + """ + Spawn an external editor on the current cell. + """ + self._grideditor().cmd_spawn_editor() + + @command.command("console.flowview.mode.set") + @command.argument( + "mode", type=mitmproxy.types.Choice("console.flowview.mode.options") + ) + def flowview_mode_set(self, mode: str) -> None: + """ + Set the display mode for the current flow view. + """ + fv = self.master.window.current_window("flowview") + if not fv: + raise exceptions.CommandError("Not viewing a flow.") + idx = fv.body.tab_offset + + if mode.lower() not in self.flowview_mode_options(): + raise exceptions.CommandError("Invalid flowview mode.") + + try: + self.master.commands.call_strings( + "view.settings.setval", ["@focus", f"flowview_mode_{idx}", mode] + ) + except exceptions.CommandError as e: + logger.error(str(e)) + + @command.command("console.flowview.mode.options") + def flowview_mode_options(self) -> Sequence[str]: + """ + Returns the valid options for the flowview mode. + """ + return contentviews.registry.available_views() + + @command.command("console.flowview.mode") + def flowview_mode(self) -> str: + """ + Get the display mode for the current flow view. + """ + fv = self.master.window.current_window("flowview") + if not fv: + raise exceptions.CommandError("Not viewing a flow.") + idx = fv.body.tab_offset + + return self.master.commands.call_strings( + "view.settings.getval", + [ + "@focus", + f"flowview_mode_{idx}", + self.master.options.console_default_contentview, + ], + ) + + @command.command("console.key.contexts") + def key_contexts(self) -> Sequence[str]: + """ + The available contexts for key binding. + """ + return list(sorted(keymap.Contexts)) + + @command.command("console.key.bind") + def key_bind( + self, + contexts: Sequence[str], + key: str, + cmd: mitmproxy.types.Cmd, + *args: mitmproxy.types.CmdArgs, + ) -> None: + """ + Bind a shortcut key. + """ + try: + self.master.keymap.add(key, cmd + " " + " ".join(args), contexts, "") + except ValueError as v: + raise exceptions.CommandError(v) + + @command.command("console.key.unbind") + def key_unbind(self, contexts: Sequence[str], key: str) -> None: + """ + Un-bind a shortcut key. + """ + try: + self.master.keymap.remove(key, contexts) + except ValueError as v: + raise exceptions.CommandError(v) + + def _keyfocus(self): + kwidget = self.master.window.current("keybindings") + if not kwidget: + raise exceptions.CommandError("Not viewing key bindings.") + f = kwidget.get_focused_binding() + if not f: + raise exceptions.CommandError("No key binding focused") + return f + + @command.command("console.key.unbind.focus") + def key_unbind_focus(self) -> None: + """ + Un-bind the shortcut key currently focused in the key binding viewer. + """ + b = self._keyfocus() + try: + self.master.keymap.remove(b.key, b.contexts) + except ValueError as v: + raise exceptions.CommandError(v) + + @command.command("console.key.execute.focus") + def key_execute_focus(self) -> None: + """ + Execute the currently focused key binding. + """ + b = self._keyfocus() + self.console_command(b.command) + + @command.command("console.key.edit.focus") + def key_edit_focus(self) -> None: + """ + Execute the currently focused key binding. + """ + b = self._keyfocus() + self.console_command( + "console.key.bind", + ",".join(b.contexts), + b.key, + b.command, + ) + + def running(self): + self.started = True + + def update(self, flows) -> None: + if not flows: + signals.update_settings.send() + for f in flows: + signals.flow_change.send(flow=f) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/defaultkeys.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/defaultkeys.py new file mode 100644 index 0000000000000000000000000000000000000000..0ff9d0a291bf968cb8d65c89bb0802ee0c71d536 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/defaultkeys.py @@ -0,0 +1,277 @@ +from mitmproxy.tools.console.keymap import Keymap + + +def map(km: Keymap) -> None: + km.add(":", "console.command ", ["commonkey", "global"], "Command prompt") + km.add( + ";", + "console.command flow.comment @focus ''", + ["flowlist", "flowview"], + "Add comment to flow", + ) + km.add("?", "console.view.help", ["global"], "View help") + km.add("B", "browser.start", ["global"], "Start an attached browser") + km.add("C", "console.view.commands", ["global"], "View commands") + km.add("K", "console.view.keybindings", ["global"], "View key bindings") + km.add("O", "console.view.options", ["commonkey", "global"], "View options") + km.add("E", "console.view.eventlog", ["commonkey", "global"], "View event log") + km.add("Q", "console.exit", ["global"], "Exit immediately") + km.add("q", "console.view.pop", ["commonkey", "global"], "Exit the current view") + km.add("esc", "console.view.pop", ["commonkey", "global"], "Exit the current view") + km.add( + "H", + "set console_quickhelp_visible toggle", + ["global"], + "Toggle quick help bar visibility", + ) + km.add("-", "console.layout.cycle", ["global"], "Cycle to next layout") + km.add("ctrl right", "console.panes.next", ["global"], "Focus next layout pane") + km.add("ctrl left", "console.panes.prev", ["global"], "Focus previous layout pane") + km.add("shift tab", "console.panes.next", ["global"], "Focus next layout pane") + km.add("P", "console.view.flow @focus", ["global"], "View flow details") + + km.add("?", "console.view.pop", ["help"], "Exit help") + + km.add("g", "console.nav.start", ["global"], "Go to start") + km.add("G", "console.nav.end", ["global"], "Go to end") + km.add("k", "console.nav.up", ["global"], "Up") + km.add("j", "console.nav.down", ["global"], "Down") + km.add("l", "console.nav.right", ["global"], "Right") + km.add("h", "console.nav.left", ["global"], "Left") + km.add("tab", "console.nav.next", ["commonkey", "global"], "Next") + km.add("enter", "console.nav.select", ["commonkey", "global"], "Select") + km.add("space", "console.nav.pagedown", ["global"], "Page down") + km.add("ctrl f", "console.nav.pagedown", ["global"], "Page down") + km.add("ctrl b", "console.nav.pageup", ["global"], "Page up") + + km.add( + "I", + "set intercept_active toggle", + ["global"], + "Toggle whether the filtering via the intercept option is enabled", + ) + km.add("i", "console.command.set intercept", ["global"], "Set intercept") + km.add("W", "console.command.set save_stream_file", ["global"], "Stream to file") + km.add( + "A", + "flow.resume @all", + ["flowlist", "flowview"], + "Resume all intercepted flows", + ) + km.add( + "a", + "flow.resume @focus", + ["flowlist", "flowview"], + "Resume this intercepted flow", + ) + km.add( + "b", + "console.command cut.save @focus response.content ", + ["flowlist", "flowview"], + "Save response body to file", + ) + km.add( + "d", + "view.flows.remove @focus", + ["flowlist", "flowview"], + "Delete flow from view", + ) + km.add( + "D", "view.flows.duplicate @focus", ["flowlist", "flowview"], "Duplicate flow" + ) + km.add( + "x", + """ + console.choose.cmd "Export as..." export.formats + console.command export.file {choice} @focus + """, + ["flowlist", "flowview"], + "Export this flow to file", + ) + km.add("f", "console.command.set view_filter", ["flowlist"], "Set view filter") + km.add( + "F", + "set console_focus_follow toggle", + ["flowlist", "flowview"], + "Set focus follow", + ) + km.add( + "ctrl l", + "console.command cut.clip ", + ["flowlist", "flowview"], + "Send cuts to clipboard", + ) + km.add( + "L", "console.command view.flows.load ", ["flowlist"], "Load flows from file" + ) + km.add("m", "flow.mark.toggle @focus", ["flowlist"], "Toggle mark on this flow") + km.add( + "M", + "view.properties.marked.toggle", + ["flowlist"], + "Toggle viewing marked flows", + ) + km.add( + "n", + "console.command view.flows.create get https://example.com/", + ["flowlist"], + "Create a new flow", + ) + km.add( + "o", + """ + console.choose.cmd "Order flows by..." view.order.options + set view_order {choice} + """, + ["flowlist"], + "Set flow list order", + ) + km.add("r", "replay.client @focus", ["flowlist", "flowview"], "Replay this flow") + km.add("S", "console.command replay.server ", ["flowlist"], "Start server replay") + km.add( + "v", "set view_order_reversed toggle", ["flowlist"], "Reverse flow list order" + ) + km.add("U", "flow.mark @all false", ["flowlist"], "Un-set all marks") + km.add( + "w", + "console.command save.file @shown ", + ["flowlist"], + "Save listed flows to file", + ) + km.add( + "V", + "flow.revert @focus", + ["flowlist", "flowview"], + "Revert changes to this flow", + ) + km.add("X", "flow.kill @focus", ["flowlist"], "Kill this flow") + km.add( + "z", + 'console.command.confirm "Delete all flows" view.flows.remove @all', + ["flowlist"], + "Clear flow list", + ) + km.add( + "Z", + 'console.command.confirm "Purge all hidden flows" view.flows.remove @hidden', + ["flowlist"], + "Purge all flows not showing", + ) + km.add( + "|", + "console.command script.run @focus ", + ["flowlist", "flowview"], + "Run a script on this flow", + ) + + km.add( + "e", + """ + console.choose.cmd "Edit..." console.edit.focus.options + console.edit.focus {choice} + """, + ["flowlist", "flowview"], + "Edit a flow component", + ) + km.add( + "f", + "view.settings.setval.toggle @focus fullcontents", + ["flowview"], + "Toggle viewing full contents on this flow", + ) + km.add("w", "console.command save.file @focus ", ["flowview"], "Save flow to file") + km.add("space", "view.focus.next", ["flowview"], "Go to next flow") + + km.add( + "v", + """ + console.choose "View..." request,response + console.bodyview @focus {choice} + """, + ["flowview"], + "View flow body in an external viewer", + ) + km.add("p", "view.focus.prev", ["flowview"], "Go to previous flow") + km.add( + "m", + """ + console.choose.cmd "Set contentview..." console.flowview.mode.options + console.flowview.mode.set {choice} + """, + ["flowview"], + "Set flow view mode", + ) + km.add( + "z", + """ + console.choose "Encode/decode..." request,response + flow.encode.toggle @focus {choice} + """, + ["flowview"], + "Encode/decode flow body", + ) + + km.add("L", "console.command options.load ", ["options"], "Load from file") + km.add("S", "console.command options.save ", ["options"], "Save to file") + km.add("D", "options.reset", ["options"], "Reset all options") + km.add("d", "console.options.reset.focus", ["options"], "Reset this option") + + km.add("a", "console.grideditor.add", ["grideditor"], "Add a row after cursor") + km.add( + "A", "console.grideditor.insert", ["grideditor"], "Insert a row before cursor" + ) + km.add("d", "console.grideditor.delete", ["grideditor"], "Delete this row") + km.add( + "r", + "console.command console.grideditor.load", + ["grideditor"], + "Read unescaped data into the current cell from file", + ) + km.add( + "R", + "console.command console.grideditor.load_escaped", + ["grideditor"], + "Load a Python-style escaped string into the current cell from file", + ) + km.add("e", "console.grideditor.editor", ["grideditor"], "Edit in external editor") + km.add( + "w", + "console.command console.grideditor.save ", + ["grideditor"], + "Save data to file as CSV", + ) + + km.add( + "z", + 'console.command.confirm "Clear event log" eventstore.clear', + ["eventlog"], + "Clear", + ) + + km.add( + "a", + """ + console.choose.cmd "Context" console.key.contexts + console.command console.key.bind {choice} + """, + ["keybindings"], + "Add a key binding", + ) + km.add( + "d", + "console.key.unbind.focus", + ["keybindings"], + "Unbind the currently focused key binding", + ) + km.add( + "x", + "console.key.execute.focus", + ["keybindings"], + "Execute the currently focused key binding", + ) + km.add( + "enter", + "console.key.edit.focus", + ["keybindings"], + "Edit the currently focused key binding", + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/eventlog.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/eventlog.py new file mode 100644 index 0000000000000000000000000000000000000000..92591e45114ff2c84e1a06b13d6c89128a7a541a --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/eventlog.py @@ -0,0 +1,63 @@ +import collections + +import urwid + +from mitmproxy import log +from mitmproxy.tools.console import layoutwidget + + +class LogBufferWalker(urwid.SimpleListWalker): + pass + + +class EventLog(urwid.ListBox, layoutwidget.LayoutWidget): + keyctx = "eventlog" + title = "Events" + + def __init__(self, master): + self.master = master + self.walker = LogBufferWalker(collections.deque(maxlen=self.master.events.size)) + + master.events.sig_add.connect(self.add_event) + master.events.sig_refresh.connect(self.refresh_events) + self.master.options.subscribe( + self.refresh_events, ["console_eventlog_verbosity"] + ) + self.refresh_events() + + super().__init__(self.walker) + + def load(self, loader): + loader.add_option( + "console_focus_follow", bool, False, "Focus follows new flows." + ) + + def set_focus(self, index): + if 0 <= index < len(self.walker): + super().set_focus(index) + + def keypress(self, size, key): + if key == "m_end": + self.set_focus(len(self.walker) - 1) + elif key == "m_start": + self.set_focus(0) + return super().keypress(size, key) + + def add_event(self, entry: log.LogEntry): + if log.log_tier(self.master.options.console_eventlog_verbosity) < log.log_tier( + entry.level + ): + return + txt = f"{entry.level}: {entry.msg}" + if entry.level in ("error", "warn", "alert"): + e = urwid.Text((entry.level, txt)) + else: + e = urwid.Text(txt) + self.walker.append(e) + if self.master.options.console_focus_follow: + self.walker.set_focus(len(self.walker) - 1) + + def refresh_events(self, *_) -> None: + self.walker.clear() + for event in self.master.events.data: + self.add_event(event) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowdetailview.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowdetailview.py new file mode 100644 index 0000000000000000000000000000000000000000..e3a28b91a609c3b55fa271758b0cbb69ceff3497 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowdetailview.py @@ -0,0 +1,149 @@ +import urwid + +import mitmproxy.flow +from mitmproxy import http +from mitmproxy.tools.console import common +from mitmproxy.tools.console import searchable +from mitmproxy.utils import human +from mitmproxy.utils import strutils + + +def maybe_timestamp(base, attr): + if base is not None and getattr(base, attr): + return human.format_timestamp_with_milli(getattr(base, attr)) + else: + # in mitmdump we serialize before a connection is closed. + # loading those flows at a later point shouldn't display "active". + # We also use a ndash (and not a regular dash) so that it is sorted + # after other timestamps. We may need to revisit that in the future if it turns out + # to render ugly in consoles. + return "โ€“" + + +def flowdetails(state, flow: mitmproxy.flow.Flow): + text = [] + + sc = flow.server_conn + cc = flow.client_conn + req: http.Request | None + resp: http.Response | None + if isinstance(flow, http.HTTPFlow): + req = flow.request + resp = flow.response + else: + req = None + resp = None + metadata = flow.metadata + comment = flow.comment + + if comment: + text.append(urwid.Text([("head", "Comment: "), ("text", comment)])) + + if metadata is not None and len(metadata) > 0: + parts = [(str(k), repr(v)) for k, v in metadata.items()] + text.append(urwid.Text([("head", "Metadata:")])) + text.extend(common.format_keyvals(parts, indent=4)) + + if sc is not None and sc.peername: + text.append(urwid.Text([("head", "Server Connection:")])) + parts = [ + ("Address", human.format_address(sc.address)), + ] + if sc.peername: + parts.append(("Resolved Address", human.format_address(sc.peername))) + if resp: + parts.append(("HTTP Version", resp.http_version)) + if sc.alpn: + parts.append(("ALPN", strutils.bytes_to_escaped_str(sc.alpn))) + + text.extend(common.format_keyvals(parts, indent=4)) + + if sc.certificate_list: + c = sc.certificate_list[0] + text.append(urwid.Text([("head", "Server Certificate:")])) + parts = [ + ("Type", "%s, %s bits" % c.keyinfo), + ("SHA256 digest", c.fingerprint().hex(" ")), + ("Valid from", str(c.notbefore)), + ("Valid to", str(c.notafter)), + ("Serial", str(c.serial)), + ( + "Subject", + urwid.Pile( + common.format_keyvals(c.subject, key_format="highlight") + ), + ), + ( + "Issuer", + urwid.Pile(common.format_keyvals(c.issuer, key_format="highlight")), + ), + ] + + if c.altnames: + parts.append(("Alt names", ", ".join(str(x.value) for x in c.altnames))) + text.extend(common.format_keyvals(parts, indent=4)) + + if cc is not None: + text.append(urwid.Text([("head", "Client Connection:")])) + + parts = [ + ("Address", human.format_address(cc.peername)), + ] + if req: + parts.append(("HTTP Version", req.http_version)) + if cc.tls_version: + parts.append(("TLS Version", cc.tls_version)) + if cc.sni: + parts.append(("Server Name Indication", cc.sni)) + if cc.cipher: + parts.append(("Cipher Name", cc.cipher)) + if cc.alpn: + parts.append(("ALPN", strutils.bytes_to_escaped_str(cc.alpn))) + + text.extend(common.format_keyvals(parts, indent=4)) + + parts = [] + + if cc is not None and cc.timestamp_start: + parts.append( + ("Client conn. established", maybe_timestamp(cc, "timestamp_start")) + ) + if cc.tls_established: + parts.append( + ( + "Client conn. TLS handshake", + maybe_timestamp(cc, "timestamp_tls_setup"), + ) + ) + parts.append(("Client conn. closed", maybe_timestamp(cc, "timestamp_end"))) + + if sc is not None and sc.timestamp_start: + parts.append(("Server conn. initiated", maybe_timestamp(sc, "timestamp_start"))) + parts.append( + ("Server conn. TCP handshake", maybe_timestamp(sc, "timestamp_tcp_setup")) + ) + if sc.tls_established: + parts.append( + ( + "Server conn. TLS handshake", + maybe_timestamp(sc, "timestamp_tls_setup"), + ) + ) + parts.append(("Server conn. closed", maybe_timestamp(sc, "timestamp_end"))) + + if req is not None and req.timestamp_start: + parts.append(("First request byte", maybe_timestamp(req, "timestamp_start"))) + parts.append(("Request complete", maybe_timestamp(req, "timestamp_end"))) + + if resp is not None and resp.timestamp_start: + parts.append(("First response byte", maybe_timestamp(resp, "timestamp_start"))) + parts.append(("Response complete", maybe_timestamp(resp, "timestamp_end"))) + + if parts: + # sort operations by timestamp + parts = sorted(parts, key=lambda p: p[1]) + + text.append(urwid.Text([("head", "Timing:")])) + text.extend(common.format_keyvals(parts, indent=4)) + + return searchable.Searchable(text) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowlist.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowlist.py new file mode 100644 index 0000000000000000000000000000000000000000..e9723e24f4efd5262baa8a003b51849eea61899c --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowlist.py @@ -0,0 +1,108 @@ +from functools import lru_cache + +import urwid + +import mitmproxy.tools.console.master +from mitmproxy.tools.console import common +from mitmproxy.tools.console import layoutwidget + + +class FlowItem(urwid.WidgetWrap): + def __init__(self, master, flow): + self.master, self.flow = master, flow + w = self.get_text() + urwid.WidgetWrap.__init__(self, w) + + def get_text(self): + cols, _ = self.master.ui.get_cols_rows() + layout = self.master.options.console_flowlist_layout + if layout == "list" or (layout == "default" and cols < 100): + render_mode = common.RenderMode.LIST + else: + render_mode = common.RenderMode.TABLE + + return common.format_flow( + self.flow, + render_mode=render_mode, + focused=self.flow is self.master.view.focus.flow, + hostheader=self.master.options.showhost, + ) + + def selectable(self): + return True + + def mouse_event(self, size, event, button, col, row, focus): + if event == "mouse press" and button == 1: + self.master.commands.execute("console.view.flow @focus") + return True + + def keypress(self, size, key): + return key + + +class FlowListWalker(urwid.ListWalker): + master: "mitmproxy.tools.console.master.ConsoleMaster" + + def __init__(self, master): + self.master = master + + def positions(self, reverse=False): + # The stub implementation of positions can go once this issue is resolved: + # https://github.com/urwid/urwid/issues/294 + ret = range(self.master.view.get_length()) + if reverse: + return reversed(ret) + return ret + + def view_changed(self): + self._modified() + self._get.cache_clear() + + def get_focus(self): + if not self.master.view.focus.flow: + return None, 0 + f = FlowItem(self.master, self.master.view.focus.flow) + return f, self.master.view.focus.index + + def set_focus(self, index): + if self.master.commands.execute("view.properties.inbounds %d" % index): + self.master.view.focus.index = index + + @lru_cache(maxsize=None) + def _get(self, pos: int) -> tuple[FlowItem | None, int | None]: + if not self.master.view.inbounds(pos): + return None, None + return FlowItem(self.master, self.master.view[pos]), pos + + def get_next(self, pos): + return self._get(pos + 1) + + def get_prev(self, pos): + return self._get(pos - 1) + + +class FlowListBox(urwid.ListBox, layoutwidget.LayoutWidget): + title = "Flows" + keyctx = "flowlist" + + def __init__(self, master: "mitmproxy.tools.console.master.ConsoleMaster") -> None: + self.master: "mitmproxy.tools.console.master.ConsoleMaster" = master + super().__init__(FlowListWalker(master)) + self.master.options.subscribe( + self.set_flowlist_layout, ["console_flowlist_layout"] + ) + + def keypress(self, size, key): + if key == "m_start": + self.master.commands.execute("view.focus.go 0") + elif key == "m_end": + self.master.commands.execute("view.focus.go -1") + elif key == "m_select": + self.master.commands.execute("console.view.flow @focus") + return urwid.ListBox.keypress(self, size, key) + + def view_changed(self): + self.body.view_changed() + + def set_flowlist_layout(self, *_) -> None: + self.master.ui.clear() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowview.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowview.py new file mode 100644 index 0000000000000000000000000000000000000000..e575fb5ddbb2ffe62ac5656d04913c4fdb3cbf5c --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/flowview.py @@ -0,0 +1,497 @@ +import sys +from functools import lru_cache + +import urwid + +import mitmproxy.flow +import mitmproxy.tools.console.master +import mitmproxy_rs.syntax_highlight +from mitmproxy import contentviews +from mitmproxy import ctx +from mitmproxy import dns +from mitmproxy import http +from mitmproxy import tcp +from mitmproxy import udp +from mitmproxy.dns import DNSMessage +from mitmproxy.tools.console import common +from mitmproxy.tools.console import flowdetailview +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import searchable +from mitmproxy.tools.console import tabs +from mitmproxy.utils import strutils + + +class FlowViewHeader(urwid.WidgetWrap): + def __init__( + self, + master: "mitmproxy.tools.console.master.ConsoleMaster", + ) -> None: + self.master = master + self.focus_changed() + + def focus_changed(self): + cols, _ = self.master.ui.get_cols_rows() + if self.master.view.focus.flow: + self._w = common.format_flow( + self.master.view.focus.flow, + render_mode=common.RenderMode.DETAILVIEW, + hostheader=self.master.options.showhost, + ) + else: + self._w = urwid.Pile([]) + + +class FlowDetails(tabs.Tabs): + def __init__(self, master): + self.master = master + super().__init__([]) + self.show() + self.last_displayed_body = None + self.last_displayed_websocket_messages = None + contentviews.registry.on_change.connect(self.contentview_changed) + + @property + def view(self): + return self.master.view + + @property + def flow(self) -> mitmproxy.flow.Flow: + return self.master.view.focus.flow + + def contentview_changed(self, view): + # this is called when a contentview addon is live-reloaded. + # we clear our cache and then rerender + self._get_content_view.cache_clear() + if self.master.window.current_window("flowview"): + self.show() + + def focus_changed(self): + f = self.flow + if f: + if isinstance(f, http.HTTPFlow): + if f.websocket: + self.tabs = [ + (self.tab_http_request, self.view_request), + (self.tab_http_response, self.view_response), + (self.tab_websocket_messages, self.view_websocket_messages), + (self.tab_details, self.view_details), + ] + else: + self.tabs = [ + (self.tab_http_request, self.view_request), + (self.tab_http_response, self.view_response), + (self.tab_details, self.view_details), + ] + elif isinstance(f, tcp.TCPFlow): + self.tabs = [ + (self.tab_tcp_stream, self.view_message_stream), + (self.tab_details, self.view_details), + ] + elif isinstance(f, udp.UDPFlow): + self.tabs = [ + (self.tab_udp_stream, self.view_message_stream), + (self.tab_details, self.view_details), + ] + elif isinstance(f, dns.DNSFlow): + self.tabs = [ + (self.tab_dns_request, self.view_dns_request), + (self.tab_dns_response, self.view_dns_response), + (self.tab_details, self.view_details), + ] + self.show() + else: + # Get the top window from the focus stack (the currently active view). + # If it's NOT the "flowlist", it's safe to pop back to the previous view. + if self.master.window.focus_stack().stack[-1] != "flowlist": + self.master.window.pop() + # If it is the "flowlist", weโ€™re already at the main view with no flows to show. + # Popping now would close the last window and prompt app exit, so we remain on the empty flow list screen instead. + + def tab_http_request(self): + flow = self.flow + assert isinstance(flow, http.HTTPFlow) + if self.flow.intercepted and not flow.response: + return "Request intercepted" + else: + return "Request" + + def tab_http_response(self): + flow = self.flow + assert isinstance(flow, http.HTTPFlow) + + # there is no good way to detect what part of the flow is intercepted, + # so we apply some heuristics to see if it's the HTTP response. + websocket_started = flow.websocket and len(flow.websocket.messages) != 0 + response_is_intercepted = ( + self.flow.intercepted and flow.response and not websocket_started + ) + if response_is_intercepted: + return "Response intercepted" + else: + return "Response" + + def tab_dns_request(self) -> str: + flow = self.flow + assert isinstance(flow, dns.DNSFlow) + if self.flow.intercepted and not flow.response: + return "Request intercepted" + else: + return "Request" + + def tab_dns_response(self) -> str: + flow = self.flow + assert isinstance(flow, dns.DNSFlow) + if self.flow.intercepted and flow.response: + return "Response intercepted" + else: + return "Response" + + def tab_tcp_stream(self): + return "TCP Stream" + + def tab_udp_stream(self): + return "UDP Stream" + + def tab_websocket_messages(self): + flow = self.flow + assert isinstance(flow, http.HTTPFlow) + assert flow.websocket + + if self.flow.intercepted and len(flow.websocket.messages) != 0: + return "WebSocket Messages intercepted" + else: + return "WebSocket Messages" + + def tab_details(self): + return "Detail" + + def view_request(self): + flow = self.flow + assert isinstance(flow, http.HTTPFlow) + return self.conn_text(flow.request) + + def view_response(self): + flow = self.flow + assert isinstance(flow, http.HTTPFlow) + return self.conn_text(flow.response) + + def view_dns_request(self): + flow = self.flow + assert isinstance(flow, dns.DNSFlow) + return self.dns_message_text("request", flow.request) + + def view_dns_response(self): + flow = self.flow + assert isinstance(flow, dns.DNSFlow) + return self.dns_message_text("response", flow.response) + + def _contentview_status_bar(self, description: str, viewmode: str): + cols = [ + urwid.Text( + [ + ("heading", description), + ] + ), + urwid.Text( + [ + " ", + ("heading", "["), + ("heading_key", "m"), + ("heading", (":%s]" % viewmode)), + ], + align="right", + ), + ] + contentview_status_bar = urwid.AttrMap(urwid.Columns(cols), "heading") + return contentview_status_bar + + FROM_CLIENT_MARKER = ("from_client", f"{common.SYMBOL_FROM_CLIENT} ") + TO_CLIENT_MARKER = ("to_client", f"{common.SYMBOL_TO_CLIENT} ") + + def view_websocket_messages(self): + flow = self.flow + assert isinstance(flow, http.HTTPFlow) + assert flow.websocket is not None + + if not flow.websocket.messages: + return searchable.Searchable([urwid.Text(("highlight", "No messages."))]) + + viewmode = self.master.commands.call("console.flowview.mode") + + widget_lines = [] + for m in flow.websocket.messages: + pretty = contentviews.prettify_message(m, flow, viewmode) + chunks = mitmproxy_rs.syntax_highlight.highlight( + pretty.text, + language=pretty.syntax_highlight, + ) + if m.from_client: + marker = self.FROM_CLIENT_MARKER + else: + marker = self.TO_CLIENT_MARKER + widget_lines.append(urwid.Text([marker, *chunks])) + + if flow.websocket.closed_by_client is not None: + widget_lines.append( + urwid.Text( + [ + ( + self.FROM_CLIENT_MARKER + if flow.websocket.closed_by_client + else self.TO_CLIENT_MARKER + ), + ( + "alert" + if flow.websocket.close_code in (1000, 1001, 1005) + else "error", + f"Connection closed: {flow.websocket.close_code} {flow.websocket.close_reason}", + ), + ] + ) + ) + + if flow.intercepted: + markup = widget_lines[-1].get_text()[0] + widget_lines[-1].set_text(("intercept", markup)) + + widget_lines.insert( + 0, self._contentview_status_bar(viewmode.capitalize(), viewmode) + ) + + if (last_view := self.last_displayed_websocket_messages) is not None: + last_view.walker[:] = widget_lines + view = last_view + else: + view = searchable.Searchable(widget_lines) + self.last_displayed_websocket_messages = view + + return view + + def view_message_stream(self) -> urwid.Widget: + flow = self.flow + assert isinstance(flow, (tcp.TCPFlow, udp.UDPFlow)) + + if not flow.messages: + return searchable.Searchable([urwid.Text(("highlight", "No messages."))]) + + viewmode = self.master.commands.call("console.flowview.mode") + + widget_lines = [] + for m in flow.messages: + if m.from_client: + marker = self.FROM_CLIENT_MARKER + else: + marker = self.TO_CLIENT_MARKER + pretty = contentviews.prettify_message(m, flow, viewmode) + chunks = mitmproxy_rs.syntax_highlight.highlight( + pretty.text, + language=pretty.syntax_highlight, + ) + + widget_lines.append(urwid.Text([marker, *chunks])) + + if flow.intercepted: + markup = widget_lines[-1].get_text()[0] + widget_lines[-1].set_text(("intercept", markup)) + + widget_lines.insert( + 0, self._contentview_status_bar(viewmode.capitalize(), viewmode) + ) + + return searchable.Searchable(widget_lines) + + def view_details(self): + return flowdetailview.flowdetails(self.view, self.flow) + + def content_view( + self, viewmode: str, message: http.Message + ) -> tuple[str, list[urwid.Text]]: + if message.raw_content is None: + return "", [urwid.Text([("error", "[content missing]")])] + + if message.raw_content == b"": + if isinstance(message, http.Request): + query = getattr(message, "query", "") + if not query: + # No body and no query params + return "", [urwid.Text("No request content")] + # else: there are query params -> fall through to render them + else: + return "", [urwid.Text("No content")] + + full = self.master.commands.execute( + "view.settings.getval @focus fullcontents false" + ) + + if full == "true": + limit = sys.maxsize + else: + limit = ctx.options.content_view_lines_cutoff + + flow_modify_cache_invalidation = hash( + ( + message.raw_content, + message.headers.fields, + getattr(message, "path", None), + ) + ) + # we need to pass the message off-band because it's not hashable + self._get_content_view_message = message + return self._get_content_view(viewmode, limit, flow_modify_cache_invalidation) + + @lru_cache(maxsize=200) + def _get_content_view( + self, viewmode: str, max_lines: int, _ + ) -> tuple[str, list[urwid.Text]]: + message: http.Message = self._get_content_view_message + self._get_content_view_message = None # type: ignore[assignment] + + pretty = contentviews.prettify_message(message, self.flow, viewmode) + cut_off = strutils.cut_after_n_lines(pretty.text, max_lines) + + chunks = mitmproxy_rs.syntax_highlight.highlight( + cut_off, + language=pretty.syntax_highlight, + ) + + text_objects = [urwid.Text(chunks)] + if len(cut_off) < len(pretty.text): + text_objects.append( + urwid.Text( + [ + ( + "highlight", + "Stopped displaying data after %d lines. Press " + % max_lines, + ), + ("key", "f"), + ("highlight", " to load all data."), + ] + ) + ) + + return f"{pretty.view_name} {pretty.description}", text_objects + + def conn_text(self, conn): + if conn: + hdrs = [] + for k, v in conn.headers.fields: + # This will always force an ascii representation of headers. For example, if the server sends a + # + # X-Authors: Made with โค in Hamburg + # + # header, mitmproxy will display the following: + # + # X-Authors: Made with \xe2\x9d\xa4 in Hamburg. + # + # The alternative would be to just use the header's UTF-8 representation and maybe + # do `str.replace("\t", "\\t")` to exempt tabs from urwid's special characters escaping [1]. + # That would in some terminals allow rendering UTF-8 characters, but the mapping + # wouldn't be bijective, i.e. a user couldn't distinguish "\\t" and "\t". + # Also, from a security perspective, a mitmproxy user couldn't be fooled by homoglyphs. + # + # 1) https://github.com/mitmproxy/mitmproxy/issues/1833 + # https://github.com/urwid/urwid/blob/6608ee2c9932d264abd1171468d833b7a4082e13/urwid/display_common.py#L35-L36, + + k = strutils.bytes_to_escaped_str(k) + ":" + v = strutils.bytes_to_escaped_str(v) + hdrs.append((k, v)) + txt = common.format_keyvals(hdrs, key_format="header") + viewmode = self.master.commands.call("console.flowview.mode") + msg, body = self.content_view(viewmode, conn) + + txt.append(self._contentview_status_bar(msg, viewmode)) + txt.extend(body) + else: + txt = [ + urwid.Text(""), + urwid.Text( + [ + ("highlight", "No response. Press "), + ("key", "e"), + ("highlight", " and edit any aspect to add one."), + ] + ), + ] + return searchable.Searchable(txt) + + def dns_message_text( + self, type: str, message: DNSMessage | None + ) -> searchable.Searchable: + """ + Alternative: + if not message: + return searchable.Searchable([urwid.Text(("highlight", f"No {typ}."))]) + + viewmode = self.master.commands.call("console.flowview.mode") + pretty = contentviews.prettify_message(message, flow, viewmode) + chunks = mitmproxy_rs.syntax_highlight.highlight( + pretty.text, + language=pretty.syntax_highlight, + ) + + widget_lines = [ + self._contentview_status_bar(viewmode.capitalize(), viewmode), + urwid.Text(chunks) + ] + return searchable.Searchable(widget_lines) + """ + # Keep in sync with web/src/js/components/FlowView/DnsMessages.tsx + if message: + + def rr_text(rr: dns.ResourceRecord): + return urwid.Text( + f" {rr.name} {dns.types.to_str(rr.type)} {dns.classes.to_str(rr.class_)} {rr.ttl} {rr}" + ) + + txt = [] + txt.append( + urwid.Text( + "{recursive}Question".format( + recursive="Recursive " if message.recursion_desired else "", + ) + ) + ) + txt.extend( + urwid.Text( + f" {q.name} {dns.types.to_str(q.type)} {dns.classes.to_str(q.class_)}" + ) + for q in message.questions + ) + txt.append(urwid.Text("")) + txt.append( + urwid.Text( + "{authoritative}{recursive}Answer".format( + authoritative="Authoritative " + if message.authoritative_answer + else "", + recursive="Recursive " if message.recursion_available else "", + ) + ) + ) + txt.extend(map(rr_text, message.answers)) + txt.append(urwid.Text("")) + txt.append(urwid.Text("Authority")) + txt.extend(map(rr_text, message.authorities)) + txt.append(urwid.Text("")) + txt.append(urwid.Text("Addition")) + txt.extend(map(rr_text, message.additionals)) + return searchable.Searchable(txt) + else: + return searchable.Searchable([urwid.Text(("highlight", f"No {type}."))]) + + +class FlowView(urwid.Frame, layoutwidget.LayoutWidget): + keyctx = "flowview" + title = "Flow Details" + + def __init__(self, master): + super().__init__( + FlowDetails(master), + header=FlowViewHeader(master), + ) + self.master = master + + def focus_changed(self, *args, **kwargs): + self.body.focus_changed() + self.header.focus_changed() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dd062dbe4df67abeffdac3c167f4ebe9f4f06277 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__init__.py @@ -0,0 +1,29 @@ +from . import base +from .editors import CommentEditor +from .editors import CookieAttributeEditor +from .editors import CookieEditor +from .editors import DataViewer +from .editors import OptionsEditor +from .editors import PathEditor +from .editors import QueryEditor +from .editors import RequestHeaderEditor +from .editors import RequestMultipartEditor +from .editors import RequestUrlEncodedEditor +from .editors import ResponseHeaderEditor +from .editors import SetCookieEditor + +__all__ = [ + "base", + "QueryEditor", + "RequestHeaderEditor", + "ResponseHeaderEditor", + "RequestMultipartEditor", + "RequestUrlEncodedEditor", + "PathEditor", + "CookieEditor", + "CookieAttributeEditor", + "SetCookieEditor", + "CommentEditor", + "OptionsEditor", + "DataViewer", +] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6a460cfa5c490eb2ff19837f018fcfb00002e45 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/base.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/base.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..003005e6a33844f3fa5da8b3d1721933669d62fa Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/base.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_bytes.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_bytes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5760e2bae3e7429f837bd9539a2728ad3e8d46f Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_bytes.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_subgrid.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_subgrid.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f392e112069363cc6090e763dfa7236b6bce2171 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_subgrid.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_text.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_text.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ec47f96947ffb811e352740d68a48218f8da9b7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_text.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_viewany.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_viewany.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edaab860608155298bdf92b410d0421e5e60aed9 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/col_viewany.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/editors.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/editors.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d76be0f3277cc15506a0a0a0aecfde6d7016be0 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/__pycache__/editors.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/base.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/base.py new file mode 100644 index 0000000000000000000000000000000000000000..63150713ef812d3a2852c7e8aa3a3a56c0e17178 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/base.py @@ -0,0 +1,469 @@ +import abc +import copy +import os +from collections.abc import Callable +from collections.abc import Container +from collections.abc import Iterable +from collections.abc import MutableSequence +from collections.abc import Sequence +from typing import Any +from typing import ClassVar +from typing import Literal +from typing import overload + +import urwid + +import mitmproxy.tools.console.master +from mitmproxy import exceptions +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import signals +from mitmproxy.utils import strutils + + +@overload +def read_file(filename: str, escaped: Literal[True]) -> bytes: ... + + +@overload +def read_file(filename: str, escaped: Literal[False]) -> str: ... + + +def read_file(filename: str, escaped: bool) -> bytes | str: + filename = os.path.expanduser(filename) + try: + with open(filename, "r" if escaped else "rb") as f: + d = f.read() + except OSError as v: + raise exceptions.CommandError(v) + if escaped: + try: + d = strutils.escaped_str_to_bytes(d) + except ValueError: + raise exceptions.CommandError("Invalid Python-style string encoding.") + return d + + +class Cell(urwid.WidgetWrap): + def get_data(self): + """ + Raises: + ValueError, if the current content is invalid. + """ + raise NotImplementedError() + + def selectable(self): + return True + + +class Column(metaclass=abc.ABCMeta): + subeditor: urwid.Edit = None + + def __init__(self, heading): + self.heading = heading + + @abc.abstractmethod + def Display(self, data) -> Cell: + pass + + @abc.abstractmethod + def Edit(self, data) -> Cell: + pass + + @abc.abstractmethod + def blank(self) -> Any: + pass + + def keypress(self, key: str, editor: "GridEditor") -> str | None: + return key + + +class GridRow(urwid.WidgetWrap): + def __init__( + self, + focused: int | None, + editing: bool, + editor: "GridEditor", + values: tuple[Iterable[bytes], Container[int]], + ) -> None: + self.focused = focused + self.editor = editor + self.edit_col: Cell | None = None + + errors = values[1] + self.fields: Sequence[Any] = [] + for i, v in enumerate(values[0]): + if focused == i and editing: + self.edit_col = self.editor.columns[i].Edit(v) + self.fields.append(self.edit_col) + else: + w = self.editor.columns[i].Display(v) + if focused == i: + if i in errors: + w = urwid.AttrMap(w, "focusfield_error") + else: + w = urwid.AttrMap(w, "focusfield") + elif i in errors: + w = urwid.AttrMap(w, "field_error") + self.fields.append(w) + + fspecs = self.fields[:] + if len(self.fields) > 1: + fspecs[0] = ("fixed", self.editor.first_width + 2, fspecs[0]) + w = urwid.Columns(fspecs, dividechars=2) + if focused is not None: + w.focus_position = focused + super().__init__(w) + + def keypress(self, s, k): + if self.edit_col: + w = self._w.column_widths(s)[self.focused] + k = self.edit_col.keypress((w,), k) + return k + + def selectable(self): + return True + + +class GridWalker(urwid.ListWalker): + """ + Stores rows as a list of (rows, errors) tuples, where rows is a list + and errors is a set with an entry of each offset in rows that is an + error. + """ + + def __init__(self, lst: Iterable[list], editor: "GridEditor") -> None: + self.lst: MutableSequence[tuple[Any, set]] = [(i, set()) for i in lst] + self.editor = editor + self.focus = 0 + self.focus_col = 0 + self.edit_row: GridRow | None = None + + def _modified(self): + self.editor.show_empty_msg() + return super()._modified() + + def add_value(self, lst): + self.lst.append((lst[:], set())) + self._modified() + + def get_current_value(self): + if self.lst: + return self.lst[self.focus][0][self.focus_col] + + def set_current_value(self, val) -> None: + errors = self.lst[self.focus][1] + emsg = self.editor.is_error(self.focus_col, val) + if emsg: + signals.status_message.send(message=emsg) + errors.add(self.focus_col) + else: + errors.discard(self.focus_col) + self.set_value(val, self.focus, self.focus_col, errors) + + def set_value(self, val, focus, focus_col, errors=None): + if not errors: + errors = set() + row = list(self.lst[focus][0]) + row[focus_col] = val + self.lst[focus] = [tuple(row), errors] # type: ignore + self._modified() + + def delete_focus(self): + if self.lst: + del self.lst[self.focus] + self.focus = min(len(self.lst) - 1, self.focus) + self._modified() + + def _insert(self, pos): + self.focus = pos + self.lst.insert(self.focus, ([c.blank() for c in self.editor.columns], set())) + self.focus_col = 0 + self.start_edit() + + def insert(self): + return self._insert(self.focus) + + def add(self): + return self._insert(min(self.focus + 1, len(self.lst))) + + def start_edit(self): + col = self.editor.columns[self.focus_col] + if self.lst and not col.subeditor: + self.edit_row = GridRow( + self.focus_col, True, self.editor, self.lst[self.focus] + ) + self._modified() + + def stop_edit(self): + if self.edit_row and self.edit_row.edit_col: + try: + val = self.edit_row.edit_col.get_data() + except ValueError: + return + self.edit_row = None + self.set_current_value(val) + + def left(self): + self.focus_col = max(self.focus_col - 1, 0) + self._modified() + + def right(self): + self.focus_col = min(self.focus_col + 1, len(self.editor.columns) - 1) + self._modified() + + def tab_next(self): + self.stop_edit() + if self.focus_col < len(self.editor.columns) - 1: + self.focus_col += 1 + elif self.focus != len(self.lst) - 1: + self.focus_col = 0 + self.focus += 1 + self._modified() + + def get_focus(self): + if self.edit_row: + return self.edit_row, self.focus + elif self.lst: + return ( + GridRow(self.focus_col, False, self.editor, self.lst[self.focus]), + self.focus, + ) + else: + return None, None + + def set_focus(self, focus): + self.stop_edit() + self.focus = focus + self._modified() + + def get_next(self, pos): + if pos + 1 >= len(self.lst): + return None, None + return GridRow(None, False, self.editor, self.lst[pos + 1]), pos + 1 + + def get_prev(self, pos): + if pos - 1 < 0: + return None, None + return GridRow(None, False, self.editor, self.lst[pos - 1]), pos - 1 + + +class GridListBox(urwid.ListBox): + def __init__(self, lw): + super().__init__(lw) + + +FIRST_WIDTH_MAX = 40 + + +class BaseGridEditor(urwid.WidgetWrap): + title: str = "" + keyctx: ClassVar[str] = "grideditor" + + def __init__( + self, + master: "mitmproxy.tools.console.master.ConsoleMaster", + title, + columns, + value: Any, + callback: Callable[..., None], + *cb_args, + **cb_kwargs, + ) -> None: + value = self.data_in(copy.deepcopy(value)) + self.master = master + self.title = title + self.columns = columns + self.value = value + self.callback = callback + self.cb_args = cb_args + self.cb_kwargs = cb_kwargs + + first_width = 20 + if value: + for r in value: + assert len(r) == len(self.columns) + first_width = max(len(r), first_width) + self.first_width = min(first_width, FIRST_WIDTH_MAX) + + h = None + if any(col.heading for col in self.columns): + headings = [] + for i, col in enumerate(self.columns): + c = urwid.Text(col.heading) + if i == 0 and len(self.columns) > 1: + headings.append(("fixed", first_width + 2, c)) + else: + headings.append(c) + h = urwid.Columns(headings, dividechars=2) + h = urwid.AttrMap(h, "heading") + + self.walker = GridWalker(self.value, self) + self.lb = GridListBox(self.walker) + w = urwid.Frame(self.lb, header=h) + + super().__init__(w) + self.show_empty_msg() + + def layout_popping(self): + res = [] + for i in self.walker.lst: + if not i[1] and any([x for x in i[0]]): + res.append(i[0]) + self.callback(self.data_out(res), *self.cb_args, **self.cb_kwargs) + + def show_empty_msg(self): + if self.walker.lst: + self._w.footer = None + else: + self._w.footer = urwid.Text( + [ + ("highlight", "No values - you should add some. Press "), + ("key", "?"), + ("highlight", " for help."), + ] + ) + + def set_subeditor_value(self, val, focus, focus_col): + self.walker.set_value(val, focus, focus_col) + + def keypress(self, size, key): + if self.walker.edit_row: + if key == "esc": + self.walker.stop_edit() + elif key == "tab": + pf, pfc = self.walker.focus, self.walker.focus_col + self.walker.tab_next() + if self.walker.focus == pf and self.walker.focus_col != pfc: + self.walker.start_edit() + else: + self._w.keypress(size, key) + return None + + column = self.columns[self.walker.focus_col] + if key == "m_start": + self.walker.set_focus(0) + elif key == "m_next": + self.walker.tab_next() + elif key == "m_end": + self.walker.set_focus(len(self.walker.lst) - 1) + elif key == "left": + self.walker.left() + elif key == "right": + self.walker.right() + elif column.keypress(key, self) and not self.handle_key(key): + return self._w.keypress(size, key) + + def data_out(self, data: Sequence[list]) -> Any: + """ + Called on raw list data, before data is returned through the + callback. + """ + return data + + def data_in(self, data: Any) -> Iterable[list]: + """ + Called to prepare provided data. + """ + return data + + def is_error(self, col: int, val: Any) -> str | None: + """ + Return None, or a string error message. + """ + return None + + def handle_key(self, key): + if key == "?": + signals.pop_view_state.send() + return False + + def cmd_add(self): + self.walker.add() + + def cmd_insert(self): + self.walker.insert() + + def cmd_delete(self): + self.walker.delete_focus() + + def cmd_read_file(self, path): + self.walker.set_current_value(read_file(path, False)) + + def cmd_read_file_escaped(self, path): + self.walker.set_current_value(read_file(path, True)) + + def cmd_spawn_editor(self): + o = self.walker.get_current_value() + if o is not None: + n = self.master.spawn_editor(o) + n = strutils.clean_hanging_newline(n) + self.walker.set_current_value(n) + + +class GridEditor(BaseGridEditor): + title = "" + columns: Sequence[Column] = () + keyctx: ClassVar[str] = "grideditor" + + def __init__( + self, + master: "mitmproxy.tools.console.master.ConsoleMaster", + value: Any, + callback: Callable[..., None], + *cb_args, + **cb_kwargs, + ) -> None: + super().__init__( + master, self.title, self.columns, value, callback, *cb_args, **cb_kwargs + ) + + +class FocusEditor(urwid.WidgetWrap, layoutwidget.LayoutWidget): + """ + A specialised GridEditor that edits the current focused flow. + """ + + keyctx: ClassVar[str] = "grideditor" + + def __init__(self, master): + self.master = master + + def call(self, v, name, *args, **kwargs): + f = getattr(v, name, None) + if f: + f(*args, **kwargs) + + def get_data(self, flow): + """ + Retrieve the data to edit from the current flow. + """ + raise NotImplementedError + + def set_data(self, vals, flow): + """ + Set the current data on the flow. + """ + raise NotImplementedError + + def set_data_update(self, vals, flow) -> None: + self.set_data(vals, flow) + signals.flow_change.send(flow=flow) + + def key_responder(self): + return self._w + + def layout_popping(self): + self.call(self._w, "layout_popping") + + def layout_pushed(self, prev): + if self.master.view.focus.flow: + self._w = BaseGridEditor( + self.master, + self.title, + self.columns, + self.get_data(self.master.view.focus.flow), + self.set_data_update, + self.master.view.focus.flow, + ) + else: + self._w = urwid.Pile([]) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_bytes.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_bytes.py new file mode 100644 index 0000000000000000000000000000000000000000..0ac4a7ed1c11ebe08040ad16f9a6e31897cac566 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_bytes.py @@ -0,0 +1,49 @@ +import urwid + +from mitmproxy.tools.console import signals +from mitmproxy.tools.console.grideditor import base +from mitmproxy.utils import strutils + + +class Column(base.Column): + def Display(self, data): + return Display(data) + + def Edit(self, data): + return Edit(data) + + def blank(self): + return b"" + + def keypress(self, key, editor): + if key in ["m_select"]: + editor.walker.start_edit() + else: + return key + + +class Display(base.Cell): + def __init__(self, data: bytes) -> None: + self.data = data + escaped = strutils.bytes_to_escaped_str(data) + w = urwid.Text(escaped, wrap="any") + super().__init__(w) + + def get_data(self) -> bytes: + return self.data + + +class Edit(base.Cell): + def __init__(self, data: bytes) -> None: + d = strutils.bytes_to_escaped_str(data) + w = urwid.Edit(edit_text=d, wrap="any", multiline=True) + w = urwid.AttrMap(w, "editfield") + super().__init__(w) + + def get_data(self) -> bytes: + txt = self._w.base_widget.get_text()[0].strip() + try: + return strutils.escaped_str_to_bytes(txt) + except ValueError: + signals.status_message.send(message="Invalid data.") + raise diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_subgrid.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_subgrid.py new file mode 100644 index 0000000000000000000000000000000000000000..17887b1af22529bdd2e4c60506e8db98ff756454 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_subgrid.py @@ -0,0 +1,40 @@ +import urwid + +from mitmproxy.net.http import cookies +from mitmproxy.tools.console import signals +from mitmproxy.tools.console.grideditor import base + + +class Column(base.Column): + def __init__(self, heading, subeditor): + super().__init__(heading) + self.subeditor = subeditor + + def Edit(self, data): + raise RuntimeError("SubgridColumn should handle edits itself") + + def Display(self, data): + return Display(data) + + def blank(self): + return [] + + def keypress(self, key: str, editor): + if key in "rRe": + signals.status_message.send(message="Press enter to edit this field.") + return + elif key == "m_select": + self.subeditor.grideditor = editor + editor.master.switch_view("edit_focus_setcookie_attrs") + else: + return key + + +class Display(base.Cell): + def __init__(self, data): + p = cookies._format_pairs(data, sep="\n") + w = urwid.Text(p) + super().__init__(w) + + def get_data(self): + pass diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_text.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_text.py new file mode 100644 index 0000000000000000000000000000000000000000..d5ad1cba034de74cfbc97cc7e1fdeaa5dad88d0c --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_text.py @@ -0,0 +1,48 @@ +""" +Welcome to the encoding dance! + +In a nutshell, text columns are actually a proxy class for byte columns, +which just encode/decodes contents. +""" + +from mitmproxy.tools.console import signals +from mitmproxy.tools.console.grideditor import col_bytes + + +class Column(col_bytes.Column): + def __init__(self, heading, encoding="utf8", errors="surrogateescape"): + super().__init__(heading) + self.encoding_args = encoding, errors + + def Display(self, data): + return TDisplay(data, self.encoding_args) + + def Edit(self, data): + return TEdit(data, self.encoding_args) + + def blank(self): + return "" + + +# This is the same for both edit and display. +class EncodingMixin: + def __init__(self, data, encoding_args): + self.encoding_args = encoding_args + super().__init__(str(data).encode(*self.encoding_args)) # type: ignore + + def get_data(self): + data = super().get_data() # type: ignore + try: + return data.decode(*self.encoding_args) + except ValueError: + signals.status_message.send(message="Invalid encoding.") + raise + + +# urwid forces a different name for a subclass. +class TDisplay(EncodingMixin, col_bytes.Display): + pass + + +class TEdit(EncodingMixin, col_bytes.Edit): + pass diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_viewany.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_viewany.py new file mode 100644 index 0000000000000000000000000000000000000000..50ffe2a7d35815bc46dce21cdb70d2cd737ce203 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/col_viewany.py @@ -0,0 +1,34 @@ +""" +A display-only column that displays any data type. +""" + +from typing import Any + +import urwid + +from mitmproxy.tools.console.grideditor import base +from mitmproxy.utils import strutils + + +class Column(base.Column): + def Display(self, data): + return Display(data) + + Edit = Display + + def blank(self): + return "" + + +class Display(base.Cell): + def __init__(self, data: Any) -> None: + self.data = data + if isinstance(data, bytes): + data = strutils.bytes_to_escaped_str(data) + if not isinstance(data, str): + data = repr(data) + w = urwid.Text(data, wrap="any") + super().__init__(w) + + def get_data(self) -> Any: + return self.data diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/editors.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/editors.py new file mode 100644 index 0000000000000000000000000000000000000000..f5372dcfe825dd2f620a00dcbf274ff5611fd0e0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/grideditor/editors.py @@ -0,0 +1,220 @@ +from typing import Any + +import urwid + +from mitmproxy import exceptions +from mitmproxy.http import Headers +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import signals +from mitmproxy.tools.console.grideditor import base +from mitmproxy.tools.console.grideditor import col_bytes +from mitmproxy.tools.console.grideditor import col_subgrid +from mitmproxy.tools.console.grideditor import col_text +from mitmproxy.tools.console.grideditor import col_viewany + + +class QueryEditor(base.FocusEditor): + title = "Edit Query" + columns = [col_text.Column("Key"), col_text.Column("Value")] + + def get_data(self, flow): + return flow.request.query.items(multi=True) + + def set_data(self, vals, flow): + flow.request.query = vals + + +class HeaderEditor(base.FocusEditor): + columns = [col_bytes.Column("Key"), col_bytes.Column("Value")] + + +class RequestHeaderEditor(HeaderEditor): + title = "Edit Request Headers" + + def get_data(self, flow): + return flow.request.headers.fields + + def set_data(self, vals, flow): + flow.request.headers = Headers(vals) + + +class ResponseHeaderEditor(HeaderEditor): + title = "Edit Response Headers" + + def get_data(self, flow): + return flow.response.headers.fields + + def set_data(self, vals, flow): + flow.response.headers = Headers(vals) + + +class RequestMultipartEditor(base.FocusEditor): + title = "Edit Multipart Form" + columns = [col_bytes.Column("Key"), col_bytes.Column("Value")] + + def get_data(self, flow): + return flow.request.multipart_form.items(multi=True) + + def set_data(self, vals, flow): + flow.request.multipart_form = vals + + +class RequestUrlEncodedEditor(base.FocusEditor): + title = "Edit UrlEncoded Form" + columns = [col_text.Column("Key"), col_text.Column("Value")] + + def get_data(self, flow): + return flow.request.urlencoded_form.items(multi=True) + + def set_data(self, vals, flow): + flow.request.urlencoded_form = vals + + +class PathEditor(base.FocusEditor): + # TODO: Next row on enter? + title = "Edit Path Components" + columns = [ + col_text.Column("Component"), + ] + + def data_in(self, data): + return [[i] for i in data] + + def data_out(self, data): + return [i[0] for i in data] + + def get_data(self, flow): + return self.data_in(flow.request.path_components) + + def set_data(self, vals, flow): + flow.request.path_components = self.data_out(vals) + + +class CommentEditor(base.FocusEditor): + title = "Edit Comment" + columns = [col_text.Column("Value")] + + def get_data(self, flow): + return [[flow.comment or ""]] + + def set_data(self, vals, flow): + flow.comment = vals[0][0] if vals and vals[0] else "" + + +class CookieEditor(base.FocusEditor): + title = "Edit Cookies" + columns = [ + col_text.Column("Name"), + col_text.Column("Value"), + ] + + def get_data(self, flow): + return flow.request.cookies.items(multi=True) + + def set_data(self, vals, flow): + flow.request.cookies = vals + + +class CookieAttributeEditor(base.FocusEditor): + title = "Editing Set-Cookie attributes" + columns = [ + col_text.Column("Name"), + col_text.Column("Value"), + ] + grideditor: base.BaseGridEditor + + def data_in(self, data): + return [(k, v or "") for k, v in data] + + def data_out(self, data): + ret = [] + for i in data: + if not i[1]: + ret.append([i[0], None]) + else: + ret.append(i) + return ret + + def layout_pushed(self, prev): + if self.grideditor.master.view.focus.flow: + self._w = base.BaseGridEditor( + self.grideditor.master, + self.title, + self.columns, + self.grideditor.walker.get_current_value(), + self.grideditor.set_subeditor_value, + self.grideditor.walker.focus, + self.grideditor.walker.focus_col, + ) + else: + self._w = urwid.Pile([]) + + +class SetCookieEditor(base.FocusEditor): + title = "Edit SetCookie Header" + columns = [ + col_text.Column("Name"), + col_text.Column("Value"), + col_subgrid.Column("Attributes", CookieAttributeEditor), + ] + + def data_in(self, data): + flattened = [] + for key, (value, attrs) in data: + flattened.append([key, value, attrs.items(multi=True)]) + return flattened + + def data_out(self, data): + vals = [] + for key, value, attrs in data: + vals.append([key, (value, attrs)]) + return vals + + def get_data(self, flow): + return self.data_in(flow.response.cookies.items(multi=True)) + + def set_data(self, vals, flow): + flow.response.cookies = self.data_out(vals) + + +class OptionsEditor(base.GridEditor, layoutwidget.LayoutWidget): + title = "" + columns = [col_text.Column("")] + + def __init__(self, master, name, vals): + self.name = name + super().__init__(master, [[i] for i in vals], self.callback) + + def callback(self, vals) -> None: + try: + setattr(self.master.options, self.name, [i[0] for i in vals]) + except exceptions.OptionsError as v: + signals.status_message.send(message=str(v)) + + def is_error(self, col, val): + pass + + +class DataViewer(base.GridEditor, layoutwidget.LayoutWidget): + title = "" + + def __init__( + self, + master, + vals: (list[list[Any]] | list[Any] | Any), + ) -> None: + if vals is not None: + # Whatever vals is, make it a list of rows containing lists of column values. + if not isinstance(vals, list): + vals = [vals] + if not isinstance(vals[0], list): + vals = [[i] for i in vals] + + self.columns = [col_viewany.Column("")] * len(vals[0]) + super().__init__(master, vals, self.callback) + + def callback(self, vals): + pass + + def is_error(self, col, val): + pass diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/help.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/help.py new file mode 100644 index 0000000000000000000000000000000000000000..55e7bf36d60ce75f887f554f85a0f8da389c6b64 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/help.py @@ -0,0 +1,113 @@ +import urwid + +from mitmproxy import flowfilter +from mitmproxy.tools.console import common +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import tabs + + +class CListBox(urwid.ListBox): + def __init__(self, contents): + self.length = len(contents) + contents = contents[:] + [urwid.Text(["\n"])] * 5 + super().__init__(contents) + + def keypress(self, size, key): + if key == "m_end": + self.set_focus(self.length - 1) + elif key == "m_start": + self.set_focus(0) + else: + return super().keypress(size, key) + + +class HelpView(tabs.Tabs, layoutwidget.LayoutWidget): + title = "Help" + keyctx = "help" + + def __init__(self, master): + self.master = master + self.helpctx = "" + super().__init__( + [ + [self.keybindings_title, self.keybindings], + [self.filtexp_title, self.filtexp], + ] + ) + + def keybindings_title(self): + return "Key Bindings" + + def format_keys(self, binds): + kvs = [] + for b in binds: + k = b.key + if b.key == " ": + k = "space" + kvs.append((k, b.help or b.command)) + return common.format_keyvals(kvs) + + def keybindings(self): + text = [urwid.Text([("title", "Common Keybindings")])] + + text.extend(self.format_keys(self.master.keymap.list("commonkey"))) + + text.append(urwid.Text(["\n", ("title", "Keybindings for this view")])) + if self.helpctx: + text.extend(self.format_keys(self.master.keymap.list(self.helpctx))) + + text.append( + urwid.Text( + [ + "\n", + ("title", "Global Keybindings"), + ] + ) + ) + + text.extend(self.format_keys(self.master.keymap.list("global"))) + + return CListBox(text) + + def filtexp_title(self): + return "Filter Expressions" + + def filtexp(self): + text = [] + text.extend(common.format_keyvals(flowfilter.help, indent=4)) + text.append( + urwid.Text( + [ + "\n", + ("text", " Regexes are Python-style.\n"), + ("text", " Regexes can be specified as quoted strings.\n"), + ( + "text", + ' Header matching (~h, ~hq, ~hs) is against a string of the form "name: value".\n', + ), + ( + "text", + " Expressions with no operators are regex matches against URL.\n", + ), + ("text", " Default binary operator is &.\n"), + ("head", "\n Examples:\n"), + ] + ) + ) + examples = [ + (r"google\.com", r"Url containing \"google.com"), + ("~q ~b test", r"Requests where body contains \"test\""), + ( + r"!(~q & ~t \"text/html\")", + "Anything but requests with a text/html content type.", + ), + ] + text.extend(common.format_keyvals(examples, indent=4)) + return CListBox(text) + + def layout_pushed(self, prev): + """ + We are just about to push a window onto the stack. + """ + self.helpctx = prev.keyctx + self.show() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/keybindings.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/keybindings.py new file mode 100644 index 0000000000000000000000000000000000000000..a9d7237657363ef21b83859ee3b997315381ac08 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/keybindings.py @@ -0,0 +1,163 @@ +import textwrap + +import urwid + +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import signals +from mitmproxy.utils import signals as utils_signals + +HELP_HEIGHT = 5 + + +class KeyItem(urwid.WidgetWrap): + def __init__(self, walker, binding, focused): + self.walker, self.binding, self.focused = walker, binding, focused + super().__init__(self.get_widget()) + + def get_widget(self): + cmd = textwrap.dedent(self.binding.command).strip() + parts = [ + (4, urwid.Text([("focus", ">> " if self.focused else " ")])), + (10, urwid.Text([("title", self.binding.key)])), + (12, urwid.Text([("highlight", "\n".join(self.binding.contexts))])), + urwid.Text([("text", cmd)]), + ] + return urwid.Columns(parts) + + def get_edit_text(self): + return self._w[1].get_edit_text() + + def selectable(self): + return True + + def keypress(self, size, key): + return key + + +class KeyListWalker(urwid.ListWalker): + def __init__(self, master, keybinding_focus_change): + self.keybinding_focus_change = keybinding_focus_change + self.master = master + + self.index = 0 + self.focusobj = None + self.bindings = list(master.keymap.list("all")) + self.set_focus(0) + signals.keybindings_change.connect(self.sig_modified) + + def sig_modified(self): + self.bindings = list(self.master.keymap.list("all")) + self.set_focus(min(self.index, len(self.bindings) - 1)) + self._modified() + + def get_edit_text(self): + return self.focus_obj.get_edit_text() + + def _get(self, pos): + binding = self.bindings[pos] + return KeyItem(self, binding, pos == self.index) + + def get_focus(self): + return self.focus_obj, self.index + + def set_focus(self, index): + binding = self.bindings[index] + self.index = index + self.focus_obj = self._get(self.index) + self.keybinding_focus_change.send(binding.help or "") + self._modified() + + def get_next(self, pos): + if pos >= len(self.bindings) - 1: + return None, None + pos = pos + 1 + return self._get(pos), pos + + def get_prev(self, pos): + pos = pos - 1 + if pos < 0: + return None, None + return self._get(pos), pos + + def positions(self, reverse=False): + if reverse: + return reversed(range(len(self.bindings))) + else: + return range(len(self.bindings)) + + +class KeyList(urwid.ListBox): + def __init__(self, master, keybinding_focus_change): + self.master = master + self.walker = KeyListWalker(master, keybinding_focus_change) + super().__init__(self.walker) + + def keypress(self, size, key): + if key == "m_select": + foc, idx = self.get_focus() + # Act here + elif key == "m_start": + self.set_focus(0) + self.walker._modified() + elif key == "m_end": + self.set_focus(len(self.walker.bindings) - 1) + self.walker._modified() + return super().keypress(size, key) + + +class KeyHelp(urwid.Frame): + def __init__(self, master, keybinding_focus_change): + self.master = master + super().__init__(self.widget("")) + self.set_active(False) + keybinding_focus_change.connect(self.sig_mod) + + def set_active(self, val): + h = urwid.Text("Key Binding Help") + style = "heading" if val else "heading_inactive" + self.header = urwid.AttrMap(h, style) + + def widget(self, txt): + cols, _ = self.master.ui.get_cols_rows() + return urwid.ListBox([urwid.Text(i) for i in textwrap.wrap(txt, cols)]) + + def sig_mod(self, txt): + self.body = self.widget(txt) + + +class KeyBindings(urwid.Pile, layoutwidget.LayoutWidget): + title = "Key Bindings" + keyctx = "keybindings" + focus_position: int + + def __init__(self, master): + keybinding_focus_change = utils_signals.SyncSignal(lambda text: None) + + oh = KeyHelp(master, keybinding_focus_change) + super().__init__( + [ + KeyList(master, keybinding_focus_change), + (HELP_HEIGHT, oh), + ] + ) + self.master = master + + def get_focused_binding(self): + if self.focus_position != 0: + return None + f = self.contents[0][0] + return f.walker.get_focus()[0].binding + + def keypress(self, size, key): + if key == "m_next": + self.focus_position = (self.focus_position + 1) % len(self.widget_list) + self.contents[1][0].set_active(self.focus_position == 1) + key = None + + # This is essentially a copypasta from urwid.Pile's keypress handler. + # So much for "closed for modification, but open for extension". + item_rows = None + if len(size) == 2: + item_rows = self.get_item_rows(size, focus=True) + tsize = self.get_item_size(size, self.focus_position, True, item_rows) + return self.focus.keypress(tsize, key) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/keymap.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/keymap.py new file mode 100644 index 0000000000000000000000000000000000000000..514066a9bc605a03ee4bb3812c038c67fa464003 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/keymap.py @@ -0,0 +1,262 @@ +import logging +import os +from collections import defaultdict +from collections.abc import Sequence +from functools import cache + +import ruamel.yaml.error + +import mitmproxy.types +from mitmproxy import command +from mitmproxy import ctx +from mitmproxy import exceptions +from mitmproxy.tools.console import commandexecutor +from mitmproxy.tools.console import signals + + +class KeyBindingError(Exception): + pass + + +Contexts = { + "chooser", + "commands", + "commonkey", + "dataviewer", + "eventlog", + "flowlist", + "flowview", + "global", + "grideditor", + "help", + "keybindings", + "options", +} + + +navkeys = [ + "m_start", + "m_end", + "m_next", + "m_select", + "up", + "down", + "page_up", + "page_down", + "left", + "right", +] + + +class Binding: + def __init__(self, key, command, contexts, help): + self.key, self.command, self.contexts = key, command, sorted(contexts) + self.help = help + + def keyspec(self): + """ + Translate the key spec from a convenient user specification to one + Urwid understands. + """ + return self.key.replace("space", " ") + + def key_short(self) -> str: + return ( + self.key.replace("enter", "โŽ").replace("right", "โ†’").replace("space", "โฃ") + ) + + def sortkey(self): + return self.key + ",".join(self.contexts) + + +class Keymap: + def __init__(self, master): + self.executor = commandexecutor.CommandExecutor(master) + self.keys: dict[str, dict[str, Binding]] = defaultdict(dict) + self.bindings = [] + + def _check_contexts(self, contexts): + if not contexts: + raise ValueError("Must specify at least one context.") + for c in contexts: + if c not in Contexts: + raise ValueError("Unsupported context: %s" % c) + + def _on_change(self) -> None: + signals.keybindings_change.send() + self.binding_for_help.cache_clear() + + def add(self, key: str, command: str, contexts: Sequence[str], help="") -> None: + """ + Add a key to the key map. + """ + self._check_contexts(contexts) + + for b in self.bindings: + if b.key == key and b.command.strip() == command.strip(): + b.contexts = sorted(list(set(b.contexts + contexts))) + if help: + b.help = help + self.bind(b) + break + else: + self.remove(key, contexts) + b = Binding(key=key, command=command, contexts=contexts, help=help) + self.bindings.append(b) + self.bind(b) + self._on_change() + + def remove(self, key: str, contexts: Sequence[str]) -> None: + """ + Remove a key from the key map. + """ + self._check_contexts(contexts) + for c in contexts: + b = self.get(c, key) + if b: + self.unbind(b) + b.contexts = [x for x in b.contexts if x != c] + if b.contexts: + self.bindings.append(b) + self.bind(b) + self._on_change() + + def bind(self, binding: Binding) -> None: + for c in binding.contexts: + self.keys[c][binding.keyspec()] = binding + + def unbind(self, binding: Binding) -> None: + """ + Unbind also removes the binding from the list. + """ + for c in binding.contexts: + del self.keys[c][binding.keyspec()] + self.bindings = [b for b in self.bindings if b != binding] + self._on_change() + + def get(self, context: str, key: str) -> Binding | None: + if context in self.keys: + return self.keys[context].get(key, None) + return None + + @cache + def binding_for_help(self, help: str) -> Binding | None: + for b in self.bindings: + if b.help == help: + return b + return None + + def list(self, context: str) -> Sequence[Binding]: + b = [x for x in self.bindings if context in x.contexts or context == "all"] + single = [x for x in b if len(x.key.split()) == 1] + multi = [x for x in b if len(x.key.split()) != 1] + single.sort(key=lambda x: x.sortkey()) + multi.sort(key=lambda x: x.sortkey()) + return single + multi + + def handle(self, context: str, key: str) -> str | None: + """ + Returns the key if it has not been handled, or None. + """ + b = self.get(context, key) or self.get("global", key) + if b: + self.executor(b.command) + return None + return key + + def handle_only(self, context: str, key: str) -> str | None: + """ + Like handle, but ignores global bindings. Returns the key if it has + not been handled, or None. + """ + b = self.get(context, key) + if b: + self.executor(b.command) + return None + return key + + +keyAttrs = { + "key": lambda x: isinstance(x, str), + "cmd": lambda x: isinstance(x, str), + "ctx": lambda x: isinstance(x, list) and [isinstance(v, str) for v in x], + "help": lambda x: isinstance(x, str), +} +requiredKeyAttrs = {"key", "cmd"} + + +class KeymapConfig: + defaultFile = "keys.yaml" + + def __init__(self, master): + self.master = master + + @command.command("console.keymap.load") + def keymap_load_path(self, path: mitmproxy.types.Path) -> None: + try: + self.load_path(self.master.keymap, path) # type: ignore + except (OSError, KeyBindingError) as e: + raise exceptions.CommandError("Could not load key bindings - %s" % e) from e + + def running(self): + p = os.path.join(os.path.expanduser(ctx.options.confdir), self.defaultFile) + if os.path.exists(p): + try: + self.load_path(self.master.keymap, p) + except KeyBindingError as e: + logging.error(e) + + def load_path(self, km, p): + if os.path.exists(p) and os.path.isfile(p): + with open(p, encoding="utf8") as f: + try: + txt = f.read() + except UnicodeDecodeError as e: + raise KeyBindingError(f"Encoding error - expected UTF8: {p}: {e}") + try: + vals = self.parse(txt) + except KeyBindingError as e: + raise KeyBindingError(f"Error reading {p}: {e}") from e + for v in vals: + user_ctxs = v.get("ctx", ["global"]) + try: + km._check_contexts(user_ctxs) + km.remove(v["key"], user_ctxs) + km.add( + key=v["key"], + command=v["cmd"], + contexts=user_ctxs, + help=v.get("help", None), + ) + except ValueError as e: + raise KeyBindingError(f"Error reading {p}: {e}") from e + + def parse(self, text): + try: + data = ruamel.yaml.YAML(typ="safe", pure=True).load(text) + except ruamel.yaml.error.MarkedYAMLError as v: + if hasattr(v, "problem_mark"): + snip = v.problem_mark.get_snippet() + raise KeyBindingError( + "Key binding config error at line %s:\n%s\n%s" + % (v.problem_mark.line + 1, snip, v.problem) + ) + else: + raise KeyBindingError("Could not parse key bindings.") + if not data: + return [] + if not isinstance(data, list): + raise KeyBindingError("Invalid keybinding config - expected a list of keys") + + for k in data: + unknown = k.keys() - keyAttrs.keys() + if unknown: + raise KeyBindingError("Unknown key attributes: %s" % unknown) + missing = requiredKeyAttrs - k.keys() + if missing: + raise KeyBindingError("Missing required key attributes: %s" % unknown) + for attr in k.keys(): + if not keyAttrs[attr](k[attr]): + raise KeyBindingError("Invalid type for %s" % attr) + + return data diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/layoutwidget.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/layoutwidget.py new file mode 100644 index 0000000000000000000000000000000000000000..5443c4f0db65600f1c2e06070d537998d6b4eac6 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/layoutwidget.py @@ -0,0 +1,40 @@ +from typing import ClassVar + + +class LayoutWidget: + """ + All top-level layout widgets and all widgets that may be set in an + overlay must comply with this API. + """ + + # Title is only required for windows, not overlay components + title = "" + keyctx: ClassVar[str] = "" + + def key_responder(self): + """ + Returns the object responding to key input. Usually self, but may be + a wrapped object. + """ + return self + + def focus_changed(self): + """ + The view focus has changed. Layout objects should implement the API + rather than directly subscribing to events. + """ + + def view_changed(self): + """ + The view list has changed. + """ + + def layout_popping(self): + """ + We are just about to pop a window off the stack, or exit an overlay. + """ + + def layout_pushed(self, prev): + """ + We have just pushed a window onto the stack. + """ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/master.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/master.py new file mode 100644 index 0000000000000000000000000000000000000000..5457ba4665de4ff52ef4a53c9e1587b19f5bc447 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/master.py @@ -0,0 +1,263 @@ +import asyncio +import contextlib +import mimetypes +import os.path +import shlex +import shutil +import stat +import subprocess +import sys +import tempfile +import threading +from typing import TypeVar + +import urwid +from tornado.platform.asyncio import AddThreadSelectorEventLoop + +from mitmproxy import addons +from mitmproxy import log +from mitmproxy import master +from mitmproxy import options +from mitmproxy.addons import errorcheck +from mitmproxy.addons import eventstore +from mitmproxy.addons import intercept +from mitmproxy.addons import readfile +from mitmproxy.addons import view +from mitmproxy.tools.console import consoleaddons +from mitmproxy.tools.console import defaultkeys +from mitmproxy.tools.console import keymap +from mitmproxy.tools.console import palettes +from mitmproxy.tools.console import signals +from mitmproxy.tools.console import window +from mitmproxy.utils import strutils + +T = TypeVar("T", str, bytes) + + +class ConsoleMaster(master.Master): + def __init__(self, opts: options.Options) -> None: + super().__init__(opts) + + self.view: view.View = view.View() + self.events = eventstore.EventStore() + self.events.sig_add.connect(self.sig_add_log) + + self.stream_path = None + self.keymap = keymap.Keymap(self) + defaultkeys.map(self.keymap) + self.options.errored.connect(self.options_error) + + self.addons.add(*addons.default_addons()) + self.addons.add( + intercept.Intercept(), + self.view, + self.events, + readfile.ReadFile(), + consoleaddons.ConsoleAddon(self), + keymap.KeymapConfig(self), + errorcheck.ErrorCheck(repeat_errors_on_stderr=True), + ) + + self.window: window.Window | None = None + + def __setattr__(self, name, value): + super().__setattr__(name, value) + signals.update_settings.send() + + def options_error(self, exc) -> None: + signals.status_message.send(message=str(exc), expire=1) + + def prompt_for_user_choice(self, prompt, callback) -> None: + signals.status_prompt_onekey.send( + prompt=prompt, + keys=[ + ("yes", "y"), + ("no", "n"), + ], + callback=callback, + ) + + def prompt_for_exit(self) -> None: + self.prompt_for_user_choice("Quit", self.quit) + + def sig_add_log(self, entry: log.LogEntry): + if log.log_tier(self.options.console_eventlog_verbosity) < log.log_tier( + entry.level + ): + return + if entry.level in ("error", "warn", "alert"): + signals.status_message.send( + message=( + entry.level, + f"{entry.level.title()}: {entry.msg.lstrip()}", + ), + expire=5, + ) + + def sig_call_in(self, seconds, callback): + def cb(*_): + return callback() + + self.loop.set_alarm_in(seconds, cb) + + @contextlib.contextmanager + def uistopped(self): + self.loop.stop() + try: + yield + finally: + self.loop.start() + self.loop.screen_size = None + self.loop.draw_screen() + + def get_editor(self) -> str: + # based upon https://github.com/pallets/click/blob/main/src/click/_termui_impl.py + if m := os.environ.get("MITMPROXY_EDITOR"): + return m + if m := os.environ.get("EDITOR"): + return m + for editor in "sensible-editor", "nano", "vim": + if shutil.which(editor): + return editor + if os.name == "nt": + return "notepad" + else: + return "vi" + + def get_hex_editor(self) -> str: + editors = ["ghex", "hexedit", "hxd", "hexer", "hexcurse"] + for editor in editors: + if shutil.which(editor): + return editor + return self.get_editor() + + def spawn_editor(self, data: T) -> T: + text = isinstance(data, str) + fd, name = tempfile.mkstemp("", "mitmproxy", text=text) + with_hexeditor = isinstance(data, bytes) and strutils.is_mostly_bin(data) + with open(fd, "w" if text else "wb") as f: + f.write(data) + if with_hexeditor: + c = self.get_hex_editor() + else: + c = self.get_editor() + cmd = shlex.split(c) + cmd.append(name) + with self.uistopped(): + try: + subprocess.call(cmd) + except Exception: + signals.status_message.send(message="Can't start editor: %s" % c) + else: + with open(name, "r" if text else "rb") as f: + data = f.read() + os.unlink(name) + return data + + def spawn_external_viewer(self, data, contenttype): + if contenttype: + contenttype = contenttype.split(";")[0] + ext = mimetypes.guess_extension(contenttype) or "" + else: + ext = "" + fd, name = tempfile.mkstemp(ext, "mproxy") + os.write(fd, data) + os.close(fd) + + # read-only to remind the user that this is a view function + os.chmod(name, stat.S_IREAD) + + # hm which one should get priority? + c = ( + os.environ.get("MITMPROXY_EDITOR") + or os.environ.get("PAGER") + or os.environ.get("EDITOR") + ) + if not c: + c = "less" + cmd = shlex.split(c) + cmd.append(name) + + with self.uistopped(): + try: + subprocess.call(cmd, shell=False) + except Exception: + signals.status_message.send( + message="Can't start external viewer: %s" % " ".join(c) + ) + # add a small delay before deletion so that the file is not removed before being loaded by the viewer + t = threading.Timer(1.0, os.unlink, args=[name]) + t.start() + + def set_palette(self, *_) -> None: + self.ui.register_palette( + palettes.palettes[self.options.console_palette].palette( + self.options.console_palette_transparent + ) + ) + self.ui.clear() + + def inject_key(self, key): + self.loop.process_input([key]) + + async def running(self) -> None: + if not sys.stdout.isatty(): + print( + "Error: mitmproxy's console interface requires a tty. " + "Please run mitmproxy in an interactive shell environment.", + file=sys.stderr, + ) + sys.exit(1) + + detected_encoding = urwid.detected_encoding.lower() + if os.name != "nt" and detected_encoding and "utf" not in detected_encoding: + print( + f"mitmproxy expects a UTF-8 console environment, not {urwid.detected_encoding!r}. " + f"Set your LANG environment variable to something like en_US.UTF-8.", + file=sys.stderr, + ) + # Experimental (04/2022): We just don't exit here and see if/how that affects users. + # sys.exit(1) + urwid.set_encoding("utf8") + + signals.call_in.connect(self.sig_call_in) + self.ui = window.Screen() + self.ui.set_terminal_properties(256) + self.set_palette(None) + self.options.subscribe( + self.set_palette, ["console_palette", "console_palette_transparent"] + ) + + loop = asyncio.get_running_loop() + if isinstance(loop, getattr(asyncio, "ProactorEventLoop", tuple())): + # fix for https://bugs.python.org/issue37373 + loop = AddThreadSelectorEventLoop(loop) # type: ignore + self.loop = urwid.MainLoop( + urwid.SolidFill("x"), + event_loop=urwid.AsyncioEventLoop(loop=loop), + screen=self.ui, + handle_mouse=self.options.console_mouse, + ) + self.window = window.Window(self) + self.loop.widget = self.window + self.window.refresh() + + self.loop.start() + + await super().running() + + async def done(self): + self.loop.stop() + await super().done() + + def overlay(self, widget, **kwargs): + assert self.window + self.window.set_overlay(widget, **kwargs) + + def switch_view(self, name): + assert self.window + self.window.push(name) + + def quit(self, a): + if a != "n": + self.shutdown() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/options.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/options.py new file mode 100644 index 0000000000000000000000000000000000000000..73973783e2407fb4472012d4092b1e5ec3a41f0d --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/options.py @@ -0,0 +1,272 @@ +from __future__ import annotations + +import pprint +import textwrap +import typing +from collections.abc import Sequence +from typing import Optional + +import urwid + +from mitmproxy import exceptions +from mitmproxy import optmanager +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import overlay +from mitmproxy.tools.console import signals + +HELP_HEIGHT = 5 + + +def can_edit_inplace(opt): + if opt.choices: + return False + if opt.typespec in [str, int, Optional[str], Optional[int]]: + return True + + +class OptionItem(urwid.WidgetWrap): + def __init__(self, walker, opt, focused, namewidth, editing): + self.walker, self.opt, self.focused = walker, opt, focused + self.namewidth = namewidth + self.editing = editing + super().__init__(self.get_widget()) + + def get_widget(self): + val = self.opt.current() + if self.opt.typespec is bool: + displayval = "true" if val else "false" + elif not val: + displayval = "" + elif self.opt.typespec == Sequence[str]: + displayval = pprint.pformat(val, indent=1) + else: + displayval = str(val) + + changed = self.walker.master.options.has_changed(self.opt.name) + if self.focused: + valstyle = "option_active_selected" if changed else "option_selected" + else: + valstyle = "option_active" if changed else "text" + + if self.editing: + valw = urwid.Edit(edit_text=displayval) + else: + valw = urwid.AttrMap( + urwid.Padding(urwid.Text([(valstyle, displayval)])), valstyle + ) + + return urwid.Columns( + [ + ( + self.namewidth, + urwid.Text([("title", self.opt.name.ljust(self.namewidth))]), + ), + valw, + ], + dividechars=2, + focus_column=1, + ) + + def get_edit_text(self): + return self._w[1].get_edit_text() + + def selectable(self): + return True + + def keypress(self, size, key): + if self.editing: + self._w[1].keypress(size, key) + return + return key + + +class OptionListWalker(urwid.ListWalker): + def __init__(self, master, help_widget: OptionHelp): + self.master = master + self.help_widget = help_widget + + self.index = 0 + self.focusobj = None + + self.opts = sorted(master.options.keys()) + self.maxlen = max(len(i) for i in self.opts) + self.editing = False + self.set_focus(0) + self.master.options.changed.connect(self.sig_mod) + + def sig_mod(self, *args, **kwargs): + self.opts = sorted(self.master.options.keys()) + self.maxlen = max(len(i) for i in self.opts) + self._modified() + self.set_focus(self.index) + + def start_editing(self): + self.editing = True + self.focus_obj = self._get(self.index, True) + self._modified() + + def stop_editing(self): + self.editing = False + self.focus_obj = self._get(self.index, False) + self.set_focus(self.index) + self._modified() + + def get_edit_text(self): + return self.focus_obj.get_edit_text() + + def _get(self, pos, editing): + name = self.opts[pos] + opt = self.master.options._options[name] + return OptionItem(self, opt, pos == self.index, self.maxlen, editing) + + def get_focus(self): + return self.focus_obj, self.index + + def set_focus(self, index): + self.editing = False + name = self.opts[index] + opt = self.master.options._options[name] + self.index = index + self.focus_obj = self._get(self.index, self.editing) + self.help_widget.update_help_text(opt.help) + self._modified() + + def get_next(self, pos): + if pos >= len(self.opts) - 1: + return None, None + pos = pos + 1 + return self._get(pos, False), pos + + def get_prev(self, pos): + pos = pos - 1 + if pos < 0: + return None, None + return self._get(pos, False), pos + + def positions(self, reverse=False): + if reverse: + return reversed(range(len(self.opts))) + else: + return range(len(self.opts)) + + +class OptionsList(urwid.ListBox): + def __init__(self, master, help_widget: OptionHelp): + self.master = master + self.walker = OptionListWalker(master, help_widget) + super().__init__(self.walker) + + def save_config(self, path): + try: + optmanager.save(self.master.options, path) + except exceptions.OptionsError as e: + signals.status_message.send(message=str(e)) + + def keypress(self, size, key): + if self.walker.editing: + if key == "enter": + foc, idx = self.get_focus() + v = self.walker.get_edit_text() + try: + self.master.options.set(f"{foc.opt.name}={v}") + except exceptions.OptionsError as v: + signals.status_message.send(message=str(v)) + self.walker.stop_editing() + return None + elif key == "esc": + self.walker.stop_editing() + return None + else: + if key == "m_start": + self.set_focus(0) + self.walker._modified() + elif key == "m_end": + self.set_focus(len(self.walker.opts) - 1) + self.walker._modified() + elif key == "m_select": + foc, idx = self.get_focus() + if foc.opt.typespec is bool: + self.master.options.toggler(foc.opt.name)() + # Bust the focus widget cache + self.set_focus(self.walker.index) + elif can_edit_inplace(foc.opt): + self.walker.start_editing() + self.walker._modified() + elif foc.opt.choices: + self.master.overlay( + overlay.Chooser( + self.master, + foc.opt.name, + foc.opt.choices, + foc.opt.current(), + self.master.options.setter(foc.opt.name), + ) + ) + elif foc.opt.typespec in (Sequence[str], typing.Sequence[str]): + self.master.overlay( + overlay.OptionsOverlay( + self.master, + foc.opt.name, + foc.opt.current(), + HELP_HEIGHT + 5, + ), + valign="top", + ) + else: + raise NotImplementedError() + return super().keypress(size, key) + + +class OptionHelp(urwid.Frame): + def __init__(self, master): + self.master = master + super().__init__(self.widget("")) + self.set_active(False) + + def set_active(self, val): + h = urwid.Text("Option Help") + style = "heading" if val else "heading_inactive" + self.header = urwid.AttrMap(h, style) + + def widget(self, txt): + cols, _ = self.master.ui.get_cols_rows() + return urwid.ListBox([urwid.Text(i) for i in textwrap.wrap(txt, cols)]) + + def update_help_text(self, txt: str) -> None: + self.body = self.widget(txt) + + +class Options(urwid.Pile, layoutwidget.LayoutWidget): + title = "Options" + keyctx = "options" + + focus_position: int + + def __init__(self, master): + oh = OptionHelp(master) + self.optionslist = OptionsList(master, oh) + super().__init__( + [ + self.optionslist, + (HELP_HEIGHT, oh), + ] + ) + self.master = master + + def current_name(self): + foc, idx = self.optionslist.get_focus() + return foc.opt.name + + def keypress(self, size, key): + if key == "m_next": + self.focus_position = (self.focus_position + 1) % len(self.widget_list) + self.widget_list[1].set_active(self.focus_position == 1) + key = None + + # This is essentially a copypasta from urwid.Pile's keypress handler. + # So much for "closed for modification, but open for extension". + item_rows = None + if len(size) == 2: + item_rows = self.get_item_rows(size, focus=True) + tsize = self.get_item_size(size, self.focus_position, True, item_rows) + return self.focus.keypress(tsize, key) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/overlay.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..1b3923e9b3bc0ddab1fb22300f790cbb49ab9690 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/overlay.py @@ -0,0 +1,195 @@ +import math + +import urwid + +from mitmproxy.tools.console import grideditor +from mitmproxy.tools.console import keymap +from mitmproxy.tools.console import layoutwidget +from mitmproxy.tools.console import signals + + +class SimpleOverlay(urwid.Overlay, layoutwidget.LayoutWidget): + def __init__(self, master, widget, parent, width, valign="middle"): + self.widget = widget + self.master = master + super().__init__( + widget, parent, align="center", width=width, valign=valign, height="pack" + ) + + @property + def keyctx(self): + return getattr(self.widget, "keyctx") + + # mypy: Cannot override writeable attribute with read-only property + @keyctx.setter + def keyctx(self, value): + raise RuntimeError # pragma: no cover + + def key_responder(self): + return self.widget.key_responder() + + def focus_changed(self): + return self.widget.focus_changed() + + def view_changed(self): + return self.widget.view_changed() + + def layout_popping(self): + return self.widget.layout_popping() + + +class Choice(urwid.WidgetWrap): + def __init__(self, txt, focus, current, shortcut): + if shortcut: + selection_type = "option_selected_key" if focus else "key" + txt = [(selection_type, shortcut), ") ", txt] + else: + txt = " " + txt + if current: + s = "option_active_selected" if focus else "option_active" + else: + s = "option_selected" if focus else "text" + super().__init__( + urwid.AttrMap( + urwid.Padding(urwid.Text(txt)), + s, + ) + ) + + def selectable(self): + return True + + def keypress(self, size, key): + return key + + +class ChooserListWalker(urwid.ListWalker): + shortcuts = "123456789abcdefghijklmnoprstuvwxyz" + + def __init__(self, choices, current): + self.index = 0 + self.choices = choices + self.current = current + + def _get(self, idx, focus): + c = self.choices[idx] + return Choice(c, focus, c == self.current, self.shortcuts[idx : idx + 1]) + + def set_focus(self, index): + self.index = index + + def get_focus(self): + return self._get(self.index, True), self.index + + def get_next(self, pos): + if pos >= len(self.choices) - 1: + return None, None + pos = pos + 1 + return self._get(pos, False), pos + + def get_prev(self, pos): + pos = pos - 1 + if pos < 0: + return None, None + return self._get(pos, False), pos + + def choice_by_shortcut(self, shortcut): + for i, choice in enumerate(self.choices): + if shortcut == self.shortcuts[i : i + 1]: + return choice + return None + + +class Chooser(urwid.WidgetWrap, layoutwidget.LayoutWidget): + keyctx = "chooser" + + def __init__(self, master, title, choices, current, callback): + self.master = master + self.choices = choices + self.callback = callback + choicewidth = max(len(i) for i in choices) + self.width = max(choicewidth, len(title)) + 7 + + self.walker = ChooserListWalker(choices, current) + super().__init__( + urwid.AttrMap( + urwid.LineBox( + urwid.BoxAdapter(urwid.ListBox(self.walker), len(choices)), + title=title, + ), + "background", + ) + ) + + def selectable(self): + return True + + def keypress(self, size, key): + key = self.master.keymap.handle_only("chooser", key) + choice = self.walker.choice_by_shortcut(key) + if choice: + self.callback(choice) + signals.pop_view_state.send() + return + if key == "m_select": + self.callback(self.choices[self.walker.index]) + signals.pop_view_state.send() + return + elif key in ["q", "esc"]: + signals.pop_view_state.send() + return + + binding = self.master.keymap.get("global", key) + # This is extremely awkward. We need a better way to match nav keys only. + if binding and binding.command.startswith("console.nav"): + self.master.keymap.handle("global", key) + elif key in keymap.navkeys: + return super().keypress(size, key) + + +class OptionsOverlay(urwid.WidgetWrap, layoutwidget.LayoutWidget): + keyctx = "grideditor" + + def __init__(self, master, name, vals, vspace): + """ + vspace: how much vertical space to keep clear + """ + cols, rows = master.ui.get_cols_rows() + self.ge = grideditor.OptionsEditor(master, name, vals) + super().__init__( + urwid.AttrMap( + urwid.LineBox(urwid.BoxAdapter(self.ge, rows - vspace), title=name), + "background", + ) + ) + self.width = math.ceil(cols * 0.8) + + def key_responder(self): + return self.ge.key_responder() + + def layout_popping(self): + return self.ge.layout_popping() + + +class DataViewerOverlay(urwid.WidgetWrap, layoutwidget.LayoutWidget): + keyctx = "dataviewer" + + def __init__(self, master, vals): + """ + vspace: how much vertical space to keep clear + """ + cols, rows = master.ui.get_cols_rows() + self.ge = grideditor.DataViewer(master, vals) + super().__init__( + urwid.AttrMap( + urwid.LineBox(urwid.BoxAdapter(self.ge, rows - 5), title="Data viewer"), + "background", + ) + ) + self.width = math.ceil(cols * 0.8) + + def key_responder(self): + return self.ge.key_responder() + + def layout_popping(self): + return self.ge.layout_popping() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/palettes.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/palettes.py new file mode 100644 index 0000000000000000000000000000000000000000..a5321e07c5e87b9c25f4c5e5b0e948b9485e001c --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/palettes.py @@ -0,0 +1,546 @@ +# Low-color themes should ONLY use the standard foreground and background +# colours listed here: +# +# http://urwid.org/manual/displayattributes.html +# +from __future__ import annotations + +from collections.abc import Mapping +from collections.abc import Sequence + + +class Palette: + _fields = [ + "background", + "title", + # Status bar & heading + "heading", + "heading_key", + "heading_inactive", + # Help + "key", + "head", + "text", + # Options + "option_selected", + "option_active", + "option_active_selected", + "option_selected_key", + # List and Connections + "method_get", + "method_post", + "method_delete", + "method_other", + "method_head", + "method_put", + "method_http2_push", + "scheme_http", + "scheme_https", + "scheme_ws", + "scheme_wss", + "scheme_tcp", + "scheme_udp", + "scheme_dns", + "scheme_quic", + "scheme_other", + "url_punctuation", + "url_domain", + "url_filename", + "url_extension", + "url_query_key", + "url_query_value", + "content_none", + "content_text", + "content_script", + "content_media", + "content_data", + "content_raw", + "content_other", + "focus", + "code_200", + "code_300", + "code_400", + "code_500", + "code_other", + "error", + "warn", + "alert", + "header", + "highlight", + "intercept", + "replay", + "mark", + # Contentview Syntax Highlighting + "name", + "string", + "number", + "boolean", + "comment", + "error", + # TCP flow details + "from_client", + "to_client", + # Grid Editor + "focusfield", + "focusfield_error", + "field_error", + "editfield", + # Commander + "commander_command", + "commander_invalid", + "commander_hint", + ] + _fields.extend(["gradient_%02d" % i for i in range(100)]) + high: Mapping[str, Sequence[str]] | None = None + low: Mapping[str, Sequence[str]] + + def palette(self, transparent: bool): + lst: list[Sequence[str | None]] = [] + highback, lowback = None, None + if not transparent: + if self.high and self.high.get("background"): + highback = self.high["background"][1] + lowback = self.low["background"][1] + + for i in self._fields: + if transparent and i == "background": + lst.append(["background", "default", "default"]) + else: + v: list[str | None] = [i] + low = list(self.low[i]) + if lowback and low[1] == "default": + low[1] = lowback + v.extend(low) + if self.high and i in self.high: + v.append(None) + high: list[str | None] = list(self.high[i]) + if highback and high[1] == "default": + high[1] = highback + v.extend(high) + elif highback and self.low[i][1] == "default": + high = [None, low[0], highback] + v.extend(high) + lst.append(tuple(v)) + return lst + + +def gen_gradient(palette, cols): + for i in range(100): + palette["gradient_%02d" % i] = (cols[i * len(cols) // 100], "default") + + +def gen_rgb_gradient(palette, cols): + parts = len(cols) - 1 + for i in range(100): + p = i / 100 + idx = int(p * parts) + t0 = cols[idx] + t1 = cols[idx + 1] + pp = p * parts % 1 + t = ( + round(t0[0] + (t1[0] - t0[0]) * pp), + round(t0[1] + (t1[1] - t0[1]) * pp), + round(t0[2] + (t1[2] - t0[2]) * pp), + ) + palette["gradient_%02d" % i] = ("#%x%x%x" % t, "default") + + +class LowDark(Palette): + """ + Low-color dark background + """ + + low = dict( + background=("white", "black"), + title=("white,bold", "default"), + # Status bar & heading + heading=("white", "dark blue"), + heading_key=("light cyan", "dark blue"), + heading_inactive=("dark gray", "light gray"), + # Help + key=("light cyan", "default"), + head=("white,bold", "default"), + text=("light gray", "default"), + # Options + option_selected=("black", "light gray"), + option_selected_key=("light cyan", "light gray"), + option_active=("light red", "default"), + option_active_selected=("light red", "light gray"), + # List and Connections + method_get=("light green", "default"), + method_post=("brown", "default"), + method_delete=("light red", "default"), + method_head=("dark cyan", "default"), + method_put=("dark red", "default"), + method_other=("dark magenta", "default"), + method_http2_push=("dark gray", "default"), + scheme_http=("dark cyan", "default"), + scheme_https=("dark green", "default"), + scheme_ws=("brown", "default"), + scheme_wss=("dark magenta", "default"), + scheme_tcp=("dark magenta", "default"), + scheme_udp=("dark magenta", "default"), + scheme_dns=("dark blue", "default"), + scheme_quic=("brown", "default"), + scheme_other=("dark magenta", "default"), + url_punctuation=("light gray", "default"), + url_domain=("white", "default"), + url_filename=("dark cyan", "default"), + url_extension=("light gray", "default"), + url_query_key=("white", "default"), + url_query_value=("light gray", "default"), + content_none=("dark gray", "default"), + content_text=("light gray", "default"), + content_script=("dark green", "default"), + content_media=("light blue", "default"), + content_data=("brown", "default"), + content_raw=("dark red", "default"), + content_other=("dark magenta", "default"), + focus=("yellow", "default"), + code_200=("dark green", "default"), + code_300=("light blue", "default"), + code_400=("light red", "default"), + code_500=("light red", "default"), + code_other=("dark red", "default"), + alert=("light magenta", "default"), + warn=("brown", "default"), + error=("light red", "default"), + header=("dark cyan", "default"), + highlight=("white,bold", "default"), + intercept=("brown", "default"), + replay=("light green", "default"), + mark=("light red", "default"), + # Contentview Syntax Highlighting + name=("dark green", "default"), + string=("dark blue", "default"), + number=("light magenta", "default"), + boolean=("dark magenta", "default"), + comment=("dark gray", "default"), + # TCP flow details + from_client=("light blue", "default"), + to_client=("light red", "default"), + # Grid Editor + focusfield=("black", "light gray"), + focusfield_error=("dark red", "light gray"), + field_error=("dark red", "default"), + editfield=("white", "default"), + commander_command=("white,bold", "default"), + commander_invalid=("light red", "default"), + commander_hint=("dark gray", "default"), + ) + gen_gradient( + low, + ["light red", "yellow", "light green", "dark green", "dark cyan", "dark blue"], + ) + + +class Dark(LowDark): + high = dict( + heading_inactive=("g58", "g11"), + intercept=("#f60", "default"), + option_selected=("g85", "g45"), + option_selected_key=("light cyan", "g50"), + option_active_selected=("light red", "g50"), + ) + + +class LowLight(Palette): + """ + Low-color light background + """ + + low = dict( + background=("black", "white"), + title=("dark magenta", "default"), + # Status bar & heading + heading=("white", "black"), + heading_key=("dark blue", "black"), + heading_inactive=("black", "light gray"), + # Help + key=("dark blue", "default"), + head=("black", "default"), + text=("dark gray", "default"), + # Options + option_selected=("black", "light gray"), + option_selected_key=("dark blue", "light gray"), + option_active=("light red", "default"), + option_active_selected=("light red", "light gray"), + # List and Connections + method_get=("dark green", "default"), + method_post=("brown", "default"), + method_head=("dark cyan", "default"), + method_put=("light red", "default"), + method_delete=("dark red", "default"), + method_other=("light magenta", "default"), + method_http2_push=("light gray", "default"), + scheme_http=("dark cyan", "default"), + scheme_https=("light green", "default"), + scheme_ws=("brown", "default"), + scheme_wss=("light magenta", "default"), + scheme_tcp=("light magenta", "default"), + scheme_udp=("light magenta", "default"), + scheme_dns=("light blue", "default"), + scheme_quic=("brown", "default"), + scheme_other=("light magenta", "default"), + url_punctuation=("dark gray", "default"), + url_domain=("dark gray", "default"), + url_filename=("black", "default"), + url_extension=("dark gray", "default"), + url_query_key=("light blue", "default"), + url_query_value=("dark blue", "default"), + content_none=("black", "default"), + content_text=("dark gray", "default"), + content_script=("light green", "default"), + content_media=("light blue", "default"), + content_data=("brown", "default"), + content_raw=("light red", "default"), + content_other=("light magenta", "default"), + focus=("black", "default"), + code_200=("dark green", "default"), + code_300=("light blue", "default"), + code_400=("dark red", "default"), + code_500=("dark red", "default"), + code_other=("light red", "default"), + error=("light red", "default"), + warn=("brown", "default"), + alert=("light magenta", "default"), + header=("dark blue", "default"), + highlight=("black,bold", "default"), + intercept=("brown", "default"), + replay=("dark green", "default"), + mark=("dark red", "default"), + # Contentview Syntax Highlighting + name=("dark green", "default"), + string=("dark blue", "default"), + number=("light magenta", "default"), + boolean=("dark magenta", "default"), + comment=("dark gray", "default"), + # TCP flow details + from_client=("dark blue", "default"), + to_client=("dark red", "default"), + # Grid Editor + focusfield=("black", "light gray"), + focusfield_error=("dark red", "light gray"), + field_error=("dark red", "black"), + editfield=("black", "default"), + commander_command=("dark magenta", "default"), + commander_invalid=("light red", "default"), + commander_hint=("light gray", "default"), + ) + gen_gradient( + low, + ["light red", "yellow", "light green", "dark green", "dark cyan", "dark blue"], + ) + + +class Light(LowLight): + high = dict( + background=("black", "g100"), + heading=("g99", "#08f"), + heading_key=("#0ff,bold", "#08f"), + heading_inactive=("g35", "g85"), + replay=("#0a0,bold", "default"), + option_selected=("black", "g85"), + option_selected_key=("dark blue", "g85"), + option_active_selected=("light red", "g85"), + ) + + +# Solarized palette in Urwid-style terminal high-colour offsets +# See: http://ethanschoonover.com/solarized +sol_base03 = "h234" +sol_base02 = "h235" +sol_base01 = "h240" +sol_base00 = "h241" +sol_base0 = "h244" +sol_base1 = "h245" +sol_base2 = "h254" +sol_base3 = "h230" +sol_yellow = "h136" +sol_orange = "h166" +sol_red = "h160" +sol_magenta = "h125" +sol_violet = "h61" +sol_blue = "h33" +sol_cyan = "h37" +sol_green = "h64" + + +class SolarizedLight(LowLight): + high = dict( + background=(sol_base00, sol_base3), + title=(sol_cyan, "default"), + text=(sol_base00, "default"), + # Status bar & heading + heading=(sol_base2, sol_base02), + heading_key=(sol_blue, sol_base03), + heading_inactive=(sol_base03, sol_base1), + # Help + key=( + sol_blue, + "default", + ), + head=(sol_base00, "default"), + # Options + option_selected=(sol_base03, sol_base2), + option_selected_key=(sol_blue, sol_base2), + option_active=(sol_orange, "default"), + option_active_selected=(sol_orange, sol_base2), + # List and Connections + method_get=(sol_green, "default"), + method_post=(sol_orange, "default"), + method_head=(sol_cyan, "default"), + method_put=(sol_red, "default"), + method_delete=(sol_red, "default"), + method_other=(sol_magenta, "default"), + method_http2_push=("light gray", "default"), + scheme_http=(sol_cyan, "default"), + scheme_https=("light green", "default"), + scheme_ws=(sol_orange, "default"), + scheme_wss=("light magenta", "default"), + scheme_tcp=("light magenta", "default"), + scheme_udp=("light magenta", "default"), + scheme_dns=("light blue", "default"), + scheme_quic=(sol_orange, "default"), + scheme_other=("light magenta", "default"), + url_punctuation=("dark gray", "default"), + url_domain=("dark gray", "default"), + url_filename=("black", "default"), + url_extension=("dark gray", "default"), + url_query_key=(sol_blue, "default"), + url_query_value=("dark blue", "default"), + focus=(sol_base01, "default"), + code_200=(sol_green, "default"), + code_300=(sol_blue, "default"), + code_400=( + sol_orange, + "default", + ), + code_500=(sol_red, "default"), + code_other=(sol_magenta, "default"), + error=(sol_red, "default"), + warn=(sol_orange, "default"), + alert=(sol_magenta, "default"), + header=(sol_blue, "default"), + highlight=(sol_base01, "default"), + intercept=( + sol_red, + "default", + ), + replay=( + sol_green, + "default", + ), + mark=(sol_base01, "default"), + # Contentview Syntax Highlighting + name=(sol_green, "default"), + string=(sol_cyan, "default"), + number=(sol_blue, "default"), + boolean=(sol_magenta, "default"), + comment=(sol_base1, "default"), + # TCP flow details + from_client=(sol_blue, "default"), + to_client=(sol_red, "default"), + # Grid Editor + focusfield=(sol_base00, sol_base2), + focusfield_error=(sol_red, sol_base2), + field_error=(sol_red, "default"), + editfield=(sol_base01, "default"), + commander_command=(sol_cyan, "default"), + commander_invalid=(sol_orange, "default"), + commander_hint=(sol_base1, "default"), + ) + + +class SolarizedDark(LowDark): + high = dict( + background=(sol_base2, sol_base03), + title=(sol_blue, "default"), + text=(sol_base1, "default"), + # Status bar & heading + heading=(sol_base2, sol_base01), + heading_key=(sol_blue + ",bold", sol_base01), + heading_inactive=(sol_base1, sol_base02), + # Help + key=( + sol_blue, + "default", + ), + head=(sol_base2, "default"), + # Options + option_selected=(sol_base03, sol_base00), + option_selected_key=(sol_blue, sol_base00), + option_active=(sol_orange, "default"), + option_active_selected=(sol_orange, sol_base00), + # List and Connections + focus=(sol_base1, "default"), + method_get=(sol_green, "default"), + method_post=(sol_orange, "default"), + method_delete=(sol_red, "default"), + method_head=(sol_cyan, "default"), + method_put=(sol_red, "default"), + method_other=(sol_magenta, "default"), + method_http2_push=(sol_base01, "default"), + url_punctuation=("h242", "default"), + url_domain=("h252", "default"), + url_filename=("h132", "default"), + url_extension=("h96", "default"), + url_query_key=("h37", "default"), + url_query_value=("h30", "default"), + content_none=(sol_base01, "default"), + content_text=(sol_base1, "default"), + content_media=(sol_blue, "default"), + code_200=(sol_green, "default"), + code_300=(sol_blue, "default"), + code_400=( + sol_orange, + "default", + ), + code_500=(sol_red, "default"), + code_other=(sol_magenta, "default"), + error=(sol_red, "default"), + warn=(sol_orange, "default"), + alert=(sol_magenta, "default"), + header=(sol_blue, "default"), + highlight=(sol_base01, "default"), + intercept=( + sol_red, + "default", + ), + replay=( + sol_green, + "default", + ), + mark=(sol_base01, "default"), + # Contentview Syntax Highlighting + name=(sol_green, "default"), + string=(sol_cyan, "default"), + number=(sol_blue, "default"), + boolean=(sol_magenta, "default"), + comment=(sol_base00, "default"), + # TCP flow details + from_client=(sol_blue, "default"), + to_client=(sol_red, "default"), + # Grid Editor + focusfield=(sol_base0, sol_base02), + focusfield_error=(sol_red, sol_base02), + field_error=(sol_red, "default"), + editfield=(sol_base1, "default"), + commander_command=(sol_blue, "default"), + commander_invalid=(sol_orange, "default"), + commander_hint=(sol_base00, "default"), + ) + gen_rgb_gradient( + high, [(15, 0, 0), (15, 15, 0), (0, 15, 0), (0, 15, 15), (0, 0, 15)] + ) + + +DEFAULT = "dark" +palettes = { + "lowlight": LowLight(), + "lowdark": LowDark(), + "light": Light(), + "dark": Dark(), + "solarized_light": SolarizedLight(), + "solarized_dark": SolarizedDark(), +} diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/quickhelp.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/quickhelp.py new file mode 100644 index 0000000000000000000000000000000000000000..663a03cfadad83b2f35b9673f0a6527650285151 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/quickhelp.py @@ -0,0 +1,191 @@ +""" +This module is reponsible for drawing the quick key help at the bottom of mitmproxy. +""" + +from dataclasses import dataclass +from typing import Union + +import urwid + +from mitmproxy import flow +from mitmproxy.http import HTTPFlow +from mitmproxy.tools.console.eventlog import EventLog +from mitmproxy.tools.console.flowlist import FlowListBox +from mitmproxy.tools.console.flowview import FlowView +from mitmproxy.tools.console.grideditor.base import FocusEditor +from mitmproxy.tools.console.help import HelpView +from mitmproxy.tools.console.keybindings import KeyBindings +from mitmproxy.tools.console.keymap import Keymap +from mitmproxy.tools.console.options import Options + + +@dataclass +class BasicKeyHelp: + """Quick help for urwid-builtin keybindings (i.e. those keys that do not appear in the keymap)""" + + key: str + + +HelpItems = dict[str, Union[str, BasicKeyHelp]] +""" +A mapping from the short text that should be displayed in the help bar to the full help text provided for the key +binding. The order of the items in the dictionary determines the order in which they are displayed in the help bar. + +Some help items explain builtin urwid functionality, so there is no key binding for them. In this case, the value +is a BasicKeyHelp object. +""" + + +@dataclass +class QuickHelp: + top_label: str + top_items: HelpItems + bottom_label: str + bottom_items: HelpItems + + def make_rows(self, keymap: Keymap) -> tuple[urwid.Columns, urwid.Columns]: + top = _make_row(self.top_label, self.top_items, keymap) + bottom = _make_row(self.bottom_label, self.bottom_items, keymap) + return top, bottom + + +def make( + widget: type[urwid.Widget], + focused_flow: flow.Flow | None, + is_root_widget: bool, +) -> QuickHelp: + top_label = "" + top_items: HelpItems = {} + if widget in (FlowListBox, FlowView): + top_label = "Flow:" + if focused_flow: + if widget == FlowListBox: + top_items["Select"] = "Select" + else: + top_items["Edit"] = "Edit a flow component" + top_items |= { + "Duplicate": "Duplicate flow", + "Replay": "Replay this flow", + "Export": "Export this flow to file", + "Delete": "Delete flow from view", + } + if widget == FlowListBox: + if focused_flow.marked: + top_items["Unmark"] = "Toggle mark on this flow" + else: + top_items["Mark"] = "Toggle mark on this flow" + top_items["Edit"] = "Edit a flow component" + if focused_flow.intercepted: + top_items["Resume"] = "Resume this intercepted flow" + if focused_flow.modified(): + top_items["Restore"] = "Revert changes to this flow" + if isinstance(focused_flow, HTTPFlow) and focused_flow.response: + top_items["Save body"] = "Save response body to file" + if widget == FlowView: + top_items |= { + "Next flow": "Go to next flow", + "Prev flow": "Go to previous flow", + } + else: + top_items |= { + "Load flows": "Load flows from file", + "Create new": "Create a new flow", + } + elif widget == KeyBindings: + top_label = "Keybindings:" + top_items |= { + "Add": "Add a key binding", + "Edit": "Edit the currently focused key binding", + "Delete": "Unbind the currently focused key binding", + "Execute": "Execute the currently focused key binding", + } + elif widget == Options: + top_label = "Options:" + top_items |= { + "Edit": BasicKeyHelp("โŽ"), + "Reset": "Reset this option", + "Reset all": "Reset all options", + "Load file": "Load from file", + "Save file": "Save to file", + } + elif widget == HelpView: + top_label = "Help:" + top_items |= { + "Scroll down": BasicKeyHelp("โ†“"), + "Scroll up": BasicKeyHelp("โ†‘"), + "Exit help": "Exit help", + "Next tab": BasicKeyHelp("tab"), + } + elif widget == EventLog: + top_label = "Events:" + top_items |= { + "Scroll down": BasicKeyHelp("โ†“"), + "Scroll up": BasicKeyHelp("โ†‘"), + "Clear": "Clear", + } + elif issubclass(widget, FocusEditor): + top_label = f"Edit:" + top_items |= { + "Start edit": BasicKeyHelp("โŽ"), + "Stop edit": BasicKeyHelp("esc"), + "Add row": "Add a row after cursor", + "Delete row": "Delete this row", + } + else: + pass + + bottom_label = "Proxy:" + bottom_items: HelpItems = { + "Help": "View help", + } + if is_root_widget: + bottom_items["Quit"] = "Exit the current view" + else: + bottom_items["Back"] = "Exit the current view" + bottom_items |= { + "Events": "View event log", + "Options": "View options", + "Intercept": "Set intercept", + "Filter": "Set view filter", + } + if focused_flow: + bottom_items |= { + "Save flows": "Save listed flows to file", + "Clear list": "Clear flow list", + } + bottom_items |= { + "Layout": "Cycle to next layout", + "Switch": "Focus next layout pane", + "Follow new": "Set focus follow", + } + + label_len = max(len(top_label), len(bottom_label), 8) + 1 + top_label = top_label.ljust(label_len) + bottom_label = bottom_label.ljust(label_len) + + return QuickHelp(top_label, top_items, bottom_label, bottom_items) + + +def _make_row(label: str, items: HelpItems, keymap: Keymap) -> urwid.Columns: + cols = [ + (len(label), urwid.Text(label)), + ] + for short, long in items.items(): + if isinstance(long, BasicKeyHelp): + key_short = long.key + else: + b = keymap.binding_for_help(long) + if b is None: + continue + key_short = b.key_short() + txt = urwid.Text( + [ + ("heading_inactive", key_short), + " ", + short, + ], + wrap="clip", + ) + cols.append((14, txt)) + + return urwid.Columns(cols) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/searchable.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/searchable.py new file mode 100644 index 0000000000000000000000000000000000000000..15d4e7277178518838fd5a8eae4637db974f1895 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/searchable.py @@ -0,0 +1,89 @@ +import urwid + +from mitmproxy.tools.console import signals + + +class Highlight(urwid.AttrMap): + def __init__(self, t): + urwid.AttrMap.__init__( + self, + urwid.Text(t.text), + "focusfield", + ) + self.backup = t + + +class Searchable(urwid.ListBox): + def __init__(self, contents): + self.walker = urwid.SimpleFocusListWalker(contents) + urwid.ListBox.__init__(self, self.walker) + self.search_offset = 0 + self.current_highlight = None + self.search_term = None + self.last_search = None + + def keypress(self, size, key: str): + if key == "/": + signals.status_prompt.send( + prompt="Search for", text="", callback=self.set_search + ) + elif key == "n": + self.find_next(False) + elif key == "N": + self.find_next(True) + elif key == "m_start": + self.set_focus(0) + self.walker._modified() + elif key == "m_end": + self.set_focus(len(self.walker) - 1) + self.walker._modified() + else: + return super().keypress(size, key) + + def set_search(self, text): + self.last_search = text + self.search_term = text or None + self.find_next(False) + + def set_highlight(self, offset): + if self.current_highlight is not None: + old = self.body[self.current_highlight] + self.body[self.current_highlight] = old.backup + if offset is None: + self.current_highlight = None + else: + self.body[offset] = Highlight(self.body[offset]) + self.current_highlight = offset + + def get_text(self, w): + if isinstance(w, urwid.Text): + return w.text + elif isinstance(w, Highlight): + return w.backup.text + else: + return None + + def find_next(self, backwards: bool): + if not self.search_term: + if self.last_search: + self.search_term = self.last_search + else: + self.set_highlight(None) + return + # Start search at focus + 1 + if backwards: + rng = range(len(self.body) - 1, -1, -1) + else: + rng = range(1, len(self.body) + 1) + for i in rng: + off = (self.focus_position + i) % len(self.body) + w = self.body[off] + txt = self.get_text(w) + if txt and self.search_term in txt: + self.set_highlight(off) + self.set_focus(off, coming_from="above") + self.body._modified() + return + else: + self.set_highlight(None) + signals.status_message.send(message="Search not found.", expire=1) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/signals.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/signals.py new file mode 100644 index 0000000000000000000000000000000000000000..63d5f59a005458aa8e55a81465fc5a45615c4fef --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/signals.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Callable +from typing import Union + +from mitmproxy.utils import signals + +StatusMessage = Union[tuple[str, str], str] + + +# Show a status message in the action bar +# Instead of using this signal directly, consider emitting a log event. +def _status_message(message: StatusMessage, expire: int = 5) -> None: ... + + +status_message = signals.SyncSignal(_status_message) + + +# Prompt for input +def _status_prompt( + prompt: str, text: str | None, callback: Callable[[str], None] +) -> None: ... + + +status_prompt = signals.SyncSignal(_status_prompt) + + +# Prompt for a single keystroke +def _status_prompt_onekey( + prompt: str, keys: list[tuple[str, str]], callback: Callable[[str], None] +) -> None: ... + + +status_prompt_onekey = signals.SyncSignal(_status_prompt_onekey) + + +# Prompt for a command +def _status_prompt_command(partial: str = "", cursor: int | None = None) -> None: ... + + +status_prompt_command = signals.SyncSignal(_status_prompt_command) + + +# Call a callback in N seconds +def _call_in(seconds: float, callback: Callable[[], None]) -> None: ... + + +call_in = signals.SyncSignal(_call_in) + +# Focus the body, footer or header of the main window +focus = signals.SyncSignal(lambda section: None) + +# Fired when settings change +update_settings = signals.SyncSignal(lambda: None) + +# Fired when a flow changes +flow_change = signals.SyncSignal(lambda flow: None) + +# Pop and push view state onto a stack +pop_view_state = signals.SyncSignal(lambda: None) + +# Fired when the window state changes +window_refresh = signals.SyncSignal(lambda: None) + +# Fired when the key bindings change +keybindings_change = signals.SyncSignal(lambda: None) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/statusbar.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/statusbar.py new file mode 100644 index 0000000000000000000000000000000000000000..480676778cada066d5cd8bb08081ab519e4163da --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/statusbar.py @@ -0,0 +1,366 @@ +from __future__ import annotations + +from collections.abc import Callable +from functools import lru_cache + +import urwid + +import mitmproxy.tools.console.master +from mitmproxy.tools.console import commandexecutor +from mitmproxy.tools.console import common +from mitmproxy.tools.console import flowlist +from mitmproxy.tools.console import quickhelp +from mitmproxy.tools.console import signals +from mitmproxy.tools.console.commander import commander +from mitmproxy.utils import human + + +@lru_cache +def shorten_message( + msg: tuple[str, str] | str, max_width: int +) -> list[tuple[str, str]]: + """ + Shorten message so that it fits into a single line in the statusbar. + """ + if isinstance(msg, tuple): + disp_attr, msg_text = msg + elif isinstance(msg, str): + msg_text = msg + disp_attr = "" + else: + raise AssertionError(f"Unexpected message type: {type(msg)}") + msg_end = "\u2026" # unicode ellipsis for the end of shortened message + prompt = "(more in eventlog)" + + msg_lines = msg_text.split("\n") + first_line = msg_lines[0] + if len(msg_lines) > 1: + # First line of messages with a few lines must end with prompt. + line_length = len(first_line) + len(prompt) + else: + line_length = len(first_line) + + if line_length > max_width: + shortening_index = max(0, max_width - len(prompt) - len(msg_end)) + first_line = first_line[:shortening_index] + msg_end + else: + if len(msg_lines) == 1: + prompt = "" + + return [(disp_attr, first_line), ("warn", prompt)] + + +class ActionBar(urwid.WidgetWrap): + def __init__(self, master: mitmproxy.tools.console.master.ConsoleMaster) -> None: + self.master = master + self.top = urwid.WidgetWrap(urwid.Text("")) + self.bottom = urwid.WidgetWrap(urwid.Text("")) + super().__init__(urwid.Pile([self.top, self.bottom])) + self.show_quickhelp() + signals.status_message.connect(self.sig_message) + signals.status_prompt.connect(self.sig_prompt) + signals.status_prompt_onekey.connect(self.sig_prompt_onekey) + signals.status_prompt_command.connect(self.sig_prompt_command) + signals.window_refresh.connect(self.sig_update) + master.view.focus.sig_change.connect(self.sig_update) + master.view.sig_view_update.connect(self.sig_update) + master.options.subscribe(self.sig_options_update, ["console_quickhelp_visible"]) + + self.prompting: Callable[[str], None] | None = None + + self.onekey: set[str] | None = None + + def ensure_bottom_bar_is_visible(self) -> None: + pile: urwid.Pile = self._w # type: ignore[has-type] + current_widgets = [w for w, _ in pile.contents] + if current_widgets != [self.top, self.bottom]: + self._w = urwid.Pile([self.top, self.bottom]) + + def sig_update(self, flow=None) -> None: + if not self.prompting and (flow is None or flow == self.master.view.focus.flow): + self.show_quickhelp() + + def sig_options_update(self, options, updated) -> None: + self.show_quickhelp() + + def sig_message( + self, message: tuple[str, str] | str, expire: int | None = 1 + ) -> None: + if self.prompting: + return + # Ensure widgets are visible for messages + self.ensure_bottom_bar_is_visible() + cols, _ = self.master.ui.get_cols_rows() + w = urwid.Text(shorten_message(message, cols)) + self.top._w = w + self.bottom._w = urwid.Text("") + if expire: + + def cb(): + if w == self.top._w: + self.show_quickhelp() + + signals.call_in.send(seconds=expire, callback=cb) + + def sig_prompt( + self, prompt: str, text: str | None, callback: Callable[[str], None] + ) -> None: + self.ensure_bottom_bar_is_visible() + signals.focus.send(section="footer") + self.top._w = urwid.Edit(f"{prompt.strip()}: ", text or "") + self.bottom._w = urwid.Text("") + self.prompting = callback + + def sig_prompt_command(self, partial: str = "", cursor: int | None = None) -> None: + self.ensure_bottom_bar_is_visible() + signals.focus.send(section="footer") + self.top._w = commander.CommandEdit( + self.master, + partial, + ) + if cursor is not None: + self.top._w.cbuf.cursor = cursor + self.bottom._w = urwid.Text("") + self.prompting = self.execute_command + + def execute_command(self, txt: str) -> None: + if txt.strip(): + self.master.commands.call("commands.history.add", txt) + execute = commandexecutor.CommandExecutor(self.master) + execute(txt) + + def sig_prompt_onekey( + self, prompt: str, keys: list[tuple[str, str]], callback: Callable[[str], None] + ) -> None: + """ + Keys are a set of (word, key) tuples. The appropriate key in the + word is highlighted. + """ + self.ensure_bottom_bar_is_visible() + signals.focus.send(section="footer") + parts = [prompt, " ("] + mkup = [] + for i, e in enumerate(keys): + mkup.extend(common.highlight_key(e[0], e[1])) + if i < len(keys) - 1: + mkup.append(",") + parts.extend(mkup) + parts.append(")? ") + self.onekey = {i[1] for i in keys} + self.top._w = urwid.Edit(parts, "") + self.bottom._w = urwid.Text("") + self.prompting = callback + + def selectable(self) -> bool: + return True + + def keypress(self, size, k): + if self.prompting: + if k == "esc": + self.prompt_done() + elif self.onekey: + if k == "enter": + self.prompt_done() + elif k in self.onekey: + self.prompt_execute(k) + elif k == "enter": + text = self.top._w.get_edit_text() + self.prompt_execute(text) + else: + if common.is_keypress(k): + self.top._w.keypress(size, k) + else: + return k + + def show_quickhelp(self) -> None: + if not self.master.options.console_quickhelp_visible: + self._w = urwid.Pile([]) + return + self.ensure_bottom_bar_is_visible() + if w := self.master.window: + s = w.focus_stack() + focused_widget = type(s.top_widget()) + is_top_widget = len(s.stack) == 1 + else: # on startup + focused_widget = flowlist.FlowListBox + is_top_widget = True + focused_flow = self.master.view.focus.flow + qh = quickhelp.make(focused_widget, focused_flow, is_top_widget) + self.top._w, self.bottom._w = qh.make_rows(self.master.keymap) + + def prompt_done(self) -> None: + self.prompting = None + self.onekey = None + self.show_quickhelp() + signals.focus.send(section="body") + + def prompt_execute(self, txt) -> None: + callback = self.prompting + assert callback is not None + self.prompt_done() + msg = callback(txt) + if msg: + signals.status_message.send(message=msg, expire=1) + + +class StatusBar(urwid.WidgetWrap): + REFRESHTIME = 0.5 # Timed refresh time in seconds + keyctx = "" + + def __init__(self, master: mitmproxy.tools.console.master.ConsoleMaster) -> None: + self.master = master + self.ib = urwid.WidgetWrap(urwid.Text("")) + self.ab = ActionBar(self.master) + super().__init__(urwid.Pile([self.ib, self.ab])) + signals.flow_change.connect(self.sig_update) + signals.update_settings.connect(self.sig_update) + master.options.changed.connect(self.sig_update) + master.view.focus.sig_change.connect(self.sig_update) + master.view.sig_view_add.connect(self.sig_update) + self.refresh() + + def refresh(self) -> None: + self.redraw() + signals.call_in.send(seconds=self.REFRESHTIME, callback=self.refresh) + + def sig_update(self, *args, **kwargs) -> None: + self.redraw() + + def keypress(self, *args, **kwargs): + return self.ab.keypress(*args, **kwargs) + + def get_status(self) -> list[tuple[str, str] | str]: + r: list[tuple[str, str] | str] = [] + + sreplay = self.master.commands.call("replay.server.count") + creplay = self.master.commands.call("replay.client.count") + + if len(self.master.options.modify_headers): + r.append("[") + r.append(("heading_key", "H")) + r.append("eaders]") + if len(self.master.options.modify_body): + r.append("[%d body modifications]" % len(self.master.options.modify_body)) + if creplay: + r.append("[") + r.append(("heading_key", "cplayback")) + r.append(":%s]" % creplay) + if sreplay: + r.append("[") + r.append(("heading_key", "splayback")) + r.append(":%s]" % sreplay) + if self.master.options.ignore_hosts: + r.append("[") + r.append(("heading_key", "I")) + r.append("gnore:%d]" % len(self.master.options.ignore_hosts)) + elif self.master.options.allow_hosts: + r.append("[") + r.append(("heading_key", "A")) + r.append("llow:%d]" % len(self.master.options.allow_hosts)) + if self.master.options.tcp_hosts: + r.append("[") + r.append(("heading_key", "T")) + r.append("CP:%d]" % len(self.master.options.tcp_hosts)) + if self.master.options.intercept: + r.append("[") + if not self.master.options.intercept_active: + r.append("X") + r.append(("heading_key", "i")) + r.append(":%s]" % self.master.options.intercept) + if self.master.options.view_filter: + r.append("[") + r.append(("heading_key", "f")) + r.append(":%s]" % self.master.options.view_filter) + if self.master.options.stickycookie: + r.append("[") + r.append(("heading_key", "t")) + r.append(":%s]" % self.master.options.stickycookie) + if self.master.options.stickyauth: + r.append("[") + r.append(("heading_key", "u")) + r.append(":%s]" % self.master.options.stickyauth) + if self.master.options.console_default_contentview != "auto": + r.append( + "[contentview:%s]" % (self.master.options.console_default_contentview) + ) + if self.master.options.has_changed("view_order"): + r.append("[") + r.append(("heading_key", "o")) + r.append(":%s]" % self.master.options.view_order) + + opts = [] + if self.master.options.anticache: + opts.append("anticache") + if self.master.options.anticomp: + opts.append("anticomp") + if self.master.options.showhost: + opts.append("showhost") + if not self.master.options.server_replay_refresh: + opts.append("norefresh") + if not self.master.options.upstream_cert: + opts.append("no-upstream-cert") + if self.master.options.console_focus_follow: + opts.append("following") + if self.master.options.stream_large_bodies: + opts.append(self.master.options.stream_large_bodies) + + if opts: + r.append("[%s]" % (":".join(opts))) + + if self.master.options.mode != ["regular"]: + if len(self.master.options.mode) == 1: + r.append(f"[{self.master.options.mode[0]}]") + else: + r.append(f"[modes:{len(self.master.options.mode)}]") + if self.master.options.scripts: + r.append("[scripts:%s]" % len(self.master.options.scripts)) + + if self.master.options.save_stream_file: + r.append("[W:%s]" % self.master.options.save_stream_file) + + return r + + def redraw(self) -> None: + fc = self.master.commands.execute("view.properties.length") + if self.master.view.focus.index is None: + offset = 0 + else: + offset = self.master.view.focus.index + 1 + + if self.master.options.view_order_reversed: + arrow = common.SYMBOL_UP + else: + arrow = common.SYMBOL_DOWN + + marked = "" + if self.master.commands.execute("view.properties.marked"): + marked = "M" + + t: list[tuple[str, str] | str] = [ + ("heading", f"{arrow} {marked} [{offset}/{fc}]".ljust(11)), + ] + + listen_addrs: list[str] = list( + dict.fromkeys( + human.format_address(a) + for a in self.master.addons.get("proxyserver").listen_addrs() + ) + ) + if listen_addrs: + boundaddr = f"[{', '.join(listen_addrs)}]" + else: + boundaddr = "" + t.extend(self.get_status()) + status = urwid.AttrMap( + urwid.Columns( + [ + urwid.Text(t), + urwid.Text(boundaddr, align="right"), + ] + ), + "heading", + ) + self.ib._w = status + + def selectable(self) -> bool: + return True diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/tabs.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/tabs.py new file mode 100644 index 0000000000000000000000000000000000000000..adf9c481f9cadc722580ce1ab5b16257c4fe9cb0 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/tabs.py @@ -0,0 +1,58 @@ +import urwid + + +class Tab(urwid.WidgetWrap): + def __init__(self, offset, content, attr, onclick): + """ + onclick is called on click with the tab offset as argument + """ + p = urwid.Text(content, align="center") + p = urwid.Padding(p, align="center", width=("relative", 100)) + p = urwid.AttrMap(p, attr) + urwid.WidgetWrap.__init__(self, p) + self.offset = offset + self.onclick = onclick + + def mouse_event(self, size, event, button, col, row, focus): + if event == "mouse press" and button == 1: + self.onclick(self.offset) + return True + + +class Tabs(urwid.WidgetWrap): + def __init__(self, tabs, tab_offset=0): + super().__init__(urwid.Pile([])) + self.tab_offset = tab_offset + self.tabs = tabs + self.show() + + def change_tab(self, offset): + self.tab_offset = offset + self.show() + + def keypress(self, size, key): + n = len(self.tabs) + if key == "m_next": + self.change_tab((self.tab_offset + 1) % n) + elif key == "right": + self.change_tab((self.tab_offset + 1) % n) + elif key == "left": + self.change_tab((self.tab_offset - 1) % n) + return self._w.keypress(size, key) + + def show(self): + if not self.tabs: + return + + headers = [] + for i in range(len(self.tabs)): + txt = self.tabs[i][0]() + if i == self.tab_offset % len(self.tabs): + headers.append(Tab(i, txt, "heading", self.change_tab)) + else: + headers.append(Tab(i, txt, "heading_inactive", self.change_tab)) + headers = urwid.Columns(headers, dividechars=1) + self._w = urwid.Frame( + body=self.tabs[self.tab_offset % len(self.tabs)][1](), header=headers + ) + self._w.focus_position = "body" diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/console/window.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/window.py new file mode 100644 index 0000000000000000000000000000000000000000..baeec5be8512b5a88127ce1538c20f7d3fb82dd9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/console/window.py @@ -0,0 +1,318 @@ +import logging +import re + +import urwid + +from mitmproxy import flow +from mitmproxy.tools.console import commands +from mitmproxy.tools.console import common +from mitmproxy.tools.console import eventlog +from mitmproxy.tools.console import flowlist +from mitmproxy.tools.console import flowview +from mitmproxy.tools.console import grideditor +from mitmproxy.tools.console import help +from mitmproxy.tools.console import keybindings +from mitmproxy.tools.console import options +from mitmproxy.tools.console import overlay +from mitmproxy.tools.console import signals +from mitmproxy.tools.console import statusbar + + +class StackWidget(urwid.Frame): + def __init__(self, window, widget, title, focus): + self.is_focused = focus + self.window = window + + if title: + header = urwid.AttrMap( + urwid.Text(title), "heading" if focus else "heading_inactive" + ) + else: + header = None + super().__init__(widget, header=header) + + def mouse_event(self, size, event, button, col, row, focus): + if event == "mouse press" and button == 1 and not self.is_focused: + self.window.switch() + return super().mouse_event(size, event, button, col, row, focus) + + def keypress(self, size, key): + # Make sure that we don't propagate cursor events outside of the widget. + # Otherwise, in a horizontal layout, urwid's Pile would change the focused widget + # if we cannot scroll any further. + ret = super().keypress(size, key) + command = self._command_map[ + ret + ] # awkward as they don't implement a full dict api + if command and command.startswith("cursor"): + return None + return ret + + +class WindowStack: + def __init__(self, master, base): + self.master = master + self.windows = dict( + flowlist=flowlist.FlowListBox(master), + flowview=flowview.FlowView(master), + commands=commands.Commands(master), + keybindings=keybindings.KeyBindings(master), + options=options.Options(master), + help=help.HelpView(master), + eventlog=eventlog.EventLog(master), + edit_focus_query=grideditor.QueryEditor(master), + edit_focus_comment=grideditor.CommentEditor(master), + edit_focus_cookies=grideditor.CookieEditor(master), + edit_focus_setcookies=grideditor.SetCookieEditor(master), + edit_focus_setcookie_attrs=grideditor.CookieAttributeEditor(master), + edit_focus_multipart_form=grideditor.RequestMultipartEditor(master), + edit_focus_urlencoded_form=grideditor.RequestUrlEncodedEditor(master), + edit_focus_path=grideditor.PathEditor(master), + edit_focus_request_headers=grideditor.RequestHeaderEditor(master), + edit_focus_response_headers=grideditor.ResponseHeaderEditor(master), + ) + self.stack = [base] + self.overlay = None + + def set_overlay(self, o, **kwargs): + self.overlay = overlay.SimpleOverlay( + self, + o, + self.top_widget(), + o.width, + **kwargs, + ) + + def top_window(self): + """ + The current top window, ignoring overlays. + """ + return self.windows[self.stack[-1]] + + def top_widget(self): + """ + The current top widget - either a window or the active overlay. + """ + if self.overlay: + return self.overlay + return self.top_window() + + def push(self, wname): + if self.stack[-1] == wname: + return + prev = self.top_window() + self.stack.append(wname) + self.call("layout_pushed", prev) + + def pop(self, *args, **kwargs): + """ + Pop off the stack, return True if we're already at the top. + """ + if not self.overlay and len(self.stack) == 1: + return True + self.call("layout_popping") + if self.overlay: + self.overlay = None + else: + self.stack.pop() + + def call(self, name, *args, **kwargs): + """ + Call a function on both the top window, and the overlay if there is + one. If the widget has a key_responder, we call the function on the + responder instead. + """ + getattr(self.top_window(), name)(*args, **kwargs) + if self.overlay: + getattr(self.overlay, name)(*args, **kwargs) + + +class Window(urwid.Frame): + def __init__(self, master): + self.statusbar = statusbar.StatusBar(master) + super().__init__( + None, header=None, footer=urwid.AttrMap(self.statusbar, "background") + ) + self.master = master + self.master.view.sig_view_refresh.connect(self.view_changed) + self.master.view.sig_view_add.connect(self.view_changed) + self.master.view.sig_view_remove.connect(self.view_changed) + self.master.view.sig_view_update.connect(self.view_changed) + self.master.view.focus.sig_change.connect(self.view_changed) + self.master.view.focus.sig_change.connect(self.focus_changed) + + signals.focus.connect(self.sig_focus) + signals.flow_change.connect(self.flow_changed) + signals.pop_view_state.connect(self.pop) + + self.master.options.subscribe( + self.configure, ["console_layout", "console_layout_headers"] + ) + self.pane = 0 + self.stacks = [WindowStack(master, "flowlist"), WindowStack(master, "eventlog")] + + def focus_stack(self): + return self.stacks[self.pane] + + def configure(self, options, updated): + self.refresh() + + def refresh(self): + """ + Redraw the layout. + """ + c = self.master.options.console_layout + if c == "single": + self.pane = 0 + + def wrapped(idx): + widget = self.stacks[idx].top_widget() + if self.master.options.console_layout_headers: + title = self.stacks[idx].top_window().title + else: + title = None + return StackWidget(self, widget, title, self.pane == idx) + + w = None + if c == "single": + w = wrapped(0) + elif c == "vertical": + w = urwid.Pile( + [wrapped(i) for i, s in enumerate(self.stacks)], focus_item=self.pane + ) + else: + w = urwid.Columns( + [wrapped(i) for i, s in enumerate(self.stacks)], + dividechars=1, + focus_column=self.pane, + ) + + self.body = urwid.AttrMap(w, "background") + signals.window_refresh.send() + + def flow_changed(self, flow: flow.Flow) -> None: + if self.master.view.focus.flow: + if flow.id == self.master.view.focus.flow.id: + self.focus_changed() + + def focus_changed(self, *args, **kwargs): + """ + Triggered when the focus changes - either when it's modified, or + when it changes to a different flow altogether. + """ + for i in self.stacks: + i.call("focus_changed") + + def view_changed(self, *args, **kwargs): + """ + Triggered when the view list has changed. + """ + for i in self.stacks: + i.call("view_changed") + + def set_overlay(self, o, **kwargs): + """ + Set an overlay on the currently focused stack. + """ + self.focus_stack().set_overlay(o, **kwargs) + self.refresh() + + def push(self, wname): + """ + Push a window onto the currently focused stack. + """ + self.focus_stack().push(wname) + self.refresh() + self.view_changed() + self.focus_changed() + + def pop(self) -> None: + """ + Pop a window from the currently focused stack. If there is only one + window on the stack, this prompts for exit. + """ + if self.focus_stack().pop(): + self.master.prompt_for_exit() + else: + self.refresh() + self.view_changed() + self.focus_changed() + + def stacks_sorted_by_focus(self): + """ + Returns: + self.stacks, with the focused stack first. + """ + stacks = self.stacks.copy() + stacks.insert(0, stacks.pop(self.pane)) + return stacks + + def current(self, keyctx): + """ + Returns the active widget with a matching key context, including overlays. + If multiple stacks have an active widget with a matching key context, + the currently focused stack is preferred. + """ + for s in self.stacks_sorted_by_focus(): + t = s.top_widget() + if t.keyctx == keyctx: + return t + + def current_window(self, keyctx): + """ + Returns the active window with a matching key context, ignoring overlays. + If multiple stacks have an active widget with a matching key context, + the currently focused stack is preferred. + """ + for s in self.stacks_sorted_by_focus(): + t = s.top_window() + if t.keyctx == keyctx: + return t + + def sig_focus(self, section): + self.focus_position = section + + def switch(self): + """ + Switch between the two panes. + """ + if self.master.options.console_layout == "single": + self.pane = 0 + else: + self.pane = (self.pane + 1) % len(self.stacks) + self.refresh() + + def mouse_event(self, *args, **kwargs): + # args: (size, event, button, col, row) + k = super().mouse_event(*args, **kwargs) + if not k: + if args[1] == "mouse drag": + signals.status_message.send( + message="Hold down fn, shift, alt or ctrl to select text or use the --set console_mouse=false parameter.", + expire=1, + ) + elif args[1] == "mouse press" and args[2] == 4: + self.keypress(args[0], "up") + elif args[1] == "mouse press" and args[2] == 5: + self.keypress(args[0], "down") + else: + return False + return True + + def keypress(self, size, k): + k = super().keypress(size, k) + if k: + return self.master.keymap.handle(self.focus_stack().top_widget().keyctx, k) + + +class Screen(urwid.raw_display.Screen): + def __init__(self) -> None: + super().__init__() + self.logger = logging.getLogger("urwid") + + def write(self, data): + if common.IS_WINDOWS_OR_WSL: + # replace urwid's SI/SO, which produce artifacts under WSL. + # at some point we may figure out what they actually do. + data = re.sub("[\x0e\x0f]", "", data) + super().write(data) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/dump.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/dump.py new file mode 100644 index 0000000000000000000000000000000000000000..2f815b46be1d453d2603cecec60c9e9e022f08fc --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/dump.py @@ -0,0 +1,26 @@ +from mitmproxy import addons +from mitmproxy import master +from mitmproxy import options +from mitmproxy.addons import dumper +from mitmproxy.addons import errorcheck +from mitmproxy.addons import keepserving +from mitmproxy.addons import readfile + + +class DumpMaster(master.Master): + def __init__( + self, + options: options.Options, + loop=None, + with_termlog=True, + with_dumper=True, + ) -> None: + super().__init__(options, event_loop=loop, with_termlog=with_termlog) + self.addons.add(*addons.default_addons()) + if with_dumper: + self.addons.add(dumper.Dumper()) + self.addons.add( + keepserving.KeepServing(), + readfile.ReadFileStdin(), + errorcheck.ErrorCheck(), + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/main.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/main.py new file mode 100644 index 0000000000000000000000000000000000000000..eabdc6c8be7a675435a3dde3c1b82ff72fd298bc --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/main.py @@ -0,0 +1,174 @@ +from __future__ import annotations + +import argparse +import asyncio +import logging +import os +import signal +import sys +from collections.abc import Callable +from collections.abc import Sequence +from typing import Any +from typing import TypeVar + +from mitmproxy import exceptions +from mitmproxy import master +from mitmproxy import options +from mitmproxy import optmanager +from mitmproxy.tools import cmdline +from mitmproxy.utils import arg_check +from mitmproxy.utils import debug + + +def process_options(parser, opts, args): + if args.version: + print(debug.dump_system_info()) + sys.exit(0) + if args.quiet or args.options or args.commands: + # also reduce log verbosity if --options or --commands is passed, + # we don't want log messages from regular startup then. + args.termlog_verbosity = "error" + args.flow_detail = 0 + if args.verbose: + args.termlog_verbosity = "debug" + args.flow_detail = 2 + + adict = { + key: val for key, val in vars(args).items() if key in opts and val is not None + } + opts.update(**adict) + + +T = TypeVar("T", bound=master.Master) + + +def run( + master_cls: type[T], + make_parser: Callable[[options.Options], argparse.ArgumentParser], + arguments: Sequence[str], + extra: Callable[[Any], dict] | None = None, +) -> T: # pragma: no cover + """ + extra: Extra argument processing callable which returns a dict of + options. + """ + + async def main() -> T: + logging.getLogger().setLevel(logging.DEBUG) + logging.getLogger("tornado").setLevel(logging.WARNING) + logging.getLogger("asyncio").setLevel(logging.WARNING) + logging.getLogger("hpack").setLevel(logging.WARNING) + logging.getLogger("urwid").setLevel(logging.INFO) + logging.getLogger("quic").setLevel( + logging.WARNING + ) # aioquic uses a different prefix... + debug.register_info_dumpers() + + opts = options.Options() + master = master_cls(opts) + + parser = make_parser(opts) + + # To make migration from 2.x to 3.0 bearable. + if "-R" in sys.argv and sys.argv[sys.argv.index("-R") + 1].startswith("http"): + print( + "To use mitmproxy in reverse mode please use --mode reverse:SPEC instead" + ) + + try: + args = parser.parse_args(arguments) + except SystemExit: + arg_check.check() + sys.exit(1) + + try: + opts.set(*args.setoptions, defer=True) + optmanager.load_paths( + opts, + os.path.join(opts.confdir, "config.yaml"), + os.path.join(opts.confdir, "config.yml"), + ) + process_options(parser, opts, args) + + if args.options: + # Load custom addons so that their options are registered + if sl := master.addons.get("scriptloader"): + for s in sl.addons: + if s.ns is None: + s.loadscript() + optmanager.dump_defaults(opts, sys.stdout) + sys.exit(0) + if args.commands: + master.commands.dump() + sys.exit(0) + if extra: + if args.filter_args: + logging.info( + f'Only processing flows that match "{" & ".join(args.filter_args)}"' + ) + opts.update(**extra(args)) + + except exceptions.OptionsError as e: + print(f"{sys.argv[0]}: {e}", file=sys.stderr) + sys.exit(1) + + loop = asyncio.get_running_loop() + + def _sigint(*_): + loop.call_soon_threadsafe( + getattr(master, "prompt_for_exit", master.shutdown) + ) + + def _sigterm(*_): + loop.call_soon_threadsafe(master.shutdown) + + try: + # Prefer loop.add_signal_handler where it is available + # https://github.com/mitmproxy/mitmproxy/issues/7128 + loop.add_signal_handler(signal.SIGINT, _sigint) + loop.add_signal_handler(signal.SIGTERM, _sigterm) + except NotImplementedError: + # Fall back to `signal.signal` for platforms where that is not available (Windows' Proactorloop) + signal.signal(signal.SIGINT, _sigint) + signal.signal(signal.SIGTERM, _sigterm) + + # to fix the issue mentioned https://github.com/mitmproxy/mitmproxy/issues/6744 + # by setting SIGPIPE to SIG_IGN, the process will not terminate and continue to run + if hasattr(signal, "SIGPIPE"): + signal.signal(signal.SIGPIPE, signal.SIG_IGN) + + await master.run() + return master + + return asyncio.run(main()) + + +def mitmproxy(args=None) -> int | None: # pragma: no cover + from mitmproxy.tools import console + + run(console.master.ConsoleMaster, cmdline.mitmproxy, args) + return None + + +def mitmdump(args=None) -> int | None: # pragma: no cover + from mitmproxy.tools import dump + + def extra(args): + if args.filter_args: + v = " ".join(args.filter_args) + return dict( + save_stream_filter=v, + readfile_filter=v, + dumper_filter=v, + ) + return {} + + run(dump.DumpMaster, cmdline.mitmdump, args, extra) + return None + + +def mitmweb(args=None) -> int | None: # pragma: no cover + from mitmproxy.tools import web + + run(web.master.WebMaster, cmdline.mitmweb, args) + return None diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__init__.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..708a2195c0b1623b3fd92bbe410a8544a7d93456 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__init__.py @@ -0,0 +1,3 @@ +from mitmproxy.tools.web import master + +__all__ = ["master"] diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/__init__.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc3d9bbeb805470434a620f18b2555259f32e4b7 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/__init__.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/app.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/app.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50d1f15de9913c13f52c806afdc3f88848a65c69 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/app.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/master.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/master.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2778f3419b17092f9320e88f6edcb65b4a574e71 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/master.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/static_viewer.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/static_viewer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98b206599268bc00a018ed79e5185745a1024c5a Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/static_viewer.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/web_columns.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/web_columns.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff1570ac093077289188885089c6c3c4ec07c996 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/web_columns.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/webaddons.cpython-313.pyc b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/webaddons.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40e1456cec5cb34c85dd5de484494336476f2b21 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/__pycache__/webaddons.cpython-313.pyc differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/app.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/app.py new file mode 100644 index 0000000000000000000000000000000000000000..1989bd2e9ded9bd0ffad40bfdd69832e0d43adcd --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/app.py @@ -0,0 +1,939 @@ +from __future__ import annotations + +import asyncio +import functools +import hashlib +import json +import logging +import mimetypes +import os.path +import re +import secrets +import sys +from collections.abc import Callable +from collections.abc import Sequence +from io import BytesIO +from typing import Any +from typing import Awaitable +from typing import ClassVar +from typing import Concatenate +from typing import Literal +from typing import Optional + +import tornado.escape +import tornado.web +import tornado.websocket + +import mitmproxy.flow +import mitmproxy.tools.web.master +import mitmproxy_rs +from mitmproxy import certs +from mitmproxy import command +from mitmproxy import contentviews +from mitmproxy import flowfilter +from mitmproxy import http +from mitmproxy import io +from mitmproxy import log +from mitmproxy import optmanager +from mitmproxy import version +from mitmproxy.dns import DNSFlow +from mitmproxy.http import HTTPFlow +from mitmproxy.tcp import TCPFlow +from mitmproxy.tcp import TCPMessage +from mitmproxy.tools.web.webaddons import WebAuth +from mitmproxy.udp import UDPFlow +from mitmproxy.udp import UDPMessage +from mitmproxy.utils import asyncio_utils +from mitmproxy.utils.emoji import emoji +from mitmproxy.utils.strutils import always_str +from mitmproxy.utils.strutils import cut_after_n_lines +from mitmproxy.websocket import WebSocketMessage + +# Fix for Windows systems where .js files may have text/plain MIME type in registry. +# Modern browsers with ES6 module scripts require proper JavaScript MIME types. +# See: https://github.com/mitmproxy/mitmproxy/issues/7971 +mimetypes.add_type("text/javascript", ".js") + +TRANSPARENT_PNG = ( + b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08" + b"\x04\x00\x00\x00\xb5\x1c\x0c\x02\x00\x00\x00\x0bIDATx\xdac\xfc\xff\x07" + b"\x00\x02\x00\x01\xfc\xa8Q\rh\x00\x00\x00\x00IEND\xaeB`\x82" +) + +logger = logging.getLogger(__name__) + + +def cert_to_json(certs: Sequence[certs.Cert]) -> dict | None: + if not certs: + return None + cert = certs[0] + return { + "keyinfo": cert.keyinfo, + "sha256": cert.fingerprint().hex(), + "notbefore": int(cert.notbefore.timestamp()), + "notafter": int(cert.notafter.timestamp()), + "serial": str(cert.serial), + "subject": cert.subject, + "issuer": cert.issuer, + "altnames": [str(x.value) for x in cert.altnames], + } + + +def flow_to_json(flow: mitmproxy.flow.Flow) -> dict: + """ + Remove flow message content and cert to save transmission space. + Args: + flow: The original flow. + Sync with web/src/flow.ts. + """ + f = { + "id": flow.id, + "intercepted": flow.intercepted, + "is_replay": flow.is_replay, + "type": flow.type, + "modified": flow.modified(), + "marked": emoji.get(flow.marked, "๐Ÿ”ด") if flow.marked else "", + "comment": flow.comment, + "timestamp_created": flow.timestamp_created, + } + + if flow.client_conn: + f["client_conn"] = { + "id": flow.client_conn.id, + "peername": flow.client_conn.peername, + "sockname": flow.client_conn.sockname, + "tls_established": flow.client_conn.tls_established, + "cert": cert_to_json(flow.client_conn.certificate_list), + "sni": flow.client_conn.sni, + "cipher": flow.client_conn.cipher, + "alpn": always_str(flow.client_conn.alpn, "ascii", "backslashreplace"), + "tls_version": flow.client_conn.tls_version, + "timestamp_start": flow.client_conn.timestamp_start, + "timestamp_tls_setup": flow.client_conn.timestamp_tls_setup, + "timestamp_end": flow.client_conn.timestamp_end, + } + + if flow.server_conn: + f["server_conn"] = { + "id": flow.server_conn.id, + "peername": flow.server_conn.peername, + "sockname": flow.server_conn.sockname, + "address": flow.server_conn.address, + "tls_established": flow.server_conn.tls_established, + "cert": cert_to_json(flow.server_conn.certificate_list), + "sni": flow.server_conn.sni, + "cipher": flow.server_conn.cipher, + "alpn": always_str(flow.server_conn.alpn, "ascii", "backslashreplace"), + "tls_version": flow.server_conn.tls_version, + "timestamp_start": flow.server_conn.timestamp_start, + "timestamp_tcp_setup": flow.server_conn.timestamp_tcp_setup, + "timestamp_tls_setup": flow.server_conn.timestamp_tls_setup, + "timestamp_end": flow.server_conn.timestamp_end, + } + if flow.error: + f["error"] = flow.error.get_state() + + if isinstance(flow, HTTPFlow): + content_length: int | None + content_hash: str | None + + if flow.request.raw_content is not None: + content_length = len(flow.request.raw_content) + content_hash = hashlib.sha256(flow.request.raw_content).hexdigest() + else: + content_length = None + content_hash = None + f["request"] = { + "method": flow.request.method, + "scheme": flow.request.scheme, + "host": flow.request.host, + "port": flow.request.port, + "path": flow.request.path, + "http_version": flow.request.http_version, + "headers": tuple(flow.request.headers.items(True)), + "contentLength": content_length, + "contentHash": content_hash, + "timestamp_start": flow.request.timestamp_start, + "timestamp_end": flow.request.timestamp_end, + "pretty_host": flow.request.pretty_host, + } + if flow.response: + if flow.response.raw_content is not None: + content_length = len(flow.response.raw_content) + content_hash = hashlib.sha256(flow.response.raw_content).hexdigest() + else: + content_length = None + content_hash = None + f["response"] = { + "http_version": flow.response.http_version, + "status_code": flow.response.status_code, + "reason": flow.response.reason, + "headers": tuple(flow.response.headers.items(True)), + "contentLength": content_length, + "contentHash": content_hash, + "timestamp_start": flow.response.timestamp_start, + "timestamp_end": flow.response.timestamp_end, + } + if flow.response.data.trailers: + f["response"]["trailers"] = tuple( + flow.response.data.trailers.items(True) + ) + + if flow.websocket: + f["websocket"] = { + "messages_meta": { + "contentLength": sum( + len(x.content) for x in flow.websocket.messages + ), + "count": len(flow.websocket.messages), + "timestamp_last": flow.websocket.messages[-1].timestamp + if flow.websocket.messages + else None, + }, + "closed_by_client": flow.websocket.closed_by_client, + "close_code": flow.websocket.close_code, + "close_reason": flow.websocket.close_reason, + "timestamp_end": flow.websocket.timestamp_end, + } + elif isinstance(flow, (TCPFlow, UDPFlow)): + f["messages_meta"] = { + "contentLength": sum(len(x.content) for x in flow.messages), + "count": len(flow.messages), + "timestamp_last": flow.messages[-1].timestamp if flow.messages else None, + } + elif isinstance(flow, DNSFlow): + f["request"] = flow.request.to_json() + if flow.response: + f["response"] = flow.response.to_json() + + return f + + +def logentry_to_json(e: log.LogEntry) -> dict: + return { + "id": id(e), # we just need some kind of id. + "message": e.msg, + "level": e.level, + } + + +class APIError(tornado.web.HTTPError): + pass + + +class AuthRequestHandler(tornado.web.RequestHandler): + AUTH_COOKIE_VALUE = b"y" + + def __init_subclass__(cls, **kwargs): + """Automatically wrap all request handlers with `_require_auth`.""" + for method in cls.SUPPORTED_METHODS: + method = method.lower() + fn = getattr(cls, method) + if fn is not tornado.web.RequestHandler._unimplemented_method: + setattr(cls, method, AuthRequestHandler._require_auth(fn)) + + def auth_fail(self, invalid_password: bool) -> None: + """ + Will be called when returning a 403. + May write a login form as the response. + """ + + @staticmethod + def _require_auth[**P, R]( + fn: Callable[Concatenate[AuthRequestHandler, P], R], + ) -> Callable[Concatenate[AuthRequestHandler, P], R | None]: + @functools.wraps(fn) + def wrapper( + self: AuthRequestHandler, *args: P.args, **kwargs: P.kwargs + ) -> R | None: + if not self.current_user: + password = "" + if auth_header := self.request.headers.get("Authorization"): + auth_scheme, _, auth_params = auth_header.partition(" ") + if auth_scheme == "Bearer": + password = auth_params + + if not password: + password = self.get_argument("token", default="") + + if not self.settings["is_valid_password"](password): + self.set_status(403) + self.auth_fail(bool(password)) + return None + self.set_signed_cookie( + self.settings["auth_cookie_name"](), + self.AUTH_COOKIE_VALUE, + expires_days=400, + httponly=True, + samesite="Strict", + ) + return fn(self, *args, **kwargs) + + return wrapper + + def get_current_user(self) -> bool: + return ( + self.get_signed_cookie(self.settings["auth_cookie_name"](), min_version=2) + == self.AUTH_COOKIE_VALUE + ) + + +class RequestHandler(AuthRequestHandler): + application: Application + + def prepare(self): + if ( + self.request.method not in ("GET", "HEAD", "OPTIONS") + and "Sec-Fetch-Site" in self.request.headers + and self.request.headers["Sec-Fetch-Site"] not in ("same-origin", "none") + ): + raise tornado.httpclient.HTTPError(403) + + def write(self, chunk: str | bytes | dict | list): + # Writing arrays on the top level is ok nowadays. + # http://flask.pocoo.org/docs/0.11/security/#json-security + if isinstance(chunk, list): + chunk = tornado.escape.json_encode(chunk) + self.set_header("Content-Type", "application/json; charset=UTF-8") + super().write(chunk) + + def set_default_headers(self): + super().set_default_headers() + self.set_header("Server", version.MITMPROXY) + self.set_header("X-Frame-Options", "DENY") + self.add_header("X-XSS-Protection", "1; mode=block") + self.add_header("X-Content-Type-Options", "nosniff") + self.add_header( + "Content-Security-Policy", + "default-src 'self'; " + "connect-src 'self' ws:; " + "img-src 'self' data:; " + "style-src 'self' 'unsafe-inline'", + ) + + @property + def json(self): + if not self.request.headers.get("Content-Type", "").startswith( + "application/json" + ): + raise APIError(400, "Invalid Content-Type, expected application/json.") + try: + return json.loads(self.request.body.decode()) + except Exception as e: + raise APIError(400, f"Malformed JSON: {e}") + + @property + def filecontents(self): + """ + Accept either a multipart/form file upload or just take the plain request body. + + """ + if self.request.files: + return next(iter(self.request.files.values()))[0].body + else: + return self.request.body + + @property + def view(self) -> mitmproxy.addons.view.View: + return self.application.master.view + + @property + def master(self) -> mitmproxy.tools.web.master.WebMaster: + return self.application.master + + @property + def flow(self) -> mitmproxy.flow.Flow: + flow_id = str(self.path_kwargs["flow_id"]) + # FIXME: Add a facility to addon.view to safely access the store + flow = self.view.get_by_id(flow_id) + if flow: + return flow + else: + raise APIError(404, "Flow not found.") + + def write_error(self, status_code: int, **kwargs): + if "exc_info" in kwargs and isinstance(kwargs["exc_info"][1], APIError): + self.finish(kwargs["exc_info"][1].log_message) + else: + super().write_error(status_code, **kwargs) + + +class IndexHandler(RequestHandler): + def auth_fail(self, invalid_password: bool) -> None: + self.render("login.html", invalid_password=invalid_password) + + def get(self): + self.render("../index.html") + + post = get # login form + + +class FilterHelp(RequestHandler): + def get(self): + self.write(dict(commands=flowfilter.help)) + + +class WebSocketEventBroadcaster(tornado.websocket.WebSocketHandler, AuthRequestHandler): + # raise an error if inherited class doesn't specify its own instance. + connections: ClassVar[set[WebSocketEventBroadcaster]] + + _send_queue: asyncio.Queue[bytes] + _send_task: asyncio.Task[None] + + def prepare(self) -> Optional[Awaitable[None]]: + token = self.xsrf_token # https://github.com/tornadoweb/tornado/issues/645 + assert token + return None + + def open(self, *args, **kwargs): + self.connections.add(self) + self._send_queue = asyncio.Queue() + # Python 3.13+: use _send_queue.shutdown() and we can use keep_ref=True here. + self._send_task = asyncio_utils.create_task( + self.send_task(), + name="WebSocket send task", + keep_ref=False, + ) + + def on_close(self): + self.connections.discard(self) + self._send_task.cancel() + + @classmethod + def broadcast(cls, **kwargs): + message = cls._json_dumps(kwargs) + for conn in cls.connections: + conn.send(message) + + def send(self, message: bytes): + self._send_queue.put_nowait(message) + + async def send_task(self): + while True: + message = await self._send_queue.get() + try: + await self.write_message(message) + except tornado.websocket.WebSocketClosedError: + self.on_close() + + @staticmethod + def _json_dumps(d): + return json.dumps(d, ensure_ascii=False).encode("utf8", "surrogateescape") + + +class ClientConnection(WebSocketEventBroadcaster): + connections: ClassVar[set[ClientConnection]] = set() # type: ignore + application: Application + + def __init__(self, application: Application, request, **kwargs): + super().__init__(application, request, **kwargs) + self.filters: dict[str, flowfilter.TFilter] = {} # filters per connection + + @classmethod + def broadcast_flow_reset(cls) -> None: + for conn in cls.connections: + conn.send(cls._json_dumps({"type": "flows/reset"})) + for name, expr in conn.filters.copy().items(): + conn.update_filter(name, expr.pattern) + + @classmethod + def broadcast_flow( + cls, + type: Literal["flows/add", "flows/update"], + f: mitmproxy.flow.Flow, + ) -> None: + flow_json = flow_to_json(f) + for conn in cls.connections: + conn._broadcast_flow(type, f, flow_json) + + def _broadcast_flow( + self, + type: Literal["flows/add", "flows/update"], + f: mitmproxy.flow.Flow, + flow_json: dict, # Passing the flow_json dictionary to avoid recalculating it for each client + ) -> None: + filters = {name: bool(expr(f)) for name, expr in self.filters.items()} + message = self._json_dumps( + { + "type": type, + "payload": { + "flow": flow_json, + "matching_filters": filters, + }, + }, + ) + self.send(message) + + def update_filter(self, name: str, expr: str) -> None: + if expr: + filt = flowfilter.parse(expr) + self.filters[name] = filt + matching_flow_ids = [f.id for f in self.application.master.view if filt(f)] + else: + self.filters.pop(name, None) + matching_flow_ids = None + + message = self._json_dumps( + { + "type": "flows/filterUpdate", + "payload": { + "name": name, + "matching_flow_ids": matching_flow_ids, + }, + }, + ) + self.send(message=message) + + async def on_message(self, message: str | bytes): + try: + data = json.loads(message) + match data["type"]: + case "flows/updateFilter": + self.update_filter(data["payload"]["name"], data["payload"]["expr"]) + case other: + raise ValueError(f"Unsupported command: {other}") + except Exception as e: + logger.error(f"Error processing message from {self}: {e}") + self.close(code=1011, reason="Internal server error.") + + +class Flows(RequestHandler): + def get(self): + self.write([flow_to_json(f) for f in self.view]) + + +class DumpFlows(RequestHandler): + def get(self) -> None: + self.set_header("Content-Disposition", "attachment; filename=flows") + self.set_header("Content-Type", "application/octet-stream") + + match: Callable[[mitmproxy.flow.Flow], bool] + try: + match = flowfilter.parse(self.request.arguments["filter"][0].decode()) + except ValueError: # thrown py flowfilter.parse if filter is invalid + raise APIError(400, f"Invalid filter argument / regex") + except ( + KeyError, + IndexError, + ): # Key+Index: ["filter"][0] can fail, if it's not set + + def match(_) -> bool: + return True + + with BytesIO() as bio: + fw = io.FlowWriter(bio) + for f in self.view: + if match(f): + fw.add(f) + self.write(bio.getvalue()) + + async def post(self): + self.view.clear() + bio = BytesIO(self.filecontents) + for f in io.FlowReader(bio).stream(): + await self.master.load_flow(f) + bio.close() + + +class ClearAll(RequestHandler): + def post(self): + self.view.clear() + self.master.events.clear() + + +class ResumeFlows(RequestHandler): + def post(self): + for f in self.view: + if not f.intercepted: + continue + f.resume() + self.view.update([f]) + + +class KillFlows(RequestHandler): + def post(self): + for f in self.view: + if f.killable: + f.kill() + self.view.update([f]) + + +class ResumeFlow(RequestHandler): + def post(self, flow_id): + self.flow.resume() + self.view.update([self.flow]) + + +class KillFlow(RequestHandler): + def post(self, flow_id): + if self.flow.killable: + self.flow.kill() + self.view.update([self.flow]) + + +class FlowHandler(RequestHandler): + def delete(self, flow_id): + if self.flow.killable: + self.flow.kill() + self.view.remove([self.flow]) + + def put(self, flow_id) -> None: + flow: mitmproxy.flow.Flow = self.flow + flow.backup() + try: + for a, b in self.json.items(): + if a == "request" and hasattr(flow, "request"): + request: mitmproxy.http.Request = flow.request + for k, v in b.items(): + if k in ["method", "scheme", "host", "path", "http_version"]: + setattr(request, k, str(v)) + elif k == "port": + request.port = int(v) + elif k == "headers": + request.headers.clear() + for header in v: + request.headers.add(*header) + elif k == "trailers": + if request.trailers is not None: + request.trailers.clear() + else: + request.trailers = mitmproxy.http.Headers() + for trailer in v: + request.trailers.add(*trailer) + elif k == "content": + request.text = v + else: + raise APIError(400, f"Unknown update request.{k}: {v}") + + elif a == "response" and hasattr(flow, "response"): + response: mitmproxy.http.Response = flow.response + for k, v in b.items(): + if k in ["msg", "http_version"]: + setattr(response, k, str(v)) + elif k == "code": + response.status_code = int(v) + elif k == "headers": + response.headers.clear() + for header in v: + response.headers.add(*header) + elif k == "trailers": + if response.trailers is not None: + response.trailers.clear() + else: + response.trailers = mitmproxy.http.Headers() + for trailer in v: + response.trailers.add(*trailer) + elif k == "content": + response.text = v + else: + raise APIError(400, f"Unknown update response.{k}: {v}") + elif a == "marked": + flow.marked = b + elif a == "comment": + flow.comment = b + else: + raise APIError(400, f"Unknown update {a}: {b}") + except APIError: + flow.revert() + raise + self.view.update([flow]) + + +class DuplicateFlow(RequestHandler): + def post(self, flow_id): + f = self.flow.copy() + self.view.add([f]) + self.write(f.id) + + +class RevertFlow(RequestHandler): + def post(self, flow_id): + if self.flow.modified(): + self.flow.revert() + self.view.update([self.flow]) + + +class ReplayFlow(RequestHandler): + def post(self, flow_id): + self.master.commands.call("replay.client", [self.flow]) + + +class FlowContent(RequestHandler): + def post(self, flow_id, message): + self.flow.backup() + message = getattr(self.flow, message) + message.content = self.filecontents + self.view.update([self.flow]) + + def get(self, flow_id, message): + message = getattr(self.flow, message) + assert isinstance(self.flow, HTTPFlow) + + original_cd = message.headers.get("Content-Disposition", None) + filename = None + if original_cd: + if m := re.search(r'filename=([-\w" .()]+)', original_cd): + filename = m.group(1) + if not filename: + filename = self.flow.request.path.split("?")[0].split("/")[-1] + + filename = re.sub(r'[^-\w" .()]', "", filename) + cd = f"attachment; {filename=!s}" + self.set_header("Content-Disposition", cd) + self.set_header("Content-Type", "application/text") + self.set_header("X-Content-Type-Options", "nosniff") + self.set_header("X-Frame-Options", "DENY") + self.write(message.get_content(strict=False)) + + +class FlowContentView(RequestHandler): + def message_to_json( + self, + view_name: str, + message: http.Message | TCPMessage | UDPMessage | WebSocketMessage, + flow: HTTPFlow | TCPFlow | UDPFlow, + max_lines: int | None = None, + from_client: bool | None = None, + timestamp: float | None = None, + ): + if view_name and view_name.lower() == "auto": + view_name = "auto" + pretty = contentviews.prettify_message(message, flow, view_name=view_name) + if max_lines: + pretty.text = cut_after_n_lines(pretty.text, max_lines) + + ret: dict[str, Any] = dict( + text=pretty.text, + view_name=pretty.view_name, + syntax_highlight=pretty.syntax_highlight, + description=pretty.description, + ) + if from_client is not None: + ret["from_client"] = from_client + if timestamp is not None: + ret["timestamp"] = timestamp + return ret + + def get(self, flow_id, message, content_view) -> None: + flow = self.flow + assert isinstance(flow, (HTTPFlow, TCPFlow, UDPFlow)) + + if self.request.arguments.get("lines"): + max_lines = int(self.request.arguments["lines"][0]) + else: + max_lines = None + + if message == "messages": + messages: list[TCPMessage] | list[UDPMessage] | list[WebSocketMessage] + if isinstance(flow, HTTPFlow) and flow.websocket: + messages = flow.websocket.messages + elif isinstance(flow, (TCPFlow, UDPFlow)): + messages = flow.messages + else: + raise APIError(400, f"This flow has no messages.") + msgs = [] + for m in messages: + d = self.message_to_json( + view_name=content_view, + message=m, + flow=flow, + max_lines=max_lines, + from_client=m.from_client, + timestamp=m.timestamp, + ) + msgs.append(d) + if max_lines: + max_lines -= d["text"].count("\n") + 1 + assert max_lines is not None + if max_lines <= 0: + break + self.write(msgs) + else: + message = getattr(self.flow, message) + self.write(self.message_to_json(content_view, message, flow, max_lines)) + + +class Commands(RequestHandler): + def get(self) -> None: + commands = {} + for name, cmd in self.master.commands.commands.items(): + commands[name] = { + "help": cmd.help, + "parameters": [ + { + "name": param.name, + "type": command.typename(param.type), + "kind": str(param.kind), + } + for param in cmd.parameters + ], + "return_type": command.typename(cmd.return_type) + if cmd.return_type + else None, + "signature_help": cmd.signature_help(), + } + self.write(commands) + + +class ExecuteCommand(RequestHandler): + def post(self, cmd: str): + # TODO: We should parse query strings here, this API is painful. + try: + args = self.json["arguments"] + except APIError: + args = [] + try: + result = self.master.commands.call_strings(cmd, args) + except Exception as e: + self.write({"error": str(e)}) + else: + self.write( + { + "value": result, + # "type": command.typename(type(result)) if result is not None else "none" + } + ) + + +class Events(RequestHandler): + def get(self): + self.write([logentry_to_json(e) for e in self.master.events.data]) + + +class Options(RequestHandler): + def get(self): + self.write(optmanager.dump_dicts(self.master.options)) + + def put(self): + update = self.json + try: + self.master.options.update(**update) + except Exception as err: + raise APIError(400, f"{err}") + + +class SaveOptions(RequestHandler): + def post(self): + # try: + # optmanager.save(self.master.options, CONFIG_PATH, True) + # except Exception as err: + # raise APIError(400, "{}".format(err)) + pass + + +class State(RequestHandler): + # Separate method for testability. + @staticmethod + def get_json(master: mitmproxy.tools.web.master.WebMaster): + return { + "version": version.VERSION, + "contentViews": [ + v for v in contentviews.registry.available_views() if v != "query" + ], + "servers": { + s.mode.full_spec: s.to_json() for s in master.proxyserver.servers + }, + "platform": sys.platform, + "localModeUnavailable": mitmproxy_rs.local.LocalRedirector.unavailable_reason(), + } + + def get(self): + self.write(State.get_json(self.master)) + + +class ProcessList(RequestHandler): + @staticmethod + def get_json(): + processes = mitmproxy_rs.process_info.active_executables() + return [ + { + "is_visible": process.is_visible, + "executable": str(process.executable), + "is_system": process.is_system, + "display_name": process.display_name, + } + for process in processes + ] + + def get(self): + self.write(ProcessList.get_json()) + + +class ProcessImage(RequestHandler): + def get(self): + path = self.get_query_argument("path", None) + + if not path: + raise APIError(400, "Missing 'path' parameter.") + + try: + icon_bytes = mitmproxy_rs.process_info.executable_icon(path) + except Exception: + icon_bytes = TRANSPARENT_PNG + + self.set_header("Content-Type", "image/png") + self.set_header("X-Content-Type-Options", "nosniff") + self.set_header("Cache-Control", "max-age=604800") + self.write(icon_bytes) + + +class GZipContentAndFlowFiles(tornado.web.GZipContentEncoding): + CONTENT_TYPES = { + "application/octet-stream", + *tornado.web.GZipContentEncoding.CONTENT_TYPES, + } + + +handlers = [ + (r"/", IndexHandler), + (r"/filter-help(?:\.json)?", FilterHelp), + (r"/updates", ClientConnection), + (r"/commands(?:\.json)?", Commands), + (r"/commands/(?P[a-z.]+)", ExecuteCommand), + (r"/events(?:\.json)?", Events), + (r"/flows(?:\.json)?", Flows), + (r"/flows/dump", DumpFlows), + (r"/flows/resume", ResumeFlows), + (r"/flows/kill", KillFlows), + (r"/flows/(?P[0-9a-f\-]+)", FlowHandler), + (r"/flows/(?P[0-9a-f\-]+)/resume", ResumeFlow), + (r"/flows/(?P[0-9a-f\-]+)/kill", KillFlow), + (r"/flows/(?P[0-9a-f\-]+)/duplicate", DuplicateFlow), + (r"/flows/(?P[0-9a-f\-]+)/replay", ReplayFlow), + (r"/flows/(?P[0-9a-f\-]+)/revert", RevertFlow), + (r"/flows/(?P[0-9a-f\-]+)/(?Prequest|response|messages)/content.data", FlowContent), + (r"/flows/(?P[0-9a-f\-]+)/(?Prequest|response|messages)/content/(?P[0-9a-zA-Z\-\_%]+)(?:\.json)?", FlowContentView), + (r"/clear", ClearAll), + (r"/options(?:\.json)?", Options), + (r"/options/save", SaveOptions), + (r"/state(?:\.json)?", State), + (r"/processes", ProcessList), + (r"/executable-icon", ProcessImage), +] # fmt: skip + + +class Application(tornado.web.Application): + master: mitmproxy.tools.web.master.WebMaster + + def __init__( + self, master: mitmproxy.tools.web.master.WebMaster, debug: bool + ) -> None: + self.master = master + auth_addon: WebAuth = master.addons.get("webauth") + super().__init__( + handlers=handlers, # type: ignore # https://github.com/tornadoweb/tornado/pull/3455 + template_path=os.path.join(os.path.dirname(__file__), "templates"), + static_path=os.path.join(os.path.dirname(__file__), "static"), + xsrf_cookies=True, + # https://github.com/mitmproxy/mitmproxy/issues/8194 + # 2026-05: We can move back to the default cookie name in a few years. + xsrf_cookie_name="_mitmproxy_xsrf", + xsrf_cookie_kwargs=dict(samesite="Strict"), + cookie_secret=secrets.token_bytes(32), + debug=debug, + autoreload=False, + transforms=[GZipContentAndFlowFiles], + is_valid_password=auth_addon.is_valid_password, + auth_cookie_name=auth_addon.auth_cookie_name, + compiled_template_cache=False, # Vite + ) diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/index.html b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/index.html new file mode 100644 index 0000000000000000000000000000000000000000..74288b6128cf74ce177cd3b88fa39122dd604d5f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/index.html @@ -0,0 +1,16 @@ + + + + + mitmproxy + + + + + + + + +
    + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/master.py b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/master.py new file mode 100644 index 0000000000000000000000000000000000000000..c2020739b4d3a4d36c80b03a3e8ec707dc4e040f --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/master.py @@ -0,0 +1,122 @@ +import errno +import logging +from typing import cast + +import tornado.httpserver +import tornado.ioloop + +from mitmproxy import addons +from mitmproxy import flow +from mitmproxy import log +from mitmproxy import master +from mitmproxy import options +from mitmproxy import optmanager +from mitmproxy.addons import errorcheck +from mitmproxy.addons import eventstore +from mitmproxy.addons import intercept +from mitmproxy.addons import readfile +from mitmproxy.addons import view +from mitmproxy.addons.proxyserver import Proxyserver +from mitmproxy.tools.web import app +from mitmproxy.tools.web import static_viewer +from mitmproxy.tools.web import webaddons + +logger = logging.getLogger(__name__) + + +class WebMaster(master.Master): + def __init__(self, opts: options.Options, with_termlog: bool = True): + super().__init__(opts, with_termlog=with_termlog) + self.view = view.View() + self.view.sig_view_add.connect(self._sig_view_add) + self.view.sig_view_remove.connect(self._sig_view_remove) + self.view.sig_view_update.connect(self._sig_view_update) + self.view.sig_view_refresh.connect(self._sig_view_refresh) + + self.events = eventstore.EventStore() + self.events.sig_add.connect(self._sig_events_add) + self.events.sig_refresh.connect(self._sig_events_refresh) + + self.options.changed.connect(self._sig_options_update) + + self.addons.add(*addons.default_addons()) + self.addons.add( + webaddons.WebAddon(), + webaddons.WebAuth(), + intercept.Intercept(), + readfile.ReadFileStdin(), + static_viewer.StaticViewer(), + self.view, + self.events, + errorcheck.ErrorCheck(), + ) + self.app = app.Application(self, self.options.web_debug) + self.proxyserver: Proxyserver = self.addons.get("proxyserver") + self.proxyserver.servers.changed.connect(self._sig_servers_changed) + + def _sig_view_add(self, flow: flow.Flow) -> None: + app.ClientConnection.broadcast_flow("flows/add", flow) + + def _sig_view_update(self, flow: flow.Flow) -> None: + app.ClientConnection.broadcast_flow("flows/update", flow) + + def _sig_view_remove(self, flow: flow.Flow, index: int) -> None: + app.ClientConnection.broadcast( + type="flows/remove", + payload=flow.id, + ) + + def _sig_view_refresh(self) -> None: + app.ClientConnection.broadcast_flow_reset() + + def _sig_events_add(self, entry: log.LogEntry) -> None: + app.ClientConnection.broadcast( + type="events/add", + payload=app.logentry_to_json(entry), + ) + + def _sig_events_refresh(self) -> None: + app.ClientConnection.broadcast( + type="events/reset", + ) + + def _sig_options_update(self, updated: set[str]) -> None: + options_dict = optmanager.dump_dicts(self.options, updated) + app.ClientConnection.broadcast( + type="options/update", + payload=options_dict, + ) + + def _sig_servers_changed(self) -> None: + app.ClientConnection.broadcast( + type="state/update", + payload={ + "servers": { + s.mode.full_spec: s.to_json() for s in self.proxyserver.servers + } + }, + ) + + @property + def web_url(self) -> str: + return cast(webaddons.WebAuth, self.addons.get("webauth")).web_url + + async def running(self): + # Register tornado with the current event loop + tornado.ioloop.IOLoop.current() + + # Add our web app. + http_server = tornado.httpserver.HTTPServer( + self.app, max_buffer_size=2**32 + ) # 4GB + try: + http_server.listen(self.options.web_port, self.options.web_host) + except OSError as e: + message = f"Web server failed to listen on {self.options.web_host or '*'}:{self.options.web_port} with {e}" + if e.errno == errno.EADDRINUSE: + message += f"\nTry specifying a different port by using `--set web_port={self.options.web_port + 2}`." + raise OSError(e.errno, message, e.filename) from e + + logger.info(f"Web server listening at {self.web_url}") + + return await super().running() diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-B-jkhYfk.woff2 b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-B-jkhYfk.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..4d13fc60404b91e398a37200c4a77b645cfd9586 Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-B-jkhYfk.woff2 differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-CDK5bt4p.woff b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-CDK5bt4p.woff new file mode 100644 index 0000000000000000000000000000000000000000..400014a4b06eee3d0c0d54402a47ab2601b2862b Binary files /dev/null and b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-CDK5bt4p.woff differ diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-D13rzr4g.svg b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-D13rzr4g.svg new file mode 100644 index 0000000000000000000000000000000000000000..855c845e538b65548118279537a04eab2ec6ef0d --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/fontawesome-webfont-D13rzr4g.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/index-Be7e-cwP.js b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/index-Be7e-cwP.js new file mode 100644 index 0000000000000000000000000000000000000000..54b08644e226d8a43c2df08a9c167befeebbd9c3 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/index-Be7e-cwP.js @@ -0,0 +1,10 @@ +import{c as fe,R as Cl,a as _e,r as I,b as Te,d as je,j as o,e as k,f as ui,u as Nl,g as kl,h as fi,s as Kt,i as El,l as Ht,k as Tl,m as Rl,n as Al,y as Dl,o as Fl,p as Il,q as zt,Q as Ll,t as Pl,P as Ol}from"./vendor-BS4xPthR.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const l of n.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function s(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(r){if(r.ep)return;r.ep=!0;const n=s(r);fetch(r.href,n)}})();const Ml={tab:"request",contentViewFor:{}},ql=fe({name:"ui/flow",initialState:Ml,reducers:{selectTab(t,e){t.tab=e.payload},setContentViewFor(t,e){t.contentViewFor[e.payload.messageId]=e.payload.contentView}}}),{actions:Hl,reducer:Vl}=ql,{selectTab:Ut,setContentViewFor:pi}=Hl;window.React=Cl;const hi=function(t){if(t===0)return"0";const e=["b","kb","mb","gb","tb"];let s=0;for(;st);s++);let i;return t%Math.pow(1024,s)===0?i=0:i=1,(t/Math.pow(1024,s)).toFixed(i)+e[s]},mi=function(t){let e=t;const s=["ms","s","min","h"],i=[1e3,60,60];let r=0;for(;Math.abs(e)>=i[r]&&r{const t=Ul("_mitmproxy_xsrf");return fs=()=>t,fs()};function ne(t,e={}){return e.method&&e.method!=="GET"&&(e.headers=e.headers||{},e.headers["X-XSRFToken"]=fs()),t.startsWith("/")&&(t="."+t),fetch(t,{credentials:"same-origin",...e})}ne.put=(t,e,s={})=>ne(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),...s});ne.post=(t,e,s={})=>ne(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),...s});async function Bt(t,...e){return await(await ne(`/commands/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({arguments:e})})).json()}async function gi(t){try{await navigator.clipboard.write([new ClipboardItem({"text/plain":t})]);return}catch(i){console.warn(i)}const e=await t;try{await navigator.clipboard.writeText(e);return}catch(i){console.warn(i)}const s=document.createElement("textarea");s.value=e,s.style.position="absolute",s.style.opacity="0",document.body.appendChild(s);try{if(s.focus(),s.select(),!document.execCommand("copy"))throw"failed to copy"}catch{alert(e)}finally{s.remove()}}async function Bl(t){await gi(Promise.resolve(t?.text||""))}function ps(t,e){const s=t.lastIndexOf(e);if(s===-1)return["",t];const i=t.slice(0,s),r=t.slice(s+e.length);return[i,r]}function vi(t,e){const s=t.indexOf(e);if(s===-1)return[t,""];const i=t.slice(0,s),r=t.slice(s+e.length);return[i,r]}function Ct(t){throw new Error(`Unreachable: ${JSON.stringify(t)}`)}const xi={http:80,https:443},Vn=new WeakMap;class we{static getContentType(e){const s=we.get_first_header(e,/^Content-Type$/i);if(s)return s.split(";")[0].trim()}static get_first_header(e,s){let i=Vn.get(e);i||(i=new Map,Vn.set(e,i));let r=i.get(s);if(r===void 0){const n=e.headers.find(([l,a])=>s.test(l));r=n?n[1]:!1,i.set(s,r)}return r!==!1?r:void 0}static match_header(e,s){const i=e.headers;if(!i)return!1;let r=i.length;for(;r--;)if(s.test(i[r].join(" ")))return i[r];return!1}static getContentURL(e,s,i,r){e.type==="http"&&s===e.request?s="request":e.type==="http"&&s===e.response&&(s="response");const n=r?`?lines=${r}`:"";return`./flows/${e.id}/${s}/`+(i?`content/${encodeURIComponent(i)}.json${n}`:"content.data")}}class ct extends we{static pretty_url(e){let s="";return xi[e.scheme]!==e.port&&(s=":"+e.port),e.scheme+"://"+e.pretty_host+s+e.path}}class mt extends we{}const Wl=/^(?:(https?):\/\/)?([^/:]+)?(?::(\d+))?(\/.*)?$/i,_i=function(t){const e=Wl.exec(t);if(!e)return;const s=e[1],i=e[2],r=parseInt(e[3]),n=e[4],l=s?r||xi[s]:r,a={};return s&&(a.scheme=s),i&&(a.host=i),l&&(a.port=l),n&&(a.path=n),a},Kl=/^HTTP\/\d+(\.\d+)*$/i,ji=function(t){return Kl.test(t)};function Wt(t){switch(t.type){case"http":return t.request.timestamp_start;case"tcp":case"udp":return t.client_conn.timestamp_start;case"dns":return t.request.timestamp}}function yi(t){switch(t.type){case"http":if(t.websocket){if(t.websocket.timestamp_end)return t.websocket.timestamp_end;if(t.websocket.messages_meta.timestamp_last)return t.websocket.messages_meta.timestamp_last}return t.response?t.response.timestamp_end:void 0;case"tcp":return t.server_conn?.timestamp_end;case"udp":return t.messages_meta.timestamp_last;case"dns":return t.response?.timestamp}}const wi=t=>{switch(t.type){case"http":{let e=t.request.contentLength||0;return t.response&&(e+=t.response.contentLength||0),t.websocket&&(e+=t.websocket.messages_meta.contentLength||0),e}case"tcp":case"udp":return t.messages_meta.contentLength||0;case"dns":return t.response?.size??0}},xs=t=>t.type==="http"&&!t.websocket,bi=t=>t.modified,_s=t=>t.intercepted,Si=t=>{if(t.type!=="http")return t.client_conn.tls_version==="QUICv1"?"resource-icon-quic":`resource-icon-${t.type}`;if(t.websocket)return"resource-icon-websocket";if(!t.response)return"resource-icon-plain";const e=mt.getContentType(t.response)||"";return t.response.status_code===304?"resource-icon-not-modified":300<=t.response.status_code&&t.response.status_code<400?"resource-icon-redirect":e.indexOf("image")>=0?"resource-icon-image":e.indexOf("javascript")>=0?"resource-icon-js":e.indexOf("css")>=0?"resource-icon-css":e.indexOf("html")>=0?"resource-icon-document":"resource-icon-plain"},$i=t=>{switch(t.type){case"http":return ct.pretty_url(t.request);case"tcp":case"udp":return`${t.client_conn.peername.join(":")} โ†” ${t.server_conn?.address?.join(":")}`;case"dns":return`${t.request.questions.map(e=>`${e.name} ${e.type}`).join(", ")} = ${(t.response?.answers.map(e=>e.data).join(", ")??"...")||"?"}`}},Ci=t=>{switch(t.type){case"http":return t.response?.status_code;case"dns":return t.response?.response_code;default:return}},Ni=t=>{switch(t.type){case"http":return t.websocket?t.client_conn.tls_established?"WSS":"WS":t.request.method;case"dns":return t.request.op_code;default:return t.type.toUpperCase()}},ki=t=>{switch(t.type){case"http":return t.request.http_version;default:return""}},Ei={tls:t=>t.type==="http"&&t.request.scheme,icon:Si,index:()=>0,path:$i,method:Ni,version:ki,status:Ci,size:wi,time:t=>{const e=Wt(t),s=yi(t);return e&&s&&s-e},timestamp:Wt,quickactions:()=>0,comment:t=>t.comment};function zl(t){return t in Ei}var ve=(t=>(t.Search="search",t.Highlight="highlight",t))(ve||{});const Ti={search:"",highlight:""},Gl=fe({name:"ui/filters",initialState:Ti,reducers:{setFilter(t,e){t.search=e.payload},setHighlight(t,e){t.highlight=e.payload}}}),{actions:Yl,reducer:Jl}=Gl,{setFilter:Ri,setHighlight:Ai}=Yl;function rs(t,e){return t.toSorted?t.toSorted(e):[...t].sort(e)}function js(t,...e){if(t.toSpliced)return t.toSpliced(...e);{const s=[...t];return s.splice(...e),s}}function jt(t){return new Map(t.map((e,s)=>[e.id,s]))}function os(t){return new Set(t.map(e=>e.id))}function Un(t,e){return t.has(e)&&(t=new Set(t),t.delete(e)),t}function Bn(t,e,s){const i=js(t,s,1),r=new Map(e);r.delete(t[s].id);for(let n=i.length-1;n>=s;n--)r.set(i[n].id,n);return{view:i,_viewIndex:r}}function Ql(t,e,s,i){const r=[...t],n=r.length;let l=e,a=l.get(s.id);if(a+10){l=new Map(l);do{const d=r[a+1];r[a]=d,l.set(d.id,a),a++}while(a+10);l.set(s.id,a)}else if(a>0&&i(s,r[a-1])<0){l=new Map(l);do{const d=r[a-1];r[a]=d,l.set(d.id,a),a--}while(a>0&&i(s,r[a-1])<0);l.set(s.id,a)}return r[a]=s,{view:r,_viewIndex:l}}function Wn(t,e,s,i){const r=Xl(t,s,i),n=js(t,r,0,s),l=new Map(e);for(let a=n.length-1;a>=r;a--)l.set(n[a].id,a);return{view:n,_viewIndex:l}}function Xl(t,e,s){let i=0,r=t.length;if(r===0||s(t[r-1],e)<=0)return r;for(;i>>1;s(e,t[n])>=0?i=n+1:r=n}return i}function ys(t){return t=t.filter(_s),()=>Promise.all(t.map(e=>ne(`/flows/${e.id}/resume`,{method:"POST"})))}function Di(){return()=>ne("/flows/resume",{method:"POST"})}function Fi(t){return t=t.filter(_s),()=>Promise.all(t.map(e=>ne(`/flows/${e.id}/kill`,{method:"POST"})))}function Zl(){return()=>ne("/flows/kill",{method:"POST"})}function Ii(t){return()=>Promise.all(t.map(e=>ne(`/flows/${e.id}`,{method:"DELETE"})))}function Li(t){return()=>Promise.all(t.map(e=>ne(`/flows/${e.id}/duplicate`,{method:"POST"})))}function ws(t){return t=t.filter(xs),()=>Promise.all(t.map(e=>ne(`/flows/${e.id}/replay`,{method:"POST"})))}function Pi(t){return t=t.filter(bi),()=>Promise.all(t.map(e=>ne(`/flows/${e.id}/revert`,{method:"POST"})))}function Kn(t,e){return()=>Promise.all(t.map(s=>Le(s,{marked:e})()))}function Le(t,e){return()=>ne.put(`/flows/${t.id}`,e)}function ec(t,e,s){const i=new FormData;return e=new window.Blob([e],{type:"plain/text"}),i.append("file",e),()=>ne(`/flows/${t.id}/${s}/content.data`,{method:"POST",body:i})}function Oi(){return()=>ne("/clear",{method:"POST"})}function tc(t){const e=new FormData;return e.append("file",t),()=>ne("/flows/dump",{method:"POST",body:e})}const Mi=_e("flows/add"),qi=_e("flows/update"),Hi=_e("flows/remove"),bs=_e("flows/receive"),Vi=_e("flows/filterUpdate"),Ui=_e("flows/sort"),Ve=_e("flows/select"),sc={list:[],_listIndex:new Map,byId:new Map,view:[],_viewIndex:new Map,sort:{column:void 0,desc:!1},selected:[],selectedIds:new Set,highlightedIds:new Set};function nc(t=sc,e){if(bs.match(e)){const{sort:s}=t,i=e.payload,r=jt(i),n=new Map(i.map(h=>[h.id,h])),l=rs(i,pt(s)),a=jt(l),d=t.selected.map(h=>n.get(h.id)).filter(h=>h!==void 0),f=os(d);return{list:i,_listIndex:r,byId:n,view:l,_viewIndex:a,sort:s,selected:d,selectedIds:f,highlightedIds:new Set}}else if(Mi.match(e)){const{flow:s,matching_filters:i}=e.payload;if(t._listIndex.has(s.id))return t;const{sort:r,selected:n,selectedIds:l}=t;let{view:a,_viewIndex:d,highlightedIds:f}=t;const p=new Map(t._listIndex);p.set(s.id,t.list.length);const h=[...t.list,s],g=new Map(t.byId);return g.set(s.id,s),(i[ve.Search]===!0||i[ve.Search]===void 0)&&({view:a,_viewIndex:d}=Wn(a,d,s,pt(r))),i[ve.Highlight]===!0&&(f=new Set(f),f.add(s.id)),{list:h,_listIndex:p,byId:g,view:a,_viewIndex:d,sort:r,selected:n,selectedIds:l,highlightedIds:f}}else if(qi.match(e)){const{flow:s,matching_filters:i}=e.payload,{_listIndex:r,sort:n,selectedIds:l}=t;let{view:a,_viewIndex:d,selected:f,highlightedIds:p}=t;const h=t._listIndex.get(s.id),g=[...t.list];h!==void 0?g[h]=s:g.push(s);const _=new Map(t.byId);_.set(s.id,s);const j=d.get(s.id),y=j!==void 0,w=i[ve.Search]===!0||i[ve.Search]===void 0;return w&&!y?{view:a,_viewIndex:d}=Wn(a,d,s,pt(n)):!w&&y?{view:a,_viewIndex:d}=Bn(a,d,j):w&&y&&({view:a,_viewIndex:d}=Ql(a,d,s,pt(n))),l.has(s.id)&&(f=f.map($=>$.id===s.id?s:$)),i[ve.Highlight]===!0?p.has(s.id)||(p=new Set(p),p.add(s.id)):p=Un(p,s.id),{list:g,_listIndex:r,byId:_,view:a,_viewIndex:d,sort:n,selected:f,selectedIds:l,highlightedIds:p}}else if(Hi.match(e)){const s=e.payload,{sort:i}=t;let{view:r,_viewIndex:n,selected:l,selectedIds:a}=t;const d=t._listIndex.get(s);if(d===void 0)return t;const f=js(t.list,d,1),p=jt(f),h=new Map(t.byId);h.delete(s);const g=n.get(s);if(g!==void 0&&({view:r,_viewIndex:n}=Bn(r,n,g)),a.has(s)){if(l.length===1&&g!==void 0){const j=r[g]??r[g-1];l=j?[j]:[]}else l=l.filter(j=>j.id!==s);a=os(l)}const _=Un(t.highlightedIds,s);return{list:f,_listIndex:p,byId:h,view:r,_viewIndex:n,sort:i,selected:l,selectedIds:a,highlightedIds:_}}else if(Vi.match(e)){const{name:s,matching_flow_ids:i}=e.payload;switch(s){case ve.Search:{const r=rs(i===null?t.list:i.map(l=>t.byId.get(l)).filter(l=>l!==void 0),pt(t.sort)),n=jt(r);return{...t,view:r,_viewIndex:n}}case ve.Highlight:return{...t,highlightedIds:new Set(i)};default:Ct(s)}}else if(Ui.match(e)){const s=e.payload;let i;s.column?i=rs(t.view,pt(s)):i=t.list.filter(n=>t._viewIndex.has(n.id));const r=jt(i);return{...t,sort:s,view:i,_viewIndex:r}}else return Ve.match(e)?{...t,selected:e.payload,selectedIds:os(e.payload)}:t}function pt({column:t,desc:e}){if(!t)return(i,r)=>0;const s=Ei[t];return(i,r)=>{const n=s(i),l=s(r);return n>l?e?-1:1:n{const{flows:i}=s();i.selectedIds.has(t.id)?e(Ve(i.selected.filter(r=>r!==t))):e(Ve([...i.selected,t]))}}function rc(t){return(e,s)=>{const{flows:i}=s(),r=i.selected[i.selected.length-1],n=i._viewIndex.get(t.id),l=i._viewIndex.get(r?.id);if(n===void 0||l===void 0)return e(Ve([t]));let a;return n<=l?a=i.view.slice(n,l+1):(a=i.view.slice(l+1,n+1),a.push(r)),e(Ve(a))}}const oc={activeModal:void 0},Bi=fe({name:"ui/modal",initialState:oc,reducers:{setActiveModal(t,e){t.activeModal=e.payload},hideModal(t){t.activeModal=void 0}}}),{actions:lc,reducer:cc}=Bi,ac=Bi.actions.hideModal.type,{setActiveModal:dc,hideModal:Wi}=lc,zn=(()=>{const t=document.createElement("div");return t.setAttribute("contenteditable","PLAINTEXT-ONLY"),t.contentEditable==="plaintext-only"?"plaintext-only":"true"})();class ce extends I.Component{input=Te.createRef();render(){const e=je("inline-input",this.props.className);return o.jsx("span",{ref:this.input,tabIndex:0,className:e,placeholder:this.props.placeholder,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onInput:this.onInput,onPaste:this.onPaste,onMouseDown:this.onMouseDown,onClick:this.onClick,children:this.props.content})}componentDidUpdate(e){e.content!==this.props.content&&this.props.onInput?.(this.props.content)}isEditing=()=>this.input.current?.contentEditable===zn;startEditing=()=>{if(!this.input.current)return console.error("unreachable");this.isEditing()||(this.suppress_events=!0,this.input.current.blur(),this.input.current.contentEditable=zn,window.requestAnimationFrame(()=>{if(this.input.current){if(this.input.current.focus(),this.suppress_events=!1,this.props.selectAllOnClick){const e=document.createRange();e.selectNodeContents(this.input.current);const s=window.getSelection();s?.removeAllRanges(),s?.addRange(e)}this.props.onEditStart?.()}}))};resetValue=()=>{if(!this.input.current)return console.error("unreachable");this.input.current.textContent=this.props.content,this.props.onInput?.(this.props.content)};finishEditing=()=>{if(!this.input.current)return console.error("unreachable");this.props.onEditDone(this.input.current.textContent||""),this.input.current.blur(),this.input.current.contentEditable="inherit"};onPaste=e=>{e.preventDefault();const s=e.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,s)};suppress_events=!1;onMouseDown=e=>{this.suppress_events=!0,window.addEventListener("mouseup",this.onMouseUp,{once:!0})};onMouseUp=e=>{const s=e.target===this.input.current,i=!window.getSelection()?.toString();this.props.selectAllOnClick?s&&i&&this.startEditing():s&&this.startEditing(),this.suppress_events=!1};onClick=e=>{};onFocus=e=>{if(!this.input.current)throw"unreachable";this.suppress_events||this.startEditing()};onInput=e=>{this.props.onInput?.(this.input.current?.textContent||"")};onBlur=e=>{this.suppress_events||this.finishEditing()};onKeyDown=e=>{switch(e.stopPropagation(),e.key){case"Escape":e.preventDefault(),this.resetValue(),this.finishEditing();break;case"Enter":e.shiftKey||(e.preventDefault(),this.finishEditing());break}this.props.onKeyDown?.(e)}}function bt(t){const e=k.c(15);let s;e[0]!==t.content||e[1]!==t.isValid?(s=t.isValid(t.content),e[0]=t.content,e[1]=t.isValid,e[2]=s):s=e[2];const[i,r]=I.useState(s),n=I.useRef(null);let l;e[3]!==t?(l=_=>{t.isValid(_)?t.onEditDone(_):n.current?.resetValue()},e[3]=t,e[4]=l):l=e[4];const a=l,d=i?"has-success":"has-warning";let f;e[5]!==t.className||e[6]!==d?(f=je(t.className,d),e[5]=t.className,e[6]=d,e[7]=f):f=e[7];const p=f;let h;e[8]!==t?(h=_=>r(t.isValid(_)),e[8]=t,e[9]=h):h=e[9];let g;return e[10]!==p||e[11]!==a||e[12]!==t||e[13]!==h?(g=o.jsx(ce,{...t,className:p,onInput:h,onEditDone:a,ref:n}),e[10]=p,e[11]=a,e[12]=t,e[13]=h,e[14]=g):g=e[14],g}const G=()=>Nl(),D=kl,uc=ui.withTypes(),Ss=_e("EVENTS_ADD"),Ki=_e("EVENTS_RECEIVE"),Gt=_e("events/toggleVisibility"),zi=_e("events/toggleFilter");var Gi=(t=>(t.debug="debug",t.info="info",t.web="web",t.warn="warn",t.error="error",t))(Gi||{});const fc={visible:!1,filters:{debug:!1,info:!0,web:!0,warn:!0,error:!0},list:[],view:[]};function pc(t=fc,e){if(Ss.match(e)){const s=e.payload;return{...t,list:[...t.list,s],view:t.filters[s.level]?[...t.view,s]:t.view}}else{if(Ki.match(e))return{...t,list:e.payload,view:e.payload.filter(s=>t.filters[s.level])};if(Gt.match(e))return{...t,visible:!t.visible};if(zi.match(e)){const s={...t.filters,[e.payload]:!t.filters[e.payload]};return{...t,filters:s,view:t.list.filter(i=>s[i.level])}}else return t}}function hc(t,e="web"){return Ss({id:Math.random().toString(),message:t,level:e})}const Gn={},mc=fe({name:"ui/optionsEditor",initialState:Gn,reducers:{startUpdate(t,e){t[e.payload.option]={isUpdating:!0,value:e.payload.value,error:!1}},updateSuccess(t,e){t[e.payload.option]=void 0},updateError(t,e){let s=t[e.payload.option].value;typeof s=="boolean"&&(s=!s),t[e.payload.option]={value:s,isUpdating:!1,error:e.payload.error}}},extraReducers:t=>{t.addCase(ac,()=>Gn)}}),{actions:gc,reducer:vc}=mc,{startUpdate:xc,updateSuccess:_c,updateError:jc}=gc;var xe=(t=>(t[t.Capture=0]="Capture",t[t.FlowList=1]="FlowList",t[t.Options=2]="Options",t[t.Flow=3]="Flow",t))(xe||{});const yc=fe({name:"ui/tabs",initialState:{current:1},reducers:{setCurrent(t,e){t.current=e.payload}}}),{actions:wc,reducer:bc}=yc,{setCurrent:Vt}=wc,Sc=fi({flow:Vl,modal:cc,optionsEditor:vc,tabs:bc,filter:Jl});var wt=(t=>(t.INIT="CONNECTION_INIT",t.FETCHING="CONNECTION_FETCHING",t.ESTABLISHED="CONNECTION_ESTABLISHED",t.ERROR="CONNECTION_ERROR",t))(wt||{});const $c={state:"CONNECTION_INIT",message:void 0},Yi=fe({name:"connection",initialState:$c,reducers:{startFetching:t=>{t.state==="CONNECTION_INIT"&&(t.state="CONNECTION_FETCHING")},finishFetching:t=>{t.state==="CONNECTION_FETCHING"&&(t.state="CONNECTION_ESTABLISHED")},connectionError:(t,e)=>{t.state="CONNECTION_ERROR",t.message=e.payload}}}),{startFetching:Cc,finishFetching:Nc,connectionError:kc}=Yi.actions,Ec=Yi.reducer,Tc={add_upstream_certs_to_client_chain:!1,allow_hosts:[],anticache:!1,anticomp:!1,block_global:!0,block_list:[],block_private:!1,body_size_limit:void 0,cert_passphrase:void 0,certs:[],ciphers_client:void 0,ciphers_server:void 0,client_certs:void 0,client_replay:[],client_replay_concurrency:1,command_history:!0,confdir:"~/.mitmproxy",connect_addr:void 0,connection_strategy:"eager",console_focus_follow:!1,content_view_lines_cutoff:512,dns_name_servers:[],dns_use_hosts_file:!0,export_preserve_original_ip:!1,hardump:"",http2:!0,http2_ping_keepalive:58,http3:!0,http_connect_send_host_header:!0,ignore_hosts:[],intercept:void 0,intercept_active:!1,keep_alt_svc_header:!1,keep_host_header:!1,key_size:2048,listen_host:"",listen_port:void 0,map_local:[],map_remote:[],mode:["regular"],modify_body:[],modify_headers:[],normalize_outbound_headers:!0,onboarding:!0,onboarding_host:"mitm.it",protobuf_definitions:void 0,proxy_debug:!1,proxyauth:void 0,rawtcp:!0,readfile_filter:void 0,request_client_cert:!1,rfile:void 0,save_stream_file:void 0,save_stream_filter:void 0,scripts:[],server:!0,server_replay:[],server_replay_extra:"forward",server_replay_ignore_content:!1,server_replay_ignore_host:!1,server_replay_ignore_params:[],server_replay_ignore_payload_params:[],server_replay_ignore_port:!1,server_replay_kill_extra:!1,server_replay_nopop:!1,server_replay_refresh:!0,server_replay_reuse:!1,server_replay_use_headers:[],show_ignored_hosts:!1,showhost:!1,ssl_insecure:!1,ssl_verify_upstream_trusted_ca:void 0,ssl_verify_upstream_trusted_confdir:void 0,stickyauth:void 0,stickycookie:void 0,store_streamed_bodies:!1,stream_large_bodies:void 0,strip_ech:!0,tcp_hosts:[],tcp_timeout:600,termlog_verbosity:"info",tls_ecdh_curve_client:void 0,tls_ecdh_curve_server:void 0,tls_version_client_max:"UNBOUNDED",tls_version_client_min:"TLS1_2",tls_version_server_max:"UNBOUNDED",tls_version_server_min:"TLS1_2",udp_hosts:[],upstream_auth:void 0,upstream_cert:!0,validate_inbound_headers:!0,view_filter:void 0,view_order:"time",view_order_reversed:!1,web_columns:["tls","icon","path","method","status","size","time"],web_debug:!1,web_host:"127.0.0.1",web_open_browser:!0,web_password:"",web_port:8081,web_static_viewer:"",websocket:!0},Yt=_e("OPTIONS_RECEIVE"),$s=_e("OPTIONS_UPDATE"),Rc=fe({name:"options",initialState:Tc,reducers:{},extraReducers:t=>{t.addCase(Yt,(e,s)=>{const i={};for(const[r,{value:n}]of Object.entries(s.payload))i[r]=n;return i}).addCase($s,(e,s)=>{for(const[i,{value:r}]of Object.entries(s.payload))e[i]=r})}}),Ac=Rc.reducer;async function Dc(t,e,s){try{const i=await ne.put("/options",{[t]:e});if(i.status===200)s(_c({option:t}));else throw await i.text()}catch(i){s(jc({option:t,error:i.toString()}))}}const Fc=Dc;function Cs(t,e){return s=>{s(xc({option:t,value:e})),Fc(t,e,s)}}const Ic={visible:!1},Lc=fe({name:"commandBar",initialState:Ic,reducers:{toggleVisibility(t){t.visible=!t.visible}}}),{actions:Pc,reducer:Oc}=Lc,{toggleVisibility:Ji}=Pc,Ue=_e("STATE_RECEIVE"),Be=_e("STATE_UPDATE"),Mc={available:!1,version:"",contentViews:[],servers:{},platform:"",localModeUnavailable:null},qc=fe({name:"backendState",initialState:Mc,reducers:{},extraReducers:t=>{t.addCase(Ue,(e,s)=>({...e,available:!0,...s.payload})).addCase(Be,(e,s)=>({...e,...s.payload}))}}),Hc=qc.reducer,Vc={},Uc=fe({name:"optionsMeta",initialState:Vc,reducers:{},extraReducers:t=>{t.addCase(Yt,(e,s)=>s.payload).addCase($s,(e,s)=>({...e,...s.payload}))}}),Bc=Uc.reducer,dt=(t,e)=>e.listen_host&&e.listen_port?`${t}@${e.listen_host}:${e.listen_port}`:e.listen_port?`${t}@${e.listen_port}`:t,Qi=t=>{let[e,s]=ps(t,"@");e||(e=s,s="");const[i,r]=vi(e,":");let n,l;if(s){let a;if(s.includes(":")?[n,a]=ps(s,":"):(n="",a=s),a&&(l=parseInt(a,10),isNaN(l)||l<0||l>65535))throw new Error(`invalid port: ${a}`)}return{full_spec:t,name:i,data:r,listen_host:n,listen_port:l}},Xi=t=>dt("regular",t),Yn=({listen_host:t,listen_port:e})=>({ui_id:Math.random(),active:!0,listen_host:t,listen_port:e}),Zi=t=>t.selectedProcesses?`local:${t.selectedProcesses}`:"local",Jn=({data:t})=>({ui_id:Math.random(),active:!0,selectedProcesses:t}),er=t=>{const e=t.file_path?`wireguard:${t.file_path}`:"wireguard";return dt(e,t)},Qn=({data:t,listen_host:e,listen_port:s})=>({ui_id:Math.random(),active:!0,listen_host:e,listen_port:s,file_path:t});var Jt=(t=>(t.HTTP="http",t.HTTPS="https",t.HTTP3="http3",t.TLS="tls",t.DTLS="dtls",t.TCP="tcp",t.UDP="udp",t.DNS="dns",t.QUIC="quic",t))(Jt||{}),ot=(t=>(t.CSS="css",t.JAVASCRIPT="javascript",t.XML="xml",t.YAML="yaml",t.NONE="none",t.ERROR="error",t))(ot||{});const hs=()=>({active:!1,protocol:Jt.HTTPS,destination:"",ui_id:Math.random()}),Ns=t=>dt(`reverse:${t.protocol}://${t.destination}`,t),Wc=({data:t,listen_host:e,listen_port:s})=>{let[i,r]=vi(t,"://");return r||(r=i,i=Jt.HTTPS),{ui_id:Math.random(),active:!0,protocol:i,destination:r,listen_host:e,listen_port:s}},tr=t=>dt("transparent",t),Xn=({listen_host:t,listen_port:e})=>({ui_id:Math.random(),active:!0,listen_host:t,listen_port:e}),sr=t=>dt("socks5",t),Zn=({listen_host:t,listen_port:e})=>({ui_id:Math.random(),active:!0,listen_host:t,listen_port:e}),nr=t=>dt(`upstream:${t.destination}`,t),ei=({data:t,listen_host:e,listen_port:s})=>({ui_id:Math.random(),active:!0,destination:t||"",listen_host:e,listen_port:s}),ir=t=>dt("dns",t),ti=({listen_host:t,listen_port:e})=>({ui_id:Math.random(),active:!0,listen_host:t,listen_port:e}),Xe=t=>t.active&&!t.error;async function Kc(t,e){const s=e.getState().modes,i=[...s.regular.filter(Xe).map(Xi),...s.local.filter(Xe).map(Zi),...s.wireguard.filter(Xe).map(er),...s.reverse.filter(Xe).map(Ns),...s.transparent.filter(Xe).map(tr),...s.socks.filter(Xe).map(sr),...s.upstream.filter(Xe).map(nr),...s.dns.filter(Xe).map(ir)],r=await ne.put("/options",{mode:i});if(r.status!==200)throw new Error(await r.text())}function ie(t){return uc(t,Kc)}function se(t,e,s){t.addCase(s.pending,(i,r)=>{const{server:n,value:l}=r.meta.arg,a=i.findIndex(d=>d.ui_id===n.ui_id);a>=0&&(i[a][e]=l,i[a].error=void 0)}),t.addCase(s.rejected,(i,r)=>{const{server:n}=r.meta.arg,l=i.findIndex(a=>a.ui_id===n.ui_id);l>=0&&(i[l].error=r.error.message)})}function be(t,e){return function(i,r){if(r.payload.servers){const n=Object.values(r.payload.servers).filter(l=>l.type===t).map(l=>Qi(l.full_spec));if(n.length>0)return n.map(e);for(const l of i)l.active=!1}}}const rr=ie("modes/regular/setActive"),or=ie("modes/regular/setListenHost"),lr=ie("modes/regular/setListenPort"),zc=[{active:!0,ui_id:Math.random()}],Gc=fe({name:"modes/regular",initialState:zc,reducers:{},extraReducers:t=>{se(t,"active",rr),se(t,"listen_host",or),se(t,"listen_port",lr),t.addCase(Ue,be("regular",Yn)),t.addCase(Be,be("regular",Yn))}}),Yc=Gc.reducer,cr=ie("modes/local/setActive"),St=ie("modes/local/setSelectedProcesses"),Jc=[{active:!1,selectedProcesses:"",ui_id:Math.random()}],Qc=fe({name:"modes/local",initialState:Jc,reducers:{},extraReducers:t=>{se(t,"active",cr),se(t,"selectedProcesses",St),t.addCase(Ue,be("local",Jn)),t.addCase(Be,be("local",Jn))}}),Xc=Qc.reducer,ar=ie("modes/wireguard/setActive"),dr=ie("modes/wireguard/setListenHost"),ur=ie("modes/wireguard/setListenPort"),fr=ie("modes/wireguard/setFilePath"),Zc=[{active:!1,ui_id:Math.random()}],ea=fe({name:"modes/wireguard",initialState:Zc,reducers:{},extraReducers:t=>{se(t,"active",ar),se(t,"listen_host",dr),se(t,"listen_port",ur),se(t,"file_path",fr),t.addCase(Ue,be("wireguard",Qn)),t.addCase(Be,be("wireguard",Qn))}}),ta=ea.reducer,ms=ie("modes/reverse/setActive"),pr=ie("modes/reverse/setListenHost"),hr=ie("modes/reverse/setListenPort"),mr=ie("modes/reverse/setProtocol"),gr=ie("modes/reverse/setDestination"),sa=[hs()],vr=fe({name:"modes/reverse",initialState:sa,reducers:{addServer:t=>{t.push(hs())},removeServer:(t,e)=>{const s=t.findIndex(i=>i.ui_id===e.payload.ui_id);s!==-1&&(t[s].active&&console.error("servers should be deactivated before removal"),t.splice(s,1))}},extraReducers:t=>{se(t,"active",ms),se(t,"listen_host",pr),se(t,"listen_port",hr),se(t,"protocol",mr),se(t,"destination",gr),t.addCase(Ue,e),t.addCase(Be,e);function e(s,i){if(i.payload.servers){const r=Object.fromEntries(Object.entries(i.payload.servers).filter(([l,a])=>a.type==="reverse").map(([l,a])=>[l,Qi(l)])),n=[];for(const l of s){const a=Ns(l),d=a in r;delete r[a],n.push({...l,active:d})}for(const l of Object.values(r))n.push(Wc(l));return n.length>1&&Kt({...n[0],ui_id:void 0},{...hs(),ui_id:void 0})&&n.shift(),n}}}}),{addServer:na,removeServer:ia}=vr.actions,ra=vr.reducer,xr=ie("modes/transparent/setActive"),_r=ie("modes/transparent/setListenHost"),jr=ie("modes/transparent/setListenPort"),oa=[{active:!1,ui_id:Math.random()}],la=fe({name:"modes/transparent",initialState:oa,reducers:{},extraReducers:t=>{se(t,"active",xr),se(t,"listen_host",_r),se(t,"listen_port",jr),t.addCase(Ue,be("transparent",Xn)),t.addCase(Be,be("transparent",Xn))}}),ca=la.reducer,yr=ie("modes/socks5/setActive"),wr=ie("modes/socks5/setListenHost"),br=ie("modes/socks5/setListenPort"),aa=[{active:!1,ui_id:Math.random()}],da=fe({name:"modes/socks5",initialState:aa,reducers:{},extraReducers:t=>{se(t,"active",yr),se(t,"listen_host",wr),se(t,"listen_port",br),t.addCase(Ue,be("socks5",Zn)),t.addCase(Be,be("socks5",Zn))}}),ua=da.reducer,Sr=ie("modes/upstream/setActive"),$r=ie("modes/upstream/setListenHost"),Cr=ie("modes/upstream/setListenPort"),Nr=ie("modes/upstream/setDestination"),fa=[{active:!1,destination:"",ui_id:Math.random()}],pa=fe({name:"modes/upstream",initialState:fa,reducers:{},extraReducers:t=>{se(t,"active",Sr),se(t,"listen_host",$r),se(t,"listen_port",Cr),se(t,"destination",Nr),t.addCase(Ue,be("upstream",ei)),t.addCase(Be,be("upstream",ei))}}),ha=pa.reducer,kr=ie("modes/dns/setActive"),Er=ie("modes/dns/setListenHost"),Tr=ie("modes/dns/setListenPort"),ma=[{active:!0,ui_id:Math.random()}],ga=fe({name:"modes/dns",initialState:ma,reducers:{},extraReducers:t=>{se(t,"active",kr),se(t,"listen_host",Er),se(t,"listen_port",Tr),t.addCase(Ue,be("dns",ti)),t.addCase(Be,be("dns",ti))}}),va=ga.reducer,xa=fi({regular:Yc,local:Xc,wireguard:ta,reverse:ra,transparent:ca,socks:ua,upstream:ha,dns:va}),$t=ui("fetchProcesses",async(t,{rejectWithValue:e})=>{try{return(await ne("/processes")).json()}catch(s){return e(s.message)}}),_a={currentProcesses:[],isLoading:!1},ja=fe({name:"processes",initialState:_a,reducers:{},extraReducers:t=>{t.addCase($t.pending,e=>{e.isLoading=!0,e.error=void 0}),t.addCase($t.fulfilled,(e,s)=>{e.isLoading=!1,e.currentProcesses=s.payload}),t.addCase($t.rejected,(e,s)=>{e.isLoading=!1,e.error=s.payload})}}),ya=ja.reducer,wa={commandBar:Oc,eventLog:pc,flows:nc,connection:Ec,modes:xa,ui:Sc,options:Ac,options_meta:Bc,backendState:Hc,processes:ya},ba={immutableCheck:{warnAfter:5e5},serializableCheck:{warnAfter:5e5,ignoredPaths:["flows"]}},Nt=El({reducer:wa,middleware:t=>t(ba),devTools:!1});class Sa extends I.Component{container=Te.createRef();nameInput=Te.createRef();valueInput=Te.createRef();render=()=>{const[e,s]=this.props.item;return o.jsxs("div",{ref:this.container,className:"kv-row",onClick:this.onClick,onKeyDownCapture:this.onKeyDown,children:[o.jsx(ce,{ref:this.nameInput,className:"kv-key",content:e,onEditStart:this.props.onEditStart,onEditDone:i=>this.props.onEditDone([i,s]),selectAllOnClick:!0}),":ย ",o.jsx(ce,{ref:this.valueInput,className:"kv-value",content:s,onEditStart:this.props.onEditStart,onEditDone:i=>this.props.onEditDone([e,i]),placeholder:"empty",selectAllOnClick:!0})]})};onClick=e=>{e.target===this.container.current&&this.props.onClickEmptyArea()};onKeyDown=e=>{e.target===this.valueInput.current?.input.current&&e.key==="Tab"&&this.props.onTabNext()}}class Rr extends I.Component{rowRefs={};currentlyEditing;justFinishedEditing;state={currentList:this.props.data||[],initialList:this.props.data};static getDerivedStateFromProps(e,s){return e.data!==s.initialList?{currentList:e.data||[],initialList:e.data}:null}render=()=>{this.rowRefs={};const e=this.state.currentList.map((s,i)=>o.jsx(Sa,{item:s,onEditStart:()=>this.currentlyEditing=i,onEditDone:r=>this.onEditDone(i,r),onClickEmptyArea:()=>this.onClickEmptyArea(i),onTabNext:()=>this.onTabNext(i),ref:r=>{this.rowRefs[i]=r}},i));return o.jsxs("div",{className:je("kv-editor",this.props.className),onMouseDown:this.onMouseDown,children:[e,o.jsx("div",{onClick:s=>{s.preventDefault(),this.onClickEmptyArea(this.state.currentList.length-1)},className:"kv-add-row fa fa-plus-square-o",role:"button","aria-label":"Add"})]})};onEditDone=(e,s)=>{const i=[...this.state.currentList];s[0]?i[e]=s:i.splice(e,1),this.currentlyEditing=void 0,Ht.isEqual(this.state.currentList,i)||this.props.onChange(i),this.setState({currentList:i})};onClickEmptyArea=e=>{if(this.justFinishedEditing)return;const s=[...this.state.currentList];s.splice(e+1,0,["",""]),this.setState({currentList:s},()=>this.rowRefs[e+1]?.nameInput.current?.startEditing())};onTabNext=e=>{e==this.state.currentList.length-1&&this.onClickEmptyArea(e)};onMouseDown=e=>{this.justFinishedEditing=this.currentlyEditing}}function Ar(t,e){const s=k.c(6),[i,r]=I.useState(),[n,l]=I.useState();let a;s[0]!==n||s[1]!==t?(a=()=>{n&&n.abort();const f=new AbortController;return ne(t,{signal:f.signal}).then($a).then(p=>{r(p)}).catch(p=>{f.signal.aborted||r(`Error getting content: ${p}.`)}),l(f),()=>{f.signal.aborted||f.abort()}},s[0]=n,s[1]=t,s[2]=a):a=s[2];let d;return s[3]!==e||s[4]!==t?(d=[t,e],s[3]=e,s[4]=t,s[5]=d):d=s[5],I.useEffect(a,d),i}function $a(t){if(!t.ok)throw`${t.status} ${t.statusText}`.trim();return t.text()}function Dr(t,e,s,i,r){const n=k.c(11);let l;n[0]!==t||n[1]!==i||n[2]!==e||n[3]!==s?(l=we.getContentURL(t,e,s,i),n[0]=t,n[1]=i,n[2]=e,n[3]=s,n[4]=l):l=n[4];const d=Ar(l,r);let f;if(d)try{let p;n[5]!==d?(p=JSON.parse(d),n[5]=d,n[6]=p):p=n[6],f=p}catch{let p;n[7]!==d?(p={text:d,description:"Network Error",syntax_highlight:"error",view_name:"raw"},n[7]=d,n[8]=p):p=n[8];const h=p;if(e==="messages"){let g;n[9]!==h?(g=[h],n[9]=h,n[10]=g):g=n[10],f=g}else f=h}else f=void 0;return f}const Fr=Te.memo(function({icon:e,text:s,className:i,title:r,onOpenFile:n,onClick:l}){let a;return o.jsxs("a",{href:"#",onClick:d=>{a.click(),l&&l(d)},className:i,title:r,children:[o.jsx("i",{className:"fa fa-fw "+e}),s,o.jsx("input",{ref:d=>{a=d},className:"hidden",type:"file",onChange:d=>{d.preventDefault(),d.target.files&&d.target.files.length>0&&n(d.target.files[0]),a.value=""}})]})});function pe(t){const e=k.c(11),{onClick:s,children:i,icon:r,disabled:n,className:l,title:a}=t;let d;e[0]!==l?(d=je(l,"btn btn-default"),e[0]=l,e[1]=d):d=e[1];const f=n?void 0:s;let p;e[2]!==r?(p=r&&o.jsxs(o.Fragment,{children:[o.jsx("i",{className:"fa "+r}),"ย "]}),e[2]=r,e[3]=p):p=e[3];let h;return e[4]!==i||e[5]!==n||e[6]!==d||e[7]!==f||e[8]!==p||e[9]!==a?(h=o.jsxs("button",{className:d,onClick:f,disabled:n,title:a,children:[p,i]}),e[4]=i,e[5]=n,e[6]=d,e[7]=f,e[8]=p,e[9]=a,e[10]=h):h=e[10],h}function Ca(t){const e=k.c(11),{initialContent:s,onChange:i,language:r,readonly:n}=t,l=n===void 0?!1:n,a=Na;let d;e:switch(r){case ot.YAML:{let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[Dl()],e[0]=h):h=e[0],d=h;break e}case ot.XML:{let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=[Al()],e[1]=h):h=e[1],d=h;break e}case ot.JAVASCRIPT:{let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=[Rl()],e[2]=h):h=e[2],d=h;break e}case ot.CSS:{let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=[Tl()],e[3]=h):h=e[3],d=h;break e}case void 0:case null:case ot.NONE:case ot.ERROR:{let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[4]=h):h=e[4],d=h;break e}default:{console.error("Unexpected syntax highlighting language: ",r);let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[5]=g):g=e[5],d=g}}const f=d;let p;return e[6]!==f||e[7]!==s||e[8]!==i||e[9]!==l?(p=o.jsx("div",{className:"codeeditor",onKeyDown:a,children:o.jsx(Fl,{value:s,onChange:i,readOnly:l,extensions:f})}),e[6]=f,e[7]=s,e[8]=i,e[9]=l,e[10]=p):p=e[10],p}function Na(t){return t.stopPropagation()}const Ir=Te.memo(function(e){const s=k.c(9),{content:i,maxLines:r,showMore:n}=e;if(i.length===0)return null;let l;if(s[0]!==i||s[1]!==r||s[2]!==n){let d;s[4]!==r||s[5]!==n?(d=(f,p)=>p===r?o.jsxs("button",{onClick:n,className:"btn btn-xs btn-info",children:[o.jsx("i",{className:"fa fa-angle-double-down","aria-hidden":"true"})," ","Show more"]},"showmore"):o.jsx("div",{children:f},p),s[4]=r,s[5]=n,s[6]=d):d=s[6],l=i.split(` +`).map(d),s[0]=i,s[1]=r,s[2]=n,s[3]=l}else l=s[3];let a;return s[7]!==l?(a=o.jsx("pre",{children:l}),s[7]=l,s[8]=a):a=s[8],a}),ka=()=>{const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("li",{role:"separator",className:"divider"}),t[0]=e):e=t[0],e};function ke(t){const e=k.c(8);let s,i,r;if(e[0]!==t){const{onClick:a,children:d,...f}=t;i=d,s=f,r=p=>{p.preventDefault(),a()},e[0]=t,e[1]=s,e[2]=i,e[3]=r}else s=e[1],i=e[2],r=e[3];const n=r;let l;return e[4]!==s||e[5]!==i||e[6]!==n?(l=o.jsx("li",{children:o.jsx("a",{href:"#",onClick:n,...s,children:i})}),e[4]=s,e[5]=i,e[6]=n,e[7]=l):l=e[7],l}const Et=Te.memo(function({text:e,children:s,options:i,className:r,onOpen:n,...l}){const[a,d]=I.useState(!1),{refs:f,floatingStyles:p}=Il(i),h=_=>{d(_),n&&n(_)};I.useEffect(()=>{f.floating.current&&document.addEventListener("click",_=>{f.floating.current?.contains(_.target)?document.addEventListener("click",()=>h(!1),{once:!0}):(_.preventDefault(),_.stopPropagation(),h(!1))},{once:!0,capture:!0})},[f.floating.current]);let g;return a?g=o.jsx("ul",{className:"dropdown-menu show",ref:f.setFloating,style:p,children:s}):g=null,o.jsxs(o.Fragment,{children:[o.jsx("a",{href:"#",ref:f.setReference,className:je(r,{open:a}),onClick:_=>{_.preventDefault(),h(!0)},...l,children:e}),g]})});function Lr(t){const e=k.c(16),{value:s,onChange:i}=t,r=D(Ea);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("i",{className:"fa fa-fw fa-files-o"}),e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("b",{children:"View:"}),e[1]=l):l=e[1];let a;e[2]!==s?(a=s.toLowerCase(),e[2]=s,e[3]=a):a=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("span",{className:"caret"}),e[4]=d):d=e[4];let f;e[5]!==a?(f=o.jsxs("span",{children:[n,"ย ",l," ",a," ",d]}),e[5]=a,e[6]=f):f=e[6];const p=f;let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h={placement:"top-end"},e[7]=h):h=e[7];let g;if(e[8]!==r||e[9]!==i){let j;e[11]!==i?(j=y=>o.jsx(ke,{onClick:()=>i(y),children:y.toLowerCase().replace("_"," ")},y),e[11]=i,e[12]=j):j=e[12],g=r.map(j),e[8]=r,e[9]=i,e[10]=g}else g=e[10];let _;return e[13]!==p||e[14]!==g?(_=o.jsx(Et,{text:p,className:"btn btn-default btn-xs",options:h,children:g}),e[13]=p,e[14]=g,e[15]=_):_=e[15],_}function Ea(t){return t.backendState.contentViews||[]}function Ta(t){const e=k.c(8),{flow:s,message:i}=t,[r,n]=I.useState(!1);if(r){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(!1),e[0]=l):l=e[0];let a;return e[1]!==s||e[2]!==i?(a=o.jsx(Ra,{flow:s,message:i,stopEdit:l}),e[1]=s,e[2]=i,e[3]=a):a=e[3],a}else{let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(!0),e[4]=l):l=e[4];let a;return e[5]!==s||e[6]!==i?(a=o.jsx(Aa,{flow:s,message:i,startEdit:l}),e[5]=s,e[6]=i,e[7]=a):a=e[7],a}}function Ra(t){const e=k.c(23),{flow:s,message:i,stopEdit:r}=t,n=G(),l=s.request===i?"request":"response";let a;e[0]!==s||e[1]!==i?(a=we.getContentURL(s,i),e[0]=s,e[1]=i,e[2]=a):a=e[2];const f=Ar(a,i.contentHash),[p,h]=I.useState();let g;e[3]!==f||e[4]!==n||e[5]!==p||e[6]!==s||e[7]!==l||e[8]!==r?(g=async()=>{await n(Le(s,{[l]:{content:p??f??""}})),r()},e[3]=f,e[4]=n,e[5]=p,e[6]=s,e[7]=l,e[8]=r,e[9]=g):g=e[9];const _=g;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("h5",{children:"[Editing]"}),e[10]=j):j=e[10];let y;e[11]!==_?(y=o.jsx(pe,{onClick:_,icon:"fa-check text-success",className:"btn-xs",children:"Done"}),e[11]=_,e[12]=y):y=e[12];let w;e[13]!==r?(w=o.jsx(pe,{onClick:()=>r(),icon:"fa-times text-danger",className:"btn-xs",children:"Cancel"}),e[13]=r,e[14]=w):w=e[14];let $;e[15]!==y||e[16]!==w?($=o.jsxs("div",{className:"controls",children:[j,y,"ย ",w]}),e[15]=y,e[16]=w,e[17]=$):$=e[17];const N=f||"";let E;e[18]!==N?(E=o.jsx(Ca,{initialContent:N,onChange:h}),e[18]=N,e[19]=E):E=e[19];let T;return e[20]!==$||e[21]!==E?(T=o.jsxs("div",{className:"contentview",children:[$,E]},"edit"),e[20]=$,e[21]=E,e[22]=T):T=e[22],T}function Aa(t){const e=k.c(43),{flow:s,message:i,startEdit:r}=t,n=G(),l=s.request===i?"request":"response";let a;e[0]!==s.id||e[1]!==l?(a=V=>V.ui.flow.contentViewFor[s.id+l]||"Auto",e[0]=s.id,e[1]=l,e[2]=a):a=e[2];const d=D(a),[f,p]=I.useState(D(Da));let h;e[3]!==f?(h=()=>p(Math.max(1024,f*2)),e[3]=f,e[4]=h):h=e[4];const g=h,_=Dr(s,i,d,f+1,i.contentHash);let j;if(i.contentLength===0)j="No content";else if(_===void 0)j="Loading...";else{const V=`${_.view_name} ${_.description}`;let W;e[5]!==V?(W=V.trimEnd(),e[5]=V,e[6]=W):W=e[6],j=W}let y;e[7]!==j?(y=o.jsx("h5",{children:j}),e[7]=j,e[8]=y):y=e[8];let w;e[9]!==_||e[10]!==s||e[11]!==i?(w=_&&_?.text.length>0&&o.jsx(Fa,{flow:s,message:i}),e[9]=_,e[10]=s,e[11]=i,e[12]=w):w=e[12];let $;e[13]!==r?($=o.jsx(pe,{onClick:r,icon:"fa-edit",className:"btn-xs",children:"Edit"}),e[13]=r,e[14]=$):$=e[14];let N;e[15]!==n||e[16]!==s||e[17]!==l?(N=o.jsx(Fr,{icon:"fa-upload",text:"Replace",title:"Upload a file to replace the content.",onOpenFile:V=>n(ec(s,V,l)),className:"btn btn-default btn-xs"}),e[15]=n,e[16]=s,e[17]=l,e[18]=N):N=e[18];let E;e[19]!==n||e[20]!==s.id||e[21]!==l?(E=V=>n(pi({messageId:s.id+l,contentView:V})),e[19]=n,e[20]=s.id,e[21]=l,e[22]=E):E=e[22];let T;e[23]!==d||e[24]!==E?(T=o.jsx(Lr,{value:d,onChange:E}),e[23]=d,e[24]=E,e[25]=T):T=e[25];let P;e[26]!==y||e[27]!==w||e[28]!==$||e[29]!==N||e[30]!==T?(P=o.jsxs("div",{className:"controls",children:[y,w,"ย ",$,"ย ",N,"ย ",T]}),e[26]=y,e[27]=w,e[28]=$,e[29]=N,e[30]=T,e[31]=P):P=e[31];let L;e[32]!==s||e[33]!==i?(L=gs.matches(i)&&o.jsx(gs,{flow:s,message:i}),e[32]=s,e[33]=i,e[34]=L):L=e[34];const O=_?.text??"";let M;e[35]!==f||e[36]!==g||e[37]!==O?(M=o.jsx(Ir,{content:O,maxLines:f,showMore:g}),e[35]=f,e[36]=g,e[37]=O,e[38]=M):M=e[38];let U;return e[39]!==L||e[40]!==M||e[41]!==P?(U=o.jsxs("div",{className:"contentview",children:[P,L,M]},"view"),e[39]=L,e[40]=M,e[41]=P,e[42]=U):U=e[42],U}function Da(t){return t.options.content_view_lines_cutoff}function Fa({flow:t,message:e}){const s=t.request===e?"request":"response",i=D(f=>f.ui.flow.contentViewFor[t.id+s]||"Auto"),[r,n]=I.useState(!1),[l,a]=I.useState(!1),d=async()=>{try{const f=we.getContentURL(t,e,i);a(!0);const p=await ne(f);if(!p.ok)throw new Error(`${p.status} ${p.statusText}`.trim());const h=await p.json();await Bl(h),n(!0),setTimeout(()=>n(!1),2e3)}catch(f){console.error(f)}finally{a(!1)}};return o.jsx(pe,{onClick:d,icon:"fa-clipboard",className:"btn-xs",disabled:l,children:r?"Copied!":"Copy"})}const Ia=/^image\/(png|jpe?g|gif|webp|vnc.microsoft.icon|x-icon|svg\+xml)$/i;gs.matches=t=>Ia.test(we.getContentType(t)||"");function gs(t){const e=k.c(5),{flow:s,message:i}=t;let r;e[0]!==s||e[1]!==i?(r=we.getContentURL(s,i),e[0]=s,e[1]=i,e[2]=r):r=e[2];let n;return e[3]!==r?(n=o.jsx("div",{className:"flowview-image",children:o.jsx("img",{src:r,alt:"preview",className:"img-thumbnail"})}),e[3]=r,e[4]=n):n=e[4],n}function La(t){const e=k.c(24),{flow:s}=t,i=G();let r;e[0]!==i||e[1]!==s?(r=g=>i(Le(s,{request:{method:g}})),e[0]=i,e[1]=s,e[2]=r):r=e[2];let n;e[3]!==s.request.method||e[4]!==r?(n=o.jsx(bt,{content:s.request.method,onEditDone:r,isValid:Oa,selectAllOnClick:!0}),e[3]=s.request.method,e[4]=r,e[5]=n):n=e[5];let l;e[6]!==s.request?(l=ct.pretty_url(s.request),e[6]=s.request,e[7]=l):l=e[7];let a;e[8]!==i||e[9]!==s?(a=g=>i(Le(s,{request:{path:"",..._i(g)}})),e[8]=i,e[9]=s,e[10]=a):a=e[10];let d;e[11]!==l||e[12]!==a?(d=o.jsx(bt,{content:l,onEditDone:a,isValid:Pa}),e[11]=l,e[12]=a,e[13]=d):d=e[13];let f;e[14]!==i||e[15]!==s?(f=g=>i(Le(s,{request:{http_version:g}})),e[14]=i,e[15]=s,e[16]=f):f=e[16];let p;e[17]!==s.request.http_version||e[18]!==f?(p=o.jsx(bt,{content:s.request.http_version,onEditDone:f,isValid:ji,selectAllOnClick:!0}),e[17]=s.request.http_version,e[18]=f,e[19]=p):p=e[19];let h;return e[20]!==n||e[21]!==d||e[22]!==p?(h=o.jsx("div",{className:"first-line request-line",children:o.jsxs("div",{children:[n,"ย ",d,"ย ",p]})}),e[20]=n,e[21]=d,e[22]=p,e[23]=h):h=e[23],h}function Pa(t){return!!_i(t)?.host}function Oa(t){return t.length>0}function Ma(t){const e=k.c(19),{flow:s}=t,i=G();let r;e[0]!==i||e[1]!==s?(r=h=>i(Le(s,{response:{http_version:h}})),e[0]=i,e[1]=s,e[2]=r):r=e[2];let n;e[3]!==s.response.http_version||e[4]!==r?(n=o.jsx(bt,{content:s.response.http_version,onEditDone:r,isValid:ji,selectAllOnClick:!0}),e[3]=s.response.http_version,e[4]=r,e[5]=n):n=e[5];const l=s.response.status_code+"";let a;e[6]!==i||e[7]!==s?(a=h=>i(Le(s,{response:{code:parseInt(h)}})),e[6]=i,e[7]=s,e[8]=a):a=e[8];let d;e[9]!==l||e[10]!==a?(d=o.jsx(bt,{content:l,onEditDone:a,isValid:qa,selectAllOnClick:!0}),e[9]=l,e[10]=a,e[11]=d):d=e[11];let f;e[12]!==i||e[13]!==s?(f=s.response.http_version!=="HTTP/2.0"&&o.jsxs(o.Fragment,{children:["ย ",o.jsx(ce,{content:s.response.reason,onEditDone:h=>i(Le(s,{response:{msg:h}})),selectAllOnClick:!0})]}),e[12]=i,e[13]=s,e[14]=f):f=e[14];let p;return e[15]!==n||e[16]!==d||e[17]!==f?(p=o.jsxs("div",{className:"first-line response-line",children:[n,"ย ",d,f]}),e[15]=n,e[16]=d,e[17]=f,e[18]=p):p=e[18],p}function qa(t){return/^\d+$/.test(t)}function Ha(t){const e=k.c(7),{flow:s,message:i}=t,r=G(),n=s.request===i?"request":"response";let l;e[0]!==r||e[1]!==s||e[2]!==n?(l=d=>r(Le(s,{[n]:{headers:d}})),e[0]=r,e[1]=s,e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==i.headers||e[5]!==l?(a=o.jsx(Rr,{className:"headers",data:i.headers,onChange:l}),e[4]=i.headers,e[5]=l,e[6]=a):a=e[6],a}function Va(t){const e=k.c(9),{flow:s,message:i}=t,r=G(),n=s.request===i?"request":"response";if(!!!we.get_first_header(i,/^trailer$/i))return null;let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("hr",{}),d=o.jsx("h5",{children:"HTTP Trailers"}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let f;e[2]!==r||e[3]!==s||e[4]!==n?(f=h=>r(Le(s,{[n]:{trailers:h}})),e[2]=r,e[3]=s,e[4]=n,e[5]=f):f=e[5];let p;return e[6]!==i.trailers||e[7]!==f?(p=o.jsxs(o.Fragment,{children:[a,d,o.jsx(Rr,{className:"trailers",data:i.trailers,onChange:f})]}),e[6]=i.trailers,e[7]=f,e[8]=p):p=e[8],p}const Pr=I.memo(function(e){const s=k.c(20),{flow:i,message:r}=e,n=i.request===r?"request":"response",l=i.request===r?La:Ma;let a;s[0]!==l||s[1]!==i?(a=o.jsx(l,{flow:i}),s[0]=l,s[1]=i,s[2]=a):a=s[2];let d;s[3]!==i||s[4]!==r?(d=o.jsx(Ha,{flow:i,message:r}),s[3]=i,s[4]=r,s[5]=d):d=s[5];let f;s[6]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("hr",{}),s[6]=f):f=s[6];const p=i.id+n;let h;s[7]!==i||s[8]!==r||s[9]!==p?(h=o.jsx(Ta,{flow:i,message:r},p),s[7]=i,s[8]=r,s[9]=p,s[10]=h):h=s[10];let g;s[11]!==i||s[12]!==r?(g=o.jsx(Va,{flow:i,message:r}),s[11]=i,s[12]=r,s[13]=g):g=s[13];let _;return s[14]!==n||s[15]!==a||s[16]!==d||s[17]!==h||s[18]!==g?(_=o.jsxs("section",{className:n,children:[a,d,f,h,g]}),s[14]=n,s[15]=a,s[16]=d,s[17]=h,s[18]=g,s[19]=_):_=s[19],_});function Or(){const t=k.c(2),e=D(Ua);let s;return t[0]!==e?(s=o.jsx(Pr,{flow:e,message:e.request}),t[0]=e,t[1]=s):s=t[1],s}function Ua(t){return t.flows.selected[0]}Or.displayName="Request";function Mr(){const t=k.c(2),e=D(Ba);let s;return t[0]!==e?(s=o.jsx(Pr,{flow:e,message:e.response}),t[0]=e,t[1]=s):s=t[1],s}function Ba(t){return t.flows.selected[0]}Mr.displayName="Response";const Wa=t=>{const e=k.c(3),{message:s}=t,i=s.query?s.op_code:s.response_code,r=s.truncation?"(Truncated)":"";let n;return e[0]!==i||e[1]!==r?(n=o.jsxs("div",{children:[i,"ย ",r]}),e[0]=i,e[1]=r,e[2]=n):n=e[2],n},Ka=t=>{const e=k.c(10),{message:s}=t,i=s.recursion_desired?"Recursive ":"";let r;e[0]!==i?(r=o.jsxs("h5",{children:[i,"Question"]}),e[0]=i,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Class"})]})}),e[2]=n):n=e[2];let l;e[3]!==s.questions?(l=s.questions.map(Ya),e[3]=s.questions,e[4]=l):l=e[4];let a;e[5]!==l?(a=o.jsxs("table",{children:[n,o.jsx("tbody",{children:l})]}),e[5]=l,e[6]=a):a=e[6];let d;return e[7]!==r||e[8]!==a?(d=o.jsxs(o.Fragment,{children:[r,a]}),e[7]=r,e[8]=a,e[9]=d):d=e[9],d},ls=t=>{const e=k.c(7),{name:s,values:i}=t;let r;e[0]!==s?(r=o.jsx("h5",{children:s}),e[0]=s,e[1]=r):r=e[1];let n;e[2]!==i?(n=i.length>0?o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Class"}),o.jsx("th",{children:"TTL"}),o.jsx("th",{children:"Data"})]})}),o.jsx("tbody",{children:i.map(Ja)})]}):"โ€”",e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==r||e[5]!==n?(l=o.jsxs(o.Fragment,{children:[r,n]}),e[4]=r,e[5]=n,e[6]=l):l=e[6],l},qr=t=>{const e=k.c(24),{type:s,message:i}=t,r="dns-"+s,n=`first-line ${s}-line`;let l;e[0]!==i?(l=o.jsx(Wa,{message:i}),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==n||e[3]!==l?(a=o.jsx("div",{className:n,children:l}),e[2]=n,e[3]=l,e[4]=a):a=e[4];let d;e[5]!==i?(d=o.jsx(Ka,{message:i}),e[5]=i,e[6]=d):d=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("hr",{}),e[7]=f):f=e[7];const p=`${i.authoritative_answer?"Authoritative ":""}${i.recursion_available?"Recursive ":""}Answer`;let h;e[8]!==i.answers||e[9]!==p?(h=o.jsx(ls,{name:p,values:i.answers}),e[8]=i.answers,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("hr",{}),e[11]=g):g=e[11];let _;e[12]!==i.authorities?(_=o.jsx(ls,{name:"Authority",values:i.authorities}),e[12]=i.authorities,e[13]=_):_=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("hr",{}),e[14]=j):j=e[14];let y;e[15]!==i.additionals?(y=o.jsx(ls,{name:"Additional",values:i.additionals}),e[15]=i.additionals,e[16]=y):y=e[16];let w;return e[17]!==r||e[18]!==_||e[19]!==y||e[20]!==a||e[21]!==d||e[22]!==h?(w=o.jsxs("section",{className:r,children:[a,d,f,h,g,_,j,y]}),e[17]=r,e[18]=_,e[19]=y,e[20]=a,e[21]=d,e[22]=h,e[23]=w):w=e[23],w};function Hr(){const t=k.c(2),e=D(za);let s;return t[0]!==e.request?(s=o.jsx(qr,{type:"request",message:e.request}),t[0]=e.request,t[1]=s):s=t[1],s}function za(t){return t.flows.selected[0]}Hr.displayName="Request";function Vr(){const t=k.c(2),e=D(Ga);let s;return t[0]!==e.response?(s=o.jsx(qr,{type:"response",message:e.response}),t[0]=e.response,t[1]=s):s=t[1],s}function Ga(t){return t.flows.selected[0]}Vr.displayName="Response";function Ya(t,e){return o.jsxs("tr",{children:[o.jsx("td",{children:t.name}),o.jsx("td",{children:t.type}),o.jsx("td",{children:t.class})]},e)}function Ja(t,e){return o.jsxs("tr",{children:[o.jsx("td",{children:t.name}),o.jsx("td",{children:t.type}),o.jsx("td",{children:t.class}),o.jsx("td",{children:t.ttl}),o.jsx("td",{children:JSON.stringify(t.data).replace(/^"|"$/g,"")})]},e)}function Mt(t,e){return e?(e=[e[0],e[1]],e[0].includes(":")&&(e[0]=`[${e[0]}]`),o.jsxs("tr",{children:[o.jsxs("td",{children:[t,":"]}),o.jsx("td",{children:e.join(":")})]})):o.jsx(o.Fragment,{})}function si(t){const e=k.c(26),{conn:s}=t;let i;if("address"in s){let f;e[0]!==s.address?(f=Mt("Address",s.address),e[0]=s.address,e[1]=f):f=e[1];let p;e[2]!==s.peername?(p=Mt("Resolved address",s.peername),e[2]=s.peername,e[3]=p):p=e[3];let h;e[4]!==s.sockname?(h=Mt("Source address",s.sockname),e[4]=s.sockname,e[5]=h):h=e[5];let g;e[6]!==f||e[7]!==p||e[8]!==h?(g=o.jsxs(o.Fragment,{children:[f,p,h]}),e[6]=f,e[7]=p,e[8]=h,e[9]=g):g=e[9],i=g}else{let f;e[10]!==s.peername?(f=Mt("Address",s.peername),e[10]=s.peername,e[11]=f):f=e[11],i=f}let r;e[12]!==s.sni?(r=s.sni?o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("abbr",{title:"TLS Server Name Indication",children:"SNI"}),":"]}),o.jsx("td",{children:s.sni})]}):null,e[12]=s.sni,e[13]=r):r=e[13];let n;e[14]!==s.alpn?(n=s.alpn?o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("abbr",{title:"ALPN protocol negotiated",children:"ALPN"}),":"]}),o.jsx("td",{children:s.alpn})]}):null,e[14]=s.alpn,e[15]=n):n=e[15];let l;e[16]!==s.tls_version?(l=s.tls_version?o.jsxs("tr",{children:[o.jsx("td",{children:"TLS Version:"}),o.jsx("td",{children:s.tls_version})]}):null,e[16]=s.tls_version,e[17]=l):l=e[17];let a;e[18]!==s.cipher?(a=s.cipher?o.jsxs("tr",{children:[o.jsx("td",{children:"TLS Cipher:"}),o.jsx("td",{children:s.cipher})]}):null,e[18]=s.cipher,e[19]=a):a=e[19];let d;return e[20]!==i||e[21]!==r||e[22]!==n||e[23]!==l||e[24]!==a?(d=o.jsx("table",{className:"connection-table",children:o.jsxs("tbody",{children:[i,r,n,l,a]})}),e[20]=i,e[21]=r,e[22]=n,e[23]=l,e[24]=a,e[25]=d):d=e[25],d}function ni(t){return o.jsx("dl",{className:"cert-attributes",children:t.map(([e,s])=>o.jsxs(I.Fragment,{children:[o.jsx("dt",{children:e}),o.jsx("dd",{children:s})]},e))})}function Qa(t){const e=k.c(46),{flow:s}=t,i=s.server_conn?.cert;if(!i){let W;return e[0]===Symbol.for("react.memo_cache_sentinel")?(W=o.jsx(o.Fragment,{}),e[0]=W):W=e[0],W}let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("h4",{children:"Server Certificate"},"name"),e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("td",{children:"Type"}),e[2]=n):n=e[2];let l;e[3]!==i.keyinfo[0]||e[4]!==i.keyinfo[1]?(l=o.jsxs("tr",{children:[n,o.jsxs("td",{children:[i.keyinfo[0],", ",i.keyinfo[1]," bits"]})]}),e[3]=i.keyinfo[0],e[4]=i.keyinfo[1],e[5]=l):l=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("td",{children:"SHA256 digest"}),e[6]=a):a=e[6];let d;e[7]!==i.sha256?(d=o.jsxs("tr",{children:[a,o.jsx("td",{children:i.sha256})]}),e[7]=i.sha256,e[8]=d):d=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("td",{children:"Valid from"}),e[9]=f):f=e[9];let p;e[10]!==i.notbefore?(p=at(i.notbefore,{includeMilliseconds:!1}),e[10]=i.notbefore,e[11]=p):p=e[11];let h;e[12]!==p?(h=o.jsxs("tr",{children:[f,o.jsx("td",{children:p})]}),e[12]=p,e[13]=h):h=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("td",{children:"Valid to"}),e[14]=g):g=e[14];let _;e[15]!==i.notafter?(_=at(i.notafter,{includeMilliseconds:!1}),e[15]=i.notafter,e[16]=_):_=e[16];let j;e[17]!==_?(j=o.jsxs("tr",{children:[g,o.jsx("td",{children:_})]}),e[17]=_,e[18]=j):j=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("td",{children:"Subject Alternative Names"}),e[19]=y):y=e[19];let w;e[20]!==i.altnames?(w=i.altnames.join(", "),e[20]=i.altnames,e[21]=w):w=e[21];let $;e[22]!==w?($=o.jsxs("tr",{children:[y,o.jsx("td",{children:w})]}),e[22]=w,e[23]=$):$=e[23];let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx("td",{children:"Subject"}),e[24]=N):N=e[24];let E;e[25]!==i.subject?(E=ni(i.subject),e[25]=i.subject,e[26]=E):E=e[26];let T;e[27]!==E?(T=o.jsxs("tr",{children:[N,o.jsx("td",{children:E})]}),e[27]=E,e[28]=T):T=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx("td",{children:"Issuer"}),e[29]=P):P=e[29];let L;e[30]!==i.issuer?(L=ni(i.issuer),e[30]=i.issuer,e[31]=L):L=e[31];let O;e[32]!==L?(O=o.jsxs("tr",{children:[P,o.jsx("td",{children:L})]}),e[32]=L,e[33]=O):O=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("td",{children:"Serial"}),e[34]=M):M=e[34];let U;e[35]!==i.serial?(U=o.jsxs("tr",{children:[M,o.jsx("td",{children:i.serial})]}),e[35]=i.serial,e[36]=U):U=e[36];let V;return e[37]!==j||e[38]!==$||e[39]!==T||e[40]!==O||e[41]!==U||e[42]!==l||e[43]!==d||e[44]!==h?(V=o.jsxs(o.Fragment,{children:[r,o.jsx("table",{className:"certificate-table",children:o.jsxs("tbody",{children:[l,d,h,j,$,T,O,U]})})]}),e[37]=j,e[38]=$,e[39]=T,e[40]=O,e[41]=U,e[42]=l,e[43]=d,e[44]=h,e[45]=V):V=e[45],V}function Ur(t){const e=k.c(11),{flow:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("h4",{children:"Client Connection"}),e[0]=i):i=e[0];let r;e[1]!==s.client_conn?(r=o.jsx(si,{conn:s.client_conn}),e[1]=s.client_conn,e[2]=r):r=e[2];let n;e[3]!==s.server_conn?(n=s.server_conn?.address&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{children:"Server Connection"}),o.jsx(si,{conn:s.server_conn})]}),e[3]=s.server_conn,e[4]=n):n=e[4];let l;e[5]!==s?(l=o.jsx(Qa,{flow:s}),e[5]=s,e[6]=l):l=e[6];let a;return e[7]!==r||e[8]!==n||e[9]!==l?(a=o.jsxs("section",{className:"detail",children:[i,r,n,l]}),e[7]=r,e[8]=n,e[9]=l,e[10]=a):a=e[10],a}Ur.displayName="Connection";function Br(t){const e=k.c(7),{flow:s}=t,i=s.error.msg;let r;e[0]!==s.error.timestamp?(r=at(s.error.timestamp),e[0]=s.error.timestamp,e[1]=r):r=e[1];let n;e[2]!==r?(n=o.jsx("div",{children:o.jsx("small",{children:r})}),e[2]=r,e[3]=n):n=e[3];let l;return e[4]!==s.error.msg||e[5]!==n?(l=o.jsx("section",{className:"error",children:o.jsxs("div",{className:"alert alert-warning",children:[i,n]})}),e[4]=s.error.msg,e[5]=n,e[6]=l):l=e[6],l}Br.displayName="Error";function Xa(t){const e=k.c(4),{t:s,deltaTo:i,title:r}=t;let n;return e[0]!==i||e[1]!==s||e[2]!==r?(n=s?o.jsxs("tr",{children:[o.jsxs("td",{children:[r,":"]}),o.jsxs("td",{children:[at(s),i&&o.jsxs("span",{className:"text-muted",children:["(",mi(1e3*(s-i)),")"]})]})]}):o.jsx("tr",{}),e[0]=i,e[1]=s,e[2]=r,e[3]=n):n=e[3],n}function Wr(t){const e=k.c(26),{flow:s}=t;let i;s.type==="http"?i=s.request.timestamp_start:i=s.client_conn.timestamp_start;const r=s.server_conn?.timestamp_start;let n,l,a,d;if(e[0]!==s.client_conn.timestamp_end||e[1]!==s.client_conn.timestamp_start||e[2]!==s.client_conn.timestamp_tls_setup||e[3]!==s.request||e[4]!==s.response?.timestamp_end||e[5]!==s.response?.timestamp_start||e[6]!==s.server_conn?.timestamp_end||e[7]!==s.server_conn?.timestamp_tcp_setup||e[8]!==s.server_conn?.timestamp_tls_setup||e[9]!==s.type||e[10]!==i||e[11]!==r){const g=[{title:"Server conn. initiated",t:r,deltaTo:i},{title:"Server conn. TCP handshake",t:s.server_conn?.timestamp_tcp_setup,deltaTo:i},{title:"Server conn. TLS handshake",t:s.server_conn?.timestamp_tls_setup,deltaTo:i},{title:"Server conn. closed",t:s.server_conn?.timestamp_end,deltaTo:i},{title:"Client conn. established",t:s.client_conn.timestamp_start,deltaTo:s.type==="http"?i:void 0},{title:"Client conn. TLS handshake",t:s.client_conn.timestamp_tls_setup,deltaTo:i},{title:"Client conn. closed",t:s.client_conn.timestamp_end,deltaTo:i}];s.type==="http"&&g.push({title:"First request byte",t:s.request.timestamp_start},{title:"Request complete",t:s.request.timestamp_end,deltaTo:i},{title:"First response byte",t:s.response?.timestamp_start,deltaTo:i},{title:"Response complete",t:s.response?.timestamp_end,deltaTo:i}),a="timing",e[16]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("h4",{children:"Timing"}),e[16]=d):d=e[16],l="timing-table",n=g.filter(td).sort(ed).map(Za),e[0]=s.client_conn.timestamp_end,e[1]=s.client_conn.timestamp_start,e[2]=s.client_conn.timestamp_tls_setup,e[3]=s.request,e[4]=s.response?.timestamp_end,e[5]=s.response?.timestamp_start,e[6]=s.server_conn?.timestamp_end,e[7]=s.server_conn?.timestamp_tcp_setup,e[8]=s.server_conn?.timestamp_tls_setup,e[9]=s.type,e[10]=i,e[11]=r,e[12]=n,e[13]=l,e[14]=a,e[15]=d}else n=e[12],l=e[13],a=e[14],d=e[15];let f;e[17]!==n?(f=o.jsx("tbody",{children:n}),e[17]=n,e[18]=f):f=e[18];let p;e[19]!==l||e[20]!==f?(p=o.jsx("table",{className:l,children:f}),e[19]=l,e[20]=f,e[21]=p):p=e[21];let h;return e[22]!==a||e[23]!==d||e[24]!==p?(h=o.jsxs("section",{className:a,children:[d,p]}),e[22]=a,e[23]=d,e[24]=p,e[25]=h):h=e[25],h}function Za(t){const{title:e,t:s,deltaTo:i}=t;return o.jsx(Xa,{title:e,t:s,deltaTo:i},e)}function ed(t,e){return t.t-e.t}function td(t){return!!t.t}Wr.displayName="Timing";function ks({flow:t,messages_meta:e}){const s=G(),i=D(f=>f.ui.flow.contentViewFor[t.id+"messages"]||"Auto"),[r,n]=I.useState(D(f=>f.options.content_view_lines_cutoff)),l=I.useCallback(()=>n(Math.max(1024,r*2)),[r]),a=Dr(t,"messages",i,r+1,t.id+e.count)??[];let d=r;return o.jsxs("div",{className:"contentview",children:[o.jsxs("div",{className:"controls",children:[o.jsxs("h5",{children:[e.count," Messages"]}),o.jsx(Lr,{value:i,onChange:f=>s(pi({messageId:t.id+"messages",contentView:f}))})]}),a.map((f,p)=>{const h=`fa fa-fw fa-arrow-${f.from_client?"right text-primary":"left text-danger"}`,g=o.jsxs("div",{children:[o.jsxs("small",{children:[o.jsx("i",{className:h}),o.jsx("span",{className:"pull-right",children:f.timestamp&&at(f.timestamp)})]}),o.jsx(Ir,{content:f.text,maxLines:d,showMore:l})]},p);return d-=f.text.split(` +`).length,g})]})}function Kr(t){const e=k.c(8),{flow:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("h4",{children:"WebSocket"}),e[0]=i):i=e[0];let r;e[1]!==s?(r=o.jsx(ks,{flow:s,messages_meta:s.websocket.messages_meta}),e[1]=s,e[2]=r):r=e[2];let n;e[3]!==s.websocket?(n=o.jsx(sd,{websocket:s.websocket}),e[3]=s.websocket,e[4]=n):n=e[4];let l;return e[5]!==r||e[6]!==n?(l=o.jsxs("section",{className:"websocket",children:[i,r,n]}),e[5]=r,e[6]=n,e[7]=l):l=e[7],l}Kr.displayName="WebSocket";function sd(t){const e=k.c(10),{websocket:s}=t;if(!s.timestamp_end)return null;const i=s.close_reason?`(${s.close_reason})`:"";let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("i",{className:"fa fa-fw fa-window-close text-muted"}),e[0]=r):r=e[0];const n=s.closed_by_client?"client":"server",l=s.close_code;let a;e[1]!==s.timestamp_end?(a=at(s.timestamp_end),e[1]=s.timestamp_end,e[2]=a):a=e[2];let d;e[3]!==a?(d=o.jsx("small",{className:"pull-right",children:a}),e[3]=a,e[4]=d):d=e[4];let f;return e[5]!==i||e[6]!==n||e[7]!==d||e[8]!==s.close_code?(f=o.jsxs("div",{children:[r,"ย  Closed by ",n," ","with code ",l," ",i,".",d]}),e[5]=i,e[6]=n,e[7]=d,e[8]=s.close_code,e[9]=f):f=e[9],f}function zr(t){const e=k.c(7),{flow:s}=t,i=G();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("h4",{children:"Comment"}),e[0]=r):r=e[0];let n;e[1]!==i||e[2]!==s?(n=a=>{i(Le(s,{comment:a}))},e[1]=i,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==s.comment||e[5]!==n?(l=o.jsxs("section",{className:"timing",children:[r,o.jsx(ce,{className:"kv-value",content:s.comment,onEditDone:n,placeholder:"empty",selectAllOnClick:!0})]}),e[4]=s.comment,e[5]=n,e[6]=l):l=e[6],l}zr.displayName="Comment";function Gr(t){const e=k.c(2),{flow:s}=t;let i;return e[0]!==s?(i=o.jsx("section",{className:"tcp",children:o.jsx(ks,{flow:s,messages_meta:s.messages_meta})}),e[0]=s,e[1]=i):i=e[1],i}Gr.displayName="Stream Data";function Yr(t){const e=k.c(2),{flow:s}=t;let i;return e[0]!==s?(i=o.jsx("section",{className:"udp",children:o.jsx(ks,{flow:s,messages_meta:s.messages_meta})}),e[0]=s,e[1]=i):i=e[1],i}Yr.displayName="Datagrams";const ii={request:Or,response:Mr,error:Br,connection:Ur,timing:Wr,websocket:Kr,tcpmessages:Gr,udpmessages:Yr,dnsrequest:Hr,dnsresponse:Vr,comment:zr};function vs(t){let e;switch(t.type){case"http":e=["request","response","websocket"].filter(s=>t[s]);break;case"tcp":e=["tcpmessages"];break;case"udp":e=["udpmessages"];break;case"dns":e=["request","response"].filter(s=>t[s]).map(s=>"dns"+s);break}return t.error&&e.push("error"),e.push("connection"),e.push("timing"),e.push("comment"),e}function nd(){const t=k.c(15),e=G(),s=D(rd);let i=D(id);if(s==null){let y;return t[0]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(o.Fragment,{}),t[0]=y):y=t[0],y}const r=vs(s);r.indexOf(i)<0&&(i==="response"&&s.error?i="error":i==="error"&&"response"in s?i="response":i=r[0]);const n=ii[i],l="flow-detail",a="nav-tabs nav-tabs-sm";let d;t[1]!==e?(d=()=>e(Ve([])),t[1]=e,t[2]=d):d=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("i",{className:"fa fa-times-circle"}),t[3]=f):f=t[3];let p;t[4]!==d?(p=o.jsx("button",{"data-testid":"close-button-id",className:"close-button",onClick:d,children:f}),t[4]=d,t[5]=p):p=t[5];const h=r.map(y=>o.jsx("a",{href:"#",className:je({active:i===y}),onClick:w=>{w.preventDefault(),e(Ut(y))},children:ii[y].displayName},y));let g;t[6]!==p||t[7]!==h?(g=o.jsxs("nav",{className:a,children:[p,h]}),t[6]=p,t[7]=h,t[8]=g):g=t[8];let _;t[9]!==n||t[10]!==s?(_=o.jsx(n,{flow:s}),t[9]=n,t[10]=s,t[11]=_):_=t[11];let j;return t[12]!==g||t[13]!==_?(j=o.jsxs("div",{className:l,children:[g,_]}),t[12]=g,t[13]=_,t[14]=j):j=t[14],j}function id(t){return t.ui.flow.tab}function rd(t){return t.flows.selected[0]}function od(t){if(t.ctrlKey||t.metaKey)return()=>{};const e=t.key;return t.preventDefault(),(s,i)=>{const{flows:r}=i(),n=r.selected,l=n[0];switch(e){case"k":case"ArrowUp":s(ht(r,-1));break;case"j":case"ArrowDown":s(ht(r,1));break;case" ":case"PageDown":s(ht(r,10));break;case"PageUp":s(ht(r,-10));break;case"End":s(ht(r,1e10));break;case"Home":s(ht(r,-1e10));break;case"Escape":i().ui.modal.activeModal?s(Wi()):s(Ve([]));break;case"ArrowLeft":{if(!l)break;const a=vs(l),d=i().ui.flow.tab,f=a[(Math.max(0,a.indexOf(d))-1+a.length)%a.length];s(Ut(f));break}case"Tab":case"ArrowRight":{if(!l)break;const a=vs(l),d=i().ui.flow.tab,f=a[(Math.max(0,a.indexOf(d))+1)%a.length];s(Ut(f));break}case"Delete":case"d":{s(Ii(n));break}case"n":{Bt("view.flows.create","get","https://example.com/");break}case"D":{s(Li(n));break}case"a":{s(ys(n));break}case"A":{s(Di());break}case"r":{s(ws(n));break}case"v":{s(Pi(n));break}case"x":{s(Fi(n));break}case"X":{s(Zl());break}case"z":{s(Oi());break}default:return}}}class ld extends I.Component{static defaultProps={axis:"x"};node=Te.createRef();constructor(e,s){super(e,s),this.state={applied:!1,startPos:0,dragPointer:.1},this.onLostPointerCapture=this.onLostPointerCapture.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this)}onPointerDown(e){this.state.dragPointer===.1&&(e.target.setPointerCapture(e.pointerId),this.setState({startPos:this.props.axis==="x"?e.pageX:e.pageY,dragPointer:e.pointerId}))}onLostPointerCapture(e){if(this.state.dragPointer!==e.pointerId)return;const s=this.node.current,i=s.previousElementSibling,r=s.nextElementSibling;s.style.transform="",i.style.flex=`0 0 ${Math.max(0,(this.props.axis==="x"?i.offsetWidth+e.pageX:i.offsetHeight+e.pageY)-this.state.startPos)}px`,r.style.flex="1 1 auto",this.setState({applied:!0,dragPointer:.1}),this.onResize()}onPointerMove(e){this.state.dragPointer===e.pointerId&&(this.node.current.style.transform=this.props.axis==="x"?`translateX(${e.pageX-this.state.startPos}px)`:`translateY(${e.pageY-this.state.startPos}px)`)}onResize(){window.setTimeout(()=>window.dispatchEvent(new CustomEvent("resize")),1)}reset(e){this.state.applied&&(this.node.current?.previousElementSibling instanceof HTMLElement&&(this.node.current.previousElementSibling.style.flex=""),this.node.current?.nextElementSibling instanceof HTMLElement&&(this.node.current.nextElementSibling.style.flex=""),e||this.setState({applied:!1}),this.onResize())}componentWillUnmount(){this.reset(!0)}render(){return o.jsx("div",{ref:this.node,className:je("splitter",this.props.axis==="x"?"splitter-x":"splitter-y"),children:o.jsx("div",{onLostPointerCapture:this.onLostPointerCapture,onPointerDown:this.onPointerDown,onPointerMove:this.onPointerMove})})}}const Es=t=>{const e=t.current;return e===null||e.scrollTop===0?!1:Math.ceil(e.scrollTop)+e.clientHeight>=e.scrollHeight},Jr=t=>{t.current&&!Es(t)&&(t.current.scrollTop=t.current.scrollHeight)};function kt(t=void 0){if(!t)return{start:0,end:0,paddingTop:0,paddingBottom:0};const{itemCount:e,rowHeight:s,viewportTop:i,viewportHeight:r,itemHeights:n}=t,l=i+r;let a=0,d=0,f=0,p=0;if(n){let h=0;for(let g=0;g0&&ho.jsx("td",{className:je("col-tls",t.client_conn.tls_established?"col-tls-https":"col-tls-http")});Ts.headerName="";const Rs=({rowNumber:t})=>o.jsx("td",{className:"col-index",children:t+1});Rs.headerName="#";const As=({flow:t})=>o.jsx("td",{className:"col-icon",children:o.jsx("div",{className:je("resource-icon",Si(t))})});As.headerName="";const Ds=({flow:t})=>{let e;return t.error&&(t.error.msg==="Connection killed."?e=o.jsx("i",{className:"fa fa-fw fa-times pull-right"}):e=o.jsx("i",{className:"fa fa-fw fa-exclamation pull-right"})),o.jsxs("td",{className:"col-path",children:[t.is_replay==="request"&&o.jsx("i",{className:"fa fa-fw fa-repeat pull-right"}),t.intercepted&&o.jsx("i",{className:"fa fa-fw fa-pause pull-right"}),e,o.jsx("span",{className:"marker pull-right",children:t.marked}),$i(t)]})};Ds.headerName="Path";const Fs=({flow:t})=>o.jsx("td",{className:"col-method",children:Ni(t)});Fs.headerName="Method";const Is=({flow:t})=>o.jsx("td",{className:"col-http-version",children:ki(t)});Is.headerName="Version";const Ls=({flow:t})=>{let e="darkred";return t.type!=="http"&&t.type!="dns"||!t.response?o.jsx("td",{className:"col-status"}):(100<=t.response.status_code&&t.response.status_code<200?e="green":200<=t.response.status_code&&t.response.status_code<300?e="darkgreen":300<=t.response.status_code&&t.response.status_code<400?e="lightblue":(400<=t.response.status_code&&t.response.status_code<500||500<=t.response.status_code&&t.response.status_code<600)&&(e="red"),o.jsx("td",{className:"col-status",style:{color:e},children:Ci(t)}))};Ls.headerName="Status";const Ps=({flow:t})=>o.jsx("td",{className:"col-size",children:hi(wi(t))});Ps.headerName="Size";const Os=({flow:t})=>{const e=Wt(t),s=yi(t);return o.jsx("td",{className:"col-time",children:e&&s?mi(1e3*(s-e)):"..."})};Os.headerName="Time";const Ms=({flow:t})=>{const e=Wt(t);return o.jsx("td",{className:"col-timestamp",children:e?at(e):"..."})};Ms.headerName="Start time";const Qt=({flow:t})=>{const e=G();let s=null;return t.intercepted?s=o.jsx("a",{href:"#",className:"quickaction",onClick:()=>e(ys([t])),children:o.jsx("i",{className:"fa fa-fw fa-play text-success"})}):xs(t)&&(s=o.jsx("a",{href:"#",className:"quickaction",onClick:()=>e(ws([t])),children:o.jsx("i",{className:"fa fa-fw fa-repeat text-primary"})})),o.jsx("td",{className:"col-quickactions",children:s?o.jsx("div",{children:s}):o.jsx(o.Fragment,{})})};Qt.headerName="";const qs=({flow:t})=>{const e=t.comment;return o.jsx("td",{className:"col-comment",children:e})};qs.headerName="Comment";const Qr={icon:As,index:Rs,method:Fs,version:Is,path:Ds,quickactions:Qt,size:Ps,status:Ls,time:Os,timestamp:Ms,tls:Ts,comment:qs},cd=Object.freeze(Object.defineProperty({__proto__:null,comment:qs,default:Qr,icon:As,index:Rs,method:Fs,path:Ds,quickactions:Qt,size:Ps,status:Ls,time:Os,timestamp:Ms,tls:Ts,version:Is},Symbol.toStringTag,{value:"Module"})),ad=I.memo(function(){const e=k.c(13),s=G(),i=D(dd),r=D(ud),n=D(fd),l=i?"sort-desc":"sort-asc";let a;if(e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==i||e[4]!==l){const f=n.filter(zl).concat("quickactions");let p;e[6]!==s||e[7]!==r||e[8]!==i||e[9]!==l?(p=h=>o.jsx("th",{className:je(`col-${h}`,r===h&&l),onClick:()=>s(Ui({column:h===r&&i?void 0:h,desc:h!==r?!1:!i})),children:Qr[h].headerName},h),e[6]=s,e[7]=r,e[8]=i,e[9]=l,e[10]=p):p=e[10],a=f.map(p),e[0]=s,e[1]=n,e[2]=r,e[3]=i,e[4]=l,e[5]=a}else a=e[5];let d;return e[11]!==a?(d=o.jsx("tr",{children:a}),e[11]=a,e[12]=d):d=e[12],d});function dd(t){return t.flows.sort.desc}function ud(t){return t.flows.sort.column}function fd(t){return t.options.web_columns}const pd=Te.memo(function({flow:e,selected:s,highlighted:i,displayColumnNames:r,rowNumber:n}){const l=G(),a=je({selected:s,highlighted:i,intercepted:e.intercepted,"has-request":e.type==="http"&&e.request,"has-response":e.type==="http"&&e.response}),d=I.useCallback(p=>{let h=p.target;for(;h.parentNode;){if(h.classList.contains("col-quickactions"))return;h=h.parentNode}p.metaKey||p.ctrlKey?l(ic(e)):p.shiftKey?(window.getSelection()?.empty(),l(rc(e))):l(Ve([e]))},[e]),f=r.map(p=>cd[p]).filter(p=>p).concat(Qt);return o.jsx("tr",{className:a,onClick:d,children:f.map(p=>o.jsx(p,{flow:e,rowNumber:n},p.name))})});class hd extends I.Component{static defaultProps={rowHeight:32};viewport=I.createRef();head=I.createRef();constructor(e,s){super(e,s),this.state={vScroll:kt(),viewportTop:0},this.onViewportUpdate=this.onViewportUpdate.bind(this)}componentDidMount(){window.addEventListener("resize",this.onViewportUpdate),this.onViewportUpdate()}componentWillUnmount(){window.removeEventListener("resize",this.onViewportUpdate)}getSnapshotBeforeUpdate(){return Es(this.viewport)}componentDidUpdate(e,s,i){i&&Jr(this.viewport),this.onViewportUpdate();const{onlySelectedId:r}=this.props;if(r&&r!==e.onlySelectedId){const{rowHeight:l,firstSelectedIndex:a}=this.props,d=this.viewport.current,f=this.head.current,p=f?f.offsetHeight:0,h=a*l+p,g=h+l,_=d.scrollTop,j=d.offsetHeight;h-p<_?d.scrollTop=h-p:g>_+j&&(d.scrollTop=g-j),this.onViewportUpdate()}}onViewportUpdate(){const e=this.viewport.current,s=e.scrollTop||0,i=kt({viewportTop:s,viewportHeight:e.offsetHeight||0,itemCount:this.props.flowView.length,rowHeight:this.props.rowHeight});if(this.state.viewportTop!==s||!Kt(this.state.vScroll,i)){const r=Math.min(s,i.end*this.props.rowHeight);this.setState({vScroll:i,viewportTop:r})}}render(){const{vScroll:e,viewportTop:s}=this.state,{flowView:i,selectedIds:r,highlightedIds:n,displayColumnNames:l,listIndex:a}=this.props;return o.jsx("div",{className:"flow-table",onScroll:this.onViewportUpdate,ref:this.viewport,children:o.jsxs("table",{children:[o.jsx("thead",{ref:this.head,style:{transform:`translateY(${s}px)`},children:o.jsx(ad,{})}),o.jsxs("tbody",{children:[o.jsx("tr",{style:{height:e.paddingTop}}),i.slice(e.start,e.end).map(d=>o.jsx(pd,{flow:d,selected:r.has(d.id),highlighted:n.has(d.id),displayColumnNames:l,rowNumber:a.get(d.id)},d.id)),o.jsx("tr",{style:{height:e.paddingBottom}})]})]})})}}const md=zt(t=>({flowView:t.flows.view,highlightedIds:t.flows.highlightedIds,selectedIds:t.flows.selectedIds,onlySelectedId:t.flows.selected.length===1&&t.flows.selected[0].id,firstSelectedIndex:t.flows._viewIndex.get(t.flows.selected[0]?.id),displayColumnNames:t.options.web_columns,listIndex:t.flows._listIndex}))(hd);function gd(){const t=k.c(3);let e,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={padding:"1em 2em"},s=o.jsx("h3",{children:"mitmproxy is running."}),t[0]=e,t[1]=s):(e=t[0],s=t[1]);let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{style:e,children:[s,o.jsxs("p",{children:["No flows have been recorded yet.",o.jsx("br",{}),"To start capturing traffic, please configure your settings in the Capture tab."]})]}),t[2]=i):i=t[2],i}function vd(t){const e=k.c(20);let{description:s,listen_addrs:i,is_running:r,wireguard_conf:n,type:l}=t;const a=I.useRef(null);let d,f;e[0]!==n?(d=()=>{n&&a.current&&Ll.toCanvas(a.current,n,{margin:0,scale:3})},f=[n],e[0]=n,e[1]=d,e[2]=f):(d=e[1],f=e[2]),I.useEffect(d,f);let p;const h=i.length===1||i.length===2&&i[0][1]===i[1][1],g=i.every(xd);if(h&&g){let y;e[3]!==i[0][1]?(y=Hn(["*",i[0][1]]),e[3]=i[0][1],e[4]=y):y=e[4],p=y}else{let y;e[5]!==i?(y=i.map(Hn).join(" and "),e[5]=i,e[6]=y):y=e[6],p=y}s=s[0].toUpperCase()+s.substr(1);let _;if(r){let y;e[9]!==s||e[10]!==p||e[11]!==l?(y=l==="local"?o.jsxs("div",{className:"text-success",children:[s," is active."]}):o.jsxs("div",{className:"text-success",children:[s," listening at ",p,"."]}),e[9]=s,e[10]=p,e[11]=l,e[12]=y):y=e[12];let w;e[13]!==n?(w=n&&o.jsxs("div",{className:"wireguard-config",children:[o.jsx("pre",{children:n}),o.jsx("canvas",{ref:a})]}),e[13]=n,e[14]=w):w=e[14];let $;e[15]!==y||e[16]!==w?($=o.jsxs(o.Fragment,{children:[y,w]}),e[15]=y,e[16]=w,e[17]=$):$=e[17],_=$}else{let y;e[7]!==s?(y=o.jsx(o.Fragment,{children:o.jsxs("div",{className:"text-warning",children:[s," starting..."]})}),e[7]=s,e[8]=y):y=e[8],_=y}let j;return e[18]!==_?(j=o.jsx("div",{children:_}),e[18]=_,e[19]=j):j=e[19],j}function xd(t){return["::","0.0.0.0"].includes(t[0])}function et(t){const e=k.c(5),{error:s,backendState:i}=t;let r;e[0]!==i||e[1]!==s?(r=s?o.jsx("div",{className:"text-danger",children:s}):i&&o.jsx(vd,{...i}),e[0]=i,e[1]=s,e[2]=r):r=e[2];let n;return e[3]!==r?(n=o.jsx("div",{className:"mode-status",children:r}),e[3]=r,e[4]=n):n=e[4],n}function tt(t){const e=k.c(13),{value:s,onChange:i,children:r,label:n}=t,l=I.useId(),a=`mode-checkbox-${l}`,d=`mode-checkbox-${l}`;let f;e[0]!==i||e[1]!==a||e[2]!==d||e[3]!==s?(f=o.jsx("input",{type:"checkbox",name:a,id:d,checked:s,onChange:i}),e[0]=i,e[1]=a,e[2]=d,e[3]=s,e[4]=f):f=e[4];const p=`mode-checkbox-${l}`;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={marginBottom:0,fontWeight:"normal"},e[5]=h):h=e[5];let g;e[6]!==n||e[7]!==p?(g=o.jsx("label",{htmlFor:p,style:h,children:n}),e[6]=n,e[7]=p,e[8]=g):g=e[8];let _;return e[9]!==r||e[10]!==f||e[11]!==g?(_=o.jsxs("div",{className:"mode-entry",children:[f,g,r]}),e[9]=r,e[10]=f,e[11]=g,e[12]=_):_=e[12],_}function st(t){const e=k.c(22),{children:s,iconClass:i,classname:r,isVisible:n}=t,l=I.useId();let a;e[0]!==l?(a=[...l].map(_d),e[0]=l,e[1]=a):a=e[1];const d="--"+a.join(""),f=I.useRef(null),p=I.useRef(null);let h;e[2]!==d?(h=()=>{f.current.style.anchorName=d,p.current.style.positionAnchor=d},e[2]=d,e[3]=h):h=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[4]=g):g=e[4],I.useEffect(h,g);let _;e[5]!==l||e[6]!==n?(_=()=>{n===!0&&document.getElementById(l)?.showPopover()},e[5]=l,e[6]=n,e[7]=_):_=e[7];let j;e[8]!==n?(j=[n],e[8]=n,e[9]=j):j=e[9],I.useEffect(_,j);const y=r?`mode-popover ${r}`:"mode-popover";let w;e[10]!==i?(w=o.jsx("i",{className:i,"aria-hidden":"true"}),e[10]=i,e[11]=w):w=e[11];let $;e[12]!==l||e[13]!==w?($=o.jsx("button",{popoverTarget:l,ref:f,children:w}),e[12]=l,e[13]=w,e[14]=$):$=e[14];let N;e[15]!==s||e[16]!==l?(N=o.jsx("div",{id:l,popover:"auto",ref:p,children:s}),e[15]=s,e[16]=l,e[17]=N):N=e[17];let E;return e[18]!==y||e[19]!==$||e[20]!==N?(E=o.jsxs("div",{className:y,children:[$,N]}),e[18]=y,e[19]=$,e[20]=N,e[21]=E):E=e[21],E}function _d(t){return t.charCodeAt(0).toString(16)}function jd(t){const e=k.c(44),{server:s}=t,{currentProcesses:i,isLoading:r}=D(bd),{selectedProcesses:n}=D(wd);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];const[a,d]=I.useState(l),[f,p]=I.useState(""),h=G(),{platform:g}=D(yd);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=B=>{p(B.target.value)},e[1]=_):_=e[1];const j=_;let y;e[2]!==g?(y=B=>{const oe=g.startsWith("win32")?"\\":"/";return ps(B.executable,oe)[1]},e[2]=g,e[3]=y):y=e[3];const w=y;let $;e[4]!==h||e[5]!==w||e[6]!==n||e[7]!==s?($=B=>{const oe=typeof B=="string"?B:w(B),q=n?`${n}, ${oe}`:oe;h(St({server:s,value:q}))},e[4]=h,e[5]=w,e[6]=n,e[7]=s,e[8]=$):$=e[8];const N=$;let E;e[9]!==h||e[10]!==w||e[11]!==n||e[12]!==s?(E=B=>{const oe=n?.split(/,\s*/).filter(q=>q!==w(B)).join(", ");h(St({server:s,value:oe}))},e[9]=h,e[10]=w,e[11]=n,e[12]=s,e[13]=E):E=e[13];const T=E,P=B=>{L(B)&&n?T(B):N(B)},L=B=>{const oe=w(B);return n?.includes(oe)};let O;e[14]!==i||e[15]!==h?(O=()=>{i.length===0&&h($t())},e[14]=i,e[15]=h,e[16]=O):O=e[16];let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[17]=M):M=e[17],I.useEffect(O,M);let U;e[18]!==i||e[19]!==f||e[20]!==w||e[21]!==a?(U=()=>{if(f){const B=i.filter(oe=>w(oe).toLowerCase().includes(f.toLowerCase()));d(B)}else a!==i&&d(i)},e[18]=i,e[19]=f,e[20]=w,e[21]=a,e[22]=U):U=e[22];let V;e[23]!==i||e[24]!==f?(V=[f,i],e[23]=i,e[24]=f,e[25]=V):V=e[25],I.useEffect(U,V);let W;e[26]!==N||e[27]!==f?(W=B=>{B.stopPropagation(),B.key==="Enter"&&(N(f),p(""))},e[26]=N,e[27]=f,e[28]=W):W=e[28];const J=W,[z,te]=I.useState(!1),Y="local-dropdown",Q="dropdown-header",X=n&&n?.length>0?"Add more":"all applications";let Z,ae;e[29]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>te(!0),ae=()=>te(!1),e[29]=Z,e[30]=ae):(Z=e[29],ae=e[30]);let le;e[31]!==f||e[32]!==J||e[33]!==X?(le=o.jsx("input",{type:"text",className:"autocomplete-input",placeholder:X,value:f,onChange:j,onKeyDown:J,onClick:Z,onBlur:ae}),e[31]=f,e[32]=J,e[33]=X,e[34]=le):le=e[34];const de=st,ye="fa fa-chevron-down",Pe="local-popover";let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=o.jsx("h4",{children:"Current Applications running on machine"}),e[35]=Se):Se=e[35];const Ee=r?o.jsx("i",{className:"fa fa-spinner","aria-hidden":"true"}):a.length>0?o.jsxs("ul",{className:"dropdown-list",children:[o.jsxs("li",{className:`dropdown-item ${n===""?"selected":""}`,onClick:()=>{h(St({server:s,value:""}))},role:"menuitem",children:[o.jsxs("div",{className:"process-details",children:[o.jsx("div",{className:"process-icon"}),o.jsx("span",{className:"process-name",children:"All applications"})]}),n===""&&o.jsx("i",{className:"fa fa-check","aria-hidden":"true"})]}),o.jsx("hr",{className:"process-separator"}),a.map((B,oe)=>o.jsxs("li",{className:`dropdown-item ${L(B)?"selected":""}`,onClick:()=>P(B),role:"menuitem",children:[o.jsxs("div",{className:"process-details",children:[o.jsx("img",{className:"process-icon",src:`./executable-icon?path=${B.executable}`,loading:"lazy"}),o.jsx("span",{className:"process-name",children:w(B)})]}),L(B)&&o.jsx("i",{className:"fa fa-check","aria-hidden":"true"})]},oe))]}):o.jsxs("span",{children:["Press ",o.jsx("strong",{children:"Enter"})," to capture traffic for programs matching: ",o.jsx("strong",{children:f})]});let C;e[36]!==de||e[37]!==z||e[38]!==Se||e[39]!==Ee?(C=o.jsxs(de,{iconClass:ye,classname:Pe,isVisible:z,children:[Se,Ee]}),e[36]=de,e[37]=z,e[38]=Se,e[39]=Ee,e[40]=C):C=e[40];let he;return e[41]!==le||e[42]!==C?(he=o.jsx("div",{className:Y,children:o.jsxs("div",{className:Q,children:[le,C]})}),e[41]=le,e[42]=C,e[43]=he):he=e[43],he}function yd(t){return t.backendState}function wd(t){return t.modes.local[0]}function bd(t){return t.processes}function Sd(){const t=k.c(9),e=D(Cd),s=D($d);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Nd,{server:f,backendState:s[Zi(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Local Applications"}),l=o.jsx("p",{className:"mode-description",children:"Transparently Intercept local application(s)."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function $d(t){return t.backendState.servers}function Cd(t){return t.modes.local}function Nd(t){const e=k.c(31),{server:s,backendState:i}=t,r=G(),n=D(Ed),l=s.error||i?.last_exception||n||void 0;let a;e[0]!==r||e[1]!==s?(a=E=>{const T=s.selectedProcesses?.split(/,\s*/).filter(P=>P!==E).join(", ");r(St({server:s,value:T}))},e[0]=r,e[1]=s,e[2]=a):a=e[2];const d=a;let f;e[3]!==r||e[4]!==s?(f=()=>r(cr({server:s,value:!s.active})),e[3]=r,e[4]=s,e[5]=f):f=e[5];let p;e[6]!==d||e[7]!==s.selectedProcesses?(p=s.selectedProcesses?.split(/,\s*/).filter(kd).map(E=>o.jsxs("div",{className:"selected-process",children:[E,o.jsx("i",{className:"fa fa-times","aria-hidden":"true",onClick:()=>d(E)})]},E)),e[6]=d,e[7]=s.selectedProcesses,e[8]=p):p=e[8];let h;e[9]!==p?(h=o.jsx("div",{className:"selected-processes",children:p}),e[9]=p,e[10]=h):h=e[10];let g;e[11]!==s?(g=o.jsx(jd,{server:s}),e[11]=s,e[12]=g):g=e[12];let _;e[13]!==r?(_=o.jsx("i",{className:"fa fa-refresh","aria-hidden":"true",onClick:()=>r($t())}),e[13]=r,e[14]=_):_=e[14];let j;e[15]!==g||e[16]!==_?(j=o.jsxs("div",{className:"dropdown-container",children:[g,_]}),e[15]=g,e[16]=_,e[17]=j):j=e[17];let y;e[18]!==h||e[19]!==j?(y=o.jsxs("div",{className:"processes-container",children:[h,j]}),e[18]=h,e[19]=j,e[20]=y):y=e[20];let w;e[21]!==s.active||e[22]!==f||e[23]!==y?(w=o.jsx(tt,{value:s.active,label:"Intercept traffic for",onChange:f,children:y}),e[21]=s.active,e[22]=f,e[23]=y,e[24]=w):w=e[24];let $;e[25]!==i||e[26]!==l?($=o.jsx(et,{error:l,backendState:i}),e[25]=i,e[26]=l,e[27]=$):$=e[27];let N;return e[28]!==$||e[29]!==w?(N=o.jsxs("div",{className:"mode-local",children:[w,$]}),e[28]=$,e[29]=w,e[30]=N):N=e[30],N}function kd(t){return t.trim()!==""}function Ed(t){return t.processes.error}function Td(){const t=k.c(9),e=D(Ad),s=D(Rd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Dd,{server:f,backendState:s[Xi(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Explicit HTTP(S) Proxy"}),l=o.jsx("p",{className:"mode-description",children:"You manually configure your client application or device to use an HTTP(S) proxy."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Rd(t){return t.backendState.servers}function Ad(t){return t.modes.regular}function Dd(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(rr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(or({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(lr({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run HTTP/S Proxy",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function Fd(){const t=k.c(9),e=D(Ld),s=D(Id);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Pd,{server:f,backendState:s[er(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"WireGuard Server"}),l=o.jsx("p",{className:"mode-description",children:"Start a WireGuardโ„ข server and connect an external device for transparent proxying."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Id(t){return t.backendState.servers}function Ld(t){return t.modes.wireguard}function Pd(t){const e=k.c(41),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(ar({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=M=>r(dr({server:s,value:M})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,placeholder:"(all interfaces)",onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=M=>r(ur({server:s,value:parseInt(M)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"51820",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("p",{children:"Configuration File"}),e[20]=w):w=e[20];const $=s.file_path||"";let N;e[21]!==r||e[22]!==s?(N=M=>r(fr({server:s,value:M})),e[21]=r,e[22]=s,e[23]=N):N=e[23];let E;e[24]!==$||e[25]!==N?(E=o.jsx(ce,{className:"mode-input",content:$,placeholder:"~/.mitmproxy/wireguard.conf",onEditDone:N}),e[24]=$,e[25]=N,e[26]=E):E=e[26];let T;e[27]!==y||e[28]!==E||e[29]!==h?(T=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y,w,E]}),e[27]=y,e[28]=E,e[29]=h,e[30]=T):T=e[30];let P;e[31]!==s.active||e[32]!==l||e[33]!==T?(P=o.jsx(tt,{value:s.active,label:"Run WireGuard Server",onChange:l,children:T}),e[31]=s.active,e[32]=l,e[33]=T,e[34]=P):P=e[34];let L;e[35]!==i||e[36]!==n?(L=o.jsx(et,{error:n,backendState:i}),e[35]=i,e[36]=n,e[37]=L):L=e[37];let O;return e[38]!==P||e[39]!==L?(O=o.jsxs("div",{children:[P,L]}),e[38]=P,e[39]=L,e[40]=O):O=e[40],O}function Od(){const t=k.c(15),e=G(),s=D(qd),i=D(Md);let r,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("h4",{className:"mode-title",children:"Reverse Proxy"}),n=o.jsx("p",{className:"mode-description",children:"Requests are forwarded to a preconfigured destination."}),t[0]=r,t[1]=n):(r=t[0],n=t[1]);let l;if(t[2]!==i||t[3]!==s){let h;t[5]!==i?(h=(g,_)=>o.jsx(Hd,{removable:_>0,server:g,backendState:i[Ns(g)]},g.ui_id),t[5]=i,t[6]=h):h=t[6],l=s.map(h),t[2]=i,t[3]=s,t[4]=l}else l=t[4];let a;t[7]!==e?(a=()=>e(na()),t[7]=e,t[8]=a):a=t[8];let d;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("i",{className:"fa fa-plus-square-o","aria-hidden":"true"}),t[9]=d):d=t[9];let f;t[10]!==a?(f=o.jsxs("div",{className:"mode-reverse-add-server",onClick:a,children:[d,"Add additional server"]}),t[10]=a,t[11]=f):f=t[11];let p;return t[12]!==l||t[13]!==f?(p=o.jsxs("div",{children:[r,n,o.jsxs("div",{className:"mode-reverse-servers",children:[l,f]})]}),t[12]=l,t[13]=f,t[14]=p):p=t[14],p}function Md(t){return t.backendState.servers}function qd(t){return t.modes.reverse}function Hd(t){const e=k.c(56),{removable:s,server:i,backendState:r}=t,n=G();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.values(Jt),e[0]=l):l=e[0];const a=l;let d;e[1]!==n||e[2]!==i?(d=async()=>{i.active&&await n(ms({server:i,value:!1})).unwrap(),await n(ia(i))},e[1]=n,e[2]=i,e[3]=d):d=e[3];const f=d,p=i.error||r?.last_exception||void 0,h=i.active;let g;e[4]!==n||e[5]!==i?(g=()=>{n(ms({server:i,value:!i.active}))},e[4]=n,e[5]=i,e[6]=g):g=e[6];const _=i.protocol;let j;e[7]!==n||e[8]!==i?(j=Z=>{n(mr({server:i,value:Z.target.value}))},e[7]=n,e[8]=i,e[9]=j):j=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=a.map(Vd),e[10]=y):y=e[10];let w;e[11]!==i.protocol||e[12]!==j?(w=o.jsx("select",{name:"protocols",className:"mode-reverse-dropdown",value:_,onChange:j,children:y}),e[11]=i.protocol,e[12]=j,e[13]=w):w=e[13];let $;e[14]!==i.destination?($=i.destination?.toString()||"",e[14]=i.destination,e[15]=$):$=e[15];let N;e[16]!==n||e[17]!==i?(N=Z=>n(gr({server:i,value:Z})),e[16]=n,e[17]=i,e[18]=N):N=e[18];let E;e[19]!==N||e[20]!==$?(E=o.jsx(ce,{className:"mode-reverse-input",content:$,onEditDone:N,placeholder:"example.com"}),e[19]=N,e[20]=$,e[21]=E):E=e[21];let T,P;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx("h4",{children:"Advanced Configuration"}),P=o.jsx("p",{children:"Listen Host"}),e[22]=T,e[23]=P):(T=e[22],P=e[23]);const L=i.listen_host||"";let O;e[24]!==n||e[25]!==i?(O=Z=>n(pr({server:i,value:Z})),e[24]=n,e[25]=i,e[26]=O):O=e[26];let M;e[27]!==L||e[28]!==O?(M=o.jsx(ce,{className:"mode-input",content:L,onEditDone:O,placeholder:"*"}),e[27]=L,e[28]=O,e[29]=M):M=e[29];let U;e[30]===Symbol.for("react.memo_cache_sentinel")?(U=o.jsx("p",{children:"Listen Port"}),e[30]=U):U=e[30];const V=String(i.listen_port||"");let W;e[31]!==n||e[32]!==i?(W=Z=>n(hr({server:i,value:Z})),e[31]=n,e[32]=i,e[33]=W):W=e[33];let J;e[34]!==V||e[35]!==W?(J=o.jsx(ce,{className:"mode-input",content:V,onEditDone:W,placeholder:"8080"}),e[34]=V,e[35]=W,e[36]=J):J=e[36];let z;e[37]!==M||e[38]!==J?(z=o.jsxs(st,{iconClass:"fa fa-cog",children:[T,P,M,U,J]}),e[37]=M,e[38]=J,e[39]=z):z=e[39];let te;e[40]!==f||e[41]!==s?(te=s&&o.jsx("i",{className:"fa fa-fw fa-trash fa-lg","aria-hidden":"true",onClick:f}),e[40]=f,e[41]=s,e[42]=te):te=e[42];let Y;e[43]!==i.active||e[44]!==E||e[45]!==z||e[46]!==te||e[47]!==g||e[48]!==w?(Y=o.jsxs(tt,{value:h,label:"Forward",onChange:g,children:[w,"traffic to",E,z,te]}),e[43]=i.active,e[44]=E,e[45]=z,e[46]=te,e[47]=g,e[48]=w,e[49]=Y):Y=e[49];let Q;e[50]!==r||e[51]!==p?(Q=o.jsx(et,{error:p,backendState:r}),e[50]=r,e[51]=p,e[52]=Q):Q=e[52];let X;return e[53]!==Y||e[54]!==Q?(X=o.jsxs("div",{children:[Y,Q]}),e[53]=Y,e[54]=Q,e[55]=X):X=e[55],X}function Vd(t){return o.jsx("option",{value:t,children:t},t)}function Ud(){const t=k.c(9),e=D(Wd),s=D(Bd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Kd,{server:f,backendState:s[tr(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Transparent Proxy"}),t[5]=n):n=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsxs("p",{className:"mode-description",children:["You"," ",o.jsx("a",{href:"https://docs.mitmproxy.org/stable/howto-transparent/",style:{textDecoration:"underline",color:"inherit"},children:"configure your routing table"})," ","to send traffic through mitmproxy."]}),t[6]=l):l=t[6];let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Bd(t){return t.backendState.servers}function Wd(t){return t.modes.transparent}function Kd(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(xr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(_r({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(jr({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run Transparent Proxy",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function zd(){const t=k.c(9),e=D(Yd),s=D(Gd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(Jd,{server:f,backendState:s[sr(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"SOCKS Proxy"}),l=o.jsx("p",{className:"mode-description",children:"You manually configure your client application or device to use a SOCKS5 proxy."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Gd(t){return t.backendState.servers}function Yd(t){return t.modes.socks}function Jd(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(yr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(wr({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(br({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run SOCKS Proxy",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function Qd(){const t=k.c(9),e=D(Zd),s=D(Xd);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(eu,{server:f,backendState:s[nr(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"Explicit HTTP(S) Proxy (With Upstream Proxy)"}),l=o.jsx("p",{className:"mode-description",children:"All requests are forwarded to a second HTTP(S) proxy server."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function Xd(t){return t.backendState.servers}function Zd(t){return t.modes.upstream}function eu(t){const e=k.c(42),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>{r(Sr({server:s,value:!s.active}))},e[0]=r,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==s.destination?(a=s.destination?.toString()||"",e[3]=s.destination,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==s?(d=O=>r(Nr({server:s,value:O})),e[5]=r,e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a||e[9]!==d?(f=o.jsx(ce,{className:"mode-upstream-input",content:a,onEditDone:d,placeholder:"http://example.com:8080"}),e[8]=a,e[9]=d,e[10]=f):f=e[10];let p,h;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("h4",{children:"Advanced Configuration"}),h=o.jsx("p",{children:"Listen Host"}),e[11]=p,e[12]=h):(p=e[11],h=e[12]);const g=s.listen_host||"";let _;e[13]!==r||e[14]!==s?(_=O=>r($r({server:s,value:O})),e[13]=r,e[14]=s,e[15]=_):_=e[15];let j;e[16]!==g||e[17]!==_?(j=o.jsx(ce,{className:"mode-input",content:g,onEditDone:_}),e[16]=g,e[17]=_,e[18]=j):j=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("p",{children:"Listen Port"}),e[19]=y):y=e[19];let w;e[20]!==s.listen_port?(w=s.listen_port?s.listen_port.toString():"",e[20]=s.listen_port,e[21]=w):w=e[21];let $;e[22]!==r||e[23]!==s?($=O=>r(Cr({server:s,value:parseInt(O)})),e[22]=r,e[23]=s,e[24]=$):$=e[24];let N;e[25]!==w||e[26]!==$?(N=o.jsx(ce,{className:"mode-input",content:w,placeholder:"8080",onEditDone:$}),e[25]=w,e[26]=$,e[27]=N):N=e[27];let E;e[28]!==N||e[29]!==j?(E=o.jsxs(st,{iconClass:"fa fa-cog",children:[p,h,j,y,N]}),e[28]=N,e[29]=j,e[30]=E):E=e[30];let T;e[31]!==s.active||e[32]!==l||e[33]!==E||e[34]!==f?(T=o.jsxs(tt,{value:s.active,label:"Run HTTP/S Proxy and forward requests to",onChange:l,children:[f,E]}),e[31]=s.active,e[32]=l,e[33]=E,e[34]=f,e[35]=T):T=e[35];let P;e[36]!==i||e[37]!==n?(P=o.jsx(et,{error:n,backendState:i}),e[36]=i,e[37]=n,e[38]=P):P=e[38];let L;return e[39]!==T||e[40]!==P?(L=o.jsxs("div",{children:[T,P]}),e[39]=T,e[40]=P,e[41]=L):L=e[41],L}function tu(){const t=k.c(9),e=D(nu),s=D(su);let i;if(t[0]!==s||t[1]!==e){let d;t[3]!==s?(d=f=>o.jsx(iu,{server:f,backendState:s[ir(f)]},f.ui_id),t[3]=s,t[4]=d):d=t[4],i=e.map(d),t[0]=s,t[1]=e,t[2]=i}else i=t[2];const r=i;let n,l;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h4",{className:"mode-title",children:"DNS Server"}),l=o.jsx("p",{className:"mode-description",children:"A recursive DNS resolver using the host's DNS configuration."}),t[5]=n,t[6]=l):(n=t[5],l=t[6]);let a;return t[7]!==r?(a=o.jsxs("div",{children:[n,l,r]}),t[7]=r,t[8]=a):a=t[8],a}function su(t){return t.backendState.servers}function nu(t){return t.modes.dns}function iu(t){const e=k.c(33),{server:s,backendState:i}=t,r=G(),n=s.error||i?.last_exception||void 0;let l;e[0]!==r||e[1]!==s?(l=()=>r(kr({server:s,value:!s.active})),e[0]=r,e[1]=s,e[2]=l):l=e[2];let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("h4",{children:"Advanced Configuration"}),d=o.jsx("p",{children:"Listen Host"}),e[3]=a,e[4]=d):(a=e[3],d=e[4]);const f=s.listen_host||"";let p;e[5]!==r||e[6]!==s?(p=T=>r(Er({server:s,value:T})),e[5]=r,e[6]=s,e[7]=p):p=e[7];let h;e[8]!==f||e[9]!==p?(h=o.jsx(ce,{className:"mode-input",content:f,onEditDone:p}),e[8]=f,e[9]=p,e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("p",{children:"Listen Port"}),e[11]=g):g=e[11];let _;e[12]!==s.listen_port?(_=s.listen_port?s.listen_port.toString():"",e[12]=s.listen_port,e[13]=_):_=e[13];let j;e[14]!==r||e[15]!==s?(j=T=>r(Tr({server:s,value:parseInt(T)})),e[14]=r,e[15]=s,e[16]=j):j=e[16];let y;e[17]!==_||e[18]!==j?(y=o.jsx(ce,{className:"mode-input",content:_,placeholder:"8080",onEditDone:j}),e[17]=_,e[18]=j,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==h?(w=o.jsxs(st,{iconClass:"fa fa-cog",children:[a,d,h,g,y]}),e[20]=y,e[21]=h,e[22]=w):w=e[22];let $;e[23]!==s.active||e[24]!==l||e[25]!==w?($=o.jsx(tt,{value:s.active,label:"Run DNS Server",onChange:l,children:w}),e[23]=s.active,e[24]=l,e[25]=w,e[26]=$):$=e[26];let N;e[27]!==i||e[28]!==n?(N=o.jsx(et,{error:n,backendState:i}),e[27]=i,e[28]=n,e[29]=N):N=e[29];let E;return e[30]!==$||e[31]!==N?(E=o.jsxs("div",{children:[$,N]}),e[30]=$,e[31]=N,e[32]=E):E=e[32],E}function ri(t){const e=k.c(10),{title:s,description:i}=t;let r;e[0]!==s?(r=o.jsx("h4",{className:"mode-title",children:s}),e[0]=s,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("i",{className:"fa fa-exclamation-triangle","aria-hidden":"true"}),e[2]=n):n=e[2];let l;e[3]!==r?(l=o.jsxs("div",{className:"title-icon-container",children:[r,n]}),e[3]=r,e[4]=l):l=e[4];let a;e[5]!==i?(a=o.jsx("p",{className:"mode-description",children:i}),e[5]=i,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==a?(d=o.jsxs("div",{className:"missing-mode-container",children:[l,a]}),e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function ru(){const t=k.c(19),{platform:e,localModeUnavailable:s}=D(ou);let i,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("h2",{children:"Intercept Traffic"}),r=o.jsx("p",{children:"Configure how you want to intercept traffic with mitmproxy."}),t[0]=i,t[1]=r):(i=t[0],r=t[1]);let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("h3",{children:"Recommended"}),t[2]=n):n=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Td,{}),t[3]=l):l=t[3];let a;t[4]!==s?(a=s!==null?o.jsx(ri,{title:"Local Redirect Mode",description:s}):o.jsx(Sd,{}),t[4]=s,t[5]=a):a=t[5];let d,f;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Fd,{}),f=o.jsx(Od,{}),t[6]=d,t[7]=f):(d=t[6],f=t[7]);let p;t[8]!==a?(p=o.jsxs("div",{className:"modes-category green-left-border",children:[n,o.jsxs("div",{className:"modes-container",children:[l,a,d,f]})]}),t[8]=a,t[9]=p):p=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("h3",{children:"Advanced"}),t[10]=h):h=t[10];let g,_,j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(zd,{}),g=o.jsx(Qd,{}),_=o.jsx(tu,{}),t[11]=g,t[12]=_,t[13]=j):(g=t[11],_=t[12],j=t[13]);let y;t[14]!==e?(y=o.jsxs("div",{className:"modes-category gray-left-border",children:[h,o.jsxs("div",{className:"modes-container",children:[j,g,_,e.startsWith("win32")?o.jsx(ri,{title:"Transparent Proxy",description:"This mode is only supported on Linux and MacOS."}):o.jsx(Ud,{})]})]}),t[14]=e,t[15]=y):y=t[15];let w;return t[16]!==y||t[17]!==p?(w=o.jsxs("div",{className:"modes",children:[i,r,p,y]}),t[16]=y,t[17]=p,t[18]=w):w=t[18],w}function ou(t){return t.backendState}function lu(){const t=k.c(4),e=D(du),s=D(au),i=D(cu);let r;return t[0]!==i||t[1]!==s||t[2]!==e?(r=o.jsx("div",{className:"main-view",children:i===xe.Capture?o.jsx(ru,{}):o.jsxs(o.Fragment,{children:[s?o.jsx(md,{}):o.jsx(gd,{}),e&&o.jsxs(o.Fragment,{children:[o.jsx(ld,{},"splitter"),o.jsx(nd,{},"flowDetails")]})]})}),t[0]=i,t[1]=s,t[2]=e,t[3]=r):r=t[3],r}function cu(t){return t.ui.tabs.current}function au(t){return t.flows.list.length>0}function du(t){return t.flows.selected.length===1}function gt(t){const e=k.c(2),{children:s}=t;let i;return e[0]!==s?(i=window.MITMWEB_STATIC?null:o.jsx(o.Fragment,{children:s}),e[0]=s,e[1]=i):i=e[1],i}const uu=I.memo(function(){const e=k.c(20),s=G(),i=D(fu);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={placement:"bottom-start"},e[0]=r):r=e[0];let n;e[1]!==s?(n=o.jsx("li",{children:o.jsx(Fr,{icon:"fa-folder-open",text:"ย Open...",onClick:pu,onOpenFile:w=>{s(tc(w)),document.body.click()}})}),e[1]=s,e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsxs(ke,{onClick:hu,children:[o.jsx("i",{className:"fa fa-fw fa-floppy-o"}),"ย Save"]}),e[3]=l):l=e[3];let a;e[4]!==i?(a=()=>location.replace("/flows/dump?filter="+i),e[4]=i,e[5]=a):a=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("i",{className:"fa fa-fw fa-floppy-o"}),e[6]=d):d=e[6];let f;e[7]!==a?(f=o.jsxs(ke,{onClick:a,children:[d,"ย Save filtered"]}),e[7]=a,e[8]=f):f=e[8];let p;e[9]!==s?(p=()=>confirm("Delete all flows?")&&s(Oi()),e[9]=s,e[10]=p):p=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("i",{className:"fa fa-fw fa-trash"}),e[11]=h):h=e[11];let g;e[12]!==p?(g=o.jsxs(ke,{onClick:p,children:[h,"ย Clear All"]}),e[12]=p,e[13]=g):g=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(ka,{}),e[14]=_):_=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsxs(gt,{children:[_,o.jsx("li",{children:o.jsxs("a",{href:"http://mitm.it/",target:"_blank",rel:"noreferrer",children:[o.jsx("i",{className:"fa fa-fw fa-external-link"}),"ย Install Certificates..."]})})]}),e[15]=j):j=e[15];let y;return e[16]!==n||e[17]!==f||e[18]!==g?(y=o.jsxs(Et,{className:"pull-left special",text:"File",options:r,children:[n,l,f,g,j]}),e[16]=n,e[17]=f,e[18]=g,e[19]=y):y=e[19],y});function fu(t){return t.ui.filter[ve.Search]}function pu(t){return t.stopPropagation()}function hu(){return location.replace("/flows/dump")}const mu=I.memo(function(){const e=k.c(5),s=D(gu),i=D(vu);switch(s){case wt.INIT:{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{className:"connection-indicator init",children:"connectingโ€ฆ"}),e[0]=r):r=e[0],r}case wt.FETCHING:{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{className:"connection-indicator fetching",children:"fetching dataโ€ฆ"}),e[1]=r):r=e[1],r}case wt.ESTABLISHED:{let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{className:"connection-indicator established",children:"connected"}),e[2]=r):r=e[2],r}case wt.ERROR:{let r;return e[3]!==i?(r=o.jsx("span",{className:"connection-indicator error",title:i,children:"connection lost"}),e[3]=i,e[4]=r):r=e[4],r}default:Ct(s)}});function gu(t){return t.connection.state}function vu(t){return t.connection.message}Xr.title="Capture";function Xr(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(o.Fragment,{}),t[0]=e):e=t[0],e}const oi=function(){function t(i,r){function n(){this.constructor=i}n.prototype=r.prototype,i.prototype=new n}function e(i,r,n,l){this.message=i,this.expected=r,this.found=n,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}t(e,Error);function s(i){var r=arguments.length>1?arguments[1]:{},n={},l={start:_n},a=_n,d={type:"other",description:"filter expression"},f=function(c){return c},p={type:"other",description:"whitespace"},h=/^[ \t\n\r]/,g={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_={type:"other",description:"control character"},j=/^[|&!()~"]/,y={type:"class",value:'[|&!()~"]',description:'[|&!()~"]'},w={type:"other",description:"optional whitespace"},$="|",N={type:"literal",value:"|",description:'"|"'},E=function(c,u){return il(c,u)},T="&",P={type:"literal",value:"&",description:'"&"'},L=function(c,u){return rl(c,u)},O="!",M={type:"literal",value:"!",description:'"!"'},U=function(c){return ol(c)},V="(",W={type:"literal",value:"(",description:'"("'},J=")",z={type:"literal",value:")",description:'")"'},te=function(c){return ll(c)},Y="~all",Q={type:"literal",value:"~all",description:'"~all"'},X=function(){return Sn},Z="~a",ae={type:"literal",value:"~a",description:'"~a"'},le=function(){return Cn},de="~b",ye={type:"literal",value:"~b",description:'"~b"'},Pe=function(c){return cl(c)},Se="~bq",Ee={type:"literal",value:"~bq",description:'"~bq"'},C=function(c){return al(c)},he="~bs",B={type:"literal",value:"~bs",description:'"~bs"'},oe=function(c){return dl(c)},q="~c",$e={type:"literal",value:"~c",description:'"~c"'},We=function(c){return ul(c)},Oe="~comment",ee={type:"literal",value:"~comment",description:'"~comment"'},Me=function(c){return fl(c)},Re="~d",re={type:"literal",value:"~d",description:'"~d"'},ue=function(c){return pl(c)},ge="~dns",Ae={type:"literal",value:"~dns",description:'"~dns"'},nt=function(){return Nn},Je="~dst",Zt={type:"literal",value:"~dst",description:'"~dst"'},b=function(c){return hl(c)},S="~e",A={type:"literal",value:"~e",description:'"~e"'},H=function(){return kn},Tt="~h",es={type:"literal",value:"~h",description:'"~h"'},Ce=function(c){return ml(c)},De="~hq",ut={type:"literal",value:"~hq",description:'"~hq"'},Ke=function(c){return gl(c)},vt="~hs",Rt={type:"literal",value:"~hs",description:'"~hs"'},it=function(c){return vl(c)},At="~http",ft={type:"literal",value:"~http",description:'"~http"'},Fe=function(){return En},Us="~marked",no={type:"literal",value:"~marked",description:'"~marked"'},io=function(){return Tn},Bs="~marker",ro={type:"literal",value:"~marker",description:'"~marker"'},oo=function(c){return xl(c)},Ws="~m",lo={type:"literal",value:"~m",description:'"~m"'},co=function(c){return _l(c)},Ks="~q",ao={type:"literal",value:"~q",description:'"~q"'},uo=function(){return Rn},zs="~replayq",fo={type:"literal",value:"~replayq",description:'"~replayq"'},po=function(){return An},Gs="~replays",ho={type:"literal",value:"~replays",description:'"~replays"'},mo=function(){return Dn},Ys="~replay",go={type:"literal",value:"~replay",description:'"~replay"'},vo=function(){return Fn},Js="~src",xo={type:"literal",value:"~src",description:'"~src"'},_o=function(c){return jl(c)},Qs="~s",jo={type:"literal",value:"~s",description:'"~s"'},yo=function(){return In},Xs="~tcp",wo={type:"literal",value:"~tcp",description:'"~tcp"'},bo=function(){return Ln},Zs="~udp",So={type:"literal",value:"~udp",description:'"~udp"'},$o=function(){return Pn},en="~tq",Co={type:"literal",value:"~tq",description:'"~tq"'},No=function(c){return yl(c)},tn="~ts",ko={type:"literal",value:"~ts",description:'"~ts"'},Eo=function(c){return wl(c)},sn="~t",To={type:"literal",value:"~t",description:'"~t"'},Ro=function(c){return bl(c)},nn="~u",Ao={type:"literal",value:"~u",description:'"~u"'},rn=function(c){return Sl(c)},on="~websocket",Do={type:"literal",value:"~websocket",description:'"~websocket"'},Fo=function(){return On},Io={type:"other",description:"integer"},ln=/^['"]/,cn={type:"class",value:`['"]`,description:`['"]`},an=/^[0-9]/,dn={type:"class",value:"[0-9]",description:"[0-9]"},Lo=function(c){return parseInt(c.join(""),10)},Po={type:"other",description:"string"},un='"',fn={type:"literal",value:'"',description:'"\\""'},ts=function(c){return c.join("")},pn="'",hn={type:"literal",value:"'",description:`"'"`},Oo=/^["\\]/,Mo={type:"class",value:'["\\\\]',description:'["\\\\]'},ss={type:"any",description:"any character"},xt=function(c){return c},mn="\\",gn={type:"literal",value:"\\",description:'"\\\\"'},qo=/^['\\]/,Ho={type:"class",value:"['\\\\]",description:"['\\\\]"},Vo=/^['"\\]/,Uo={type:"class",value:`['"\\\\]`,description:`['"\\\\]`},Bo="n",Wo={type:"literal",value:"n",description:'"n"'},Ko=function(){return` +`},zo="r",Go={type:"literal",value:"r",description:'"r"'},Yo=function(){return"\r"},Jo="t",Qo={type:"literal",value:"t",description:'"t"'},Xo=function(){return" "},m=0,Dt=[{line:1,column:1,seenCR:!1}],qe=0,ns=[],R=0,Ft;if("startRule"in r){if(!(r.startRule in l))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');a=l[r.startRule]}function vn(c){var u=Dt[c],v,x;if(u)return u;for(v=c-1;!Dt[v];)v--;for(u=Dt[v],u={line:u.line,column:u.column,seenCR:u.seenCR};vqe&&(qe=m,ns=[]),ns.push(c))}function Zo(c,u,v,x){function He(Ie){var Qe=1;for(Ie.sort(function(Pt,rt){return Pt.descriptionrt.description?1:0});Qe1?rt.slice(0,-1).join(", ")+" or "+rt[Ie.length-1]:rt[0],qn=Qe?'"'+Pt(Qe)+'"':"end of input","Expected "+Mn+" but "+qn+" found."}return u!==null&&He(u),new e(Ne(u,v),u,v,x)}function _n(){var c,u,v,x;return R++,c=m,u=ze(),u!==n?(v=is(),v!==n?(x=ze(),x!==n?(u=f(v),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),R--,c===n&&(u=n,R===0&&F(d)),c}function K(){var c;return R++,h.test(i.charAt(m))?(c=i.charAt(m),m++):(c=n,R===0&&F(g)),R--,c===n&&R===0&&F(p),c}function el(){var c;return R++,j.test(i.charAt(m))?(c=i.charAt(m),m++):(c=n,R===0&&F(y)),R--,c===n&&R===0&&F(_),c}function ze(){var c,u;for(R++,c=[],u=K();u!==n;)c.push(u),u=K();return R--,c===n&&(u=n,R===0&&F(w)),c}function is(){var c,u,v,x,He,Ne;return c=m,u=It(),u!==n?(v=ze(),v!==n?(i.charCodeAt(m)===124?(x=$,m++):(x=n,R===0&&F(N)),x!==n?(He=ze(),He!==n?(Ne=is(),Ne!==n?(u=E(u,Ne),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n&&(c=It()),c}function It(){var c,u,v,x,He,Ne;if(c=m,u=Lt(),u!==n?(v=ze(),v!==n?(i.charCodeAt(m)===38?(x=T,m++):(x=n,R===0&&F(P)),x!==n?(He=ze(),He!==n?(Ne=It(),Ne!==n?(u=L(u,Ne),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n){if(c=m,u=Lt(),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=It(),x!==n?(u=L(u,x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;c===n&&(c=Lt())}return c}function Lt(){var c,u,v,x;return c=m,i.charCodeAt(m)===33?(u=O,m++):(u=n,R===0&&F(M)),u!==n?(v=ze(),v!==n?(x=Lt(),x!==n?(u=U(x),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n&&(c=tl()),c}function tl(){var c,u,v,x,He,Ne;return c=m,i.charCodeAt(m)===40?(u=V,m++):(u=n,R===0&&F(W)),u!==n?(v=ze(),v!==n?(x=is(),x!==n?(He=ze(),He!==n?(i.charCodeAt(m)===41?(Ne=J,m++):(Ne=n,R===0&&F(z)),Ne!==n?(u=te(x),c=u):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n)):(m=c,c=n),c===n&&(c=sl()),c}function sl(){var c,u,v,x;if(c=m,i.substr(m,4)===Y?(u=Y,m+=4):(u=n,R===0&&F(Q)),u!==n&&(u=X()),c=u,c===n&&(c=m,i.substr(m,2)===Z?(u=Z,m+=2):(u=n,R===0&&F(ae)),u!==n&&(u=le()),c=u,c===n)){if(c=m,i.substr(m,2)===de?(u=de,m+=2):(u=n,R===0&&F(ye)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Pe(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===Se?(u=Se,m+=3):(u=n,R===0&&F(Ee)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=C(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===he?(u=he,m+=3):(u=n,R===0&&F(B)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=oe(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===q?(u=q,m+=2):(u=n,R===0&&F($e)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=nl(),x!==n?(u=We(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,8)===Oe?(u=Oe,m+=8):(u=n,R===0&&F(ee)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Me(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===Re?(u=Re,m+=2):(u=n,R===0&&F(re)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=ue(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,4)===ge?(u=ge,m+=4):(u=n,R===0&&F(Ae)),u!==n&&(u=nt()),c=u,c===n)){if(c=m,i.substr(m,4)===Je?(u=Je,m+=4):(u=n,R===0&&F(Zt)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=b(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,2)===S?(u=S,m+=2):(u=n,R===0&&F(A)),u!==n&&(u=H()),c=u,c===n)){if(c=m,i.substr(m,2)===Tt?(u=Tt,m+=2):(u=n,R===0&&F(es)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Ce(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===De?(u=De,m+=3):(u=n,R===0&&F(ut)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Ke(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===vt?(u=vt,m+=3):(u=n,R===0&&F(Rt)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=it(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,5)===At?(u=At,m+=5):(u=n,R===0&&F(ft)),u!==n&&(u=Fe()),c=u,c===n&&(c=m,i.substr(m,7)===Us?(u=Us,m+=7):(u=n,R===0&&F(no)),u!==n&&(u=io()),c=u,c===n))){if(c=m,i.substr(m,7)===Bs?(u=Bs,m+=7):(u=n,R===0&&F(ro)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=oo(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===Ws?(u=Ws,m+=2):(u=n,R===0&&F(lo)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=co(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,2)===Ks?(u=Ks,m+=2):(u=n,R===0&&F(ao)),u!==n&&(u=uo()),c=u,c===n&&(c=m,i.substr(m,8)===zs?(u=zs,m+=8):(u=n,R===0&&F(fo)),u!==n&&(u=po()),c=u,c===n&&(c=m,i.substr(m,8)===Gs?(u=Gs,m+=8):(u=n,R===0&&F(ho)),u!==n&&(u=mo()),c=u,c===n&&(c=m,i.substr(m,7)===Ys?(u=Ys,m+=7):(u=n,R===0&&F(go)),u!==n&&(u=vo()),c=u,c===n))))){if(c=m,i.substr(m,4)===Js?(u=Js,m+=4):(u=n,R===0&&F(xo)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=_o(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n&&(c=m,i.substr(m,2)===Qs?(u=Qs,m+=2):(u=n,R===0&&F(jo)),u!==n&&(u=yo()),c=u,c===n&&(c=m,i.substr(m,4)===Xs?(u=Xs,m+=4):(u=n,R===0&&F(wo)),u!==n&&(u=bo()),c=u,c===n&&(c=m,i.substr(m,4)===Zs?(u=Zs,m+=4):(u=n,R===0&&F(So)),u!==n&&(u=$o()),c=u,c===n)))){if(c=m,i.substr(m,3)===en?(u=en,m+=3):(u=n,R===0&&F(Co)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=No(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,3)===tn?(u=tn,m+=3):(u=n,R===0&&F(ko)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Eo(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===sn?(u=sn,m+=2):(u=n,R===0&&F(To)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=Ro(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.substr(m,2)===nn?(u=nn,m+=2):(u=n,R===0&&F(Ao)),u!==n){if(v=[],x=K(),x!==n)for(;x!==n;)v.push(x),x=K();else v=n;v!==n?(x=me(),x!==n?(u=rn(x),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;c===n&&(c=m,i.substr(m,10)===on?(u=on,m+=10):(u=n,R===0&&F(Do)),u!==n&&(u=Fo()),c=u,c===n&&(c=m,u=me(),u!==n&&(u=rn(u)),c=u))}}}}}}}}}}}}}}}}}return c}function nl(){var c,u,v,x;if(R++,c=m,ln.test(i.charAt(m))?(u=i.charAt(m),m++):(u=n,R===0&&F(cn)),u===n&&(u=null),u!==n){if(v=[],an.test(i.charAt(m))?(x=i.charAt(m),m++):(x=n,R===0&&F(dn)),x!==n)for(;x!==n;)v.push(x),an.test(i.charAt(m))?(x=i.charAt(m),m++):(x=n,R===0&&F(dn));else v=n;v!==n?(ln.test(i.charAt(m))?(x=i.charAt(m),m++):(x=n,R===0&&F(cn)),x===n&&(x=null),x!==n?(u=Lo(v),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;return R--,c===n&&(u=n,R===0&&F(Io)),c}function me(){var c,u,v,x;if(R++,c=m,i.charCodeAt(m)===34?(u=un,m++):(u=n,R===0&&F(fn)),u!==n){for(v=[],x=jn();x!==n;)v.push(x),x=jn();v!==n?(i.charCodeAt(m)===34?(x=un,m++):(x=n,R===0&&F(fn)),x!==n?(u=ts(v),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n){if(c=m,i.charCodeAt(m)===39?(u=pn,m++):(u=n,R===0&&F(hn)),u!==n){for(v=[],x=yn();x!==n;)v.push(x),x=yn();v!==n?(i.charCodeAt(m)===39?(x=pn,m++):(x=n,R===0&&F(hn)),x!==n?(u=ts(v),c=u):(m=c,c=n)):(m=c,c=n)}else m=c,c=n;if(c===n)if(c=m,u=m,R++,v=el(),R--,v===n?u=void 0:(m=u,u=n),u!==n){if(v=[],x=wn(),x!==n)for(;x!==n;)v.push(x),x=wn();else v=n;v!==n?(u=ts(v),c=u):(m=c,c=n)}else m=c,c=n}return R--,c===n&&(u=n,R===0&&F(Po)),c}function jn(){var c,u,v;return c=m,u=m,R++,Oo.test(i.charAt(m))?(v=i.charAt(m),m++):(v=n,R===0&&F(Mo)),R--,v===n?u=void 0:(m=u,u=n),u!==n?(i.length>m?(v=i.charAt(m),m++):(v=n,R===0&&F(ss)),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n),c===n&&(c=m,i.charCodeAt(m)===92?(u=mn,m++):(u=n,R===0&&F(gn)),u!==n?(v=bn(),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n)),c}function yn(){var c,u,v;return c=m,u=m,R++,qo.test(i.charAt(m))?(v=i.charAt(m),m++):(v=n,R===0&&F(Ho)),R--,v===n?u=void 0:(m=u,u=n),u!==n?(i.length>m?(v=i.charAt(m),m++):(v=n,R===0&&F(ss)),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n),c===n&&(c=m,i.charCodeAt(m)===92?(u=mn,m++):(u=n,R===0&&F(gn)),u!==n?(v=bn(),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n)),c}function wn(){var c,u,v;return c=m,u=m,R++,v=K(),R--,v===n?u=void 0:(m=u,u=n),u!==n?(i.length>m?(v=i.charAt(m),m++):(v=n,R===0&&F(ss)),v!==n?(u=xt(v),c=u):(m=c,c=n)):(m=c,c=n),c}function bn(){var c,u;return Vo.test(i.charAt(m))?(c=i.charAt(m),m++):(c=n,R===0&&F(Uo)),c===n&&(c=m,i.charCodeAt(m)===110?(u=Bo,m++):(u=n,R===0&&F(Wo)),u!==n&&(u=Ko()),c=u,c===n&&(c=m,i.charCodeAt(m)===114?(u=zo,m++):(u=n,R===0&&F(Go)),u!==n&&(u=Yo()),c=u,c===n&&(c=m,i.charCodeAt(m)===116?(u=Jo,m++):(u=n,R===0&&F(Qo)),u!==n&&(u=Xo()),c=u))),c}function il(c,u){function v(){return c.apply(this,arguments)||u.apply(this,arguments)}return v.desc=c.desc+" or "+u.desc,v}function rl(c,u){function v(){return c.apply(this,arguments)&&u.apply(this,arguments)}return v.desc=c.desc+" and "+u.desc,v}function ol(c){function u(){return!c.apply(this,arguments)}return u.desc="not "+c.desc,u}function ll(c){function u(){return c.apply(this,arguments)}return u.desc="("+c.desc+")",u}function Sn(c){return!0}Sn.desc="all flows";var $n=[new RegExp("text/javascript"),new RegExp("application/x-javascript"),new RegExp("application/javascript"),new RegExp("text/css"),new RegExp("image/.*"),new RegExp("font/.*"),new RegExp("application/font.*")];function Cn(c){if(c.response){for(var u=mt.getContentType(c.response),v=$n.length;v--;)if($n[v].test(u))return!0}return!1}Cn.desc="is asset";function cl(c){c=new RegExp(c,"i");function u(v){return!0}return u.desc="body matches "+c,u}function al(c){c=new RegExp(c,"i");function u(v){return!0}return u.desc="body request matches "+c,u}function dl(c){c=new RegExp(c,"i");function u(v){return!0}return u.desc="body response matches "+c,u}function ul(c){function u(v){return v.response&&v.response.status_code===c}return u.desc="resp. code is "+c,u}function fl(c){c=new RegExp(c,"i");function u(v){return c.test(v.comment)}return u.desc="comment matches "+c,u}function pl(c){c=new RegExp(c,"i");function u(v){return v.request&&(c.test(v.request.host)||c.test(v.request.pretty_host))}return u.desc="domain matches "+c,u}function Nn(c){return c.type==="dns"}Nn.desc="is a DNS Flow";function hl(c){c=new RegExp(c,"i");function u(v){return!!v.server_conn.address&&c.test(v.server_conn.address[0]+":"+v.server_conn.address[1])}return u.desc="destination address matches "+c,u}function kn(c){return!!c.error}kn.desc="has error";function ml(c){c=new RegExp(c,"i");function u(v){return v.request&&ct.match_header(v.request,c)||v.response&&mt.match_header(v.response,c)}return u.desc="header matches "+c,u}function gl(c){c=new RegExp(c,"i");function u(v){return v.request&&ct.match_header(v.request,c)}return u.desc="req. header matches "+c,u}function vl(c){c=new RegExp(c,"i");function u(v){return v.response&&mt.match_header(v.response,c)}return u.desc="resp. header matches "+c,u}function En(c){return c.type==="http"}En.desc="is an HTTP Flow";function Tn(c){return c.marked}Tn.desc="is marked";function xl(c){c=new RegExp(c,"i");function u(v){return c.test(v.marked)}return u.desc="marker matches "+c,u}function _l(c){c=new RegExp(c,"i");function u(v){return v.request&&c.test(v.request.method)}return u.desc="method matches "+c,u}function Rn(c){return c.request&&!c.response}Rn.desc="has no response";function An(c){return c.is_replay==="request"}An.desc="request has been replayed";function Dn(c){return c.is_replay==="response"}Dn.desc="response has been replayed";function Fn(c){return!!c.is_replay}Fn.desc="flow has been replayed";function jl(c){c=new RegExp(c,"i");function u(v){return!!v.client_conn.peername&&c.test(v.client_conn.peername[0]+":"+v.client_conn.peername[1])}return u.desc="source address matches "+c,u}function In(c){return!!c.response}In.desc="has response";function Ln(c){return c.type==="tcp"}Ln.desc="is a TCP Flow";function Pn(c){return c.type==="udp"}Pn.desc="is a UDP Flow";function yl(c){c=new RegExp(c,"i");function u(v){return v.request&&c.test(ct.getContentType(v.request))}return u.desc="req. content type matches "+c,u}function wl(c){c=new RegExp(c,"i");function u(v){return v.response&&c.test(mt.getContentType(v.response))}return u.desc="resp. content type matches "+c,u}function bl(c){c=new RegExp(c,"i");function u(v){return v.request&&c.test(ct.getContentType(v.request))||v.response&&c.test(mt.getContentType(v.response))}return u.desc="content type matches "+c,u}function Sl(c){c=new RegExp(c,"i");function u(v){if(v.type==="dns"){const x=v.request?.questions[0];return x&&c.test(x.name)}return v.request&&c.test(ct.pretty_url(v.request))}return u.desc="url matches "+c,u}function On(c){return!!c.websocket}if(On.desc="is a Websocket Flow",Ft=a(),Ft!==n&&m===i.length)return Ft;throw Ft!==n&&me.json()),Ye.xhr.catch(()=>{Ye.xhr=null})),this.state.doc||Ye.xhr.then(e=>{Ye.doc=e,this.setState({doc:e})})}render(){const{doc:e}=this.state;return e?o.jsx("table",{className:"table table-condensed",children:o.jsxs("tbody",{children:[e.commands.map(s=>o.jsxs("tr",{onClick:()=>this.props.selectHandler(s[0].split(" ")[0]+" "),children:[o.jsx("td",{children:s[0].replace(" ","ย ")}),o.jsx("td",{children:s[1]})]},s[1])),o.jsx("tr",{children:o.jsx("td",{colSpan:2,children:o.jsxs("a",{href:"https://mitmproxy.org/docs/latest/concepts-filters/",target:"_blank",rel:"noreferrer",children:[o.jsx("i",{className:"fa fa-external-link"}),"ย  mitmproxy docs"]})})},"docs-link")]})}):o.jsx("i",{className:"fa fa-spinner fa-spin"})}}var Xt=(t=>(t.SEARCH="search",t.HIGHLIGHT="tag",t.INTERCEPT="pause",t))(Xt||{});class Hs extends I.Component{inputRef=Te.createRef();constructor(e,s){super(e,s),this.state={value:this.props.value,focus:!1,mousefocus:!1},this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.selectFilter=this.selectFilter.bind(this)}UNSAFE_componentWillReceiveProps(e){this.setState({value:e.value})}isValid(e){try{return e&&oi.parse(e),!0}catch{return!1}}getDesc(){if(!this.state.value)return o.jsx(Ye,{selectHandler:this.selectFilter});try{return oi.parse(this.state.value).desc}catch(e){return""+e}}onChange(e){const s=e.target.value;this.setState({value:s}),this.isValid(s)&&this.props.onChange(s)}onFocus(){this.setState({focus:!0})}onBlur(){this.setState({focus:!1})}onMouseEnter(){this.setState({mousefocus:!0})}onMouseLeave(){this.setState({mousefocus:!1})}onKeyDown(e){(e.key==="Escape"||e.key==="Enter")&&(this.blur(),this.setState({mousefocus:!1})),e.stopPropagation()}selectFilter(e){this.setState({value:e}),this.inputRef.current?.focus(),this.isValid(e)&&this.props.onChange(e)}blur(){this.inputRef.current?.blur()}select(){this.inputRef.current?.select()}render(){const{icon:e,color:s,placeholder:i}=this.props,{value:r,focus:n,mousefocus:l}=this.state;return o.jsxs("div",{className:je("filter-input input-group",{"has-error":!this.isValid(r)}),children:[o.jsx("span",{className:"input-group-addon",children:o.jsx("i",{className:"fa fa-fw fa-"+e,style:{color:s}})}),o.jsx("input",{type:"text",ref:this.inputRef,placeholder:i,className:"form-control",value:r,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown}),(n||l)&&o.jsxs("div",{className:"popover bottom",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,children:[o.jsx("div",{className:"arrow"}),o.jsx("div",{className:"popover-content",children:this.getDesc()})]})]})}}Zr.title="Flow List";function Zr(){const t=k.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[o.jsx(ju,{}),o.jsx(wu,{})]}),o.jsx("div",{className:"menu-legend",children:"Find"})]}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsxs("div",{className:"main-menu",children:[e,o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[o.jsx(xu,{}),o.jsx(Su,{})]}),o.jsx("div",{className:"menu-legend",children:"Intercept"})]})]}),t[1]=s):s=t[1],s}function xu(){const t=k.c(5),e=G(),i=D(_u)||"";let r;t[0]!==e?(r=l=>e(Cs("intercept",l)),t[0]=e,t[1]=r):r=t[1];let n;return t[2]!==i||t[3]!==r?(n=o.jsx(Hs,{value:i,placeholder:"Intercept",icon:Xt.INTERCEPT,color:"hsl(208, 56%, 53%)",onChange:r}),t[2]=i,t[3]=r,t[4]=n):n=t[4],n}function _u(t){return t.options.intercept}function ju(){const t=k.c(5),e=G(),s=D(yu);let i;t[0]!==e?(i=n=>e(Ri(n)),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Hs,{value:s,placeholder:"Search",icon:Xt.SEARCH,color:"black",onChange:i}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function yu(t){return t.ui.filter[ve.Search]}function wu(){const t=k.c(5),e=G(),s=D(bu);let i;t[0]!==e?(i=n=>e(Ai(n)),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Hs,{value:s,placeholder:"Highlight",icon:Xt.HIGHLIGHT,color:"hsl(48, 100%, 50%)",onChange:i}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function bu(t){return t.ui.filter[ve.Highlight]}function Su(){const t=k.c(2),e=G();let s;return t[0]!==e?(s=o.jsx(pe,{className:"btn-sm",title:"[a]ccept all",icon:"fa-forward text-success",onClick:()=>e(Di()),children:"Resume All"}),t[0]=e,t[1]=s):s=t[1],s}function Vs(t){const e=k.c(6),{value:s,onChange:i,children:r}=t;let n;e[0]!==i||e[1]!==s?(n=o.jsx("input",{type:"checkbox",checked:s,onChange:i}),e[0]=i,e[1]=s,e[2]=n):n=e[2];let l;return e[3]!==r||e[4]!==n?(l=o.jsx("div",{className:"menu-entry",children:o.jsxs("label",{children:[n,r]})}),e[3]=r,e[4]=n,e[5]=l):l=e[5],l}function cs(t){const e=k.c(10),{name:s,children:i}=t,r=G();let n;e[0]!==s?(n=p=>p.options[s],e[0]=s,e[1]=n):n=e[1];const l=D(n),a=!!l;let d;e[2]!==r||e[3]!==s||e[4]!==l?(d=()=>r(Cs(s,!l)),e[2]=r,e[3]=s,e[4]=l,e[5]=d):d=e[5];let f;return e[6]!==i||e[7]!==a||e[8]!==d?(f=o.jsx(Vs,{value:a,onChange:d,children:i}),e[6]=i,e[7]=a,e[8]=d,e[9]=f):f=e[9],f}function $u(){const t=k.c(5),e=G(),s=D(Cu);let i;t[0]!==e?(i=()=>e(Gt()),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Vs,{value:s,onChange:i,children:"Display Event Log"}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function Cu(t){return t.eventLog.visible}function Nu(){const t=k.c(5),e=G(),s=D(ku);let i;t[0]!==e?(i=()=>e(Ji()),t[0]=e,t[1]=i):i=t[1];let r;return t[2]!==i||t[3]!==s?(r=o.jsx(Vs,{value:s,onChange:i,children:"Display Command Bar"}),t[2]=i,t[3]=s,t[4]=r):r=t[4],r}function ku(t){return t.commandBar.visible}function as(t){const e=k.c(5),{children:s,resource:i}=t,r=`https://docs.mitmproxy.org/stable/${i}`;let n;e[0]!==s?(n=s||o.jsx("i",{className:"fa fa-question-circle"}),e[0]=s,e[1]=n):n=e[1];let l;return e[2]!==n||e[3]!==r?(l=o.jsx("a",{target:"_blank",href:r,rel:"noreferrer",children:n}),e[2]=n,e[3]=r,e[4]=l):l=e[4],l}eo.title="Options";function eo(){const t=k.c(16),e=G(),s=Eu;let i;t[0]!==e?(i=()=>e(s()),t[0]=e,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("sup",{children:"alpha"}),t[2]=r):r=t[2];let n;t[3]!==i?(n=o.jsx("div",{className:"menu-content",children:o.jsxs(pe,{title:"Open Options",icon:"fa-cogs text-primary",onClick:i,children:["Edit Options ",r]})}),t[3]=i,t[4]=n):n=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"menu-legend",children:"Options Editor"}),t[5]=l):l=t[5];let a;t[6]!==n?(a=o.jsxs("div",{className:"menu-group",children:[n,l]}),t[6]=n,t[7]=a):a=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxs(cs,{name:"anticache",children:["Strip cache headers"," ",o.jsx(as,{resource:"overview/features/#anticache"})]}),t[8]=d):d=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsxs(cs,{name:"showhost",children:["Use host header for display"," ",o.jsx(as,{resource:"concepts/options/#showhost"})]}),t[9]=f):f=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[d,f,o.jsxs(cs,{name:"ssl_insecure",children:["Don't verify server certificates"," ",o.jsx(as,{resource:"concepts/options/#ssl_insecure"})]})]}),o.jsx("div",{className:"menu-legend",children:"Quick Options"})]}),t[10]=p):p=t[10];let h;t[11]!==a?(h=o.jsxs(gt,{children:[a,p]}),t[11]=a,t[12]=h):h=t[12];let g;t[13]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxs("div",{className:"menu-group",children:[o.jsxs("div",{className:"menu-content",children:[o.jsx($u,{}),o.jsx(Nu,{})]}),o.jsx("div",{className:"menu-legend",children:"View Options"})]}),t[13]=g):g=t[13];let _;return t[14]!==h?(_=o.jsxs("div",{children:[h,g]}),t[14]=h,t[15]=_):_=t[15],_}function Eu(){return dc("OptionModal")}const yt=async(t,e)=>{const s=(async()=>{const i=await Bt("export",e,`@${t.id}`);if(i.value)return i.value;throw i.error?i.error:i})();try{await gi(s)}catch(i){alert(i)}};to.title="Flow";function to(){const t=k.c(63),e=G(),s=D(Tu),i=s[0];let r;t[0]!==s?(r=s.some(_s),t[0]=s,t[1]=r):r=t[1];const n=r;if(s.length===0){let X;return t[2]===Symbol.for("react.memo_cache_sentinel")?(X=o.jsx("div",{}),t[2]=X):X=t[2],X}let l;t[3]!==e||t[4]!==s?(l=()=>e(ws(s)),t[3]=e,t[4]=s,t[5]=l):l=t[5];let a;t[6]!==s?(a=s.some(xs),t[6]=s,t[7]=a):a=t[7];const d=!a;let f;t[8]!==l||t[9]!==d?(f=o.jsx(pe,{title:"[r]eplay flow",icon:"fa-repeat text-primary",onClick:l,disabled:d,children:"Replay"}),t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==e||t[12]!==s?(p=o.jsx(pe,{title:"[D]uplicate flow",icon:"fa-copy text-info",onClick:()=>e(Li(s)),children:"Duplicate"}),t[11]=e,t[12]=s,t[13]=p):p=t[13];let h;t[14]!==s?(h=s.some(bi),t[14]=s,t[15]=h):h=t[15];const g=!h;let _;t[16]!==e||t[17]!==s?(_=()=>e(Pi(s)),t[16]=e,t[17]=s,t[18]=_):_=t[18];let j;t[19]!==g||t[20]!==_?(j=o.jsx(pe,{disabled:g,title:"revert changes to flow [V]",icon:"fa-history text-warning",onClick:_,children:"Revert"}),t[19]=g,t[20]=_,t[21]=j):j=t[21];let y;t[22]!==e||t[23]!==s?(y=o.jsx(pe,{title:"[d]elete flow",icon:"fa-trash text-danger",onClick:()=>{e(Ii(s))},children:"Delete"}),t[22]=e,t[23]=s,t[24]=y):y=t[24];let w;t[25]!==s?(w=o.jsx(Mu,{flows:s}),t[25]=s,t[26]=w):w=t[26];let $;t[27]!==y||t[28]!==w||t[29]!==f||t[30]!==p||t[31]!==j?($=o.jsxs("div",{className:"menu-content",children:[f,p,j,y,w]}),t[27]=y,t[28]=w,t[29]=f,t[30]=p,t[31]=j,t[32]=$):$=t[32];let N;t[33]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx("div",{className:"menu-legend",children:"Flow Modification"}),t[33]=N):N=t[33];let E;t[34]!==$?(E=o.jsx(gt,{children:o.jsxs("div",{className:"menu-group",children:[$,N]})}),t[34]=$,t[35]=E):E=t[35];let T;t[36]!==i?(T=o.jsxs("div",{className:"menu-content",children:[o.jsx(Ru,{flow:i}),o.jsx(Iu,{flow:i})]}),t[36]=i,t[37]=T):T=t[37];let P;t[38]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx("div",{className:"menu-legend",children:"Export"}),t[38]=P):P=t[38];let L;t[39]!==T?(L=o.jsxs("div",{className:"menu-group",children:[T,P]}),t[39]=T,t[40]=L):L=t[40];const O=!n;let M;t[41]!==e||t[42]!==s?(M=()=>e(ys(s)),t[41]=e,t[42]=s,t[43]=M):M=t[43];let U;t[44]!==O||t[45]!==M?(U=o.jsx(pe,{disabled:O,title:"[a]ccept intercepted flow",icon:"fa-play text-success",onClick:M,children:"Resume"}),t[44]=O,t[45]=M,t[46]=U):U=t[46];const V=!n;let W;t[47]!==e||t[48]!==s?(W=()=>e(Fi(s)),t[47]=e,t[48]=s,t[49]=W):W=t[49];let J;t[50]!==V||t[51]!==W?(J=o.jsx(pe,{disabled:V,title:"kill intercepted flow [x]",icon:"fa-times text-danger",onClick:W,children:"Abort"}),t[50]=V,t[51]=W,t[52]=J):J=t[52];let z;t[53]!==U||t[54]!==J?(z=o.jsxs("div",{className:"menu-content",children:[U,J]}),t[53]=U,t[54]=J,t[55]=z):z=t[55];let te;t[56]===Symbol.for("react.memo_cache_sentinel")?(te=o.jsx("div",{className:"menu-legend",children:"Interception"}),t[56]=te):te=t[56];let Y;t[57]!==z?(Y=o.jsx(gt,{children:o.jsxs("div",{className:"menu-group",children:[z,te]})}),t[57]=z,t[58]=Y):Y=t[58];let Q;return t[59]!==E||t[60]!==L||t[61]!==Y?(Q=o.jsxs("div",{className:"flow-menu",children:[E,L,Y]}),t[59]=E,t[60]=L,t[61]=Y,t[62]=Q):Q=t[62],Q}function Tu(t){return t.flows.selected}const qt=t=>{const e=window.open(t,"_blank","noopener,noreferrer");e&&(e.opener=null)};function Ru(t){const e=k.c(24),{flow:s}=t,i=D(Fu);if(s.type!=="http"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(pe,{icon:"fa-download",onClick:Du,disabled:!0,children:"Download"}),e[0]=r):r=e[0],r}if(s.request.contentLength&&!s.response?.contentLength){let r;e[1]!==s?(r=()=>qt(we.getContentURL(s,s.request)),e[1]=s,e[2]=r):r=e[2];const n=!i;let l;return e[3]!==r||e[4]!==n?(l=o.jsx(pe,{icon:"fa-download",onClick:r,disabled:n,children:"Download"}),e[3]=r,e[4]=n,e[5]=l):l=e[5],l}if(s.response){const r=s.response;if(!s.request.contentLength&&s.response.contentLength){let n;e[6]!==s||e[7]!==r?(n=()=>qt(we.getContentURL(s,r)),e[6]=s,e[7]=r,e[8]=n):n=e[8];const l=!i;let a;return e[9]!==n||e[10]!==l?(a=o.jsx(pe,{icon:"fa-download",onClick:n,disabled:l,children:"Download"}),e[9]=n,e[10]=l,e[11]=a):a=e[11],a}if(s.request.contentLength&&s.response.contentLength){const n=!i;let l;e[12]!==n?(l=o.jsx(pe,{icon:"fa-download",onClick:Au,disabled:n,children:"Downloadโ–พ"}),e[12]=n,e[13]=l):l=e[13];let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a={placement:"bottom-start"},e[14]=a):a=e[14];let d;e[15]!==s?(d=o.jsx(ke,{onClick:()=>qt(we.getContentURL(s,s.request)),children:"Download request"}),e[15]=s,e[16]=d):d=e[16];let f;e[17]!==s||e[18]!==r?(f=o.jsx(ke,{onClick:()=>qt(we.getContentURL(s,r)),children:"Download response"}),e[17]=s,e[18]=r,e[19]=f):f=e[19];let p;return e[20]!==l||e[21]!==d||e[22]!==f?(p=o.jsxs(Et,{text:l,options:a,children:[d,f]}),e[20]=l,e[21]=d,e[22]=f,e[23]=p):p=e[23],p}}return null}function Au(){return 1}function Du(){return 0}function Fu(t){return t.flows.selected.length===1}function Iu(t){const e=k.c(20),{flow:s}=t,i=D(Pu),r=s.type!=="http"||!i;let n;e[0]!==r?(n=o.jsx(pe,{title:"Export flow.",icon:"fa-clone",onClick:Lu,disabled:r,children:"Exportโ–พ"}),e[0]=r,e[1]=n):n=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={placement:"bottom-start"},e[2]=l):l=e[2];let a;e[3]!==s?(a=o.jsx(ke,{onClick:()=>yt(s,"raw_request"),children:"Copy raw request"}),e[3]=s,e[4]=a):a=e[4];let d;e[5]!==s?(d=o.jsx(ke,{onClick:()=>yt(s,"raw_response"),children:"Copy raw response"}),e[5]=s,e[6]=d):d=e[6];let f;e[7]!==s?(f=o.jsx(ke,{onClick:()=>yt(s,"raw"),children:"Copy raw request and response"}),e[7]=s,e[8]=f):f=e[8];let p;e[9]!==s?(p=o.jsx(ke,{onClick:()=>yt(s,"curl"),children:"Copy as cURL"}),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==s?(h=o.jsx(ke,{onClick:()=>yt(s,"httpie"),children:"Copy as HTTPie"}),e[11]=s,e[12]=h):h=e[12];let g;return e[13]!==n||e[14]!==a||e[15]!==d||e[16]!==f||e[17]!==p||e[18]!==h?(g=o.jsxs(Et,{className:"",text:n,options:l,children:[a,d,f,p,h]}),e[13]=n,e[14]=a,e[15]=d,e[16]=f,e[17]=p,e[18]=h,e[19]=g):g=e[19],g}function Lu(){return 1}function Pu(t){return t.flows.selected.length===1}const Ou={":red_circle:":"๐Ÿ”ด",":orange_circle:":"๐ŸŸ ",":yellow_circle:":"๐ŸŸก",":green_circle:":"๐ŸŸข",":large_blue_circle:":"๐Ÿ”ต",":purple_circle:":"๐ŸŸฃ",":brown_circle:":"๐ŸŸค"};function Mu(t){const e=k.c(5),{flows:s}=t,i=G();let r,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(pe,{title:"mark flow",icon:"fa-paint-brush text-success",onClick:qu,children:"Markโ–พ"}),n={placement:"bottom-start"},e[0]=r,e[1]=n):(r=e[0],n=e[1]);let l;return e[2]!==i||e[3]!==s?(l=o.jsxs(Et,{className:"",text:r,options:n,children:[o.jsx(ke,{onClick:()=>i(Kn(s,"")),children:"โšช (no marker)"}),Object.entries(Ou).map(a=>{const[d,f]=a;return o.jsxs(ke,{onClick:()=>i(Kn(s,d)),children:[f," ",d.replace(/[:_]/g," ")]},d)})]}),e[2]=i,e[3]=s,e[4]=l):l=e[4],l}function qu(){return 1}const li={[xe.Capture]:Xr,[xe.FlowList]:Zr,[xe.Options]:eo,[xe.Flow]:to};function Hu(){const t=k.c(26),e=G(),s=D(Uu),i=D(Vu),[r,n]=I.useState(!1);let l;t[0]!==i.length?(l=[xe.Capture,xe.FlowList,xe.Options],i.length>0&&l.push(xe.Flow),t[0]=i.length,t[1]=l):l=t[1];let a;t[2]!==s||t[3]!==e||t[4]!==i.length||t[5]!==r?(a=()=>{i.length>0&&!r?(e(Vt(xe.Flow)),n(!0)):i.length===0&&(r&&n(!1),s===xe.Flow&&e(Vt(xe.FlowList)))},t[2]=s,t[3]=e,t[4]=i.length,t[5]=r,t[6]=a):a=t[6];let d;t[7]!==s||t[8]!==i||t[9]!==r?(d=[i,r,s],t[7]=s,t[8]=i,t[9]=r,t[10]=d):d=t[10],I.useEffect(a,d);let f;t[11]!==e?(f=function(E,T){T.preventDefault(),e(Vt(E))},t[11]=e,t[12]=f):f=t[12];const p=f,h=li[s];let g;t[13]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(uu,{}),t[13]=g):g=t[13];let _;t[14]!==s||t[15]!==l||t[16]!==p?(_=l.map(N=>o.jsx("a",{href:"#",className:je({active:N===s}),onClick:E=>p(N,E),children:li[N].title},N)),t[14]=s,t[15]=l,t[16]=p,t[17]=_):_=t[17];let j;t[18]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(gt,{children:o.jsx(mu,{})}),t[18]=j):j=t[18];let y;t[19]!==_?(y=o.jsxs("nav",{className:"nav-tabs nav-tabs-lg",children:[g,_,j]}),t[19]=_,t[20]=y):y=t[20];let w;t[21]!==h?(w=o.jsx("div",{children:o.jsx(h,{})}),t[21]=h,t[22]=w):w=t[22];let $;return t[23]!==y||t[24]!==w?($=o.jsxs("header",{children:[y,w]}),t[23]=y,t[24]=w,t[25]=$):$=t[25],$}function Vu(t){return t.flows.selected}function Uu(t){return t.ui.tabs.current}const ds=function(){function t(i,r){function n(){this.constructor=i}n.prototype=r.prototype,i.prototype=new n}function e(i,r,n,l){this.message=i,this.expected=r,this.found=n,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}t(e,Error);function s(i){var r=arguments.length>1?arguments[1]:{},n={},l={Expr:Re},a=Re,d=function(b,S){return[b,...S]},f=function(b){return[b]},p=function(){return""},h={type:"other",description:"string"},g='"',_={type:"literal",value:'"',description:'"\\""'},j=function(b){return b.join("")},y="'",w={type:"literal",value:"'",description:`"'"`},$=/^["\\]/,N={type:"class",value:'["\\\\]',description:'["\\\\]'},E={type:"any",description:"any character"},T=function(b){return b},P="\\",L={type:"literal",value:"\\",description:'"\\\\"'},O=/^['\\]/,M={type:"class",value:"['\\\\]",description:"['\\\\]"},U=/^['"\\]/,V={type:"class",value:`['"\\\\]`,description:`['"\\\\]`},W="n",J={type:"literal",value:"n",description:'"n"'},z=function(){return` +`},te="r",Y={type:"literal",value:"r",description:'"r"'},Q=function(){return"\r"},X="t",Z={type:"literal",value:"t",description:'"t"'},ae=function(){return" "},le={type:"other",description:"whitespace"},de=/^[ \t\n\r]/,ye={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},Pe={type:"other",description:"control character"},Se=/^[|&!()~"]/,Ee={type:"class",value:'[|&!()~"]',description:'[|&!()~"]'},C=0,he=[{line:1,column:1,seenCR:!1}],B=0,oe=[],q=0,$e;if("startRule"in r){if(!(r.startRule in l))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');a=l[r.startRule]}function We(b){var S=he[b],A,H;if(S)return S;for(A=b-1;!he[A];)A--;for(S=he[A],S={line:S.line,column:S.column,seenCR:S.seenCR};AB&&(B=C,oe=[]),oe.push(b))}function Me(b,S,A,H){function Tt(Ce){var De=1;for(Ce.sort(function(ut,Ke){return ut.descriptionKe.description?1:0});De1?Ke.slice(0,-1).join(", ")+" or "+Ke[Ce.length-1]:Ke[0],Rt=De?'"'+ut(De)+'"':"end of input","Expected "+vt+" but "+Rt+" found."}return S!==null&&Tt(S),new e(es(S,A),S,A,H)}function Re(){var b,S,A,H;if(b=C,S=re(),S!==n){if(A=[],H=Je(),H!==n)for(;H!==n;)A.push(H),H=Je();else A=n;A!==n?(H=Re(),H!==n?(S=d(S,H),b=S):(C=b,b=n)):(C=b,b=n)}else C=b,b=n;if(b===n&&(b=C,S=re(),S!==n&&(S=f(S)),b=S,b===n)){for(b=C,S=[],A=Je();A!==n;)S.push(A),A=Je();S!==n&&(S=p()),b=S}return b}function re(){var b,S,A,H;if(q++,b=C,i.charCodeAt(C)===34?(S=g,C++):(S=n,q===0&&ee(_)),S!==n){for(A=[],H=ue();H!==n;)A.push(H),H=ue();A!==n?(i.charCodeAt(C)===34?(H=g,C++):(H=n,q===0&&ee(_)),H!==n?(S=j(A),b=S):(C=b,b=n)):(C=b,b=n)}else C=b,b=n;if(b===n){if(b=C,i.charCodeAt(C)===39?(S=y,C++):(S=n,q===0&&ee(w)),S!==n){for(A=[],H=ge();H!==n;)A.push(H),H=ge();A!==n?(i.charCodeAt(C)===39?(H=y,C++):(H=n,q===0&&ee(w)),H!==n?(S=j(A),b=S):(C=b,b=n)):(C=b,b=n)}else C=b,b=n;if(b===n){if(b=C,S=C,q++,A=Zt(),q--,A===n?S=void 0:(C=S,S=n),S!==n){if(A=[],H=Ae(),H!==n)for(;H!==n;)A.push(H),H=Ae();else A=n;A!==n?(S=j(A),b=S):(C=b,b=n)}else C=b,b=n;if(b===n){if(b=C,i.charCodeAt(C)===34?(S=g,C++):(S=n,q===0&&ee(_)),S!==n){for(A=[],H=ue();H!==n;)A.push(H),H=ue();A!==n?(S=j(A),b=S):(C=b,b=n)}else C=b,b=n;if(b===n)if(b=C,i.charCodeAt(C)===39?(S=y,C++):(S=n,q===0&&ee(w)),S!==n){for(A=[],H=ge();H!==n;)A.push(H),H=ge();A!==n?(S=j(A),b=S):(C=b,b=n)}else C=b,b=n}}}return q--,b===n&&(S=n,q===0&&ee(h)),b}function ue(){var b,S,A;return b=C,S=C,q++,$.test(i.charAt(C))?(A=i.charAt(C),C++):(A=n,q===0&&ee(N)),q--,A===n?S=void 0:(C=S,S=n),S!==n?(i.length>C?(A=i.charAt(C),C++):(A=n,q===0&&ee(E)),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n),b===n&&(b=C,i.charCodeAt(C)===92?(S=P,C++):(S=n,q===0&&ee(L)),S!==n?(A=nt(),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n)),b}function ge(){var b,S,A;return b=C,S=C,q++,O.test(i.charAt(C))?(A=i.charAt(C),C++):(A=n,q===0&&ee(M)),q--,A===n?S=void 0:(C=S,S=n),S!==n?(i.length>C?(A=i.charAt(C),C++):(A=n,q===0&&ee(E)),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n),b===n&&(b=C,i.charCodeAt(C)===92?(S=P,C++):(S=n,q===0&&ee(L)),S!==n?(A=nt(),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n)),b}function Ae(){var b,S,A;return b=C,S=C,q++,A=Je(),q--,A===n?S=void 0:(C=S,S=n),S!==n?(i.length>C?(A=i.charAt(C),C++):(A=n,q===0&&ee(E)),A!==n?(S=T(A),b=S):(C=b,b=n)):(C=b,b=n),b}function nt(){var b,S;return U.test(i.charAt(C))?(b=i.charAt(C),C++):(b=n,q===0&&ee(V)),b===n&&(b=C,i.charCodeAt(C)===110?(S=W,C++):(S=n,q===0&&ee(J)),S!==n&&(S=z()),b=S,b===n&&(b=C,i.charCodeAt(C)===114?(S=te,C++):(S=n,q===0&&ee(Y)),S!==n&&(S=Q()),b=S,b===n&&(b=C,i.charCodeAt(C)===116?(S=X,C++):(S=n,q===0&&ee(Z)),S!==n&&(S=ae()),b=S))),b}function Je(){var b;return q++,de.test(i.charAt(C))?(b=i.charAt(C),C++):(b=n,q===0&&ee(ye)),q--,b===n&&q===0&&ee(le),b}function Zt(){var b;return q++,Se.test(i.charAt(C))?(b=i.charAt(C),C++):(b=n,q===0&&ee(Ee)),q--,b===n&&q===0&&ee(Pe),b}if($e=a(),$e!==n&&C===i.length)return $e;throw $e!==n&&C{i&&i.current.addEventListener("DOMNodeInserted",Ku)},n=[],e[0]=r,e[1]=n):(r=e[0],n=e[1]),I.useEffect(r,n);let l;e[2]!==s?(l=s.map(Wu),e[2]=s,e[3]=l):l=e[3];let a;return e[4]!==l?(a=o.jsx("div",{className:"command-result",ref:i,children:l}),e[4]=l,e[5]=a):a=e[5],a}function Wu(t,e){return o.jsxs("div",{children:[o.jsx("div",{children:o.jsxs("strong",{children:["$ ",t.command]})}),t.result]},e)}function Ku(t){const e=t.currentTarget;e.scroll({top:e.scrollHeight,behavior:"auto"})}function zu(t){const e=k.c(20),{nextArgs:s,currentArg:i,help:r,description:n,availableCommands:l}=t;let a;if(e[0]!==i||e[1]!==s){a=[];for(let w=0;w0&&o.jsxs("div",{children:[o.jsx("strong",{children:"Argument suggestion:"})," ",a]}),e[4]=a,e[5]=f):f=e[5];let p;e[6]!==r?(p=r?.includes("->")&&o.jsxs("div",{children:[o.jsx("strong",{children:"Signature help: "}),r]}),e[6]=r,e[7]=p):p=e[7];let h;e[8]!==n?(h=n&&o.jsxs("div",{children:["# ",n]}),e[8]=n,e[9]=h):h=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("strong",{children:"Available Commands: "}),e[10]=g):g=e[10];let _;e[11]!==l?(_=JSON.stringify(l),e[11]=l,e[12]=_):_=e[12];let j;e[13]!==_?(j=o.jsxs("div",{children:[g,o.jsx("p",{className:"available-commands",children:_})]}),e[13]=_,e[14]=j):j=e[14];let y;return e[15]!==f||e[16]!==p||e[17]!==h||e[18]!==j?(y=o.jsxs("div",{className:"argument-suggestion popover top",children:[d,o.jsxs("div",{className:"popover-content",children:[f,p,h,j]})]}),e[15]=f,e[16]=p,e[17]=h,e[18]=j,e[19]=y):y=e[19],y}function Gu(){const t=k.c(45),[e,s]=I.useState(""),[i,r]=I.useState(""),[n,l]=I.useState(0);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],t[0]=a):a=t[0];const[d,f]=I.useState(a);let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=[],t[1]=p):p=t[1];const[h,g]=I.useState(p);let _;t[2]===Symbol.for("react.memo_cache_sentinel")?(_={},t[2]=_):_=t[2];const[j,y]=I.useState(_);let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=[],t[3]=w):w=t[3];const[$,N]=I.useState(w),[E,T]=I.useState(0),[P,L]=I.useState(""),[O,M]=I.useState("");let U;t[4]===Symbol.for("react.memo_cache_sentinel")?(U=[],t[4]=U):U=t[4];const[V,W]=I.useState(U);let J;t[5]===Symbol.for("react.memo_cache_sentinel")?(J=[],t[5]=J):J=t[5];const[z,te]=I.useState(J),[Y,Q]=I.useState(void 0);let X,Z;t[6]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{ne("/commands",{method:"GET"}).then(ef).then(re=>{y(re),f(us(re)),g(Object.keys(re))}).catch(Zu)},Z=[],t[6]=X,t[7]=Z):(X=t[6],Z=t[7]),I.useEffect(X,Z);let ae,le;t[8]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>{Bt("commands.history.get").then(re=>{te(re.value)}).catch(Xu)},le=[],t[8]=ae,t[9]=le):(ae=t[8],le=t[9]),I.useEffect(ae,le);let de;t[10]!==j?(de=(re,ue)=>{const ge=ds.parse(ue),Ae=ds.parse(re);L(j[ge[0]]?.signature_help),M(j[ge[0]]?.help||""),f(us(j,Ae[0])),g(us(j,ge[0]));const nt=j[ge[0]]?.parameters.map(Qu);nt&&(N([ge[0],...nt]),T(ge.length-1))},t[10]=j,t[11]=de):de=t[11];const ye=de;let Pe;t[12]===Symbol.for("react.memo_cache_sentinel")?(Pe=re=>{s(re.target.value),r(re.target.value),l(0)},t[12]=Pe):Pe=t[12];const Se=Pe;let Ee;t[13]!==h||t[14]!==d||t[15]!==n||t[16]!==Y||t[17]!==z||t[18]!==e||t[19]!==V?(Ee=re=>{if(re.key==="Enter"){const[ue,...ge]=ds.parse(e);te([...z,e]),Bt("commands.history.add",e).catch(Ju),ne.post(`/commands/${ue}`,{arguments:ge}).then(Yu).then(Ae=>{Q(void 0),N([]),W([...V,{command:e,result:JSON.stringify(Ae.value||Ae.error)}])}).catch(Ae=>{Q(void 0),N([]),W([...V,{command:e,result:Ae.toString()}])}),L(""),M(""),s(""),r(""),l(0),f(h)}if(re.key==="ArrowUp"){let ue;Y===void 0?ue=z.length-1:ue=Math.max(0,Y-1),s(z[ue]),r(z[ue]),Q(ue)}if(re.key==="ArrowDown"){if(Y===void 0)return;if(Y==z.length-1)s(""),r(""),Q(void 0);else{const ue=Y+1;s(z[ue]),r(z[ue]),Q(ue)}}re.key==="Tab"&&(s(d[n]),l((n+1)%d.length),re.preventDefault()),re.stopPropagation()},t[13]=h,t[14]=d,t[15]=n,t[16]=Y,t[17]=z,t[18]=e,t[19]=V,t[20]=Ee):Ee=t[20];const C=Ee;let he;t[21]!==j||t[22]!==e||t[23]!==i||t[24]!==ye?(he=re=>{if(!e){g(Object.keys(j));return}ye(i,e),re.stopPropagation()},t[21]=j,t[22]=e,t[23]=i,t[24]=ye,t[25]=he):he=t[25];const B=he;let oe;t[26]===Symbol.for("react.memo_cache_sentinel")?(oe=o.jsx("div",{className:"command-title",children:"Command Result"}),t[26]=oe):oe=t[26];let q;t[27]!==V?(q=o.jsx(Bu,{results:V}),t[27]=V,t[28]=q):q=t[28];let $e;t[29]!==h||t[30]!==E||t[31]!==O||t[32]!==$||t[33]!==P?($e=o.jsx(zu,{nextArgs:$,currentArg:E,help:P,description:O,availableCommands:h}),t[29]=h,t[30]=E,t[31]=O,t[32]=$,t[33]=P,t[34]=$e):$e=t[34];let We;t[35]===Symbol.for("react.memo_cache_sentinel")?(We=je("command-input input-group"),t[35]=We):We=t[35];let Oe;t[36]===Symbol.for("react.memo_cache_sentinel")?(Oe=o.jsx("span",{className:"input-group-addon",children:o.jsx("i",{className:"fa fa-fw fa-terminal"})}),t[36]=Oe):Oe=t[36];const ee=e||"";let Me;t[37]!==C||t[38]!==B||t[39]!==ee?(Me=o.jsxs("div",{className:We,children:[Oe,o.jsx("input",{type:"text",placeholder:"Enter command",className:"form-control",value:ee,onChange:Se,onKeyDown:C,onKeyUp:B})]}),t[37]=C,t[38]=B,t[39]=ee,t[40]=Me):Me=t[40];let Re;return t[41]!==q||t[42]!==$e||t[43]!==Me?(Re=o.jsxs("div",{className:"command",children:[oe,q,$e,Me]}),t[41]=q,t[42]=$e,t[43]=Me,t[44]=Re):Re=t[44],Re}function Yu(t){return t.json()}function Ju(){return 0}function Qu(t){return t.name}function Xu(t){return console.error(t)}function Zu(t){return console.error(t)}function ef(t){return t.json()}function tf(t){const e=k.c(7),{checked:s,onToggle:i,text:r}=t,n="btn btn-toggle "+(s?"btn-primary":"btn-default"),l="fa fa-fw "+(s?"fa-check-square-o":"fa-square-o");let a;e[0]!==l?(a=o.jsx("i",{className:l}),e[0]=l,e[1]=a):a=e[1];let d;return e[2]!==i||e[3]!==n||e[4]!==a||e[5]!==r?(d=o.jsxs("div",{className:n,onClick:i,children:[a,"ย ",r]}),e[2]=i,e[3]=n,e[4]=a,e[5]=r,e[6]=d):d=e[6],d}class sf extends I.Component{static defaultProps={rowHeight:18};heights;viewport=Te.createRef();constructor(e){super(e),this.heights={},this.state={vScroll:kt()},this.onViewportUpdate=this.onViewportUpdate.bind(this)}componentDidMount(){window.addEventListener("resize",this.onViewportUpdate),this.onViewportUpdate()}componentWillUnmount(){window.removeEventListener("resize",this.onViewportUpdate)}getSnapshotBeforeUpdate(){return Es(this.viewport)}componentDidUpdate(e,s,i){i&&Jr(this.viewport),this.onViewportUpdate()}onViewportUpdate(){const e=this.viewport.current,s=kt({itemCount:this.props.events.length,rowHeight:this.props.rowHeight,viewportTop:e.scrollTop,viewportHeight:e.offsetHeight,itemHeights:this.props.events.map(i=>this.heights[i.id])});Kt(this.state.vScroll,s)||this.setState({vScroll:s})}setHeight(e,s){if(s&&!this.heights[e]){const i=s.offsetHeight;this.heights[e]!==i&&(this.heights[e]=i,this.onViewportUpdate())}}render(){const{vScroll:e}=this.state,{events:s}=this.props;return o.jsxs("pre",{ref:this.viewport,onScroll:this.onViewportUpdate,children:[o.jsx("div",{style:{height:e.paddingTop}}),s.slice(e.start,e.end).map(i=>o.jsxs("div",{ref:r=>{this.setHeight(i.id,r)},children:[o.jsx(nf,{event:i}),i.message]},i.id)),o.jsx("div",{style:{height:e.paddingBottom}})]})}}function nf(t){const e=k.c(4),{event:s}=t;let i;e[0]!==s.level?(i={web:"html5",debug:"bug",warn:"exclamation-triangle",error:"ban"}[s.level]||"info",e[0]=s.level,e[1]=i):i=e[1];const n=`fa fa-fw fa-${i}`;let l;return e[2]!==n?(l=o.jsx("i",{className:n}),e[2]=n,e[3]=l):l=e[3],l}class rf extends I.Component{static defaultProps={defaultHeight:200};dragStart;constructor(e,s){super(e,s),this.state={height:this.props.defaultHeight},this.onDragStart=this.onDragStart.bind(this),this.onDragMove=this.onDragMove.bind(this),this.onDragStop=this.onDragStop.bind(this)}onDragStart(e){e.preventDefault(),this.dragStart=this.state.height+e.pageY,window.addEventListener("mousemove",this.onDragMove),window.addEventListener("mouseup",this.onDragStop),window.addEventListener("dragend",this.onDragStop)}onDragMove(e){e.preventDefault(),this.setState({height:this.dragStart-e.pageY})}onDragStop(e){e.preventDefault(),window.removeEventListener("mousemove",this.onDragMove)}render(){const{height:e}=this.state,{filters:s,events:i,toggleFilter:r,close:n}=this.props;return o.jsxs("div",{className:"eventlog",style:{height:e},children:[o.jsxs("div",{onMouseDown:this.onDragStart,children:["Eventlog",o.jsxs("div",{className:"pull-right",children:[Object.values(Gi).map(l=>o.jsx(tf,{text:l,checked:s[l],onToggle:()=>r(l)},l)),o.jsx("i",{onClick:n,className:"fa fa-close"})]})]}),o.jsx(sf,{events:i})]})}}const of=zt(t=>({filters:t.eventLog.filters,events:t.eventLog.view}),{close:Gt,toggleFilter:zi})(rf);function lf(){const t=k.c(56),e=D(uf),{mode:s,intercept:i,showhost:r,upstream_cert:n,rawtcp:l,http2:a,websocket:d,anticache:f,anticomp:p,stickyauth:h,stickycookie:g,stream_large_bodies:_,listen_host:j,listen_port:y,server:w,ssl_insecure:$}=D(df),N=D(af),E=D(cf);let T;t[0]!==s?(T=s&&(s.length!==1||s[0]!=="regular")&&o.jsx("span",{className:"label label-success",children:s.join(",")}),t[0]=s,t[1]=T):T=t[1];let P;t[2]!==i?(P=i&&o.jsxs("span",{className:"label label-success",children:["Intercept: ",i]}),t[2]=i,t[3]=P):P=t[3];let L;t[4]!==$?(L=$&&o.jsx("span",{className:"label label-danger",children:"ssl_insecure"}),t[4]=$,t[5]=L):L=t[5];let O;t[6]!==r?(O=r&&o.jsx("span",{className:"label label-success",children:"showhost"}),t[6]=r,t[7]=O):O=t[7];let M;t[8]!==n?(M=!n&&o.jsx("span",{className:"label label-success",children:"no-upstream-cert"}),t[8]=n,t[9]=M):M=t[9];let U;t[10]!==l?(U=!l&&o.jsx("span",{className:"label label-success",children:"no-raw-tcp"}),t[10]=l,t[11]=U):U=t[11];let V;t[12]!==a?(V=!a&&o.jsx("span",{className:"label label-success",children:"no-http2"}),t[12]=a,t[13]=V):V=t[13];let W;t[14]!==d?(W=!d&&o.jsx("span",{className:"label label-success",children:"no-websocket"}),t[14]=d,t[15]=W):W=t[15];let J;t[16]!==f?(J=f&&o.jsx("span",{className:"label label-success",children:"anticache"}),t[16]=f,t[17]=J):J=t[17];let z;t[18]!==p?(z=p&&o.jsx("span",{className:"label label-success",children:"anticomp"}),t[18]=p,t[19]=z):z=t[19];let te;t[20]!==h?(te=h&&o.jsxs("span",{className:"label label-success",children:["stickyauth: ",h]}),t[20]=h,t[21]=te):te=t[21];let Y;t[22]!==g?(Y=g&&o.jsxs("span",{className:"label label-success",children:["stickycookie: ",g]}),t[22]=g,t[23]=Y):Y=t[23];let Q;t[24]!==_?(Q=_&&o.jsxs("span",{className:"label label-success",children:["stream: ",hi(_)]}),t[24]=_,t[25]=Q):Q=t[25];let X;t[26]!==N||t[27]!==E?(X=E>0&&o.jsxs("span",{className:"label label-default",children:[N," of ",E," flows selected"]}),t[26]=N,t[27]=E,t[28]=X):X=t[28];let Z;t[29]!==j||t[30]!==y||t[31]!==w?(Z=w&&o.jsxs("span",{className:"label label-primary",title:"HTTP Proxy Server Address",children:[j||"*",":",y||8080]}),t[29]=j,t[30]=y,t[31]=w,t[32]=Z):Z=t[32];let ae;t[33]!==Z?(ae=o.jsx(gt,{children:Z}),t[33]=Z,t[34]=ae):ae=t[34];let le;t[35]!==e?(le=o.jsxs("span",{className:"label label-default",title:"Mitmproxy Version",children:["mitmproxy ",e]}),t[35]=e,t[36]=le):le=t[36];let de;t[37]!==ae||t[38]!==le?(de=o.jsxs("div",{className:"pull-right",children:[ae,le]}),t[37]=ae,t[38]=le,t[39]=de):de=t[39];let ye;return t[40]!==T||t[41]!==P||t[42]!==te||t[43]!==Y||t[44]!==Q||t[45]!==X||t[46]!==de||t[47]!==L||t[48]!==O||t[49]!==M||t[50]!==U||t[51]!==V||t[52]!==W||t[53]!==J||t[54]!==z?(ye=o.jsxs("footer",{children:[T,P,L,O,M,U,V,W,J,z,te,Y,Q,X,de]}),t[40]=T,t[41]=P,t[42]=te,t[43]=Y,t[44]=Q,t[45]=X,t[46]=de,t[47]=L,t[48]=O,t[49]=M,t[50]=U,t[51]=V,t[52]=W,t[53]=J,t[54]=z,t[55]=ye):ye=t[55],ye}function cf(t){return t.flows.list.length}function af(t){return t.flows.selected.length}function df(t){return t.options}function uf(t){return t.backendState.version}function ff(t){const e=k.c(3),{children:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"modal-backdrop fade in"}),e[0]=i):i=e[0];let r;return e[1]!==s?(r=o.jsxs("div",{children:[i,o.jsx("div",{className:"modal modal-visible",id:"optionsModal",tabIndex:-1,role:"dialog","aria-labelledby":"options",children:o.jsx("div",{className:"modal-dialog modal-lg",role:"document",children:o.jsx("div",{className:"modal-content",children:s})})})]}),e[1]=s,e[2]=r):r=e[2],r}const pf=t=>{t.key!=="Escape"&&t.stopPropagation()};function so(t){const e=k.c(10);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=a=>s(a.target.checked),e[4]=s,e[5]=n):n=e[5];let l;return e[6]!==i||e[7]!==n||e[8]!==r?(l=o.jsx("div",{className:"checkbox",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:r,onChange:n,...i}),"Enable"]})}),e[6]=i,e[7]=n,e[8]=r,e[9]=l):l=e[9],l}function ci(t){const e=k.c(10);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);const n=r||"";let l;e[4]!==s?(l=d=>s(d.target.value),e[4]=s,e[5]=l):l=e[5];let a;return e[6]!==i||e[7]!==n||e[8]!==l?(a=o.jsx("input",{type:"text",value:n,onChange:l,...i}),e[6]=i,e[7]=n,e[8]=l,e[9]=a):a=e[9],a}function ai(t){return function({onChange:s,...i}){return o.jsx(t,{onChange:r=>s(r||null),...i})}}function di(t){const e=k.c(10);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=a=>s(parseInt(a.target.value)),e[4]=s,e[5]=n):n=e[5];let l;return e[6]!==i||e[7]!==n||e[8]!==r?(l=o.jsx("input",{type:"number",value:r,onChange:n,...i}),e[6]=i,e[7]=n,e[8]=r,e[9]=l):l=e[9],l}function hf(t){const e=k.c(12);let s,i,r,n;if(e[0]!==t){const{value:d,onChange:f,choices:p,...h}=t;n=d,s=p,i=h,r=g=>f(g.target.value),e[0]=t,e[1]=s,e[2]=i,e[3]=r,e[4]=n}else s=e[1],i=e[2],r=e[3],n=e[4];let l;e[5]!==s?(l=s.map(mf),e[5]=s,e[6]=l):l=e[6];let a;return e[7]!==i||e[8]!==r||e[9]!==l||e[10]!==n?(a=o.jsx("select",{onChange:r,value:n,...i,children:l}),e[7]=i,e[8]=r,e[9]=l,e[10]=n,e[11]=a):a=e[11],a}function mf(t){return o.jsx("option",{value:t,children:t},t)}function gf(t){const e=k.c(13);let s,i,r;e[0]!==t?({value:r,onChange:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);const n=Math.max(r.length,1);let l;e[4]!==r?(l=r.join(` +`),e[4]=r,e[5]=l):l=e[5];const[a,d]=Te.useState(l);let f;e[6]!==s?(f=g=>{const _=g.target.value;d(_),s(_.split(` +`).map(xf).filter(vf))},e[6]=s,e[7]=f):f=e[7];const p=f;let h;return e[8]!==p||e[9]!==n||e[10]!==i||e[11]!==a?(h=o.jsx("textarea",{rows:n,value:a,onChange:p,...i}),e[8]=p,e[9]=n,e[10]=i,e[11]=a,e[12]=h):h=e[12],h}function vf(t){return t!==""}function xf(t){return t.trim()}const _f={bool:so,str:ci,int:di,"optional str":ai(ci),"optional int":ai(di),"sequence of str":gf};function jf(t){const e=k.c(16),{choices:s,type:i,value:r,onChange:n,name:l,error:a}=t;let d,f;if(e[0]!==d||e[1]!==s||e[2]!==n||e[3]!==i||e[4]!==r){if(f={onChange:n,value:r},s)d=hf,f.choices=s;else if(d=_f[i],!d)throw`unknown option type ${i}`;d!==so&&(f.className="form-control"),e[0]=d,e[1]=s,e[2]=n,e[3]=i,e[4]=r,e[5]=f,e[6]=d}else f=e[5],d=e[6];let p;e[7]!==a?(p=je({"has-error":a}),e[7]=a,e[8]=p):p=e[8];let h;e[9]!==d||e[10]!==l||e[11]!==f?(h=o.jsx(d,{name:l,onKeyDown:pf,...f}),e[9]=d,e[10]=l,e[11]=f,e[12]=h):h=e[12];let g;return e[13]!==p||e[14]!==h?(g=o.jsx("div",{className:p,children:h}),e[13]=p,e[14]=h,e[15]=g):g=e[15],g}function yf(t){const e=k.c(18),{name:s}=t,i=G();let r;e[0]!==s?(r=j=>j.options_meta[s]?.choices,e[0]=s,e[1]=r):r=e[1];const n=D(r);let l;e[2]!==s?(l=j=>j.options_meta[s]?.type,e[2]=s,e[3]=l):l=e[3];const a=D(l);let d;e[4]!==s?(d=j=>{const y=j.ui.optionsEditor[s];return y?y.value:j.options_meta[s]?.value},e[4]=s,e[5]=d):d=e[5];const f=D(d);let p;e[6]!==s?(p=j=>j.ui.optionsEditor[s]?.error,e[6]=s,e[7]=p):p=e[7];const h=D(p);let g;e[8]!==i||e[9]!==s?(g=j=>i(Cs(s,j)),e[8]=i,e[9]=s,e[10]=g):g=e[10];let _;return e[11]!==n||e[12]!==h||e[13]!==s||e[14]!==g||e[15]!==a||e[16]!==f?(_=o.jsx(jf,{name:s,choices:n,type:a,value:f,error:h,onChange:g}),e[11]=n,e[12]=h,e[13]=s,e[14]=g,e[15]=a,e[16]=f,e[17]=_):_=e[17],_}function wf(t){const e=k.c(4),{name:s}=t;let i;e[0]!==s?(i=l=>l.options_meta[s]?.help,e[0]=s,e[1]=i):i=e[1];const r=D(i);let n;return e[2]!==r?(n=o.jsx("div",{className:"help-block small",children:r}),e[2]=r,e[3]=n):n=e[3],n}function bf(t){const e=k.c(4),{name:s}=t;let i;e[0]!==s?(i=l=>l.options_meta[s]?.error,e[0]=s,e[1]=i):i=e[1];const r=D(i);if(!r)return null;let n;return e[2]!==r?(n=o.jsx("div",{className:"small text-danger",children:r}),e[2]=r,e[3]=n):n=e[3],n}function Sf(t){const e=k.c(2);let{value:s,defaultVal:i}=t;if(s===i)return null;{if(typeof i=="boolean")i=i?"true":"false";else if(Array.isArray(i)){if(Ht.isEmpty(Ht.compact(s))&&Ht.isEmpty(i))return null;i="[ ]"}else i===""?i='""':i===null&&(i="null");let r;return e[0]!==i?(r=o.jsxs("div",{className:"small",children:["Default: ",o.jsxs("strong",{children:[" ",i," "]})," "]}),e[0]=i,e[1]=r):r=e[1],r}}const $f=zt((t,{name:e})=>({value:t.options[e],defaultVal:t.options_meta[e]?.default}))(Sf);function Cf(){const t=k.c(24),e=G(),s=D(kf,Kt);let i,r,n,l;if(t[0]!==e||t[1]!==s){const h=s.sort();let g;t[6]!==e?(g=()=>e(Wi()),t[6]=e,t[7]=g):g=t[7];let _;t[8]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx("i",{className:"fa fa-fw fa-times"}),t[8]=_):_=t[8];let j;t[9]!==g?(j=o.jsx("button",{type:"button",className:"close","data-dismiss":"modal",onClick:g,children:_}),t[9]=g,t[10]=j):j=t[10];let y;t[11]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("div",{className:"modal-title",children:o.jsx("h4",{children:"Options"})}),t[11]=y):y=t[11],t[12]!==j?(l=o.jsxs("div",{className:"modal-header",children:[j,y]}),t[12]=j,t[13]=l):l=t[13],n="modal-body",i="form-horizontal",r=h.map(Nf),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t[4]=n,t[5]=l}else i=t[2],r=t[3],n=t[4],l=t[5];let a;t[14]!==i||t[15]!==r?(a=o.jsx("div",{className:i,children:r}),t[14]=i,t[15]=r,t[16]=a):a=t[16];let d;t[17]!==n||t[18]!==a?(d=o.jsx("div",{className:n,children:a}),t[17]=n,t[18]=a,t[19]=d):d=t[19];let f;t[20]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"modal-footer"}),t[20]=f):f=t[20];let p;return t[21]!==l||t[22]!==d?(p=o.jsxs("div",{children:[l,d,f]}),t[21]=l,t[22]=d,t[23]=p):p=t[23],p}function Nf(t){return o.jsxs("div",{className:"form-group",children:[o.jsxs("div",{className:"col-xs-6",children:[o.jsx("label",{htmlFor:t,children:t}),o.jsx(wf,{name:t})]}),o.jsxs("div",{className:"col-xs-6",children:[o.jsx(yf,{name:t}),o.jsx(bf,{name:t}),o.jsx($f,{name:t})]})]},t)}function kf(t){return Object.keys(t.options_meta)}function Ef(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(ff,{children:o.jsx(Cf,{})}),t[0]=e):e=t[0],e}const Tf={OptionModal:Ef};function Rf(){const t=k.c(3),e=D(Af),s=e?Tf[e]:void 0;if(s){let i;return t[0]!==s?(i=o.jsx(s,{}),t[0]=s,t[1]=i):i=t[1],i}else{let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(o.Fragment,{}),t[2]=i):i=t[2],i}}function Af(t){return t.ui.modal.activeModal}class Df extends I.Component{state={};render=()=>{const{showEventLog:e,showCommandBar:s}=this.props;return this.state.error?(console.log("ERR",this.state),o.jsxs("div",{className:"container",children:[o.jsx("h1",{children:"mitmproxy has crashed."}),o.jsxs("pre",{children:[this.state.error.stack,o.jsx("br",{}),o.jsx("br",{}),"Component Stack:",this.state.errorInfo?.componentStack]}),o.jsxs("p",{children:["Please lodge a bug report at"," ",o.jsx("a",{href:"https://github.com/mitmproxy/mitmproxy/issues",children:"https://github.com/mitmproxy/mitmproxy/issues"}),"."]})]})):o.jsxs("div",{id:"container",tabIndex:0,children:[o.jsx(Hu,{}),o.jsx(lu,{}),s&&o.jsx(Gu,{},"commandbar"),e&&o.jsx(of,{},"eventlog"),o.jsx(lf,{}),o.jsx(Rf,{})]})};componentDidMount(){window.addEventListener("keydown",this.props.onKeyDown)}componentWillUnmount(){window.removeEventListener("keydown",this.props.onKeyDown)}componentDidCatch(e,s){this.setState({error:e,errorInfo:s})}}const Ff=zt(t=>({showEventLog:t.eventLog.visible,showCommandBar:t.commandBar.visible}),{onKeyDown:od})(Df),Ze={SEARCH:"s",HIGHLIGHT:"h",SHOW_EVENTLOG:"e",SHOW_COMMANDBAR:"c"};function If(t){const[e,s]=window.location.hash.substr(1).split("?",2),i=e.substr(1).split("/");if(i[0]==="flows"){if(i.length==3){const[r,n]=i.slice(1);t.dispatch(Ut(n));const l=()=>{const d=t.getState().flows.byId.get(r);d!==void 0&&(a(),t.dispatch(Ve([d])))},a=t.subscribe(l);l()}}else i[0]==="capture"&&t.dispatch(Vt(xe.Capture));s&&s.split("&").forEach(r=>{const[n,l]=r.split("=",2),a=decodeURIComponent(l);switch(n){case Ze.SEARCH:t.dispatch(Ri(a));break;case Ze.HIGHLIGHT:t.dispatch(Ai(a));break;case Ze.SHOW_EVENTLOG:t.getState().eventLog.visible||t.dispatch(Gt());break;case Ze.SHOW_COMMANDBAR:t.getState().commandBar.visible||t.dispatch(Ji());break;default:console.error(`unimplemented query arg: ${r}`)}})}function Lf(t){const e=t.getState(),s={[Ze.SEARCH]:e.ui.filter[ve.Search],[Ze.HIGHLIGHT]:e.ui.filter[ve.Highlight],[Ze.SHOW_EVENTLOG]:e.eventLog.visible,[Ze.SHOW_COMMANDBAR]:e.commandBar.visible},i=Object.keys(s).filter(l=>s[l]).map(l=>`${l}=${encodeURIComponent(s[l])}`).join("&");let r;e.ui.tabs.current===xe.Capture?r="/capture":e.flows.selected.length>0?r=`/flows/${e.flows.selected[0].id}/${e.ui.flow.tab}`:r="/flows",i&&(r+="?"+i);let n=window.location.pathname;n==="blank"&&(n="/"),window.location.hash.substr(1)!==r&&history.replaceState(void 0,"",`${n}#${r}`)}function Pf(t){If(t),t.subscribe(()=>Lf(t))}var lt=(t=>(t.State="state",t.Flows="flows",t.Events="events",t.Options="options",t))(lt||{});class Of{activeFetches;store;filterState;socket;messageQueue;constructor(e){this.activeFetches={},this.store=e,this.filterState=Ti,this.messageQueue=[],this.connect(),this.store.subscribe(this.onStoreUpdate.bind(this))}connect(){this.socket=new WebSocket(location.origin.replace("http","ws")+location.pathname.replace(/\/$/,"")+"/updates"),this.socket.addEventListener("open",()=>this.onOpen()),this.socket.addEventListener("close",e=>this.onClose(e)),this.socket.addEventListener("message",e=>this.onMessage(JSON.parse(e.data))),this.socket.addEventListener("error",e=>this.onError(e))}async onOpen(){for(const e of this.messageQueue)this.socket.send(JSON.stringify(e));this.messageQueue=[],this.store.dispatch(Cc()),await Promise.all([this.fetchData("state"),this.fetchData("flows"),this.fetchData("events"),this.fetchData("options")]),this.store.dispatch(Nc())}onStoreUpdate(){const e=this.store.getState().ui.filter;if(e!==this.filterState){for(const s of Object.values(ve))this.filterState[s]!==e[s]&&this.sendMessage({type:"flows/updateFilter",payload:{name:s,expr:e[s]}});this.filterState=e}}fetchData(e){const s=[];return this.activeFetches[e]=s,ne(`./${e}`).then(i=>i.json()).then(i=>{this.activeFetches[e]===s&&this.receive(e,i)})}onMessage(e){switch(e.type){case"flows/add":return this.queueOrDispatch("flows",Mi(e.payload));case"flows/update":return this.queueOrDispatch("flows",qi(e.payload));case"flows/filterUpdate":return this.queueOrDispatch("flows",Vi(e.payload));case"flows/remove":return this.queueOrDispatch("flows",Hi(e.payload));case"events/add":return this.queueOrDispatch("events",Ss(e.payload));case"options/update":return this.queueOrDispatch("options",$s(e.payload));case"state/update":return this.queueOrDispatch("state",Be(e.payload));case"flows/reset":return this.fetchData("flows");case"events/reset":return this.fetchData("events");default:Ct(e.type)}}sendMessage(e){this.socket.readyState===WebSocket.OPEN?this.socket.send(JSON.stringify(e)):this.socket.readyState===WebSocket.CONNECTING?this.messageQueue.push(e):console.error("WebSocket is not open. Cannot send:",e)}queueOrDispatch(e,s){const i=this.activeFetches[e];i!==void 0?i.push(s):this.store.dispatch(s)}receive(e,s){switch(e){case"state":this.store.dispatch(Ue(s));break;case"options":this.store.dispatch(Yt(s));break;case"events":this.store.dispatch(Ki(s));break;case"flows":this.store.dispatch(bs(s));break;default:Ct(e)}const i=this.activeFetches[e];delete this.activeFetches[e],i.forEach(r=>this.store.dispatch(r))}onClose(e){this.store.dispatch(kc(`Connection closed at ${new Date().toUTCString()} with error code ${e.code}.`)),console.error("websocket connection closed",e)}onError(...e){console.error("websocket connection errored",e)}}class Mf{store;constructor(e){this.store=e,this.onOpen()}onOpen(){this.fetchData(lt.Flows),this.fetchData(lt.Options)}fetchData(e){ne(`./${e}`).then(s=>s.json()).then(s=>{this.receive(e,s)})}receive(e,s){switch(e){case lt.Flows:this.store.dispatch(bs(s));break;case lt.Options:this.store.dispatch(Yt(s));break;case lt.State:throw"unreachable";case lt.Events:throw"unreachable";default:Ct(e)}}}window.MITMWEB_STATIC?window.backend=new Mf(Nt):window.backend=new Of(Nt);Pf(Nt);window.addEventListener("error",t=>{Nt.dispatch(hc(`${t.message} +${t.error.stack}`))});document.addEventListener("DOMContentLoaded",()=>{const t=document.getElementById("mitmproxy");Pl.createRoot(t).render(o.jsx(Ol,{store:Nt,children:o.jsx(Ff,{})}))}); diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/index-DhPPoJ7G.css b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/index-DhPPoJ7G.css new file mode 100644 index 0000000000000000000000000000000000000000..4e0da77b11ed4252fdf0deca4f943ffd558a47e9 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/index-DhPPoJ7G.css @@ -0,0 +1 @@ +html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.resource-icon{width:32px;height:32px}.resource-icon-css{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADtElEQVR42uWXaUhUURTH/7MoNq6Nhjpq0WSlMplOvgm0TWMUkTawsMUSqi9FtCBhEYFUFPSpCFopqYjMyqGopBRDmCidcKBSwyWX0Q+aKw5U6Ez3XnqPyalX7zFR0IHLvfecu/zOOffeN6N2u934m6Im5d8BUCgUKq1WyyUnJ0dRm2dxuVwqpVLpR2s67pue1Xzf00Zq5RSdqq2tze5wOM6LRUBJUqKtra2thAwhc39YCASrNRrN9j+VAn4TUQgiAb4G8NpEDIKInyQAq9XK6sHBQVZzHIeOjg6+7wWQl5cnBsFSLAkgIyPDSxcdHf3TfE9OTvKRkA4gIRLCBmlpaXxEhE087UajkdYUmre5RAAkRULYUKfT/SwC9FrzetkRELzX6/VoaGjg1XRRAYQKeT9gMplEDyQRhUQA5r3nIfM+9eJ9CQDy7/fv2iR9C4RJz1pv40XXE6IAFsflIEufz/Q17RV45XgKauB0ZiyftY7pn3feh62vmg7HoqgsLIld7Qng9gIQ89ry7hIsTZexkyuFm+iuvC6lNrZO+ZszKEo9QklRZj8h6O82n0OhoYTtdPPtKWJ2IV23SkiBJIBnbXewMfkATDFmIaTjX8bg/DIKjX8wNOogJEaYED4tGgGqIOJ5DTR+IQgg+gRtGrSLojCNtPm5kgH6x3swQxMj9DkCQtpE70Dth3s4/WIX2TAYSQQiR18IY2Qm6rorcaZhL9PPJxDmWRsx3T9SOAOSAAL9QzD+eUTov+1/yTZfNnMtTmZVonOkGU0D9ajrsaCq/Tp2LDyG0iXl6BptQcuQDdbeh3jaeQtFSUclAfAhY6F/+P4qEiI4OD+PoazxOHLjt+Fxaxnx1ILD6deQPXszOkeb2ZyqjhuwOh6gmLuIlXEF6CYg+LaWrAjkJ+1Bxbuz2P1oBdPnztmKpXFr4CTnoN/pwP7qbKpm+S5ILGb5HnD2oqRuFdPPm25Efvw++QAadTAKFxzCFkPJd3c7QBWITUkHUZBQ7HX3N8zbj/Vz93m+AzIBxB8aqXZ5APX19aw9NDTE+ikpKWhsbPxuwdDQUAwPD7M++S2J8PDwH0HIe4g4jvPywmw2S31y+TGSAVix2Wy0plGgen5BwWO73c7aYWFhbAwRoR8bG0vb9Esp6yVkJTU1VdTbzMxMEbu8FPju4Hmn5ZOEh8g3EFNk9FcAbiJOg8FwAUAMDQZ8I0pSekn5+CsAl1qtbp2YmCgnv+cCWc58IwrqGIDnogBkEPW4j5b/5t/xV4iXgWA3JaZUAAAAAElFTkSuQmCC)}.resource-icon-document{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADfklEQVR42u1WS0gVURj+zsy9Nx/lq4uvS1nWplCxe70usghFskKEFhK0MRCKFrWoRYt0E7iIiKCN0SaUCFwZQRg9sBZWKmQaEpGJULdIrlrm46ozc5pzdMY7M9f7GO+uPvj555wz58z3f//5zxn88yAwQszJyfGXlZXlA3CEm6IooiAITuYJIeJaP/daO3xM9YKpTxwbG3sfCATaEQYHjBAopTm9vb3dsAF1bkRTSXCflpbWDBMEJAfsIxuZTkJFCkxwIAr6+vq4n5qa4t7v92N8fFxrW6L2+XzauNbmPi8vj3sVzoQIVFVVwYyCgoKocufm5m6YAq64fQV06AtWVFSER8zMMO71es0KCJtVwCJ9YWFhpGgjGedmS4Hi4mIMDg5CA8vtwMCAToRBLV8Eg0FNAd4uKipKngINDQ2GaOrr65mPXnrWPUDslKG2iMGWpfW+pZUNS89gdghYFvk+I+HygzlcvD/HPyLLCs53hnD7+TLmQiYiJmOINwUWOccnJdzoCWFhiYLBvZWES4sP3ygudUnYmwucOQhkplhToYLGQ8Aw6dMPCW2PFmDG0RJRf8+/i2BwgoJhbBJoeQh4soDmKorsVOMeiJvA4rKCc/fmYMbZIw54iwiwHh2P+HQl8HSUomeUgCHwi+DaYxEpTgGtx5bgFKLuASuB2UVrzu42ueDdCdAI+RWJgrr9Mq6fXEE4QisEf0Lr5Ro3gTSnYo2+Yxlvvihs40WsiiejAq50G4/77FS2lpzQJuRsXSLlEU8EFdx6JqkpAUfHa0U1oNFHcWjPago63wp499UYS2GmgqbKRWRs0UoyfgUMdbwjm+Jmo4CrJwhSXdDx4iN7j6th+Pju7TJa6xZw4fA8trlkW2UY8RTLz6Bqfil+zlK0vxKwKPEy1CPbly/j1IElpDgsczXbFAHd3OkULcdlrMhY61PQVr8AkWiqWY5kWwRi3nACWL/2zJSIei/YO4j6+/u5n56e5n3l5eUYGhoynJRZWVlsnD+XlpZiZGREj7akpGRVNbebzU+UAP/hsERSW1sbNdLq6upoCpBECLA7X1eAwbQYj3h4eBgMTImZmRltnLc9Ho+mgJ0U8J/KmHd9TU1NtHG9vYZQPARi/VolNG7C71gEqIp5dfPcAeBhYiA5EAAEAARjEVAcDsdnSZK6CCHpPGfJAWGBAXiJ/zDhL423UWlXBx5dAAAAAElFTkSuQmCC)}.resource-icon-js{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC2klEQVR4Xu1XTWgTURD+3u4Gbaymbi8mqSL1IjYuScgWJBd7KCo9CQpFj17Eqz2IdxXvih710IMXFbwVJEWoQlpIqIKCIVVIvdik2tKa2maffY8+SLKdJs9UevGDYWZ2dne++clulnHOsZcwsMew6h3GmGnbtus4zhERqxfP80zDMAJCi/O2jkut/PrYpjaajpmFQiFfKpUeEQQkDM65nclkXkAf4JxvK5skpA4Gg9f+1QhEElIUCQD7/SPoDNtVSgqAgBaBqakpqcvlstSu66JYLCrfR2BkZGRHEgAMLQLpdBrNCIfD5LxrtRrdCX0CdCdUglQqpTqikjTEk8mk0IK0inkkAd1OqISRSITsAGNMHdfoAFF9f38/pqenoSBuqogI2LaNwcHBHRcSAKMJ0NXXLxmx9aTfkoCxC7/vdkXrXVBfgT9xKQP+8Ym0sfQFxtubsCYuw3w3Br40RxIEwNsh0LJS/j0HNvdS2ubEJcEW66duSL3v9Sh1bdsjaNFuNVdImy1/hdd9DLXgUVSdW6im7hHX6hEgSSgNSBu/47cRyN1F8FUaXZkrYOVZ8lofdAhgfhLs01Nxo4YOrJ28juWLs1g98xC1wzF0vb8PozLb0RJuu3hYyMP88EDafO0HeOCQtLufn4ZVGMda9AKqx0eJAmgCFvzwtVvaJ66CfXuD4HhUzFxULOOryTuiaik8EMLKwBjWQwPEg0iPQCMJ6yBWz477HjTVyHn8Cp9rTOYvoMMdoJdSJ67fgWw2K+1KpSL9eDyOXC7XUFEoFMLi4qL0HcdBb28v+ZcMANci4Lqur5XDw8NUAiXUUmsTkDIzMyO06IK6ifRVxfl8Xto9PT3yHAHl9/X1Sdu2bUWMaRNIJBI7Vjs0NETEOx8BJX8V30K1LQL6Seh4E362IsA3sRKLxR4DiALwdvETcB7AQisCnmVZnzc2Np4xxg7Ime0OmCgMwCSa8P/r+A9UZe+5GbcPsQAAAABJRU5ErkJggg==)}.resource-icon-plain{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAA7klEQVR4XsXVPwrCMBgF8Jc/BdGtk+AVxM0TeSi9gpNH0CO469pOXRwKDvJ9KgohCeFRVPxKqW/Iry80oMeH8zXA1cvFFP51ibOVOOPg4eCfz1cy9v3LnY/NOgas1vsdiqPhgkAxXg3agkATAqMEIO/OCFQpwIvHgM0BXnwoYOPlUYb8uEG6JMswZSBdEmcCkOIhhfGF4oQIhs/ezYnSFoQVD5kBnAAYkBMc4MV5A07wLXCCA4QgACeEHiROEIAR9CRygjbgH/HKD1Ihv+eSAqr9fIMZBHwsGnQpIP5025oJFHyM9jhkQNei/cu/8x2MBu0IhSW4oAAAAABJRU5ErkJggg==)}.resource-icon-executable{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAvdJREFUeNrkV72rE0EQn9xX7nxJkZDCh42iEp/GKMrrtFLwA0RU7CWdvMpGxH/AToSHaCGoYKPYWGhto4UgBhUtTBk7BY35vlzWmc1tuNvcVy6RVzgw7Ca7M/PbmdmZvQxjDLaSFNhi0rw/MpmMWiwW16vV6nZ3bcrj8VhVFEWnkfa5//NR/Pau4ahI/6mNRqPebDbv+RBQCAQj6YVC4SxLSWiMOY7DRqMRs22bDYdDNhgMWK/XY91ulwzUvPaItWW5Eo2DrNzLtI5kRoYgDclGokCQh5cGIOqkEQCUpQBI4u5/CgBvQ6TxsHXCnhgACWBGA2Y0V+omUSIPiOKG1w9UVeWAwupOKAAy3u/34cHDJwsl6eWL58AwDA6EMCUGQCfvdDp8fvLUmVhDdx+9gI0r531jedWAdrsN+Xyee2MuAORm8gBR78/PWAC1S8f4Pu/45u07wAIElmWBpmnxpVgOAVYyPl8/eiQ0T8Qo8oTkxEgAsCJO84i2JgIglHk75fGNx4CdAFTDATXrgGY68Orm1UBgp68/h5e3LsyASxwCIeDNfNV0DWdHoFk0H3Hl7z/UfbIH1vaBVepNZcVBFgagb7P5qVUTARAbEwCHqwen+4T7c6vtmfCEvTsSAzDyNj819wAa13SbK61//OSTLe/dA/niL58HZF2xAOSCwj2wMpwYNmxunJiUVvavzXjg9olrYSFI7gFZyLCGE8McAM61SWZ//vLVJ7t7106frJSEkPoWPKvd8CkTV42STr5+Xtm4EChJcyCqYMnsDV+qHBCbRRO5s3k/dS9we8D8hYjHHZvIoUoZWq0W4LvOdzJ57o05McnmcjnQdT0dAGoepmlCqVTiikQ5DWq7QQ8ROjmByGaz0/fBXIWIABB6Mk7NhJIr6KRhryG3+6UPASkh5ASCOtk8j88wTyH1ExeitO8+eV2i33EA6PuiU6lUKO13BL3hFvgE/I78Iw7AGN39DRPuKcZwJShmKSlDB8PxddDC//11/FeAAQBAYeksv+aJbgAAAABJRU5ErkJggg==)}.resource-icon-flash{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAztJREFUeNrkV79PFEEUfjt3B4f8CHcxQSOJwURp4GxOGkoSSPQvoCKxI3RUFFpqSei0VwpDQwJ/gB1HYowxpw1YcUTxNEiA29vdmR3fG2bMsizHsnuEwkkms7szO9/3vvdjdi0pJVxnY3DNLRu8sSwrUywWH5VKpVt67l/3fT/DGMvRSOv0czWa++Acjiz0LLO9vf2pVqu9OsWAXGA6tlyhUHgsEzYEk0IIyTmXnudJ13Wl4zjStm3ZaDQI4GkQj3q2XVIiOIQ3D3aax5Zv6YIkLQzSigQp3DYCrSxtQYC1hUAcua+UAGZDS/Dz5ol7IgI/enqgoQuWS7vQhnSNo7As4AgqPA88muvoUHN1nHtSr7dHAQc71/Q9TYRGesZdF2whAAYHQSK42NkBSQr09Z1xBZWaRJXQgHkBFQR1BHf6+2FgaQnK1SrcX1yEJiqBaGpjIhDsUQSycQJOgYVc4HMOzXwe7i0vw92pKeB7e/C9sqEQfLPurAIQm8CpwNIWc+17UqOJBIpzcwq8vr4OH2dmwPmzD6yzU63jERlB28ZyQVg6B18m+YkEBZpAcNnbC4Ozs2rH/cNDyI2Po8AMXHoH11oB8Eu7ICyd0OBcm4C1HromJ6F3eFip82B6Gm4UCrCxtnayQSYDPmZHcJ9UBHggC4TjQAPHIbSedvv28gUcV7/Aca2mgPHkO0nHNDEQftEz0uNzG9NrYH4ebk9MwO9KBb4+ew42rqHzluVy4CIB8ivH1ExMIBw8ZA1Hy9noKDxcXYWbQ0Ng7+7C1sIC+JgJOUw9gbnf1C5SSoVccB4B1koBEzxkPQWihRHejbn/8+0b+IAxUN/cBIYETHCCdpWJlYg6cHkXqDqgwW0sNpVyGdyjIwVqZbPQxGsfrbd0qkrdRbtigK6PtIU+Sk2u8BGYgo2TzEZyE3g61A8wNSPqQLIg/Dw2pgqLySFxEihgKovQcWKOO0ZzXV2nXHleIYpFYHZlJdE3QEQdSEYg7idXjE8yKxWBtCRSK5CGhG7NRIUoDYlQO7iIAP1fHI+MjLzG6ztR33ApfgF3sf+6iACmeHYLT7t3mOfdUT5L2CwyDMf3URP/99/xXwEGANgxwaTRsGhXAAAAAElFTkSuQmCC)}.resource-icon-image{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3JJREFUeNrkV0trE1EU/uaRJjZN0iTWthZaq1hclEgXRcGdbsSFP0LwX7jwV6i4c6l/wIUI1qIVIigKSjVUKE3TmvSVxkzmced6zkwS0jS0maTShQcOd+5j7vnudx5zR5FS4jRFxSmL3tpRFEVLpVLzmUxmrD7XVNd1NVVVQ9zyuvq41zb6rXPUqm1jWi6X+7y2tvb4AAJ2QUNJQslk8o7sUciYFEJIx3GkbdvSsixpmqY0DENWq1U2cK/VHqt+UlSScbRv3qo8TxI50gW9SLuRo0AwwycG4KiTHgFAPREA3dD9TwFQNhxgop2Z9mcKRlBQetgDAbAsgdXNvU4cgGOK93el23Z6Zkg05zKXxz3A9SAMxsB6qYwHj155G2iqxGBEoGqqMC0JyjbYQnit4wh6duGwOq43zi33s8/uN93GpSYQAF1TcXZ4EAMUu3NXKrh+NY1f+SLefQqjUNR9g6SC1CaDwvXb5phwm27oCQCVPgwPRTA2UsOtaxdxPj2PydE8GXiPhWzMM+IbIxaYjVoZwiZ/6wkPjHMYAAIBUFUF8WgY0bCg53pwURPWNSRoXLjsc+kBYYN7Wx9h7heRvHATNtUccRiA7AoAL6b6TSoRI0O2E8KXHxswL7zExpaB9WKSgEUoyHwAvL68tYrqTh6VSgVG7i0m5+4eyIZALuDFmqZ5DCSifvXc3plGtmwRrTqFMrkm1oh6Ckai/dviImoWB6EDZ3cdo6mhAwUrMAAvdYjCdDziseHLGX9D3tj105H9/GHhNbZLm0iNjKNWLePc+BTGU9FOHzt0DYDFNC0sZb/7sBlEw5/U2HRSo2bDMmvYWFmGMpDEzm4V6kAce1UNi0tfvbW3b0y3MtAdgAZirl6/S0WPAS/YaBPLcjzj3G9mS2IGO6U8nb5CzGlQqK2IZQzF0+0uCMaAUTORW1ntqjwroTj0SAj7uxuwLQO2SwXLRn8AHMdGaasU8I4Vg206VDEFDKvUOwB+KUT5PjWR8tNXtiZxa7/TXLzZ5334YxQYAOvMpUm8ePqw669ep76u6ygUCsELUblcDnTb6fJKJgO5oBcjx1zJlL4A9Auibwb6AVGXWteF6KRAtMnecQD4/+LP7OzsE3qe6HSH6+MXME9aOg6AS2nzk75oz6n8Rjv5rEdR+GCkbzpN/N9/x38FGAA04HAMRDx3awAAAABJRU5ErkJggg==)}.resource-icon-java{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAv9JREFUeNrkV81rE0EUf7NJaEpFSSChYooIxVPJwQ+wJiePHsWb4sFrT/4X0pM3/QcExZsnEUETWpFSSQULral6SUGw0Gya3c3X7vjebGa73W63m0mgB9/mZXZnJvN+83sfmWWcczhL0eCMJel/YIwlstnszWKxODsc89RxnISmaSlqad6wX7Ty2T+GrRboS+zs7Gw0Go3nRxCQC6SipDKZzF2uKGiM27bNB4MB7/f7vNfr8W63yy3L4qZpkoHHfnukyUlRicYhuLhfaRwlHekCFQkaiQJBDE8MQNROIwBoEwEQh+6JA6hUKrGAYRBCqVQ6CYAzFgNlXBiYSFeZtp5hTFFYX/8KzWYTVlZXYPHWYiwGtJF8jpf4DKunbMk4CaYelMtlcGwH1tbWBDC/goCvwIDfr4IBzgQYYoD6JBOGYUC1WhX35IpgLCgB8C+CX/D5+2+YTk/hSswDJ4Dglc5dhvn8OcACBD/q9TAAEBtAMKq9xewBXLs674Ez1l/CzI0Hwg0rtS2YvTgrxra2t49lBAgHxoiBoO/8C1mdLmCpFf7WPz6DvsPA2Hwn+mgsjL2oGIgFQKYXbcK0LEEx1nhw0Ch8ewX23G3AWi/GJNUyBvwgYsdAWCGRfQYa6nQ68LZag9TeFPALDyG/+Qt+7v6F89NJESfctwmlGDgJAC1umi4DhXwGaq0rwHoMCgk3JGnM9TSPDUCLSju/ko+pf4DUtswuag/mclko5DLwZ9+A+3eugy1TFT80P6QOjMZAGBP7egs+fNk4FtBv3q+C3m57tSLs90oukPe6rguTTx7dcwsPqmhA3rsqY4DmTxTAwcGBuzhzN88kB6IyHuWDxmh+SB1QC0J6pjQTVQ8v7lk8RHMIwu2j+UFXhhWi2FnQRv8+XV5WPjcMg1AdwNLS0sgHEeU/oyhDqqehsV0wLoihdGIBGHengcDzi34aAHq/MBYWFl7g/aWwM9wYr4C7qHunAXCSyWQdy+hrLCozYT5TFEYbw/ZT2MD//Xb8T4ABAGtLxURbEDriAAAAAElFTkSuQmCC)}.resource-icon-not-modified{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA9JJREFUeNrkV7tLo0EQn++7JGJUjMYHGgUxCioiiohgJ2gXtLAxKNeICIJYyOE14vkHCNdZKGojWGqRTrGIxSGKnkUKH+DrLMRLoha+YnI7w7d7m3e+zwOLW1hmZne/md88drJRIpEIfORQ4YOHSRYURbEUFhZ+bmpqcjLRzKZFo+ZwOGxSVdXC6Cd2zqR9+wn3mIzUpO0hj1TV1lRtTT05Ofl5dXXlTgoAZZYSx9bW1lcj3mA6E00GgqjVav2RMgLvGdxIKhBsWHUDuL6+hvLycsFnZ2fDw8PDXwUmE7y+vgojubm5tI9yfn4+5OTkCBBaSvUBmJ+fh+npacEPDw/D0tKS2B8aGoLl5WUhDwwMwMrKStQ+AtEAqIZuwcXFBU0ceXl5MDU1Rfz4+DiUlpbC2NgYyZOTk2QMx8TEBFGMBkZGS4FqqAZkj0mLqvJbQzyXkeIajtnZWaJlZWW0rkUgbAgAT8HMzIwoOF71kneiEHGMjIyI/Evr6rtvgWyEG5cBcJ5dubibgUGL1afIrZiFz1pQUPDF7/d/42uPj49U+agM+aysLFKGvMViEcpj95CPBVBcXOxh1KUrAqjo7e2NFKBBrpQbl+VYPkEEIOMU8I8CgQCcnZ1BMBiE2tpaKCkpEXt4M5A6HI64xsNaLtjtdjCbzTKASEYAZOTr6+u0htdrcXER+vv7obKyElZXV6O86uvrE9/4fD7Y3NyE3t5eamJS3Si6AaBintvz83OKBO7f3NzA6Ogorc/NzcHl5SUZOz09Ba/XS/1CTpFWnEpGjUiubszn4eEhGUEgTqeTQLCCEmeKiorg7u6OQG1vb0NPTw+1ZFlPshpICwAn5rijowPu7+/h+PgYnp6eonoA8ri2trZGjQf5l5cXuL29JV6+nhkBkJXjxHDW19eT9+gpeoxg+D62Wyw4nMjv7e0RPTo6ijqX8S2Q87awsAANDQ3kCXtQQHd3Nxl6fn6GjY0NOo88e8iAy+UStePxeKC5uRlsNpvxFOBH7e3tQmlXVxdUVVXR1RocHKQ843S73fSzLEetpqZGdEPDEcBZV1eX8HWDIFpbW6OiJZ+rrq6OW9cNYGdnh3jWmknGkO7v70cpxP6AzQpl9pak9CR7kuluRG1tbXFeYA0kM5DMU6kP6O+Eu7u7RDEK8s8w9/jg4IB4LDY8w/dRrqioIB4L1HAnbGlpSeltZ2dnyv13pSDdM1vPPv91zwiAUSNJvJaHPx2AMPso0NjY6GO8PVHIDA7M/W82f6UDEGINxRsKhfDvlO1fAmCOBRn9nvJJ9l/+O/4jwAATI0GMJl2ikwAAAABJRU5ErkJggg==)}.resource-icon-redirect{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABDhJREFUeNrkV01MG0cU/rzsruO1zRo7xrGxCkqqkhACRogLVRtxoFWbVo16q1AiRQhxQqhCEbkgyqknpCSHXDjABfXWVqpIpFYVSKhqhKhMkjahqiM1xBiigJfUgBNs7M4Mu9s1mPUPkXLok0bvvXmeed97b97M2pLNZvEmicMbJt6oWCwW0e12X25qajpFVIEMUeVCJpPhOY4TCa8gv+PVtRXURnTKedVGZco5dY5T57hIJHIvGo1+cSgAqpOS1ExPT18rJxpaznyDgGBckqS7phk4CmlOzEAQkkoGEIvFEAgEdNlmsyGRSPy3Ac8jlUrpThwOB7NTXZZl2O12HYRa0tIAjI2NYXh4WJd7enowPj6u27u7uzExMaHrXV1dmJyczLFTICoArqwuWFpaYoOS0+nE0NAQk/v7++Hz+dDX18f0wcFB5ozSwMAA4zQbNDNqCbiyzoAxYrYLx2ldw2RNp5zOURodHWXc7/ezeTUDmbIAaCUYGRnRD5x26g3R6QeRUm9vr15/wzx35C4wOtGcGwFoMmm5A51Bk7Z/P4vxKibpk6qqqq7G4/GvtLlkMslOPt2MylarlW1GZVEU9c3326i8H4DX650i/JOSMkA32t3dZRtQh9qmmnOjvl/OkwEUXQJt0cvtFJb/VLAW3UTtOTfcAUm3JdZfYiXyD062ugvegiqAbFFtaKzt/Z+f4rfbT5izqZsP8GBmmc3f/e5v3Ln1EKuRF/j26/vMblxnzIDhbFiKyoAR9dnzfoQ+DKp6BuvRLWZ/NLuKi9fOwe4ScPvGIyz9oWAnuctG6KMTUFaSuHdnBa2fBWCT+fIB8FYOa08TmP3mMTbjr3DhywaS9hd7J13duOZMJXNcG5Lx063HkH0i/vo1Dv9pB45VVuR0TskloENyiWjuDMBeZSWRPyNzuW2ogZVkgUTsx/z3MbKGR/177gOtWhQAY93o4K0W1DTICJ6VEV/ehnzCunfNxvfqTtOtrdna2IFAsra1kcKr7XRBAKYloHxmIkIiFyEc47D4y3PUtx9nDrx1doSnaKQCYosJnH7fAyWWxOLMGtovBfH7j88R/uEZWj+vNm1D0xLQRe+86wVPnG8qO2j5OICGjmpmO3+lDv56JzsjH/SdhLNaxMZqEqFPfXB6BTRf8JI5AVtkXdkZYLdXnYTjtba8ff1Wc2VOtmoaHbpsdXJ4u13OCaZkAHNzc0wmVzPTQ6EQwuFwTkrp86soCtPJtyQ8Hs+hl1G+i8gUQFtb24GoOzs7TW+7fJEaPsmyJZdgfn6ecZoF4zOsRbywsMBkl8vFfqPZqR4M7l1g5Ev70NewIICWlhbTaDs6OkztRypBMQ9MsXbtdS8KQLlODonaSPFCADJkkdLY2PiQyJ58KSuTaO3XyVguBCBNvvNn0+k0/Tvlep0ASGAbhF83/ST7X/47/leAAQBGWDbA0N7wPgAAAABJRU5ErkJggg==)}.resource-icon-websocket{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAkNQTFRFAAAAAAAAEhISQEBAQEBAQEBAQEBAQEBAPj4+QEBAPj4+Pz8/Pz8/Pz8/Pz8/QEBAQEBAPj4+Pz8/Pz8/QEBAQEBAPj4+Pz8/Pz8/GxsbAAAAERER/////v7+/f39/Pz8+/v7+vr6+fn59/f39vb2AAAA+Pj49PT0AAAA+sr29fX18/PzAAAA/7/5/wDm/w/n/b33/Kz0/Jzz/xDm+nvu8vLy8fHxAAAA/9/8/3/y/Nz5/Lz2+7v0/h7o99f096fw+Ijt8PDw7+/vAAAA/x/p/r74/o7z+9z6/V3t/1/v/6/3/z/s/Y3y/X3w/i7o/F3r9dXy/3/x/k7t/l7u/X3v/U3s/T3q9+f2+1vs9pbt7u7u7e3tAAAA/2/w/zDq/m7w/Ezr9NTx/R3n79/u7Ozs6+vrAAAA/n7w/j7r+5vy+qry+nrs93fq8bHr6urq6enp+7v1/h/o+bnz+Ljy+Jju8uLx+zzp87Pt8NDt/C3n/g7m7Nzr6Ojo5+fn9ub19eX09bXu8eHw+zvo8pLp5ubm5eXl7s7q76/p4+PjAAAA5OTk4uLi4eHh4ODgjY2N1dXV0dHRi4uL3t7e39/fhoaGbm5uvLy8uLi4hISE29vb3d3d3Nzcg4OD2NjY2traurq6tLS02dnZdnZ2yMjIdXV1gYGB19fX1tbW0tLS1NTUrq6uw8PDwsLCwcHBq6ur09PTiYmJysrKxsbGiIiI0NDQAAAAAAAAAAAAEBAQERERERERERERAAAAAAAAFBQUEBAQERERzBhqngAAAMF0Uk5TAAM4UFRYXGBjaGtucnV5fICDhoqMkJOWmWkFSv///////////2L//2r///9v/////////////3H//////////////3P///////////////////////////////90////////////df////////////////////////////////////////////92/////////////////////////////////////////////////////////2xdBD+XsrBJAhpAS89MUjoAAAIASURBVHicY2CgBmBkYmZhZWPn4OTi5uHl4xcQFBIWERUTl5CEKZCSlkEBsnLyCopKyiqqOBSApdWUVdQ1sCoAalfUBEprqWvroCjQ1dOV0deTNdAzNDLW0zNR1zY1M0dRYKFnKaOnZ2WtZ6Nva2fvYGrm6OSMaoWepa6+i6ubnrueB9gCdBNkXDy9vL19fPWU/PT8A7SxmODtHRgUHBIaphweoacX6egUFR2DqiA2Lt4XKJ8AND0xSS85OiU1DUWBXLpeRmZWmG02yPQcvdzUvHxkBUDfF+gVFhXr6ZWUlpVXVFZV59fUIlkBCjwbPb26ej29hsYmPb2q5vyallYkE6BhC3Z7VEpbO1B7S2tHJ0KBEiRsQdJAx4Gluzq6kRRAQ8YRJJ0HMh0o3dOLpABiem1fP0h6wsRJIOnJk5AUgE1vmTJ1Gsj06VNnzARKz5qNpABkeuuUqXAwZ+6s2TPnISkAuX3G1PlgtwNNXzB1zux5C+ciKQA5bsaiCWDHAU1fvGTpvIXLliOFA8jtvXMQVixdMXfZ8pVIIZkHctykOVNXrV6zdu26qUsnLFvev3I9kgmQkJm5YSPQ7TM3bZ4Akl4xAckEaMhMBrl9Ich0oPSWLVsRClohITNrNlgaqB0ovWXLNpiC7Tt27tqNAXbt3ANTsHff/gPSGODAfgbqAACmh/JxEXYKVQAAAABJRU5ErkJggg==)}.resource-icon-tcp{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAeNQTFRFAAAAAAAAEhISQEBAQEBAQEBAQEBAQEBAPj4+QEBAPj4+Pz8/Pz8/Pz8/Pz8/QEBAQEBAPj4+Pz8/Pz8/QEBAQEBAPj4+Pz8/Pz8/GxsbAAAAERER/////v7+/f39/Pz8+/v7+vr6+fn59/f39vb2AAAA+Pj49PT0AAAA/+/v/t7e9fX18/PzAAAA/z8//wAA/2Bg/h8f+9vb/j4+/S4u+Xp68vLy8fHxAAAA/8/P/7+//y8v/n5+/Y2N/IyM/T0997e3+1tb9paW8PDw7+/vAAAA/w8P/9/f/l5e9OTk+Wlp/b29/X19+zw887Oz7u7u7e3tAAAA/V1d/Dw8+zs78rKy7Ozs6+vrAAAA6urq6enp+3t7+YqK9re3+Wpq8eHh6Ojo5+fn9eXl/Cws8cHB5ubm5eXl8sLC4+PjAAAA5OTk4uLi4eHh4ODgjY2N1dXV0dHRi4uL3t7e39/fhoaGbm5uvLy8uLi4hISE29vb3d3d3Nzcg4OD2NjY2traurq6tLS02dnZdnZ2yMjIdXV1gYGB19fX1tbW0tLS1NTUrq6uw8PDwsLCwcHBq6ur09PTiYmJysrKxsbGiIiI0NDQAAAAAAAAAAAAEBAQERERERERERERAAAAAAAAFBQUEBAQERERcTpMiAAAAKF0Uk5TAAM4UFRYXGBjaGtucnV5fICDhoqMkJOWmWkFSv///////////2L//2r/////b/////////////9x////////////////c///////////////dP///////3X/////////////////////dv////////////////////////////////////////////////////////9sXQQ/l7KwSQIaQEvOHw6iAAAB7klEQVR4nK2Q6V9SQRiFMS3TyqVcKhFUrpCCvCYKqSUiuGuoIJorWNxsMW/oLXZFBdwtRXPJ9E91ZoAYXL75fj3PPHN+RyC4jUu5k5p29176/YzMBw8fZWXn5D5+kpdfUPj0WRx4XiRMumKRuKS0TMKU3wCQWCphZC+uAyoqRWISy2WKKhpQAjplRTXAyxoVQG2dQq15RQP1DdDYUP8a3tQ0SbXQrIMWvaE1+QtQCoVtjbiAChg56C4ZCNAOHbifFmSd0HWNobgbenA/LdT1wltjX/9lQFwCA7i+CUzmwT7L0HASIAJVaVlbLSNTqE1gMFqG3o3QABoPVFLJKIyNT0yaAT0fsdqoL3B30DLyKR3A+w9mQM+tdpYyxLZF40x+JHarzc5Of0oAsW01eoMxarezn6e/UACJ1Ro9jokdxV9nKIDY9bZvszjmvjtwPOegAGK3z/M/sP0n73Sh2O2hAGxn5/n/5/W5PS4/BaByFie/QLoj+yLv9fgDPgrA5ZxLHCmH7MsrQX8gFKZ2wN1nvIkvgqu+UHiNWpIs4/Dy6xubW1vbfJALhWfXdihDdBnXr9+ou2t3j8PxKkcZYsvM4e4BbEdxJLKfANjoMm4PidFzFEciB3Hgz+HR8cmVOz76GwdO/52dF1258zPB7dwFbUXIeSfgDeUAAAAASUVORK5CYII=)}.resource-icon-udp{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADb0lEQVRYw+2Xz0tbWRTHP/e9PBMpbckvFKtboZBmN0hLF25cKNLoQtHqaqD/QWEK/Q8GunY2aZCoMEjdtKUgLgak0O6G4q4uGiQkxEJji0nU5J5Z5Nfz+WJeM9nNHLhw7z3v5nzv95zzfS/wXzflWJuhUOiXeDw+DPjsQ2ttGoZhaa1NpZTZ2DcBX3Nt9ymlDMeeeXh4+Hc2m127DpAVDAZnpEfTWkutVpNqtSoXFxdyfn4uZ2dnUi6XpVQqCfCrM6CvX1RqrRGRjkNrDRDoOwBnkOtAAJbzvNHxl9+8AaXg0SP49Kk+VwpOT2Fvr7VWsRjGkyfw/j0igrG3hz8QIDA4yGA8TuDpU9SXL00GDO8AutwagAcPqG1swMuXmI8fIz9+QMMnExNUNjYw1tYYePWqvwCUajePunWrPslmMcrlOjPNZ27frgc5OcEwDADdXwYaxdfar9XaDIjAt2/1ud/fPwa01q0giCA2AM0iBFAfPxKYmkISCSozM00AqqcuEJHWSS2CoXV93W6v+nNatwDJxATFd+/aXfDTAEyzfUs7AEDZUnCJAREMGzvOtnSzjgBkeLgetFhEvn+v7yUSaMvCsAVVxWJrXrMszKbPRRsA8VQDWmv0vXvo16+Ru3cxnz1DP3/O+YsXaPttPnzA//Ahcv8+Z6kU1Zs3rxRoE0SnGlAu74KpQqHwtpOcXie13aR4bGzsN+D3rinoNZAHKfZWA15u04vPzYxObdfMm32USiWSySS5XO6KL5/Pk06nqVQqrmft7eqpCJ0gSqUSqVSKTCbjCiCXy3F0dMTW1lZHEF6+iKxgMDiVyWTe2iktl8usr6+Tz+c9qWU0GmVhYQHLsi6lYHx8/OeLUGtNKpWiUCgwOztLPB6/NucHBwfs7u6yvb3N8vKyUwd6K0KAQCDA0NCQa5HZ9yKRCP7Gy8eeyk5C5AnA6uoq6XSaZDLpKQXhcJj5+fkrTPYMYGBggJWVFTY3Nzk+PmZycpJoNHqJoUKhwP7+PuFwmLm5OSzLcmNS9awDlmWxtLTEzs4Oo6OjRCKRK/6RkRGmp6ddg/+rFNiDLC4uXspvc4RCIRKJREcxaljFEwCv2u7F77CTbgBERE5jsdgfwB23b7gezQCywNduALTP5/tcrVb/VErdcMtZr38BReQU+Iv/zWH/AMyRVKUN0udlAAAAAElFTkSuQmCC)}.resource-icon-dns{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAD4ElEQVRYw+2X3U9bZRjAf+e0p8XJR057KpOCEmJIFkkTQbNME2VGVAwJIxEGwtWyJf4DzsTEC6NRs/0BMyZNhxUSQ+BuN0TJJkOd2QguZFFBYiGspBwyGLaFtryvF6WklH5RuNMneS/O87znPL/3+TrnwH9dlIxri8PheMnj8ZwErOlLCGFRVVUTQlgURbHs6i2ANXWdblMURc3QWebn52eWl5ev5QPSdF1/R5YoQgi5s7MjE4mEjMfjMhaLye3tbRmNRmUkEpHAhUyH1uMKpRACKWXOJYQAKDt2gEwn+SAA7dgA8p00D4BaNMDCwhqffHY3WZkWhWefeYKWZhevn23g4cMNPv18GsPQ+Pij05w4oTE1FeC6f4H3LzUSDseYuBkktBqj5mk7ly6eoqLclhVALXTSF1t0vr72Bs0vGIyMBhj030dRks1jmnFGRn9HUZQ93dTPQfzDf+Ny2bnyxWneaqtFClBVFUAcGgDAalU529oAwC931jDN8J7t9pTJnV+XUiHmwYN/AJj57TGjY3/gdpdTVWVPFaFaEgBAebkdTUuecn19C4DWVw1chsb1b+ZZXNxM6l4zsFqS+27/9Igvr97HNMMpAKUkACklm5tR4vHkKXVHspsqKmxcvHCKREIycWsVgIaGSi5/8DwtzVUARKOCublHRwGQbMcSfP/DAgBvv3mSygr7Xu/X1VVy/t26vd23fgwS296ht+c5XEay63TdlgKg6C5I5fTuvXXuTU9Q6y7jvd56Xnm5jsWl9d09yX1nzrj5c+4x0zMb2Gwq3w7/hbkWp/opjfPdNdTXV6YAZKF3gabreptpmjcO09+F7Cmb2+2+DFwtGIFcDyvGSYFRrBSVglIdFTGKOTLAUSCyiZqrAIUQB1YkEsHr9RIMBg/YVlZW8Pv9bG1tZb03Vxeo+SKQ6dzn8xEIBLICBINBlpaWGB4ezglRzBeRput6WyAQuJEe0mg0yuDgICsrK0VNTZfLRXd3N5qm7UtBY2Pjh8CVQ9WAEAKfz0coFKKjowOPx5M357Ozs4yPjzMyMkJfX98+e8lFCFBWVkZ1dXXWIkvXGYaB3W7fC3u6PdsgKgpgYGAAv9+P1+stKgVOp5Ourq4DkSwZwGaz0d/fz9DQEKurq7S2tuJyufZFKBQKMTk5idPp5Ny5c2iali2SpQ8iTdPo7e1lbGyM2tpaDMM4YK+pqaG9vT2r8yOlIN1JT0/PvvymlsPhoLOzM+cw2pWtogCO+vLJKLx02SgEIKWU4aampq8Ad7ZvuBJFBZYBsxCAsFqtc4lE4jtFUZ7MlrNSfwGllGHgJv9LhvwL9JSHUqlHDc4AAAAASUVORK5CYII=)}.resource-icon-quic{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAgpQTFRFAAAAAAAAEhISQEBAQEBAQEBAQEBAQEBAPj4+QEBAPj4+Pz8/Pz8/Pz8/Pz8/QEBAQEBAPj4+Pz8/Pz8/QEBAQEBAPj4+Pz8/Pz8/GxsbAAAAERER/////v7+/f39/Pz8+/v7+vr6+fn59/f39vb2AAAA+Pj49PT0AAAA9fX18/PzAAAA//Pn/5Ap/4QR/86f/5w//cyd/cud/aBI9/Lt993H/oMQ/3wA9tCu8fHxAAAA/3sA/7Rv/9m3/ps+9+vh9end+LqA9c+t97l/7+/vAAAA/8GH/6hX/4MP/pw++Ozi+7Br/oIO8vLy/Jo8/Jk88PDw/Zs9/Zo99enf7u7u7e3tAAAA/5An/sCG8+fd/Y4l7Ozs6+vrAAAA/+bP/fHl/L+E+dSx+6RT8ebb8tnC7uLW7tW+6enp/rNu+eDJ8uba7+TZ+aJR+Zc55+fn+uHK/LBs6urq6Ojo5ubm5eXl4+PjAAAA5OTk4uLi4eHh4ODgjY2N1dXV0dHRi4uL3t7e39/fhoaGbm5uvLy8uLi4hISE29vb3d3d3Nzcg4OD2NjY2traurq6tLS02dnZdnZ2yMjIdXV1gYGB19fX1tbW0tLS1NTUrq6uw8PDwsLCwcHBq6ur09PTiYmJysrKxsbGiIiI0NDQAAAAAAAAAAAAEBAQERERERERERERAAAAAAAAFBQUEBAQERERO29ZqAAAAK50Uk5TAAM4UFRYXGBjaGtucnV5fICDhoqMkJOWmWkFSv///////////2L//2r//2///////////////////3H/////////////c/////////////////////90////////df///////////////////////////////3b/////////////////////////////////////////////////////////bF0EP5eysEkCGkBLwAnvMQAAAfpJREFUeJytkGlbUkEYhsnKyjJbtXQO60nSNGlz1ElapMyMQIJK07TVVlrAJfWInmI3KkAryxL3Sv9jMwPIy2V98/163/PMcz0KxXrchpyNmzbnbtm6LW/7jvydBbt279m7b39h0YGDaaG4BGWdoFSpNVqdeOg/AselOlF/+J8Cfc5xmb78CBQqKo9WIWQQlMeOa06cFE9V45raOiiQ0/WkHmGV2mgsxWfOknPnG0wXgHCRINR4CWFB2WTU4MvNV/Tl5qwEgwGhKryacNVirrVmJSQFJdZoW2wivmaxWE12x3UgNN5Awk2ixlqdzabHrZY2u+NWewcQbpNOFenSkjsiuWvG9+6TB+0Pu6EgPMIEP9Y1E4KfWPFTxzNCnjvBF2y8Fy9xGetuZemvul+73CAhtS3DJjvHTpe7pzcjpLZlmD7nuK+nHwgcw3SK3wwAIZnuHBxiWBr2MDziAQJPd43Kb1n6O9nro9gfAAJLd4/KqxcM+QO+MBBYd688xrvT9PdyMBCOhIDAynk/SLwcTf/4KRqOxOJgB9Z9IJj5IjoeisUnwJJ8GU9Q/vzl6+TkNzkqxeJDE99BQnIZ39QP2t33c1pieFwCCallRlj3CEunOJGYyQju5DL+AMf0OcWJxGxamJtfWFxac4sLv9LC7z/LKyVrbmVZsT73Fy8u3GKpKoI/AAAAAElFTkSuQmCC)}html,body,#container,#mitmproxy{height:100%;margin:0;overflow:hidden}#container{display:flex;flex-direction:column;outline:none}#container>header,#container>footer,#container>.eventlog{flex:0 0 auto}.main-view{flex:1 1 auto;height:0;display:flex;flex-direction:row}.main-view.vertical{flex-direction:column}.main-view .flow-detail,.main-view .flow-table{flex:1 1 auto}.splitter{flex:0 0 1px;background-color:#aaa;position:relative}.splitter>div{position:absolute}.splitter.splitter-x{cursor:col-resize}.splitter.splitter-x>div{margin-left:-1px;width:4px;height:100%}.splitter.splitter-y{cursor:row-resize}.splitter.splitter-y>div{margin-top:-1px;height:4px;width:100%}.nav-tabs{border-bottom:solid #a6a6a6 1px}.nav-tabs>a{display:inline-block;border:solid transparent 1px;text-decoration:none}.nav-tabs>a.active{background-color:#fff;border-color:#a6a6a6;border-bottom-color:#fff}.nav-tabs>a.special{color:#fff;background-color:#396cad;border-bottom-color:#396cad}.nav-tabs>a.special:hover{background-color:#5386c6}.nav-tabs-lg>a{padding:3px 14px;margin:0 2px -1px}.nav-tabs-sm>a{padding:0 7px;margin:2px 2px -1px}header{padding-top:6px;background-color:#fff}header>div:not(:empty){display:block;margin:0;padding:0;border-bottom:solid #a6a6a6 1px;height:95px;overflow:visible}.menu-group{margin:0 5px 0 6px;display:inline-block;height:95px}.menu-content{height:79px;display:flow-root}.menu-content>a{display:inline-block}.menu-content>.btn,.menu-content>a>.btn{height:79px;text-align:center;margin:0 1px;padding:12px 5px;border:none;border-radius:0}.menu-content>.btn i,.menu-content>a>.btn i{font-size:20px;display:block;margin:0 auto 5px}.menu-content>.btn.btn-sm{height:26.33333333px;padding:0 5px}.menu-content>.btn.btn-sm i{display:inline-block;font-size:14px;margin:0}.menu-entry{text-align:left;height:26.33333333px;line-height:1;padding:.5rem 1rem}.menu-entry label{font-size:1.2rem;font-weight:400;margin:0}.menu-entry input[type=checkbox]{margin:0 2px;vertical-align:middle}.menu-legend{color:#777;height:16px;text-align:center;font-size:12px;padding:0 5px}.menu-group+.menu-group:before{margin-left:-6px;content:" ";border-left:solid 1px #e6e6e6;margin-top:10px;height:75px;position:absolute}.main-menu{display:flex}.main-menu .menu-group{width:50%}.main-menu .btn-sm{margin-top:6px}.filter-input{margin:4px 0}.filter-input .popover{top:27px;left:43px;display:block;max-width:none;opacity:.9}@media (max-width: 767px){.filter-input .popover{top:16px;left:29px;right:2px}}.filter-input .popover .popover-content{max-height:500px;overflow-y:auto}.filter-input .popover .popover-content tr{cursor:pointer}.filter-input .popover .popover-content tr:hover{background-color:#c1d7eb80!important}.connection-indicator{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;float:right;margin:5px;opacity:1;transition:all 1s linear}a.connection-indicator:hover,a.connection-indicator:focus{color:#fff;text-decoration:none;cursor:pointer}.connection-indicator:empty{display:none}.btn .connection-indicator{position:relative;top:-1px}.connection-indicator.init,.connection-indicator.fetching{background-color:#5bc0de}.connection-indicator.established{background-color:#5cb85c;opacity:0}.connection-indicator.error{background-color:#d9534f;transition:all .2s linear}.connection-indicator.offline{background-color:#f0ad4e;opacity:1}.flow-table{width:100%;overflow-y:scroll;overflow-x:hidden}.flow-table table{width:100%;table-layout:fixed}.flow-table thead tr{background-color:#f2f2f2;border-bottom:solid #bebebe 1px;line-height:23px}.flow-table th{font-weight:400;position:relative!important;padding-left:1px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flow-table th.sort-asc,.flow-table th.sort-desc{background-color:#fafafa}.flow-table th.sort-asc:after,.flow-table th.sort-desc:after{font: 14px/1 FontAwesome;position:absolute;right:3px;top:3px;padding:2px;background-color:#fafafacc}.flow-table th.sort-asc:after{content:"๏ƒž"}.flow-table th.sort-desc:after{content:"๏ƒ"}.flow-table tr{cursor:pointer;background-color:#fff}.flow-table tr:nth-child(2n){background-color:#f2f2f2}.flow-table tr.highlighted{background-color:#ffeb99}.flow-table tr.highlighted:nth-child(2n){background-color:#ffe680}.flow-table tr.selected{background-color:#e0ebf5!important}.flow-table tr.selected:nth-child(2n){background-color:#c9dcee!important}.flow-table tr.selected.highlighted{background-color:#7dbffc!important}.flow-table tr.selected.highlighted:nth-child(2n){background-color:#5fb0fc!important}.flow-table td{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.flow-table tr.intercepted:not(.has-response) .col-path,.flow-table tr.intercepted:not(.has-response) .col-method{color:#ff8000}.flow-table tr.intercepted.has-response .col-status,.flow-table tr.intercepted.has-response .col-size,.flow-table tr.intercepted.has-response .col-time{color:#ff8000}.flow-table .fa{line-height:inherit}.flow-table .col-tls{width:10px}.flow-table .col-tls-https{background-color:#00b90080}.flow-table .col-index{text-align:right;width:4ch}.flow-table .col-icon{width:32px}.flow-table .col-path .fa{margin-left:0;font-size:16px}.flow-table .col-path .fa-repeat{color:green}.flow-table .col-path .fa-pause{color:#ff8000}.flow-table .col-path .fa-exclamation,.flow-table .col-path .fa-times{color:#8b0000}.flow-table .col-method{width:60px}.flow-table .col-version{width:80px}.flow-table .col-status{width:50px}.flow-table .col-size{width:70px}.flow-table .col-time{width:50px}.flow-table .col-timestamp{width:170px}.flow-table .col-comment{width:150px;padding-left:5px}.flow-table td.col-time,.flow-table td.col-size,.flow-table td.col-timestamp,.flow-table td.col-comment{text-align:right}.flow-table .col-quickactions{width:0;direction:rtl;overflow:hidden;background-color:inherit;font-size:20px}.flow-table .col-quickactions *{direction:ltr}.flow-table tr:hover .col-quickactions{overflow:visible}.flow-table .col-quickactions>div{height:32px;background-color:inherit;display:inline-flex;align-items:center}.flow-table .col-quickactions>div>a{margin-right:2px;height:32px;width:32px;border-radius:16px;text-align:center}.flow-table .col-quickactions>div>a:hover{background-color:#0000000d}.flow-table .col-quickactions .fa-play{transform:translate(1px,2px)}.flow-table .col-quickactions .fa-repeat{transform:translateY(2px)}.flow-detail{width:100%;overflow:hidden;display:flex;flex-direction:column}.flow-detail nav{background-color:#f2f2f2}.flow-detail section{overflow-y:scroll;flex:1;padding:5px 12px 10px}.flow-detail section>footer{box-shadow:0 0 3px gray;padding:2px;margin:0;height:23px}.flow-detail .close-button{margin-top:2px;padding-left:10px;padding-right:7px;color:gray;font-size:15px;border:none}.flow-detail .close-button:hover{color:#000}.flow-detail .first-line{font-family:Menlo,Monaco,Consolas,Courier New,monospace;background-color:#428bca;color:#fff;margin:0 -8px 2px;padding:4px 8px;border-radius:5px;word-break:break-all;max-height:100px;overflow-y:auto}.flow-detail .contentview{margin:0 -12px;padding:0 12px}.flow-detail .contentview .controls{display:flex;align-items:center}.flow-detail .contentview .controls h5{flex:1;font-size:12px;font-weight:700;margin:10px 0}.flow-detail .contentview pre button:not(:only-child){margin-top:6px}.flow-detail hr{margin:0}.inline-input{display:inline;margin:0 -3px;padding:0 3px;border:solid transparent 1px}.inline-input:hover{box-shadow:0 0 0 1px #00000003,0 2px 4px #0000000d,0 2px 6px #00000006;background-color:#ffffff1a}.inline-input[placeholder]:empty:not(:focus-visible):before{content:attr(placeholder);color:#d3d3d3;font-style:italic}.inline-input[contenteditable]{outline-width:0;box-shadow:0 0 0 1px #0000000d,0 2px 4px #0003,0 2px 6px #0000001a;background-color:#fff3}.inline-input[contenteditable].has-warning{color:#ffb8b8}.connection-table,.timing-table,.certificate-table{width:100%;table-layout:fixed;word-break:break-all}.connection-table td:nth-child(2),.timing-table td:nth-child(2),.certificate-table td:nth-child(2){font-family:Menlo,Monaco,Consolas,Courier New,monospace;width:70%}.connection-table tr:not(:first-child),.timing-table tr:not(:first-child),.certificate-table tr:not(:first-child){border-top:1px solid #f7f7f7}.connection-table td,.timing-table td,.certificate-table td{vertical-align:top}.connection-table td:first-child{padding-right:1em}.headers,.trailers{position:relative;min-height:2ex;overflow-wrap:break-word}.headers .kv-row,.trailers .kv-row{margin-bottom:.3em;max-height:12.4ex;overflow-y:auto}.headers .kv-key,.trailers .kv-key{font-weight:700}.headers .kv-value,.trailers .kv-value{font-family:Menlo,Monaco,Consolas,Courier New,monospace}.headers .inline-input,.trailers .inline-input{background-color:#fff}.headers .kv-add-row,.trailers .kv-add-row{opacity:0;color:#666;position:absolute;bottom:4px;right:4px;transition:all .1s ease-in-out}.headers:hover .kv-add-row,.trailers:hover .kv-add-row{opacity:1}.connection-table td,.timing-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}dl.cert-attributes{display:flex;flex-flow:row;flex-wrap:wrap;margin-bottom:0}dl.cert-attributes dt,dl.cert-attributes dd{text-overflow:ellipsis;overflow:hidden}dl.cert-attributes dt{flex:0 0 2em}dl.cert-attributes dd{flex:0 0 calc(100% - 2em)}.dns-request table th,.dns-response table th,.dns-request table td,.dns-response table td{padding-right:1rem}.flowview-image{text-align:center;padding:10px 0}.flowview-image img{max-width:100%;max-height:100%}.edit-flow-container{position:fixed;right:20px}.edit-flow{cursor:pointer;position:absolute;right:0;top:5px;height:40px;width:40px;border-radius:20px;z-index:10000;background-color:#ffffffb3;border:solid 2px rgba(248,145,59,.7);text-align:center;font-size:22px;line-height:37px;transition:all .1s ease-in-out}.edit-flow:hover{background-color:#ef6c00b3;color:#000c;border:solid 2px transparent}.eventlog{height:200px;flex:0 0 auto;display:flex;flex-direction:column}.eventlog>div{background-color:#f2f2f2;padding:0 5px;flex:0 0 auto;border-top:1px solid #aaa;cursor:row-resize}.eventlog>pre{flex:1 1 auto;margin:0;border-radius:0;overflow-x:auto;overflow-y:scroll;background-color:#fcfcfc}.eventlog .fa-close{cursor:pointer;float:right;color:gray;padding:3px 0 3px 10px}.eventlog .fa-close:hover{color:#000}.eventlog .btn-toggle{margin-top:-2px;margin-left:3px;padding:2px;font-size:10px;line-height:10px;border-radius:2px}.eventlog .label{cursor:pointer;vertical-align:middle;display:inline-block;margin-top:-2px;margin-left:3px}footer{box-shadow:0 -1px 3px #d3d3d3;padding:0 0 4px 3px}footer .label{margin-right:3px}.CodeMirror{border:1px solid #ccc;height:auto!important}.contentview .header,.contentview .highlight{font-weight:700}.contentview .offset{color:#00f}.contentview .codeeditor{margin-bottom:12px}.contentview .Token_Name_Tag{color:#006400}.contentview .Token_Literal_String{color:#b22222}.contentview .Token_Literal_Number{color:purple}.contentview .Token_Keyword_Constant{color:#00f}.modal-visible{display:block}.modal-dialog{overflow-y:initial!important}.modal-body{max-height:calc(100vh - 200px);overflow-y:auto}.dropdown-menu{margin:0!important;max-height:250px;overflow-y:scroll}.dropdown-menu>li>a{padding:3px 10px}.command-title{background-color:#f2f2f2;border:1px solid #aaa}.command-result{display:block;margin:0;background-color:#fcfcfc;height:100px;max-height:100px;overflow:auto}.command-suggestion{background-color:#9c9c9c}.argument-suggestion{background-color:#c1d7eb80!important}.command>.popover{display:block;position:relative;max-width:none}.available-commands{overflow:auto}.wireguard-config{margin:1rem 0;display:flex;flex-wrap:wrap;column-gap:2rem;align-items:center}.wireguard-config>*{margin:0}.modes{padding:1em 2em 2em;overflow-y:auto;height:100%;width:100vw}.modes h3{margin-bottom:10px}.modes .modes-category{padding-left:10px}.modes .green-left-border{border-left:10px solid #77c77a}.modes .gray-left-border{border-left:10px solid #b2b2b2}.modes .modes-container{display:flex;flex-direction:column;gap:25px}.modes .mode-title{font-size:16px;font-weight:600}.modes .mode-description{color:#b2b2b2;margin-top:-10px}.modes .mode-entry{text-align:left;display:flex;align-items:center;font-size:1.5rem;font-weight:400;margin:0}.modes .mode-entry input[type=checkbox]{margin:0 10px;vertical-align:middle;width:1.8rem;height:1.8rem}.modes .mode-entry p{margin:0}.modes .mode-status{margin-left:10px;margin-top:5px;font-weight:600}.modes .mode-local i{font-size:1.8rem;cursor:pointer}.modes .mode-local .processes-container{display:flex;flex-direction:row;align-items:center;gap:5px;margin-left:5px}.modes .mode-local .selected-processes{display:flex;flex-wrap:wrap;gap:5px;overflow:hidden}.modes .mode-local .selected-process{display:flex;flex-direction:row;gap:5px;background-color:#e0e0e0;padding:5px;border-radius:4px;height:30px;font-size:12px;font-weight:500;align-content:center;align-items:center}.modes .mode-local .selected-process>i{font-size:15px}.modes .mode-local .dropdown-container{display:flex;flex-direction:row;align-items:center}.modes .mode-local .local-dropdown{position:relative;width:200px}.modes .mode-local .local-dropdown .dropdown-header{padding:5px;border:1px solid #ccc;border-radius:4px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;margin-right:10px;height:30px}.modes .mode-local .local-dropdown input{border:none;flex:1;outline:none;color:#000}.modes .mode-local .local-dropdown .dropdown-list{width:100%;max-height:300px;overflow-y:auto;z-index:1;list-style:none;padding:0;margin-bottom:0}.modes .mode-local .local-dropdown .dropdown-item{display:flex;flex-direction:row;align-items:center;padding:8px 10px;margin:4px 0;border-radius:4px;cursor:pointer;transition:background-color .2s ease;justify-content:space-between}.modes .mode-local .local-dropdown .dropdown-item.selected{background-color:#e0e0e0}.modes .mode-local .local-dropdown .dropdown-item:hover{background-color:#f0f0f0}.modes .mode-local .local-dropdown .process-details{display:flex;flex-direction:row;align-items:center}.modes .mode-local .local-dropdown .process-icon{margin-right:5px;margin-left:5px;color:#5f6368;width:25px;height:25px}.modes .mode-local .local-dropdown .process-name{font-weight:500;color:#333}.modes .mode-local .local-dropdown .process-separator{margin-top:10px;margin-bottom:10px}.modes .mode-local .local-popover button{font-size:1rem}.modes .mode-local .local-popover i{font-size:1.5rem}@supports (anchor-name: --test){.modes .mode-local .local-popover>div{margin:0;position:absolute;top:10px;position-area:bottom}}.modes .mode-local .local-popover>div{gap:.5rem;align-items:center}.modes .mode-local .local-popover>div:popover-open{display:block}.modes .mode-input{border:1px solid #ccc;margin-left:10px;border-radius:4px;min-width:120px;height:25px}.modes .mode-reverse-input{border:1px solid #ccc;margin-left:10px;margin-right:10px;border-radius:4px;min-width:70px;height:25px}.modes .mode-upstream-input{border:1px solid #ccc;margin-left:10px;margin-right:5px;border-radius:4px;min-width:70px;height:25px}.modes .mode-reverse-dropdown{margin:0 5px;border:1px solid #ccc;border-radius:4px;height:25px}.modes .mode-reverse-servers{display:flex;flex-direction:column;gap:10px}.modes .mode-reverse-add-server{margin-left:10px;display:flex;flex-direction:row;cursor:pointer;font-weight:500;opacity:.5;transition:all 50ms ease-in-out}.modes .mode-reverse-add-server:hover{opacity:1}.modes .mode-reverse-add-server i{font-size:2rem;margin-right:5px}.modes .mode-popover>button{background-color:transparent;border:none;cursor:pointer;font-size:2rem}@supports (anchor-name: --test){.modes .mode-popover>div{margin:0;position:absolute;position-area:right}}.modes .mode-popover>div{border:1px solid #ccc;border-radius:4px;padding:10px 15px;background-color:#f9f9f9;box-shadow:0 4px 8px #0000001a;grid-template-columns:9em 1fr;grid-auto-rows:min-content;gap:.5rem;align-items:center}.modes .mode-popover>div:popover-open{display:grid}.modes .mode-popover>div>h4{text-align:center;grid-column:1/-1}.modes .mode-popover>div>.mode-input{text-align:right;background-color:#fff;margin:0}.modes .missing-mode-container{color:#b2b2b2}.modes .missing-mode-container .title-icon-container{display:flex;flex-direction:row;align-items:center;gap:5px}.modes .missing-mode-container .title-icon-container i{font-size:1.8rem} diff --git a/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/vendor-BS4xPthR.js b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/vendor-BS4xPthR.js new file mode 100644 index 0000000000000000000000000000000000000000..0ceec93567a3003a683d4cc72fcb9a2526745360 --- /dev/null +++ b/python/user_packages/Python313/site-packages/mitmproxy/tools/web/static/vendor-BS4xPthR.js @@ -0,0 +1,62 @@ +function yR(n,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var Um=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var K1={exports:{}},lO={};var qx;function SR(){if(qx)return lO;qx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,s){var o=null;if(s!==void 0&&(o=""+s),r.key!==void 0&&(o=""+r.key),"key"in r){s={};for(var f in r)f!=="key"&&(s[f]=r[f])}else s=r;return r=s.ref,{$$typeof:n,type:i,key:o,ref:r!==void 0?r:null,props:s}}return lO.Fragment=e,lO.jsx=t,lO.jsxs=t,lO}var zx;function bR(){return zx||(zx=1,K1.exports=SR()),K1.exports}var vR=bR(),F1={exports:{}},sO={},J1={exports:{}},eS={};var Bx;function xR(){return Bx||(Bx=1,function(n){function e(I,oe){var ge=I.length;I.push(oe);e:for(;0>>1,X=I[Re];if(0>>1;Rer(me,ge))Cer(De,me)?(I[Re]=De,I[Ce]=ge,Re=Ce):(I[Re]=me,I[Se]=ge,Re=Se);else if(Cer(De,ge))I[Re]=De,I[Ce]=ge,Re=Ce;else break e}}return oe}function r(I,oe){var ge=I.sortIndex-oe.sortIndex;return ge!==0?ge:I.id-oe.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,f=o.now();n.unstable_now=function(){return o.now()-f}}var h=[],p=[],g=1,S=null,v=3,Q=!1,k=!1,C=!1,A=!1,$=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function Y(I){for(var oe=t(p);oe!==null;){if(oe.callback===null)i(p);else if(oe.startTime<=I)i(p),oe.sortIndex=oe.expirationTime,e(h,oe);else break;oe=t(p)}}function q(I){if(C=!1,Y(I),!k)if(t(h)!==null)k=!0,N||(N=!0,te());else{var oe=t(p);oe!==null&&we(q,oe.startTime-I)}}var N=!1,V=-1,J=5,ne=-1;function de(){return A?!0:!(n.unstable_now()-neI&&de());){var Re=S.callback;if(typeof Re=="function"){S.callback=null,v=S.priorityLevel;var X=Re(S.expirationTime<=I);if(I=n.unstable_now(),typeof X=="function"){S.callback=X,Y(I),oe=!0;break t}S===t(h)&&i(h),Y(I)}else i(h);S=t(h)}if(S!==null)oe=!0;else{var ie=t(p);ie!==null&&we(q,ie.startTime-I),oe=!1}}break e}finally{S=null,v=ge,Q=!1}oe=void 0}}finally{oe?te():N=!1}}}var te;if(typeof D=="function")te=function(){D(ae)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,ye=Oe.port2;Oe.port1.onmessage=ae,te=function(){ye.postMessage(null)}}else te=function(){$(ae,0)};function we(I,oe){V=$(function(){I(n.unstable_now())},oe)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_forceFrameRate=function(I){0>I||125Re?(I.sortIndex=ge,e(p,I),t(h)===null&&I===t(p)&&(C?(z(V),V=-1):C=!0,we(q,ge-Re))):(I.sortIndex=X,e(h,I),k||Q||(k=!0,N||(N=!0,te()))),I},n.unstable_shouldYield=de,n.unstable_wrapCallback=function(I){var oe=v;return function(){var ge=v;v=oe;try{return I.apply(this,arguments)}finally{v=ge}}}}(eS)),eS}var Yx;function QR(){return Yx||(Yx=1,J1.exports=xR()),J1.exports}var tS={exports:{}},Ie={};var Lx;function wR(){if(Lx)return Ie;Lx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),S=Symbol.iterator;function v(X){return X===null||typeof X!="object"?null:(X=S&&X[S]||X["@@iterator"],typeof X=="function"?X:null)}var Q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function A(X,ie,Se){this.props=X,this.context=ie,this.refs=C,this.updater=Se||Q}A.prototype.isReactComponent={},A.prototype.setState=function(X,ie){if(typeof X!="object"&&typeof X!="function"&&X!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,X,ie,"setState")},A.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function $(){}$.prototype=A.prototype;function z(X,ie,Se){this.props=X,this.context=ie,this.refs=C,this.updater=Se||Q}var D=z.prototype=new $;D.constructor=z,k(D,A.prototype),D.isPureReactComponent=!0;var Y=Array.isArray,q={H:null,A:null,T:null,S:null,V:null},N=Object.prototype.hasOwnProperty;function V(X,ie,Se,me,Ce,De){return Se=De.ref,{$$typeof:n,type:X,key:ie,ref:Se!==void 0?Se:null,props:De}}function J(X,ie){return V(X.type,ie,void 0,void 0,void 0,X.props)}function ne(X){return typeof X=="object"&&X!==null&&X.$$typeof===n}function de(X){var ie={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(Se){return ie[Se]})}var ae=/\/+/g;function te(X,ie){return typeof X=="object"&&X!==null&&X.key!=null?de(""+X.key):ie.toString(36)}function Oe(){}function ye(X){switch(X.status){case"fulfilled":return X.value;case"rejected":throw X.reason;default:switch(typeof X.status=="string"?X.then(Oe,Oe):(X.status="pending",X.then(function(ie){X.status==="pending"&&(X.status="fulfilled",X.value=ie)},function(ie){X.status==="pending"&&(X.status="rejected",X.reason=ie)})),X.status){case"fulfilled":return X.value;case"rejected":throw X.reason}}throw X}function we(X,ie,Se,me,Ce){var De=typeof X;(De==="undefined"||De==="boolean")&&(X=null);var Ae=!1;if(X===null)Ae=!0;else switch(De){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(X.$$typeof){case n:case e:Ae=!0;break;case g:return Ae=X._init,we(Ae(X._payload),ie,Se,me,Ce)}}if(Ae)return Ce=Ce(X),Ae=me===""?"."+te(X,0):me,Y(Ce)?(Se="",Ae!=null&&(Se=Ae.replace(ae,"$&/")+"/"),we(Ce,ie,Se,"",function(Xt){return Xt})):Ce!=null&&(ne(Ce)&&(Ce=J(Ce,Se+(Ce.key==null||X&&X.key===Ce.key?"":(""+Ce.key).replace(ae,"$&/")+"/")+Ae)),ie.push(Ce)),1;Ae=0;var yt=me===""?".":me+":";if(Y(X))for(var We=0;We"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),nS.exports=kR(),nS.exports}var Gx;function TR(){if(Gx)return sO;Gx=1;var n=QR(),e=tp(),t=PT();function i(l){var a="https://react.dev/errors/"+l;if(1X||(l.current=Re[X],Re[X]=null,X--)}function me(l,a){X++,Re[X]=l.current,l.current=a}var Ce=ie(null),De=ie(null),Ae=ie(null),yt=ie(null);function We(l,a){switch(me(Ae,a),me(De,l),me(Ce,null),a.nodeType){case 9:case 11:l=(l=a.documentElement)&&(l=l.namespaceURI)?Bt(l):0;break;default:if(l=a.tagName,a=a.namespaceURI)a=Bt(a),l=Lt(a,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}Se(Ce),me(Ce,l)}function Xt(){Se(Ce),Se(De),Se(Ae)}function Wi(l){l.memoizedState!==null&&me(yt,l);var a=Ce.current,u=Lt(a,l.type);a!==u&&(me(De,l),me(Ce,u))}function sl(l){De.current===l&&(Se(Ce),Se(De)),yt.current===l&&(Se(yt),Wa._currentValue=ge)}var tn=Object.prototype.hasOwnProperty,dr=n.unstable_scheduleCallback,ui=n.unstable_cancelCallback,fo=n.unstable_shouldYield,zy=n.unstable_requestPaint,hn=n.unstable_now,mp=n.unstable_getCurrentPriorityLevel,yp=n.unstable_ImmediatePriority,Ws=n.unstable_UserBlockingPriority,Ln=n.unstable_NormalPriority,ho=n.unstable_LowPriority,Oo=n.unstable_IdlePriority,By=n.log,po=n.unstable_setDisableYieldValue,go=null,vn=null;function ci(l){if(typeof By=="function"&&po(l),vn&&typeof vn.setStrictMode=="function")try{vn.setStrictMode(go,l)}catch{}}var Rn=Math.clz32?Math.clz32:ch,oh=Math.log,uh=Math.LN2;function ch(l){return l>>>=0,l===0?32:31-(oh(l)/uh|0)|0}var js=256,Hs=4194304;function Mr(l){var a=l&42;if(a!==0)return a;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Is(l,a,u){var O=l.pendingLanes;if(O===0)return 0;var m=0,b=l.suspendedLanes,w=l.pingedLanes;l=l.warmLanes;var _=O&134217727;return _!==0?(O=_&~b,O!==0?m=Mr(O):(w&=_,w!==0?m=Mr(w):u||(u=_&~l,u!==0&&(m=Mr(u))))):(_=O&~b,_!==0?m=Mr(_):w!==0?m=Mr(w):u||(u=O&~l,u!==0&&(m=Mr(u)))),m===0?0:a!==0&&a!==m&&(a&b)===0&&(b=m&-m,u=a&-a,b>=u||b===32&&(u&4194048)!==0)?a:m}function ls(l,a){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&a)===0}function Yy(l,a){switch(l){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sp(){var l=js;return js<<=1,(js&4194048)===0&&(js=256),l}function bp(){var l=Hs;return Hs<<=1,(Hs&62914560)===0&&(Hs=4194304),l}function Hu(l){for(var a=[],u=0;31>u;u++)a.push(l);return a}function Ks(l,a){l.pendingLanes|=a,a!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Ly(l,a,u,O,m,b){var w=l.pendingLanes;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=u,l.entangledLanes&=u,l.errorRecoveryDisabledLanes&=u,l.shellSuspendCounter=0;var _=l.entanglements,Z=l.expirationTimes,H=l.hiddenUpdates;for(u=w&~u;0)":-1m||Z[O]!==H[m]){var le=` +`+Z[O].replace(" at new "," at ");return l.displayName&&le.includes("")&&(le=le.replace("",l.displayName)),le}while(1<=O&&0<=m);break}}}finally{ph=!1,Error.prepareStackTrace=u}return(u=l?l.displayName||l.name:"")?ia(u):""}function Wy(l){switch(l.tag){case 26:case 27:case 5:return ia(l.type);case 16:return ia("Lazy");case 13:return ia("Suspense");case 19:return ia("SuspenseList");case 0:case 15:return gh(l.type,!1);case 11:return gh(l.type.render,!1);case 1:return gh(l.type,!0);case 31:return ia("Activity");default:return""}}function mh(l){try{var a="";do a+=Wy(l),l=l.return;while(l);return a}catch(u){return` +Error generating stack: `+u.message+` +`+u.stack}}function fi(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function yh(l){var a=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Sh(l){var a=yh(l)?"checked":"value",u=Object.getOwnPropertyDescriptor(l.constructor.prototype,a),O=""+l[a];if(!l.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,b=u.set;return Object.defineProperty(l,a,{configurable:!0,get:function(){return m.call(this)},set:function(w){O=""+w,b.call(this,w)}}),Object.defineProperty(l,a,{enumerable:u.enumerable}),{getValue:function(){return O},setValue:function(w){O=""+w},stopTracking:function(){l._valueTracker=null,delete l[a]}}}}function tc(l){l._valueTracker||(l._valueTracker=Sh(l))}function bh(l){if(!l)return!1;var a=l._valueTracker;if(!a)return!0;var u=a.getValue(),O="";return l&&(O=yh(l)?l.checked?"true":"false":l.value),l=O,l!==u?(a.setValue(l),!0):!1}function as(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var _p=/[\n"\\]/g;function Ti(l){return l.replace(_p,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function nc(l,a,u,O,m,b,w,_){l.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?l.type=w:l.removeAttribute("type"),a!=null?w==="number"?(a===0&&l.value===""||l.value!=a)&&(l.value=""+fi(a)):l.value!==""+fi(a)&&(l.value=""+fi(a)):w!=="submit"&&w!=="reset"||l.removeAttribute("value"),a!=null?So(l,w,fi(a)):u!=null?So(l,w,fi(u)):O!=null&&l.removeAttribute("value"),m==null&&b!=null&&(l.defaultChecked=!!b),m!=null&&(l.checked=m&&typeof m!="function"&&typeof m!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?l.name=""+fi(_):l.removeAttribute("name")}function vh(l,a,u,O,m,b,w,_){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(l.type=b),a!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||a!=null))return;u=u!=null?""+fi(u):"",a=a!=null?""+fi(a):u,_||a===l.value||(l.value=a),l.defaultValue=a}O=O??m,O=typeof O!="function"&&typeof O!="symbol"&&!!O,l.checked=_?l.checked:!!O,l.defaultChecked=!!O,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(l.name=w)}function So(l,a,u){a==="number"&&as(l.ownerDocument)===l||l.defaultValue===""+u||(l.defaultValue=""+u)}function ra(l,a,u,O){if(l=l.options,a){a={};for(var m=0;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xo=!1;if(Er)try{var Qo={};Object.defineProperty(Qo,"passive",{get:function(){xo=!0}}),window.addEventListener("test",Qo,Qo),window.removeEventListener("test",Qo,Qo)}catch{xo=!1}var cl=null,Ch=null,lc=null;function $p(){if(lc)return lc;var l,a=Ch,u=a.length,O,m="value"in cl?cl.value:cl.textContent,b=m.length;for(l=0;l=ca),hc=" ",Zh=!1;function Vp(l,a){switch(l){case"keyup":return ua.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dc(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var hl=!1;function t1(l,a){switch(l){case"compositionend":return dc(a);case"keypress":return a.which!==32?null:(Zh=!0,hc);case"textInput":return l=a.data,l===hc&&Zh?null:l;default:return null}}function Np(l,a){if(hl)return l==="compositionend"||!Xh&&Vp(l,a)?(l=$p(),lc=Ch=cl=null,hl=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:u,offset:a-l};l=O}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ci(u)}}function Ip(l,a){return l&&a?l===a?!0:l&&l.nodeType===3?!1:a&&a.nodeType===3?Ip(l,a.parentNode):"contains"in l?l.contains(a):l.compareDocumentPosition?!!(l.compareDocumentPosition(a)&16):!1:!1}function Kp(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var a=as(l.document);a instanceof l.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)l=a.contentWindow;else break;a=as(l.document)}return a}function zh(l){var a=l&&l.nodeName&&l.nodeName.toLowerCase();return a&&(a==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||a==="textarea"||l.contentEditable==="true")}var l1=Er&&"documentMode"in document&&11>=document.documentMode,Oa=null,pl=null,U=null,re=!1;function ee(l,a,u){var O=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;re||Oa==null||Oa!==as(O)||(O=Oa,"selectionStart"in O&&zh(O)?O={start:O.selectionStart,end:O.selectionEnd}:(O=(O.ownerDocument&&O.ownerDocument.defaultView||window).getSelection(),O={anchorNode:O.anchorNode,anchorOffset:O.anchorOffset,focusNode:O.focusNode,focusOffset:O.focusOffset}),U&&gr(U,O)||(U=O,O=hf(pl,"onSelect"),0>=w,m-=w,Dt=1<<32-Rn(a)+m|u<b?b:8;var w=I.T,_={};I.T=_,dd(l,!1,a,u);try{var Z=m(),H=I.S;if(H!==null&&H(_,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=f1(Z,O);Qs(l,a,le,Pn(l))}else Qs(l,a,O,Pn(l))}catch(fe){Qs(l,a,{then:function(){},status:"rejected",reason:fe},Pn())}finally{oe.p=b,I.T=w}}function bg(){}function jo(l,a,u,O){if(l.tag!==5)throw Error(i(476));var m=fd(l).queue;Wo(l,m,a,ge,u===null?bg:function(){return Yc(l),u(O)})}function fd(l){var a=l.memoizedState;if(a!==null)return a;a={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:ge},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:u},next:null},l.memoizedState=a,l=l.alternate,l!==null&&(l.memoizedState=a),a}function Yc(l){var a=fd(l).next.queue;Qs(l,a,{},Pn())}function Ho(){return Ut(Wa)}function Lr(){return Jt().memoizedState}function vg(){return Jt().memoizedState}function xl(l){for(var a=l.return;a!==null;){switch(a.tag){case 24:case 3:var u=Pn();l=Sl(u);var O=zr(a,l,u);O!==null&&(bi(O,a,u),Do(O,a,u)),a={cache:Uh()},l.payload=a;return}a=a.return}}function xg(l,a,u){var O=Pn();u={lane:O,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Lc(l)?Qg(a,u):(u=ma(l,a,u,O),u!==null&&(bi(u,l,O),Od(u,a,O)))}function hd(l,a,u){var O=Pn();Qs(l,a,u,O)}function Qs(l,a,u,O){var m={lane:O,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Lc(l))Qg(a,m);else{var b=l.alternate;if(l.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var w=a.lastRenderedState,_=b(w,u);if(m.hasEagerState=!0,m.eagerState=_,di(_,w))return Hi(l,a,m,0),Ct===null&&us(),!1}catch{}finally{}if(u=ma(l,a,m,O),u!==null)return bi(u,l,O),Od(u,a,O),!0}return!1}function dd(l,a,u,O){if(O={lane:2,revertLane:ff(),action:O,hasEagerState:!1,eagerState:null,next:null},Lc(l)){if(a)throw Error(i(479))}else a=ma(l,u,O,2),a!==null&&bi(a,l,2)}function Lc(l){var a=l.alternate;return l===He||a!==null&&a===He}function Qg(l,a){bs=Qa=!0;var u=l.pending;u===null?a.next=a:(a.next=u.next,u.next=a),l.pending=a}function Od(l,a,u){if((u&4194048)!==0){var O=a.lanes;O&=l.pendingLanes,u|=O,a.lanes=u,xp(l,u)}}var Io={readContext:Ut,use:Rc,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt},wg={readContext:Ut,use:Rc,useCallback:function(l,a){return In().memoizedState=[l,a===void 0?null:a],l},useContext:Ut,useEffect:yg,useImperativeHandle:function(l,a,u){u=u!=null?u.concat([l]):null,Vo(4194308,4,zc.bind(null,a,l),u)},useLayoutEffect:function(l,a){return Vo(4194308,4,l,a)},useInsertionEffect:function(l,a){Vo(4,2,l,a)},useMemo:function(l,a){var u=In();a=a===void 0?null:a;var O=l();if(kn){ci(!0);try{l()}finally{ci(!1)}}return u.memoizedState=[O,a],O},useReducer:function(l,a,u){var O=In();if(u!==void 0){var m=u(a);if(kn){ci(!0);try{u(a)}finally{ci(!1)}}}else m=a;return O.memoizedState=O.baseState=m,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:m},O.queue=l,l=l.dispatch=xg.bind(null,He,l),[O.memoizedState,l]},useRef:function(l){var a=In();return l={current:l},a.memoizedState=l},useState:function(l){l=Ec(l);var a=l.queue,u=hd.bind(null,He,a);return a.dispatch=u,[l.memoizedState,u]},useDebugValue:Bc,useDeferredValue:function(l,a){var u=In();return Go(u,l,a)},useTransition:function(){var l=Ec(!1);return l=Wo.bind(null,He,l.queue,!0,!1),In().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,a,u){var O=He,m=In();if(it){if(u===void 0)throw Error(i(407));u=u()}else{if(u=a(),Ct===null)throw Error(i(349));(at&124)!==0||$c(O,a,u)}m.memoizedState=u;var b={value:u,getSnapshot:a};return m.queue=b,yg(Mc.bind(null,O,b,l),[l]),O.flags|=2048,ka(9,qc(),Og.bind(null,O,b,u,a),null),u},useId:function(){var l=In(),a=Ct.identifierPrefix;if(it){var u=Dr,O=Dt;u=(O&~(1<<32-Rn(O)-1)).toString(32)+u,a="ยซ"+a+"R"+u,u=wa++,0Be?(yn=Me,Me=null):yn=Me.sibling;var ct=F(G,Me,j[Be],se);if(ct===null){Me===null&&(Me=yn);break}l&&Me&&ct.alternate===null&&a(G,Me),L=b(ct,L,Be),Fe===null?Pe=ct:Fe.sibling=ct,Fe=ct,Me=yn}if(Be===j.length)return u(G,Me),it&&Os(G,Be),Pe;if(Me===null){for(;BeBe?(yn=Me,Me=null):yn=Me.sibling;var ql=F(G,Me,ct.value,se);if(ql===null){Me===null&&(Me=yn);break}l&&Me&&ql.alternate===null&&a(G,Me),L=b(ql,L,Be),Fe===null?Pe=ql:Fe.sibling=ql,Fe=ql,Me=yn}if(ct.done)return u(G,Me),it&&Os(G,Be),Pe;if(Me===null){for(;!ct.done;Be++,ct=j.next())ct=fe(G,ct.value,se),ct!==null&&(L=b(ct,L,Be),Fe===null?Pe=ct:Fe.sibling=ct,Fe=ct);return it&&Os(G,Be),Pe}for(Me=O(Me);!ct.done;Be++,ct=j.next())ct=K(Me,G,Be,ct.value,se),ct!==null&&(l&&ct.alternate!==null&&Me.delete(ct.key===null?Be:ct.key),L=b(ct,L,Be),Fe===null?Pe=ct:Fe.sibling=ct,Fe=ct);return l&&Me.forEach(function(j1){return a(G,j1)}),it&&Os(G,Be),Pe}function kt(G,L,j,se){if(typeof j=="object"&&j!==null&&j.type===k&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case v:e:{for(var Pe=j.key;L!==null;){if(L.key===Pe){if(Pe=j.type,Pe===k){if(L.tag===7){u(G,L.sibling),se=m(L,j.props.children),se.return=G,G=se;break e}}else if(L.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===J&&ks(Pe)===L.type){u(G,L.sibling),se=m(L,j.props),Ko(se,j),se.return=G,G=se;break e}u(G,L);break}else a(G,L);L=L.sibling}j.type===k?(se=ds(j.props.children,G.mode,se,j.key),se.return=G,G=se):(se=vc(j.type,j.key,j.props,null,G.mode,se),Ko(se,j),se.return=G,G=se)}return w(G);case Q:e:{for(Pe=j.key;L!==null;){if(L.key===Pe)if(L.tag===4&&L.stateNode.containerInfo===j.containerInfo&&L.stateNode.implementation===j.implementation){u(G,L.sibling),se=m(L,j.children||[]),se.return=G,G=se;break e}else{u(G,L);break}else a(G,L);L=L.sibling}se=ya(j,G.mode,se),se.return=G,G=se}return w(G);case J:return Pe=j._init,j=Pe(j._payload),kt(G,L,j,se)}if(we(j))return ze(G,L,j,se);if(te(j)){if(Pe=te(j),typeof Pe!="function")throw Error(i(150));return j=Pe.call(j),qe(G,L,j,se)}if(typeof j.then=="function")return kt(G,L,Vc(j),se);if(j.$$typeof===D)return kt(G,L,wc(G,j),se);ws(G,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,L!==null&&L.tag===6?(u(G,L.sibling),se=m(L,j),se.return=G,G=se):(u(G,L),se=Lh(j,G.mode,se),se.return=G,G=se),w(G)):u(G,L)}return function(G,L,j,se){try{Fn=0;var Pe=kt(G,L,j,se);return rn=null,Pe}catch(Me){if(Me===Mn||Me===Tc)throw Me;var Fe=Gn(29,Me,null,G.mode);return Fe.lanes=se,Fe.return=G,Fe}finally{}}}var Ts=gd(!0),Tg=gd(!1),mi=ie(null),En=null;function Zi(l){var a=l.alternate;me(Gt,Gt.current&1),me(mi,l),En===null&&(a===null||Ss.current!==null||a.memoizedState!==null)&&(En=l)}function Pg(l){if(l.tag===22){if(me(Gt,Gt.current),me(mi,l),En===null){var a=l.alternate;a!==null&&a.memoizedState!==null&&(En=l)}}else Vr()}function Vr(){me(Gt,Gt.current),me(mi,mi.current)}function Sr(l){Se(mi),En===l&&(En=null),Se(Gt)}var Gt=ie(0);function Fo(l){for(var a=l;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||Zn(u)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break;for(;a.sibling===null;){if(a.return===null||a.return===l)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Pa(l,a,u,O){a=l.memoizedState,u=u(O,a),u=u==null?a:g({},a,u),l.memoizedState=u,l.lanes===0&&(l.updateQueue.baseState=u)}var Jo={enqueueSetState:function(l,a,u){l=l._reactInternals;var O=Pn(),m=Sl(O);m.payload=a,u!=null&&(m.callback=u),a=zr(l,m,O),a!==null&&(bi(a,l,O),Do(a,l,O))},enqueueReplaceState:function(l,a,u){l=l._reactInternals;var O=Pn(),m=Sl(O);m.tag=1,m.payload=a,u!=null&&(m.callback=u),a=zr(l,m,O),a!==null&&(bi(a,l,O),Do(a,l,O))},enqueueForceUpdate:function(l,a){l=l._reactInternals;var u=Pn(),O=Sl(u);O.tag=2,a!=null&&(O.callback=a),a=zr(l,O,u),a!==null&&(bi(a,l,u),Do(a,l,u))}};function eu(l,a,u,O,m,b,w){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(O,b,w):a.prototype&&a.prototype.isPureReactComponent?!gr(u,O)||!gr(m,b):!0}function _g(l,a,u,O){l=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,O),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,O),a.state!==l&&Jo.enqueueReplaceState(a,a.state,null)}function Ql(l,a){var u=a;if("ref"in a){u={};for(var O in a)O!=="ref"&&(u[O]=a[O])}if(l=l.defaultProps){u===a&&(u=g({},u));for(var m in l)u[m]===void 0&&(u[m]=l[m])}return u}var Ps=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)};function md(l){Ps(l)}function Nc(l){console.error(l)}function Cg(l){Ps(l)}function tu(l,a){try{var u=l.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(O){setTimeout(function(){throw O})}}function br(l,a,u){try{var O=l.onCaughtError;O(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Uc(l,a,u){return u=Sl(u),u.tag=3,u.payload={element:null},u.callback=function(){tu(l,a)},u}function yd(l){return l=Sl(l),l.tag=3,l}function Rg(l,a,u,O){var m=u.type.getDerivedStateFromError;if(typeof m=="function"){var b=O.value;l.payload=function(){return m(b)},l.callback=function(){br(a,u,O)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(l.callback=function(){br(a,u,O),typeof m!="function"&&(Cl===null?Cl=new Set([this]):Cl.add(this));var _=O.stack;this.componentDidCatch(O.value,{componentStack:_!==null?_:""})})}function Ag(l,a,u,O,m){if(u.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){if(a=u.alternate,a!==null&&Eo(a,u,m,!0),u=mi.current,u!==null){switch(u.tag){case 13:return En===null?Dd():u.alternate===null&&Wt===0&&(Wt=3),u.flags&=-257,u.flags|=65536,u.lanes=m,O===Wh?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([O]):a.add(O),Bd(l,O,m)),!1;case 22:return u.flags|=65536,O===Wh?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([O])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([O]):u.add(O)),Bd(l,O,m)),!1}throw Error(i(435,u.tag))}return Bd(l,O,m),Dd(),!1}if(it)return a=mi.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=m,O!==Sa&&(l=Error(i(422),{cause:O}),ml(An(l,u)))):(O!==Sa&&(a=Error(i(423),{cause:O}),ml(An(a,u))),l=l.current.alternate,l.flags|=65536,m&=-m,l.lanes|=m,O=An(O,u),m=Uc(l.stateNode,O,m),Ki(l,m),Wt!==4&&(Wt=2)),!1;var b=Error(i(520),{cause:O});if(b=An(b,u),fu===null?fu=[b]:fu.push(b),Wt!==4&&(Wt=2),a===null)return!0;O=An(O,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,l=m&-m,u.lanes|=l,l=Uc(u.stateNode,O,l),Ki(u,l),!1;case 1:if(a=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Cl===null||!Cl.has(b))))return u.flags|=65536,m&=-m,u.lanes|=m,m=yd(m),Rg(m,l,u,O),Ki(u,m),!1}u=u.return}while(u!==null);return!1}var $g=Error(i(461)),pn=!1;function At(l,a,u,O){a.child=l===null?Tg(a,null,u,O):Ts(a,l.child,u,O)}function Gc(l,a,u,O,m){u=u.render;var b=a.ref;if("ref"in O){var w={};for(var _ in O)_!=="ref"&&(w[_]=O[_])}else w=O;return gs(a),O=Kh(l,a,u,w,b,m),_=Jh(),l!==null&&!pn?(vs(l,a,m),Nr(l,a,m)):(it&&_&&Nh(a),a.flags|=1,At(l,a,O,m),a.child)}function Wc(l,a,u,O,m){if(l===null){var b=u.type;return typeof b=="function"&&!hs(b)&&b.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=b,jc(l,a,b,O,m)):(l=vc(u.type,null,O,a,a.mode,m),l.ref=a.ref,l.return=a,a.child=l)}if(b=l.child,!er(l,m)){var w=b.memoizedProps;if(u=u.compare,u=u!==null?u:gr,u(w,O)&&l.ref===a.ref)return Nr(l,a,m)}return a.flags|=1,l=$n(b,O),l.ref=a.ref,l.return=a,a.child=l}function jc(l,a,u,O,m){if(l!==null){var b=l.memoizedProps;if(gr(b,O)&&l.ref===a.ref)if(pn=!1,a.pendingProps=O=b,er(l,m))(l.flags&131072)!==0&&(pn=!0);else return a.lanes=l.lanes,Nr(l,a,m)}return _a(l,a,u,O,m)}function nu(l,a,u){var O=a.pendingProps,m=O.children,b=l!==null?l.memoizedState:null;if(O.mode==="hidden"){if((a.flags&128)!==0){if(O=b!==null?b.baseLanes|u:u,l!==null){for(m=a.child=l.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;a.childLanes=b&~O}else a.childLanes=0,a.child=null;return _s(l,a,O,u)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},l!==null&&kc(a,b!==null?b.cachePool:null),b!==null?Br(a,b):_c(),Pg(a);else return a.lanes=a.childLanes=536870912,_s(l,a,b!==null?b.baseLanes|u:u,u)}else b!==null?(kc(a,b.cachePool),Br(a,b),Vr(),a.memoizedState=null):(l!==null&&kc(a,null),_c(),Vr());return At(l,a,m,u),a.child}function _s(l,a,u,O){var m=qr();return m=m===null?null:{parent:Tt._currentValue,pool:m},a.memoizedState={baseLanes:u,cachePool:m},l!==null&&kc(a,null),_c(),Pg(a),l!==null&&Eo(l,a,O,!0),null}function Ze(l,a){var u=a.ref;if(u===null)l!==null&&l.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(l===null||l.ref!==u)&&(a.flags|=4194816)}}function _a(l,a,u,O,m){return gs(a),u=Kh(l,a,u,O,void 0,m),O=Jh(),l!==null&&!pn?(vs(l,a,m),Nr(l,a,m)):(it&&O&&Nh(a),a.flags|=1,At(l,a,u,m),a.child)}function Hc(l,a,u,O,m,b){return gs(a),a.updateQueue=null,u=dg(a,O,u,m),hg(l),O=Jh(),l!==null&&!pn?(vs(l,a,b),Nr(l,a,b)):(it&&O&&Nh(a),a.flags|=1,At(l,a,u,b),a.child)}function wl(l,a,u,O,m){if(gs(a),a.stateNode===null){var b=fs,w=u.contextType;typeof w=="object"&&w!==null&&(b=Ut(w)),b=new u(O,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Jo,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=O,b.state=a.memoizedState,b.refs={},ys(a),w=u.contextType,b.context=typeof w=="object"&&w!==null?Ut(w):fs,b.state=a.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(Pa(a,u,w,O),b.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(w=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),w!==b.state&&Jo.enqueueReplaceState(b,b.state,null),wn(a,O,b,m),Fi(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),O=!0}else if(l===null){b=a.stateNode;var _=a.memoizedProps,Z=Ql(u,_);b.props=Z;var H=b.context,le=u.contextType;w=fs,typeof le=="object"&&le!==null&&(w=Ut(le));var fe=u.getDerivedStateFromProps;le=typeof fe=="function"||typeof b.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,le||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(_||H!==w)&&_g(a,b,O,w),mr=!1;var F=a.memoizedState;b.state=F,wn(a,O,b,m),Fi(),H=a.memoizedState,_||F!==H||mr?(typeof fe=="function"&&(Pa(a,u,fe,O),H=a.memoizedState),(Z=mr||eu(a,u,Z,O,F,H,w))?(le||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=O,a.memoizedState=H),b.props=O,b.state=H,b.context=w,O=Z):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),O=!1)}else{b=a.stateNode,xa(l,a),w=a.memoizedProps,le=Ql(u,w),b.props=le,fe=a.pendingProps,F=b.context,H=u.contextType,Z=fs,typeof H=="object"&&H!==null&&(Z=Ut(H)),_=u.getDerivedStateFromProps,(H=typeof _=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(w!==fe||F!==Z)&&_g(a,b,O,Z),mr=!1,F=a.memoizedState,b.state=F,wn(a,O,b,m),Fi();var K=a.memoizedState;w!==fe||F!==K||mr||l!==null&&l.dependencies!==null&&Qc(l.dependencies)?(typeof _=="function"&&(Pa(a,u,_,O),K=a.memoizedState),(le=mr||eu(a,u,le,O,F,K,Z)||l!==null&&l.dependencies!==null&&Qc(l.dependencies))?(H||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(O,K,Z),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(O,K,Z)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||w===l.memoizedProps&&F===l.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||w===l.memoizedProps&&F===l.memoizedState||(a.flags|=1024),a.memoizedProps=O,a.memoizedState=K),b.props=O,b.state=K,b.context=Z,O=le):(typeof b.componentDidUpdate!="function"||w===l.memoizedProps&&F===l.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||w===l.memoizedProps&&F===l.memoizedState||(a.flags|=1024),O=!1)}return b=O,Ze(l,a),O=(a.flags&128)!==0,b||O?(b=a.stateNode,u=O&&typeof u.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,l!==null&&O?(a.child=Ts(a,l.child,null,m),a.child=Ts(a,null,u,m)):At(l,a,u,m),a.memoizedState=b.state,l=a.child):l=Nr(l,a,m),l}function Mg(l,a,u,O){return Mo(),a.flags|=256,At(l,a,u,O),a.child}var iu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ic(l){return{baseLanes:l,cachePool:lg()}}function gn(l,a,u){return l=l!==null?l.childLanes&~u:0,a&&(l|=qi),l}function Eg(l,a,u){var O=a.pendingProps,m=!1,b=(a.flags&128)!==0,w;if((w=b)||(w=l!==null&&l.memoizedState===null?!1:(Gt.current&2)!==0),w&&(m=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,l===null){if(it){if(m?Zi(a):Vr(),it){var _=qt,Z;if(Z=_){e:{for(Z=_,_=Wn;Z.nodeType!==8;){if(!_){_=null;break e}if(Z=nr(Z.nextSibling),Z===null){_=null;break e}}_=Z}_!==null?(a.memoizedState={dehydrated:_,treeContext:Rt!==null?{id:Dt,overflow:Dr}:null,retryLane:536870912,hydrationErrors:null},Z=Gn(18,null,null,0),Z.stateNode=_,Z.return=a,a.child=Z,nn=a,qt=null,Z=!0):Z=!1}Z||Mi(a)}if(_=a.memoizedState,_!==null&&(_=_.dehydrated,_!==null))return Zn(_)?a.lanes=32:a.lanes=536870912,null;Sr(a)}return _=O.children,O=O.fallback,m?(Vr(),m=a.mode,_=ru({mode:"hidden",children:_},m),O=ds(O,m,u,null),_.return=a,O.return=a,_.sibling=O,a.child=_,m=a.child,m.memoizedState=Ic(u),m.childLanes=gn(l,w,u),a.memoizedState=iu,O):(Zi(a),Sd(a,_))}if(Z=l.memoizedState,Z!==null&&(_=Z.dehydrated,_!==null)){if(b)a.flags&256?(Zi(a),a.flags&=-257,a=bd(l,a,u)):a.memoizedState!==null?(Vr(),a.child=l.child,a.flags|=128,a=null):(Vr(),m=O.fallback,_=a.mode,O=ru({mode:"visible",children:O.children},_),m=ds(m,_,u,null),m.flags|=2,O.return=a,m.return=a,O.sibling=m,a.child=O,Ts(a,l.child,null,u),O=a.child,O.memoizedState=Ic(u),O.childLanes=gn(l,w,u),a.memoizedState=iu,a=m);else if(Zi(a),Zn(_)){if(w=_.nextSibling&&_.nextSibling.dataset,w)var H=w.dgst;w=H,O=Error(i(419)),O.stack="",O.digest=w,ml({value:O,source:null,stack:null}),a=bd(l,a,u)}else if(pn||Eo(l,a,u,!1),w=(u&l.childLanes)!==0,pn||w){if(w=Ct,w!==null&&(O=u&-u,O=(O&42)!==0?1:fh(O),O=(O&(w.suspendedLanes|u))!==0?0:O,O!==0&&O!==Z.retryLane))throw Z.retryLane=O,cs(l,O),bi(w,l,O),$g;_.data==="$?"||Dd(),a=bd(l,a,u)}else _.data==="$?"?(a.flags|=192,a.child=l.child,a=null):(l=Z.treeContext,qt=nr(_.nextSibling),nn=a,it=!0,Ii=null,Wn=!1,l!==null&&(Ai[$i++]=Dt,Ai[$i++]=Dr,Ai[$i++]=Rt,Dt=l.id,Dr=l.overflow,Rt=a),a=Sd(a,O.children),a.flags|=4096);return a}return m?(Vr(),m=O.fallback,_=a.mode,Z=l.child,H=Z.sibling,O=$n(Z,{mode:"hidden",children:O.children}),O.subtreeFlags=Z.subtreeFlags&65011712,H!==null?m=$n(H,m):(m=ds(m,_,u,null),m.flags|=2),m.return=a,O.return=a,O.sibling=m,a.child=O,O=m,m=a.child,_=l.child.memoizedState,_===null?_=Ic(u):(Z=_.cachePool,Z!==null?(H=Tt._currentValue,Z=Z.parent!==H?{parent:H,pool:H}:Z):Z=lg(),_={baseLanes:_.baseLanes|u,cachePool:Z}),m.memoizedState=_,m.childLanes=gn(l,w,u),a.memoizedState=iu,O):(Zi(a),u=l.child,l=u.sibling,u=$n(u,{mode:"visible",children:O.children}),u.return=a,u.sibling=null,l!==null&&(w=a.deletions,w===null?(a.deletions=[l],a.flags|=16):w.push(l)),a.child=u,a.memoizedState=null,u)}function Sd(l,a){return a=ru({mode:"visible",children:a},l.mode),a.return=l,l.child=a}function ru(l,a){return l=Gn(22,l,null,a),l.lanes=0,l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},l}function bd(l,a,u){return Ts(a,l.child,null,u),l=Sd(a,a.pendingProps.children),l.flags|=2,a.memoizedState=null,l}function vd(l,a,u){l.lanes|=a;var O=l.alternate;O!==null&&(O.lanes|=a),jn(l.return,a,u)}function xd(l,a,u,O,m){var b=l.memoizedState;b===null?l.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:O,tail:u,tailMode:m}:(b.isBackwards=a,b.rendering=null,b.renderingStartTime=0,b.last=O,b.tail=u,b.tailMode=m)}function Xg(l,a,u){var O=a.pendingProps,m=O.revealOrder,b=O.tail;if(At(l,a,O.children,u),O=Gt.current,(O&2)!==0)O=O&1|2,a.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=a.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&vd(l,u,a);else if(l.tag===19)vd(l,u,a);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}O&=1}switch(me(Gt,O),m){case"forwards":for(u=a.child,m=null;u!==null;)l=u.alternate,l!==null&&Fo(l)===null&&(m=u),u=u.sibling;u=m,u===null?(m=a.child,a.child=null):(m=u.sibling,u.sibling=null),xd(a,!1,m,u,b);break;case"backwards":for(u=null,m=a.child,a.child=null;m!==null;){if(l=m.alternate,l!==null&&Fo(l)===null){a.child=m;break}l=m.sibling,m.sibling=u,u=m,m=l}xd(a,!0,u,null,b);break;case"together":xd(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Nr(l,a,u){if(l!==null&&(a.dependencies=l.dependencies),_l|=a.lanes,(u&a.childLanes)===0)if(l!==null){if(Eo(l,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(l!==null&&a.child!==l.child)throw Error(i(153));if(a.child!==null){for(l=a.child,u=$n(l,l.pendingProps),a.child=u,u.return=a;l.sibling!==null;)l=l.sibling,u=u.sibling=$n(l,l.pendingProps),u.return=a;u.sibling=null}return a.child}function er(l,a){return(l.lanes&a)!==0?!0:(l=l.dependencies,!!(l!==null&&Qc(l)))}function Xn(l,a,u){switch(a.tag){case 3:We(a,a.stateNode.containerInfo),pi(a,Tt,l.memoizedState.cache),Mo();break;case 27:case 5:Wi(a);break;case 4:We(a,a.stateNode.containerInfo);break;case 10:pi(a,a.type,a.memoizedProps.value);break;case 13:var O=a.memoizedState;if(O!==null)return O.dehydrated!==null?(Zi(a),a.flags|=128,null):(u&a.child.childLanes)!==0?Eg(l,a,u):(Zi(a),l=Nr(l,a,u),l!==null?l.sibling:null);Zi(a);break;case 19:var m=(l.flags&128)!==0;if(O=(u&a.childLanes)!==0,O||(Eo(l,a,u,!1),O=(u&a.childLanes)!==0),m){if(O)return Xg(l,a,u);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),me(Gt,Gt.current),O)break;return null;case 22:case 23:return a.lanes=0,nu(l,a,u);case 24:pi(a,Tt,l.memoizedState.cache)}return Nr(l,a,u)}function Kc(l,a,u){if(l!==null)if(l.memoizedProps!==a.pendingProps)pn=!0;else{if(!er(l,u)&&(a.flags&128)===0)return pn=!1,Xn(l,a,u);pn=(l.flags&131072)!==0}else pn=!1,it&&(a.flags&1048576)!==0&&Vh(a,Ro,a.index);switch(a.lanes=0,a.tag){case 16:e:{l=a.pendingProps;var O=a.elementType,m=O._init;if(O=m(O._payload),a.type=O,typeof O=="function")hs(O)?(l=Ql(O,l),a.tag=1,a=wl(null,a,O,l,u)):(a.tag=0,a=_a(null,a,O,l,u));else{if(O!=null){if(m=O.$$typeof,m===Y){a.tag=11,a=Gc(null,a,O,l,u);break e}else if(m===V){a.tag=14,a=Wc(null,a,O,l,u);break e}}throw a=ye(O)||O,Error(i(306,a,""))}}return a;case 0:return _a(l,a,a.type,a.pendingProps,u);case 1:return O=a.type,m=Ql(O,a.pendingProps),wl(l,a,O,m,u);case 3:e:{if(We(a,a.stateNode.containerInfo),l===null)throw Error(i(387));O=a.pendingProps;var b=a.memoizedState;m=b.element,xa(l,a),wn(a,O,null,u);var w=a.memoizedState;if(O=w.cache,pi(a,Tt,O),O!==b.cache&&Ke(a,[Tt],u,!0),Fi(),O=w.element,b.isDehydrated)if(b={element:O,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=Mg(l,a,O,u);break e}else if(O!==m){m=An(Error(i(424)),a),ml(m),a=Mg(l,a,O,u);break e}else{switch(l=a.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(qt=nr(l.firstChild),nn=a,it=!0,Ii=null,Wn=!0,u=Tg(a,null,O,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Mo(),O===m){a=Nr(l,a,u);break e}At(l,a,O,u)}a=a.child}return a;case 26:return Ze(l,a),l===null?(u=Am(a.type,null,a.pendingProps,null))?a.memoizedState=u:it||(u=a.type,l=a.pendingProps,O=As(Ae.current).createElement(u),O[dn]=a,O[Vn]=l,an(O,u,l),On(O),a.stateNode=O):a.memoizedState=Am(a.type,l.memoizedProps,a.pendingProps,l.memoizedState),null;case 27:return Wi(a),l===null&&it&&(O=a.stateNode=_m(a.type,a.pendingProps,Ae.current),nn=a,Wn=!0,m=qt,zi(a.type)?(Hd=m,qt=nr(O.firstChild)):qt=m),At(l,a,a.pendingProps.children,u),Ze(l,a),l===null&&(a.flags|=4194304),a.child;case 5:return l===null&&it&&((m=O=qt)&&(O=Tm(O,a.type,a.pendingProps,Wn),O!==null?(a.stateNode=O,nn=a,qt=nr(O.firstChild),Wn=!1,m=!0):m=!1),m||Mi(a)),Wi(a),m=a.type,b=a.pendingProps,w=l!==null?l.memoizedProps:null,O=b.children,pf(m,b)?O=null:w!==null&&pf(m,w)&&(a.flags|=32),a.memoizedState!==null&&(m=Kh(l,a,Fh,null,null,u),Wa._currentValue=m),Ze(l,a),At(l,a,O,u),a.child;case 6:return l===null&&it&&((l=u=qt)&&(u=mf(u,a.pendingProps,Wn),u!==null?(a.stateNode=u,nn=a,qt=null,l=!0):l=!1),l||Mi(a)),null;case 13:return Eg(l,a,u);case 4:return We(a,a.stateNode.containerInfo),O=a.pendingProps,l===null?a.child=Ts(a,null,O,u):At(l,a,O,u),a.child;case 11:return Gc(l,a,a.type,a.pendingProps,u);case 7:return At(l,a,a.pendingProps,u),a.child;case 8:return At(l,a,a.pendingProps.children,u),a.child;case 12:return At(l,a,a.pendingProps.children,u),a.child;case 10:return O=a.pendingProps,pi(a,a.type,O.value),At(l,a,O.children,u),a.child;case 9:return m=a.type._context,O=a.pendingProps.children,gs(a),m=Ut(m),O=O(m),a.flags|=1,At(l,a,O,u),a.child;case 14:return Wc(l,a,a.type,a.pendingProps,u);case 15:return jc(l,a,a.type,a.pendingProps,u);case 19:return Xg(l,a,u);case 31:return O=a.pendingProps,u=a.mode,O={mode:O.mode,children:O.children},l===null?(u=ru(O,u),u.ref=a.ref,a.child=u,u.return=a,a=u):(u=$n(l.child,O),u.ref=a.ref,a.child=u,u.return=a,a=u),a;case 22:return nu(l,a,u);case 24:return gs(a),O=Ut(Tt),l===null?(m=qr(),m===null&&(m=Ct,b=Uh(),m.pooledCache=b,b.refCount++,b!==null&&(m.pooledCacheLanes|=u),m=b),a.memoizedState={parent:O,cache:m},ys(a),pi(a,Tt,m)):((l.lanes&u)!==0&&(xa(l,a),wn(a,null,null,u),Fi()),m=l.memoizedState,b=a.memoizedState,m.parent!==O?(m={parent:O,cache:O},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),pi(a,Tt,O)):(O=b.cache,pi(a,Tt,O),O!==m.cache&&Ke(a,[Tt],u,!0))),At(l,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function Ur(l){l.flags|=4}function Fc(l,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!on(a)){if(a=mi.current,a!==null&&((at&4194048)===at?En!==null:(at&62914560)!==at&&(at&536870912)===0||a!==En))throw va=Wh,sg;l.flags|=8192}}function Jc(l,a){a!==null&&(l.flags|=4),l.flags&16384&&(a=l.tag!==22?bp():536870912,l.lanes|=a,Xa|=a)}function lu(l,a){if(!it)switch(l.tailMode){case"hidden":a=l.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?l.tail=null:u.sibling=null;break;case"collapsed":u=l.tail;for(var O=null;u!==null;)u.alternate!==null&&(O=u),u=u.sibling;O===null?a||l.tail===null?l.tail=null:l.tail.sibling=null:O.sibling=null}}function Pt(l){var a=l.alternate!==null&&l.alternate.child===l.child,u=0,O=0;if(a)for(var m=l.child;m!==null;)u|=m.lanes|m.childLanes,O|=m.subtreeFlags&65011712,O|=m.flags&65011712,m.return=l,m=m.sibling;else for(m=l.child;m!==null;)u|=m.lanes|m.childLanes,O|=m.subtreeFlags,O|=m.flags,m.return=l,m=m.sibling;return l.subtreeFlags|=O,l.childLanes=u,a}function Zg(l,a,u){var O=a.pendingProps;switch(Ao(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(a),null;case 1:return Pt(a),null;case 3:return u=a.stateNode,O=null,l!==null&&(O=l.memoizedState.cache),a.memoizedState.cache!==O&&(a.flags|=2048),Ei(Tt),Xt(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(l===null||l.child===null)&&($o(a)?Ur(a):l===null||l.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,tg())),Pt(a),null;case 26:return u=a.memoizedState,l===null?(Ur(a),u!==null?(Pt(a),Fc(a,u)):(Pt(a),a.flags&=-16777217)):u?u!==l.memoizedState?(Ur(a),Pt(a),Fc(a,u)):(Pt(a),a.flags&=-16777217):(l.memoizedProps!==O&&Ur(a),Pt(a),a.flags&=-16777217),null;case 27:sl(a),u=Ae.current;var m=a.type;if(l!==null&&a.stateNode!=null)l.memoizedProps!==O&&Ur(a);else{if(!O){if(a.stateNode===null)throw Error(i(166));return Pt(a),null}l=Ce.current,$o(a)?Jp(a):(l=_m(m,O,u),a.stateNode=l,Ur(a))}return Pt(a),null;case 5:if(sl(a),u=a.type,l!==null&&a.stateNode!=null)l.memoizedProps!==O&&Ur(a);else{if(!O){if(a.stateNode===null)throw Error(i(166));return Pt(a),null}if(l=Ce.current,$o(a))Jp(a);else{switch(m=As(Ae.current),l){case 1:l=m.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:l=m.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":l=m.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":l=m.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":l=m.createElement("div"),l.innerHTML="