-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "🔥 feat: Add support for context.Context in keyauth middleware" #3364
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request simplifies token extraction in the key authentication middleware by eliminating context handling via the standard library’s Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client Request
participant FC as fiber.Ctx
participant TK as TokenFromContext
C->>FC: Send request with Authorization header
FC->>TK: Invoke TokenFromContext(Fiber.Ctx)
TK->>FC: Retrieve token from Locals
TK-->>FC: Return token (or empty string)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3364 +/- ##
==========================================
+ Coverage 83.67% 83.72% +0.05%
==========================================
Files 118 118
Lines 11721 11711 -10
==========================================
- Hits 9807 9805 -2
+ Misses 1486 1480 -6
+ Partials 428 426 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50
.
Benchmark suite | Current: 811732c | Previous: 87f3f0c | Ratio |
---|---|---|---|
Benchmark_Compress_Levels/Brotli_LevelBestCompression - B/op |
6 B/op |
0 B/op |
+∞ |
This comment was automatically generated by workflow using github-action-benchmark.
Reverts #3287
Reversion of Middleware Changes in Fiber v3
Following discussions in issue #3358, we have reverted changes that attempted to copy values into
context.Context
within various middlewares. These changes were removed to maintain Fiber’s lightweight design, improve performance, and avoid unnecessary complexity for users who do not requirecontext.Context
.Why Were These Changes Reverted?
context.Context
for every request introduces unnecessary overhead.c.Locals()
, making context modifications redundant.context.Context
values can implement a trivial custom middleware without affecting default behavior.