feat(BA-3668): remove unnecessary informations from model service JWT #7705
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.
resolves #7704 (BA-3668).
This pull request focuses on reducing the size of JWT tokens generated for model service endpoints by removing unnecessary information and centralizing the logic for JWT creation. The changes streamline the payload, mask sensitive data, and move JWT generation to the
Circuitmodel for better maintainability.JWT Generation Improvements:
generate_jwtmethod to theCircuitmodel to create JWT tokens with only essential information, removing unrelated and sensitive fields such asconfigandroute_info. (src/ai/backend/appproxy/coordinator/models/circuit.py, src/ai/backend/appproxy/coordinator/models/circuit.pyR417-R431)generate_jwtmethod, ensuring a smaller and cleaner JWT payload. (src/ai/backend/appproxy/coordinator/api/endpoint.py, src/ai/backend/appproxy/coordinator/api/endpoint.pyL303-R304)Codebase Cleanup:
jwtlibrary from the endpoint API, consolidating JWT logic in the model layer. (src/ai/backend/appproxy/coordinator/api/endpoint.py, src/ai/backend/appproxy/coordinator/api/endpoint.pyL9)jwtimport to the model file to support the new centralized JWT generation method. (src/ai/backend/appproxy/coordinator/models/circuit.py, src/ai/backend/appproxy/coordinator/models/circuit.pyR5)Documentation:
changes/.feature.md, changes/.feature.mdR1)