-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1581fa
commit a3c9f6b
Showing
10 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# cli.py | ||
|
||
import typer | ||
from commands.auth import auth_app | ||
from commands.pipelines import pipelines_app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
# auth.py | ||
|
||
import typer | ||
import click | ||
|
||
from auth import get_access_token_with_browser_open, _validate_token, _save_local_token, _load_local_token, _clear_local_token | ||
from auth_helper import get_access_token_with_browser_open, _validate_token, _save_local_token, _load_local_token, _clear_local_token | ||
from config import CliConfig | ||
|
||
|
||
cli_config = CliConfig() # initialize the config from environment variables | ||
|
||
auth_app = typer.Typer() | ||
|
||
|
||
@auth_app.command() | ||
def login(): | ||
token = _load_local_token(cli_config.token_file) | ||
if token and _validate_token(token): | ||
click.echo('Already authenticated') | ||
return | ||
token = get_access_token_with_browser_open(cli_config.client_info, server_port=10444) | ||
token = get_access_token_with_browser_open(cli_config.client_info) | ||
_save_local_token(cli_config.token_file, token) | ||
|
||
|
||
@auth_app.command() | ||
def logout(): | ||
_clear_local_token(cli_config.token_file) | ||
click.echo('Logged out') | ||
click.echo('Logged out') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# utils.py | ||
|
||
import click | ||
import json | ||
|
||
|