:py:mod:`dissect.database.ese.ntds.schema` ========================================== .. py:module:: dissect.database.ese.ntds.schema Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.database.ese.ntds.schema.ClassEntry dissect.database.ese.ntds.schema.AttributeEntry dissect.database.ese.ntds.schema.Schema Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.database.ese.ntds.schema.parse_prefix_map dissect.database.ese.ntds.schema.decode_oid Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.database.ese.ntds.schema.BOOTSTRAP_COLUMNS dissect.database.ese.ntds.schema.BOOTSTRAP_ATTRIBUTES dissect.database.ese.ntds.schema.BOOTSTRAP_OBJECT_CLASSES dissect.database.ese.ntds.schema.BOOTSTRAP_OID_PREFIXES .. py:data:: BOOTSTRAP_COLUMNS :value: [('DNT', 'DNT_col', 524297), ('Pdnt', 'PDNT_col', 524297), ('Obj', 'OBJ_col', 524296),... .. py:data:: BOOTSTRAP_ATTRIBUTES :value: [('objectClass', 0, 524290, False), ('cn', 3, 524300, True), ('isDeleted', 131120, 524296,... .. py:data:: BOOTSTRAP_OBJECT_CLASSES .. py:data:: BOOTSTRAP_OID_PREFIXES .. py:class:: ClassEntry Bases: :py:obj:`NamedTuple` .. py:attribute:: dnt :type: int .. py:attribute:: id :type: int .. py:attribute:: name :type: str .. py:class:: AttributeEntry Bases: :py:obj:`NamedTuple` .. py:attribute:: dnt :type: int .. py:attribute:: id :type: int .. py:attribute:: name :type: str .. py:attribute:: column :type: str .. py:attribute:: syntax :type: int .. py:attribute:: om_syntax :type: int | None .. py:attribute:: om_object_class :type: bytes | None .. py:attribute:: is_single_valued :type: bool .. py:attribute:: link_id :type: int | None .. py:attribute:: search_flags :type: dissect.database.ese.ntds.util.SearchFlags | None .. py:class:: Schema An index for schema entries providing fast lookups by various keys. Provides efficient lookups for schema entries by DNT, OID, ATTRTYP, LDAP display name, and column name. .. py:method:: load(db: dissect.database.ese.ntds.database.Database) -> None Load the classes and attributes from the database into the schema index. :param db: The database instance to load the schema from. .. py:method:: lookup_attribute(*, id: int | None = None, name: str | None = None, link_id: int | None = None, column: str | None = None) -> AttributeEntry | None Lookup an attribute schema entry by an indexed field. :param id: The attribute ID to look up. :param name: The LDAP display name to look up. :param link_id: The link ID to look up. :param column: The column name to look up. :returns: The matching attribute schema entry or ``None`` if not found. .. py:method:: lookup_class(*, id: int | None = None, name: str | None = None) -> ClassEntry | None Lookup a class schema entry by an indexed field. :param id: The class ID to look up. :param name: The LDAP display name to look up. :returns: The matching class schema entry or ``None`` if not found. .. py:method:: lookup_oid(oid: str) -> ClassEntry | AttributeEntry | None Lookup a schema entry by OID. :param oid: The OID to look up. :returns: The matching schema entry or ``None`` if not found. .. py:method:: attrtyp_to_oid(attrtyp: int) -> str | None Convert an ATTRTYP integer value to an OID string. :param attrtyp: The ATTRTYP integer value to convert. :returns: The corresponding OID string or ``None`` if the ATTRTYP does not correspond to a valid OID. .. py:method:: lookup(*, dnt: int | None = None, oid: str | None = None, attrtyp: int | None = None, name: str | None = None) -> ClassEntry | AttributeEntry | None Lookup a schema entry by an indexed field. :param dnt: The DNT (Distinguished Name Tag) of the schema entry to look up. :param oid: The OID (Object Identifier) of the schema entry to look up. :param attrtyp: The ATTRTYP (attribute type) of the schema entry to look up. :param name: The LDAP display name of the schema entry to look up. :returns: The matching schema entry or ``None`` if not found. .. py:function:: parse_prefix_map(buf: bytes) -> dict[int, str] Parse a prefix map. :param buf: The buffer containing the prefix map data. .. py:function:: decode_oid(buf: bytes) -> str Decode a BER encoded OID. :param buf: The buffer containing the BER encoded OID.