Maps signed with a secret into URL-safe texts, so that a value can make a round trip through a browser, e.g. in a URL or a form, and come back unchanged, with nothing stored.
A signed map has a kind, a keyword such as :comment, so that one kind never passes for another, and the instant it was signed, so that unsign refuses it after the lifetime you give. The secret is a text of 32 bytes or more, e.g. a token of indieauth/token kept in your configuration, and can be a hidden text of wary-fetch. The map holds EDN values, e.g. texts, keywords, numbers and instants.
Maps signed with a secret into URL-safe texts, so that a value can make a round trip through a browser, e.g. in a URL or a form, and come back unchanged, with nothing stored. A signed map has a kind, a keyword such as :comment, so that one kind never passes for another, and the instant it was signed, so that unsign refuses it after the lifetime you give. The secret is a text of 32 bytes or more, e.g. a token of indieauth/token kept in your configuration, and can be a hidden text of wary-fetch. The map holds EDN values, e.g. texts, keywords, numbers and instants.
(derive-text secret purpose s)A URL-safe text that only the secret gives for the text s and the
purpose, a text, e.g. the PKCE code verifier of a signed state, which
then needs no storing.
A URL-safe text that only the `secret` gives for the text `s` and the `purpose`, a text, e.g. the PKCE code verifier of a signed state, which then needs no storing.
(sign secret kind m)(sign secret kind m at)The map m of the kind, a keyword, signed with the secret at the
instant at, now by default, as a URL-safe text. A secret of fewer than
32 bytes throws.
(sign secret :comment {:me "https://user.example/"})
The map `m` of the `kind`, a keyword, signed with the `secret` at the
instant `at`, now by default, as a URL-safe text. A secret of fewer than
32 bytes throws.
(sign secret :comment {:me "https://user.example/"})(unsign secret kind s max-seconds)(unsign secret kind s at max-seconds)The map of the kind that the text s holds, if the secret signed it
at most max-seconds before the instant at, now by default. Else nil:
for a text that's expired or of another kind, that another secret
signed, that was changed, or that isn't a signed text at all.
(unsign secret :comment s 1800)
The map of the `kind` that the text `s` holds, if the `secret` signed it
at most `max-seconds` before the instant `at`, now by default. Else nil:
for a text that's expired or of another kind, that another secret
signed, that was changed, or that isn't a signed text at all.
(unsign secret :comment s 1800)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |