502 Commits
Author SHA1 Message Date
Aryan Shah bf446775a1 Wait for writes to drain before closing in NIOHTTP2ServerConnectionManagementHandler (#582)
### Motivation

`NIOHTTP2ServerConnectionManagementHandler` was derived from the
implementation in
[`gRPC-swift-nio-transport`](https://github.com/grpc/grpc-swift-nio-transport/blob/main/Sources/GRPCNIOTransportCore/Server/Connection/ServerConnectionManagementHandler.swift).

In that implementation, PR
https://github.com/grpc/grpc-swift-nio-transport/pull/183 updated the
way how the channel is closed. The channel is now first half-closed and
then fully-closed in order to allow all pending writes to drain.

This is also applicable in this implementation, so we should apply the
same change here.

### Modifications

Applied the changes verbatim from PR
https://github.com/grpc/grpc-swift-nio-transport/pull/183.

### Result

Pending writes are drained when gracefully shutting down.
2026-11-17 10:10:41 +00:00
Cory Benfield 728149ca4f Update the thresholds for 6.4 (#568) 2026-10-07 11:06:59 +01:00
apple-ospo[bot] 8d2c7b93f8 Housekeeping: replace repo-level CODE_OF_CONDUCT (#565)
Co-authored-by: apple-ospo[bot] <326325757+apple-ospo[bot]@users.noreply.github.com>
2026-09-26 00:39:27 +02:00
Rafael Cepeda c702a62e27 Delete SECURITY.md (#564)
Deleting file to favour org-wide
https://github.com/apple/.github/blob/main/SECURITY.md.
2026-09-09 16:58:42 +01:00
DmitryandDmitry Rantovov 0f3e54e29c Match the documented parameter names to the signatures in NIOHPACK (#562)
The base64 helper looks like it came over from Foundation with
`Data(base64Encoded:options:)` still in the doc comment, and the
parameter is a Bool now. The other two seem to be plain leftovers. All
three are internal, so DocC never builds them and nothing flags the
mismatch. Nothing else touched.

Co-authored-by: Dmitry Rantovov <rantovov5@gmail.com>
1.46.0
2026-09-01 05:57:10 +00:00
Eirik Botten Nicolaysen bea911a3de Reject the empty HTTP/2 field name (#563)
`isValidFieldName` validates a field name with `allSatisfy` over the
tchar set. `allSatisfy` returns `true` for an empty collection, so the
empty field name passes.

The file already states the rule it is implementing. The doc comment at
line 312 quotes:

```
token          = 1*tchar
```

The derivation that follows is correct — I expanded `0x21, 0x23...0x27,
0x2a, 0x2b, 0x2d, 0x2e, 0x30...0x39, 0x5e...0x7a, 0x7c, 0x7e` byte by
byte against tchar minus `A-Z` and every one of the four rewriting steps
in lines 315-341 holds, including the `%x5E-60 / %x61-7A` → `%x5E-7A`
collapse. It is the `1*` quantifier that is missing: the code implements
`*tchar`.

### Scope

All three block types accept an empty name today, since they share
`HeaderFieldName.init`:

```
request:  empty name -> accepted
response: empty name -> accepted
trailers: empty name -> accepted
```

An empty name serialises as `: value`, and RFC 9113 § 8.2.1 lists field
names as something a recipient is required to validate and treat as
malformed when the generic syntax is violated. This is a conformance gap
in a validator that already does the rest of that section — the
uppercase check, the CR/LF/NUL value check and the connection-specific
header check are all there.

(`":"` alone is already rejected, though as `unknownPseudoHeader` rather
than a name error, since `dropFirst()` leaves an empty base name that
matches no known pseudo-header. That path is unchanged here.)

### The change

An explicit early return, mirroring the shape swift-http-types uses for
the same production in `tokenValidity`:

```swift
if buffer.isEmpty {
    return .invalid
}
```

### Tests

Added to `HTTP2FramePayloadToHTTP1CodecCRLFTests.swift`, which already
exercises `validateRequestBlock`, `validateResponseBlock` and
`validateTrailersBlock` directly for the § 8.2.1 value rules. Five
cases: the empty name in each of the three block types, plus `"a b"` and
an ordinary `x-custom-header` to keep the surrounding behaviour pinned.

### Verification

**I could not run `swift test` here**: this machine has Command Line
Tools without XCTest, so the test targets fail at `import XCTest` with
`no such module`. Pre-existing and unrelated — it reproduces on an
unmodified checkout (18 occurrences). **CI should be the authority;
treat my local run as unverified.**

`swift build` succeeds. I linked a throwaway executable against
`NIOHTTP2` to exercise the change directly:

```
PASS request:  empty name       -> rejected
PASS response: empty name       -> rejected
PASS trailers: empty name       -> rejected
PASS request:  "a b"            -> rejected
PASS request:  "Host" (uppercase) -> rejected
PASS request:  valid name       -> accepted
PASS request:  pseudo-headers only -> accepted
```

Before the change the first three were accepted.

### Conflicts

No open PR touches `HPACKHeaders+Validation.swift`. #531 and #562 touch
NIOHPACK, and #531 (`+ Fix a bug`) is about `isASCII` in
`HPACKHeader.swift` — no overlap with `isValidFieldName`.
2026-09-01 05:16:30 +00:00
Aryan Shah d6f5f25943 Rate-limit PING, SETTINGS, PRIORITY, ALTSVC, and ORIGIN frames (#561)
### Motivation

We currently mitigate against receiving an excessive numbers of
RST_STREAM frames, empty DATA frames, or encountering stream errors in a
given time window.

Receiving excessive numbers of PING, SETTINGS, PRIORITY, ALTSVC, or
ORIGIN frames also results in the endpoint performing unnecessary work.
As such, this PR adds these five frames to the current rate-limiting
mechanism.

### Modifications

- Updated `DOSHeuristics` to also rate-limit PING, SETTINGS, PRIORITY,
ALTSVC, and ORIGIN frames.
- Added a new `controlFrameRateLimit` property to
`NIOHTTP2Handler.ConnectionConfiguration`.
- Plumbed the configuration argument to `NIOHTTP2Handler` initializers.

### Result

Mechanism in place to avoid endpoints from being overwhelmed by
excessive PING, SETTINGS, PRIORITY, ALTSVC, or ORIGIN frames.
2026-08-18 17:43:05 +01:00
nishaddeokar 281170341a Fix outbound stream starvation (#559)
Motivation:

`nextStreamToSend()` returned `self.flushableStreams.first`, and since `Set.first` always yields the same stable element, under load the buffer kept handing the whole connection window to one stream while the rest starved to near-zero.

Modifiations:

Rotate through the flushable streams instead of always picking the same one. `flushableStreams` stays the source of truth for membership, and alongside it we keep a queue of those streams (`sendQueue`) in the order to serve them. We pop the front to pick the next stream, and append it to the back once it's been served, so every flushable stream gets a turn per sweep and none can be starved. Both the pop and the append are O(1). Removing a stream from the middle of the queue would be O(n), so we avoid this. A stream that stops being flushable is left as a stale entry and simply skipped when it reaches the front (lazy deletion), with a `queuedStreams` set to stop us ever enqueuing a duplicate.
2026-08-07 08:36:41 +01:00
abhinav9-coderandGeorge Barnett 45bdf67024 NIOHTTP2: reject SP and control characters in pseudo-header values (#555)
Stacks on #554 — the diff will show that commit too until it merges.

## Motivation

`isValidPseudoHeaderValue` rejects CR, LF and NUL, which is narrower
than the HTTP/1.1 request line actually needs.

`:path` ends up as the request-target in:

```
METHOD SP request-target SP HTTP-version CRLF
```

so `:path = "/a HTTP/1.1"` serializes to `GET /a HTTP/1.1 HTTP/1.1`.
Whether a recipient reads the first or the last SP-delimited token as
the version decides what the request-target actually is, which is the
usual parser-differential setup. RFC 9112 § 3.2 wants SP in a
request-target percent-encoded, and bare HTAB and the other CTLs aren't
valid there either.

None of the HTTP/2 pseudo-headers have a grammar that allows SP or a
CTL: `:method` and `:protocol` are tokens, `:scheme` is a URI scheme,
`:authority` is host[:port], `:path` is a request-target, `:status` is
3DIGIT. So rejecting them doesn't reject anything well-formed.

Same severity caveat as #554: NIOHTTP1's
`uriOnlyContainsAllowedCharacters` already rejects SP in a
request-target by default, so this is hardening rather than something
exploitable on a stock pipeline.

## Modifications

`isValidPseudoHeaderValue` goes from `{0x00, 0x0A, 0x0D}` to `<= 0x20 ||
== 0x7F`, so the whole CTL range plus SP and DEL.

Bytes >= 0x80 stay allowed on purpose. They aren't delimiters in a
request line or header block, and rejecting them would break anyone
sending unencoded UTF-8 in `:path`.

### One behaviour change worth flagging

`validateRequestBlock` runs on send as well as receive, so a client
passing a URI with a raw space in it will now throw where it didn't
before. I'd argue that's the right outcome, since NIOHTTP1's validator
already rejects that URI by default and this makes the two layers agree,
but it is a behaviour change and it's the bit most likely to need
discussion. That's why I split it out of #554 instead of bundling them.

## Result

Pseudo-header values containing SP or any control character are
rejected.

## Testing

Added to `HTTP2FramePayloadToHTTP1CodecCRLFTests.swift`:

- `:path` with SP (`/a HTTP/1.1`), HTAB, VT, FF, DEL, SOH
- SP in `:authority`, `:method`, `:scheme`
- covered at the predicate, request-validation and server-codec levels

The existing positive cases in that file still pass untouched — `/`,
`/foo/bar`, `/foo?q=1&r=2`, `/foo#fragment`, `*`, `/foo%20bar`, `200` —
which is the check that this doesn't reject anything legitimate.

Built and ran on Linux, Swift 6.1 aarch64. `swift test -Xswiftc
-warnings-as-errors` is clean with no new warnings, the new tests pass,
and `swift format lint --strict Sources/ Tests/` is clean.

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
1.45.0
2026-07-22 11:34:07 +00:00
abhinav9-coder 48bfd9067d Treat CR, LF and NUL in regular header field values as malformed (#554)
## Motivation

RFC 9113 § 8.2.1 requires that a field value must not contain NUL, LF or
CR at any position, and that a message carrying one is treated as
malformed. That applies to every field value, not just pseudo-headers.

`legalHeaderField(value:)` only enforces it for pseudo-headers. The
regular-header branch checks the forbidden-name list and then returns
without looking at the value:

```swift
switch self.baseName {
case "connection", "transfer-encoding", "proxy-connection", "keep-alive", "upgrade":
    throw NIOHTTP2Errors.forbiddenHeaderField(name: String(self.baseName), value: value)
default:
    return
}
```

Nothing else on the inbound path picks it up either. HPACK values are
length-prefixed octet strings, and I couldn't find any charset
validation of values anywhere in NIOHPACK.

Where it bites is `HTTP2ToHTTP1Codec`. Serializing `name: value CRLF`
with an embedded CR or LF terminates the field early and injects header
lines into the HTTP/1.1 message downstream. Same sink as the `:path`
validation added for GHSA-4px2-pw77-vc85, just reached through a regular
field instead.

To be clear about severity: I don't think this is exploitable on a
default pipeline and I don't have a PoC. NIOHTTP1's
`NIOHTTPRequestHeadersValidator` rejects 0x00...0x1F and 0x7F on write,
and the pipeline helpers insert it by default
(`enableOutboundHeaderValidation` defaults to true). So this is
hardening.

I still think it's worth doing here. It's a MUST that NIOHTTP2 is in the
right place to enforce; `HTTPEncoder` itself doesn't validate, so a
hand-built pipeline has no check at all; and anyone reading
`HTTPRequestHead.headers` and passing values on elsewhere is inheriting
a check they'd probably assume the HTTP/2 layer had already done.

## Modifications

`isValidFieldValue(_:)` rejects 0x00, 0x0A and 0x0D, and
`legalHeaderField(value:)` now calls it for regular headers, throwing a
new `NIOHTTP2Errors.invalidHTTP2HeaderFieldValue`. The state machine
already turns a throw here into the right stream/connection error, so
nothing else needed changing.

SP, HTAB and obs-text stay legal (RFC 9110 § 5.5). It sits behind the
existing `headerBlockValidation` flag. The new error type mirrors
`ForbiddenHeaderField`'s storage pattern and is additive public API.

Two things I left out on purpose, both easy to add if you'd rather have
them:

- § 8.2.1 also forbids a value starting or ending with SP/HTAB. Not
smuggling-relevant, and rejecting it seemed likely to break peers
sending harmless padding.
- No check in the codec itself.
`HTTPRequestHead(http2HeaderBlock:isEndStream:)` validates
pseudo-headers inline via `peekPseudoHeader`, but
`appendRegularHeaders(from:)` just copies. I didn't add one there
because it's per-request and you have allocation thresholds. It does
leave the two asymmetric if `headerBlockValidation` is `.disabled`.

## Result

Regular field values containing NUL, CR or LF are treated as malformed.
Well-formed values are unaffected.

## Testing

Added to `HTTP2FramePayloadToHTTP1CodecCRLFTests.swift`, the regression
file from GHSA-4px2-pw77-vc85, which currently has no coverage for
regular field values.

- `isValidFieldValue` against CRLF, lone CR, lone LF, NUL, a full
smuggling payload, a TE desync payload
- values that must still pass: `with spaces inside`, `with\ttab`,
`text/html; charset=utf-8`, bearer tokens, non-ASCII
- request, response and trailers validation

Built and ran on Linux, Swift 6.1 aarch64. `swift test -Xswiftc
-warnings-as-errors` is clean with no new warnings, the new tests pass,
and `swift format lint --strict Sources/ Tests/` is clean.
2026-07-22 10:58:49 +01:00
AkshayandGeorge Barnett 41a8b95a98 NIOHTTP2: forbid keep-alive and upgrade connection-specific headers (#552)
RFC 9113 § 8.2.2 enumerates five connection-specific header fields that
a conformant HTTP/2 endpoint must treat as malformed: Connection,
Proxy-Connection, Keep-Alive, Transfer-Encoding, and Upgrade.
HeaderFieldName .legalHeaderField(value:) only rejected three of them,
so keep-alive and upgrade passed validation and were translated verbatim
into HTTP/1.1 messages by the H2->H1 codecs. This is a conformance gap
and a defence-in-depth issue, since downstream HTTP/1.1 parsers may act
on those fields independently.

Modifications:

- Add keep-alive and upgrade to the forbidden connection-specific header
switch in legalHeaderField(value:).
- Update the surrounding comment to cite RFC 9113 § 8.2.2 and its
explicit enumeration in place of the obsoleted RFC 7540 § 8.1.2.2
reference.
- Add request- and response-block validation tests covering all five
connection-specific fields.

Result:

All five connection-specific header fields named by RFC 9113 § 8.2.2 are
rejected during header-block validation.

Resolves #549

Co-authored-by: George Barnett <gbarnett@apple.com>
2026-07-02 10:58:11 +00:00
AkshayandGeorge Barnett 2a044b90f4 HPACKDecoder: reject more than two table size updates per header block (#551)
RFC 7541 § 4.2 specifies that an encoder emits at most two dynamic table
size updates between two header blocks (the smallest size reached, then
the final size). The decoder enforced placement - updates must precede
the first header - but put no upper bound on their count, so a block of
arbitrarily many 0x20 bytes followed by a header was accepted. This is a
conformance gap. It is not a DoS: setting an already-empty table to 0 is
O(1).

Modifications:

- Count consecutive table size updates in decodeHeaders(from:) and throw
IllegalDynamicTableSizeChange once a third is seen.
- Extend the existing § 4.2 comment to cite the at-most-two rule.
- Add tests covering the two-accepted and three-rejected cases.

Result:

Header blocks with more than two dynamic table size updates are rejected
as malformed, matching RFC 7541 § 4.2.

Co-authored-by: George Barnett <gbarnett@apple.com>
2026-07-01 11:47:56 +00:00
George Barnett 634d078571 Apply formatter (#553)
Motivation:

61d1b44 was merged in from a private security fork and didn't have the
formatter run on it.

Modifications:

- Run the formatter

Result:

Format check passes
2026-07-01 10:30:24 +00:00
Fabian Fett 61d1b44f6e Merge commit from fork 1.44.0 2026-05-20 10:08:41 +01:00
Mads Odgaard 81cc18264f Update clampedToValidWindowSize to use Int32.max (#546)
Fixes a runtime crash on 32-bit devices because of an overflow.

This occurred immediately when trying to make a HTTP2 request on our
Android 32-bit devices.
1.43.0
2026-04-14 13:30:42 +00:00
Rick Newton-RogersandGeorge Barnett 335e5b5b9d Drop Swift 6.0 (#545)
Motivation:

Swift 6.0 is no longer supported, we should bump the tools version and
remove it from our CI.

Modifications:

* Bump the Swift tools version to Swift 6.1
* Remove Swift 6.0 jobs where appropriate in main.yml, pull_request.yml

Result:

Code reflects our support window.

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
2026-04-07 12:14:31 +00:00
Rick Newton-Rogers ac262c1f36 Enable Swift 6.3 jobs in CI (#544)
Motivation:

Swift 6.3 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.3 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2026-04-01 14:03:11 +01:00
George Barnett 6d8d596f0a Allow connection and stream window target sizes to be configured separately (#543)
Motivation:

At the moment users can only set a target window size which applies to
both the connection and to streams. It should be possible to set these
separately so that one stream can't stall other streams by consuming the
whole flow control window.

Modifications:

- Add target window size to the connection config
- Plumb through the values

Result:

Users can set target flow control window sizes separately
1.42.0
2026-03-18 10:05:08 +00:00
Fabian Fett 9019b76fa8 Improve HPACKEncoding performance by ~1.5x (#542)
As it turns out our `isEqualCaseInsensitiveASCIIBytes` implementation
isn't super fast. So instead of hitting this 60 times for each header
(once for every entry in the static list), we may just want to compute
the hash of our new header candidate once and do a dict lookup.
1.41.0
2026-03-11 16:21:22 +01:00
Fabian Fett 0b600fc4ff Improve HPACKEncoding performance by ~2x (#541) 2026-03-10 17:06:04 +00:00
Fabian Fett 46ffc740ce Add HPACKEncoder Benchmark (#540)
### Motivation

swift-nio-http2 shall be fast. For fast http2 we need fast HPACK
encoding. We should measure `HPACKEncoder`s performance.

### Changes

- Add a benchmark target
- Add a `HPACKHeaderEncoding_APNS` benchmark that allows us to encode
the same fake apns header over and over.

### Result

We can measure the HPACK encoding performance.
2026-03-10 16:07:04 +00:00
Salman ChishtiandRick Newton-Rogers 04ce651639 Upgrade GitHub Actions for Node 24 compatibility (#536)
## Summary

Upgrade GitHub Actions to their latest versions to ensure compatibility
with Node 24, as Node 20 will reach end-of-life in April 2026.

## Changes

| Action | Old Version(s) | New Version | Release | Files |
|--------|---------------|-------------|---------|-------|
| `actions/checkout` |
[`v4`](https://github.com/actions/checkout/releases/tag/v4) |
[`v6`](https://github.com/actions/checkout/releases/tag/v6) |
[Release](https://github.com/actions/checkout/releases/tag/v6) |
main.yml, pull_request.yml, pull_request_label.yml |

## Context

Per [GitHub's
announcement](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/),
Node 20 is being deprecated and runners will begin using Node 24 by
default starting March 4th, 2026.

### Why this matters

- **Node 20 EOL**: April 2026
- **Node 24 default**: March 4th, 2026
- **Action**: Update to latest action versions that support Node 24

### Security Note

Actions that were previously pinned to commit SHAs remain pinned to SHAs
(updated to the latest release SHA) to maintain the security benefits of
immutable references.

### Testing

These changes only affect CI/CD workflow configurations and should not
impact application functionality. The workflows should be tested by
running them on a branch before merging.

Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
2026-03-02 13:40:45 +00:00
hamzahrmalik 0ba06c0251 Make NIOHPACK a product (#538)
## Motivation

- Users need to be able to create HPACKHeaders to pass into library such
as GRPC v1
- To create them, without relying on SPM weirdness, users should be
importing NIOHPACK
- To import NIOHPACK without relying on SPM weirdness, users should be
depending on NIOHPACK in Package.swift
- Users currently cannot depend on NIOHPACK in Package.swift, because
NIOHPACK is not a product

## Changes
Make NIOHPACK a product
2026-02-24 16:15:04 +00:00
Rick Newton-Rogers fb87ca810f switch from main to 0.0.7 for swiftlang workflows (#537)
Motivation

* `@main` references to `swiftlang/github-workflows` are deprecated.

Modifications

* Replace `@main` with `@0.0.7` in all workflow files.

Result

* Workflow files reference a pinned version of
`swiftlang/github-workflows`.
2026-02-20 13:26:37 +00:00
aryan-25 b6571f3db4 Add a server connection manager (#532)
Motivation:

`NIOHTTP2Handler` currently does not support graceful shutdown because
it does not action upon a `ChannelShouldQuiesceEvent` event. See issue
https://github.com/apple/swift-nio-http2/issues/336.

Per the
[comment](https://github.com/apple/swift-nio-http2/issues/336#issuecomment-2252862397)
on that issue,
[`gRPC-swift-nio-transport`](https://github.com/grpc/grpc-swift-nio-transport)
implements this functionality in a separate channel handler, named
[`ServerConnectionManagementHandler`](https://github.com/grpc/grpc-swift-nio-transport/blob/main/Sources/GRPCNIOTransportCore/Server/Connection/ServerConnectionManagementHandler.swift).
We should introduce this to this repo too.

Modifications:

- Added `ServerConnectionManagementHandler` from
`gRPC-swift-nio-transport` with some slight modifications such as
removing gRPC-specific functionality like policing client pings.
- Added a new `configureAsyncHTTP2Pipeline` helper, which takes a
connection manager configuration as an argument and sets the
connection manager up alongside `NIOHTTP2Handler`.

Result:

Addresses issue https://github.com/apple/swift-nio-http2/issues/336.
1.40.0
2026-02-18 08:08:55 +00:00
Fabian Fett 979f431f1f Optimize HTTP2ToHTTP1 client codec to reduce empty data frames (#535)
The codec now caches the most recent outbound frame and only writes it
on flush or when receiving `.end`. This lets us set `endStream=true` on
the final data or headers frame instead of sending a separate empty data
frame.

Changes:
- Introduced `PendingFrameWrite` to cache frame payload and promise
- Modified `processOutboundData` to return optional frames instead of
writing immediately
- Added `flush()` method to both client codecs to handle cached writes
- Promise merging ensures correct completion notification when combining
frames
1.39.1
2026-02-10 10:16:27 +00:00
aryan-25 c1bb956720 Update allocation thresholds (#534)
Motivation:

The nightly CI checks for Integration Tests started failing since run
https://github.com/apple/swift-nio-http2/actions/runs/19310336168/job/55228659542
(on 12 November 2025) due to multiple allocation benchmark tests
exceeding their allocation thresholds.

The date these failures started coincides with [release 2.89.0 of
`swift-nio`](https://github.com/apple/swift-nio/releases/tag/2.89.0). In
particular, all failing allocation benchmarks use `EmbeddedChannel`, and
`EmbeddedChannel` was changed in [a PR contained in that
release](https://github.com/apple/swift-nio/pull/3442) that introduced
some changes leading to greater allocations.

[Another change to
`EmbeddedChannel`](https://github.com/apple/swift-nio/pull/3495) in
`swift-nio`'s latest release
([2.94.0](https://github.com/apple/swift-nio/releases)) has also
increased the number of allocations in benchmarks using
`EmbeddedChannel`.

As such, we should update the allocation thresholds for affected tests
accordingly.

Modifications:

Updated the allocation threshold for all affected tests across all
versions.

Result:

Integration tests should no longer fail.
2026-02-09 12:41:37 +00:00
Fabian FettandRick Newton-Rogers c2ba4cfbb8 Drop Swift 5.10, Use Swift 6 language mode (#525)
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
1.39.0
2025-11-11 14:39:46 +00:00
Rick Newton-Rogers 7205ab8219 Add explicit read permissions to workflows (#529)
Motivation:

* More secure GitHub Actions workflows

Modifications:

Add explicit 'contents: read' permissions to workflows that did not have
explicit permissions defined. This follows GitHub Actions security best
practices by limiting the default GITHUB_TOKEN permissions.

Result:

An extra layer of security.
2025-10-30 17:29:25 +00:00
Rick Newton-Rogers b450646b59 Enable Swift 6.2 jobs in CI (#526)
Motivation:

Swift 6.2 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.2 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2025-09-22 12:42:17 +00:00
Raphael 95c084ae51 Enable release mode builds (#524)
### Motivation:

Some errors do not show up in debug builds. Enabling release mode builds
improves the CI coverage.

### Modifications:

Enable release mode builds for pull requests and scheduled builds on
main.

### Result:

Improved CI coverage.
2025-07-30 09:00:19 +01:00
George Barnett 5e9e99ec96 Add a frame delegate (#522)
Motivation:

Frames written from a child channel may not be written immediately by
the connection channel. For example, a DATA frame written on a stream
may be larger than the max frame size imposed on the connection and so
the connection channel will have to slice it into multiple frames. Or
the connection may not be writable and may delay the transmission of the
frame. This behaviour isn't currently observable but is useful to know
about.

Modifications:

- Add a frame delegate which is notified when certain frames are written
by the connection channel.

Result:

Users can observer when headers and data frames are written into the
connection channel.
1.38.0
2025-07-18 15:30:36 +01:00
Gus Cairo f0e94525a7 Add GlitchesMonitor (#518)
Add a `GlitchesMonitor` that will terminate a connection if too many glitches are triggered.
See https://github.com/HTTPWorkshop/workshop2024/blob/main/talks/1.%20Security/glitches.pdf for details.
2025-07-16 16:19:40 +01:00
Gus Cairo bf0645a009 Update allocation thresholds (#520) 2025-07-03 16:39:55 +01:00
Rick Newton-Rogers 5ca52e2f07 Add static SDK CI workflow (#500)
Add static SDK CI workflow which runs on commits to PRs, merges to main
and daily on main.
1.37.0
2025-06-26 10:16:36 +00:00
Gus Cairo 623755c0cd Enable warnings as errors (#517) 2025-05-14 14:17:48 +01:00
Rick Newton-RogersandGeorge Barnett ee831fb9e7 Drop Swift 5.9 (#515)
Motivation:

Swift 5.9 is no longer supported, we should bump the tools version and
remove it from our CI.

Modifications:

* Bump the Swift tools version to Swift 5.10
* Remove Swift 5.9 jobs where appropriate in main.yml, pull_request.yml

Result:

Code reflects our support window.

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
2025-05-07 07:59:35 +01:00
George Barnett 4281466512 Remove temporary shims (#514)
Motivation:

We added a couple of shims which were upstreamed to swift-nio and were
released in 2.82.0.

Modifications:

- Bump minimum verison of swift-nio
- Remove shims

Result:

Less code
1.36.0
2025-04-23 07:29:33 +01:00
Rick Newton-Rogers 31d5bdb86b update thresholds (#513)
update thresholds from Swift 6.0 thresholds
2025-04-14 11:59:58 +01:00
Rick Newton-Rogers 37c302e6da Enable Swift 6.1 jobs in CI (#512)
Motivation:

Swift 6.1 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.1 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2025-04-14 10:52:17 +01:00
Rick Newton-Rogers e574770917 Switch h2Spec tests to newer Swift test matrix (#511)
### Motivation:

To remove all uses of the older workflow so it can be removed to
simplify the workflows.

### Modifications:

* Switch h2Spec tests to use the newer Swift test matrix workflow,
`swift_test_matrix.yml`

### Result:

This should make no difference to the running of h2Spec tests.
2025-04-10 08:01:12 +01:00
Rick Newton-Rogers f98e90cbf6 Enable macOS CI on pull requests (#510)
Motivation:

* Improve test coverage

Modifications:

Enable macOS CI to be run on pull request commits and make the use of
the nightly runner pool for main.yml jobs explicit.

Result:

Improved test coverage.
2025-04-01 17:40:10 +01:00
George BarnettandRick Newton-Rogers 159ef997b2 Strict concurrency for tests (#507)
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
2025-03-31 13:38:26 +01:00
George Barnett 9a582726cf Strict concurrency for perf tests and the h2 server (#509) 2025-03-31 11:31:38 +01:00
George Barnett 276b9cb73d Provide a senable view over the stream multiplexer (#506)
Motivation:

The HTTP2StreamMultiplexer isn't `Sendable`, but it has public API for
creating streams which must operate from off of the `EventLoop`.

Modifications:

- Add a `SendableView` over the multiplexer which only provides the
methods for creating streams. These are safe to call from any isolation
domain.

Result:

Can create streams from off of the EL.
2025-03-27 14:10:38 +00:00
George Barnett 61f6aa4142 Add explicit Sendable annotations (#505) 2025-03-27 14:01:05 +00:00
George BarnettandRick Newton-Rogers 0c020df343 Strict concurrency for pipeline helpers (#503)
Motivation:

To increase concurrency safety the NIOHTTP2 module should compile
without warning under strict concurrency checking.

Modifications:

- Add a few temporary internal helpers
- Annotate the pipeline helpers

Result:

Fewer concurrency warnings

Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
2025-03-27 11:33:37 +00:00
Rick Newton-Rogers 9f0d47ef62 Enable macOS CI on merge to main and daily timer (#504)
Enable macOS CI on merge to main and daily timer

### Motivation:

* Improve test coverage
* Check test pass/fail status
* Monitor CI throughput

### Modifications:

Enable macOS CI to be run on all merges to main and on a daily timer.

### Result:

Improved test coverage run out-of-band at the moment so we can get a
feeling for if any changes need to be made in the repo or in the CI
pipelines to ensure timely and stable checks.
2025-03-26 17:01:11 +01:00
George Barnett a7a0a9a118 Strict concurrency for NIOHPACK (#502)
Motivation:

To increase concurrency safety the NIOPHACK module should compile
without warning under strict concurrency checking.

Modifications:

- Add explicit Sendable annotations

Result:

No concurrency warnings.
2025-03-21 17:15:54 +00:00
Rick Newton-Rogers b46cdf06d4 Update main.yml integration tests to use swift_test_matrix (#499)
Update main.yml integration tests to use `swift_test_matrix` as has been
done on the PR workflow. This brings it off the deprecated workflow and
should fix the nightly-6.1 issue
2025-03-14 14:50:09 +01:00