()
| 306 | } |
| 307 | |
| 308 | fn fixture() -> Fixture { |
| 309 | let dir = TempDir::new().unwrap(); |
| 310 | let store = IdentityStore::open(dir.path()).unwrap(); |
| 311 | |
| 312 | let human_key = KeyPair::generate(); |
| 313 | let human = Identity::new("alice", &human_key); |
| 314 | |
| 315 | let agent_key = KeyPair::generate(); |
| 316 | let agent = Identity::builder("alice+claude") |
| 317 | .identity_type(IdentityType::Agent) |
| 318 | .public_key(agent_key.public.clone()) |
| 319 | .delegated_by(human.id) |
| 320 | .build() |
| 321 | .unwrap(); |
| 322 | |
| 323 | Fixture { |
| 324 | _dir: dir, |
| 325 | store, |
| 326 | human, |
| 327 | human_key, |
| 328 | agent, |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | fn issue(f: &Fixture, scope: DelegationScope, expires_in: Duration) -> String { |
| 333 | let terms = Delegation::new(&f.human, &f.agent, scope).expires_in(expires_in); |
no test coverage detected