Fix assert_required_cryptography_version() calls.

This commit is contained in:
Felix Fontein
2025-05-03 12:55:50 +02:00
parent 83beb7148c
commit 12f958c955
20 changed files with 60 additions and 20 deletions

View File

@@ -330,7 +330,9 @@ def select_backend(module, provider):
"""
provider.validate_module_args(module)
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
if provider.needs_version_two_certs(module):
# TODO: remove

View File

@@ -434,5 +434,7 @@ def get_certificate_info(module, content, prefer_one_fingerprint=False):
def select_backend(module, content):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return CertificateInfoRetrievalCryptography(module, content)

View File

@@ -84,7 +84,9 @@ class CRLInfoRetrieval:
def get_crl_info(module, content, list_revoked_certificates=True):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
info = CRLInfoRetrieval(
module, content, list_revoked_certificates=list_revoked_certificates
)

View File

@@ -733,7 +733,9 @@ class CertificateSigningRequestCryptographyBackend(CertificateSigningRequestBack
def select_backend(module):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return CertificateSigningRequestCryptographyBackend(module)

View File

@@ -348,7 +348,9 @@ def get_csr_info(
def select_backend(module, content, validate_signature=True):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return CSRInfoRetrievalCryptography(
module, content, validate_signature=validate_signature
)

View File

@@ -542,7 +542,9 @@ class PrivateKeyCryptographyBackend(PrivateKeyBackend):
def select_backend(module):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return PrivateKeyCryptographyBackend(module)

View File

@@ -248,7 +248,9 @@ class PrivateKeyConvertCryptographyBackend(PrivateKeyConvertBackend):
def select_backend(module):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return PrivateKeyConvertCryptographyBackend(module)

View File

@@ -297,7 +297,9 @@ def select_backend(
return_private_key_data=False,
check_consistency=False,
):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return PrivateKeyInfoRetrievalCryptography(
module,
content,

View File

@@ -144,5 +144,7 @@ def get_publickey_info(module, content=None, key=None, prefer_one_fingerprint=Fa
def select_backend(module, content=None, key=None):
assert_required_cryptography_version(MINIMAL_CRYPTOGRAPHY_VERSION)
assert_required_cryptography_version(
module, minimum_cryptography_version=MINIMAL_CRYPTOGRAPHY_VERSION
)
return PublicKeyInfoRetrievalCryptography(module, content=content, key=key)