diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..998fd4c57 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + groups: + dependencies: + patterns: + - "*" + - package-ecosystem: "swift" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 6 + allow: + - dependency-type: all + groups: + all-dependencies: + patterns: + - "*" diff --git a/.github/workflows/api-breakage.yml b/.github/workflows/api-breakage.yml index 97abea20d..5caffc090 100644 --- a/.github/workflows/api-breakage.yml +++ b/.github/workflows/api-breakage.yml @@ -4,16 +4,17 @@ name: API breaking changes on: pull_request: branches: - - main + - main jobs: linux: runs-on: ubuntu-latest + timeout-minutes: 15 container: - image: swift:5.8 + image: swift:5.9 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # https://github.com/actions/checkout/issues/766 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a0a49bef5..b6eb2cc6d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -14,6 +14,7 @@ jobs: benchmark-delta: runs-on: ${{ matrix.os }} + timeout-minutes: 15 continue-on-error: true strategy: @@ -21,7 +22,7 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad0731061..ce355b1db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,26 +15,9 @@ on: workflow_dispatch: jobs: -# macOS: -# runs-on: macOS-13 -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# - name: SPM tests -# run: swift test --enable-code-coverage -# - name: Convert coverage files -# run: | -# xcrun llvm-cov export -format "lcov" \ -# .build/debug/hummingbirdPackageTests.xctest/Contents/MacOs/hummingbirdPackageTests \ -# -ignore-filename-regex="\/Tests\/" \ -# -ignore-filename-regex="\/Benchmarks\/" \ -# -instr-profile=.build/debug/codecov/default.profdata > info.lcov -# - name: Upload to codecov.io -# uses: codecov/codecov-action@v3 -# with: -# file: info.lcov linux: runs-on: ubuntu-latest + timeout-minutes: 15 strategy: matrix: image: @@ -45,7 +28,7 @@ jobs: image: ${{ matrix.image }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test run: | swift test --enable-code-coverage diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index e2a00c428..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ "main", "7.x.x" ] - pull_request: - branches: [ "main", "7.x.x" ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - container: swift:5.8 - permissions: - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'swift' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - - name: Build - run: swift build - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4e3da45d5..fd31bac8d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,20 +1,12 @@ name: Swift nightly build on: - schedule: - - cron: '0 1 * * *' workflow_dispatch: jobs: - macOS: - runs-on: macOS-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: SPM tests - run: swift test linux: runs-on: ubuntu-latest + timeout-minutes: 15 strategy: matrix: image: ['nightly-focal', 'nightly-jammy', 'nightly-amazonlinux2'] @@ -23,7 +15,7 @@ jobs: image: swiftlang/swift:${{ matrix.image }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test run: | swift test --enable-test-discovery diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ff9740420..60277059f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -4,18 +4,20 @@ on: pull_request: branches: - main + - 2.x.x jobs: validate: runs-on: macOS-latest + timeout-minutes: 15 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 - name: Install Dependencies run: | brew install mint - mint install NickLockwood/SwiftFormat@0.48.17 --no-link + mint install NickLockwood/SwiftFormat@0.51.15 --no-link - name: run script run: ./scripts/validate.sh diff --git a/.gitignore b/.gitignore index e73744cdf..45ca84cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ xcuserdata/ Package.resolved /public /docs -.benchmarkBaselines +.benchmarkBaselines \ No newline at end of file diff --git a/.swiftformat b/.swiftformat index 48f8ed4d6..d800f8ace 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,5 +1,5 @@ # Minimum swiftformat version ---minversion 0.47.4 +--minversion 0.51.0 # Swift version --swiftversion 5.9 @@ -8,7 +8,7 @@ --exclude .build # rules ---disable redundantReturn, extensionAccessControl, conditionalAssignment +--disable redundantReturn, extensionAccessControl, typeSugar # format options --ifdef no-indent diff --git a/Benchmarks/Benchmarks/Router/Benchmarks.swift b/Benchmarks/Benchmarks/Router/Benchmarks.swift index 0e55f211a..2da694499 100644 --- a/Benchmarks/Benchmarks/Router/Benchmarks.swift +++ b/Benchmarks/Benchmarks/Router/Benchmarks.swift @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -@testable import Hummingbird import Benchmark +@testable import Hummingbird let benchmarks = { Benchmark.defaultConfiguration = .init( diff --git a/Benchmarks/Benchmarks/Router/RouterBenchmarks.swift b/Benchmarks/Benchmarks/Router/RouterBenchmarks.swift index 0de477f6c..f1cebe1d6 100644 --- a/Benchmarks/Benchmarks/Router/RouterBenchmarks.swift +++ b/Benchmarks/Benchmarks/Router/RouterBenchmarks.swift @@ -57,7 +57,7 @@ extension Benchmark { for _ in 0..<50 { try await withThrowingTaskGroup(of: Void.self) { group in let context = Context( - allocator: ByteBufferAllocator(), + allocator: ByteBufferAllocator(), logger: Logger(label: "Benchmark") ) let (inbound, source) = NIOAsyncChannelInboundStream.makeTestingStream() @@ -86,7 +86,7 @@ extension HTTPField.Name { } func routerBenchmarks() { - let buffer = ByteBufferAllocator().buffer(repeating: 0xff, count: 10000) + let buffer = ByteBufferAllocator().buffer(repeating: 0xFF, count: 10000) Benchmark( name: "Router:GET", configuration: .init(warmupIterations: 10), diff --git a/Benchmarks/Benchmarks/Router/TrieRouterBenchmarks.swift b/Benchmarks/Benchmarks/Router/TrieRouterBenchmarks.swift index e001196c5..c8f341b85 100644 --- a/Benchmarks/Benchmarks/Router/TrieRouterBenchmarks.swift +++ b/Benchmarks/Benchmarks/Router/TrieRouterBenchmarks.swift @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -@testable import Hummingbird import Benchmark +@testable import Hummingbird func trieRouterBenchmarks() { var trie: RouterPathTrie! @@ -25,9 +25,9 @@ func trieRouterBenchmarks() { "/doesntExist", ] benchmark.startMeasurement() - + for _ in benchmark.scaledIterations { - blackHole(testValues.map { trie.getValueAndParameters($0)}) + blackHole(testValues.map { trie.getValueAndParameters($0) }) } } setup: { let trieBuilder = RouterPathTrieBuilder() @@ -48,9 +48,9 @@ func trieRouterBenchmarks() { "/test2/one/two", ] benchmark.startMeasurement() - + for _ in benchmark.scaledIterations { - blackHole(testValues.map { trie2.getValueAndParameters($0)}) + blackHole(testValues.map { trie2.getValueAndParameters($0) }) } } setup: { let trieBuilder = RouterPathTrieBuilder() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12d20a071..bd21b4f37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Legal By submitting a pull request, you represent that you have the right to license your contribution to the community, and agree by submitting the patch -that your contributions are licensed under the Apache 2.0 license (see [LICENSE](LICENSE.txt)). +that your contributions are licensed under the Apache 2.0 license (see [LICENSE](LICENSE)). ## Contributor Conduct All contributors are expected to adhere to the project's [Code of Conduct](CODE_OF_CONDUCT.md). @@ -30,4 +30,4 @@ The main development branch of the repository is `main`. ### Formatting -We use Nick Lockwood's SwiftFormat for formatting code. PRs will not be accepted if they haven't be formatted. The current version of SwiftFormat we are using is v0.48.17. \ No newline at end of file +We use Nick Lockwood's SwiftFormat for formatting code. PRs will not be accepted if they haven't be formatted. The current version of SwiftFormat we are using is v0.51.15. \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 01fa4474e..102200fc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # ================================ # Build image # ================================ -FROM swift:5.7 as build +FROM swift:5.9 as build WORKDIR /build diff --git a/Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormEncoder.swift b/Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormEncoder.swift index da0b97a5d..a719a1bf6 100644 --- a/Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormEncoder.swift +++ b/Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormEncoder.swift @@ -75,7 +75,7 @@ public struct URLEncodedFormEncoder: Sendable { /// - Parameters: /// - value: Value to encode /// - Returns: URL encoded form data - public func encode(_ value: T) throws -> String { + public func encode(_ value: some Encodable) throws -> String { let encoder = _URLEncodedFormEncoder(options: options) try value.encode(to: encoder) guard let result = encoder.result else { @@ -158,7 +158,7 @@ private class _URLEncodedFormEncoder: Encoder { mutating func encode(_ value: UInt32, forKey key: Key) throws { self.encode(value, key: key.stringValue) } mutating func encode(_ value: UInt64, forKey key: Key) throws { self.encode(value, key: key.stringValue) } - mutating func encode(_ value: T, forKey key: Key) throws { + mutating func encode(_ value: some Encodable, forKey key: Key) throws { self.encoder.codingPath.append(key) defer { self.encoder.codingPath.removeLast() } @@ -238,7 +238,7 @@ private class _URLEncodedFormEncoder: Encoder { mutating func encode(_ value: UInt32) throws { self.encodeResult(value) } mutating func encode(_ value: UInt64) throws { self.encodeResult(value) } - mutating func encode(_ value: T) throws { + mutating func encode(_ value: some Encodable) throws { self.count += 1 self.encoder.codingPath.append(URLEncodedForm.Key(index: self.count)) @@ -304,7 +304,7 @@ extension _URLEncodedFormEncoder: SingleValueEncodingContainer { func encode(_ value: UInt32) throws { self.encodeResult(value) } func encode(_ value: UInt64) throws { self.encodeResult(value) } - func encode(_ value: T) throws { + func encode(_ value: some Encodable) throws { try value.encode(to: self) } diff --git a/Sources/Hummingbird/HTTP/MediaType.swift b/Sources/Hummingbird/HTTP/MediaType.swift index 3048c9611..0d196c87c 100644 --- a/Sources/Hummingbird/HTTP/MediaType.swift +++ b/Sources/Hummingbird/HTTP/MediaType.swift @@ -99,8 +99,8 @@ public struct HBMediaType: Sendable, CustomStringConvertible { break } } - if let category = category, - let subCategory = subCategory + if let category, + let subCategory { self.type = category self.subType = subCategory.lowercased() diff --git a/Sources/Hummingbird/Middleware/TracingMiddleware.swift b/Sources/Hummingbird/Middleware/TracingMiddleware.swift index b1f050f4b..22458ba91 100644 --- a/Sources/Hummingbird/Middleware/TracingMiddleware.swift +++ b/Sources/Hummingbird/Middleware/TracingMiddleware.swift @@ -32,7 +32,7 @@ public struct HBTracingMiddleware: HBMiddlewarePr /// - Parameters /// - recordingHeaders: A list of HTTP header names to be recorded as span attributes. By default, no headers /// are being recorded. - /// - parameters: A list of static parameters added to every span. These could be the "net.host.name", + /// - parameters: A list of static parameters added to every span. These could be the "net.host.name", /// "net.host.port" or "http.scheme" public init(recordingHeaders headerNamesToRecord: some Collection = [], attributes: SpanAttributes? = nil) { self.headerNamesToRecord = Set(headerNamesToRecord.map(RecordingHeader.init)) diff --git a/Sources/Hummingbird/Router/TrieRouter.swift b/Sources/Hummingbird/Router/TrieRouter.swift index 08bb5c984..07b1a4ea5 100644 --- a/Sources/Hummingbird/Router/TrieRouter.swift +++ b/Sources/Hummingbird/Router/TrieRouter.swift @@ -161,7 +161,7 @@ struct RouterPathTrie: Sendable { } } -extension HBParameters? { +extension Optional { fileprivate mutating func set(_ s: Substring, value: Substring) { switch self { case .some(var parameters): diff --git a/Sources/Hummingbird/Server/Request.swift b/Sources/Hummingbird/Server/Request.swift index 97c6bd501..09cc38353 100644 --- a/Sources/Hummingbird/Server/Request.swift +++ b/Sources/Hummingbird/Server/Request.swift @@ -66,7 +66,7 @@ private extension CodingKey { } } -private extension [CodingKey] { +private extension Array { /// returns a path key using a dot character as a separator var pathKeyValue: String { map(\.pathKeyValue).joined(separator: ".") diff --git a/Sources/Hummingbird/Storage/MemoryPersistDriver.swift b/Sources/Hummingbird/Storage/MemoryPersistDriver.swift index f99504394..54c375096 100644 --- a/Sources/Hummingbird/Storage/MemoryPersistDriver.swift +++ b/Sources/Hummingbird/Storage/MemoryPersistDriver.swift @@ -23,12 +23,12 @@ public actor HBMemoryPersistDriver: HBPersistDriver where C.Duration = self.clock = clock } - public func create(key: String, value: Object, expires: Duration?) async throws { + public func create(key: String, value: some Codable & Sendable, expires: Duration?) async throws { guard self.values[key] == nil else { throw HBPersistError.duplicate } self.values[key] = .init(value: value, expires: expires.map { self.clock.now.advanced(by: $0) }) } - public func set(key: String, value: Object, expires: Duration?) async throws { + public func set(key: String, value: some Codable & Sendable, expires: Duration?) async throws { self.values[key] = .init(value: value, expires: expires.map { self.clock.now.advanced(by: $0) }) } diff --git a/Sources/HummingbirdCore/Response/ResponseBody.swift b/Sources/HummingbirdCore/Response/ResponseBody.swift index aaf08b5ee..821f34986 100644 --- a/Sources/HummingbirdCore/Response/ResponseBody.swift +++ b/Sources/HummingbirdCore/Response/ResponseBody.swift @@ -57,22 +57,22 @@ public struct HBResponseBody: Sendable { } } - /// Create HBResponseBody that returns trailing headers from its closure once all the - /// body parts have been written + /// Create HBResponseBody that returns trailing headers from its closure once all the + /// body parts have been written /// - Parameters: /// - contentLength: Optional length of body /// - write: closure provided with `writer` type that can be used to write to response body /// trailing headers are returned from the closure after all the body parts have been /// written public static func withTrailingHeaders( - contentLength: Int? = nil, + contentLength: Int? = nil, _ write: @Sendable @escaping (any HBResponseBodyWriter) async throws -> HTTPFields? ) -> Self { self.init(contentLength: contentLength, write: write) } /// Initialise HBResponseBody with closure writing body contents - /// + /// /// This version of init is private and only available via ``withTrailingHeaders`` because /// if it is public the compiler gets confused when a complex closure is provided. private init(contentLength: Int? = nil, write: @Sendable @escaping (any HBResponseBodyWriter) async throws -> HTTPFields?) { diff --git a/Sources/HummingbirdCore/Server/Server.swift b/Sources/HummingbirdCore/Server/Server.swift index 56a0898fa..02058d249 100644 --- a/Sources/HummingbirdCore/Server/Server.swift +++ b/Sources/HummingbirdCore/Server/Server.swift @@ -197,10 +197,9 @@ public actor HBServer: Service { #endif do { - let asyncChannel: AsyncServerChannel switch configuration.address.value { case .hostname(let host, let port): - asyncChannel = try await bootstrap.bind( + let asyncChannel = try await bootstrap.bind( host: host, port: port, serverBackPressureStrategy: nil @@ -211,8 +210,10 @@ public actor HBServer: Service { ) } self.logger.info("Server started and listening on \(host):\(port)") + return asyncChannel + case .unixDomainSocket(let path): - asyncChannel = try await bootstrap.bind( + let asyncChannel = try await bootstrap.bind( unixDomainSocketPath: path, cleanupExistingSocketFile: false, serverBackPressureStrategy: nil @@ -223,8 +224,8 @@ public actor HBServer: Service { ) } self.logger.info("Server started and listening on socket path \(path)") + return asyncChannel } - return asyncChannel } catch { // should we close the channel here throw error diff --git a/Sources/HummingbirdCore/Utils/HBParser.swift b/Sources/HummingbirdCore/Utils/HBParser.swift index 649981b80..5dc9b9ccf 100644 --- a/Sources/HummingbirdCore/Utils/HBParser.swift +++ b/Sources/HummingbirdCore/Utils/HBParser.swift @@ -28,7 +28,7 @@ public struct HBParser: Sendable { /// Create a Parser object /// - Parameter string: UTF8 data to parse - public init?(_ utf8Data: Bytes, validateUTF8: Bool = true) where Bytes.Element == UInt8 { + public init?(_ utf8Data: some Collection, validateUTF8: Bool = true) { if let buffer = utf8Data as? [UInt8] { self.buffer = buffer } else { @@ -663,7 +663,7 @@ extension Unicode.Scalar { } } -extension Set where Element == Unicode.Scalar { +extension Set { public init(_ string: String) { self = Set(string.unicodeScalars) } diff --git a/Sources/HummingbirdHTTP2/HTTP2Channel.swift b/Sources/HummingbirdHTTP2/HTTP2Channel.swift index 6628afdad..b6ee53b67 100644 --- a/Sources/HummingbirdHTTP2/HTTP2Channel.swift +++ b/Sources/HummingbirdHTTP2/HTTP2Channel.swift @@ -117,7 +117,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler { logger.error("Error handling inbound connection for HTTP2 handler: \(error)") } // have to run this to ensure http2 channel outbound writer is closed - try await http2.executeThenClose { _,_ in} + try await http2.executeThenClose { _, _ in } } } catch { logger.error("Error getting HTTP2 upgrade negotiated value: \(error)") diff --git a/Tests/HummingbirdCoreTests/Certificates.swift b/Tests/HummingbirdCoreTests/Certificates.swift index 413f2686f..72c022d6c 100644 --- a/Tests/HummingbirdCoreTests/Certificates.swift +++ b/Tests/HummingbirdCoreTests/Certificates.swift @@ -17,149 +17,149 @@ import NIOSSL let testServerName = "hummingbird.codes" let caCertificateData = -""" ------BEGIN CERTIFICATE----- -MIIDyTCCArGgAwIBAgIUMlPXRgNMa+eUbn/hsCK88Zm1FI8wDQYJKoZIhvcNAQEL -BQAwdDELMAkGA1UEBhMCVUsxEjAQBgNVBAgMCUVkaW5idXJnaDESMBAGA1UEBwwJ -RWRpbmJ1cmdoMRQwEgYDVQQKDAtIdW1taW5nYmlyZDELMAkGA1UECwwCQ0ExGjAY -BgNVBAMMEWh1bW1pbmdiaXJkLmNvZGVzMB4XDTI0MDEyNzE1NDc0MloXDTI1MDEy -NjE1NDc0MlowdDELMAkGA1UEBhMCVUsxEjAQBgNVBAgMCUVkaW5idXJnaDESMBAG -A1UEBwwJRWRpbmJ1cmdoMRQwEgYDVQQKDAtIdW1taW5nYmlyZDELMAkGA1UECwwC -Q0ExGjAYBgNVBAMMEWh1bW1pbmdiaXJkLmNvZGVzMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAoSMlfkfyINkI63a0q5KpMjtulVb9/MESJtaiZeG0H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aW4s46/mHWw5FqW74PAt53XN9 + aSQdWscXhuutRtPbM+GY9d6Lf1pp9/Cq+XCAV3iRgjfFQPgD2INc0ySTY10uGOWc + YQpa4UBX1ZPRAPa0YBwCwF4Xz/4BBfDzfiCrosungQKBgQDXuMFEcuQFsjLYm3Vz + W9N4UZg3HeuABH29Dt09yyFlg6hZD3FFFBBWDPipT6aFdmewYDTyTZ5RPBfBLH4r + MTIYuIje/jF9bxGkKzK0Pos5nsBeJDxLf3CcJvALEc2u7l0spS5y2MJ9RU6PMaF9 + 0DoABf7yNmYbyHtyRB5a52fBEQKBgQDE/PD0TinVgWsjxkogv/rQcLn0aFVufoT7 + j01VPloATzntYdmvVT/EiAnTf4IJx8p0TqvFnvlYQj7Tffzv1B8iXmx6wAmWeS94 + ElnWi/5pkIy1XI1DUy6MCdOcOCSwL36tcKEzFjYrVJtwGiR8gxz3PQuxquFmoofQ + jYy1V1aqWwKBgBKZ0LhpO7YuBmpdBUScL2DZkEl4X/0a5giuRm90m32YW6TKSxcM + wtfYqHxY7N/nNMulkAswnC0fBGFYx8xLoqk1CEBKJNRPBnNkcivOlMy0Hpw/fZ94 + 7qnYRax+rYCe9xPJbnbir+qDVmHMgsNJeCbWXYRfInDU2aghrYhjGbQxAoGBAMRG + k3+Zci1+alaW+L1xDGQsLdzNKHKUNcTBoHhTTDIKvtk8Kj59XrBgLApEfjlojN0e + liCuqhu6xgbM/f2pCeyg0M3uEp+P2DB3eHRBwRlGIi2DLm3qr/JwyBxcBJJYgIwo + MTZJ52d9QfOM2NYHfhELDl/UuAof39t5br4xa/UJAoGBAKUYB48+AK9oFPj6YG8U + N7XHfElJPggmygAUtndYwJeNRGbFew+P4fhrRG+2nhIVjVOBSwAvTnGPexwbkWCz + NOAf/sV8p4YEBa+KwkN/dSXUD+LE+s3ARmLzFaEkYyl03U9bJ9RfCz2wLCpTmjq0 + 50ies8PMrKKJxjkhVycT3pFJ + -----END PRIVATE KEY----- + """ let clientCertificateData = -""" ------BEGIN C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lhL1o6NGDzM/j + 2/t9IzMnjIeoNGOZtrbx1QhjH6Hu4waRhkck30my+ukYLpsCAwEAAaNCMEAwHQYD + VR0OBBYEFL8Uh8IaSnv66cS3mHy4rE1RHdm9MB8GA1UdIwQYMBaAFNfcIEmn3MjO + sc9AibftCHj3QI9uMA0GCSqGSIb3DQEBCwUAA4IBAQAGG8Fv4eTFT8UaNZkuhnMA + BT2+he8O0xlvFXse+QpL451ISU1KjSbh/N2jDfpob3/nO1EKYEuG5XKHmhlTjrzb + sa0YW5ad31jPgCExm69WRVfJOlnVL1olbzmyibGbQ8lFax0QgYO9rLhvkJocQs2D + tJX0xNL/2BccaVQvj7i8qAHeiQ9NqO46g4Uob5jE2nswJLZh9REddNsFWKxxL8jK + k+Ez6oW1s6QUaOoOm3Dh94fuYD34hgDeDIu+ec7bOiIIwKAholKQuoHqphMbZvQ5 + QWv2gB3vE9Ep1VKrVr9dT4NST80Bmw7E1piUuqBShsohLc0GEkSrWboGP8vWbu+F + -----END CERTIFICATE----- + """ let clientPrivateKeyData = -""" ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCljW1OV5PxQYR3 -VbtQj7kCRsMakzoICav+7aeVrh0fWjKYG/81rhGk/3i+bWSSmF/GNjGPPwDpKFRN -H4wfLCvJ8BuAoBq68QVezLEkCeNz6kBOFl8Qtm2W5+XSyK+gAWeJ077kL6vD7/8p -af+z3pOmhRDPADyGnNJQBXCc5zgKwtse41Gqed3IBz+uMYjvmRdrU/PAhlTRAWAl -gGesdRGs9D2ypv8FnOaSBm4FvouJT+vW5H813My4zd8XHutScsfSo+g3lKiD0dmE -MGBzkZxKcAwq5YS9aOjRg8zP49v7fSMzJ4yHqDRjmba28dUIYx+h7uMGkYZHJN9J -svrpGC6bAgMBAAECggEACW02pdXXYjVK78KaPyzLEF9rUszCt3XZhqANdIWGbTEY -UJ0tGIDk/bV547OPg2HMXkx0R1+DU6nMtw5OgiR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Z -1mJhowXVjxJJA4QWzPYGQSrVfKrUGJf8y5vHos5NQWF2VYNVJsSP5D17MoMwagqW -kPQvfvMHrv6al2joWL+8/3U= ------END PRIVATE KEY----- -""" + """ + -----BEGIN PRIVATE KEY----- + MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCljW1OV5PxQYR3 + VbtQj7kCRsMakzoICav+7aeVrh0fWjKYG/81rhGk/3i+bWSSmF/GNjGPPwDpKFRN + H4wfLCvJ8BuAoBq68QVezLEkCeNz6kBOFl8Qtm2W5+XSyK+gAWeJ077kL6vD7/8p + af+z3pOmhRDPADyGnNJQBXCc5zgKwtse41Gqed3IBz+uMYjvmRdrU/PAhlTRAWAl + gGesdRGs9D2ypv8FnOaSBm4FvouJT+vW5H813My4zd8XHutScsfSo+g3lKiD0dmE + MGBzkZxKcAwq5YS9aOjRg8zP49v7fSMzJ4yHqDRjmba28dUIYx+h7uMGkYZHJN9J + svrpGC6bAgMBAAECggEACW02pdXXYjVK78KaPyzLEF9rUszCt3XZhqANdIWGbTEY + UJ0tGIDk/bV547OPg2HMXkx0R1+DU6nMtw5OgiRK1mpNUcy/PBkz2mFWATyg6D17 + IOPynZ1NoZPQ/DVNYfm1snbnCs/RSRkvn2UrC380GBcoM4+kL3DbI6kgb7nvJBZu + p5ftCeUjSOJWi5ImmaPFvBsF24bxCAuwk0Gw8q9ybqpJHLm8ybkXpiF3SvXlnKGt + RLxKhAVSOKbyrWQNUv9RDx2xAfibpqUAo3gZVyxkDY2Gkb1J5YT27bhFricJNaVz + FFxhC3O+X3ihMBBNnq1VwwjoeSzWmwS1BFPgVFzLbQKBgQDWTnT2eFrzV7ADXCMT + 1bg4hoFJD/QUJXqozAvCIAQx6xSamoadUHKMzYpGvI/5YEYbn3sgoRiQDrZd5jZf + zWRJuyQxdq1bakBsx4vji3TJ1eN0ovzTQHAB1Z+5tAw6CN9htUTyW/NbvzS4/eMd + 9we68ye2gHrgFVtfVC6emIriNQKBgQDFwsYb5xRKce5F/iL4o11LfA0Dyu9Vekvg + FPBXdE6pSzZimeyC3Y8u144eWiXTfo7DT8nY1b5JTXmhUH9Q84lTkELq666rTn9N + KV3LIMEweHX//GBi+unZC5K6H8dnc9YzBsL4P6SO/ZqHzef02EGadGEyg4rlSkpp + yqJ+SI7njwKBgBer7OF4o9szOV71o25CcinUOZ2fZH+BME5K05Wqwavd4pW9MddY + ln6VCYwMsf6CstvEPu54vOTUqzIuBp2Ia2Z1hGbuS/HIB7u8QuhsdAcDWC9+/Vw8 + RuL8/Lqfd6ZFap85TZdTrsrYkPNKH/ckXTc6Oo2/HVN5KHGcM9YS1WxtAoGAKMnE + bIrbn4MiHuOMuPWQz3nVgVvAw0OHFL+c1pzRgI9XtzyCEHe8CXBCCraTKKzoqxXw + zr0/EwVcuc3NhJfGUirl8mgLzZ9SGEsY4kVuMx4VUGfwRVn1E2QUrjjRut+kZT/W + xLbzrN5Xmfz5A4H6/e1VAsMoyaPp9ynpG9zBRLcCgYEAj/J9KsG6gqECwK12dcqz + brMAb7X3v05Kk22Nskhis6p31AOgg67MI8y3ANko2LADOHfov1HNaTwkCdhAaFoZ + 1mJhowXVjxJJA4QWzPYGQSrVfKrUGJf8y5vHos5NQWF2VYNVJsSP5D17MoMwagqW + kPQvfvMHrv6al2joWL+8/3U= + -----END PRIVATE KEY----- + """ func getServerTLSConfiguration() throws -> TLSConfiguration { let caCertificate = try NIOSSLCertificate(bytes: [UInt8](caCertificateData.utf8), format: .pem) diff --git a/Tests/HummingbirdTests/TestTracer.swift b/Tests/HummingbirdTests/TestTracer.swift index 2bbeb7172..8ef312341 100644 --- a/Tests/HummingbirdTests/TestTracer.swift +++ b/Tests/HummingbirdTests/TestTracer.swift @@ -36,11 +36,11 @@ final class TestTracer: LegacyTracer { private(set) var spans = [TestSpan]() var onEndSpan: (TestSpan) -> Void = { _ in } - func startAnySpan( + func startAnySpan( _ operationName: String, context: @autoclosure () -> ServiceContext, ofKind kind: SpanKind, - at instant: @autoclosure () -> Instant, + at instant: @autoclosure () -> some TracerInstant, function: String, file fileID: String, line: UInt @@ -79,11 +79,11 @@ final class TestTracer: LegacyTracer { #if swift(>=5.7.0) extension TestTracer: Tracer { - func startSpan( + func startSpan( _ operationName: String, context: @autoclosure () -> ServiceContext, ofKind kind: SpanKind, - at instant: @autoclosure () -> Instant, + at instant: @autoclosure () -> some TracerInstant, function: String, file fileID: String, line: UInt @@ -161,9 +161,9 @@ final class TestSpan: Span { let onEnd: (TestSpan) -> Void - init( + init( operationName: String, - at instant: Instant, + at instant: some TracerInstant, context: ServiceContext, kind: SpanKind, onEnd: @escaping (TestSpan) -> Void @@ -188,15 +188,15 @@ final class TestSpan: Span { self.events.append(event) } - func recordError( + func recordError( _ error: Error, attributes: SpanAttributes, - at instant: @autoclosure () -> Instant + at instant: @autoclosure () -> some TracerInstant ) { self.recordedErrors.append((error, attributes)) } - func end(at instant: @autoclosure () -> Instant) { + func end(at instant: @autoclosure () -> some TracerInstant) { self.endTime = instant().millisecondsSinceEpoch self.onEnd(self) } diff --git a/scripts/validate.sh b/scripts/validate.sh index e201bd38b..f621e665f 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -13,7 +13,7 @@ ## ##===----------------------------------------------------------------------===## -SWIFT_FORMAT_VERSION=0.48.17 +SWIFT_FORMAT_VERSION=0.51.15 set -eu here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"