This PR is to spike out an implementation of including tenant_id
when an email notification is generated so when we verify the generated and encoded token, we are connected to the correct tenant schema. We are proposing a globally available load_tenant!(tenant)
method that is responsible for setting the tenant schema context, as opposed to passing a tenant_id
throughout the entire mail reply code path.
###Questions
How do we support existing signed auth tokens that do not include a
tenant_id
?
An approach that we discussed is to add a new PACK_FORMAT
to use for newly generated tokens (those that include tenant_id
going forward) so we can differentiate between pre-tenant and post-tenant tokens. This may warrant new GitHub::Authentication::SignedAuthToken
version. Pre-tenant tokens will signal to us that the applicable tenant is GitHub, and for post-tenant tokens we'll parse and retrieve the tenant_id
from the token. We can then connect to the appopriate tenant schema.