fix: set the pat to context for audit #4007
Merged
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 refactors the
PersonalAccessToken
middleware inmanager/middlewares/personal_access_token.go
to improve the handling of the personal access token within the request context. The key change involves moving the context-setting logic for the token to an earlier point in the function for better auditability.Middleware improvements:
manager/middlewares/personal_access_token.go
: Moved thec.Set("pat", &token)
call to an earlier point in thePersonalAccessToken
function, ensuring the personal access token is set in the context immediately after it is retrieved. This change supports better audit logging and context management. [1] [2]Description
Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist