HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //usr/lib/python3/dist-packages/service_identity/__init__.py
"""
Verify service identities.
"""


from . import cryptography, hazmat, pyopenssl
from .exceptions import (
    CertificateError,
    SubjectAltNameWarning,
    VerificationError,
)


__title__ = "service-identity"

__author__ = "Hynek Schlawack"

__license__ = "MIT"
__copyright__ = "Copyright (c) 2014 " + __author__


__all__ = [
    "CertificateError",
    "SubjectAltNameWarning",
    "VerificationError",
    "hazmat",
    "cryptography",
    "pyopenssl",
]


def __getattr__(name: str) -> str:
    dunder_to_metadata = {
        "__version__": "version",
        "__description__": "summary",
        "__uri__": "",
        "__url__": "",
        "__email__": "",
    }
    if name not in dunder_to_metadata:
        raise AttributeError(f"module {__name__} has no attribute {name}")

    import warnings

    from importlib.metadata import metadata

    warnings.warn(
        f"Accessing service_identity.{name} is deprecated and will be "
        "removed in a future release. Use importlib.metadata directly "
        "to query packaging metadata.",
        DeprecationWarning,
        stacklevel=2,
    )

    meta = metadata("service-identity")

    if name in ("__uri__", "__url__"):
        return meta["Project-URL"].split(" ", 1)[1]

    if name == "__email__":
        return meta["Author-email"].split("<", 1)[1].rstrip(">")

    return meta[dunder_to_metadata[name]]