fix(auth): rename dict variable to avoid shadowing built-in#2920
Open
hobostay wants to merge 1 commit into
Open
fix(auth): rename dict variable to avoid shadowing built-in#2920hobostay wants to merge 1 commit into
dict variable to avoid shadowing built-in#2920hobostay wants to merge 1 commit into
Conversation
The `decode_jwt` function used a local variable named `dict` which shadows the Python built-in `dict` type. This is a code clarity issue and could cause subtle bugs if the built-in is needed later in the function. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
dicttodecoded_tokenindecode_jwt()to avoid shadowing the Python built-indicttype.Why
In
backend/chainlit/auth/jwt.py:35, thedecode_jwtfunction assigns the decoded JWT payload to a variable nameddict, which shadows Python's built-indicttype. While this doesn't currently cause a runtime error, it is a code clarity issue and could lead to subtle bugs if the built-indictwere needed later in the function (e.g., for type checking or casting).Test plan
uv run pytest tests/ -k jwtfrombackend/)🤖 Generated with Claude Code
Summary by cubic
Renamed the local variable
dicttodecoded_tokenindecode_jwt()to avoid shadowing the Python built-in and improve code clarity. No behavior change; JWT payload handling remains the same.Written for commit 9ca50ef. Summary will update on new commits.