Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor time code, add tests, fix bug when parsing absolute timestamps that omit seconds #745

Merged
merged 4 commits into from
May 3, 2024

Conversation

felixfontein
Copy link
Contributor

SUMMARY

Move various time-specific code to a time module utils and adds tests.

While working on this I noticed a bug when parsing absolute timestamps without seconds for the cryptography backend. Python's datetime.datetime.strptime() function accepts a two-digit minute count as a minute + second count if no further digit is present, apparently, which results in badly parsed timestamps.

ISSUE TYPE
  • Bugfix Pull Request
  • Test Pull Request
  • Refactoring Pull Request
COMPONENT NAME

acme backends module utils
crypto.support module utils

@felixfontein felixfontein merged commit 0a15be1 into ansible-collections:main May 3, 2024
142 checks passed
@felixfontein felixfontein deleted the time branch May 3, 2024 20:25
felixfontein added a commit that referenced this pull request May 11, 2024
Revert "Fix documentation. (#751)"
Revert "ACME modules: simplify code, refactor argspec handling code, move csr/csr_content to own docs fragment (#750)"
Revert "Refactor and extend argument spec helper, use for ACME modules (#749)"
Revert "Avoid exception if certificate has no AKI in acme_certificate. (#748)"
Revert "ACME: improve acme_certificate docs, include cert_id in acme_certificate_renewal_info return value (#747)"
Revert "Add acme_certificate_renewal_info module (#746)"
Revert "Refactor time code, add tests, fix bug when parsing absolute timestamps that omit seconds (#745)"
Revert "Add tests for acme_certificate_deactivate_authz module. (#744)"
Revert "Create acme_certificate_deactivate_authz module (#741)"
Revert "acme_certificate: allow to request renewal of a certificate according to ARI (#739)"
Revert "Implement basic acme_ari_info module. (#732)"
Revert "Add function for retrieval of ARI information. (#738)"
Revert "acme module utils: add functions for parsing Retry-After header values and computation of ARI certificate IDs (#737)"
Revert "Implement certificate information retrieval code in the ACME backends. (#736)"
Revert "Split up the default acme docs fragment to allow modules ot not need account data. (#735)"

This reverts commits 5e59c52, aa82575,
f3c9cb7, f82b335, 553ab45,
59606d4, 0a15be1, 9501a28,
d906914, 33d278a, 6d4fc58,
9614b09, af5f4b5, c6fbe58,
and afe7f75.
austinlucaslake pushed a commit to austinlucaslake/community.crypto that referenced this pull request May 25, 2024
…ps that omit seconds (ansible-collections#745)

* Add time module utils.

* Add time helpers to ACME backend.

* Add changelog fragment.

* ACME timestamp parser: do not choke on nanoseconds.
austinlucaslake pushed a commit to austinlucaslake/community.crypto that referenced this pull request May 25, 2024
Revert "Fix documentation. (ansible-collections#751)"
Revert "ACME modules: simplify code, refactor argspec handling code, move csr/csr_content to own docs fragment (ansible-collections#750)"
Revert "Refactor and extend argument spec helper, use for ACME modules (ansible-collections#749)"
Revert "Avoid exception if certificate has no AKI in acme_certificate. (ansible-collections#748)"
Revert "ACME: improve acme_certificate docs, include cert_id in acme_certificate_renewal_info return value (ansible-collections#747)"
Revert "Add acme_certificate_renewal_info module (ansible-collections#746)"
Revert "Refactor time code, add tests, fix bug when parsing absolute timestamps that omit seconds (ansible-collections#745)"
Revert "Add tests for acme_certificate_deactivate_authz module. (ansible-collections#744)"
Revert "Create acme_certificate_deactivate_authz module (ansible-collections#741)"
Revert "acme_certificate: allow to request renewal of a certificate according to ARI (ansible-collections#739)"
Revert "Implement basic acme_ari_info module. (ansible-collections#732)"
Revert "Add function for retrieval of ARI information. (ansible-collections#738)"
Revert "acme module utils: add functions for parsing Retry-After header values and computation of ARI certificate IDs (ansible-collections#737)"
Revert "Implement certificate information retrieval code in the ACME backends. (ansible-collections#736)"
Revert "Split up the default acme docs fragment to allow modules ot not need account data. (ansible-collections#735)"

This reverts commits 5e59c52, aa82575,
f3c9cb7, f82b335, 553ab45,
59606d4, 0a15be1, 9501a28,
d906914, 33d278a, 6d4fc58,
9614b09, af5f4b5, c6fbe58,
and afe7f75.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant