Skip to content

Add --title flag and polish attestation rendering#290

Draft
stevenolen wants to merge 1 commit into
mainfrom
attestation-title-flag
Draft

Add --title flag and polish attestation rendering#290
stevenolen wants to merge 1 commit into
mainfrom
attestation-title-flag

Conversation

@stevenolen
Copy link
Copy Markdown
Contributor

Description

Three small improvements to ptd attestation driven by customer feedback on a generated document.

  1. New --title flag overrides the rendered document title. Default behavior is unchanged: when the flag is not set, the title remains "Installation Confirmation — <target>". The flag is helpful when the internal workload name does not match the identifier a recipient expects at the top of the document.
  2. Widen the Identity Provider column in the PDF auth table. The previous column widths [4, 3, 5] truncated long OIDC issuer URLs (e.g. Entra ID tenant URLs). Rebalanced to [3, 1, 8] since the Method column only renders short strings like oidc.
  3. Surface the generation timestamp explicitly near the Sign-Off block in both the markdown and PDF renderers, and pre-fill the Prepared By date with the generation date. The date is still editable by anyone signing manually.

Code Flow

AttestationData gains a Title field and a DisplayTitle() method. The renderers (markdown.go, pdf.go) now call DisplayTitle() instead of inlining the default. The CLI sets data.Title from the new flag before invoking the renderers.

PdfSignatureRow now takes an optional date argument so the sign-off row can be pre-filled.

Category of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have reviewed my own diff and added inline comments on lines I want reviewers to focus on or that I am uncertain about

Verification

  • just test-lib (attestation package tests pass)
  • just cli builds cleanly
  • ptd attestation --help shows the new flag with the documented default

- New --title flag on `ptd attestation` overrides the document title
  (default unchanged: "Installation Confirmation — <target>"). Useful
  when a workload name does not match what a customer expects to see
  at the top of the document.
- Widen the Identity Provider column in the PDF so long OIDC issuer
  URLs are not truncated; rebalance auth table widths from [4,3,5] to
  [3,1,8] since the Method column only needs to fit short strings
  like "oidc".
- Surface the generation timestamp near the Sign-Off block in both
  the markdown and PDF renderers, and pre-fill the Prepared By date
  with the generation date.
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