Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context repr with auth info #739

Closed
danielballan opened this issue May 9, 2024 · 0 comments · Fixed by #745
Closed

Context repr with auth info #739

danielballan opened this issue May 9, 2024 · 0 comments · Fixed by #745

Comments

@danielballan
Copy link
Member

The tiled.client.context.Context object currently has a generic repr:

>>> client.context
<tiled.client.context.Context at 0x7ff6400a7490>

I think a good use of this would be to display authentication-related state. The Context handles the API key (if set) or the tiled.client.auth.TiledAuth object that manages refresh flow. It's in a good position to display, as applicable, the first eight characters of the API key:

>>> client.context
<Context api_key="abcdef12...">

or the username:

>>> client.context
<Context id="dallan">

or else:

>>> client.context
<Context unauthenticated>
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 a pull request may close this issue.

1 participant