Skip to content

feat: ✨ Add leapday_expiry and weekend_expiry validation#2

Closed
cdtomkins wants to merge 2 commits into
bradh11:developfrom
cdtomkins:additional_expiry_checks
Closed

feat: ✨ Add leapday_expiry and weekend_expiry validation#2
cdtomkins wants to merge 2 commits into
bradh11:developfrom
cdtomkins:additional_expiry_checks

Conversation

@cdtomkins
Copy link
Copy Markdown
Contributor

Added two ops-friendly checks - leapday_expiry and weekend_expiry validation

Added two ops-friendly checks - leapday_expiry and weekend_expiry validation
@cdtomkins cdtomkins force-pushed the additional_expiry_checks branch from debdfe6 to 90be45f Compare May 20, 2025 16:01
@bradh11 bradh11 self-assigned this May 21, 2025
@bradh11
Copy link
Copy Markdown
Owner

bradh11 commented May 21, 2025

Just thinking about this - does it make more sense as its own validator instead? The expiry validator is mostly focused on whether the cert has gone beyond (or is approaching) its expiration date.

It seems the focus on this enhancement is to focus on “special days” like does it expire on a weekend, or on a leap year date. If you created a validator for “special dates” (or you could come up with a better name) then it could potentially be more universally useable. For example with a “special dates” validator you could in theory also check a list of dates that the user passes on as a validator argument (similar to how sans one works).

so the built ins for the new validator would include

  • Weekend expiration check
  • Leap day expiration check
  • Evaluated list of dates (maybe a dict input for key/value such as holiday_name/date) - passed in as arts

this would also allow you to get more details in for “warnings” for the particular cases.

@bradh11
Copy link
Copy Markdown
Owner

bradh11 commented May 21, 2025

For reference, here is the documentation on how to pass Args to a validator.

https://certmonitor.readthedocs.io/en/latest/usage/validator_args/

@cdtomkins
Copy link
Copy Markdown
Contributor Author

cdtomkins commented May 21, 2025

Yes, I agree that it would work nicely as an additional validator. I will do that. We're zero-dependency here obviously, but in relation to the functionality you described, I will make it very easy to pass holidays from, say, the Holidays library. Sound good?

@bradh11
Copy link
Copy Markdown
Owner

bradh11 commented May 21, 2025

Yes, I agree that it would work nicely as an additional validator. I will do that. We're zero-dependency here obviously, but in relation to the functionality you described, I will make it very easy to pass holidays from, say, the Holidays library. Sound good?

Yes. I would say make the validator in such a way that you just pass an arbitrary list of dates in. Then it would be up to the user as to what meaning the dates actually have and they could derive it from some other library if they choose. That way we stay zero dependencies and leave it up to the user. I’d stay away from calling it holiday or using a specific term since the use cases could be any date deemed important or appropriate to warn against an expiration happening that particular day (example of a non holiday date might be like the IT admins grandparents anniversary, or the day they have to renew their drivers license :-) ).

You’ll need a way for the user to pass in the meaning along with the dates so that you can populate the warning field appropriately.

[
{“my_anniversary”: date_obj},
{“international_ice_cream_day”: date_obj},
etc…
]

Something like this ☝️

@bradh11 bradh11 changed the base branch from main to develop May 25, 2025 01:18
@cdtomkins
Copy link
Copy Markdown
Contributor Author

cdtomkins commented May 27, 2025

I will resubmit this with a new PR to simplify merging.

@cdtomkins cdtomkins closed this May 27, 2025
@cdtomkins cdtomkins deleted the additional_expiry_checks branch May 27, 2025 16:21
@bradh11
Copy link
Copy Markdown
Owner

bradh11 commented May 27, 2025

Sounds good. Look forward to it

@cdtomkins cdtomkins mentioned this pull request Jun 2, 2025
23 tasks
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.

2 participants