Description
Join tokens pack a few fields together: an ID, a shared secret, a fingerprint, potentially a version, and maybe more fields in the future if we add options or flags. Currently these are encoded and packed manually, but rolling a new encoding by hand has frequently been something we grow to regret later when we end up with encoding bugs or mishandling of optional fields or something later.
We might be better served by defining a little proto with a few fields and encoding that to/from base64, similar to how to handle license key tokens: https://github.com/cockroachdb/cockroach/blob/master/pkg/ccl/utilccl/licenseccl/license.go#L23 Since this hasn't shipped yet we still have a chance now to change this encoding without maintaining backwards compatibility with the hand-rolled scheme.