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

Adds a first take at an independent prefect-cloud login and logout #2

Merged
merged 3 commits into from
Feb 5, 2025

Conversation

chrisguidry
Copy link
Contributor

With the goal of keeping prefect-cloud as lightweight as possible,
we are not requiring prefect, FastAPI, or uvicorn to run the
Cloud login flow. Instead, we use mostly the standard library, httpx,
and toml to implement login, API key handoff, and profile management.

This is fairly barebones in terms of TUI niceties, but it does bring
over the prompt_select_from_list from prefect. Apart from that
one question, this attempts to follow the Unix philosophy of only
saying what's absolutely necessary.

Tests will come after we have the testing framework and suites up.

This may require PrefectHQ/nebula-ui#5539 to be merged to work correctly
with all browsers.

str: the selected option
"""

console = Console()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These functions are lifted straight from prefect but I took console out of the function signature and created one here. Might want to change that by and by

Copy link
Collaborator

@jakekaplan jakekaplan left a comment

Choose a reason for hiding this comment

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

This LGTM!

The only thing that I think might be critical to add as well is supporting a workspace in the login command? That way someone can login without any prompt/interaction?

With the goal of keeping `prefect-cloud` as lightweight as possible,
we are not requiring `prefect`, `FastAPI`, or `uvicorn` to run the
Cloud login flow.  Instead, we use mostly the standard library, `httpx`,
and `toml` to implement login, API key handoff, and profile management.

This is fairly barebones in terms of TUI niceties, but it does bring
over the `prompt_select_from_list` from `prefect`.  Apart from that
one question, this attempts to follow the Unix philosophy of only
saying what's absolutely necessary.

Tests will come after we have the testing framework and suites up.

This may require PrefectHQ/nebula-ui#5539 to be merged to work correctly
with all browsers.
@chrisguidry
Copy link
Contributor Author

Oh good call, I'll add that

@chrisguidry chrisguidry merged commit 7214aae into main Feb 5, 2025
2 checks passed
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.

2 participants