Commit 356190c
[fit] Add comprehensive HTTP client authentication support (#325)
* feat: Add comprehensive HTTP client authentication support
Implement @requestauth annotation with multi-level authentication support for
HTTP client proxy interfaces. The new authentication system supports Bearer tokens,
Basic auth, API keys, and custom authentication providers.
Key Features:
- @requestauth annotation with support for interface, method, and parameter levels
- Multiple auth types: BEARER, BASIC, API_KEY, CUSTOM
- Static configuration and dynamic AuthProvider support
- Flexible parameter locations: HEADER, QUERY, COOKIE
- Priority system: parameter > method > interface level
- Seamless integration with existing Authorization system
Implementation:
- AuthType enum defining supported authentication types
- AuthProvider interface for dynamic authentication
- RequestAuthResolver for annotation parsing
- AuthDestinationSetter for request building integration
- StaticAuthApplier for class/method level static auth
- Extended AnnotationParser to handle multi-level auth annotations
Examples and Tests:
- TestAuthClient demonstrating various auth scenarios
- AuthProvider examples: DynamicTokenProvider, ApiKeyProvider, CustomSignatureProvider
- Server-side TestAuthServerController for auth validation
- Comprehensive unit tests for resolver and setter components
- Updated TestClientController with auth testing endpoints
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: Fix unclosed HTML <p> tags in JavaDoc comments
Close all unclosed <p> tags in JavaDoc comments to ensure proper HTML validation
and documentation rendering. This improves code documentation quality and
maintains consistent JavaDoc formatting standards.
Changes:
- Fixed unclosed <p> tags in RequestAuth annotation
- Fixed unclosed <p> tags in AuthType enum
- Fixed unclosed <p> tags in AuthProvider interface
- Fixed unclosed <p> tags in RequestAuthResolver class
- Fixed unclosed <p> tags in StaticAuthApplier class
- Fixed unclosed <p> tags in AuthDestinationSetter class
- Fixed unclosed <p> tags in TestAuthServerController class
- Removed OPTIMIZATION_SUMMARY.md file as requested
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: Fix test script server connectivity check
Fix the server connectivity check in run_tests.sh to use an actual existing
endpoint instead of the non-existent root path. The script was trying to
access /http-server/auth which doesn't exist on the server, causing
HttpHandlerNotFoundException errors.
Changes:
- Modified check_server() function to use /bearer-static endpoint for connectivity check
- Added HEAD request (-I flag) to avoid unnecessary response body processing
- Prevents false server connection failures during test execution
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: Remove problematic server connectivity check from test script
Remove the complex server connectivity check that was causing HTTP handler
not found errors. The script now directly proceeds to actual testing, which
will naturally fail with clear error messages if the server is not running.
Changes:
- Replaced check_server() with simple show_server_info() function
- Removed all network probing logic (nc, telnet, curl connectivity tests)
- Simplified startup - script now shows server info and proceeds to tests
- Tests themselves will indicate if server is unreachable with clearer errors
This approach is more reliable and avoids accessing non-existent endpoints
that trigger HttpHandlerNotFoundException in the server logs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent 0e211d0 commit 356190c
File tree
21 files changed
+1931
-2
lines changed- examples/fit-example/07-http-client-proxy
- plugin-http-client/src/main/java/modelengine/fit/example
- auth
- client
- controller
- plugin-http-server/src/main/java/modelengine/fit/example/controller
- framework/fit/java/fit-builtin/services/fit-http-classic/definition/src
- main/java/modelengine/fit/http
- annotation
- client/proxy
- auth
- scanner
- resolver
- support
- applier
- setter
- test/java/modelengine/fit/http/client/proxy
- scanner/resolver
- support/setter
21 files changed
+1931
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 211 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
0 commit comments