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

Show auth state in Context repr. #745

Merged
merged 6 commits into from
May 21, 2024
Merged

Conversation

danielballan
Copy link
Member

Against a mutli-user server:

In [1]: from tiled.client import from_profile

In [2]: c = from_profile('nsls2')

In [3]: c.context
Out[3]: <Context authenticated as 'dallan'>

In [4]: c.context.api_key = '<redacted>'

In [5]: c.context
Out[5]: <Context authenticated as 'dallan' with API key '86d32845...'>

In [6]: c.logout()

In [7]: c.context
Out[7]: <Context (unauthenticated)>

Against a single-user server:

In [1]: from tiled.client import from_profile

In [2]: c = from_profile('local', api_key='secret')

In [3]: c.context
Out[3]: <Context authenticated with API key 'secret...'>

In [4]: c.context.api_key = None

In [5]: c.context
Out[5]: <Context (unauthenticated)>

Needs unit tests

Closes #739

Checklist

  • Add a Changelog entry
  • Add the ticket number which this PR closes to the comment section

@danielballan danielballan marked this pull request as ready for review May 17, 2024 13:53
@danielballan
Copy link
Member Author

I am not sure why the container-canary check is acting up. I re-ran and it failed a second time. I think it's unlikely to be related to this PR, but it might be detecting some upstream issue that is important.

@danielballan
Copy link
Member Author

Canary failure was a fluke. Re-ran today; it's fine. Possibly an upstream issue.

@Kezzsim Kezzsim merged commit 0383cf6 into bluesky:main May 21, 2024
9 checks passed
@danielballan danielballan deleted the context-repr branch May 21, 2024 21:58
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.

Context repr with auth info
3 participants