Deed JWT
General-purpose HS256 sign/verify, signed with a 32-byte key unique to your slice. You never see, set, or rotate it. The platform holds it and uses it on both sides. KeyAuth mints its tokens through this primitive, and Pocket verifies them.
token, _ := drift.Deed.JWT.Issue(drift.JWTClaims{Sub: user.ID, Exp: exp})
claims, err := drift.Deed.JWT.Verify(token, drift.JWTVerifyOptions{})Issue requires an exp in the future and refuses without one; iat, iss and jti are filled in for you. Verify checks the signature, the algorithm, exp, nbf, and that iss is this slice, plus aud when you pass an audience. A failure carries one of ten stable reasons: malformed, bad_signature, expired, not_yet_valid, wrong_algorithm, wrong_issuer, wrong_audience, invalid_claims, missing_exp, internal_error.
Verify session tokens inside the function.
The route gate understands one thing: a function's
auth { api_key = env("NAME") }. The auth block takes no other attribute, so drift file lint refuses a token mode offline. A route that needs a session declares no auth block, reads the Authorization header itself and calls JWT.Verify.