Commit 6f5622c
committed
Fix remaining CodeRabbit review issues for Keycloak provider
Address 3 additional code review comments from CodeRabbitAI:
- Fix markdownlint violations in keycloak/README.md:
- Add bash language tag to docker-compose restart code block
- Remove trailing whitespace
- Add blank line after Python code fence for proper list continuation
- Guard against missing access token in server.py get_access_token_claims tool:
- Check if token or token.claims is None before accessing claims
- Raise RuntimeError with clear message instead of AttributeError
- Provides better error handling for unauthenticated requests
- Preserve Authorization header when proxying client registration in keycloak.py:
- Forward all incoming headers except Host to support authenticated DCR
- Enables realms that require initial access tokens or bearer tokens
- Avoids routing issues by excluding Host header
- Ensures Content-Type is always application/json for modified body
These changes improve error handling, support authenticated Dynamic Client
Registration scenarios, and ensure documentation passes linting checks.1 parent eb73267 commit 6f5622c
File tree
3 files changed
+16
-4
lines changed- examples/auth/keycloak_auth
- keycloak
- src/fastmcp/server/auth/providers
3 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
283 | 292 | | |
284 | 293 | | |
285 | 294 | | |
286 | | - | |
287 | | - | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
0 commit comments