Commit graph

4,651 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
aba898adf7 Merge branch 'login' of https://github.com/logspace-ai/langflow into login 2023-08-28 17:56:56 -03:00
Gabriel Luiz Freitas Almeida
099921514c 🐛 fix(endpoints.py): add missing colon after if statement condition to fix syntax error
🔒 chore(endpoints.py): fix indentation and add missing colon after if statement condition for better code readability
2023-08-28 17:56:40 -03:00
Gabriel Luiz Freitas Almeida
1b79c1bd7e 🐛 fix(types.py): pass user_id parameter to build methods in AgentVertex, LLMVertex, WrapperVertex, ChainVertex, and PromptVertex to enable user-specific functionality 2023-08-28 17:56:39 -03:00
Gabriel Luiz Freitas Almeida
ac6d2ff8b4 🔥 refactor(service.py): remove unused import and commented code in AuthManager class 2023-08-28 17:56:38 -03:00
Gabriel Luiz Freitas Almeida
31abe8d67e 🐛 fix(utils.py): fix missing return statement in api_key_security function
🔀 refactor(utils.py): refactor create_super_user function to use Optional types for username and password parameters
2023-08-28 17:56:38 -03:00
Gabriel Luiz Freitas Almeida
d9deb6fd5f 🔧 chore(util.py): add type ignore comment to import statement for multiprocess module
🐛 fix(util.py): fix condition to check if "BaseModel" is in the string representation of _type to avoid skipping BaseModel types in format_dict function
2023-08-28 17:56:37 -03:00
Gabriel Luiz Freitas Almeida
2edffd33ee 🐛 fix(endpoints.py): add missing colon after if statement condition
🔒 chore(endpoints.py): rename api_key parameter to api_key_user for clarity and consistency
🔒 chore(endpoints.py): add type hint for api_key_user parameter to indicate it is of type User
🔒 chore(endpoints.py): remove unnecessary assignment of api_key_user from api_key.user
2023-08-28 17:56:36 -03:00
Cristhian Zanforlin Lousa
7dcb534eb3 Merge branch 'login' of https://github.com/logspace-ai/langflow into login 2023-08-28 17:56:28 -03:00
Cristhian Zanforlin Lousa
0a2ced4e60 🔧 fix(authContext.tsx): remove unused refreshAccessToken function to improve code readability and maintainability
🔧 fix(tabsContext.tsx): remove unnecessary console.error statements to improve code readability and maintainability
🔧 fix(genericModal/index.tsx): remove unnecessary console.log statement to improve code readability and maintainability
🔧 fix(ApiKeysPage/index.tsx): remove unnecessary console.log statement to improve code readability and maintainability
🔧 fix(auth.ts): remove unused refreshAccessToken function type to improve code readability and maintainability
2023-08-28 17:56:24 -03:00
Gabriel Luiz Freitas Almeida
c9fef26981
Merge branch 'dev' into login 2023-08-28 20:34:08 +00:00
igorrCarvalho
70a8b1f630 Fix: Admin Page button showing even when logged as normal user 2023-08-28 17:28:32 -03:00
igorrCarvalho
97aa1e1443 Fix: Remove processCode() for when popUp open and make it only happen when click Check and save 2023-08-28 17:15:58 -03:00
Gabriel Luiz Freitas Almeida
a154955154 🔧 fix(__main__.py): import display_results function from utils.util to fix NameError
 feat(__main__.py): add migration command to run database migrations with an option to run in test mode
🔧 fix(util.py): import console from __main__ module to fix NameError
 feat(util.py): add display_results function to display migration results in a table format
2023-08-28 16:22:56 -03:00
Gabriel Luiz Freitas Almeida
5f2a949ec5 🔧 fix(manager.py): import missing dependencies to resolve NameError and improve code readability
 feat(manager.py): add method run_migrations_test() to check if all models are in the database and up to date with all columns
 feat(manager.py): add method check_table() to check if a table exists and if all expected columns are present
🔧 fix(utils.py): import missing dependencies to resolve NameError and improve code readability
 feat(utils.py): add dataclasses Result and TableResults to store check results for tables and columns
2023-08-28 16:22:55 -03:00
Gabriel Luiz Freitas Almeida
bdd04004b3 🔀 chore(utils.py): add type hints to the get_db_manager() function for better code readability and maintainability 2023-08-28 16:22:54 -03:00
igorrCarvalho
2b88963e64 refactor: bring back border to the login related buttons 2023-08-28 16:20:19 -03:00
igorrCarvalho
8f90e61379 Refactor: update Last Used from invalid date to never 2023-08-28 16:07:57 -03:00
Gabriel Luiz Freitas Almeida
137954de6b 🐛 fix(__main__.py): rename serve command to run command for better semantics and clarity
🔧 chore(test_cli.py): update test to use the new run command instead of serve command
 feat(test_cli.py): add test for creating a superuser with the superuser command
2023-08-28 15:47:57 -03:00
Gabriel Luiz Freitas Almeida
ecf54acb7c 🔧 fix(adds_tables.py): set default values for 'total_uses' and 'is_active' columns to improve data consistency and simplify code 2023-08-28 15:30:42 -03:00
Gabriel Luiz Freitas Almeida
9604ace084 🔥 chore(adds_tables.py): remove 'flowstyle' table and related indices if it exists during upgrade to ensure data consistency
🔥 chore(adds_tables.py): remove 'flowstyle' table and related indices if it exists during downgrade to ensure data consistency
2023-08-28 14:45:30 -03:00
Gabriel Luiz Freitas Almeida
4320b127d3 🐛 fix(utils.py): handle exception when running migrations to ignore "already exists" error and prevent unnecessary error logging and raising of RuntimeError 2023-08-28 14:43:58 -03:00
igorrCarvalho
cb3fc079c6 refactor: Migrate api key messages to constants 2023-08-28 14:06:22 -03:00
Gabriel Luiz Freitas Almeida
58317a3891 🔧 chore(adds_tables.py): add comment explaining the reason for dropping '_alembic_tmp_flow' table before creating indices 2023-08-28 11:54:13 -03:00
Gabriel Luiz Freitas Almeida
49d6054517 🔧 fix(adds_tables.py): fix foreign key creation for 'flow' table when 'user' table exists
 feat(adds_tables.py): add support for creating 'user_id' column in 'flow' table if it does not exist
🔧 fix(adds_tables.py): fix index creation for 'flow' table when 'user_id' column exists
2023-08-28 11:53:24 -03:00
Gabriel Luiz Freitas Almeida
2a53ac2688 🐛 fix(util.py): handle IndentationError when parsing class source code and log an error message 2023-08-28 11:18:16 -03:00
Gabriel Luiz Freitas Almeida
4d08d511e9 🐛 fix(manager.py): fix typo in logger.warn to logger.warning
 feat(manager.py): add check_schema_health method to DatabaseManager to verify the integrity of the database schema
🐛 fix(utils.py): add error handling when checking schema health in initialize_database method
2023-08-28 11:18:01 -03:00
Gabriel Luiz Freitas Almeida
0aa8a25e3f 🔧 chore(util.py): remove unnecessary check for "BaseModel" in _type variable
The check for "BaseModel" in the _type variable is unnecessary and can be safely removed.
2023-08-28 11:17:44 -03:00
Gabriel Luiz Freitas Almeida
f922214d2a 🐛 fix(endpoints.py): add check for missing api_key and raise HTTPException with status code 401 and detail message "Invalid API Key"
🐛 fix(crud.py): remove unnecessary return statement and update_total_uses function call if api_key_object is None
2023-08-28 11:17:34 -03:00
Gabriel Luiz Freitas Almeida
2d22737c31 🐛 fix(adds_tables.py): create "user" and "apikey" tables only if they don't exist to prevent duplicate table creation
 feat(adds_tables.py): add unique index on "username" column in "user" table for faster username lookups
 feat(adds_tables.py): add unique index on "api_key" column in "apikey" table for faster API key lookups
 feat(adds_tables.py): add index on "name" column in "apikey" table for faster name lookups
 feat(adds_tables.py): add index on "user_id" column in "apikey" table for faster user ID lookups
2023-08-28 11:17:12 -03:00
Gabriel Luiz Freitas Almeida
cb6fafb723 🔖 chore(pyproject.toml): update langchain dependency version from 0.0.256 to 0.0.274
🔖 chore(pyproject.toml): update package version from 0.4.14 to 0.5.0a0
2023-08-28 11:16:46 -03:00
Gabriel Luiz Freitas Almeida
1c498e78df 🐛 fix(test_cli.py): update CLI command in test_components_path to use 'serve' subcommand for better clarity and consistency
🐛 fix(test_llms_template.py): update description of `model` to use backticks and remove unnecessary comment
2023-08-28 11:16:37 -03:00
Gabriel Luiz Freitas Almeida
59a08cd645 🔧 chore(crud.py): change return type of check_key function from bool to Optional[ApiKey] to provide more information about the API key
🔧 chore(crud.py): rename api_key variable to api_key_object in check_key function for better clarity
🔧 chore(crud.py): change return value of check_key function from True to api_key_object.user to provide the associated user with the API key
2023-08-28 07:01:01 -03:00
Gabriel Luiz Freitas Almeida
ed9796e473 🐛 fix(api_key.py): change variable name from 'e' to 'exc' for better readability and semantics
🐛 fix(endpoints.py): add 'api_key' parameter to 'process_flow' function to fix missing dependency error
🐛 fix(endpoints.py): add exception chaining to HTTPException in 'process_flow' function for better error handling
🐛 fix(utils.py): change return type of 'api_key_security' function to Optional[ApiKey] for better type hinting
🐛 fix(utils.py): change variable name from 'e' to 'exc' for better readability and semantics
2023-08-28 07:00:45 -03:00
Gabriel Luiz Freitas Almeida
4bc4a39e5e 🔒 chore(api_key.py): refactor mask_api_key validator to improve readability and maintainability
🔒 chore(api_key.py): update api_key field in ApiKeyRead model to remove index=True and unique=True constraints
2023-08-28 06:48:38 -03:00
Gabriel Luiz Freitas Almeida
5605b2aa44 🔥 refactor(alembic): remove flowstyles table migration
🔥 refactor(alembic): remove add_flow_table migration

 feat(alembic): add adds_tables migration to create user and apikey tables

🔥 chore(alembic): remove unnecessary alembic migration files

The following alembic migration files were removed:
- `5512e39b4012_add_apikey_table.py`
- `6384181fb7e8_update_api_key.py`
- `d3749cf7ac7e_update_all_tables.py`

These files are no longer needed as they are no longer relevant to the current state of the database schema. Removing them helps to keep the project's codebase clean and organized.
2023-08-27 20:04:15 -03:00
Gabriel Luiz Freitas Almeida
d06ea50674 🐛 fix(env.py): enable batch rendering for migrations to improve performance 2023-08-27 19:55:32 -03:00
Gabriel Luiz Freitas Almeida
19653858be 🔧 chore(utils.py): refactor create_super_user function to accept optional username and password parameters for flexibility
🔒 fix(utils.py): use the provided username and password parameters if available when creating the super user, instead of relying solely on the settings manager
2023-08-27 19:55:20 -03:00
Gabriel Luiz Freitas Almeida
7d3a3db7e3 🔧 chore(__main__.py): refactor imports to improve readability and maintainability
 feat(__main__.py): add 'superuser' command to create a superuser with provided username and password
2023-08-27 19:55:09 -03:00
Gabriel Luiz Freitas Almeida
b70d5501a2 🐛 fix(ApiKeysPage): handle cases where keysList.current is null or undefined to prevent errors
 feat(ApiKeysPage): add conditional rendering for keysList.current to display appropriate messages when there are no keys assigned or when loading keys
2023-08-27 19:54:59 -03:00
Gabriel Luiz Freitas Almeida
048ea7f743 🔧 chore(Makefile): update pytest command to run tests in parallel using pytest-xdist plugin
📦 deps(pyproject.toml): add pytest-xdist as a development dependency to enable parallel test execution
2023-08-27 19:16:51 -03:00
Gabriel Luiz Freitas Almeida
ea4cd294c1 🔧 fix(test_endpoints.py): fix typo in function name 'created_api_key' to 'create_api_key' for consistency
 feat(test_endpoints.py): add test case for handling invalid API key in 'test_process_flow_invalid_api_key' function
 feat(test_endpoints.py): add test case for handling invalid flow ID in 'test_process_flow_invalid_id' function
 feat(test_endpoints.py): add test case for handling flow not found in 'test_process_flow_invalid_id' function
 feat(test_endpoints.py): add test case for testing process flow without autologin in 'test_process_flow_without_autologin' function
2023-08-27 19:16:39 -03:00
Gabriel Luiz Freitas Almeida
a700ab1f71 🐛 fix(endpoints.py): handle specific exceptions when processing flow to provide more informative error messages 2023-08-27 19:16:30 -03:00
Gabriel Luiz Freitas Almeida
7c2bbad5ab 🐛 fix(api_key.py): fix delete_api_key_route URL path by removing double slashes 2023-08-26 17:40:02 -03:00
Gabriel Luiz Freitas Almeida
e850c0cbc6 🔧 fix(api_key/crud.py): remove unused import statement for get_password_hash function
 feat(api_key/crud.py): prepend 'lf-' to generated API key for better identification and readability
 feat(api_key/crud.py): add check_key function to validate API key and update total uses and last used at timestamp
2023-08-26 17:39:22 -03:00
Gabriel Luiz Freitas Almeida
9c77cc1875 🔧 fix(endpoints.py): update import statement for get_current_active_user function to match the new location
🔧 fix(endpoints.py): update import statement for api_key_security function to match the new location
🔧 fix(endpoints.py): update dependencies argument in router.post calls to use a list instead of multiple lines for better readability
🔧 fix(endpoints.py): remove valid argument from process_flow function as it is no longer needed
🔧 fix(api_key.py): remove hashed_api_key field as it is no longer used
🔧 fix(api_key.py): add total_uses field to track the number of times the API key has been used
🔧 fix(api_key.py): add is_active field to track the status of the API key
2023-08-26 17:39:08 -03:00
Gabriel Luiz Freitas Almeida
f687599ecc 🐛 fix(api_key.py): fix incorrect route prefix in APIRouter declaration 2023-08-26 17:38:56 -03:00
Gabriel Luiz Freitas Almeida
0f3bf9192d 🔒 chore(utils.py): refactor import statements and remove unused imports for better code organization and readability
🔒 chore(utils.py): refactor auth_scheme_dependency to use OAuth2PasswordBearer for better security
🔒 chore(utils.py): refactor validate_api_key to use check_key function from crud module for better code reuse
🔒 chore(utils.py): add api_key_security function to handle API key authentication logic
🔒 chore(utils.py): refactor get_current_user to use oauth2_login dependency for better security
🔒 chore(utils.py): remove unused validate_api_key function
🔒 chore(auth.py): remove unused oauth2_scheme variable for better code organization
2023-08-26 17:38:43 -03:00
Gabriel Luiz Freitas Almeida
ed06c3b4d9 🐛 fix(conftest.py): import missing Flow model in tests/conftest.py to fix NameError
 feat(conftest.py): add fixture 'flow' to create a test flow in tests/conftest.py
🐛 fix(test_endpoints.py): import missing get_settings_manager function in tests/test_endpoints.py to fix NameError
 feat(test_endpoints.py): add test case 'test_process_flow_without_autologin' to test flow processing without auto login
🐛 fix(test_endpoints.py): fix incorrect endpoint URL in test case 'test_process_flow_without_autologin' in tests/test_endpoints.py
 feat(test_endpoints.py): add test case 'test_process_flow_fails_autologin_off' to test flow processing failure when auto login is off
2023-08-26 17:38:21 -03:00
Gabriel Luiz Freitas Almeida
96c7d4c897 🔧 chore(api_key.py): remove index and unique constraints from api_key field in UnmaskedApiKeyRead model to align with database schema changes 2023-08-25 20:12:49 -03:00
Cristhian Zanforlin Lousa
512be8b9a7 Merge branch 'login' of https://github.com/logspace-ai/langflow into login 2023-08-25 20:06:16 -03:00