You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 21f8e51
Browse filesBrowse the repository at this point in the historyBrowse files
feat(sse): make parser limits configurable via SSEParserConfig
- Default max line length raised from 64 KB to 1 MB to fix interop
with servers emitting large single data: lines
- Limits configurable via a2a.sse.* properties (MicroProfile Config)
or programmatically through SSEParserConfig builder
Fixesa2aproject#1123
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Copy file name to clipboardExpand all lines: docs/content/dev/configuration.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,45 @@ The `DefaultPushNotificationUrlValidator` enforces these policies. Custom implem
113
113
114
114
> **Known limitation — DNS rebinding:** hostname resolution happens at validation time, not at connection time. An attacker controlling a domain could register a URL that initially resolves to a public IP, then change the DNS record to an internal address before the next push event fires. The DNS cache reduces this window but does not eliminate it. Deployments with strict SSRF requirements should use network-level firewall rules to block outbound traffic to internal ranges.
115
115
116
+
### SSE Parser Limits
117
+
118
+
```properties
119
+
# Maximum characters per raw SSE line (default: 1048576, 0 to disable)
120
+
a2a.sse.max-line-length=1048576
121
+
122
+
# Maximum data: lines per event block (default: 1000)
123
+
a2a.sse.max-buffer-lines=1000
124
+
125
+
# Maximum total characters across all data: values per event (default: 1048576)
126
+
a2a.sse.max-buffer-chars=1048576
127
+
```
128
+
129
+
These limits control the client-side `ServerSentEventParser` used when consuming SSE streams. They provide defense-in-depth against maliciously large events without rejecting legitimate payloads.
130
+
131
+
> **Scope:** The `a2a.sse.*` properties are read by the Quarkus CDI producer (`SSEParserConfigProducer`) and applied to the CDI-managed `A2AHttpClient` bean. Clients created via `A2AHttpClientFactory` (ServiceLoader) or the no-arg constructors use the built-in defaults. To customize limits outside Quarkus, construct the client programmatically (see example below).
132
+
133
+
**`a2a.sse.max-line-length`** caps the number of characters in a single raw SSE line (`data:`, `event:`, etc.). Set to `0` to disable the per-line check entirely (the per-event `max-buffer-chars` limit still applies). Increase this if your agents return large single-line JSON payloads.
134
+
135
+
**`a2a.sse.max-buffer-lines`** limits how many `data:` lines a single event block can contain.
136
+
137
+
**`a2a.sse.max-buffer-chars`** limits the total character count across all `data:` values within a single event. This is the primary guard against oversized events.
138
+
139
+
> **Note:** These limits only apply to clients backed by `ServerSentEventParser` (`JdkA2AHttpClient` and `AndroidA2AHttpClient`). The Vert.x HTTP client uses Vert.x-native SSE parsing and is not affected by these settings.
0 commit comments