Commit 84252cb
committed
feat(gateway): migrate all handlers to typed router
All 14 handler files migrate from raw void(httplib::Request, Response)
signatures to typed Result<TResponse>(TypedRequest [, TBody]):
- health, discovery (18 routes), lock (5 + 201/Location), trigger
(6 incl. SSE), cyclic_subscription (6 incl. SSE), auth (3 + OAuth2
error renderer), update (8 incl. 202/Location), log (3 typed
fan-out), script (8 incl. multipart upload, HATEOAS _links typed),
bulkdata (11 incl. binary_download + multipart_upload), config (5
incl. del_alternates<NoContent, ConfigurationDeleteMultiStatus> for
204/207), operation (7 incl. post_alternates for sync/async, plugin
passthrough for free-form body), data (5 incl. opaque DataValue),
fault (6 + SSE incl. del_alternates and X-Medkit-Local-Only
attachment).
rest_server.cpp setup_routes is now exclusively typed reg.get<T>/
post<TB,T>/put<TB,T>/del<T>/patch<TB,T>/sse<TEvent>/binary_download/
multipart_upload<T>/static_asset/docs_endpoint. The deprecated raw
overloads on RouteRegistry are removed.
Issue #338 final compliance: per-item wire shape for fault list and
configuration list endpoints is now enforced by JsonReader<T> (closes
the "schema declares Items[T] but wire is raw json" gap).
Forwarded path through aggregation: validators that proxy to a peer
return Forwarded; the framework wrapper detects an internal sentinel
ErrorInfo and skips the response write so the proxied response stays
intact. Wire format byte-identical with the legacy direct-write
forwarded path.
operation_handlers plugin branch passes the raw request body to
OperationProvider::execute_operation rather than the typed
ExecutionCreateRequest envelope, preserving the pre-migration ABI for
plugin operations that read vendor-specific top-level keys (UDS
session_type / reset_type, OPC-UA acknowledge_fault arguments).
Tests:
- test_*_handlers.cpp rewritten to assert against Result<T> return
values rather than http response state.
- Integration tests run unchanged - wire format byte-identical.1 parent 2a52385 commit 84252cb
49 files changed
Lines changed: 8921 additions & 7731 deletions
File tree
- src/ros2_medkit_gateway
- include/ros2_medkit_gateway
- core
- http/handlers
- http/handlers
- src
- core/aggregation
- http
- handlers
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 30 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | | - | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
31 | 48 | | |
32 | 49 | | |
33 | 50 | | |
| |||
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
45 | 61 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 62 | + | |
| 63 | + | |
50 | 64 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
55 | 69 | | |
56 | 70 | | |
57 | 71 | | |
| |||
Lines changed: 25 additions & 69 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | 17 | | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
| 21 | + | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
| |||
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 61 | + | |
| 62 | + | |
70 | 63 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 64 | + | |
| 65 | + | |
81 | 66 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
96 | 70 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 71 | + | |
| 72 | + | |
107 | 73 | | |
108 | 74 | | |
109 | 75 | | |
| |||
125 | 91 | | |
126 | 92 | | |
127 | 93 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 94 | | |
139 | 95 | | |
140 | 96 | | |
| |||
Lines changed: 41 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
31 | 48 | | |
32 | 49 | | |
33 | 50 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 51 | + | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
45 | 59 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 60 | + | |
| 61 | + | |
50 | 62 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
| |||
0 commit comments