pub struct ProjectManifest {
pub required: Vec<SecretPath>,
pub optional: Vec<SecretPath>,
pub overrides: BTreeMap<SecretPath, OverrideEntry>,
pub secrets: BTreeMap<SecretPath, IndexEntry>,
}Expand description
In-memory representation of .devboy/secrets.toml.
This loader does not merge with the global index — it is the
raw view of what the project committed. The merge logic (precedence
rules, E_OVERRIDE_FIELD_NOT_ALLOWED for non-allowed fields,
E_SECRET_UNKNOWN_PATH for paths missing from both global and
project-local) lands in epic phase P1.4 (#18).
Fields§
§required: Vec<SecretPath>Paths the project requires to function. doctor returns
non-zero if any are missing.
optional: Vec<SecretPath>Paths the project can use but does not require.
overrides: BTreeMap<SecretPath, OverrideEntry>Behavioural overrides keyed by path.
secrets: BTreeMap<SecretPath, IndexEntry>Project-local entries — paths that do not appear in the global index and whose metadata lives in this manifest.
Implementations§
Source§impl ProjectManifest
impl ProjectManifest
Sourcepub fn new() -> Self
pub fn new() -> Self
Build an empty manifest. Useful for tests and as the default
when .devboy/secrets.toml is absent (the manifest is opt-in
per ADR-020 §4).
Sourcepub fn load() -> Result<Self, ManifestError>
pub fn load() -> Result<Self, ManifestError>
Load the manifest from <cwd>/.devboy/secrets.toml. Returns
an empty manifest if the file does not exist.
Sourcepub fn load_from_project_root(root: &Path) -> Result<Self, ManifestError>
pub fn load_from_project_root(root: &Path) -> Result<Self, ManifestError>
Load the manifest from <project_root>/.devboy/secrets.toml.
Sourcepub fn load_from(path: &Path) -> Result<Self, ManifestError>
pub fn load_from(path: &Path) -> Result<Self, ManifestError>
Load the manifest from a specific file path. Returns an empty manifest if the file does not exist.
Sourcepub fn from_toml_str(body: &str) -> Result<Self, ManifestError>
pub fn from_toml_str(body: &str) -> Result<Self, ManifestError>
Parse from a TOML string with no associated file path (used in tests and when the caller has bytes in memory).
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
true when no required, optional, override, or project-local
entry is declared. doctor treats this as “the project does
not currently depend on any managed secret”.
Sourcepub fn referenced_paths(&self) -> impl Iterator<Item = (&SecretPath, PathRole)>
pub fn referenced_paths(&self) -> impl Iterator<Item = (&SecretPath, PathRole)>
Iterate over every path mentioned by the manifest in any role
(required, optional, override key, project-local secret key),
each tagged with the role it appeared in. Useful for doctor
and the merge logic.
Trait Implementations§
Source§impl Clone for ProjectManifest
impl Clone for ProjectManifest
Source§fn clone(&self) -> ProjectManifest
fn clone(&self) -> ProjectManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectManifest
impl Debug for ProjectManifest
Source§impl Default for ProjectManifest
impl Default for ProjectManifest
Source§fn default() -> ProjectManifest
fn default() -> ProjectManifest
impl Eq for ProjectManifest
Source§impl PartialEq for ProjectManifest
impl PartialEq for ProjectManifest
Source§fn eq(&self, other: &ProjectManifest) -> bool
fn eq(&self, other: &ProjectManifest) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProjectManifest
Auto Trait Implementations§
impl Freeze for ProjectManifest
impl RefUnwindSafe for ProjectManifest
impl Send for ProjectManifest
impl Sync for ProjectManifest
impl Unpin for ProjectManifest
impl UnsafeUnpin for ProjectManifest
impl UnwindSafe for ProjectManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.