Today seems like a good day to think again about how to implement transient instance link codes for running instances. The usecase is for a user that creates an instance and wants to share it with their friends, who may have separate accounts and/or not have seats within their particular organisation, or who might not have an account at all and would like to play anonymously.
One general approach could be that the user clicks “generate code” in the client, the client would send a message to comms, comms would then ferry that to the instance service and the instance service would generate a unique code for that instance in a new table with a new controller. This would then be returned to comms and comms would return it to the client, where it would be displayed for copying by the user and shared via eg Zoom / GChat etc. Users would then enter this code in their clients, which would communicate via comms with the instance service. The instance service would verify the code, respond with “authorised” to comms, and then comms would provide them access to the instance.
An issue with this approach is that ideally these codes should be transient. i.e. just one day things. PostGres does not support TTL though. This suggests an alternative approach, wherein comms generates an ephemeral code and stores it in Redis with a TTL of 1 day. Then there is no need to reach out to the instance service at all, everything can be kept with comms.
I think I might go with the latter approach, as it involves fewer network hops, and is closer to the desired implementation I would prefer to follow. It also echoes the approach used in Talespire, which also offers ephemeral 1 day TTL on campaign access codes.