atomicdata-dev / atomic-data-docs

Atomic Data is a specification to make it easier to exchange data.
https://docs.atomicdata.dev
MIT License
17 stars 7 forks source link

Multiple Keys per Agent - Sessions #139

Open joepio opened 1 year ago

joepio commented 1 year ago

Relates to #49

Currently, Agents have excactly one publicKey. This has a couple of problems:

Let's discuss what it would mean to support multiple. There may be various approaches possible.

Make Keys Resources instead of Atoms

Agents can create a Key resource, which has:

The keys will no longer be stored as an Atom in the Agent, but as separate resources. However, the agent could in fact have a resourceArray of active Key resources which it links to. We could use this relationship to check which keys can be used.

I notice I'm kind of struggling with setting a two-way relationship here. On the one hand, I'd like to see the Agent that created a Key, looking at the Key. On the other hand, I'd like to prevent having the information about which keys are from the Agent set on only one single thing, not on multiple properties with different directions.

Have a usedKeys property on an Agent

Agent has ActiveKeys and DeprecatedKeys