Signed cursor
A signed cursor is a pagination cursor containing a version, an encoded position payload, and an HMAC authentication tag. The server verifies the tag before accepting the position, allowing it to reject cursors that clients have modified or forged. Signing prevents forgery but does not prevent replay of an older valid cursor.
Minimal example
payload := base64.RawURLEncoding.EncodeToString(data)
message := "v1." + payload
mac := hmac.New(sha256.New, secret)
mac.Write([]byte(message))
token := message + "." + base64.RawURLEncoding.EncodeToString(mac.Sum(nil))