Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space names lost when syncing delegations to new store #1176

Closed
olizilla opened this issue Nov 21, 2023 · 0 comments · Fixed by #1193
Closed

Space names lost when syncing delegations to new store #1176

olizilla opened this issue Nov 21, 2023 · 0 comments · Fixed by #1193

Comments

@olizilla
Copy link
Contributor

When a user creates a space in agent a, and then calls login in agent b, space names are not available in agent b.

We call account.save() to store delegations for an account to the local agent store during a login.

this is using a now deprecated code path to derive any spaces from the set of delegations, and it's not setting the name correctly.

https://github.com/web3-storage/w3up/blob/d6217c827f3b544ca1ff364165eafdb923971556/packages/access-client/src/agent.js#L638-L644

olizilla added a commit that referenced this issue Nov 28, 2023
space names are stored as facts in proofs in the special `ucan:*` delegation from email to agent e.g.

```yaml
iss: did:mailto:protocol.ai:oli
att:
  - can: *
    with: ucan:*
fct:
  - {"access/confirm":{"/":"bafyreidadrwbxueiuhtbph2tj2m7a6nizpx7sbtqotbfkkjsoytn3dg2t4"},"access/request":{"/":"bafyreigmlliovbpxka2borbdaw6zpsai4qzmzv5nv7syl7nagecxjcub6e"}}
prf:
  - {"iss":"did:key:z6Mku56ywWspVnzkcVQbeSkw6egVRSNKVSYgS38HhKcUJRiN","aud":"did:mailto:protocol.ai:oli","v":"0.9.1","s":{"/":{"bytes":"7aEDQPgUVQFVOoLmijx8O7Li9zyc7iIHEDnCwiqr+LcV9CyHd/KzUg1Ige7Okh+ipVMOKy2EvG8dGjWfsdAAbUVPMwo"}},"exp":null,"att":[{"can":"*","with":"did:key:z6Mku56ywWspVnzkcVQbeSkw6egVRSNKVSYgS38HhKcUJRiN"}],"fct":[{"space":{"name":"fruits"}}],"prf":[],"/":"bafyreihhlz5yjci6h7vdrlgn5xnyc65e3unp3dx2yrspepwoftaxszxpxa"}
```

this will be fixed more robustly by the proposed re-imagining of the client as a stateless view over the stored ucans, but i'd like to land this fix asap, as it's currently you dont' get to see your existing space names when calling login in a new agent.

fixes: #1176

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
olizilla added a commit that referenced this issue Nov 29, 2023
space names are stored as facts in proofs in the special `ucan:*`
delegation from email to agent e.g.

```yaml
iss: did:mailto:protocol.ai:oli
att:
  - can: *
    with: ucan:*
fct:
  - {"access/confirm":{"/":"bafyreidadrwbxueiuhtbph2tj2m7a6nizpx7sbtqotbfkkjsoytn3dg2t4"},"access/request":{"/":"bafyreigmlliovbpxka2borbdaw6zpsai4qzmzv5nv7syl7nagecxjcub6e"}}
prf:
  - {"iss":"did:key:z6Mku56ywWspVnzkcVQbeSkw6egVRSNKVSYgS38HhKcUJRiN","aud":"did:mailto:protocol.ai:oli","v":"0.9.1","s":{"/":{"bytes":"7aEDQPgUVQFVOoLmijx8O7Li9zyc7iIHEDnCwiqr+LcV9CyHd/KzUg1Ige7Okh+ipVMOKy2EvG8dGjWfsdAAbUVPMwo"}},"exp":null,"att":[{"can":"*","with":"did:key:z6Mku56ywWspVnzkcVQbeSkw6egVRSNKVSYgS38HhKcUJRiN"}],"fct":[{"space":{"name":"fruits"}}],"prf":[],"/":"bafyreihhlz5yjci6h7vdrlgn5xnyc65e3unp3dx2yrspepwoftaxszxpxa"}
```

this will be fixed more robustly by the proposed re-imagining of the
client as a stateless view over the stored ucans, but i'd like to land
this fix asap, as it's currently you dont' get to see your existing
space names when calling login in a new agent.

fixes: #1176

License: MIT

---------

Signed-off-by: Oli Evans <oli@protocol.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant