Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2a8d64d
feat(core)!: verify_chain returns the proof chain's root issuer
Vasanthdev2004 Aug 14, 2026
13a2424
fix(node): gate two Unix-only tests so the crate compiles on Windows
Vasanthdev2004 Aug 14, 2026
1b1c972
feat(node): carry the verified UCAN and its root into the request
Vasanthdev2004 Aug 14, 2026
f8b9cf1
feat(node): add ucan_grants_push, anchored at the repo owner
Vasanthdev2004 Aug 14, 2026
d27f0be
feat(node): honour a delegated git/push capability on the push path
Vasanthdev2004 Aug 14, 2026
d141e59
feat(gl): gl ucan import stores a delegation for the push helper
Vasanthdev2004 Aug 14, 2026
3d81f57
feat(git-remote): send a delegated push capability as X-Ucan
Vasanthdev2004 Aug 14, 2026
8843c4f
test(git-remote): cover pack-POST URL splitting
Vasanthdev2004 Aug 14, 2026
a9e9c48
build: sync Cargo.lock for the git-remote-gitlawb dependencies
Vasanthdev2004 Aug 14, 2026
f455726
fix(core,gl,git-remote): close two review findings on delegated push
Vasanthdev2004 Aug 14, 2026
a2502fc
fix(core,node,gl,git-remote): close the second review round on delega…
Vasanthdev2004 Aug 14, 2026
d503655
fix(gl): restrict the delegations directory, and state the contract
Vasanthdev2004 Aug 14, 2026
5071524
fix(gl,git-remote): make a delegation issued the documented way actua…
Vasanthdev2004 Aug 15, 2026
5dfd8c5
fix(gl): refuse a relative or non-UTF-8 GITLAWB_KEY when deriving the…
Vasanthdev2004 Aug 15, 2026
e15fa73
fix(identity): one resolver for GITLAWB_KEY across gl and the helper
Vasanthdev2004 Aug 16, 2026
05fc52d
test(git-remote): cover delegation_header end to end
Vasanthdev2004 Aug 16, 2026
75aa1a0
fix(gl): finish the identity-path sweep on the write side
Vasanthdev2004 Aug 16, 2026
fad75a6
fix(gl,core): close round five — lazy home, envelope reads, honest re…
Vasanthdev2004 Aug 18, 2026
82f2484
fix(node,gl,git-remote): enforce repo narrowing at the node, honour t…
Vasanthdev2004 Aug 22, 2026
a47ea93
fix(gl): align the MCP ucan_show tool with gl ucan show
Vasanthdev2004 Aug 22, 2026
ec4399c
fix(gl): drop a needless borrow in quickstart's unix key write
Vasanthdev2004 Aug 22, 2026
1ab55e5
fix(node,gl,git-remote): fix a delegation's scope at issuance
Vasanthdev2004 Aug 22, 2026
89fa647
Merge origin/main into feat/ucan-push-authorization
Vasanthdev2004 Aug 27, 2026
9cf48f5
fix(gl): drop an unused import in the unix-only refresh tests
Vasanthdev2004 Aug 27, 2026
04e7941
fix(node): pass the UCAN extension at the last two receive-pack call …
Vasanthdev2004 Aug 27, 2026
f79309b
fix(core,node,gl,git-remote): one definition of a usable push capability
Vasanthdev2004 Sep 8, 2026
4dc62b2
fix(node): drop repo_capability_matches, orphaned by the shared push …
Vasanthdev2004 Sep 8, 2026
1da4251
fix(core,gl): bound every proof-chain walk and make verify report the…
Vasanthdev2004 Sep 8, 2026
fb831b1
docs: state the two gates a delegated push crosses, and finish the sweep
Vasanthdev2004 Sep 8, 2026
8b91f28
fix(gl): store one repository per imported delegation; pin the two-ga…
Vasanthdev2004 Sep 8, 2026
e3314c6
fix(gl,core): sanitize token-derived output, prove the publish step, …
Vasanthdev2004 Sep 8, 2026
1b5cb7d
test(gl): count the MCP tool list at 41 with ucan_import
Vasanthdev2004 Sep 8, 2026
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
Prev Previous commit
Next Next commit
fix(node,gl,git-remote): enforce repo narrowing at the node, honour t…
…he key basename

Round seven. Two P1s, and the first changes an authorization outcome.

The node accepted a leaf resource of `*` for delegated push. Narrowing a wildcard
delegation to the concrete repository happened only in `git-remote-gitlawb`, which
is one client's behaviour and not a protocol boundary: a delegate can sign an
otherwise valid `agent -> node` invocation that keeps `with: "*"`, it passes
attenuation because its proof is `"*"` too, and the node then authorised a push to
any repository owned by the root DID — including repositories created after the
delegation was issued. `docs/RUN-A-NODE.md` promised exactly the opposite, and
named the growth it was preventing, while resting that promise on the helper.
`repo_capability_matches` now requires a concrete `gitlawb://repos/<owner>/<repo>`.
Wildcard delegations still work through the normal path, because the helper
narrows before signing; only a hand-built wildcard leaf is refused.

`honours_the_resource_wildcard_and_repo_admin` asserted the old behaviour, so it
is now `refuses_a_resource_wildcard_and_honours_repo_admin`, and it separates the
two axes: a `*` ACTION on a concrete repository is still fine, since attenuation
bounds it. `a_wildcard_delegation_cannot_reach_a_second_repository` covers the
attack directly.

`gl` discarded the basename of `GITLAWB_KEY`. The shared resolver returns the
configured PEM path, but `gl` kept only its parent and re-appended `identity.pem`,
while the helper opens the configured path. With
`GITLAWB_KEY=/data/keys/ci-agent.pem` the CLI wrote and read
`/data/keys/identity.pem` while every push loaded `/data/keys/ci-agent.pem`, so
the two either disagreed on identity or the helper found no key — and both owner
enforcement and the delegation proof key off that identity. This was mine, from
last round's centralisation: a directory-level contract substituted where callers
needed a key-file-level one. `key_path_for` now serves both, and the seven
production sites that still hardcoded the basename go through it: `identity`
(load/new/backup/restore), `doctor`, `init`, `name` (x2), `node_stake`,
`quickstart` (x2). An explicit `--dir` keeps `<dir>/identity.pem`.

Also:

- `gl ucan import` binds the delegation's audience to the local identity and
  verifies its chain, expiry, and bounded lifetime before storing. It previously
  accepted a token addressed to a different agent, reported success, and left the
  push to fail on proof linkage with nothing pointing back.

- `build_invocation` selects only a capability the node can authorise. It took the
  first push-class capability, including a constrained one, while the node refuses
  constrained leaves outright — so a delegation holding both a constrained and an
  unconstrained grant succeeded or failed purely on their order in `att`.

- Delegation files are replaced atomically: written to a sibling temp at 0600,
  fsynced, then renamed. `truncate(true)` on the live path emptied a working
  delegation before the replacement was written, so an interruption left the
  helper with an unreadable token and pushes that silently drop `X-Ucan`.

- `gl quickstart` no longer reports "UCAN saved to ..." when the node returned no
  token. Both reviewers flagged this independently; it is the same false success
  fixed in `register` last round, one file over.

Every fix was verified by mutation: restoring the node's wildcard acceptance,
restoring `<parent>/identity.pem`, disabling the audience check, and dropping the
helper's constraint filter each turn the matching test red.
  • Loading branch information
Vasanthdev2004 committed Aug 22, 2026
commit 82f2484c39a45a14916c06a81e12e1f8baf1f156
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Good today:
Known limitations:

- Repository write authorization is not secure by default: `GITLAWB_ENFORCE_OWNER_PUSH` defaults to `false` for compatibility, so a valid HTTP Signature identifies a pusher but does not enforce owner-only pushes.
- UCAN capabilities are consulted on the push path only. There, the chain's root issuer is anchored to the repository owner, so an owner-rooted, time-bounded delegation of `git/push` (or `*`/`repo/admin`) clears the owner-push gate and does grant scoped collaborator access for pushing. The rest is unchanged: there is no revocation path, `nb` constraints are refused rather than interpreted, and no other route — reads, pull requests, issues, agents — consults capabilities at all.
- UCAN capabilities are consulted on the push path only. There, the chain's root issuer is anchored to the repository owner, so an owner-rooted, time-bounded delegation that names the repository grants scoped collaborator access for pushing to it, for the `git/push`, `*`, or `repo/admin` actions. A `*` *resource* is refused: a delegation must name the repository it applies to, so it cannot grow to cover repos created later. The rest is unchanged: there is no revocation path, `nb` constraints are refused rather than interpreted, and no other route — reads, pull requests, issues, agents — consults capabilities at all.
- Agent lifecycle revocation is not enforced by HTTP Signature authorization; do not rely on removing or revoking an agent record to block a compromised signer.
- Read visibility is not a blanket data-classification boundary: task, IPFS-pin, and Arweave-anchor listings are not repository-gated; withheld path names can be visible to a root reader; and later visibility changes cannot retract content already announced or externally anchored.
- Peer writes are signed by upgraded nodes, but strict signed-peer enforcement is opt-in during rolling upgrades.
Expand Down
50 changes: 49 additions & 1 deletion crates/git-remote-gitlawb/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,13 @@ fn build_invocation(
.att
.iter()
.find(|c| {
(c.with == "*" || names_this_repo(&c.with))
// `constraints.is_none()` mirrors the node: `ucan_grants_push` treats any
// capability carrying `nb` as granting nothing, so selecting one here
// would mint an invocation guaranteed to be refused — and a delegation
// holding BOTH a constrained and an unconstrained grant would fail or
// succeed purely on their order in `att`.
c.constraints.is_none()
&& (c.with == "*" || names_this_repo(&c.with))
&& (c.can == caps::GIT_PUSH || c.can == "*" || c.can == caps::REPO_ADMIN)
})
.ok_or_else(|| {
Expand Down Expand Up @@ -2568,6 +2574,48 @@ mod delegated_push_tests {
assert!(invocation.payload.att[0].is_attenuated_by(&delegation.payload.att[0]));
}

/// A delegation holding both a constrained and an unconstrained grant must work
/// regardless of their order. The node refuses a constrained leaf outright, so
/// picking merely the FIRST push-class capability made a valid delegation
/// succeed or fail purely on how the owner happened to order `att`.
#[test]
fn build_invocation_skips_a_constrained_capability_in_either_order() {
let owner = Keypair::generate();
let agent = Keypair::generate();
let node = Keypair::generate();
let hour = chrono::Utc::now() + chrono::Duration::hours(1);
let resource = "gitlawb://repos/z6MkOwner/r";

let mut constrained = Capability::new(resource, caps::GIT_PUSH);
constrained.constraints = Some(serde_json::json!({"max_bytes": 1}));
let usable = Capability::new(resource, caps::GIT_PUSH);

for (label, att) in [
(
"constrained first",
vec![constrained.clone(), usable.clone()],
),
("usable first", vec![usable.clone(), constrained.clone()]),
] {
let delegation = Ucan::issue(&owner, agent.did(), att, Some(hour)).expect("issue");
let invocation = build_invocation(&agent, &node.did(), &delegation, "z6MkOwner", "r")
.unwrap_or_else(|e| panic!("{label}: {e}"));
assert!(
invocation.payload.att[0].constraints.is_none(),
"{label}: the invocation must carry the capability the node can authorize"
);
}

// With ONLY a constrained grant there is nothing the node would accept, so
// failing here beats minting an invocation guaranteed to be refused.
let only_constrained =
Ucan::issue(&owner, agent.did(), vec![constrained], Some(hour)).expect("issue");
assert!(
build_invocation(&agent, &node.did(), &only_constrained, "z6MkOwner", "r").is_err(),
"a delegation with no unconstrained grant must not produce an invocation"
);
}

#[test]
fn split_pack_post_url_separates_origin_owner_and_repo() {
assert_eq!(
Expand Down
50 changes: 43 additions & 7 deletions crates/gitlawb-node/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ pub fn caller_authorized_to_push(
///
/// Structural, not a string compare: `owner_did` is stored as a full
/// `did:key:z6Mk…` on canonical rows and as a bare `z6Mk…` on mirror rows, so a
/// literal match would deny a valid delegation for every mirror. `"*"` keeps the
/// wildcard meaning [`gitlawb_core::ucan::Capability::is_attenuated_by`] gives it.
/// literal match would deny a valid delegation for every mirror.
///
/// A resource wildcard is REFUSED here, deliberately, even though
/// [`gitlawb_core::ucan::Capability::is_attenuated_by`] accepts `"*"` as a parent.
/// `git-remote-gitlawb` narrows a wildcard delegation to the concrete repo before
/// signing an invocation, but that is one client's courtesy, not a protocol
/// boundary: a delegate can sign an otherwise valid `agent -> node` invocation that
/// keeps `with: "*"`, and it passes attenuation because its proof is `"*"` too.
/// Accepting it would let a single delegation push to every repository the root DID
/// owns, including repositories created AFTER the delegation was issued — exactly
/// the growth `docs/RUN-A-NODE.md` promises cannot happen. An authorization
/// boundary cannot enforce that by trusting a client-side representation change,
/// so the node requires a concrete resource of its own.
fn repo_capability_matches(with: &str, record: &crate::db::RepoRecord) -> bool {
if with == "*" {
return true;
}
let Some(rest) = with.strip_prefix("gitlawb://repos/") else {
return false;
};
Expand Down Expand Up @@ -882,11 +890,30 @@ mod ucan_push_tests {
assert!(!ucan_grants_push(&rec, &v));
}

/// A resource wildcard must NOT authorize a push, even though attenuation
/// accepts it. The helper narrows a `*` delegation before signing, but the node
/// cannot rely on that: a delegate can sign an invocation that keeps the
/// wildcard, and it would otherwise reach every repository the owner has — or
/// will later create. This test previously asserted the opposite.
#[test]
fn honours_the_resource_wildcard_and_repo_admin() {
fn refuses_a_resource_wildcard_and_honours_repo_admin() {
let rec = repo(&owner_full(), "myrepo");
let wildcard = verified(&owner_full(), vec![Capability::new("*", caps::GIT_PUSH)]);
assert!(ucan_grants_push(&rec, &wildcard));
assert!(
!ucan_grants_push(&rec, &wildcard),
"a wildcard resource must not authorize a push at the node"
);

// The ACTION wildcard is a different axis and stays: attenuation bounds it,
// and it still has to name a concrete repository.
let action_wildcard = verified(
&owner_full(),
vec![Capability::new(
format!("gitlawb://repos/{}/myrepo", owner_full()),
"*",
)],
);
assert!(ucan_grants_push(&rec, &action_wildcard));

let admin = verified(
&owner_full(),
Expand All @@ -898,6 +925,15 @@ mod ucan_push_tests {
assert!(ucan_grants_push(&rec, &admin));
}

/// The attack the wildcard refusal exists to stop: one `*` delegation reaching a
/// repository it was never issued against, including one created afterwards.
#[test]
fn a_wildcard_delegation_cannot_reach_a_second_repository() {
let other = repo(&owner_full(), "a-repo-created-later");
let wildcard = verified(&owner_full(), vec![Capability::new("*", caps::GIT_PUSH)]);
assert!(!ucan_grants_push(&other, &wildcard));
}

#[test]
fn refuses_a_malformed_resource_uri() {
let rec = repo(&owner_full(), "myrepo");
Expand Down
3 changes: 2 additions & 1 deletion crates/gl/src/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ pub async fn run(args: DoctorArgs) -> Result<()> {
// `~/.gitlawb` while `gl register` writes to the parent of `GITLAWB_KEY` would
// make the one command whose job is to explain a broken setup the one that
// misreports it.
let args_dir = args.dir.clone();
let dir = crate::identity::gitlawb_dir(args.dir)?;

let mut checks = Vec::new();
let mut all_ok = true;

// ── 1. Identity ───────────────────────────────────────────────────────
let pem_path = dir.join("identity.pem");
let pem_path = crate::identity::key_path_for(args_dir.as_deref())?;
if pem_path.exists() {
match std::fs::read_to_string(&pem_path)
.ok()
Expand Down
89 changes: 79 additions & 10 deletions crates/gl/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,28 @@ pub fn gitlawb_dir(override_dir: Option<PathBuf>) -> Result<PathBuf> {
gitlawb_core::identity_path::identity_dir(home.as_deref()).map_err(|e| anyhow::anyhow!("{e}"))
}

fn key_path(dir: &Path) -> PathBuf {
dir.join(gitlawb_core::identity_path::KEY_FILE_NAME)
/// The identity PEM to read or write.
///
/// With an explicit `--dir` this is `<dir>/identity.pem`, the conventional layout.
/// Without one it is [`gitlawb_core::identity_path::identity_key_path`] — the whole
/// of `GITLAWB_KEY`, basename included.
///
/// Taking only the parent and re-appending `identity.pem` was a real divergence,
/// not a tidy-up: `GITLAWB_KEY` is documented as a path to a PEM, and
/// `git-remote-gitlawb` opens exactly that path. With
/// `GITLAWB_KEY=/data/keys/ci-agent.pem`, `gl identity new` wrote
/// `/data/keys/identity.pem` while every push loaded `/data/keys/ci-agent.pem`, so
/// the two either disagreed on identity or the helper found no key at all — and
/// owner enforcement and the delegation proof both key off that identity.
pub(crate) fn key_path_for(dir: Option<&Path>) -> Result<PathBuf> {
match dir {
Some(d) => Ok(d.join(gitlawb_core::identity_path::KEY_FILE_NAME)),
None => {
let home = dirs::home_dir();
gitlawb_core::identity_path::identity_key_path(home.as_deref())
.map_err(|e| anyhow::anyhow!("{e}"))
}
}
}

fn load_keypair(dir: Option<PathBuf>) -> Result<Keypair> {
Expand All @@ -104,8 +124,7 @@ fn load_keypair(dir: Option<PathBuf>) -> Result<Keypair> {
/// just created — `gl ucan delegate` would either fail to find an identity or sign
/// with a stale DID that is not the repo owner.
pub fn load_keypair_from_dir(dir: Option<&std::path::Path>) -> Result<Keypair> {
let base = gitlawb_dir(dir.map(Path::to_path_buf))?;
let path = key_path(&base);
let path = key_path_for(dir)?;
let pem = fs::read_to_string(&path).with_context(|| {
format!(
"no identity found at {}\nRun `gl identity new` to create one",
Expand All @@ -124,8 +143,11 @@ async fn cmd_new_with_reader(
force: bool,
reader: &mut impl std::io::BufRead,
) -> Result<()> {
let dir = gitlawb_dir(dir)?;
let path = key_path(&dir);
let path = key_path_for(dir.as_deref())?;
let dir = path
.parent()
.map(Path::to_path_buf)
.unwrap_or_else(|| PathBuf::from("."));

if path.exists() {
if force {
Expand Down Expand Up @@ -199,8 +221,7 @@ async fn cmd_sign(message: String, dir: Option<PathBuf>) -> Result<()> {
}

async fn cmd_backup(out: Option<PathBuf>, dir: Option<PathBuf>) -> Result<()> {
let base = gitlawb_dir(dir)?;
let src = key_path(&base);
let src = key_path_for(dir.as_deref())?;

let pem = fs::read_to_string(&src).with_context(|| {
format!(
Expand Down Expand Up @@ -255,8 +276,11 @@ async fn cmd_restore_with_reader(
// Verify it's a valid keypair before writing anything
let keypair = Keypair::from_pem(&pem).context("backup file is not a valid identity PEM")?;

let base = gitlawb_dir(dir)?;
let dest = key_path(&base);
let dest = key_path_for(dir.as_deref())?;
let base = dest
.parent()
.map(Path::to_path_buf)
.unwrap_or_else(|| PathBuf::from("."));

if dest.exists() {
if force {
Expand Down Expand Up @@ -554,6 +578,12 @@ pub(crate) mod test_env {
}
}

/// Run `f` with `GITLAWB_KEY` set, restoring it afterwards.
pub(crate) fn with_key<T, V: AsRef<OsStr>>(value: Option<V>, f: impl FnOnce() -> T) -> T {
let _guard = set_key(value);
f()
}

/// Set `GITLAWB_KEY` (or remove it, for `None`) until the guard drops.
pub(crate) fn set_key<V: AsRef<OsStr>>(value: Option<V>) -> KeyEnv {
let guard = ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());
Expand Down Expand Up @@ -659,3 +689,42 @@ mod gitlawb_dir_tests {
assert_eq!(loaded.did(), expected.did());
}
}

#[cfg(test)]
mod key_basename_tests {
use super::*;

/// `GITLAWB_KEY` names a FILE. `gl` used to keep only its parent and re-append
/// `identity.pem`, while `git-remote-gitlawb` opened the configured path — so
/// with `GITLAWB_KEY=/data/keys/ci-agent.pem` the CLI and the push path loaded
/// different files, and owner enforcement and the delegation proof both key off
/// whichever identity that was.
#[test]
fn a_non_default_key_basename_is_honoured() {
let dir = tempfile::tempdir().unwrap();
let key = dir.path().join("ci-agent.pem");
let expected = gitlawb_core::identity::Keypair::generate();
std::fs::write(&key, expected.to_pem().unwrap()).unwrap();

let (resolved, loaded) = crate::identity::test_env::with_key(Some(key.clone()), || {
(key_path_for(None).unwrap(), load_keypair_from_dir(None))
});

assert_eq!(resolved, key, "the configured basename must survive");
assert_eq!(
loaded.expect("the key at GITLAWB_KEY must load").did(),
expected.did(),
"gl must load the same file the helper opens"
);
}

/// An explicit --dir keeps the conventional layout.
#[test]
fn an_explicit_dir_still_uses_identity_pem() {
let dir = tempfile::tempdir().unwrap();
assert_eq!(
key_path_for(Some(dir.path())).unwrap(),
dir.path().join("identity.pem")
);
}
}
7 changes: 5 additions & 2 deletions crates/gl/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,15 @@ pub async fn run(args: InitArgs) -> Result<()> {
}

fn generate_identity(dir: Option<&std::path::Path>) -> Result<gitlawb_core::identity::Keypair> {
let base = crate::identity::gitlawb_dir(dir.map(std::path::Path::to_path_buf))?;
let path = crate::identity::key_path_for(dir)?;
let base = path
.parent()
.map(std::path::Path::to_path_buf)
.unwrap_or_else(|| std::path::PathBuf::from("."));
std::fs::create_dir_all(&base)?;

let keypair = gitlawb_core::identity::Keypair::generate();
let pem = keypair.to_pem()?;
let path = base.join("identity.pem");

#[cfg(unix)]
{
Expand Down
11 changes: 2 additions & 9 deletions crates/gl/src/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,8 @@ pub async fn run(args: NameArgs) -> Result<()> {

// ── Helpers ───────────────────────────────────────────────────────────────────

fn identity_dir(dir: Option<PathBuf>) -> Result<PathBuf> {
// The shared resolver, not a local `~/.gitlawb`: `gl identity new` writes the
// key wherever `GITLAWB_KEY` points, and the old fallback to `.` on a missing
// home made the answer depend on the working directory.
crate::identity::gitlawb_dir(dir)
}

fn load_did(dir: Option<PathBuf>) -> Result<String> {
let path = identity_dir(dir)?.join("identity.pem");
let path = crate::identity::key_path_for(dir.as_deref())?;
let pem = std::fs::read_to_string(&path).with_context(|| {
format!(
"No identity at {} — run `gl identity new` first",
Expand All @@ -189,7 +182,7 @@ fn load_did(dir: Option<PathBuf>) -> Result<String> {
}

fn load_did_and_document(dir: Option<PathBuf>) -> Result<(String, String)> {
let path = identity_dir(dir)?.join("identity.pem");
let path = crate::identity::key_path_for(dir.as_deref())?;
let pem = std::fs::read_to_string(&path).with_context(|| {
format!(
"No identity at {} — run `gl identity new` first",
Expand Down
3 changes: 1 addition & 2 deletions crates/gl/src/node_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ fn load_did(dir: Option<PathBuf>) -> Result<String> {
// The shared resolver, not a local `~/.gitlawb`: `gl identity new` writes the
// key wherever `GITLAWB_KEY` points, and the old fallback to `.` on a missing
// home made the answer depend on the working directory.
let base = crate::identity::gitlawb_dir(dir)?;
let path = base.join("identity.pem");
let path = crate::identity::key_path_for(dir.as_deref())?;
let pem = std::fs::read_to_string(&path).with_context(|| {
format!(
"No identity at {} — run `gl identity new` first",
Expand Down
Loading
Loading