Skip to content

security: use proto encoding for join tokens #65344

Open
@dt

Description

@dt

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.

Jira issue: CRDB-7583
Epic: CRDB-6663

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-authenticationPertains to authn subsystemsC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions