diff --git a/stubs/cryptography/@tests/stubtest_allowlist.txt b/stubs/cryptography/@tests/stubtest_allowlist.txt index bf470c14d..52bdeb872 100644 --- a/stubs/cryptography/@tests/stubtest_allowlist.txt +++ b/stubs/cryptography/@tests/stubtest_allowlist.txt @@ -25,6 +25,7 @@ cryptography.x509.CertificateRevocationListBuilder.last_update cryptography.x509.CertificateRevocationListBuilder.next_update cryptography.x509.CertificateSigningRequestBuilder.__init__ cryptography.x509.Extension.__init__ +cryptography.x509.ExtensionType.oid # is a property at runtime, but a different descriptor on subclasses, easier just to pretend it's writeable cryptography.x509.Extensions.__init__ cryptography.x509.NameAttribute.__init__ cryptography.x509.OCSPExtensionOID diff --git a/stubs/cryptography/cryptography/x509/__init__.pyi b/stubs/cryptography/cryptography/x509/__init__.pyi index e4741a8e4..0d0610157 100644 --- a/stubs/cryptography/cryptography/x509/__init__.pyi +++ b/stubs/cryptography/cryptography/x509/__init__.pyi @@ -109,7 +109,8 @@ class ExtendedKeyUsageOID: ANY_EXTENDED_KEY_USAGE: ClassVar[ObjectIdentifier] class NameAttribute: - oid: ObjectIdentifier + @property + def oid(self) -> ObjectIdentifier: ... @property def value(self) -> str: ... def __init__(self, oid: ObjectIdentifier, value: str) -> None: ... @@ -332,7 +333,8 @@ _T = TypeVar("_T", bound=ExtensionType) class Extension(Generic[_T]): @property def critical(self) -> bool: ... - oid: ObjectIdentifier + @property + def oid(self) -> ObjectIdentifier: ... @property def value(self) -> _T: ... @@ -453,6 +455,8 @@ class ExtendedKeyUsage(ExtensionType): class UnrecognizedExtension(ExtensionType): @property def value(self) -> bytes: ... + @property + def oid(self) -> ObjectIdentifier: ... # type: ignore[override] def __init__(self, oid: ObjectIdentifier, value: bytes) -> None: ... def load_der_x509_certificate(data: bytes, backend: X509Backend | None = ...) -> Certificate: ...