Closed alexyoung23j closed 1 year ago
This makes sense. A few bullet points:
bot
role, we will need to generate keys to post as address, this should happen on the worker(?). Per some research on our login flow:
verifyAddress
that can return profile details(ie User Id) so that a jwt can be retrieved via status
. Point 3 is probably the most open-ended decision left to complete this project. It almost makes sense to me to create a discordBot only route to issue a jwt but there might still be something in the address model i'm missing that will ultimately require us to assign multiple key types/signing algos to the bot.
CC: @jnaviask
Last step here is permissions. I think deciding on how we do this might require a wider conversation and decisions.
In summary we've decided the bot will have its own profile that admins can add to communities with admin-like permissions. We need to decide how 'custom' we should be about jwt issuance + profile details for the bot service.
As mentioned above to accommodate the current Commonwealth system we would need to store private keys for all community types(cosmos, ethereum, evmos, etc) and also build adapters to sign in similar to how UI functionality works.
My thoughts:
Imo I feel that b/c the discord bot isnt really a holder of a wallet we should find a way to work around this requirement. And to do that we really just need a way to issue a jwt(a route? provides jwt.sign
directly if bot provides a key) and skip any address validation on createThread/comment(need to dig more into this).
Like I said I think this should be an open discussion so I'd like to get thoughts(also probably worth a meeting discussion)
@jnaviask @CowMuon @alexyoung23j
Agree with jwt approach being the best option. It will be a little work to untangle the createThread and createComment from address validation because that's happening in the middleware, but seems doable.
I think something we could do here would be to set up new routes w/ different middleware pointing to the same createThread/comment logic.
We could even remove need for jwt in the first place and just give the bot a secret key that the bot specific endpoints checks for(we also don't need to worry about expiration here)
Description: This ticket handles the creation of a separate worker server that will pull discord thread/comment events from a RabbitMQ queue and hit the Common API (routes like
createThread
,createComment
, etc) to complete the 1-way sync with discord.Implementation:
createComment
, etcAcceptance Criteria: