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

Function fixture

atomic-remote/src/auth/delegation.rs:309–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Calls 8

openFunction · 0.85
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