h-REA / hREA

A ValueFlows / REA economic network coordination system implemented on Holochain and with supplied Javascript GraphQL libraries
https://docs.hrea.io
Other
143 stars 15 forks source link

Implement agent profile association for existing profiles #311

Closed pospi closed 2 years ago

pospi commented 2 years ago

This is an replacing #302 needed for compatibility with the GraphQL spec.

After some discussion with @mayel and the Bonfire team we have decided that signup / authorisation flows are too technology-specific to become part of the core spec. Bonfire has several custom API endpoints that deal with registration, authentication and authorisation; in their case specifically createUser transparently creates an REA Agent and other linked records.

hREA will need to do things differently, given there is no notion of "registration" in Holochain. It doesn't matter much how we deviate in these registration actions, so long as it all results in the myAgent query returning what has been associated with the active authentication. It is also true that any UI components built for signup & login will be technology-specific, so there is little point in standardisation in this area. GraphQL should ideally treat authorisation & authentication transparently in any case.

On this basis we should add this custom GraphQL mutations for hREA only:

associateMyAgent(agentId: ID!): Boolean!

...but the first one is ideal since it has the greatest flexibility to allow for #310 in future.

pospi commented 2 years ago

Implementing this will require extending the GraphQL spec with hREA-specific methods, which has not been done yet.

Upon reflecting on the current codebase it seems best to add these extensions within the existing modules/vf-graphql-holochain since they will be needed for any hREA client application.

This work plan is a draft, but hopefully will hold up as we work through it-