This repository was archived by the owner on Sep 8, 2025. It is now read-only.
fix: validate uuid on admin methods and fix wrong factor in delete_factor method #706
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces UUID validation for user-related operations in both the asynchronous and synchronous versions of the
gotrue_admin_apimodule. It ensures that invalid UUIDs are caught early, preventing unnecessary API calls. Additionally, new tests have been added to verify this behavior.UUID Validation Enhancements:
is_valid_uuidinsupabase_auth/helpers.pyto validate UUIDs._validate_uuidmethod in bothsupabase_auth/_async/gotrue_admin_api.pyandsupabase_auth/_sync/gotrue_admin_api.pyto validate UUIDs before making API requests. [1] [2]get_user_by_id,update_user_by_id,delete_user,_list_factors,_delete_factor) ingotrue_admin_apito call_validate_uuidfor input validation. [1] [2] [3] [4] [5] [6] [7] [8]Test Coverage:
tests/_async/test_gotrue_admin_api.pyto verify that invalid UUIDs raiseValueErrorin all relevant methods.tests/_sync/test_gotrue_admin_api.pyfor the synchronous API.Other Changes:
supabase_auth/_async/gotrue_admin_api.pyandsupabase_auth/_sync/gotrue_admin_api.pyto includeis_valid_uuid. [1] [2]uuidimport insupabase_auth/helpers.pyto support UUID validation.