Homework — single-use in SQL, and the caveat in your words
Expand the app. Give your app a tamper-evident artifact if it has one, or work on SignFlow.
-
Prove single-use in SQL. Open
psqland runUPDATE signers SET status='signed', signed_at=now() WHERE id='<a pending signer>';— then try to sign that link. You get the signed state, not an error, andSignSignerreports zero rows. Explain, in one sentence, why theWHERE status='pending'guard makes signing idempotent without any Go bookkeeping. -
Recompute vs trust. In
Sign, temporarily writedoc.FileHashintosigned_doc_hashinstead ofinteg.CurrentHash. Now tamper with the file and sign. What does the signature record? Why is that a lie, and why does recomputing from the bytes fix it? Revert. -
The completion boundary. Send a document to three signers. Sign as two of them and check the document status (
sent). Sign as the third and check again (completed). Look at the log line'sremaining=count across the three signs. Where, exactly, does completion happen — and why is it in the same transaction as the final signature? -
Say the caveat in your own words. In three sentences, write what this signature is and three things it is not. Then name one real situation where tamper-evidence is enough, and one where it is not (and a qualified/eIDAS signature would be required). This is the honesty the lesson is built on.
Next lesson makes every one of these state changes permanent: an append-only audit trail, enforced by the database itself — so "who did what, when" survives even the deletion of the document it describes.