use serde_json::Value;
use super::Verb;
pub const ENROLL: Verb = Verb {
word: "enroll",
params: &["workspace", "name", "grade"],
flags: &[],
summary: "mint a new box's material and say it as a code, a line and, if asked, four files",
detail: "The engine mints a leaf on its own CA, seats the client in that \
workspace, answers the material and shreds the key. What comes \
back is REMOTE §8.4's envelope — one line of compact JSON under \
`{\"yog-enroll\":1,…}` — and there are three ways to take those \
same bytes: a QR symbol for a camera, the line itself for the \
paste box an android seat offers, and `--into <dir>` for a box \
with neither, which writes the four files an entry is (`ca.pem`, \
`client.pem`, `client.key`, `address`) into that directory for \
you to carry to the machine they are for. `--at <host>:<port>` \
states the route THAT box will dial, which is a fact about it and \
not about this engine: unstated is the engine's own address, \
which is right only for a device that shares this box's view of \
it. YOU PICK ONE: with no \
`--into` the symbol and the line are both printed and this seat \
keeps NOTHING — not a file, not a cache, not a log line; with \
one, the key goes to the files and never to this terminal, which \
is the one place the act could not shred it afterwards. \
`lernie --json enroll …` is for a script: stdout is the envelope \
alone, on one line, with no symbol and nothing else — and with \
`--into` it is empty, because the material went to the files. \
`grade` \
is `operator` or `foot`. It is refused unless this box's own leaf \
is operator-grade — the new box says nothing and performs no act, \
which is why this is not the in-channel bootstrap REMOTE §1.4 \
forbids.",
};
pub const ADDRESS: &str = "address";
pub fn enroll(workspace: String, name: String, grade: String, address: Option<String>) -> Value {
ENROLL.stating(vec![workspace, name, grade], ADDRESS, address)
}
#[cfg(test)]
mod tests;