Skip to content

fix(generate): drop the generation timestamp from all guard templates - #171

Open
cultron wants to merge 2 commits into
mainfrom
fix/129-guard-timestamps
Open

cultron wants to merge 2 commits into
mainfrom
fix/129-guard-timestamps

Conversation

@cultron

@cultron cultron commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Carries @devinpadron1's fix from #152 onto current main, with his commit and authorship intact, and extends it to the two guard templates added since.

apso generate rendered Generated at: <now> into the guard files, so every run of an auth-enabled project rewrote them even with no schema change (#129).

  • d58175b (Devin): removes the line from auth.guard.eta and guards.module.eta, stops passing generatedAt/generatedBy, deletes the unused withGeneratedMeta, and adds a test that generates twice and expects identical output. The only change from fix(generate): drop the generation timestamp from guard templates #152 is a conflict resolution in typescript.ts that keeps main's newer jwt and apiKey fields.
  • 182c7ef: removes the same line from jwt-auth.guard.eta and api-key-auth.guard.eta (added in 0.45). Without it they would render Generated at: undefined. Extends the regeneration test to both.

The stale-file cleanup from #162 keys on the separate "Generated with Apso" header, so it is unaffected.

tsc clean, lint 0 errors, 520 tests pass.

Fixes #129. Supersedes #152.

devinpadron1 and others added 2 commits November 2, 2026 18:17
auth.guard.ts and guards.module.ts rendered "Generated at: <now>", so
apso generate rewrote both files on every run of an auth-enabled
project, even with no schema change.

Remove the line from both templates, finishing 39679b1, which dropped
the same timestamp from the shared header for regen churn and PII. Stop
supplying generatedAt / generatedBy too: withGeneratedMeta (added them
to every render) is deleted, and generateGuards no longer sets its own
copy. No other template read either field.

New test generates the guards twice and expects identical output.

fixes #129
The JWT and API-key guard templates (added in 0.45, after #152 was opened)
print the same "Generated at" line. With generatedAt gone from the template
data they would render "Generated at: undefined", so the line goes from them
as well. Extends Devin's regeneration test to both.

Co-authored-by: Devin <devinpadron28@gmail.com>
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.

Guard templates inject generatedAt/generatedBy, making regeneration non-idempotent for auth-enabled projects

2 participants