Menu

Signed share links: expiry, revocation and the clock skew that breaks both
πŸ“°

Signed share links: expiry, revocation and the clock skew that breaks both

DEV Community: postgresΒ·RevercueΒ·2 days ago
#wOruQdHR
#devtopostgresql#devto#dev#document#client
Long article (1570 words) β€” no AI summary yet.
Reading 0:00
15s threshold

A client opens a proposal link four seconds early and sees "This link has expired". Another forwards a link from last year's project and it still resolves to a document that mentions a price you no longer charge.

Both are the same bug: the link had no opinion about time, or its opinion was checked against the wrong clock.

A share link makes three claims β€” which document , what the holder may do , until when β€” and only the third one gets tested by reality, usually in front of a client. Here is a design that survives forwarding, revocation and a server whose clock drifts.

Start with what the token has to say

Keep the payload small and boring. A version, the subject, the scope, the issuer's timestamps, and a nonce:

{ "v" : 1 , "doc" : "9f1c2a4e-..." , "scope" : "view" , "iss" : "revercue.co.uk" , "iat" : 1795948800 , "exp" : 1797158400 , "jti" : "7d2f9c1e" }

Enter fullscreen mode

Exit fullscreen mode

Six fields do the work:

scope β€” view , comment or sign .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.