common.types
Common types used throughout the SecretVaults library.
This module provides centralized type definitions including Uuid, Did, and ByNodeName for consistent type checking across the codebase.
- class Did(value: str)[source]
Bases:
strDecentralized Identifier (DID) for Nillion network.
A branded string type that loosely validates DIDs. Supports did:nil, did:key, and did:ethr formats. Automatically converts did:key to did:nil for backwards compatibility.
- static __new__(cls, value: str) Did[source]
Create a new Did instance with validation and conversion.
- classmethod __get_pydantic_core_schema__(_source_type: type, _handler: GetCoreSchemaHandler) InvalidSchema | AnySchema | NoneSchema | BoolSchema | IntSchema | FloatSchema | DecimalSchema | StringSchema | BytesSchema | DateSchema | TimeSchema | DatetimeSchema | TimedeltaSchema | LiteralSchema | MissingSentinelSchema | EnumSchema | IsInstanceSchema | IsSubclassSchema | CallableSchema | ListSchema | TupleSchema | SetSchema | FrozenSetSchema | GeneratorSchema | DictSchema | AfterValidatorFunctionSchema | BeforeValidatorFunctionSchema | WrapValidatorFunctionSchema | PlainValidatorFunctionSchema | WithDefaultSchema | NullableSchema | UnionSchema | TaggedUnionSchema | ChainSchema | LaxOrStrictSchema | JsonOrPythonSchema | TypedDictSchema | ModelFieldsSchema | ModelSchema | DataclassArgsSchema | DataclassSchema | ArgumentsSchema | ArgumentsV3Schema | CallSchema | CustomErrorSchema | JsonSchema | UrlSchema | MultiHostUrlSchema | DefinitionsSchema | DefinitionReferenceSchema | UuidSchema | ComplexSchema[source]
Custom Pydantic core schema to handle DID validation and conversion.