Skip to content

License validation: WARNING during the renewal grace period - #4667

Merged
jbogard merged 1 commit into
mainfrom
license-grace-period
Oct 26, 2026
Merged

jbogard merged 1 commit into
mainfrom
license-grace-period

Conversation

@jbogard

@jbogard jbogard commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Client half of LuckyPennySoftware/Website#382 (website side: LuckyPennySoftware/Website#391).

Problem

A renewed license key can only be issued once the renewal bills, and that's the old key's exp. The log went straight from INFO to ERROR, usually on the first deploy after renewal and before the new key was in place.

Changes

  • License reads a new term_end claim. Newly issued keys have exp = term end + 30 days.
  • LicenseValidator now has three levels:
    • before the term end → INFO (the message now shows the term end)
    • past the term end, within the grace → WARNING: "ended N days ago. Update your license key by YYYY-MM-DD (M days remaining)…"
    • past the grace → ERROR, as before
  • Keys without term_end were issued before this change. Their exp is the term end, so they get a built-in 30-day grace (DefaultGracePeriodDays) counted from exp.
  • When term_end is present, it replaces exp as the perpetual build-date cutoff, so builds released during the grace window don't qualify.
  • No warning before expiry. Auto-renewing customers have no new key to swap in yet.
  • Docs: License-configuration.md explains the grace period.

Tests

  • Existing legacy-key expiry tests moved past the fallback grace (so they still assert ERROR).
  • New tests cover: WARNING within the grace, ERROR after it, valid before the term end, the legacy-key fallback, and the perpetual cutoff on term_end (both directions).

🤖 Generated with Claude Code

A renewed license key can only be issued once the renewal bills, which is the old key's expiration,
so customers went straight from INFO to ERROR before they could deploy it. Keys now carry a term_end
claim (exp = term end + grace). Past term_end but within the grace, the validator logs a WARNING
with the date to update by; past the grace, ERROR as before. Keys without term_end get a 30-day grace
from exp. term_end (when present) is the perpetual build-date cutoff.

LuckyPennySoftware/Website#382

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 18:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T18:24:21.268454Z 511dbf5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes match the intended licensing behavior, include regression coverage, and have no identified blocking issues.

No open issues 🎉

What changed in this PR

Adds renewal grace-period logging to AutoMapper licensing, giving customers time to deploy renewed keys without immediate license errors.

Changes:

  • Reads term_end to distinguish the subscription term from the key’s expiration.
  • Logs warnings during the grace period, with a 30-day fallback for legacy keys, while preserving the perpetual-license cutoff at term end.
  • Adds regression tests and documents the renewal grace period.
File Description
src/​UnitTests/​Licensing/​LicenseValidatorTests.cs Covers grace-period logging, legacy keys, and perpetual-license cutoffs.
src/​AutoMapper/​Licensing/​LicenseValidator.cs Implements grace-period warnings and term-based validation.
src/​AutoMapper/​Licensing/​License.cs Parses and exposes the term_end claim.
docs/​source/​License-configuration.md Explains renewal grace periods and warning behavior.

Review effort: Balanced

@jbogard
jbogard merged commit 9ea4f49 into main Oct 26, 2026
6 checks passed
@jbogard
jbogard deleted the license-grace-period branch October 26, 2026 19:00
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