Swap some implementation only imports to internal imports (#521)

This commit is contained in:
Cory Benfield authored and GitHub committed 2025-04-11 09:14:31 +00:00
1 parent 1c130a82a7
commit a919f04adb
26 files changed
+143 -17

No files matched your search

+6 -1
View File
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
#if canImport(Darwin)
import Darwin.C
#elseif canImport(Musl)
+6 -1
View File
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// ``NIOSSLCustomPrivateKey`` defines the interface of a custom, non-BoringSSL private key.
///
/// In a number of circumstances it is advantageous to store a TLS private key in some form of high-security storage,
+6 -1
View File
@@ -12,10 +12,15 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
import NIOTLS
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// The base class for all NIOSSL handlers.
///
/// This class cannot actually be instantiated by users directly: instead, users must select
+5
View File
@@ -12,8 +12,13 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
internal import CNIOBoringSSLShims
#else
@_implementationOnly import CNIOBoringSSL
@_implementationOnly import CNIOBoringSSLShims
#endif
/// A representation of an ASN.1 Object Identifier (OID)
public struct NIOSSLObjectIdentifier {
+6 -1
View File
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
#if canImport(Darwin)
import Darwin.C
#elseif canImport(Musl)
+7 -1
View File
@@ -12,9 +12,15 @@
//
//===----------------------------------------------------------------------===//
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
internal import CNIOBoringSSLShims
#else
@_implementationOnly import CNIOBoringSSL
@_implementationOnly import CNIOBoringSSLShims
import NIOCore
#endif
#if canImport(Darwin)
import Darwin.C
@@ -12,8 +12,13 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
internal import CNIOBoringSSLShims
#else
@_implementationOnly import CNIOBoringSSL
@_implementationOnly import CNIOBoringSSLShims
#endif
extension NIOSSLCertificate {
public struct _Extensions {
+6 -1
View File
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
internal let SSL_MAX_RECORD_SIZE = 16 * 1024
/// This is used as the application data index to store pointers to `SSLConnection` objects in
+7 -1
View File
@@ -12,9 +12,15 @@
//
//===----------------------------------------------------------------------===//
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
internal import CNIOBoringSSLShims
#else
@_implementationOnly import CNIOBoringSSL
@_implementationOnly import CNIOBoringSSLShims
import NIOCore
#endif
#if canImport(Darwin)
import Darwin.C
+6 -1
View File
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// Wraps a single error from BoringSSL.
public struct BoringSSLInternalError: Equatable, CustomStringConvertible, Sendable {
private enum Backing: Hashable {
+4
View File
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// Initialize BoringSSL. Note that this function IS NOT THREAD SAFE, and so must be called inside
/// either an explicit or implicit dispatch_once.
+4
View File
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// A container for a single PKCS#12 bundle.
///
+4
View File
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// An ``NIOSSLPassphraseCallback`` is a callback that will be invoked by NIOSSL when it needs to
/// get access to a private key that is stored in encrypted form.
+4
View File
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// A ``NIOSSLPublicKey`` is an abstract handle to a public key owned by BoringSSL.
///
@@ -11,9 +11,14 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
// We can only use Security.framework to validate TLS certificates on Apple platforms.
#if canImport(Darwin)
import Dispatch
+7 -1
View File
@@ -12,9 +12,15 @@
//
//===----------------------------------------------------------------------===//
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
internal import CNIOBoringSSLShims
#else
@_implementationOnly import CNIOBoringSSL
@_implementationOnly import CNIOBoringSSLShims
import NIOCore
#endif
#if canImport(Darwin)
import Darwin.C
@@ -11,7 +11,11 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
typealias errno_t = CInt
+6 -1
View File
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
/// Known and supported TLS versions.
public enum TLSVersion: Sendable {
case tlsv1
@@ -11,7 +11,11 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
enum UnsafeKeyAndChainTarget {
case sslContext(OpaquePointer)
+6 -1
View File
@@ -12,12 +12,17 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
import XCTest
@testable import NIOSSL
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
final class ByteBufferBIOTest: XCTestCase {
override func setUp() {
guard boringSSLIsInitialized else {
@@ -20,7 +20,11 @@ import XCTest
@testable import NIOSSL
#if compiler(>=5.1)
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
#else
import CNIOBoringSSL
#endif
+6 -1
View File
@@ -12,13 +12,18 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
import NIOPosix
import NIOSSL
import NIOTLS
import XCTest
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
class NIOSSLALPNTest: XCTestCase {
static var cert: NIOSSLCertificate!
static var key: NIOSSLPrivateKey!
@@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOConcurrencyHelpers
import NIOCore
import NIOEmbedded
@@ -22,6 +21,12 @@ import XCTest
@testable import NIOSSL
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
public func assertNoThrowWithValue<T>(
_ body: @autoclosure () throws -> T,
defaultValue: T? = nil,
+6 -1
View File
@@ -12,13 +12,18 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import Foundation
import NIOCore
import NIOEmbedded
@testable import NIOSSL
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
let samplePemCert = """
-----BEGIN CERTIFICATE-----
MIIGGzCCBAOgAwIBAgIJAJ/X0Fo0ynmEMA0GCSqGSIb3DQEBCwUAMIGjMQswCQYD
@@ -12,11 +12,16 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import XCTest
@testable import NIOSSL
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
private final class OIDMemoryOwner {
var reference: OpaquePointer!
public init?(_ string: String) {
+6 -1
View File
@@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CNIOBoringSSL
import NIOCore
import NIOEmbedded
import NIOPosix
@@ -21,6 +20,12 @@ import XCTest
@testable import NIOSSL
#if compiler(>=6.1)
internal import CNIOBoringSSL
#else
@_implementationOnly import CNIOBoringSSL
#endif
#if compiler(>=5.8)
@preconcurrency import Dispatch
#else