From 6f72bf8b58daa26b09c3c72534d6b0567a740565 Mon Sep 17 00:00:00 2001 From: Hinton Date: Fri, 6 Sep 2024 14:51:09 +0200 Subject: [PATCH] Release https://github.com/bitwarden/sdk/commit/59cee6ee206ff97a58b0102195c0b0a81e6bf67d --- Package.swift | 4 ++-- Sources/BitwardenSdk/BitwardenCore.swift | 8 ++++--- Sources/BitwardenSdk/BitwardenCrypto.swift | 8 ++++--- Sources/BitwardenSdk/BitwardenExporters.swift | 8 ++++--- Sources/BitwardenSdk/BitwardenFido.swift | 8 ++++--- .../BitwardenSdk/BitwardenGenerators.swift | 24 ++++++++++--------- Sources/BitwardenSdk/BitwardenSDK.swift | 8 ++++--- Sources/BitwardenSdk/BitwardenSend.swift | 8 ++++--- Sources/BitwardenSdk/BitwardenVault.swift | 8 ++++--- 9 files changed, 50 insertions(+), 34 deletions(-) diff --git a/Package.swift b/Package.swift index 7aca87f..edc8f97 100644 --- a/Package.swift +++ b/Package.swift @@ -27,8 +27,8 @@ let package = Package( swiftSettings: [.unsafeFlags(["-suppress-warnings"])]), .binaryTarget( name: "BitwardenFFI", - url: "https://bwlivefronttest.blob.core.windows.net/sdk/de3b6e2-BitwardenFFI.xcframework.zip", - checksum: "37e884d820907af85e788b5e0ab483bfc5aa0299e5d6b39865ad70659322a202"), + url: "https://bwlivefronttest.blob.core.windows.net/sdk/59cee6e-BitwardenFFI.xcframework.zip", + checksum: "6539debb4d746c5fda9cd4ff36828d6ff65d84ca15dcb71746ef6420ce3775a2"), .testTarget( name: "BitwardenSdkTests", dependencies: ["BitwardenSdk"]) diff --git a/Sources/BitwardenSdk/BitwardenCore.swift b/Sources/BitwardenSdk/BitwardenCore.swift index 629ec81..ef143a4 100644 --- a/Sources/BitwardenSdk/BitwardenCore.swift +++ b/Sources/BitwardenSdk/BitwardenCore.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } diff --git a/Sources/BitwardenSdk/BitwardenCrypto.swift b/Sources/BitwardenSdk/BitwardenCrypto.swift index ff77933..2d5f35e 100644 --- a/Sources/BitwardenSdk/BitwardenCrypto.swift +++ b/Sources/BitwardenSdk/BitwardenCrypto.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } diff --git a/Sources/BitwardenSdk/BitwardenExporters.swift b/Sources/BitwardenSdk/BitwardenExporters.swift index 804128b..50b303b 100644 --- a/Sources/BitwardenSdk/BitwardenExporters.swift +++ b/Sources/BitwardenSdk/BitwardenExporters.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } diff --git a/Sources/BitwardenSdk/BitwardenFido.swift b/Sources/BitwardenSdk/BitwardenFido.swift index 00d1b7d..b09b024 100644 --- a/Sources/BitwardenSdk/BitwardenFido.swift +++ b/Sources/BitwardenSdk/BitwardenFido.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } diff --git a/Sources/BitwardenSdk/BitwardenGenerators.swift b/Sources/BitwardenSdk/BitwardenGenerators.swift index 297c6da..de6c0b5 100644 --- a/Sources/BitwardenSdk/BitwardenGenerators.swift +++ b/Sources/BitwardenSdk/BitwardenGenerators.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } @@ -591,22 +593,22 @@ public struct PasswordGeneratorRequest { public let avoidAmbiguous: Bool /** * The minimum number of lowercase characters in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is lowercase is false + * When set, the value must be between 1 and 9. This value is ignored if lowercase is false. */ public let minLowercase: UInt8? /** * The minimum number of uppercase characters in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is uppercase is false + * When set, the value must be between 1 and 9. This value is ignored if uppercase is false. */ public let minUppercase: UInt8? /** * The minimum number of numbers in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is numbers is false + * When set, the value must be between 1 and 9. This value is ignored if numbers is false. */ public let minNumber: UInt8? /** * The minimum number of special characters in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is special is false + * When set, the value must be between 1 and 9. This value is ignored if special is false. */ public let minSpecial: UInt8? @@ -635,19 +637,19 @@ public struct PasswordGeneratorRequest { */avoidAmbiguous: Bool, /** * The minimum number of lowercase characters in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is lowercase is false + * When set, the value must be between 1 and 9. This value is ignored if lowercase is false. */minLowercase: UInt8?, /** * The minimum number of uppercase characters in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is uppercase is false + * When set, the value must be between 1 and 9. This value is ignored if uppercase is false. */minUppercase: UInt8?, /** * The minimum number of numbers in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is numbers is false + * When set, the value must be between 1 and 9. This value is ignored if numbers is false. */minNumber: UInt8?, /** * The minimum number of special characters in the generated password. - * When set, the value must be between 1 and 9. This value is ignored is special is false + * When set, the value must be between 1 and 9. This value is ignored if special is false. */minSpecial: UInt8?) { self.lowercase = lowercase self.uppercase = uppercase diff --git a/Sources/BitwardenSdk/BitwardenSDK.swift b/Sources/BitwardenSdk/BitwardenSDK.swift index c767739..48dfdae 100644 --- a/Sources/BitwardenSdk/BitwardenSDK.swift +++ b/Sources/BitwardenSdk/BitwardenSDK.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } diff --git a/Sources/BitwardenSdk/BitwardenSend.swift b/Sources/BitwardenSdk/BitwardenSend.swift index fc778ca..aacbf2e 100644 --- a/Sources/BitwardenSdk/BitwardenSend.swift +++ b/Sources/BitwardenSdk/BitwardenSend.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } } diff --git a/Sources/BitwardenSdk/BitwardenVault.swift b/Sources/BitwardenSdk/BitwardenVault.swift index 11dee29..1db13f5 100644 --- a/Sources/BitwardenSdk/BitwardenVault.swift +++ b/Sources/BitwardenSdk/BitwardenVault.swift @@ -50,9 +50,11 @@ fileprivate extension ForeignBytes { fileprivate extension Data { init(rustBuffer: RustBuffer) { - // TODO: This copies the buffer. Can we read directly from a - // Rust buffer? - self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len)) + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) } }