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

commit #1773

Merged
merged 3 commits into from
Jan 8, 2025
Merged

commit #1773

merged 3 commits into from
Jan 8, 2025

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Jan 8, 2025

Important

Enhancements in user management, API key handling, and metadata updates across SDK, database, and API components.

  • User Management:
    • Added metadata, limitOverrides, and documentIds fields to User interface in types.ts.
    • Implemented patchMetadata method in UsersClient and users_router.py for partial metadata updates.
    • Updated createApiKey method in UsersClient to accept name and description.
    • Enhanced update_user in users.py to handle new_metadata.
  • API Key Management:
    • Added description field to ApiKeyNoPriv in responses.py.
    • Updated store_user_api_key in users.py to include name and description.
    • Modified create_user_api_key in auth_service.py to handle name and description.
  • Database Changes:
    • Added metadata column to users table in users.py.
    • Implemented _merge_metadata function in users.py for metadata merging.
    • Updated update_user in users.py to handle new_metadata.
  • SDK Enhancements:
    • Updated R2RClient in sync_client.py to wrap async methods.
    • Added patch_metadata method in users.py for metadata updates.
  • Miscellaneous:
    • Version bump in package.json from 0.4.10 to 0.4.11.

This description was created by Ellipsis for 1f8b3c3. It will automatically update as commits are pushed.

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review January 8, 2025 03:59
@emrgnt-cmplxty emrgnt-cmplxty merged commit 0caece6 into main Jan 8, 2025
3 of 4 checks passed
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot 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! Reviewed everything up to 1f8b3c3 in 1 minute and 38 seconds

More details
  • Looked at 782 lines of code in 12 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. js/sdk/src/v3/clients/users.ts:536
  • Draft comment:
    Consider adding validation for the metadata input to ensure it conforms to expected formats and values before making the request. This will help prevent unexpected behavior if invalid data is passed.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces a new method patchMetadata in the UsersClient class, which allows partial updates to user metadata. However, the method does not include any validation or error handling for the metadata input. This could lead to unexpected behavior if invalid data is passed. It's important to ensure that the metadata conforms to expected formats and values before making the request.
2. py/core/database/users.py:45
  • Draft comment:
    Clarify the intended behavior for None values in the new_metadata dictionary. Currently, None is treated as equivalent to an empty string, which may lead to unintended deletions of metadata keys.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The _merge_metadata function in users.py is designed to merge new metadata with existing metadata. However, the function treats None values as equivalent to empty strings, which may not be the intended behavior. This could lead to unintended deletions of metadata keys if None is passed. It's important to clarify the intended behavior for None values and handle them accordingly.
3. py/core/main/services/auth_service.py:284
  • Draft comment:
    Ensure that the name and description inputs for API keys are properly validated and sanitized to prevent potential security issues such as injection attacks.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The create_user_api_key method in auth_service.py now accepts optional name and description parameters for API keys. However, there is no validation or sanitization of these inputs, which could lead to security issues such as injection attacks. It's important to ensure that these inputs are properly validated and sanitized before being stored or used.
4. py/core/pipes/ingestion/vector_storage_pipe.py:85
  • Draft comment:
    Ensure that the chunk limit is checked per user, not per batch. The current logic current_usage + len(vector_batch) > max_chunks may not accurately reflect the intended behavior if vector_batch contains entries for multiple users.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The VectorStoragePipe class in vector_storage_pipe.py checks for user chunk limits before storing vector entries. However, the logic for checking current_usage + len(vector_batch) > max_chunks may not accurately reflect the intended behavior if vector_batch contains entries for multiple users. It's important to ensure that the chunk limit is checked per user, not per batch.

Workflow ID: wflow_WC5EgqoivC1Z7LWv


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

1 participant