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

Ability to encrypt user data #8985

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Ability to encrypt user data #8985

wants to merge 20 commits into from

Conversation

StpMax
Copy link
Collaborator

@StpMax StpMax commented Mar 22, 2024

Description

Encrypt integrations connection args and tabs content.

Not encrypted tab structure is like:

{
    "index": 1,
    "name": "tab name",
    "content": "select * from table"
}

Encrypted tab structure is like:

{
    "index": 1,
    "name": "tab name",
    "_encrypted_content": "t1aiVMMh3VMH8HEaloUsqcPwjCXpZpJf9t"
}

Not encrypted connection args is like:

{
    "user": "username",
    "password": "123456"
}

Encrypted connection args is like:

{
    "_mindsdb_encrypted_data": "4U+DeMQCl2iaV+say1yiFNCVH+cpwNpXzwwYfmkg",
    "keys": ["user", "password"]
}

Type of change

(Please delete options that are not relevant)

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ⚡ New feature (non-breaking change which adds functionality)
  • 📢 Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • 📄 This change requires a documentation update

Verification Process

To ensure the changes are working as expected:

  • Test Location: Specify the URL or path for testing.
  • Verification Steps: Outline the steps or queries needed to validate the change. Include any data, configurations, or actions required to reproduce or see the new functionality.

Additional Media:

  • I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

@StpMax StpMax requested a review from ea-rus March 26, 2024 15:30
@StpMax StpMax marked this pull request as ready for review March 26, 2024 15:30
raise Exception('Request cannot be processed due to insufficient metadata')

if config.get("cloud", False) is True and encryption_key is None:
logger.warn("Got cloud HHTP request with missed encryption key")
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this warning on every request?

"""
content = data.get('content', '')
if self.encryption_enabled:
encrypted_content = encrypt_str(content)
Copy link
Contributor

Choose a reason for hiding this comment

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

what if encryption_enabled is set ctx.encryption_key_bytes is empty?

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.

None yet

2 participants