Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions context/interfaces/src/dsl/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@
## Public interface
```rust
/// Parse one or more human-written endorsement facts.
pub fn parse_endorsements(s: &str) -> anyhow::Result<Vec<endor::Base>>;
///
/// Bare `self` resolves to `self_imid` anywhere an imid is accepted. Positions
/// that do not accept imids reject `self` normally.
pub fn parse_endorsements(
s: &str,
self_imid: &Imid,
) -> anyhow::Result<Vec<endor::Base>>;

/// Parse a human-written delegation constraint.
pub fn parse_constraint(s: &str) -> anyhow::Result<Constraint>;
///
/// Bare `self` resolves to `self_imid` anywhere an imid is accepted. Positions
/// that do not accept imids reject `self` normally.
pub fn parse_constraint(
s: &str,
self_imid: &Imid,
) -> anyhow::Result<Constraint>;

/// Format one endorsement fact for CLI or status output.
pub fn format_endorsement(base: &endor::Base) -> String;
Expand Down
3 changes: 2 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ async fn cmd_debug_endorse(input: String, admin_socket: Option<PathBuf>) -> Resu
input
};
let admin_client = AdminClient::new(admin_socket);
for endorsement in parse_endorsements(&dsl)? {
let dump = admin_client.debug_dump().await?;
for endorsement in parse_endorsements(&dsl, &dump.derivation.my_imid)? {
admin_client.endorse(endorsement).await?;
println!("{} Created endorsement", fmt::info_icon());
}
Expand Down
Loading
Loading