• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

enboxorg / gitd / 22596904216

02 Mar 2026 09:39PM UTC coverage: 84.007% (-0.5%) from 84.482%
22596904216

push

github

web-flow
fix: resolve push auth deadlock by delegating token generation to daemon (#165)

* fix: resolve push auth deadlock by delegating token generation to daemon

The credential helper (git-remote-did-credential) was opening the agent's
LevelDB stores directly, which deadlocked when the daemon (gitd serve)
already held the exclusive lock. LevelDB only allows one process to hold
the lock — the second process hangs forever.

Add POST /auth/token endpoint to the git server that generates DID-signed
push credentials using the daemon's already-unlocked identity. Rewrite the
credential helper to call this endpoint when a daemon is running, falling
back to direct agent connection only when no daemon is found.

- Add generateToken callback to GitServerOptions and POST /auth/token route
- Wire token generation in serve.ts using the agent identity's BearerDid
- Rewrite credential-main.ts to prefer daemon endpoint over direct agent
- Add E2E test exercising the real credential helper binary via /auth/token

* test: add real daemon E2E test for push auth LevelDB lock fix

Replaces the in-process E2E test with a real multi-process test:
- test-daemon.ts: standalone daemon process that holds LevelDB lock
- e2e.spec.ts: spawns daemon, verifies /health, /auth/token, clone, push

Fixes: async Array.find() bug, nonce replay in test authenticator,
ownerDid assignment order, unused mkdirSync import.

4 of 57 new or added lines in 2 files covered. (7.02%)

1 existing line in 1 file now uncovered.

7837 of 9329 relevant lines covered (84.01%)

28.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.42
/src/git-server/server.ts


Build SHA Not Found

The commit SHA "3adf6ad87efff3933811a6118da330ffaaff7461" was not found in your repository, so the file cannot be loaded. This may be because you posted from a local development environment, or your CI created an ephemeral commit.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc