MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fixture

Function fixture

atomic-cli/src/commands/delegation.rs:308–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Calls 7

delegated_byMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45
buildMethod · 0.45
public_keyMethod · 0.45
identity_typeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected