Implement API key masking in logs and error messages#54
Merged
RonaldRonnie merged 3 commits intomainfrom Jan 2, 2026
Merged
Conversation
- Remove excessive bold formatting and structured sections - Simplify language to be more conversational - Remove 'Answer:' and 'Pros:' patterns - Make it sound more like developer-written documentation - Remove 'Questions Addressed' section - Simplify testing checklist format
- Created pyproject.toml with build system configuration and project metadata - Migrated all metadata from setup.py to pyproject.toml - Updated Dockerfile to install package from pyproject.toml during build - Updated documentation (README.md, QUICKSTART.md, DEPLOYMENT_REQUIREMENTS.md) - Maintained backward compatibility with setup.py Fixes #45
- Created credential masking utility (app/utils/credential_masking.py) - mask_credential(): Masks individual credentials (shows last 4 chars) - mask_string(): Masks credentials in text strings - mask_dict(): Masks credentials in dictionaries - safe_log_message(): Creates safe log messages - mask_exception_message(): Masks exception messages - Fixed all logging statements to mask credentials: - app/utils/config.py: Fixed error logging - app/models/llm_provider.py: Fixed all error logging - app/models/unified_qa.py: Fixed all error logging - app/models/gemini_qa.py: Fixed all error logging - app/services/data_retrieval.py: Fixed 12 error logging instances - app/api/routers/system.py: Fixed 10 error logging instances - app/api/routers/bugsigdb_analysis.py: Fixed error logging - app/api/routers/bugsigdb_analysis_v2.py: Fixed 5 error logging instances - app/api/routers/study_analysis.py: Fixed error logging - app/api/utils/api_utils.py: Fixed error logging - app/api/app.py: Fixed global exception handler - Fixed error messages to not expose credentials - Added comprehensive test suite (tests/test_credential_masking.py) - Security audit completed for all critical files Fixes #46
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created credential masking utility (app/utils/credential_masking.py)
Fixed all logging statements to mask credentials:
Fixed error messages to not expose credentials
Added comprehensive test suite (tests/test_credential_masking.py)
Security audit completed for all critical files
Fixes #46"