-
Notifications
You must be signed in to change notification settings - Fork 90
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
Added 'ignore_timestamps' parameter #381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! Please add a changelog fragment and review the initial comments. Also, I would suggest at least two test cases added here. The first will test that with ignore_timestamps: true
, equivalent relative timestamps for valid_from
/valid_to
, and a valid_at
value within an existing certificates valid time range a subsequent task does not generate a new certificate. The second test is the same, but with ignore_timestamps
omitted which should generate a new certificate.
Co-authored-by: Andrew Pantuso <[email protected]>
Co-authored-by: Andrew Pantuso <[email protected]>
Co-authored-by: Andrew Pantuso <[email protected]>
Co-authored-by: Andrew Pantuso <[email protected]>
Did the proposed changes, added third test for valid_at > valid_to (has to change the cert) |
changelogs/fragments/381_openssh_cert_add_ignore_timestamps.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Felix Fontein <[email protected]>
Out of curiosity, is there a way to run those tests local? I feel bad for spamming your repo. |
You can run them locally as follows: |
Is there any reason to separate valid_at and ignore_timestamps other than it changes behavior? Even the Documentation states:
So I propose to merge ignore_timestamps as a crutch until the next big release and then change default behavior to the less surprising "if valid_at is set, ignore relative time" Please correct me if I miss some use case where you need valid_at and ignore_timestamp false |
I don't see why this is a crutch. From my POV this is the correct change, and somehow coupling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides this, looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for implementing this!
@JochenKorge thanks for implementing this! |
SUMMARY
added 'ignore_timestamps' parameter to openssh_cert so it can be used semi-idempotent with relative timestamps in valid_to/valid_from.
Defaults to false (to be consistent with older versions)
Fixes #379
ISSUE TYPE
COMPONENT NAME
openssh_cert
ADDITIONAL INFORMATION
It´s my (second try on the) first pull-request and I´m new to python, so please be gentle ;)