Skip to content

Release dfdbf7df0d8642f440177c6ef6abe5f04b63c2c4 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@ let package = Package(
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]),
.binaryTarget(
name: "BitwardenFFI",
url: "https://bwlivefronttest.blob.core.windows.net/sdk/6311733-BitwardenFFI.xcframework.zip",
checksum: "bfd5d95b5198cc462d4e93c992f2e6ae0ff5eb9de29009f2b4a05f64e9b6ff8b"),
url: "https://bwlivefronttest.blob.core.windows.net/sdk/dfdbf7d-BitwardenFFI.xcframework.zip",
checksum: "6ec71db8879e53f3a22cb68822d416e72f306b28bfda26c8c49777afd96334eb"),
.testTarget(
name: "BitwardenSdkTests",
dependencies: ["BitwardenSdk"])
23 changes: 12 additions & 11 deletions Sources/BitwardenSdk/BitwardenCore.swift
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
}

// Protocol for types that transfer other types across the FFI. This is
// analogous go the Rust trait of the same name.
// analogous to the Rust trait of the same name.
fileprivate protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
@@ -253,18 +253,19 @@ fileprivate extension RustCallStatus {
}

private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: nil)
let neverThrow: ((RustBuffer) throws -> Never)? = nil
return try makeRustCall(callback, errorHandler: neverThrow)
}

private func rustCallWithError<T>(
_ errorHandler: @escaping (RustBuffer) throws -> Error,
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}

private func makeRustCall<T>(
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
var callStatus = RustCallStatus.init()
@@ -273,9 +274,9 @@ private func makeRustCall<T>(
return returnedVal
}

private func uniffiCheckCallStatus(
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
@@ -1879,9 +1880,9 @@ private enum InitializationResult {
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variables to perform the versioning checks. Swift ensures that
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private var initializationResult: InitializationResult {
private var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
@@ -1891,7 +1892,7 @@ private var initializationResult: InitializationResult {
}

return InitializationResult.ok
}
}()

private func uniffiEnsureInitialized() {
switch initializationResult {
23 changes: 12 additions & 11 deletions Sources/BitwardenSdk/BitwardenCrypto.swift
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
}

// Protocol for types that transfer other types across the FFI. This is
// analogous go the Rust trait of the same name.
// analogous to the Rust trait of the same name.
fileprivate protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
@@ -253,18 +253,19 @@ fileprivate extension RustCallStatus {
}

private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: nil)
let neverThrow: ((RustBuffer) throws -> Never)? = nil
return try makeRustCall(callback, errorHandler: neverThrow)
}

private func rustCallWithError<T>(
_ errorHandler: @escaping (RustBuffer) throws -> Error,
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}

private func makeRustCall<T>(
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
var callStatus = RustCallStatus.init()
@@ -273,9 +274,9 @@ private func makeRustCall<T>(
return returnedVal
}

private func uniffiCheckCallStatus(
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
@@ -834,9 +835,9 @@ private enum InitializationResult {
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variables to perform the versioning checks. Swift ensures that
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private var initializationResult: InitializationResult {
private var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
@@ -846,7 +847,7 @@ private var initializationResult: InitializationResult {
}

return InitializationResult.ok
}
}()

private func uniffiEnsureInitialized() {
switch initializationResult {
23 changes: 12 additions & 11 deletions Sources/BitwardenSdk/BitwardenExporters.swift
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
}

// Protocol for types that transfer other types across the FFI. This is
// analogous go the Rust trait of the same name.
// analogous to the Rust trait of the same name.
fileprivate protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
@@ -253,18 +253,19 @@ fileprivate extension RustCallStatus {
}

private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: nil)
let neverThrow: ((RustBuffer) throws -> Never)? = nil
return try makeRustCall(callback, errorHandler: neverThrow)
}

private func rustCallWithError<T>(
_ errorHandler: @escaping (RustBuffer) throws -> Error,
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}

private func makeRustCall<T>(
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
var callStatus = RustCallStatus.init()
@@ -273,9 +274,9 @@ private func makeRustCall<T>(
return returnedVal
}

private func uniffiCheckCallStatus(
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
@@ -489,9 +490,9 @@ private enum InitializationResult {
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variables to perform the versioning checks. Swift ensures that
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private var initializationResult: InitializationResult {
private var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
@@ -501,7 +502,7 @@ private var initializationResult: InitializationResult {
}

return InitializationResult.ok
}
}()

private func uniffiEnsureInitialized() {
switch initializationResult {
23 changes: 12 additions & 11 deletions Sources/BitwardenSdk/BitwardenFido.swift
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
}

// Protocol for types that transfer other types across the FFI. This is
// analogous go the Rust trait of the same name.
// analogous to the Rust trait of the same name.
fileprivate protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
@@ -253,18 +253,19 @@ fileprivate extension RustCallStatus {
}

private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: nil)
let neverThrow: ((RustBuffer) throws -> Never)? = nil
return try makeRustCall(callback, errorHandler: neverThrow)
}

private func rustCallWithError<T>(
_ errorHandler: @escaping (RustBuffer) throws -> Error,
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}

private func makeRustCall<T>(
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
var callStatus = RustCallStatus.init()
@@ -273,9 +274,9 @@ private func makeRustCall<T>(
return returnedVal
}

private func uniffiCheckCallStatus(
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
@@ -2138,9 +2139,9 @@ private enum InitializationResult {
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variables to perform the versioning checks. Swift ensures that
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private var initializationResult: InitializationResult {
private var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
@@ -2150,7 +2151,7 @@ private var initializationResult: InitializationResult {
}

return InitializationResult.ok
}
}()

private func uniffiEnsureInitialized() {
switch initializationResult {
23 changes: 12 additions & 11 deletions Sources/BitwardenSdk/BitwardenGenerators.swift
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) {
}

// Protocol for types that transfer other types across the FFI. This is
// analogous go the Rust trait of the same name.
// analogous to the Rust trait of the same name.
fileprivate protocol FfiConverter {
associatedtype FfiType
associatedtype SwiftType
@@ -253,18 +253,19 @@ fileprivate extension RustCallStatus {
}

private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: nil)
let neverThrow: ((RustBuffer) throws -> Never)? = nil
return try makeRustCall(callback, errorHandler: neverThrow)
}

private func rustCallWithError<T>(
_ errorHandler: @escaping (RustBuffer) throws -> Error,
private func rustCallWithError<T, E: Swift.Error>(
_ errorHandler: @escaping (RustBuffer) throws -> E,
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
try makeRustCall(callback, errorHandler: errorHandler)
}

private func makeRustCall<T>(
private func makeRustCall<T, E: Swift.Error>(
_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws -> T {
uniffiEnsureInitialized()
var callStatus = RustCallStatus.init()
@@ -273,9 +274,9 @@ private func makeRustCall<T>(
return returnedVal
}

private func uniffiCheckCallStatus(
private func uniffiCheckCallStatus<E: Swift.Error>(
callStatus: RustCallStatus,
errorHandler: ((RustBuffer) throws -> Error)?
errorHandler: ((RustBuffer) throws -> E)?
) throws {
switch callStatus.code {
case CALL_SUCCESS:
@@ -1095,9 +1096,9 @@ private enum InitializationResult {
case contractVersionMismatch
case apiChecksumMismatch
}
// Use a global variables to perform the versioning checks. Swift ensures that
// Use a global variable to perform the versioning checks. Swift ensures that
// the code inside is only computed once.
private var initializationResult: InitializationResult {
private var initializationResult: InitializationResult = {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
@@ -1107,7 +1108,7 @@ private var initializationResult: InitializationResult {
}

return InitializationResult.ok
}
}()

private func uniffiEnsureInitialized() {
switch initializationResult {
Loading