diff --git a/Sources/ConnectionHandlerExample/ConnectionHandlerExample.swift b/Sources/ConnectionHandlerExample/ConnectionHandlerExample.swift index ed89ad0..5243493 100644 --- a/Sources/ConnectionHandlerExample/ConnectionHandlerExample.swift +++ b/Sources/ConnectionHandlerExample/ConnectionHandlerExample.swift @@ -22,7 +22,7 @@ import NIOHTTPServer import X509 @main -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct ConnectionHandlerExample { static func main() async throws { try await serve() diff --git a/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+ConnectionSettings.swift b/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+ConnectionSettings.swift index 6f77248..58fb2e0 100644 --- a/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+ConnectionSettings.swift +++ b/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+ConnectionSettings.swift @@ -15,7 +15,7 @@ #if HTTP3 import HTTP3 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3 { /// HTTP/3 connection settings sent to the peer during connection establishment. public struct ConnectionSettings: Sendable, Hashable { @@ -53,7 +53,7 @@ extension NIOHTTPServerConfiguration.HTTP3 { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTP3.HTTP3Settings { init(_ connectionConfiguration: NIOHTTPServerConfiguration.HTTP3.ConnectionSettings) { self.init( diff --git a/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+DatagramConfiguration.swift b/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+DatagramConfiguration.swift index b6765aa..a4f8484 100644 --- a/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+DatagramConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+DatagramConfiguration.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #if HTTP3 && UnstableHTTPDatagrams -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3 { public struct DatagramConfiguration: Sendable, Hashable { /// The maximum datagram frame size in bytes. diff --git a/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+QUICConfiguration.swift b/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+QUICConfiguration.swift index ba4e904..545bb61 100644 --- a/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+QUICConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/HTTP3/HTTP3+QUICConfiguration.swift @@ -15,7 +15,7 @@ #if HTTP3 import NIOQUIC -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3 { /// QUIC transport configuration for an HTTP/3 server. public struct QUICConfiguration: Sendable, Hashable { @@ -206,7 +206,7 @@ extension NIOHTTPServerConfiguration.HTTP3 { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOQUIC.QUICConfiguration.QLogConfiguration { fileprivate init(_ configuration: NIOHTTPServerConfiguration.HTTP3.QUICConfiguration.QLogConfiguration) { self.init( @@ -217,7 +217,7 @@ extension NIOQUIC.QUICConfiguration.QLogConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOQUIC.KeyExchangeGroup { fileprivate init(_ configuration: NIOHTTPServerConfiguration.HTTP3.QUICConfiguration.KeyExchangeGroup) { switch configuration.backing { @@ -236,7 +236,7 @@ extension NIOQUIC.KeyExchangeGroup { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOQUIC.AuthenticationConfiguration { init(_ tlsCredentials: NIOHTTPServerConfiguration.TransportSecurity.TLSCredentials) throws { switch tlsCredentials.backing { @@ -261,7 +261,7 @@ extension NIOQUIC.AuthenticationConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOQUIC.QUICConfiguration { /// Creates a `NIOQUIC.QUICConfiguration` from a `NIOHTTPServerConfiguration.HTTP3.QUICConfiguration` instance. init( @@ -302,7 +302,7 @@ extension NIOQUIC.QUICConfiguration { #endif // UnstableHTTPDatagrams } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOQUIC.Authenticator { /// Creates an `Authenticator` instance from X.509 TLS credentials. /// diff --git a/Sources/NIOHTTPServer/Configuration/HTTP3/NIOHTTPServerConfiguration+HTTP3.swift b/Sources/NIOHTTPServer/Configuration/HTTP3/NIOHTTPServerConfiguration+HTTP3.swift index c26ce18..2bbe556 100644 --- a/Sources/NIOHTTPServer/Configuration/HTTP3/NIOHTTPServerConfiguration+HTTP3.swift +++ b/Sources/NIOHTTPServer/Configuration/HTTP3/NIOHTTPServerConfiguration+HTTP3.swift @@ -16,7 +16,7 @@ import NIOCore import NIOHTTP3 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration { /// Configuration for HTTP/3. public struct HTTP3: Sendable, Hashable { @@ -105,7 +105,7 @@ extension NIOHTTPServerConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTP3.HTTP3ServerConfiguration { init(_ configuration: NIOHTTPServerConfiguration.HTTP3) { self = .defaults diff --git a/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration+Validation.swift b/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration+Validation.swift index 6ae2780..a799aec 100644 --- a/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration+Validation.swift +++ b/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration+Validation.swift @@ -18,7 +18,7 @@ import NIOSSL import NIOQUIC #endif -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration { /// Validates the compatibility of the `supportedHTTPVersions` and `transportSecurity` configurations, and stores /// the TLS resources required to set up the server channels. diff --git a/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration.swift b/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration.swift index da1200b..9a3f60f 100644 --- a/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/NIOHTTPServerConfiguration.swift @@ -24,7 +24,7 @@ import NIOQUIC /// /// This structure contains all the necessary configuration options for setting up /// and running ``NIOHTTPServer``, including network binding and TLS settings. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) public struct NIOHTTPServerConfiguration: Sendable { /// Specifies where the server should bind and listen for incoming connections. /// @@ -444,7 +444,7 @@ public struct NIOHTTPServerConfiguration: Sendable { /// /// Indicates whether certificate verification succeeded or failed, and provides associated metadata when verification /// is successful. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) public enum CertificateVerificationResult: Sendable, Hashable { /// Metadata resulting from successful certificate verification. public struct VerificationMetadata: Sendable, Hashable { @@ -512,7 +512,7 @@ public struct CertificateVerificationMode: Sendable { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOSSL.CertificateVerification { /// Maps ``CertificateVerificationMode`` to the NIOSSL representation. init(_ verificationMode: CertificateVerificationMode) { @@ -525,7 +525,7 @@ extension NIOSSL.CertificateVerification { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration { /// Represents an HTTP version. public struct HTTPVersion: Sendable, Hashable { @@ -638,7 +638,7 @@ extension NIOHTTPServerConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark { init(_ backpressureStrategy: NIOHTTPServerConfiguration.BackPressureStrategy) { switch backpressureStrategy.backing { @@ -648,7 +648,7 @@ extension NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension Set where Element == NIOHTTPServerConfiguration.HTTPVersion { /// The ALPN protocol identifiers to advertise during the TLS handshake, derived from the supported HTTP versions. /// diff --git a/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP2+SwiftConfiguration.swift b/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP2+SwiftConfiguration.swift index 2d630fd..d738424 100644 --- a/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP2+SwiftConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP2+SwiftConfiguration.swift @@ -15,7 +15,7 @@ #if Configuration public import Configuration -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP2 { /// Initialize an HTTP/2 configuration from a config reader. /// diff --git a/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP3+SwiftConfiguration.swift b/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP3+SwiftConfiguration.swift index fa63b72..34f0537 100644 --- a/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP3+SwiftConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/HTTP3+SwiftConfiguration.swift @@ -15,7 +15,7 @@ #if HTTP3 && Configuration public import Configuration -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3 { /// Initialize an HTTP/3 configuration from a config reader. /// @@ -53,7 +53,7 @@ extension NIOHTTPServerConfiguration.HTTP3 { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3.QUICConfiguration { /// Initialize a QUIC transport configuration from a config reader. /// @@ -126,7 +126,7 @@ extension NIOHTTPServerConfiguration.HTTP3.QUICConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3.QUICConfiguration.QLogConfiguration { /// Initialize an optional qlog configuration from a config reader. /// @@ -166,7 +166,7 @@ private enum KeyExchangeGroupKind: String { case x25519MLKEM768 } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3.QUICConfiguration.KeyExchangeGroup { fileprivate init(_ kind: KeyExchangeGroupKind) { switch kind { @@ -182,7 +182,7 @@ extension NIOHTTPServerConfiguration.HTTP3.QUICConfiguration.KeyExchangeGroup { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3.ConnectionSettings { /// Initialize HTTP/3 connection settings from a config reader. /// @@ -212,7 +212,7 @@ extension NIOHTTPServerConfiguration.HTTP3.ConnectionSettings { } #if UnstableHTTPDatagrams -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTP3.DatagramConfiguration { /// Initialize HTTP/3 connection settings from a config reader. /// diff --git a/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/NIOHTTPServer+SwiftConfiguration.swift b/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/NIOHTTPServer+SwiftConfiguration.swift index e2c333c..83b6936 100644 --- a/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/NIOHTTPServer+SwiftConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/SwiftConfiguration/NIOHTTPServer+SwiftConfiguration.swift @@ -20,7 +20,7 @@ import NIOHTTP2 import SwiftASN1 public import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration { /// Initialize the server configuration from a config reader. /// @@ -124,7 +124,7 @@ extension NIOHTTPServerConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.BindTarget { /// Initialize a bind target configuration from a config reader. /// @@ -143,7 +143,7 @@ extension NIOHTTPServerConfiguration.BindTarget { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension Set where Element == NIOHTTPServerConfiguration.HTTPVersion { /// Initialize a supported HTTP versions configuration from a config reader. /// @@ -189,7 +189,7 @@ extension Set where Element == NIOHTTPServerConfiguration.HTTPVersion { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity { /// Initialize a transport security configuration from a config reader. /// @@ -264,7 +264,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity.TLSCredentials { /// Initialize TLS credentials (certificate chain and private key) from a config reader. /// @@ -324,7 +324,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity.TLSCredentials { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration { /// Initialize an mTLS trust configuration from a config reader. /// @@ -398,7 +398,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.BackPressureStrategy { /// Initialize the backpressure strategy configuration from a config reader. /// @@ -425,7 +425,7 @@ extension NIOHTTPServerConfiguration.BackPressureStrategy { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension Set where Element == NIOHTTPServerConfiguration.HTTPVersion { fileprivate enum HTTPVersionKind: String { case http1_1 @@ -436,7 +436,7 @@ extension Set where Element == NIOHTTPServerConfiguration.HTTPVersion { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity { fileprivate enum TransportSecurityMode: String { case plaintext @@ -453,7 +453,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration { /// The supported sources for trust roots. fileprivate enum TrustRootsSource: String { @@ -470,7 +470,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension CertificateVerificationMode { fileprivate init(_ mode: NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration.VerificationMode) { switch mode { @@ -482,7 +482,7 @@ extension CertificateVerificationMode { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.ConnectionTimeouts { /// Initialize connection timeouts configuration from a config reader. /// @@ -503,7 +503,7 @@ extension NIOHTTPServerConfiguration.ConnectionTimeouts { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.GracefulShutdownConfiguration { /// Initialize a graceful shutdown configuration from a config reader. /// diff --git a/Sources/NIOHTTPServer/Configuration/TransportSecurity+MTLSTrustConfiguration.swift b/Sources/NIOHTTPServer/Configuration/TransportSecurity+MTLSTrustConfiguration.swift index e8905aa..f9db84d 100644 --- a/Sources/NIOHTTPServer/Configuration/TransportSecurity+MTLSTrustConfiguration.swift +++ b/Sources/NIOHTTPServer/Configuration/TransportSecurity+MTLSTrustConfiguration.swift @@ -16,7 +16,7 @@ import NIOCore import NIOSSL public import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity { /// Configures how the server verifies client certificates during mTLS. public struct MTLSTrustConfiguration: Sendable { @@ -45,7 +45,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration { public struct TrustSource: Sendable { enum Backing { diff --git a/Sources/NIOHTTPServer/Configuration/TransportSecurity+NIOSSL.swift b/Sources/NIOHTTPServer/Configuration/TransportSecurity+NIOSSL.swift index 0f5f2cd..a04cae9 100644 --- a/Sources/NIOHTTPServer/Configuration/TransportSecurity+NIOSSL.swift +++ b/Sources/NIOHTTPServer/Configuration/TransportSecurity+NIOSSL.swift @@ -16,7 +16,7 @@ import NIOCertificateReloading import NIOSSL import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOSSLContext { /// Creates a `NIOSSL.NIOSSLContext` from the server's transport security configuration. static func makeServerContext( @@ -67,7 +67,7 @@ extension NIOSSLContext { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension TLSConfiguration { /// Creates a server `TLSConfiguration` from the provided X.509 credentials. fileprivate static func makeServerConfiguration( @@ -89,7 +89,7 @@ extension TLSConfiguration { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension [NIOSSLCertificateSource] { fileprivate init( _ serialized: NIOHTTPServerConfiguration.TransportSecurity.X509Credentials.SerializedCredentials @@ -110,7 +110,7 @@ extension [NIOSSLCertificateSource] { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOSSLPrivateKeySource { fileprivate init( _ serialized: NIOHTTPServerConfiguration.TransportSecurity.X509Credentials.SerializedCredentials @@ -125,7 +125,7 @@ extension NIOSSLPrivateKeySource { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOSSLTrustRoots { fileprivate init( _ serialized: NIOHTTPServerConfiguration.TransportSecurity.MTLSTrustConfiguration.SerializedTrustRoots @@ -146,7 +146,7 @@ extension NIOSSLTrustRoots { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOSSLSerializationFormats { fileprivate init(_ format: NIOHTTPServerConfiguration.TransportSecurity.Encoding) { switch format { diff --git a/Sources/NIOHTTPServer/Configuration/TransportSecurity+TLSCredentials.swift b/Sources/NIOHTTPServer/Configuration/TransportSecurity+TLSCredentials.swift index 31b3c7a..6343fa9 100644 --- a/Sources/NIOHTTPServer/Configuration/TransportSecurity+TLSCredentials.swift +++ b/Sources/NIOHTTPServer/Configuration/TransportSecurity+TLSCredentials.swift @@ -15,7 +15,7 @@ public import NIOCertificateReloading public import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity { /// Represents the credentials the server uses to prove its identity during the TLS handshake. /// diff --git a/Sources/NIOHTTPServer/Datagrams/ConnectUDPExample.swift b/Sources/NIOHTTPServer/Datagrams/ConnectUDPExample.swift index 2393349..c288df7 100644 --- a/Sources/NIOHTTPServer/Datagrams/ConnectUDPExample.swift +++ b/Sources/NIOHTTPServer/Datagrams/ConnectUDPExample.swift @@ -20,7 +20,7 @@ import NIOCore import NIOHTTPTypes import NetworkTypes -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) func connectUDPExample( request: HTTPRequest, context: NIOHTTPServer.ConnectionContext, @@ -124,7 +124,7 @@ final class RefBox { } extension RefBox: Sendable where Value: Sendable & ~Copyable {} -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) enum ConnectUDPHelper { /// Validate that `request` corresponds to a valid CONNECT-UDP request. static func isValidConnectUDPRequest(_ request: HTTPRequest, version: NIOHTTPServer.HTTPVersion) -> Bool { diff --git a/Sources/NIOHTTPServer/Datagrams/HTTP3ConnectionManager.swift b/Sources/NIOHTTPServer/Datagrams/HTTP3ConnectionManager.swift index 9479b5b..43dd784 100644 --- a/Sources/NIOHTTPServer/Datagrams/HTTP3ConnectionManager.swift +++ b/Sources/NIOHTTPServer/Datagrams/HTTP3ConnectionManager.swift @@ -19,7 +19,7 @@ import NIOHTTP3 import NIOQUICHelpers /// Routes inbound HTTP/3 datagrams to registered ``HTTP3DatagramStream`` instances. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) final class HTTP3ConnectionManager: ChannelInboundHandler { typealias InboundIn = HTTP3Datagram diff --git a/Sources/NIOHTTPServer/Datagrams/HTTP3UnreliableDatagramStream.swift b/Sources/NIOHTTPServer/Datagrams/HTTP3UnreliableDatagramStream.swift index 76ad03d..d95cdb6 100644 --- a/Sources/NIOHTTPServer/Datagrams/HTTP3UnreliableDatagramStream.swift +++ b/Sources/NIOHTTPServer/Datagrams/HTTP3UnreliableDatagramStream.swift @@ -18,7 +18,7 @@ import NIOCore import NIOHTTP3 import NIOQUICHelpers -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct HTTP3UnreliableDatagramStream: Sendable { // The QUIC stream ID. let streamID: QUICStreamID diff --git a/Sources/NIOHTTPServer/Datagrams/NIOHTTPServer+Datagrams.swift b/Sources/NIOHTTPServer/Datagrams/NIOHTTPServer+Datagrams.swift index 40ba1be..2c572b7 100644 --- a/Sources/NIOHTTPServer/Datagrams/NIOHTTPServer+Datagrams.swift +++ b/Sources/NIOHTTPServer/Datagrams/NIOHTTPServer+Datagrams.swift @@ -20,7 +20,7 @@ import NIOCore import NIOHTTPTypes import Synchronization -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// A reader for the unreliable datagram stream. public struct DatagramReader: AsyncReader, ~Copyable { diff --git a/Sources/NIOHTTPServer/HTTPKeepAliveHandler.swift b/Sources/NIOHTTPServer/HTTPKeepAliveHandler.swift index e8dc868..6714b1e 100644 --- a/Sources/NIOHTTPServer/HTTPKeepAliveHandler.swift +++ b/Sources/NIOHTTPServer/HTTPKeepAliveHandler.swift @@ -36,7 +36,7 @@ import NIOHTTPTypes /// /// Informational (1xx) responses pass through unchanged and do not affect buffering /// state. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) final class HTTPKeepAliveHandler: ChannelDuplexHandler { typealias InboundIn = HTTPRequestPart typealias InboundOut = HTTPRequestPart diff --git a/Sources/NIOHTTPServer/HTTPServerCapability+ConnectionCapabilities.swift b/Sources/NIOHTTPServer/HTTPServerCapability+ConnectionCapabilities.swift index 63b71fb..e33bdfb 100644 --- a/Sources/NIOHTTPServer/HTTPServerCapability+ConnectionCapabilities.swift +++ b/Sources/NIOHTTPServer/HTTPServerCapability+ConnectionCapabilities.swift @@ -15,7 +15,7 @@ public import HTTPAPIs public import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTPServerCapability { /// A request-context capability exposing connection-scoped peer and local addresses. /// diff --git a/Sources/NIOHTTPServer/ListenerConfiguration.swift b/Sources/NIOHTTPServer/ListenerConfiguration.swift index b9ad20c..31726b0 100644 --- a/Sources/NIOHTTPServer/ListenerConfiguration.swift +++ b/Sources/NIOHTTPServer/ListenerConfiguration.swift @@ -19,7 +19,7 @@ import NIOQUIC #endif /// The listeners to bind, derived from the server configuration. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) enum ListenerConfiguration: Sendable { struct SecureUpgrade: Sendable { let sslContext: NIOSSLContext @@ -42,7 +42,7 @@ enum ListenerConfiguration: Sendable { #endif } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration { func makeListenerConfiguration() -> ListenerConfiguration { let secureUpgrade = self.sslContext.map { diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+AbortRequest.swift b/Sources/NIOHTTPServer/NIOHTTPServer+AbortRequest.swift index d42fa08..bae2cdf 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+AbortRequest.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+AbortRequest.swift @@ -22,7 +22,7 @@ import HTTP3 import NIOQUICHelpers #endif -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Aborts the exchange carrying a request on the wire, after that request's handler threw `error`. /// diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+Connection.swift b/Sources/NIOHTTPServer/NIOHTTPServer+Connection.swift index fd8cd3a..2ea09f8 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+Connection.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+Connection.swift @@ -21,7 +21,7 @@ import NIOHTTPTypes import NIOQUIC #endif -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// An active HTTP server connection. /// diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+ConnectionContext.swift b/Sources/NIOHTTPServer/NIOHTTPServer+ConnectionContext.swift index c5ecf71..7b3dd41 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+ConnectionContext.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+ConnectionContext.swift @@ -16,7 +16,7 @@ import NIOCore import NIOSSL public import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// The application-level HTTP version negotiated for a connection. @nonexhaustive @@ -30,7 +30,7 @@ extension NIOHTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Connection-scoped state. /// diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+HTTP1_1.swift b/Sources/NIOHTTPServer/NIOHTTPServer+HTTP1_1.swift index c0401f7..192c831 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+HTTP1_1.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+HTTP1_1.swift @@ -21,7 +21,7 @@ import NIOHTTPTypesHTTP1 import NIOPosix import NIOSSL -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Serves incoming plaintext HTTP/1.1 connections. /// diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+HTTP3.swift b/Sources/NIOHTTPServer/NIOHTTPServer+HTTP3.swift index bd4aa93..f7a0e37 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+HTTP3.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+HTTP3.swift @@ -27,7 +27,7 @@ import NIOSSL import ServiceLifecycle import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// An inbound HTTP/3 request stream. struct HTTP3Stream: Sendable { @@ -545,7 +545,7 @@ extension NIOHTTPServer { } /// Identifies one of the datagram sockets bound for a bind target, and the group it belongs to. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct HTTP3ListenerSocket: Sendable { /// The index of this socket within its associated group (will be zero if there is no group). var index: Int diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+ListeningAddress.swift b/Sources/NIOHTTPServer/NIOHTTPServer+ListeningAddress.swift index 3fe7943..d4b63b4 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+ListeningAddress.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+ListeningAddress.swift @@ -35,7 +35,7 @@ enum ListeningAddressError: CustomStringConvertible, Error { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { func addressesBound(_ addresses: [NIOCore.SocketAddress?]) { switch self.listeningAddressState.withLockedValue({ $0.addressesBound(addresses) }) { @@ -63,7 +63,7 @@ extension NIOHTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { enum State { case idle(EventLoopPromise<[SocketAddress]>) @@ -131,7 +131,7 @@ extension NIOHTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer.SocketAddress { init(_ address: NIOCore.SocketAddress?) throws(ListeningAddressError) { guard let address, let port = address.port else { @@ -151,7 +151,7 @@ extension NIOHTTPServer.SocketAddress { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.BindTarget { init(_ address: NIOCore.SocketAddress?) throws(ListeningAddressError) { guard let address, let port = address.port else { diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+RequestContext.swift b/Sources/NIOHTTPServer/NIOHTTPServer+RequestContext.swift index b2db98f..7d4f145 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+RequestContext.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+RequestContext.swift @@ -16,7 +16,7 @@ public import HTTPAPIs import NIOCore public import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// The request context provided to handlers by ``NIOHTTPServer``. /// @@ -42,7 +42,7 @@ extension NIOHTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer.RequestContext: HTTPServerCapability.ConnectionInfo { /// The peer's address, when known. /// @@ -60,7 +60,7 @@ extension NIOHTTPServer.RequestContext: HTTPServerCapability.ConnectionInfo { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer.RequestContext: HTTPServerCapability.PeerCertificate { /// The peer's mTLS-validated certificate chain, when available. /// diff --git a/Sources/NIOHTTPServer/NIOHTTPServer+SecureUpgrade.swift b/Sources/NIOHTTPServer/NIOHTTPServer+SecureUpgrade.swift index 8d78bf5..95fbca7 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer+SecureUpgrade.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer+SecureUpgrade.swift @@ -27,7 +27,7 @@ import NIOSSL import NIOTLS import X509 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { struct NegotiationResult { enum NegotiatedChannel { @@ -370,7 +370,7 @@ extension NIOHTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOAsyncChannel where Inbound == HTTPRequestPart, Outbound == HTTPResponsePart { /// - Parameter clientClosed: Yields when the client stops waiting for a response, at which point `body` /// is cancelled. Paired with the continuation held by this stream's `ClientClosedMonitor`. @@ -433,7 +433,7 @@ extension NIOAsyncChannel where Inbound == HTTPRequestPart, Outbound == HTTPResp } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { func makeSSLServerHandler( _ sslContext: NIOSSLContext, diff --git a/Sources/NIOHTTPServer/NIOHTTPServer.swift b/Sources/NIOHTTPServer/NIOHTTPServer.swift index 1f43ffe..40eb530 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServer.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServer.swift @@ -68,7 +68,7 @@ import NIOQUIC /// /// A request handler reports failure by throwing, which aborts that request's exchange on the wire rather than /// propagating an error to the caller. See ``serve(handler:)`` and ``HTTPServerHTTP2StreamResetErrorConvertible``. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) public struct NIOHTTPServer: HTTPServer { let logger: Logger let configuration: NIOHTTPServerConfiguration @@ -440,7 +440,7 @@ public struct NIOHTTPServer: HTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension ChannelPipeline.SynchronousOperations { /// Adds timeout handlers (idle, read header, read body) to the channel pipeline. /// @@ -493,7 +493,7 @@ extension ChannelPipeline.SynchronousOperations { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTP2Handler.Configuration { init(httpServerHTTP2Configuration http2Config: NIOHTTPServerConfiguration.HTTP2) { let clampedTargetWindowSize = Self.clampTargetWindowSize(http2Config.targetWindowSize) @@ -564,13 +564,13 @@ extension NIOAsyncChannelInboundStream.AsyncIterator { /// ``ClientClosedMonitor`` while its pipeline is built, so this is what carries the stream out to the code /// that races against it. HTTP/3 streams carry theirs in ``NIOHTTPServer/HTTP3Stream`` instead, which /// already bundles per-stream state. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct HTTPRequestChannelAndCancellationSignal: Sendable { var channel: NIOAsyncChannel var clientClosed: AsyncStream } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension ServerBootstrap { /// Makes a `ServerBootstrap` alongside the `ServerQuiescingHelper` used to later shut that listener down gracefully. /// @@ -601,7 +601,7 @@ extension ServerBootstrap { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Awaits the next address from `iterator`. func nextBoundAddress( diff --git a/Sources/NIOHTTPServer/NIOHTTPServerClosureConnectionHandler.swift b/Sources/NIOHTTPServer/NIOHTTPServerClosureConnectionHandler.swift index a252cbb..6fa9351 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServerClosureConnectionHandler.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServerClosureConnectionHandler.swift @@ -16,7 +16,7 @@ /// /// Used internally by ``NIOHTTPServer/NIOHTTPServer/serve(connectionHandler:)-((NIOHTTPServer.Connection,NIOHTTPServer.ConnectionContext)->Void)`` /// to bridge a closure to the protocol-based connection-handler API. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct NIOHTTPServerClosureConnectionHandler: NIOHTTPServerConnectionHandler { let body: @Sendable ( diff --git a/Sources/NIOHTTPServer/NIOHTTPServerConnectionHandler.swift b/Sources/NIOHTTPServer/NIOHTTPServerConnectionHandler.swift index 2a0573a..8067945 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServerConnectionHandler.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServerConnectionHandler.swift @@ -27,7 +27,7 @@ /// ``NIOHTTPServer/serve(connectionHandler:)-((Connection,ConnectionContext)->Void)`` (the closure-based form). If only /// request-level handling is needed, prefer ``NIOHTTPServer/NIOHTTPServer/serve(handler:)``, which uses a built-in /// default connection handler (see ``NIOHTTPServer/NIOHTTPServerDefaultConnectionHandler``) -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) public protocol NIOHTTPServerConnectionHandler: Sendable { /// Handle a single connection. /// diff --git a/Sources/NIOHTTPServer/NIOHTTPServerDefaultConnectionHandler.swift b/Sources/NIOHTTPServer/NIOHTTPServerDefaultConnectionHandler.swift index c452ab6..50dadc9 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServerDefaultConnectionHandler.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServerDefaultConnectionHandler.swift @@ -20,7 +20,7 @@ public import HTTPAPIs /// This is the default connection handler used by ``NIOHTTPServer/serve(handler:)``. /// User code may also instantiate it directly when it wants to pass a request /// handler through a connection-handler API without doing per-connection work. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) public struct NIOHTTPServerDefaultConnectionHandler: NIOHTTPServerConnectionHandler where diff --git a/Sources/NIOHTTPServer/NIOHTTPServerReader.swift b/Sources/NIOHTTPServer/NIOHTTPServerReader.swift index f0be3b5..7fc73bf 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServerReader.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServerReader.swift @@ -17,7 +17,7 @@ import NIOCore import NIOHTTPTypes import Synchronization -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { public struct Reader: AsyncReader, ~Copyable { final class ReaderState: Sendable { @@ -137,7 +137,7 @@ extension NIOHTTPServer { extension NIOHTTPServer.Reader: Sendable {} #if HTTP3 && UnstableHTTPDatagrams -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer.Reader { /// Returns the unreliable datagram reader for this stream, if both the server and the client have advertised /// support for receiving datagrams. diff --git a/Sources/NIOHTTPServer/NIOHTTPServerResponseSender.swift b/Sources/NIOHTTPServer/NIOHTTPServerResponseSender.swift index 543fd11..53050e7 100644 --- a/Sources/NIOHTTPServer/NIOHTTPServerResponseSender.swift +++ b/Sources/NIOHTTPServer/NIOHTTPServerResponseSender.swift @@ -16,7 +16,7 @@ import NIOCore import NIOHTTPTypes import Synchronization -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { public struct ResponseSender: HTTPResponseSender, ~Copyable { let writer: NIOAsyncChannelOutboundWriter @@ -69,7 +69,7 @@ extension NIOHTTPServer { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer.ResponseSender { final class WriterState: Sendable { struct Wrapped: ~Copyable { @@ -163,6 +163,7 @@ extension NIOHTTPServer.ResponseSender: Sendable {} @available(*, unavailable) extension NIOHTTPServer.ResponseSender.Writer: Sendable {} +@available(anyAppleOS 27.0, *) extension ByteBuffer { /// Drains `buffer` into a newly allocated `ByteBuffer`. init & ~Copyable>( diff --git a/Sources/NIOHTTPServer/QUICDatagramSocketGroup.swift b/Sources/NIOHTTPServer/QUICDatagramSocketGroup.swift index 3f7c300..d943a9d 100644 --- a/Sources/NIOHTTPServer/QUICDatagramSocketGroup.swift +++ b/Sources/NIOHTTPServer/QUICDatagramSocketGroup.swift @@ -18,7 +18,7 @@ public import NIOCore public import NIOQUIC /// Used to bootstrap multiple datagram sockets sharing a single port for multithreaded QUIC. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) @_spi(QUICDatagramSockets) public protocol QUICDatagramSocketGroup: Sendable { /// How many sockets to bind for this bind target. @@ -47,7 +47,7 @@ public protocol QUICDatagramSocketGroup: Sendable { func makeConnectionIDGenerator(socketIndex: Int) -> any QUICConnectionID.Generator } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) @_spi(QUICDatagramSockets) extension QUICDatagramSocketGroup { /// Default implementation: returns the default, random connection ID generator. @@ -57,7 +57,7 @@ extension QUICDatagramSocketGroup { } /// Provides a socket group used to bootstrap a bind target, or `nil` to fall back to single socket behavior. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) @_spi(QUICDatagramSockets) public struct QUICDatagramSocketGroupFactory: Sendable, Hashable { /// Because this type is just a wrapper around a closure, we need something to use for `Hashable` conformance. diff --git a/Sources/NIOHTTPServer/SocketAddress.swift b/Sources/NIOHTTPServer/SocketAddress.swift index 583ef79..abcb85b 100644 --- a/Sources/NIOHTTPServer/SocketAddress.swift +++ b/Sources/NIOHTTPServer/SocketAddress.swift @@ -14,7 +14,7 @@ import NIOCore -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Represents an IPv4 address. public struct IPv4: Hashable, Sendable { @@ -113,7 +113,7 @@ extension NIOHTTPServer { } extension NIOCore.SocketAddress { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) init(bindTarget: NIOHTTPServerConfiguration.BindTarget) throws { switch bindTarget.backing { case .hostAndPort(let host, let port): diff --git a/Sources/RequestHandlerExample/RequestHandlerExample.swift b/Sources/RequestHandlerExample/RequestHandlerExample.swift index 3a62c35..9b2fba9 100644 --- a/Sources/RequestHandlerExample/RequestHandlerExample.swift +++ b/Sources/RequestHandlerExample/RequestHandlerExample.swift @@ -22,7 +22,7 @@ import NIOHTTPServer import X509 @main -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct RequestHandlerExample { static func main() async throws { try await serve() diff --git a/Sources/StreamResetExample/StreamResetExample.swift b/Sources/StreamResetExample/StreamResetExample.swift index 5fca65f..6d4b3af 100644 --- a/Sources/StreamResetExample/StreamResetExample.swift +++ b/Sources/StreamResetExample/StreamResetExample.swift @@ -54,7 +54,7 @@ extension TunnelFailure: HTTPServerHTTP3StreamResetErrorConvertible { struct UnexpectedFailure: Error {} @main -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct StreamResetExample { static func main() async throws { try await serve() @@ -95,7 +95,7 @@ struct StreamResetExample { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity.TLSCredentials { /// A throwaway self-signed certificate, so the example needs no files on disk. fileprivate static func selfSigned() throws -> Self { diff --git a/Tests/NIOHTTPServerTests/ClientClosedTests.swift b/Tests/NIOHTTPServerTests/ClientClosedTests.swift index fcf857c..4156ea3 100644 --- a/Tests/NIOHTTPServerTests/ClientClosedTests.swift +++ b/Tests/NIOHTTPServerTests/ClientClosedTests.swift @@ -38,7 +38,7 @@ struct ClientClosedTests { /// never will. static let detectionWindow = TimeAmount.seconds(2) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Client disconnect cancels a busy handler", arguments: NIOHTTPServer.HTTPVersion.allCases @@ -131,7 +131,7 @@ struct ClientClosedTests { /// HTTP/2: a client cancelling a single stream must cancel that request's handler, while leaving /// the connection and any other requests on it alive. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/2 stream reset by the client cancels that request's handler") func http2StreamResetCancelsBusyHandler() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -173,7 +173,7 @@ struct ClientClosedTests { } #if HTTP3 - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/3 STOP_SENDING alone does not cancel the handler") func http3StopSendingAloneDoesNotCancel() async throws { let sawCancellation = try await Self.runHTTP3Handler(clientSends: [.stopSending], completeRequest: false) @@ -185,7 +185,7 @@ struct ClientClosedTests { /// `STOP_SENDING` *after* the request end does cancel: with the client's FIN already received, the /// exchange is finished in both directions, so the QUIC layer closes the stream. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/3 STOP_SENDING after the request end cancels the handler") func http3StopSendingAfterRequestEndCancels() async throws { let sawCancellation = try await Self.runHTTP3Handler(clientSends: [.stopSending], completeRequest: true) @@ -198,7 +198,7 @@ struct ClientClosedTests { ) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/3 RESET_STREAM alone does not cancel the handler") func http3ResetStreamAloneDoesNotCancel() async throws { let sawCancellation = try await Self.runHTTP3Handler(clientSends: [.resetStream], completeRequest: false) @@ -208,7 +208,7 @@ struct ClientClosedTests { ) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/3 RESET_STREAM followed by STOP_SENDING cancels the handler") func http3BothFramesCancel() async throws { let sawCancellation = try await Self.runHTTP3Handler( @@ -243,7 +243,7 @@ struct ClientClosedTests { /// - Parameter completeRequest: whether the client finishes its request body. This matters: once the /// request is fully received QUIC may ignore a `RESET_STREAM` (RFC 9000 ยง 3.2), so leaving it /// incomplete is the only way the server can observe that frame. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) private static func runHTTP3Handler( clientSends frames: [H3CancelFrame], completeRequest: Bool @@ -327,7 +327,7 @@ struct ClientClosedTests { /// Cancellation is not scoped to the client going away: a close the *server* decided on cancels the /// handler too. For example, a timeout closing the connection has already concluded that nobody is getting a /// response. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("A timeout closing the connection cancels the handler") func serverInitiatedCloseCancelsBusyHandler() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( diff --git a/Tests/NIOHTTPServerTests/ConnectionBackpressureConfigurationTests.swift b/Tests/NIOHTTPServerTests/ConnectionBackpressureConfigurationTests.swift index 3904424..70935d0 100644 --- a/Tests/NIOHTTPServerTests/ConnectionBackpressureConfigurationTests.swift +++ b/Tests/NIOHTTPServerTests/ConnectionBackpressureConfigurationTests.swift @@ -18,7 +18,7 @@ import Testing @Suite("Connection Backpressure Configuration") struct ConnectionBackpressureConfigurationTests { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("maxConnections nil is the default") func maxConnectionsNilIsDefault() throws { let config = try NIOHTTPServerConfiguration( @@ -29,7 +29,7 @@ struct ConnectionBackpressureConfigurationTests { #expect(config.maxConnections == nil) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("ConnectionTimeouts defaults has expected values") func connectionTimeoutsDefaults() { let timeouts = NIOHTTPServerConfiguration.ConnectionTimeouts.defaults @@ -38,7 +38,7 @@ struct ConnectionBackpressureConfigurationTests { #expect(timeouts.readBody == .seconds(60)) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Valid maxConnections is accepted") func validMaxConnectionsAccepted() throws { var config = try NIOHTTPServerConfiguration( @@ -50,7 +50,7 @@ struct ConnectionBackpressureConfigurationTests { #expect(config.maxConnections == 100) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Custom ConnectionTimeouts are preserved") func customConnectionTimeouts() throws { var config = try NIOHTTPServerConfiguration( @@ -70,7 +70,7 @@ import Configuration @Suite("Connection Backpressure SwiftConfiguration") struct ConnectionBackpressureSwiftConfigurationTests { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("SwiftConfiguration parses maxConnections") func parsesMaxConnections() throws { let provider = InMemoryProvider(values: [ @@ -86,7 +86,7 @@ struct ConnectionBackpressureSwiftConfigurationTests { #expect(serverConfig.maxConnections == 500) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("SwiftConfiguration parses connectionTimeouts") func parsesConnectionTimeouts() throws { let provider = InMemoryProvider(values: [ @@ -106,7 +106,7 @@ struct ConnectionBackpressureSwiftConfigurationTests { #expect(serverConfig.connectionTimeouts.readBody == .seconds(45)) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("SwiftConfiguration uses defaults for absent fields") func usesDefaultsForAbsentFields() throws { let provider = InMemoryProvider(values: [ diff --git a/Tests/NIOHTTPServerTests/ConnectionBackpressureEndToEndTests.swift b/Tests/NIOHTTPServerTests/ConnectionBackpressureEndToEndTests.swift index 41d85d4..f83a833 100644 --- a/Tests/NIOHTTPServerTests/ConnectionBackpressureEndToEndTests.swift +++ b/Tests/NIOHTTPServerTests/ConnectionBackpressureEndToEndTests.swift @@ -26,7 +26,7 @@ struct ConnectionBackpressureEndToEndTests { let serverLogger = Logger(label: "ConnectionBackpressureE2ETests.server") let clientLogger = Logger(label: "ConnectionBackpressureE2ETests.client") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Requests succeed under connection limit", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] @@ -80,7 +80,7 @@ struct ConnectionBackpressureEndToEndTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "More connections than maxConnections all eventually complete", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] @@ -135,7 +135,7 @@ struct ConnectionBackpressureEndToEndTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "No connection limit by default", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] diff --git a/Tests/NIOHTTPServerTests/ConnectionLifecycleTests.swift b/Tests/NIOHTTPServerTests/ConnectionLifecycleTests.swift index ae17cd7..a671754 100644 --- a/Tests/NIOHTTPServerTests/ConnectionLifecycleTests.swift +++ b/Tests/NIOHTTPServerTests/ConnectionLifecycleTests.swift @@ -24,7 +24,7 @@ import Testing /// State observed by the connection handlers used in this test suite. The state lives /// in a class so it survives `consuming` calls to `handleConnection` and can be /// inspected from the test body. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) final class ConnectionLifecycleTestState: Sendable { let connectionInvocations = NIOLockedValueBox(0) let requestInvocations = NIOLockedValueBox(0) @@ -35,7 +35,7 @@ final class ConnectionLifecycleTestState: Sendable { /// A connection handler that counts invocations and runs a single request handler /// for every request on the connection. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct CountingConnectionHandler: NIOHTTPServerConnectionHandler where Handler.RequestContext == NIOHTTPServer.RequestContext, @@ -66,7 +66,7 @@ where } /// A request handler that increments two counters before delegating to the wrapped handler. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct ConnectionScopedRequestHandler: HTTPServerRequestHandler where Wrapped.RequestContext == NIOHTTPServer.RequestContext, @@ -107,7 +107,7 @@ struct ConnectionLifecycleTests { /// drains the request body, which is required for the per-channel loop /// to recover the iterator and keep the HTTP/1.1 connection alive across /// requests. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) static func echoHandler() -> HTTPServerClosureRequestHandler< NIOHTTPServer.RequestContext, NIOHTTPServer.Reader, @@ -120,7 +120,7 @@ struct ConnectionLifecycleTests { /// Connecting twice results in two `handleConnection` invocations, each with non-nil `remoteAddress` and /// `localAddress`. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Per-connection invocation count", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] @@ -161,7 +161,7 @@ struct ConnectionLifecycleTests { /// HTTP/1.1 keep-alive: two requests on the same connection result in a single `handleConnection` invocation that /// runs the request handler twice. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "HTTP/1.1 keep-alive: single connection-handler invocation, multiple requests", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -203,7 +203,7 @@ struct ConnectionLifecycleTests { /// HTTP/2: three concurrent streams on one connection result in one `handleConnection` call and three /// request-handler calls. A user counter held by the connection handler observes three after `handleRequests` /// returns. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/2: single connection-handler invocation, concurrent streams") func testHTTP2SingleInvocationConcurrentStreams() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -276,7 +276,7 @@ struct ConnectionLifecycleTests { /// A throwing connection handler is logged at debug level by the server but /// doesn't bring it down: a subsequent connection on the same server is /// served normally. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Throwing connection handler doesn't bring down the server", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] @@ -332,7 +332,7 @@ struct ConnectionLifecycleTests { /// A connection handler that returns without calling `handleRequests` effectively drops the connection: the channel /// closes immediately and the client sees EOF without any response. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Connection handler returning without handleRequests drops the connection", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] @@ -373,7 +373,7 @@ struct ConnectionLifecycleTests { } /// `ConnectionContext.httpVersion` reflects the protocol negotiated for the connection. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("ConnectionContext.httpVersion is correct", arguments: NIOHTTPServer.HTTPVersion.allCases) func testHTTPVersion(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -409,7 +409,7 @@ struct ConnectionLifecycleTests { /// Multiple HTTP/1.1 keep-alive connections in parallel each receive their own `handleConnection` invocation and /// connection-scoped state isn't shared between them. Each connection's per-request counter only reflects its own /// requests. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "State isolation across keep-alive HTTP/1.1 connections", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -462,7 +462,7 @@ struct ConnectionLifecycleTests { /// Smoke test for the closure-overload of /// ``NIOHTTPServer/Connection/handleRequests(handler:)-((@Sendable)``: a single request is served end-to-end /// without constructing an explicit ``HTTPServerClosureRequestHandler``. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("connection.handleRequests closure overload", .timeLimit(.minutes(1))) func testHandleRequestsClosureOverload() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -495,7 +495,7 @@ struct ConnectionLifecycleTests { /// Connection handler that throws on the first invocation and runs normally thereafter, so the test can verify a thrown /// error doesn't bring down the server. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct ThrowingFirstConnectionHandler: NIOHTTPServerConnectionHandler { let connectionInvocations: NIOLockedValueBox @@ -518,7 +518,7 @@ struct ThrowingFirstConnectionHandler: NIOHTTPServerConnectionHandler { /// Connection handler that records the invocation count and returns without /// calling `handleRequests`, dropping the connection. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct NoOpConnectionHandler: NIOHTTPServerConnectionHandler { let connectionInvocations: NIOLockedValueBox @@ -534,7 +534,7 @@ struct NoOpConnectionHandler: NIOHTTPServerConnectionHandler { /// Connection handler that records the negotiated HTTP version on its first /// invocation and forwards every request to a wrapped handler. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct HTTPVersionRecordingConnectionHandler: NIOHTTPServerConnectionHandler where @@ -558,7 +558,7 @@ where /// Connection handler that counts requests on its own connection and appends /// the final count to a shared array when the connection ends. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct PerConnectionCounterHandler: NIOHTTPServerConnectionHandler where Wrapped.RequestContext == NIOHTTPServer.RequestContext, @@ -586,7 +586,7 @@ where /// Connection handler that uses the closure-overload of /// ``NIOHTTPServer/Connection/handleRequests(handler:)-((@Sendable)``. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct ClosureRequestHandlerConnectionHandler: NIOHTTPServerConnectionHandler { func handleConnection( connection: consuming sending NIOHTTPServer.Connection, diff --git a/Tests/NIOHTTPServerTests/HTTP3ConfigurationTests.swift b/Tests/NIOHTTPServerTests/HTTP3ConfigurationTests.swift index 65a3a28..cd87aa4 100644 --- a/Tests/NIOHTTPServerTests/HTTP3ConfigurationTests.swift +++ b/Tests/NIOHTTPServerTests/HTTP3ConfigurationTests.swift @@ -21,7 +21,7 @@ import Testing @Suite struct HTTP3ConfigurationTests { @Test("HTTP/3 default configuration uses the defaults of the sub-components") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func http3DefaultConfiguration() { let config = NIOHTTPServerConfiguration.HTTP3.defaults #expect(config.quicConfiguration == .defaults) @@ -29,7 +29,7 @@ struct HTTP3ConfigurationTests { } @Test("HTTP/3 configuration with custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func http3ConfigurationCustomValues() { var connectionSettings = NIOHTTPServerConfiguration.HTTP3.ConnectionSettings.defaults connectionSettings.qpackMaximumTableCapacity = 4096 @@ -57,7 +57,7 @@ struct HTTP3ConfigurationTests { @Suite struct AuthenticationConfigurationTests { @Test("In-memory TLS credentials are rejected") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func inMemoryCredentialsRejected() throws { let chain = try TestCA.makeSelfSignedChain() #expect(throws: NIOHTTPServerConfigurationError.onlyPEMFileX509CredentialsCurrentlySupportedOverHTTP3) { @@ -68,7 +68,7 @@ struct HTTP3ConfigurationTests { } @Test("PEM-file TLS credentials are accepted") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func pemFileCredentialsAccepted() { #expect(throws: Never.self) { _ = try NIOQUIC.AuthenticationConfiguration( diff --git a/Tests/NIOHTTPServerTests/HTTP3DatagramTests.swift b/Tests/NIOHTTPServerTests/HTTP3DatagramTests.swift index a7ac895..209c905 100644 --- a/Tests/NIOHTTPServerTests/HTTP3DatagramTests.swift +++ b/Tests/NIOHTTPServerTests/HTTP3DatagramTests.swift @@ -31,7 +31,7 @@ struct HTTP3DatagramTests { static let clientLogger = Logger(label: "HTTP3DatagramTests.client") @Test("Datagrams are routed to the request stream they belong to") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func datagramsAreRoutedByStreamID() async throws { let channel = EmbeddedChannel() let datagramsNegotiatedPromise = channel.eventLoop.makePromise(of: Void.self) @@ -62,7 +62,7 @@ struct HTTP3DatagramTests { } @Test("Datagrams delivered after deregistering are dropped") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func datagramsAfterDeregisteringAreDropped() async throws { let channel = EmbeddedChannel() let datagramsNegotiatedPromise = channel.eventLoop.makePromise(of: Void.self) @@ -86,7 +86,7 @@ struct HTTP3DatagramTests { } @Test("Closing the connection ends every registered datagram stream") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func closingTheConnectionEndsEveryDatagramStream() async throws { let channel = EmbeddedChannel() let datagramsNegotiatedPromise = channel.eventLoop.makePromise(of: Void.self) @@ -114,7 +114,7 @@ struct HTTP3DatagramTests { } @Test("The oldest datagram is dropped once the buffer is full") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func oldestDatagramIsDroppedOnceTheBufferIsFull() async throws { let channel = EmbeddedChannel() let stream = HTTP3UnreliableDatagramStream(streamID: 0, connectionChannel: channel, maxBufferedDatagrams: 2) @@ -130,7 +130,7 @@ struct HTTP3DatagramTests { } @Test("Each write is sent as one datagram containing the stream's ID") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func eachWriteIsSentAsOneDatagram() async throws { let channel = EmbeddedChannel() @@ -169,7 +169,7 @@ struct HTTP3DatagramTests { } @Test("Finishing flushes any remaining bytes as a final datagram") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func finishingWritesRemainingBytes() async throws { let channel = EmbeddedChannel() let writer = NIOHTTPServer.DatagramWriter( @@ -185,7 +185,7 @@ struct HTTP3DatagramTests { } @Test("Finishing with an empty buffer writes no datagram") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func finishingWithAnEmptyBufferWritesNoDatagram() async throws { let channel = EmbeddedChannel() let writer = NIOHTTPServer.DatagramWriter( @@ -199,7 +199,7 @@ struct HTTP3DatagramTests { } @Test("Reading and writing datagrams are independent of each other") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func readingAndWritingAreIndependent() async throws { let channel = EmbeddedChannel() let stream = HTTP3UnreliableDatagramStream(streamID: 4, connectionChannel: channel, maxBufferedDatagrams: 16) @@ -218,7 +218,7 @@ struct HTTP3DatagramTests { } @Test("Read and write datagrams") - @available(anyAppleOS 26.2, *) + @available(anyAppleOS 27.0, *) func readAndWriteDatagrams() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: .http3, @@ -281,7 +281,7 @@ struct HTTP3DatagramTests { } @Test("Writing a datagram larger than the max_datagram_frame_size fails") - @available(anyAppleOS 26.2, *) + @available(anyAppleOS 27.0, *) func writingDatagramLargerThanMaxFrameSizeFails() async throws { let clientMaxDatagramFrameSize = 150 @@ -363,7 +363,7 @@ struct HTTP3DatagramTests { } @Test("Datagram reader and writer not vended when client does not support datagrams") - @available(anyAppleOS 26.2, *) + @available(anyAppleOS 27.0, *) func datagramReaderAndWriterNotVendedWhenNotSupportedByClient() async throws { var (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: .http3, diff --git a/Tests/NIOHTTPServerTests/HTTPKeepAliveHandlerTests.swift b/Tests/NIOHTTPServerTests/HTTPKeepAliveHandlerTests.swift index f5c40e0..686f27a 100644 --- a/Tests/NIOHTTPServerTests/HTTPKeepAliveHandlerTests.swift +++ b/Tests/NIOHTTPServerTests/HTTPKeepAliveHandlerTests.swift @@ -31,7 +31,7 @@ struct HTTPKeepAliveHandlerTests { /// Verifies the happy case: when a client pipelines multiple HTTP/1.1 requests /// on a single connection, all responses are returned in order and the connection /// stays alive (no `Connection: close`). - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Pipelined requests on a single connection all succeed", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -94,7 +94,7 @@ struct HTTPKeepAliveHandlerTests { /// Verifies that when the handler writes a short response (head + end, no body) /// before the request `.end` has arrived, the response head includes a /// `Connection: close` header and the server closes the connection. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Server sends head+end (no body) before request .end โ€” Connection: close in header", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -165,7 +165,7 @@ struct HTTPKeepAliveHandlerTests { /// the request `.end` has arrived; the client must receive that informational /// response immediately (without waiting for request `.end`), and the connection /// must remain alive after the final response. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Informational (1xx) responses pass through without buffering or closing", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -272,7 +272,7 @@ struct HTTPKeepAliveHandlerTests { /// everything until request `.end` arrives. Because the head is flushed before /// request `.end` arrives, the response carries `Connection: close` and the /// server closes the connection after writing response `.end`. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Bidirectional streaming works โ€” head is flushed (with Connection: close) when a body part is written", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -351,7 +351,7 @@ struct HTTPKeepAliveHandlerTests { /// server reads the body chunk, the read cycle ends with the head still /// buffered and request `.end` still missing โ€” the keep-alive handler must add /// `Connection: close`. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Read cycle ends without request .end while head is buffered โ€” Connection: close added", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -446,7 +446,7 @@ struct HTTPKeepAliveHandlerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test func channelClosesOnConnectionError() async throws { let channel = EmbeddedChannel() try await channel.connect(to: try .init(ipAddress: "127.0.0.1", port: 0)).get() diff --git a/Tests/NIOHTTPServerTests/HTTPServerTests.swift b/Tests/NIOHTTPServerTests/HTTPServerTests.swift index 688d585..15b1142 100644 --- a/Tests/NIOHTTPServerTests/HTTPServerTests.swift +++ b/Tests/NIOHTTPServerTests/HTTPServerTests.swift @@ -20,7 +20,7 @@ import Testing @Suite struct HTTPServerTests { @Test - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testConsumingServe() async throws { let server = NIOHTTPServer( configuration: try .init( diff --git a/Tests/NIOHTTPServerTests/ListenerConfigurationTests.swift b/Tests/NIOHTTPServerTests/ListenerConfigurationTests.swift index d560145..551934a 100644 --- a/Tests/NIOHTTPServerTests/ListenerConfigurationTests.swift +++ b/Tests/NIOHTTPServerTests/ListenerConfigurationTests.swift @@ -18,7 +18,7 @@ import Testing @Suite struct ListenerConfigurationTests { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("transport: plaintext, versions: {HTTP/1.1} -> plaintext") func plaintextHTTP1_1() throws { let configuration = try NIOHTTPServerConfiguration( @@ -35,7 +35,7 @@ struct ListenerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "transport: TLS, versions: {HTTP/1.1 and/or HTTP/2} -> secure upgrade", arguments: [ @@ -66,7 +66,7 @@ struct ListenerConfigurationTests { } #if HTTP3 - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("transport: TLS, versions: {HTTP/3} -> HTTP/3") func http3Only() throws { let chain = try TestCA.makeSelfSignedChain() @@ -88,7 +88,7 @@ struct ListenerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "transport: TLS, versions: {HTTP/1.1 and/or HTTP/2} + {HTTP/3} -> HTTP/3 and secure upgrade", arguments: [ diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServer+ServiceLifecycleTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServer+ServiceLifecycleTests.swift index b97c220..c56227a 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServer+ServiceLifecycleTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServer+ServiceLifecycleTests.swift @@ -43,7 +43,7 @@ struct NIOHTTPServiceLifecycleTests { "Active connection completes when graceful shutdown triggered", arguments: [NIOHTTPServer.HTTPVersion.http1_1, .http2] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func activeConnectionCanCompleteWhenGracefullyShutdown(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: httpVersion, @@ -126,7 +126,7 @@ struct NIOHTTPServiceLifecycleTests { "Server closes active connection upon forceful shutdown", arguments: [NIOHTTPServer.HTTPVersion.http1_1, .http2] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testServerClosesActiveConnectionOnForcefulShutdown(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: httpVersion, @@ -200,7 +200,7 @@ struct NIOHTTPServiceLifecycleTests { "Active connection forcefully shutdown when server task cancelled", arguments: [NIOHTTPServer.HTTPVersion.http1_1, .http2] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func activeConnectionForcefullyShutdownWhenServerTaskCancelled(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -280,7 +280,7 @@ struct NIOHTTPServiceLifecycleTests { } @Test("Active HTTP/2 connection is forcefully shut down upon graceful shutdown timeout") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testActiveHTTP2ConnectionIsShutDownAfterGraceTimeout() async throws { let (leafPath, caPath, keyPath) = try TestCA.makeSelfSignedChain().writeToDisk() @@ -368,7 +368,7 @@ struct NIOHTTPServiceLifecycleTests { (.http2, .http2), ] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func activeConnectionsAcrossDifferentListenersCanCompleteWhenGracefullyShutdown( firstClientHTTPVersion: NIOHTTPServer.HTTPVersion, secondClientHTTPVersion: NIOHTTPServer.HTTPVersion diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerConfigurationTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerConfigurationTests.swift index 71484bf..8303113 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerConfigurationTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerConfigurationTests.swift @@ -24,7 +24,7 @@ import X509 struct NIOHTTPServerConfigurationTests { @Suite struct BindTarget { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Empty bindTargets throws error") func emptyBindTargetsThrows() throws { #expect(throws: NIOHTTPServerConfigurationError.noBindTargetsSpecified) { @@ -39,7 +39,7 @@ struct NIOHTTPServerConfigurationTests { @Suite struct SupportedHTTPVersions { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Empty supportedHTTPVersions throws error") func emptySupportedHTTPVersionsThrows() { #expect(throws: NIOHTTPServerConfigurationError.noSupportedHTTPVersionsSpecified) { @@ -51,7 +51,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("transport: plaintext, versions: {HTTP/1.1} -> valid") func plaintextTransportAndHTTP1_1IsValid() { #expect(throws: Never.self) { @@ -64,7 +64,7 @@ struct NIOHTTPServerConfigurationTests { } #if HTTP3 - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "transport: plaintext, versions: HTTP/2 and/or HTTP/3 -> invalid", arguments: [ @@ -91,7 +91,7 @@ struct NIOHTTPServerConfigurationTests { @Suite struct TransportSecurity { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "All X.509 credential sources produce a valid configuration", arguments: TestX509CredentialSource.allCases @@ -109,7 +109,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("All mTLS trust root sources produce a valid configuration", arguments: MTLSTrustSource.allCases) func mTLSTrustRootSourceProducesValidConfiguration(source: MTLSTrustSource) throws { let chain = try TestCA.makeSelfSignedChain() @@ -127,7 +127,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "A non-existent X.509 certificate file path is rejected", arguments: [ @@ -150,7 +150,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Malformed X.509 credential bytes are rejected", arguments: [ @@ -174,7 +174,7 @@ struct NIOHTTPServerConfigurationTests { } #if HTTP3 - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("PEM-file X.509 credentials over HTTP/3 produces a valid configuration") func pemFileX509ProducesValidHTTP3Configuration() throws { let chain = try TestCA.makeSelfSignedChain() @@ -191,7 +191,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Non-PEM-file X.509 credentials are rejected over HTTP/3", arguments: [TestX509CredentialSource.inMemory, .reloading, .pemBytes, .derFile, .derBytes] @@ -209,7 +209,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("DER-file RPK credentials produces a valid TLS configuration") func derFileRPKProducesValidConfiguration() throws { let chain = try TestCA.makeSelfSignedChain() @@ -223,7 +223,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Raw public key credentials are rejected over HTTP/1.1 and HTTP/2") func rawPublicKeyRejectedOverHTTP1AndHTTP2() throws { #expect( @@ -239,7 +239,7 @@ struct NIOHTTPServerConfigurationTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("mTLS is rejected over HTTP/3") func mTLSRejectedOverHTTP3() throws { let chain = try TestCA.makeSelfSignedChain() @@ -260,7 +260,7 @@ struct NIOHTTPServerConfigurationTests { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) enum TestX509CredentialSource: Sendable, CaseIterable { case inMemory case reloading @@ -314,7 +314,7 @@ enum TestX509CredentialSource: Sendable, CaseIterable { } #if HTTP3 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.TransportSecurity.RawPublicKeyCredentials { /// Builds ``RawPublicKeyCredentials`` from `chain`. static func makeTestCredentials( @@ -335,7 +335,7 @@ extension NIOHTTPServerConfiguration.TransportSecurity.RawPublicKeyCredentials { } #endif // HTTP3 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) enum MTLSTrustSource: Sendable, CaseIterable { case systemDefaults case inMemory diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerEndToEndTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerEndToEndTests.swift index 42953a9..8d3a6d3 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerEndToEndTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerEndToEndTests.swift @@ -21,7 +21,7 @@ import Testing @Suite struct NIOHTTPServerEndToEndTests { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/1.1 request and response") func testHTTP1_1() async throws { try await TestingChannelHTTP1Server.serve( @@ -48,7 +48,7 @@ struct NIOHTTPServerEndToEndTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("HTTP/2 negotiation") func testHTTP2Negotiation() async throws { let serverChain = try TestCA.makeSelfSignedChain() diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerReaderTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerReaderTests.swift index 5d1f038..e7711dc 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerReaderTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerReaderTests.swift @@ -29,7 +29,7 @@ import NIOHTTP3 @Suite struct NIOHTTPServerReaderTests { @Test("Head request not allowed") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testWriteHeadRequestPartFatalError() async throws { // The request body reader should fatal error if it receives a head part await #expect(processExitsWith: .failure) { @@ -48,7 +48,7 @@ struct NIOHTTPServerReaderTests { } @Test("Stream cannot be finished before writing request end part") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testNotWritingRequestEndPartFatalError() async throws { await #expect(processExitsWith: .failure) { let (stream, source) = NIOAsyncChannelInboundStream.makeTestingStream() @@ -75,7 +75,7 @@ struct NIOHTTPServerReaderTests { HTTPFields([.init(name: .cookie, value: "first_cookie"), .init(name: .cookie, value: "second_cookie")]), ] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testRequestWithConcludingElement(body: ByteBuffer, trailers: HTTPFields) async throws { let (stream, source) = NIOAsyncChannelInboundStream.makeTestingStream() @@ -108,7 +108,7 @@ struct NIOHTTPServerReaderTests { HTTPFields([.init(name: .cookie, value: "first_cookie"), .init(name: .cookie, value: "second_cookie")]), ] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testStreamedRequestBody(bodyChunks: [ByteBuffer], trailers: HTTPFields) async throws { let (stream, source) = NIOAsyncChannelInboundStream.makeTestingStream() @@ -144,7 +144,7 @@ struct NIOHTTPServerReaderTests { } @Test("Throw while reading request") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testThrowingWhileReadingRequest() async throws { let (stream, source) = NIOAsyncChannelInboundStream.makeTestingStream() @@ -171,7 +171,7 @@ struct NIOHTTPServerReaderTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("More bytes available than consumption limit") func testCollectMoreBytesThanAvailable() async throws { let (stream, source) = NIOAsyncChannelInboundStream.makeTestingStream() @@ -212,7 +212,7 @@ struct NIOHTTPServerReaderTests { #if HTTP3 && UnstableHTTPDatagrams @Test("takeDatagramReader vends no datagram reader when not available") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func takeDatagramReaderVendsNilWhenNotAvailable() async throws { let (stream, source) = NIOAsyncChannelInboundStream.makeTestingStream() source.yield(.body(ByteBuffer(bytes: [1, 2, 3]))) @@ -237,7 +237,7 @@ struct NIOHTTPServerReaderTests { } @Test("takeDatagramReader vends a request body and datagram reader") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func takeDatagramReaderVendsRequestAndDatagramReader() async throws { let (reliableStream, reliableSource) = NIOAsyncChannelInboundStream.makeTestingStream() reliableSource.yield(.body(ByteBuffer(bytes: [1, 2, 3]))) @@ -294,7 +294,7 @@ struct NIOHTTPServerReaderTests { } @Test("Inbound datagrams are buffered up to a limit", arguments: [10, 20, 100]) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func datagramsAreBufferedUpToLimit(maxBufferedDatagrams: Int) async throws { let (reliableStream, _) = NIOAsyncChannelInboundStream.makeTestingStream() diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerResponseSenderTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerResponseSenderTests.swift index e7403ed..2e38121 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerResponseSenderTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerResponseSenderTests.swift @@ -22,7 +22,7 @@ import Testing @Suite struct NIOHTTPServerResponseSenderTests { @Test("Informational header without informational status code") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testInformationalResponseStatusCodePrecondition() async throws { // Sending an informational header with a non-1xx status code shouldn't be allowed try await #require(processExitsWith: .failure) { @@ -34,7 +34,7 @@ struct NIOHTTPServerResponseSenderTests { } @Test("Multiple informational responses before final response") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testSendMultipleInformationalResponses() async throws { let (outboundWriter, sink) = NIOAsyncChannelOutboundWriter.makeTestingWriter() var sender = NIOHTTPServer.ResponseSender(writer: outboundWriter, writerState: .init()) diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerStreamResetTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerStreamResetTests.swift index 1b535e8..cd90004 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerStreamResetTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerStreamResetTests.swift @@ -52,7 +52,7 @@ struct NIOHTTPServerStreamResetTests { // MARK: - HTTP/1.1 @Test("Aborting while the response head is still buffered flushes it with Connection: close and no response end") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP1AbortWhileResponseHeadIsBuffered() throws { let channel = EmbeddedChannel() try channel.connect(to: try .init(ipAddress: "127.0.0.1", port: 0)).wait() @@ -96,7 +96,7 @@ struct NIOHTTPServerStreamResetTests { } @Test("Aborting after the response head reached the wire sends no second head and no response end") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP1AbortWhileStreaming() throws { let channel = EmbeddedChannel() try channel.connect(to: try .init(ipAddress: "127.0.0.1", port: 0)).wait() @@ -137,7 +137,7 @@ struct NIOHTTPServerStreamResetTests { "HTTP/1.1: throwing before the response head sends 500 with Connection: close", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP1ThrowingBeforeResponseHeadSendsInternalServerError( http1Variant: NIOHTTPServer.HTTPVersion ) async throws { @@ -174,7 +174,7 @@ struct NIOHTTPServerStreamResetTests { // MARK: - HTTP/2 @Test("HTTP/2: throwing a conforming error resets the stream with that error's code") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP2ThrowingConformingErrorResetsStream() async throws { try await self.assertHTTP2Reset( throwing: StreamResetTestError.connectFailed, @@ -183,7 +183,7 @@ struct NIOHTTPServerStreamResetTests { } @Test("HTTP/2: throwing a non-conforming error resets the stream with INTERNAL_ERROR") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP2ThrowingNonConformingErrorResetsStreamWithInternalError() async throws { try await self.assertHTTP2Reset( throwing: TestError.intentional, @@ -192,7 +192,7 @@ struct NIOHTTPServerStreamResetTests { } /// Runs a handler that throws `error` over HTTP/2 and asserts the client observes `RST_STREAM(expectedCode)`. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) private func assertHTTP2Reset( throwing error: any Error, expectedCode: NIOHTTP2.HTTP2ErrorCode, @@ -239,7 +239,7 @@ struct NIOHTTPServerStreamResetTests { } @Test("HTTP/2: throwing after the response head still resets the stream") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP2ThrowingAfterResponseHeadResetsStream() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: .http2, @@ -296,7 +296,7 @@ struct NIOHTTPServerStreamResetTests { // MARK: - HTTP/3 @Test("Aborting an HTTP/3 stream emits RESET_STREAM and STOP_SENDING carrying the resolved codes") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP3AbortEmitsResetStreamAndStopSending() throws { let channel = EmbeddedChannel() try channel.connect(to: try .init(ipAddress: "127.0.0.1", port: 0)).wait() @@ -323,7 +323,7 @@ struct NIOHTTPServerStreamResetTests { } @Test("Aborting an HTTP/3 stream with an error describing no codes uses H3_INTERNAL_ERROR") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP3AbortWithNonConformingErrorUsesInternalError() throws { let channel = EmbeddedChannel() try channel.connect(to: try .init(ipAddress: "127.0.0.1", port: 0)).wait() @@ -344,7 +344,7 @@ struct NIOHTTPServerStreamResetTests { } @Test("HTTP/3: throwing from the handler resets the stream, failing the client's read") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP3ThrowingResetsStream() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: .http3, @@ -372,7 +372,7 @@ struct NIOHTTPServerStreamResetTests { #expect(httpError.h3ErrorCode == .connectError) } @Test("HTTP/3: throwing after the response head still resets the stream") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testHTTP3ThrowingAfterResponseHeadResetsStream() async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( for: .http3, @@ -409,7 +409,7 @@ struct NIOHTTPServerStreamResetTests { "Throwing after the response is concluded still delivers the full response", arguments: NIOHTTPServer.HTTPVersion.allCases ) - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testThrowingAfterConcludedResponseDeliversFullResponse( httpVersion: NIOHTTPServer.HTTPVersion ) async throws { diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerSwiftConfigurationTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerSwiftConfigurationTests.swift index fd070cc..5b7948a 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerSwiftConfigurationTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerSwiftConfigurationTests.swift @@ -28,7 +28,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("BindTarget") struct BindTargetTests { @Test("Valid host and port") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testValidConfig() throws { let provider = InMemoryProvider(values: ["host": "localhost", "port": 8080]) @@ -45,7 +45,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Init fails with missing host") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testMissingHost() throws { let provider = InMemoryProvider(values: ["port": 8080]) let config = ConfigReader(provider: provider) @@ -59,7 +59,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Init fails with missing port") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testMissingPort() throws { let provider = InMemoryProvider(values: ["host": "localhost"]) let config = ConfigReader(provider: provider) @@ -76,7 +76,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("Multiple bind targets via bindTargets") struct MultipleBindTargetsTests { @Test("Parallel hosts and ports produce multiple bind targets") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testMultipleBindTargets() throws { let provider = InMemoryProvider( values: [ @@ -107,7 +107,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Singular bindTarget still works") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testSingularBindTargetStillWorks() throws { let provider = InMemoryProvider( values: [ @@ -131,7 +131,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Providing both singular and plural throws an error") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testBothSingularAndPluralThrows() throws { let provider = InMemoryProvider( values: [ @@ -151,7 +151,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Mismatched hosts and ports lengths throws an error") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testMismatchedHostsAndPortsLengthsThrows() throws { let provider = InMemoryProvider( values: [ @@ -169,7 +169,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Empty bindTargets arrays throws an error") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testEmptyBindTargetsArraysThrows() throws { let provider = InMemoryProvider( values: [ @@ -190,7 +190,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("BackPressureStrategy") struct BackPressureStrategyTests { @Test("Default values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testDefaultValues() throws { // Don't provide anything. All values have defaults. let provider = InMemoryProvider(values: [:]) @@ -207,7 +207,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testCustomValues() throws { let provider = InMemoryProvider(values: ["lowWatermark": 5, "highWatermark": 20]) let config = ConfigReader(provider: provider) @@ -223,7 +223,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Partial custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testPartialCustomValues() throws { let provider = InMemoryProvider(values: ["lowWatermark": 3]) let config = ConfigReader(provider: provider) @@ -242,7 +242,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("SupportedHTTPVersions") struct SupportedHTTPVersionsTests { @Test("Empty supported version set is invalid") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testEmptySupportedHTTPVersionSetFails() async { await #expect(processExitsWith: .failure) { let provider = InMemoryProvider(values: [ @@ -256,7 +256,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Unrecognized versions are ignored") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testUnrecognizedHTTPVersionIgnored() throws { let provider = InMemoryProvider(values: [ "versions": .init(.stringArray(["unrecognized_version"]), isSecret: false) @@ -273,7 +273,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Default HTTP/2 configuration used when not specified") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testDefaultHTTP2ConfigurationUsed() throws { let provider = InMemoryProvider(values: [ "versions": .init(.stringArray(["http1_1", "http2"]), isSecret: false) @@ -288,7 +288,7 @@ struct NIOHTTPServerSwiftConfigurationTests { #if HTTP3 @Test("Default HTTP/3 configuration used when not specified") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func defaultHTTP3ConfigurationUsed() throws { let versions = ConfigValue(.stringArray(["http1_1", "http3"]), isSecret: false) let snapshot = ConfigReader(provider: InMemoryProvider(values: ["versions": versions])).snapshot() @@ -303,7 +303,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("HTTP2") struct HTTP2Tests { @Test("Default values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testDefaultValues() throws { let provider = InMemoryProvider(values: [:]) let config = ConfigReader(provider: provider) @@ -317,7 +317,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testCustomValues() throws { let provider = InMemoryProvider(values: [ "maxFrameSize": 1, @@ -335,7 +335,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Partial custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testPartialCustomValues() throws { let provider = InMemoryProvider(values: ["maxFrameSize": 5]) let config = ConfigReader(provider: provider) @@ -353,7 +353,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("HTTP3") struct HTTP3Tests { @Test("Default values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func defaultValues() throws { let snapshot = ConfigReader(provider: InMemoryProvider(values: [:])).snapshot() @@ -363,7 +363,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func customValues() throws { let provider = InMemoryProvider(values: [ "preferHuffmanEncoding": false, @@ -425,7 +425,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("ConnectionSettings") struct ConnectionSettingsTests { @Test("Default values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func defaultValues() { let snapshot = ConfigReader(provider: InMemoryProvider(values: [:])).snapshot() @@ -438,7 +438,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func customValues() { let snapshot = ConfigReader( provider: InMemoryProvider(values: [ @@ -456,7 +456,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Negative values resolve to valid values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func negativeClampsResolveToValidValues() { let snapshot = ConfigReader( provider: InMemoryProvider(values: [ @@ -478,7 +478,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("DatagramConfiguration") struct DatagramConfigurationTests { @Test("Default values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func defaultValues() throws { let snapshot = ConfigReader(provider: InMemoryProvider(values: [:])).snapshot() @@ -488,7 +488,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Custom values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func customValues() throws { let snapshot = ConfigReader( provider: InMemoryProvider(values: [ @@ -506,7 +506,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Datagrams configuration `nil` when `datagramsEnabled` set to false") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func configNilWhenDatagramsEnabledSetToFalse() throws { let snapshot = ConfigReader( provider: InMemoryProvider(values: [ @@ -518,7 +518,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Maximum frame size must not be set to 0 when datagrams enabled") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func frameSizeMustNotBeZeroWhenDatagramsEnabled() async throws { await #expect(processExitsWith: .failure) { // Setting `maxDatagramFrameSize` to 0 means that the QUIC layer will not advertise support for @@ -540,7 +540,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("QUICConfiguration") struct QUICConfigurationTests { @Test("Default values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func defaultValues() throws { let snapshot = ConfigReader(provider: InMemoryProvider(values: [:])).snapshot() @@ -550,7 +550,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Durations are extracted as seconds") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func durationsExtractedAsSeconds() throws { let snapshot = ConfigReader( provider: InMemoryProvider(values: ["maxIdleTimeout": 45, "keepAliveInterval": 5]) @@ -563,7 +563,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Invalid key exchange group throws") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func invalidKeyExchangeGroup() throws { let snapshot = ConfigReader(provider: InMemoryProvider(values: ["keyExchangeGroup": ""])) .snapshot() @@ -582,7 +582,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("QLogConfiguration") struct QLogConfigurationTests { @Test("No qlog configuration specified") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func valuesNotSpecified() throws { let snapshot = ConfigReader(provider: InMemoryProvider(values: [:])).snapshot() @@ -592,7 +592,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Fully specified qlog configuration") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func allValuesSpecified() throws { let snapshot = ConfigReader( provider: InMemoryProvider(values: [ @@ -610,7 +610,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Partial qlog configuration is invalid") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func partialConfigurationInvalid() throws { let snapshot = ConfigReader(provider: InMemoryProvider(values: ["qlog.path": "/var/log/qlog"])) .snapshot() @@ -624,7 +624,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("End-to-end HTTP/3 configuration over TLS") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testEndToEnd() throws { let (leafPath, _, keyPath) = try TestCA.makeSelfSignedChain().writeToDisk() let provider = InMemoryProvider(values: [ @@ -656,7 +656,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("TransportSecurity") struct TransportSecurityTests { @Test("Invalid security mode") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testInvalidSecurityMode() throws { let provider = InMemoryProvider(values: ["mode": ""]) let config = ConfigReader(provider: provider) @@ -670,7 +670,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Custom verification callback without mTLS being enabled") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testCannotInitializeWithCustomCallbackWhenMTLSNotEnabled() throws { let provider = InMemoryProvider(values: ["mode": "tls", "credentialSource": "inline"]) let config = ConfigReader(provider: provider) @@ -695,7 +695,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite struct TLS { @Test("Valid config using inline credentials") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testValidConfigUsingInlineCredentials() throws { let chain = try TestCA.makeSelfSignedChain() let certsPEM = try chain.chainPEMString @@ -731,7 +731,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Valid file-based credentials with reloading") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testValidFileConfigWithReloading() async throws { let provider = InMemoryProvider( values: [ @@ -761,7 +761,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Valid file-based credentials without reloading") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testValidFileConfigWithoutReloading() throws { let provider = InMemoryProvider( values: [ @@ -791,7 +791,7 @@ struct NIOHTTPServerSwiftConfigurationTests { #if HTTP3 @Test("Raw public key credentials") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testRawPublicKeyCredentials() throws { let provider = InMemoryProvider( values: [ @@ -826,7 +826,7 @@ struct NIOHTTPServerSwiftConfigurationTests { #endif // HTTP3 @Test("Init fails with missing certificate") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testMissingCertificate() throws { let chain = try TestCA.makeSelfSignedChain() let keyPEM = try chain.privateKey.serializeAsPEM().pemString @@ -849,7 +849,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Init fails with missing private key") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testMissingPrivateKey() throws { let chain = try TestCA.makeSelfSignedChain() let certsPEM = try chain.chainPEMString @@ -875,7 +875,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite struct MTLS { @Test("Custom verification callback") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testValidConfigWithCustomVerificationCallback() throws { let serverChain = try TestCA.makeSelfSignedChain() @@ -929,7 +929,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Optional verification mode") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testOptionalVerification() throws { let serverChain = try TestCA.makeSelfSignedChain() let certsPEM = try serverChain.chainPEMString @@ -975,7 +975,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Invalid verification mode") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testInvalidVerificationMode() throws { let serverChain = try TestCA.makeSelfSignedChain() @@ -1006,7 +1006,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Default trust roots") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testDefaultTrustRoots() throws { let serverChain = try TestCA.makeSelfSignedChain() @@ -1052,7 +1052,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Trust roots from PEM file path") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testTrustRootsFromPEMFilePath() throws { let serverChain = try TestCA.makeSelfSignedChain() @@ -1095,7 +1095,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite struct ReloadingMTLS { @Test("Valid config with file credentials and reloading") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testValidConfig() async throws { let chain = try TestCA.makeSelfSignedChain() let trustRootPEM = try chain.ca.serializeAsPEM().pemString @@ -1142,7 +1142,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("GracefulShutdownConfiguration") struct GracefulShutdownConfigurationTests { - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Default value") func defaultValue() { let provider = InMemoryProvider(values: [:]) let config = ConfigReader(provider: provider) @@ -1154,7 +1154,7 @@ struct NIOHTTPServerSwiftConfigurationTests { #expect(gracefulShutdown.maximumGracefulShutdownDuration == nil) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Custom value") func customValue() { let provider = InMemoryProvider(values: ["maximumDuration": 42]) let config = ConfigReader(provider: provider) @@ -1169,7 +1169,7 @@ struct NIOHTTPServerSwiftConfigurationTests { @Suite("End-to-End") struct EndToEndConfigurationTests { @Test("Configure all possible values") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func fullConfiguration() throws { let chain = try TestCA.makeSelfSignedChain() let certsPEM = try chain.chainPEMString @@ -1238,7 +1238,7 @@ struct NIOHTTPServerSwiftConfigurationTests { } @Test("Only HTTP/1.1 supported over plaintext") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func onlyHTTP1_1SupportedOverPlaintext() async { await #expect(processExitsWith: .failure) { let provider = InMemoryProvider( diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerTests.swift index 0499cc5..2828159 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerTests.swift @@ -40,7 +40,7 @@ struct NIOHTTPServerTests { let clientLogger = Logger(label: "NIOHTTPServerTests.client") let serverLogger = Logger(label: "NIOHTTPServerTests.server") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Obtain the listening address correctly") func testListeningAddress() async throws { let server = NIOHTTPServer( @@ -68,7 +68,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Request-response", arguments: NIOHTTPServer.HTTPVersion.allCases) func testRequestResponse(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -118,7 +118,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "mTLS request-response with custom verification callback returning peer certificates", arguments: [NIOHTTPServer.HTTPVersion.http1_1, .http2] @@ -181,7 +181,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Multiple informational response headers", arguments: NIOHTTPServer.HTTPVersion.allCases) func testMultipleInformationalResponseHeaders(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -223,7 +223,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Client closes stream without sending end part", arguments: [NIOHTTPServer.HTTPVersion.http1_1, .http2] @@ -273,7 +273,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Bi-directional streaming", arguments: [NIOHTTPServer.HTTPVersion.http1_1, .http2]) func testBidirectionalStreaming(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -332,7 +332,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Multiple serial HTTP/1.1 requests on the same connection", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1] @@ -379,7 +379,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Multiple concurrent connections", arguments: NIOHTTPServer.HTTPVersion.allCases) func testMultipleConcurrentConnections(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -442,7 +442,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) #if HTTP3 @Test("Multiple concurrent streams over single connection", arguments: [NIOHTTPServer.HTTPVersion.http2, .http3]) #else @@ -504,7 +504,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Server can still process other connections despite one failing", arguments: [NIOHTTPServer.HTTPVersion.plaintextHTTP1_1, .http1_1, .http2] @@ -569,7 +569,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Bind to multiple addresses") func testMultipleBindAddresses() async throws { let server = NIOHTTPServer( @@ -594,7 +594,7 @@ struct NIOHTTPServerTests { ) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Serve requests on multiple addresses independently", arguments: NIOHTTPServer.HTTPVersion.allCases) func testServeOnMultipleAddresses(httpVersion: NIOHTTPServer.HTTPVersion) async throws { let (server, clientConfiguration) = try TestHelpers.makeServerAndClientConfiguration( @@ -642,7 +642,7 @@ struct NIOHTTPServerTests { /// all bound addresses become unavailable simultaneously and ``listeningAddresses`` throws /// ``ListeningAddressError/serverClosed``. No subset of addresses continues serving after the server /// has stopped. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "All addresses stop together and listeningAddresses throws after server stops", arguments: NIOHTTPServer.HTTPVersion.allCases @@ -694,7 +694,7 @@ struct NIOHTTPServerTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Empty bind targets throws error") func testEmptyBindTargetsThrows() throws { #expect(throws: NIOHTTPServerConfigurationError.noBindTargetsSpecified) { @@ -719,7 +719,7 @@ struct NIOHTTPServerTests { /// to for the verification. The port is below the typical ephemeral range used by `port: 0` /// allocations on Linux (32768+) and macOS (49152+), so other tests using `port: 0` cannot /// accidentally be assigned this port by the OS. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Previously bound channels are closed when a later bind fails") func testPreviouslyBoundChannelsAreClosedOnPartialBindFailure() async throws { let firstPort = 30_210 diff --git a/Tests/NIOHTTPServerTests/NIOHTTPServerWriterTests.swift b/Tests/NIOHTTPServerTests/NIOHTTPServerWriterTests.swift index 374ca4b..00e4c5b 100644 --- a/Tests/NIOHTTPServerTests/NIOHTTPServerWriterTests.swift +++ b/Tests/NIOHTTPServerTests/NIOHTTPServerWriterTests.swift @@ -33,7 +33,7 @@ struct NIOHTTPServerWriterTests { let trailerSampleTwo: HTTPFields = [.serverTiming: "test", .cookie: "cookie"] @Test("Write single body element") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testSingleWriteAndConclude() async throws { let (writer, sink) = NIOAsyncChannelOutboundWriter.makeTestingWriter() let responseWriter = NIOHTTPServer.ResponseSender.Writer(writer: writer, writerState: .init()) @@ -52,7 +52,7 @@ struct NIOHTTPServerWriterTests { } @Test("Write multiple body elements") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testProduceMultipleElementsAndSingleTrailer() async throws { let (writer, sink) = NIOAsyncChannelOutboundWriter.makeTestingWriter() var responseWriter = NIOHTTPServer.ResponseSender.Writer(writer: writer, writerState: .init()) @@ -75,7 +75,7 @@ struct NIOHTTPServerWriterTests { } @Test("No body, just trailers") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func testNoBodyJustTrailers() async throws { let (writer, sink) = NIOAsyncChannelOutboundWriter.makeTestingWriter() let responseWriter = NIOHTTPServer.ResponseSender.Writer(writer: writer, writerState: .init()) @@ -89,7 +89,7 @@ struct NIOHTTPServerWriterTests { #if HTTP3 && UnstableHTTPDatagrams @Test("takeDatagramWriter vends no datagram writer when not available") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func takeDatagramWriterVendsNilWhenNotAvailable() async throws { let (outboundWriter, sink) = NIOAsyncChannelOutboundWriter.makeTestingWriter() let sender = NIOHTTPServer.ResponseSender( @@ -120,7 +120,7 @@ struct NIOHTTPServerWriterTests { } @Test("takeDatagramWriter vends a response body and datagram writer") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) func takeDatagramWriterVendsResponseAndDatagramWriter() async throws { let (outboundWriter, sink) = NIOAsyncChannelOutboundWriter.makeTestingWriter() let connectionChannel = EmbeddedChannel() diff --git a/Tests/NIOHTTPServerTests/QUICDatagramSocketGroupTests.swift b/Tests/NIOHTTPServerTests/QUICDatagramSocketGroupTests.swift index 819d4e0..816b9f6 100644 --- a/Tests/NIOHTTPServerTests/QUICDatagramSocketGroupTests.swift +++ b/Tests/NIOHTTPServerTests/QUICDatagramSocketGroupTests.swift @@ -37,7 +37,7 @@ extension Trait where Self == ConditionTrait { struct QUICDatagramSocketGroupTests { let serverLogger = Logger(label: "QUICDatagramSocketGroupTests.server") - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "Every socket in the group is bound once, with indices from zero, each on its own event loop", .requiresSeveralEventLoops @@ -61,7 +61,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Multiple HTTP/3 sockets per bind target report one address each", .requiresSeveralEventLoops) func testMultipleHTTP3SocketsPerBindTargetReportOneAddressEach() async throws { let factory = QUICDatagramSocketGroupFactory { _, _ in RecordingSocketGroup(socketCount: 2) } @@ -75,7 +75,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("A group of one socket is still told it bound and still vends its generator") func testGroupOfOneSocketIsToldItBoundAndVendsItsGenerator() async throws { let socketGroup = RecordingSocketGroup(socketCount: 1) @@ -95,7 +95,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Each bind target gets its own socket group", .requiresSeveralEventLoops) func testEachBindTargetGetsItsOwnSocketGroup() async throws { let socketGroups = Mutex<[RecordingSocketGroup]>([]) @@ -114,7 +114,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("A group need implement only the bound-socket hook", .requiresSeveralEventLoops) func testGroupNeedImplementOnlyTheBoundSocketHook() async throws { let factory = QUICDatagramSocketGroupFactory { _, _ in MinimalSocketGroup() } @@ -124,7 +124,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("Bind targets without a socket group spread across event loops", .requiresSeveralEventLoops) func testBindTargetsWithoutASocketGroupSpreadAcrossEventLoops() throws { let (configuration, _) = try TestHelpers.makeTLSServerConfiguration( @@ -143,7 +143,7 @@ struct QUICDatagramSocketGroupTests { #expect(first.eventLoops[0] !== second.eventLoops[0]) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("A socket count outside the available event loops fails server bootstrap") func testSocketCountOutsideAvailableEventLoopsFailsServerStart() throws { let (configuration, _) = try TestHelpers.makeTLSServerConfiguration( @@ -166,7 +166,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("A factory that declines binds a single socket") func testDecliningFactoryBindsASingleSocket() async throws { let availableEventLoops = Mutex(0) @@ -182,7 +182,7 @@ struct QUICDatagramSocketGroupTests { #expect(availableEventLoops.withLock { $0 } == NIOSingletons.groupLoopCountSuggestion) } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test("A factory that throws fails server bootstrap") func testThrowingFactoryFailsServerStart() async throws { let factory = QUICDatagramSocketGroupFactory { _, _ in throw SocketGroupTestError() } @@ -192,7 +192,7 @@ struct QUICDatagramSocketGroupTests { } } - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) @Test( "A socket group that throws in bind callback fails server bootstrap", .requiresSeveralEventLoops, @@ -210,7 +210,7 @@ struct QUICDatagramSocketGroupTests { /// Serves HTTP/3 on `bindTargetCount` ephemeral ports with `socketGroupFactory`, runs `body` with the /// listening addresses, then cancels the server. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) private func withHTTP3Server( bindTargetCount: Int = 1, socketGroupFactory: QUICDatagramSocketGroupFactory, @@ -236,7 +236,7 @@ struct QUICDatagramSocketGroupTests { struct SocketGroupTestError: Error {} /// A group implementing only the protocol's requirements, using the default implementations of other methods. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) final class MinimalSocketGroup: QUICDatagramSocketGroup { let socketCount = 2 @@ -244,7 +244,7 @@ final class MinimalSocketGroup: QUICDatagramSocketGroup { } /// A socket group that records what the server asked it to do. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) final class RecordingSocketGroup: QUICDatagramSocketGroup { let socketCount: Int diff --git a/Tests/NIOHTTPServerTests/Utilities/Certificates.swift b/Tests/NIOHTTPServerTests/Utilities/Certificates.swift index 7146e57..c0cc2d3 100644 --- a/Tests/NIOHTTPServerTests/Utilities/Certificates.swift +++ b/Tests/NIOHTTPServerTests/Utilities/Certificates.swift @@ -19,7 +19,7 @@ import X509 @testable import NIOHTTPServer -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct ChainPrivateKeyPair { let leaf: Certificate let ca: Certificate @@ -60,7 +60,7 @@ struct ChainPrivateKeyPair { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct TestCA { static func makeSelfSignedChain(leafExtensions: Certificate.Extensions = .init()) throws -> ChainPrivateKeyPair { let caKey = P384.Signing.PrivateKey() diff --git a/Tests/NIOHTTPServerTests/Utilities/HTTPVersion.swift b/Tests/NIOHTTPServerTests/Utilities/HTTPVersion.swift index 116f709..f786c8e 100644 --- a/Tests/NIOHTTPServerTests/Utilities/HTTPVersion.swift +++ b/Tests/NIOHTTPServerTests/Utilities/HTTPVersion.swift @@ -14,7 +14,7 @@ import NIOHTTPServer -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer.HTTPVersion { /// The ALPN protocol identifier. /// @@ -38,7 +38,7 @@ extension NIOHTTPServer.HTTPVersion { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServerConfiguration.HTTPVersion { init(_ version: NIOHTTPServer.HTTPVersion) { switch version { diff --git a/Tests/NIOHTTPServerTests/Utilities/Helpers.swift b/Tests/NIOHTTPServerTests/Utilities/Helpers.swift index ff113b3..3a91472 100644 --- a/Tests/NIOHTTPServerTests/Utilities/Helpers.swift +++ b/Tests/NIOHTTPServerTests/Utilities/Helpers.swift @@ -106,7 +106,7 @@ extension TLSConfiguration { } /// Like ``makeTestClientConfiguration``, but with mTLS. - @available(anyAppleOS 26.0, *) + @available(anyAppleOS 27.0, *) static func makeTestClientMTLSConfiguration( testTrustRoots: NIOSSLTrustRoots, clientChain: ChainPrivateKeyPair, @@ -124,7 +124,7 @@ extension TLSConfiguration { } #if HTTP3 -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension QUICConfiguration { /// Creates a client QUIC configuration. /// @@ -144,7 +144,7 @@ extension QUICConfiguration { } #endif -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct TestHelpers { /// Starts `server` with `serverHandler`, waits for it to begin listening, runs `body` with the first /// listening address, then cancels the server task. @@ -410,7 +410,7 @@ struct TestHelpers { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension TestHelpers { static func makeTLSServerConfiguration( supportedHTTPVersions: Set = [.http1_1, .http2], @@ -540,7 +540,7 @@ extension TestHelpers { #endif // HTTP3 && UnstableHTTPDatagrams } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTPFields { /// Returns the body encoding header fields required for the given HTTP version. static func makeBodyEncodingHeaders(for httpVersion: NIOHTTPServer.HTTPVersion) -> HTTPFields { @@ -559,7 +559,7 @@ extension HTTPFields { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension String { static func makeScheme(for httpVersion: NIOHTTPServer.HTTPVersion) -> String { switch httpVersion { @@ -577,7 +577,7 @@ extension String { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTPRequest { /// Creates an ``HTTPRequest`` with the appropriate headers for the given `httpVersion`. static func makeRequest( @@ -596,7 +596,7 @@ extension HTTPRequest { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTPResponse { /// Creates an ``HTTPResponse`` with the given status and the appropriate headers for the given `httpVersion`. static func makeResponse( @@ -610,7 +610,7 @@ extension HTTPResponse { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTPRequestPart { static func testHead( method: HTTPRequest.Method, diff --git a/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP1.swift b/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP1.swift index 756242e..14ea590 100644 --- a/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP1.swift +++ b/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP1.swift @@ -19,7 +19,7 @@ import NIOHTTPTypes import NIOHTTPTypesHTTP1 import NIOPosix -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension Channel { /// Adds HTTP/1.1 client handlers to the pipeline. func configureTestHTTP1ClientPipeline( @@ -48,7 +48,7 @@ extension Channel { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension ClientBootstrap { /// Connects to the provided `serverAddress` over plaintext HTTP/1.1 and returns a ``TestClientConnection`` /// wrapping the established connection. Use ``TestClientConnection/makeRequestChannel()`` to obtain a diff --git a/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP3.swift b/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP3.swift index f0748cc..38fbbcb 100644 --- a/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP3.swift +++ b/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+HTTP3.swift @@ -24,7 +24,7 @@ import NIOHTTPTypesHTTP1 import NIOPosix import NIOQUIC -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct TestHTTP3SingleConnectionCreator: HTTP3ConnectionCreator { let quicHandler: QUICHandler let connectionInitializer: @Sendable (any Channel, NIOQUIC.QUICStreamCreator) -> EventLoopFuture @@ -62,7 +62,7 @@ struct TestHTTP3SingleConnectionCreator: HTTP3ConnectionCreator { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension Channel { func makeConnectionCreator( logger: Logger, @@ -112,7 +112,7 @@ extension Channel { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension DatagramBootstrap { /// Sets up a test HTTP/3 client and returns the QUIC connection channel and the connection multiplexer. func setupTestHTTP3Client( @@ -144,7 +144,7 @@ extension DatagramBootstrap { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension HTTP3ClientConnection { /// Opens a single request stream on this connection wrapped in a `NIOAsyncChannel`. The stream is closed by the /// caller using `executeThenClose`. diff --git a/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+SecureUpgrade.swift b/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+SecureUpgrade.swift index 8c30e1b..6b188c6 100644 --- a/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+SecureUpgrade.swift +++ b/Tests/NIOHTTPServerTests/Utilities/NIOClient/NIOClient+SecureUpgrade.swift @@ -20,7 +20,7 @@ import NIOSSL @testable import NIOHTTPServer -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) /// Provides a HTTP client with ALPN negotiation. extension Channel { /// Adds a ``NIOSSLClientHandler`` configured with the provided `TLSConfiguration` to the pipeline. @@ -52,7 +52,7 @@ extension Channel { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension ClientBootstrap { /// Connects the client to the specified address using the provided TLS configuration. func connectToTestSecureUpgradeHTTPServer( diff --git a/Tests/NIOHTTPServerTests/Utilities/TestClientConnection.swift b/Tests/NIOHTTPServerTests/Utilities/TestClientConnection.swift index 2b916e2..11433b5 100644 --- a/Tests/NIOHTTPServerTests/Utilities/TestClientConnection.swift +++ b/Tests/NIOHTTPServerTests/Utilities/TestClientConnection.swift @@ -33,7 +33,7 @@ import NIOQUICHelpers /// A testing utility that wraps an established HTTP/1.1, HTTP/2, or HTTP/3 client connection and provides an opaque /// interface for creating request streams. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct TestClientConnection { enum ConnectionProtocol { case http1(connectionChannel: NIOAsyncChannel) @@ -156,7 +156,7 @@ struct TestClientConnection { #endif } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension TestClientConnection { init( alpnNegotiationResult: NIONegotiatedHTTPVersion< @@ -180,7 +180,7 @@ extension TestClientConnection { } } -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension TestClientConnection { /// The information needed to establish a test client connection to a ``NIOHTTPServer``. struct Configuration { diff --git a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+HTTP1.swift b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+HTTP1.swift index b87e15c..8253e44 100644 --- a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+HTTP1.swift +++ b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+HTTP1.swift @@ -18,7 +18,7 @@ import NIOHTTPTypes @testable import NIOHTTPServer -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Starts serving plaintext HTTP/1.1 using the provided testing channel instead of using `ServerBootstrap` as /// `NIOHTTPServer` normally does. diff --git a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+SecureUpgrade.swift b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+SecureUpgrade.swift index e339b82..39df128 100644 --- a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+SecureUpgrade.swift +++ b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/NIOHTTPServer+SecureUpgrade.swift @@ -18,7 +18,7 @@ import NIOHTTPTypes @testable import NIOHTTPServer -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) extension NIOHTTPServer { /// Starts serving with the Secure Upgrade transport using the provided testing channel instead of using /// `ServerBootstrap` as `NIOHTTPServer` normally does. diff --git a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+HTTP1.swift b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+HTTP1.swift index ab0caf3..3b30092 100644 --- a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+HTTP1.swift +++ b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+HTTP1.swift @@ -31,7 +31,7 @@ import NIOHTTPTypes /// This provider vends a HTTP client channel (also backed by a `NIOAsyncTestingChannel`) that can be used to send /// requests and observe responses in terms of HTTP types (`HTTPRequestPart` and `HTTPResponsePart`) to the server /// connection channel. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct TestingChannelHTTP1Server { let server: NIOHTTPServer let serverTestChannel: NIOAsyncTestingChannel diff --git a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+SecureUpgrade.swift b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+SecureUpgrade.swift index 28c0a3a..35dfeb0 100644 --- a/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+SecureUpgrade.swift +++ b/Tests/NIOHTTPServerTests/Utilities/TestingChannelClientServer/TestingChannelServer+SecureUpgrade.swift @@ -23,7 +23,7 @@ import X509 @testable import NIOHTTPServer /// Like ``TestingChannelHTTP1Server``, but for Secure Upgrade. -@available(anyAppleOS 26.0, *) +@available(anyAppleOS 27.0, *) struct TestingChannelSecureUpgradeServer { let server: NIOHTTPServer let serverTestChannel: NIOAsyncTestingChannel