bookclerk_plugin_manifest::id
Display-alias grammar shared by manifest parse, host registry, and SDKs.
The id is a presentation alias unique within one host plugin namespace
($BOOKCLERK_FILES_DIR). It is not a durable security identity — that is the
provenance-qualified PluginKey. The grammar is non-lossy:
characters that would need rewriting (for example / → _) are rejected
instead of sanitized, so a/b and a_b cannot collide as aliases.
pub fn validate_plugin_id(id: &str) -> Result<()>
Validates a plugin id against the strict install grammar.
Accepted form: [a-z0-9_]{2,32} with no leading or trailing _, no
consecutive __, and no leading/trailing whitespace (whitespace is not
trimmed — " echo" ≠ "echo").
id- Candidate id string exactly as it appears inplugin.tomlor registry input (do not trim beforehand if you need the whitespace check).
Ok(()) when the id is valid.
Returns Error::Message describing the first failed rule (length,
charset, underscore placement, or whitespace).
use bookclerk_plugin_manifest::validate_plugin_id;
assert!(validate_plugin_id("sqlite").is_ok());
assert!(validate_plugin_id("my_store").is_ok());
assert!(validate_plugin_id("a/b").is_err());
assert!(validate_plugin_id("_bad").is_err());
Generated from crates/bookclerk-plugin-manifest at main · View as Markdown