✨ feat(authContext.tsx): add support for process.env.PORT environment variable to be able to run app on a configurable port
🐛 fix(tabsContext.tsx): import missing AuthContext and use getAuthentication function to conditionally fetch data
🐛 fix(typesContext.tsx): import missing AuthContext and use getAuthentication function to conditionally fetch data
🐛 fix(api.tsx): add check to not refresh token if refreshToken is "auto"
🐛 fix(chat.py): add missing import statement for Session from sqlmodel
🐛 fix(chat.py): add missing import statement for get_session from langflow.services.utils
🐛 fix(chat.py): add missing import statement for get_current_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_active_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for WebSocket from fastapi
🐛 fix(chat.py): add missing import statement for WebSocketException from fastapi
🐛 fix(chat.py): add missing import statement for status from fastapi
🐛 fix(chat.py): add missing import statement for APIRouter from fastapi
🐛 fix(chat.py): add missing import statement for Depends from fastapi
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_active_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for get_current_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for get_session from langflow.services.utils
🐛 fix(chat.py): add missing import statement for Session from sqlmodel
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_user from langflow.services.auth.utils
🐛 fix(chat.py): add missing import statement for HTTPException from fastapi
🐛 fix(chat.py): add missing import statement for get_current_user from langflow
🔧 fix(test_chains_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_endpoints.py): update test_get_all function to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_llms_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_prompts_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
🔧 fix(test_vectorstore_template.py): update test functions to include logged_in_headers parameter to test authenticated requests
✨ feat(update_all_tables.py): add support for 'user_id' column in 'apikey' table
✨ feat(update_all_tables.py): add support for 'created_at' column in 'apikey' table
✨ feat(update_all_tables.py): add support for index on 'name' column in 'apikey' table
✨ feat(update_all_tables.py): add support for index on 'user_id' column in 'apikey' table
✨ feat(update_all_tables.py): add foreign key constraint on 'user_id' column in 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping 'create_at' column from 'apikey' table
✨ feat(update_all_tables.py): add support for 'user_id' column in 'flow' table
✨ feat(update_all_tables.py): add support for index on 'user_id' column in 'flow' table
✨ feat(update_all_tables.py): add foreign key constraint on 'user_id' column in 'flow' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping foreign key constraint from 'flow' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping index on 'user_id' column from 'flow' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping 'user_id' column from 'flow' table
🔧 fix(update_all_tables.py): handle potential OperationalError when adding 'create_at' column to 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping foreign key constraint from 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping index on 'user_id' column from 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping index on 'name' column from 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when altering 'name' column in 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping 'user_id' column from 'apikey' table
🔧 fix(update_all_tables.py): handle potential OperationalError when dropping 'created_at' column from 'apikey' table
This commit adds a new migration script to update all tables in the database. The script includes the following changes:
- Added columns 'created_at' and 'user_id' to the 'apikey' table
- Altered the 'name' column in the 'apikey' table to allow null values
- Created indexes on the 'name' and 'user_id' columns in the 'apikey' table
- Created a foreign key constraint between the 'apikey' table and the 'user' table
- Added the 'user_id' column to the 'flow' table
- Created an index on the 'user_id' column in the 'flow' table
- Created a foreign key constraint between the 'flow' table and the 'user' table
- Removed the 'create_at' column from the 'apikey' table
This migration script is designed to be used with Alembic for database schema updates.
✨ feat(chat.py): add current_user dependency to chat and init_build endpoints to enforce authentication and authorization
🔧 refactor(chat.py): pass user_id to vertex.build() method in stream_build endpoint to associate the build with the current user
🐛 fix(loading.py): add optional user_id parameter to instantiate_class and instantiate_based_on_type functions to support user-specific custom components
✨ feat(loading.py): modify instantiate_custom_component function to use user_id parameter and improve code readability
🐛 fix(base.py): add optional user_id parameter to _build and _build_list_of_nodes_and_update_params methods in Vertex class to support building with user-specific data
🐛 fix(base.py): add optional user_id parameter to _get_and_instantiate_class method in Vertex class to support building with user-specific data
🐛 fix(custom_component.py): add user_id attribute to CustomComponent class to store the user ID associated with the component
🐛 fix(custom_component.py): add user_id parameter to list_flows method in CustomComponent class to filter flows by user ID
🐛 fix(custom_component.py): add user_id parameter to get_flow method in CustomComponent class to filter flows by user ID
🐛 fix(conftest.py): add client parameter to active_user fixture in tests to fix missing dependency error
🔥 refactor(test_custom_component.py): remove unused fixture and imports to clean up the test file
🔧 chore(test_custom_component.py): update component fixture to include user_id parameter for testing purposes
🔧 fix(test_database.py): fix test_read_flows function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_delete_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_create_flows function signature to include logged_in_headers parameter
🔧 fix(test_database.py): fix test_upload_file function signature to include logged_in_headers parameter
🔧 fix(test_database.py): fix test_download_file function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_create_flow_with_invalid_data function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_get_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_flow_idempotency function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_delete_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_empty_flows function signature to include active_user and logged_in_headers parameters
🐛 fix(flows.py): add missing import statement for TYPE_CHECKING
✨ feat(flows.py): add user_id field to FlowCreate model to allow specifying the user for a new flow
✨ feat(flows.py): add user_id field to FlowRead model to include the user_id in the response
✨ feat(flows.py): add user_id field to Flow model and create a relationship with User model
✨ feat(flows.py): add current_user dependency to create_flow endpoint to set the user_id for a new flow
✨ feat(flows.py): add current_user dependency to read_flows endpoint to filter flows by current user
✨ feat(flows.py): add current_user dependency to read_flow endpoint to filter flow by current user
✨ feat(flows.py): add current_user dependency to update_flow endpoint to filter flow by current user
✨ feat(flows.py): add current_user dependency to delete_flow endpoint to filter flow by current user
✨ feat(flows.py): add current_user dependency to create_flows endpoint to set the user_id for new flows
✨ feat(flows.py): add current_user dependency to upload_file endpoint to set the user_id for new flows
✨ feat(flows.py): add current_user dependency to download_file endpoint to filter flows by current user
🐛 fix(flow.py): add missing import statement for User model
✨ feat(flow.py): add user_id field to Flow model to associate a flow with a user
✨ feat(test_api_key.py): add tests for API key creation, retrieval, and deletion
✨ feat(test_user.py): remove unused fixtures and imports from test_user.py module
🔒 fix(user/crud.py): add validation to prevent duplicate usernames during user update
🔄 refactor(user/crud.py): update user attributes and last_login_at timestamp during user update
🐛 fix(user/crud.py): handle IntegrityError during user update and rollback transaction
This commit adds the following functions to the `api_key/crud.py` file:
- `get_api_keys`: Retrieves a list of API keys associated with a specific user ID from the database.
- `create_api_key`: Generates a random API key, hashes it, and creates a new `ApiKey` object in the database.
- `delete_api_key`: Deletes an API key from the database based on its ID.
These functions provide the necessary functionality for managing API keys in the application's database.
🔀 chore(api_key): add UnmaskedApiKeyRead model to represent an unmasked API key
🔀 chore(api_key): add user relationship to ApiKey model for easier access to associated user
🔀 chore(api_key): add user_id field to ApiKeyBase and ApiKeyCreate models for easier user association
🔀 chore(api_key): add mask_api_key validator to ApiKeyRead model to mask the API key for security reasons
🔧 fix(users.py): update type annotation for current_user parameter from Session to User
🔧 fix(utils.py): update import statement from sqlalchemy.orm to sqlmodel.Session
🔧 fix(utils.py): update type annotation for token parameter from Annotated to Union[Coroutine, str]
🔧 fix(utils.py): update type annotation for get_user_by_username function return type from User to Union[User, None]
🔧 fix(utils.py): update type annotation for get_user_by_id function return type from User to Union[User, None]
🔧 fix(manager.py): update type annotation for dependencies parameter in register_factory method from List to Optional[List]
🐛 fix(test_user.py): fix typo in test_user_waiting_for_approval function name
🐛 fix(test_user.py): fix typo in test_deactivated_user_cannot_access function name
🐛 fix(test_user.py): fix typo in test_data_consistency_after_update function name
🐛 fix(test_user.py): fix typo in test_data_consistency_after_delete function name
🐛 fix(test_user.py): fix typo in test_inactive_user function name
🐛 fix(test_user.py): fix typo in test_normal_user_cant_read_all_users function name
🐛 fix(test_user.py): fix typo in test_patch_user_wrong_id function name
🐛 fix(test_user.py): fix typo in test_delete_user_wrong_id function name
🐛 fix(test_user.py): fix typo in test_normal_user_cant_delete_user function name
✨ feat(test_user.py): add test_add_super_user_for_testing_purposes_delete_me_before_merge_into_dev function
🐛 fix(test_login.py): fix typo in test_login_unsuccessful_wrong_username test
🐛 fix(test_login.py): fix typo in test_login_unsuccessful_wrong_password test