mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 21:33:00 +00:00
Reorganize imports due to https://github.com/ansible-community/antsibull-nox/pull/136.
This commit is contained in:
@@ -18,6 +18,7 @@ import typing as t
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.backend_cryptography import (
|
||||
CRYPTOGRAPHY_ERROR,
|
||||
CRYPTOGRAPHY_MINIMAL_VERSION,
|
||||
@@ -54,6 +55,7 @@ if t.TYPE_CHECKING:
|
||||
import urllib.error # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.account import ( # pragma: no cover
|
||||
ACMEAccount,
|
||||
)
|
||||
|
||||
@@ -15,6 +15,7 @@ import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.backends import (
|
||||
CertificateInformation,
|
||||
CryptoBackend,
|
||||
@@ -83,6 +84,7 @@ if t.TYPE_CHECKING:
|
||||
import datetime # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.certificates import ( # pragma: no cover
|
||||
CertificateChain,
|
||||
Criterium,
|
||||
|
||||
@@ -19,6 +19,7 @@ import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.backends import (
|
||||
CertificateInformation,
|
||||
CryptoBackend,
|
||||
@@ -40,6 +41,7 @@ from ansible_collections.community.crypto.plugins.module_utils._time import (
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.certificates import ( # pragma: no cover
|
||||
Criterium,
|
||||
)
|
||||
|
||||
@@ -34,6 +34,7 @@ if t.TYPE_CHECKING:
|
||||
import os # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.certificates import ( # pragma: no cover
|
||||
ChainMatcher,
|
||||
Criterium,
|
||||
|
||||
@@ -38,6 +38,7 @@ from ansible_collections.community.crypto.plugins.module_utils._acme.utils impor
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.backends import ( # pragma: no cover
|
||||
CryptoBackend,
|
||||
)
|
||||
|
||||
@@ -17,6 +17,7 @@ import time
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.errors import (
|
||||
ACMEProtocolException,
|
||||
ModuleFailException,
|
||||
@@ -29,6 +30,7 @@ from ansible_collections.community.crypto.plugins.module_utils._acme.utils impor
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._acme.acme import ( # pragma: no cover
|
||||
ACMEClient,
|
||||
)
|
||||
|
||||
@@ -20,6 +20,7 @@ from urllib.parse import (
|
||||
)
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto._asn1 import (
|
||||
serialize_asn1_string_as_der,
|
||||
)
|
||||
@@ -71,6 +72,7 @@ except ImportError:
|
||||
IDNA_IMP_ERROR = traceback.format_exc()
|
||||
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto._obj2txt import (
|
||||
obj2txt,
|
||||
)
|
||||
|
||||
@@ -41,13 +41,14 @@ if t.TYPE_CHECKING:
|
||||
import datetime # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import ( # pragma: no cover
|
||||
CertificatePrivateKeyTypes,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificateIssuerPrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import ( # pragma: no cover
|
||||
CertificatePrivateKeyTypes,
|
||||
)
|
||||
|
||||
|
||||
MINIMAL_CRYPTOGRAPHY_VERSION = COLLECTION_MINIMUM_CRYPTOGRAPHY_VERSION
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.module_backends.certificate import (
|
||||
CertificateBackend,
|
||||
CertificateError,
|
||||
@@ -23,6 +24,7 @@ from ansible_collections.community.crypto.plugins.module_utils._crypto.module_ba
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import ( # pragma: no cover
|
||||
ArgumentSpec,
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ import binascii
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import (
|
||||
CRYPTOGRAPHY_TIMEZONE,
|
||||
cryptography_decode_name,
|
||||
@@ -41,6 +42,10 @@ if t.TYPE_CHECKING:
|
||||
import datetime # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from cryptography.hazmat.primitives.asymmetric.types import (
|
||||
PublicKeyTypes, # pragma: no cover
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import ( # pragma: no cover
|
||||
ArgumentSpec,
|
||||
)
|
||||
@@ -50,9 +55,6 @@ if t.TYPE_CHECKING:
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._filter_module import ( # pragma: no cover
|
||||
FilterModuleMock,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import (
|
||||
PublicKeyTypes, # pragma: no cover
|
||||
)
|
||||
|
||||
GeneralAnsibleModule = t.Union[
|
||||
AnsibleModule, AnsibleActionModule, FilterModuleMock
|
||||
|
||||
@@ -45,13 +45,14 @@ if t.TYPE_CHECKING:
|
||||
import datetime # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import ( # pragma: no cover
|
||||
ArgumentSpec,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificateIssuerPrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import ( # pragma: no cover
|
||||
ArgumentSpec,
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
import cryptography
|
||||
|
||||
@@ -39,13 +39,14 @@ if t.TYPE_CHECKING:
|
||||
import datetime # pragma: no cover
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import ( # pragma: no cover
|
||||
ArgumentSpec,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificateIssuerPrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import ( # pragma: no cover
|
||||
ArgumentSpec,
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
import cryptography
|
||||
|
||||
@@ -29,15 +29,16 @@ from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._filter_module import ( # pragma: no cover
|
||||
FilterModuleMock,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
GeneralAnsibleModule = t.Union[
|
||||
AnsibleModule, AnsibleActionModule, FilterModuleMock
|
||||
|
||||
@@ -12,6 +12,7 @@ import binascii
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import (
|
||||
ArgumentSpec,
|
||||
)
|
||||
@@ -49,14 +50,15 @@ from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import ( # pragma: no cover
|
||||
CertificatePrivateKeyTypes,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificateIssuerPrivateKeyTypes,
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import ( # pragma: no cover
|
||||
CertificatePrivateKeyTypes,
|
||||
)
|
||||
|
||||
_ET = t.TypeVar("_ET", bound="cryptography.x509.ExtensionType") # pragma: no cover
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import binascii
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import (
|
||||
cryptography_decode_name,
|
||||
cryptography_get_extensions_from_csr,
|
||||
@@ -32,16 +33,17 @@ from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificatePublicKeyTypes,
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._filter_module import ( # pragma: no cover
|
||||
FilterModuleMock,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificatePublicKeyTypes,
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
GeneralAnsibleModule = t.Union[
|
||||
AnsibleModule, AnsibleActionModule, FilterModuleMock
|
||||
|
||||
@@ -13,6 +13,7 @@ import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import (
|
||||
ArgumentSpec,
|
||||
)
|
||||
@@ -38,13 +39,14 @@ from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
|
||||
GeneralAnsibleModule = t.Union[
|
||||
AnsibleModule, AnsibleActionModule
|
||||
] # pragma: no cover
|
||||
|
||||
@@ -11,6 +11,7 @@ import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._argspec import (
|
||||
ArgumentSpec,
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ from __future__ import annotations
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.basic import (
|
||||
OpenSSLObjectError,
|
||||
)
|
||||
@@ -34,15 +35,16 @@ from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._filter_module import ( # pragma: no cover
|
||||
FilterModuleMock,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
GeneralAnsibleModule = t.Union[
|
||||
AnsibleModule, AnsibleActionModule, FilterModuleMock
|
||||
|
||||
@@ -24,15 +24,16 @@ from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PublicKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._filter_module import ( # pragma: no cover
|
||||
FilterModuleMock,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
PublicKeyTypes,
|
||||
)
|
||||
|
||||
GeneralAnsibleModule = t.Union[
|
||||
AnsibleModule, AnsibleActionModule, FilterModuleMock
|
||||
|
||||
@@ -14,6 +14,7 @@ import os
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import (
|
||||
is_potential_certificate_issuer_private_key,
|
||||
is_potential_certificate_private_key,
|
||||
@@ -40,15 +41,16 @@ from ansible_collections.community.crypto.plugins.module_utils._crypto.basic imp
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import ( # pragma: no cover
|
||||
CertificatePrivateKeyTypes,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificateIssuerPrivateKeyTypes,
|
||||
PrivateKeyTypes,
|
||||
PublicKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.cryptography_support import ( # pragma: no cover
|
||||
CertificatePrivateKeyTypes,
|
||||
)
|
||||
|
||||
|
||||
# This list of preferred fingerprints is used when prefer_one=True is supplied to the
|
||||
# fingerprinting methods.
|
||||
|
||||
@@ -17,6 +17,7 @@ import traceback
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._version import (
|
||||
LooseVersion,
|
||||
)
|
||||
@@ -24,6 +25,7 @@ from ansible_collections.community.crypto.plugins.module_utils._version import (
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
|
||||
from ansible_collections.community.crypto.plugins.plugin_utils._action_module import ( # pragma: no cover
|
||||
AnsibleActionModule,
|
||||
)
|
||||
|
||||
@@ -20,14 +20,15 @@ from ansible_collections.community.crypto.plugins.module_utils._openssh.utils im
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
from ansible.module_utils.basic import AnsibleModule # pragma: no cover
|
||||
from ansible_collections.community.crypto.plugins.module_utils._openssh.certificate import ( # pragma: no cover
|
||||
OpensshCertificateTimeParameters,
|
||||
)
|
||||
from cryptography.hazmat.primitives.asymmetric.types import ( # pragma: no cover
|
||||
CertificateIssuerPrivateKeyTypes,
|
||||
PrivateKeyTypes,
|
||||
)
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._openssh.certificate import ( # pragma: no cover
|
||||
OpensshCertificateTimeParameters,
|
||||
)
|
||||
|
||||
Param = t.ParamSpec("Param") # pragma: no cover
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import typing as t
|
||||
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._cryptography_dep import (
|
||||
COLLECTION_MINIMUM_CRYPTOGRAPHY_VERSION,
|
||||
)
|
||||
|
||||
@@ -17,6 +17,7 @@ from datetime import datetime
|
||||
from hashlib import sha256
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._openssh.utils import (
|
||||
OpensshParser,
|
||||
_OpensshWriter,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.math import (
|
||||
convert_int_to_hex,
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ import datetime
|
||||
import re
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils._crypto.basic import (
|
||||
OpenSSLObjectError,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user