Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Oxen-AI/auth-is-configured
Auth is configured
- Loading branch information
Showing
7 changed files
with
37 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from .oxen import auth, util | ||
from oxen.user import config_user | ||
from typing import Optional | ||
import os | ||
import requests | ||
|
||
def is_configured(): | ||
""" | ||
Checks if the user and auth is configured. | ||
Returns: | ||
`bool`: True if the user and auth is configured, False otherwise. | ||
""" | ||
|
||
auth_path = os.path.join(util.get_oxen_config_dir(), "auth_config.toml") | ||
user_path = os.path.join(util.get_oxen_config_dir(), "user_config.toml") | ||
|
||
return os.path.exists(auth_path) and os.path.exists(user_path) |
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