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

fix(pg-database): by default variable is not implemented #848

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

StanGirard
Copy link
Collaborator

No description provided.

@StanGirard StanGirard temporarily deployed to preview August 4, 2023 08:16 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Aug 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2023 8:17am
quivrapp 🔄 Building (Inspect) Visit Preview Aug 4, 2023 8:17am

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

LOGAF Level 2 - /home/runner/work/quivr/quivr/backend/core/models/settings.py

1. Avoid code duplication: The settings = BrainSettings() line is repeated in multiple functions. Consider creating a global settings object that can be used across all functions. This will make your code DRY (Don't Repeat Yourself) and easier to maintain.

settings = BrainSettings()

def get_supabase_client() -> Client:
    supabase_client: Client = create_client(
        settings.supabase_url, settings.supabase_service_key
    )
    return supabase_client

2. Secure sensitive data: The BrainSettings class contains sensitive data such as API keys. Consider using environment variables to store these values securely. This will prevent accidental exposure of sensitive data.

import os

class BrainSettings(BaseSettings):
    openai_api_key: str = os.getenv('OPENAI_API_KEY')
    anthropic_api_key: str = os.getenv('ANTHROPIC_API_KEY')
    supabase_url: str = os.getenv('SUPABASE_URL')
    supabase_service_key: str = os.getenv('SUPABASE_SERVICE_KEY')
    pg_database_url: str = os.getenv('PG_DATABASE_URL', 'not implemented')
    resend_api_key: str = os.getenv('RESEND_API_KEY', 'null')
    resend_email_address: str = os.getenv('RESEND_EMAIL_ADDRESS', 'brain@mail.quivr.app')

🔂🌍🔒


Powered by Code Review GPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants