Skip to content

Commit

Permalink
Deprecate the default value 'false' of asn1_base64. (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Aug 12, 2023
1 parent 5526fca commit 62c8425
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/600-get_certificate-asn1_base64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deprecated_features:
- "get_certificate - the default ``false`` of the ``asn1_base64`` option is deprecated and will change to ``true`` in community.crypto 3.0.0 (https://github.com/ansible-collections/community.crypto/pull/600)."
16 changes: 12 additions & 4 deletions plugins/modules/get_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@
description:
- Whether to encode the ASN.1 values in the RV(extensions) return value with Base64 or not.
- The documentation claimed for a long time that the values are Base64 encoded, but they
never were. For compatibility this option is set to V(false), but that value will eventually
be deprecated and changed to V(true).
never were. For compatibility this option is set to V(false).
- The default value V(false) is B(deprecated) and will change to V(true) in community.crypto 3.0.0.
type: bool
default: false
version_added: 2.12.0
notes:
Expand Down Expand Up @@ -272,7 +271,7 @@ def main():
select_crypto_backend=dict(type='str', choices=['auto', 'cryptography'], default='auto'),
starttls=dict(type='str', choices=['mysql']),
ciphers=dict(type='list', elements='str'),
asn1_base64=dict(type='bool', default=False),
asn1_base64=dict(type='bool'),
),
)

Expand All @@ -286,6 +285,15 @@ def main():
start_tls_server_type = module.params.get('starttls')
ciphers = module.params.get('ciphers')
asn1_base64 = module.params['asn1_base64']
if asn1_base64 is None:
module.deprecate(
'The default value `false` for asn1_base64 is deprecated and will change to `true` in '
'community.crypto 3.0.0. If you need this value, it is best to set the value explicitly '
'and adjust your roles/playbooks to use `asn1_base64=true` as soon as possible',
version='3.0.0',
collection_name='community.crypto',
)
asn1_base64 = False

backend = module.params.get('select_crypto_backend')
if backend == 'auto':
Expand Down

0 comments on commit 62c8425

Please sign in to comment.