-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User UUID to use the designated column instead (#4299)
* token generation on the terminal * revoke and show commands * uuid on the right column * adding logs to the account commands * login info at this point does not make sense anymore * get_user_uuid function * log formatter to use get_user_uuid function * ruff + black * fix tests * fix tests --------- Co-authored-by: James Maslek <[email protected]>
- Loading branch information
Showing
13 changed files
with
40 additions
and
48 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,26 +1,19 @@ | ||
# IMPORTATION STANDARD | ||
import json | ||
import logging | ||
|
||
from openbb_terminal.core.log.generation.common import do_rollover | ||
|
||
# IMPORTATION THIRDPARTY | ||
# IMPORTATION INTERNAL | ||
from openbb_terminal.session.user import User | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
NO_USER_PLACEHOLDER = "NA" | ||
|
||
def log_user(with_rollover: bool = True): | ||
"""Log user""" | ||
if not User.is_guest(): | ||
_log_user_info() | ||
|
||
if with_rollover: | ||
do_rollover() | ||
def get_user_uuid() -> str: | ||
"""Get user UUID""" | ||
|
||
if not User.is_guest(): | ||
return User.get_uuid() | ||
|
||
def _log_user_info(): | ||
"""Log user info""" | ||
user_info = {"user_uuid": User.get_uuid()} | ||
logger.info("USER: %s ", json.dumps(user_info)) | ||
return NO_USER_PLACEHOLDER |
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
2 changes: 1 addition & 1 deletion
2
...minal/core/log/generation/json/test_formatter_with_exceptions/test_extract_log_extra.json
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 +1 @@ | ||
{"userId": "MOCK_USER_ID", "sessionId": "MOCK_SESSION_ID"} | ||
{"sessionId": "MOCK_SESSION_ID"} |
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