Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Benchmarks/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version:6.0

import PackageDescription

Expand Down
35 changes: 6 additions & 29 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version:6.0
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
Expand All @@ -15,24 +15,6 @@

import PackageDescription

let strictConcurrencyDevelopment = false

let strictConcurrencySettings: [SwiftSetting] = {
var initialSettings: [SwiftSetting] = []
initialSettings.append(contentsOf: [
.enableUpcomingFeature("StrictConcurrency"),
.enableUpcomingFeature("InferSendableFromCaptures"),
])

if strictConcurrencyDevelopment {
// -warnings-as-errors here is a workaround so that IDE-based development can
// get tripped up on -require-explicit-sendable.
initialSettings.append(.unsafeFlags(["-Xfrontend", "-require-explicit-sendable", "-warnings-as-errors"]))
}

return initialSettings
}()

let package = Package(
name: "swift-nio-ssh",
platforms: [
Expand All @@ -58,8 +40,7 @@ let package = Package(
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "Atomics", package: "swift-atomics"),
],
swiftSettings: strictConcurrencySettings
]
),
.executableTarget(
name: "NIOSSHClient",
Expand All @@ -68,8 +49,7 @@ let package = Package(
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
],
swiftSettings: strictConcurrencySettings
]
),
.executableTarget(
name: "NIOSSHServer",
Expand All @@ -79,8 +59,7 @@ let package = Package(
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "Crypto", package: "swift-crypto"),
],
swiftSettings: strictConcurrencySettings
]
),
.executableTarget(
name: "NIOSSHPerformanceTester",
Expand All @@ -89,8 +68,7 @@ let package = Package(
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "Crypto", package: "swift-crypto"),
],
swiftSettings: strictConcurrencySettings
]
),
.testTarget(
name: "NIOSSHTests",
Expand All @@ -99,8 +77,7 @@ let package = Package(
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
],
swiftSettings: strictConcurrencySettings
]
),
]
)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ SwiftNIO SSH | Minimum Swift Version
`0.6.2 ..< 0.9.0` | 5.6
`0.9.0 ..< 0.9.2` | 5.8
`0.9.2 ..< 0.10.0` | 5.9
`0.10.0 ...` | 5.10
`0.10.0 ... 0.12.0` | 5.10
`0.12.0 ...` | 6.0

## What does SwiftNIO SSH support?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import NIOCore

protocol AcceptsUserAuthMessages {
protocol AcceptsUserAuthMessages: _NIOSSHSendableMetatype {
var userAuthStateMachine: UserAuthenticationStateMachine { get set }

var role: SSHConnectionRole { get }
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOSSH/Key Exchange/EllipticCurveKeyExchange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Foundation

/// This protocol defines a container used by the key exchange state machine to manage key exchange.
/// This type erases the specific key exchanger.
protocol EllipticCurveKeyExchangeProtocol {
protocol EllipticCurveKeyExchangeProtocol: _NIOSSHSendableMetatype {
init(ourRole: SSHConnectionRole, previousSessionIdentifier: ByteBuffer?)

func initiateKeyExchangeClientSide(allocator: ByteBufferAllocator) -> SSHMessage.KeyExchangeECDHInitMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import NIOCore
/// Implementers of this protocol **must not** expose unauthenticated plaintext, except for the length field. This
/// is required by the SSH protocol, and swift-nio-ssh does its best to treat the length field as fundamentally
/// untrusted information.
public protocol NIOSSHTransportProtection: AnyObject {
public protocol NIOSSHTransportProtection: AnyObject, _NIOSSHSendableMetatype {
/// The name of the cipher portion of this transport protection scheme as negotiated on the wire.
static var cipherName: String { get }

Expand Down
19 changes: 19 additions & 0 deletions Sources/NIOSSH/_NIOSSHSendableMetatype.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019-2020 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#if compiler(>=6.2)
@_marker public protocol _NIOSSHSendableMetatype: SendableMetatype {}
#else
@_marker public protocol _NIOSSHSendableMetatype {}
#endif
Loading