Skip to content

Hardcoded API Keys (Lines 71-75) #395

@nitish-yaddala

Description

@nitish-yaddala

if self.gmaps == '':

Security Concern: Hardcoded API keys (like gmaps and googl) pose a potential security risk, especially in public repositories.

Suggestion: Remove the hardcoded keys and use environment variables as a secure alternative. This change will make the code safer and prevent accidental exposure of sensitive information.

Code Suggestion:

self.gmaps = config_trape.get('gmaps_api_key', os.getenv("GMAPS_API_KEY", ""))
self.googl = config_trape.get('gshortener_api_key', os.getenv("GOOGL_API_KEY", ""))

Benefit: Using environment variables avoids the exposure of sensitive keys in the codebase and allows better configuration management across different environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions