Skip to content

Handle Org Auth Tokens #1669

Description

@mydea

We want to update sentry-cli (and then all projects using it) to properly handle Org Auth Tokens.

While generally, using them works out of the box (just use them as authToken and everything should work), when we detect an org auth token we can actually use the data embedded in it.

How to detect an org auth token?

A token that starts with sntrys_ is an org auth token.

How to get embedded data?

For the purpose of sentry-cli, there are two relevant things embedded in the token:

  • org
  • url

We can get the embedded data like this: https://github.com/getsentry/sentry/blob/master/src/sentry/utils/security/orgauthtoken_token.py#L28

So basically, take the part between the _, and base64 decode it - which results in a JSON string, with org and url fields.

What to do with it?

When we detect an org auth token, we want to use the org/url set and make them optional to be configured for sentry-cli. So only the project remains necessary to configure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions