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

Hide API key from Rich tracebacks #221

Merged
merged 3 commits into from
May 2, 2023
Merged

Hide API key from Rich tracebacks #221

merged 3 commits into from
May 2, 2023

Conversation

cosmojg
Copy link
Contributor

@cosmojg cosmojg commented Apr 28, 2023

Typer uses Rich to format tracebacks with show_locals=True and locals_hide_dunder=True. This PR takes advantage of that second parameter to hide the user's API key (stored in __api_key) while retaining other local variables. (Issue #160)

@cosmojg
Copy link
Contributor Author

cosmojg commented Apr 28, 2023

This PR fixes Issue #160

@cosmojg cosmojg changed the title Hide API key from Rich tracebacks (Fix #160) Hide API key from Rich tracebacks Apr 28, 2023
sgpt/app.py Outdated Show resolved Hide resolved
@TheR1D TheR1D linked an issue May 2, 2023 that may be closed by this pull request
@TheR1D TheR1D self-assigned this May 2, 2023
@TheR1D TheR1D added bug Something isn't working refactoring Make it great again labels May 2, 2023
Copy link
Owner

@TheR1D TheR1D left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks.

@TheR1D TheR1D merged commit 1abedc6 into TheR1D:main May 2, 2023
Frodotus pushed a commit to Frodotus/shell_gpt that referenced this pull request May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactoring Make it great again
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide api_key from logs when sgpt crashing
2 participants