Skip to content

Conversation

@robotrapta
Copy link
Member

The friendly string for the Groundlight SDK client object includes redacted API key and endpoint if configured.

Useful for figuring out why things aren't working.


configuration.api_key["ApiToken"] = api_token

self.api_token = api_token[:20] + "..." # redact the secret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why :20? Is that partially revealing the secret? Or is the beginning of the key just boilerplate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API tokens consist of a unique KSUID and a random secret. The :20 truncates to just the KSUID, which is what we store in the backend - so it's the recoverable / identifiable part of the token.

@robotrapta robotrapta requested a review from mjvogelsong June 5, 2023 22:39
@robotrapta robotrapta marked this pull request as draft June 5, 2023 23:53
@mjvogelsong
Copy link
Contributor

Doing some old PR cleanup. Feel free to re-open.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants