The cross-language contract. Every function takes and returns JSON-shaped data only: maps with string keys, vectors, strings, numbers, booleans and nil, with no keywords. Language adapters (JavaScript, Python, .NET, the command line) pass this data across their boundary unchanged.
Keys are kebab-case, as in PSOSF's own JSON files.
classify entries [options] -> {"level" "invalid"|"valid"|"compatible", "errors" [...], "warnings" [...], "compatibility-errors" [...], "archive" {...}} read entries -> {"archive" {...}, "errors" [...], "warnings" [...]} write archive -> entries diff entries entries -> diff (complete and versioned; see psosf.diff) summarize diff [options] -> {"summary" "...", "details" "...", "report" ["..."]} patch entries diff -> entries
entries is a map of archive path to file text. options may hold "allowed-functions", a list of function names.
classify-json and friends take and return JSON text, for adapters that cross a C or process boundary.
The cross-language contract. Every function takes and returns JSON-shaped
data only: maps with string keys, vectors, strings, numbers, booleans and
nil, with no keywords. Language adapters (JavaScript, Python, .NET, the
command line) pass this data across their boundary unchanged.
Keys are kebab-case, as in PSOSF's own JSON files.
classify entries [options] -> {"level" "invalid"|"valid"|"compatible",
"errors" [...], "warnings" [...],
"compatibility-errors" [...], "archive" {...}}
read entries -> {"archive" {...}, "errors" [...], "warnings" [...]}
write archive -> entries
diff entries entries -> diff (complete and versioned; see psosf.diff)
summarize diff [options] -> {"summary" "...", "details" "...", "report" ["..."]}
patch entries diff -> entries
entries is a map of archive path to file text. options may hold
"allowed-functions", a list of function names.
classify-json and friends take and return JSON text, for adapters that
cross a C or process boundary.(attach-signature-json text){"entries", "key-id", "role", "signer", "signed-at", "signature", "public-key"?} -> {"entries"}. With public-key, a signature that does not verify is refused.
{"entries", "key-id", "role", "signer", "signed-at", "signature",
"public-key"?} -> {"entries"}. With public-key, a signature that does
not verify is refused.(call-java f request)For the Java class: calls the JSON function named f + "-json" with a request built from Java collections. The result is Clojure maps and vectors, which Java sees as java.util.Map and java.util.List.
For the Java class: calls the JSON function named f + "-json" with a request built from Java collections. The result is Clojure maps and vectors, which Java sees as java.util.Map and java.util.List.
(classify-file path)(classify-file path options)Reads and classifies a .psosf file (JVM). Same result shape as classify; an archive that cannot be read is reported as invalid.
Reads and classifies a .psosf file (JVM). Same result shape as classify; an archive that cannot be read is reported as invalid.
(classify-file-json text){"path", "options"?} -> classify result, as JSON text.
{"path", "options"?} -> classify result, as JSON text.
(classify-json text){"entries": {...}, "options": {...}} -> result, as JSON text.
{"entries": {...}, "options": {...}} -> result, as JSON text.
(diff entries-a entries-b)The diff between two archives, as JSON-shaped data: a complete, versioned description of every change. Pass it to summarize for people, or to patch to apply it. See psosf.diff.
The diff between two archives, as JSON-shaped data: a complete, versioned description of every change. Pass it to summarize for people, or to patch to apply it. See psosf.diff.
(diff-files-json text){"from": path, "to": path} -> the diff, as JSON text. Each .psosf file is read as untrusted input.
{"from": path, "to": path} -> the diff, as JSON text. Each .psosf file
is read as untrusted input.(diff-json text){"from": entries, "to": entries} -> the diff, as JSON text.
{"from": entries, "to": entries} -> the diff, as JSON text.
(generate-key-json _){} -> {"private-key", "public-key"}: a new Ed25519 key pair, each as the Base64 of its raw 32 bytes. For callers without their own key generator.
{} -> {"private-key", "public-key"}: a new Ed25519 key pair, each as the
Base64 of its raw 32 bytes. For callers without their own key generator.(parse-json-java text)JSON text as Java-compatible data, for the Java class's fromJson.
JSON text as Java-compatible data, for the Java class's fromJson.
(patch entries d)Applies a diff to the archive it was made from: the patched entries. Throws when the archive isn't the one the diff expects.
Applies a diff to the archive it was made from: the patched entries. Throws when the archive isn't the one the diff expects.
(patch-json text){"entries": entries, "diff": diff} -> {"entries"}, as JSON text.
{"entries": entries, "diff": diff} -> {"entries"}, as JSON text.
(read-file-json text){"path"} -> {"entries", "errors"}: a .psosf file read as hostile input.
{"path"} -> {"entries", "errors"}: a .psosf file read as hostile input.
(read-json text){"entries": {...}} -> {"archive" ..., "errors" ..., "warnings" ...}, as JSON text.
{"entries": {...}} -> {"archive" ..., "errors" ..., "warnings" ...}, as JSON text.
(sign-json text){"entries", "private-key" (Base64 raw 32-byte seed), "key-id", "role", "signer", "signed-at"} -> {"entries"}.
{"entries", "private-key" (Base64 raw 32-byte seed), "key-id", "role",
"signer", "signed-at"} -> {"entries"}.(signing-message-json text){"entries", "key-id", "role", "signer", "signed-at"} -> {"message"}: the exact text to sign, for signing in two steps.
{"entries", "key-id", "role", "signer", "signed-at"} -> {"message"}:
the exact text to sign, for signing in two steps.(summarize d)(summarize d {:strs [max-rows]})A diff for people: "summary" one paragraph "details" Markdown: which formulas, data, directives and columns changed, to what, and where, by cell address (input worksheets give the affected row numbers) "report" compact lines, one per change "max-rows" caps each section (default 50 for details, 20 for the report).
A diff for people:
"summary" one paragraph
"details" Markdown: which formulas, data, directives and columns changed,
to what, and where, by cell address (input worksheets give the
affected row numbers)
"report" compact lines, one per change
"max-rows" caps each section (default 50 for details, 20 for the report).(summarize-json text){"diff": diff, "options"?: {"max-rows"}} -> {"summary", "report"}, as JSON text.
{"diff": diff, "options"?: {"max-rows"}} -> {"summary", "report"}, as JSON text.
(verify-json text){"entries", "keys": [key records], "received-at"?, "approver-custody"?} -> verification result, as JSON text. See psosf.sign.
{"entries", "keys": [key records], "received-at"?, "approver-custody"?}
-> verification result, as JSON text. See psosf.sign.(write-file-json text){"path", "entries"} -> {}: writes entries to a .psosf file.
{"path", "entries"} -> {}: writes entries to a .psosf file.
(write-json text){"archive": {...}} -> {"entries": {...}}, as JSON text.
{"archive": {...}} -> {"entries": {...}}, as JSON text.
(write-json-java x)Java collections as canonical JSON text, for the Java class's toJson.
Java collections as canonical JSON text, for the Java class's toJson.
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 |