feat: sync api_key plugin runtime and sql with management ui changes#3
Open
yzbf-lin wants to merge 2 commits intofastapi-practices:masterfrom
Open
feat: sync api_key plugin runtime and sql with management ui changes#3yzbf-lin wants to merge 2 commits intofastapi-practices:masterfrom
yzbf-lin wants to merge 2 commits intofastapi-practices:masterfrom
Conversation
added 2 commits
March 17, 2026 13:12
Align the standalone api_key plugin with the current API Key management UI contract.\n\nThis updates pagination, status toggling, expire_time write semantics, masked list output, and adds the MySQL menu SQL alongside the plugin runtime code.
Replace the single MySQL menu script with the standard plugin SQL layout.\n\nThis adds MySQL/PostgreSQL init scripts for both normal and snowflake ID modes and keeps the menu definitions aligned across dialects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR syncs the standalone
api_keyplugin with the current API Key management UI contract.It aligns the plugin runtime APIs, write payload schema, masked list output, and adds the plugin-level MySQL menu SQL used for host integration.
Changes
PUT /api/v1/sys/api-keys/{pk}/statusfor quick enable/disableis_superuserthrough the delete API pathexpire_dayswithexpire_timein create/update schemaexpire_timedirectlysql/mysql/api_key_menu.sqlat plugin root levelAffected Files
api/v1/sys/api_key.pyschema/api_key.pyservice/api_key_service.pycrud/crud_api_key.pysql/mysql/api_key_menu.sqlValidation
python3 -m py_compile api/v1/sys/api_key.py schema/api_key.py service/api_key_service.py crud/crud_api_key.pyCompatibility Notes
This PR changes the create/update request contract from
expire_daystoexpire_time.Clients still sending
expire_daysneed to be updated accordingly.Related