Skip to content

Release 57fa7faf8c7a94781b59a570395c31da417347c8 #8

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
May 3, 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/6d45212-BitwardenFFI.xcframework.zip",
checksum: "6a30607da29c161656301e5aadfd763d34b37ef655af4059c7cef4a7ae072e08"),
url: "https://bwlivefronttest.blob.core.windows.net/sdk/57fa7fa-BitwardenFFI.xcframework.zip",
checksum: "3149f9060ebc66313f91bcd67303ad41272407fa51b56b19fb999e6500ef83ab"),
.testTarget(
name: "BitwardenSdkTests",
dependencies: ["BitwardenSdk"])
2,732 changes: 2,114 additions & 618 deletions Sources/BitwardenSdk/BitwardenCore.swift

Large diffs are not rendered by default.

195 changes: 114 additions & 81 deletions Sources/BitwardenSdk/BitwardenCrypto.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!

// swiftlint:disable all
import Foundation

// Depending on the consumer's build setup, the low-level FFI code
@@ -18,6 +20,10 @@ fileprivate extension RustBuffer {
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}

static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len:0, data: nil)
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_bitwarden_crypto_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
@@ -220,9 +226,17 @@ fileprivate enum UniffiInternalError: LocalizedError {
}
}

fileprivate extension NSLock {
func withLock<T>(f: () throws -> T) rethrows -> T {
self.lock()
defer { self.unlock() }
return try f()
}
}

fileprivate let CALL_SUCCESS: Int8 = 0
fileprivate let CALL_ERROR: Int8 = 1
fileprivate let CALL_PANIC: Int8 = 2
fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2
fileprivate let CALL_CANCELLED: Int8 = 3

fileprivate extension RustCallStatus {
@@ -275,7 +289,7 @@ private func uniffiCheckCallStatus(
throw UniffiInternalError.unexpectedRustCallError
}

case CALL_PANIC:
case CALL_UNEXPECTED_ERROR:
// When the rust code sees a panic, it tries to construct a RustBuffer
// with the message. But if that code panics, then it just sends back
// an empty buffer.
@@ -294,6 +308,76 @@ private func uniffiCheckCallStatus(
}
}

private func uniffiTraitInterfaceCall<T>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> ()
) {
do {
try writeReturn(makeCall())
} catch let error {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}

private func uniffiTraitInterfaceCallWithError<T, E>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> (),
lowerError: (E) -> RustBuffer
) {
do {
try writeReturn(makeCall())
} catch let error as E {
callStatus.pointee.code = CALL_ERROR
callStatus.pointee.errorBuf = lowerError(error)
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
fileprivate class UniffiHandleMap<T> {
private var map: [UInt64: T] = [:]
private let lock = NSLock()
private var currentHandle: UInt64 = 1

func insert(obj: T) -> UInt64 {
lock.withLock {
let handle = currentHandle
currentHandle += 1
map[handle] = obj
return handle
}
}

func get(handle: UInt64) throws -> T {
try lock.withLock {
guard let obj = map[handle] else {
throw UniffiInternalError.unexpectedStaleHandle
}
return obj
}
}

@discardableResult
func remove(handle: UInt64) throws -> T {
try lock.withLock {
guard let obj = map.removeValue(forKey: handle) else {
throw UniffiInternalError.unexpectedStaleHandle
}
return obj
}
}

var count: Int {
get {
map.count
}
}
}


// Public interface members begin here.


@@ -369,18 +453,17 @@ public struct RsaKeyPair {
public init(
/**
* Base64 encoded DER representation of the public key
*/
`public`: String,
*/`public`: String,
/**
* Encrypted PKCS8 private key
*/
`private`: EncString) {
*/`private`: EncString) {
self.`public` = `public`
self.`private` = `private`
}
}



extension RsaKeyPair: Equatable, Hashable {
public static func ==(lhs: RsaKeyPair, rhs: RsaKeyPair) -> Bool {
if lhs.`public` != rhs.`public` {
@@ -424,59 +507,6 @@ public func FfiConverterTypeRsaKeyPair_lower(_ value: RsaKeyPair) -> RustBuffer
}


/**
* Uniffi doesn't seem to be generating the SensitiveString unless it's being used by
* a record somewhere. This is a workaround to make sure the type is generated.
*/
public struct SupportSensitiveString {
public let sensitiveString: SensitiveString

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(
sensitiveString: SensitiveString) {
self.sensitiveString = sensitiveString
}
}


extension SupportSensitiveString: Equatable, Hashable {
public static func ==(lhs: SupportSensitiveString, rhs: SupportSensitiveString) -> Bool {
if lhs.sensitiveString != rhs.sensitiveString {
return false
}
return true
}

public func hash(into hasher: inout Hasher) {
hasher.combine(sensitiveString)
}
}


public struct FfiConverterTypeSupportSensitiveString: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SupportSensitiveString {
return
try SupportSensitiveString(
sensitiveString: FfiConverterTypeSensitiveString.read(from: &buf)
)
}

public static func write(_ value: SupportSensitiveString, into buf: inout [UInt8]) {
FfiConverterTypeSensitiveString.write(value.sensitiveString, into: &buf)
}
}


public func FfiConverterTypeSupportSensitiveString_lift(_ buf: RustBuffer) throws -> SupportSensitiveString {
return try FfiConverterTypeSupportSensitiveString.lift(buf)
}

public func FfiConverterTypeSupportSensitiveString_lower(_ value: SupportSensitiveString) -> RustBuffer {
return FfiConverterTypeSupportSensitiveString.lower(value)
}


public struct TrustDeviceResponse {
/**
* Base64 encoded device key
@@ -500,20 +530,16 @@ public struct TrustDeviceResponse {
public init(
/**
* Base64 encoded device key
*/
deviceKey: SensitiveString,
*/deviceKey: SensitiveString,
/**
* UserKey encrypted with DevicePublicKey
*/
protectedUserKey: AsymmetricEncString,
*/protectedUserKey: AsymmetricEncString,
/**
* DevicePrivateKey encrypted with [DeviceKey]
*/
protectedDevicePrivateKey: EncString,
*/protectedDevicePrivateKey: EncString,
/**
* DevicePublicKey encrypted with [UserKey](super::UserKey)
*/
protectedDevicePublicKey: EncString) {
*/protectedDevicePublicKey: EncString) {
self.deviceKey = deviceKey
self.protectedUserKey = protectedUserKey
self.protectedDevicePrivateKey = protectedDevicePrivateKey
@@ -522,6 +548,7 @@ public struct TrustDeviceResponse {
}



extension TrustDeviceResponse: Equatable, Hashable {
public static func ==(lhs: TrustDeviceResponse, rhs: TrustDeviceResponse) -> Bool {
if lhs.deviceKey != rhs.deviceKey {
@@ -578,12 +605,14 @@ public func FfiConverterTypeTrustDeviceResponse_lower(_ value: TrustDeviceRespon

// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

public enum HashPurpose {

case serverAuthorization
case localAuthorization
}


public struct FfiConverterTypeHashPurpose: FfiConverterRustBuffer {
typealias SwiftType = HashPurpose

@@ -624,39 +653,40 @@ public func FfiConverterTypeHashPurpose_lower(_ value: HashPurpose) -> RustBuffe
}



extension HashPurpose: Equatable, Hashable {}



// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
/**
* Key Derivation Function for Bitwarden Account
*
* In Bitwarden accounts can use multiple KDFs to derive their master key from their password. This
* Enum represents all the possible KDFs.
*/

public enum Kdf {

case pbkdf2(
iterations: NonZeroU32
case pbkdf2(iterations: NonZeroU32
)
case argon2id(
iterations: NonZeroU32,
memory: NonZeroU32,
parallelism: NonZeroU32
case argon2id(iterations: NonZeroU32, memory: NonZeroU32, parallelism: NonZeroU32
)
}


public struct FfiConverterTypeKdf: FfiConverterRustBuffer {
typealias SwiftType = Kdf

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Kdf {
let variant: Int32 = try readInt(&buf)
switch variant {

case 1: return .pbkdf2(
iterations: try FfiConverterTypeNonZeroU32.read(from: &buf)
case 1: return .pbkdf2(iterations: try FfiConverterTypeNonZeroU32.read(from: &buf)
)

case 2: return .argon2id(
iterations: try FfiConverterTypeNonZeroU32.read(from: &buf),
memory: try FfiConverterTypeNonZeroU32.read(from: &buf),
parallelism: try FfiConverterTypeNonZeroU32.read(from: &buf)
case 2: return .argon2id(iterations: try FfiConverterTypeNonZeroU32.read(from: &buf), memory: try FfiConverterTypeNonZeroU32.read(from: &buf), parallelism: try FfiConverterTypeNonZeroU32.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
@@ -692,6 +722,7 @@ public func FfiConverterTypeKdf_lower(_ value: Kdf) -> RustBuffer {
}



extension Kdf: Equatable, Hashable {}


@@ -841,7 +872,7 @@ private enum InitializationResult {
// the code inside is only computed once.
private var initializationResult: InitializationResult {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 25
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
let scaffolding_contract_version = ffi_bitwarden_crypto_uniffi_contract_version()
if bindings_contract_version != scaffolding_contract_version {
@@ -860,4 +891,6 @@ private func uniffiEnsureInitialized() {
case .apiChecksumMismatch:
fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
}
}

// swiftlint:enable all
235 changes: 141 additions & 94 deletions Sources/BitwardenSdk/BitwardenGenerators.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// This file was autogenerated by some hot garbage in the `uniffi` crate.
// Trust me, you don't want to mess with it!

// swiftlint:disable all
import Foundation

// Depending on the consumer's build setup, the low-level FFI code
@@ -18,6 +20,10 @@ fileprivate extension RustBuffer {
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}

static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len:0, data: nil)
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_bitwarden_generators_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
@@ -220,9 +226,17 @@ fileprivate enum UniffiInternalError: LocalizedError {
}
}

fileprivate extension NSLock {
func withLock<T>(f: () throws -> T) rethrows -> T {
self.lock()
defer { self.unlock() }
return try f()
}
}

fileprivate let CALL_SUCCESS: Int8 = 0
fileprivate let CALL_ERROR: Int8 = 1
fileprivate let CALL_PANIC: Int8 = 2
fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2
fileprivate let CALL_CANCELLED: Int8 = 3

fileprivate extension RustCallStatus {
@@ -275,7 +289,7 @@ private func uniffiCheckCallStatus(
throw UniffiInternalError.unexpectedRustCallError
}

case CALL_PANIC:
case CALL_UNEXPECTED_ERROR:
// When the rust code sees a panic, it tries to construct a RustBuffer
// with the message. But if that code panics, then it just sends back
// an empty buffer.
@@ -294,6 +308,76 @@ private func uniffiCheckCallStatus(
}
}

private func uniffiTraitInterfaceCall<T>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> ()
) {
do {
try writeReturn(makeCall())
} catch let error {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}

private func uniffiTraitInterfaceCallWithError<T, E>(
callStatus: UnsafeMutablePointer<RustCallStatus>,
makeCall: () throws -> T,
writeReturn: (T) -> (),
lowerError: (E) -> RustBuffer
) {
do {
try writeReturn(makeCall())
} catch let error as E {
callStatus.pointee.code = CALL_ERROR
callStatus.pointee.errorBuf = lowerError(error)
} catch {
callStatus.pointee.code = CALL_UNEXPECTED_ERROR
callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error))
}
}
fileprivate class UniffiHandleMap<T> {
private var map: [UInt64: T] = [:]
private let lock = NSLock()
private var currentHandle: UInt64 = 1

func insert(obj: T) -> UInt64 {
lock.withLock {
let handle = currentHandle
currentHandle += 1
map[handle] = obj
return handle
}
}

func get(handle: UInt64) throws -> T {
try lock.withLock {
guard let obj = map[handle] else {
throw UniffiInternalError.unexpectedStaleHandle
}
return obj
}
}

@discardableResult
func remove(handle: UInt64) throws -> T {
try lock.withLock {
guard let obj = map.removeValue(forKey: handle) else {
throw UniffiInternalError.unexpectedStaleHandle
}
return obj
}
}

var count: Int {
get {
map.count
}
}
}


// Public interface members begin here.


@@ -399,21 +483,17 @@ public struct PassphraseGeneratorRequest {
/**
* Number of words in the generated passphrase.
* This value must be between 3 and 20.
*/
numWords: UInt8,
*/numWords: UInt8,
/**
* Character separator between words in the generated passphrase. The value cannot be empty.
*/
wordSeparator: String,
*/wordSeparator: String,
/**
* When set to true, capitalize the first letter of each word in the generated passphrase.
*/
capitalize: Bool,
*/capitalize: Bool,
/**
* When set to true, include a number at the end of one of the words in the generated
* passphrase.
*/
includeNumber: Bool) {
*/includeNumber: Bool) {
self.numWords = numWords
self.wordSeparator = wordSeparator
self.capitalize = capitalize
@@ -422,6 +502,7 @@ public struct PassphraseGeneratorRequest {
}



extension PassphraseGeneratorRequest: Equatable, Hashable {
public static func ==(lhs: PassphraseGeneratorRequest, rhs: PassphraseGeneratorRequest) -> Bool {
if lhs.numWords != rhs.numWords {
@@ -533,50 +614,40 @@ public struct PasswordGeneratorRequest {
public init(
/**
* Include lowercase characters (a-z).
*/
lowercase: Bool,
*/lowercase: Bool,
/**
* Include uppercase characters (A-Z).
*/
uppercase: Bool,
*/uppercase: Bool,
/**
* Include numbers (0-9).
*/
numbers: Bool,
*/numbers: Bool,
/**
* Include special characters: ! @ # $ % ^ & *
*/
special: Bool,
*/special: Bool,
/**
* The length of the generated password.
* Note that the password length must be greater than the sum of all the minimums.
*/
length: UInt8,
*/length: UInt8,
/**
* When set to true, the generated password will not contain ambiguous characters.
* The ambiguous characters are: I, O, l, 0, 1
*/
avoidAmbiguous: Bool,
*/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
*/
minLowercase: UInt8?,
*/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
*/
minUppercase: UInt8?,
*/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
*/
minNumber: UInt8?,
*/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
*/
minSpecial: UInt8?) {
*/minSpecial: UInt8?) {
self.lowercase = lowercase
self.uppercase = uppercase
self.numbers = numbers
@@ -591,6 +662,7 @@ public struct PasswordGeneratorRequest {
}



extension PasswordGeneratorRequest: Equatable, Hashable {
public static func ==(lhs: PasswordGeneratorRequest, rhs: PasswordGeneratorRequest) -> Bool {
if lhs.lowercase != rhs.lowercase {
@@ -683,6 +755,7 @@ public func FfiConverterTypePasswordGeneratorRequest_lower(_ value: PasswordGene

// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

public enum AppendType {

/**
@@ -692,11 +765,11 @@ public enum AppendType {
/**
* Uses the websitename as part of your username
*/
case websiteName(
website: String
case websiteName(website: String
)
}


public struct FfiConverterTypeAppendType: FfiConverterRustBuffer {
typealias SwiftType = AppendType

@@ -706,8 +779,7 @@ public struct FfiConverterTypeAppendType: FfiConverterRustBuffer {

case 1: return .random

case 2: return .websiteName(
website: try FfiConverterString.read(from: &buf)
case 2: return .websiteName(website: try FfiConverterString.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
@@ -740,6 +812,7 @@ public func FfiConverterTypeAppendType_lower(_ value: AppendType) -> RustBuffer
}



extension AppendType: Equatable, Hashable {}


@@ -751,66 +824,50 @@ extension AppendType: Equatable, Hashable {}
* For instructions on how to configure each service, see the documentation:
* <https://bitwarden.com/help/generator/#username-types>
*/

public enum ForwarderServiceType {

/**
* Previously known as "AnonAddy"
*/
case addyIo(
apiToken: String,
domain: String,
baseUrl: String
case addyIo(apiToken: String, domain: String, baseUrl: String
)
case duckDuckGo(
token: String
case duckDuckGo(token: String
)
case firefox(
apiToken: String
case firefox(apiToken: String
)
case fastmail(
apiToken: String
case fastmail(apiToken: String
)
case forwardEmail(
apiToken: String,
domain: String
case forwardEmail(apiToken: String, domain: String
)
case simpleLogin(
apiKey: String
case simpleLogin(apiKey: String
)
}


public struct FfiConverterTypeForwarderServiceType: FfiConverterRustBuffer {
typealias SwiftType = ForwarderServiceType

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ForwarderServiceType {
let variant: Int32 = try readInt(&buf)
switch variant {

case 1: return .addyIo(
apiToken: try FfiConverterString.read(from: &buf),
domain: try FfiConverterString.read(from: &buf),
baseUrl: try FfiConverterString.read(from: &buf)
case 1: return .addyIo(apiToken: try FfiConverterString.read(from: &buf), domain: try FfiConverterString.read(from: &buf), baseUrl: try FfiConverterString.read(from: &buf)
)

case 2: return .duckDuckGo(
token: try FfiConverterString.read(from: &buf)
case 2: return .duckDuckGo(token: try FfiConverterString.read(from: &buf)
)

case 3: return .firefox(
apiToken: try FfiConverterString.read(from: &buf)
case 3: return .firefox(apiToken: try FfiConverterString.read(from: &buf)
)

case 4: return .fastmail(
apiToken: try FfiConverterString.read(from: &buf)
case 4: return .fastmail(apiToken: try FfiConverterString.read(from: &buf)
)

case 5: return .forwardEmail(
apiToken: try FfiConverterString.read(from: &buf),
domain: try FfiConverterString.read(from: &buf)
case 5: return .forwardEmail(apiToken: try FfiConverterString.read(from: &buf), domain: try FfiConverterString.read(from: &buf)
)

case 6: return .simpleLogin(
apiKey: try FfiConverterString.read(from: &buf)
case 6: return .simpleLogin(apiKey: try FfiConverterString.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
@@ -867,12 +924,14 @@ public func FfiConverterTypeForwarderServiceType_lower(_ value: ForwarderService
}



extension ForwarderServiceType: Equatable, Hashable {}



// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

public enum UsernameGeneratorRequest {

/**
@@ -881,12 +940,10 @@ public enum UsernameGeneratorRequest {
case word(
/**
* Capitalize the first letter of the word
*/
capitalize: Bool,
*/capitalize: Bool,
/**
* Include a 4 digit number at the end of the word
*/
includeNumber: Bool
*/includeNumber: Bool
)
/**
* Generates an email using your provider's subaddressing capabilities.
@@ -896,62 +953,49 @@ public enum UsernameGeneratorRequest {
case subaddress(
/**
* The type of subaddress to add to the base email
*/
type: AppendType,
*/type: AppendType,
/**
* The full email address to use as the base for the subaddress
*/
email: String
*/email: String
)
case catchall(
/**
* The type of username to use with the catchall email domain
*/
type: AppendType,
*/type: AppendType,
/**
* The domain to use for the catchall email address
*/
domain: String
*/domain: String
)
case forwarded(
/**
* The email forwarding service to use, see [ForwarderServiceType]
* for instructions on how to configure each
*/
service: ForwarderServiceType,
*/service: ForwarderServiceType,
/**
* The website for which the email address is being generated
* This is not used in all services, and is only used for display purposes
*/
website: String?
*/website: String?
)
}


public struct FfiConverterTypeUsernameGeneratorRequest: FfiConverterRustBuffer {
typealias SwiftType = UsernameGeneratorRequest

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UsernameGeneratorRequest {
let variant: Int32 = try readInt(&buf)
switch variant {

case 1: return .word(
capitalize: try FfiConverterBool.read(from: &buf),
includeNumber: try FfiConverterBool.read(from: &buf)
case 1: return .word(capitalize: try FfiConverterBool.read(from: &buf), includeNumber: try FfiConverterBool.read(from: &buf)
)

case 2: return .subaddress(
type: try FfiConverterTypeAppendType.read(from: &buf),
email: try FfiConverterString.read(from: &buf)
case 2: return .subaddress(type: try FfiConverterTypeAppendType.read(from: &buf), email: try FfiConverterString.read(from: &buf)
)

case 3: return .catchall(
type: try FfiConverterTypeAppendType.read(from: &buf),
domain: try FfiConverterString.read(from: &buf)
case 3: return .catchall(type: try FfiConverterTypeAppendType.read(from: &buf), domain: try FfiConverterString.read(from: &buf)
)

case 4: return .forwarded(
service: try FfiConverterTypeForwarderServiceType.read(from: &buf),
website: try FfiConverterOptionString.read(from: &buf)
case 4: return .forwarded(service: try FfiConverterTypeForwarderServiceType.read(from: &buf), website: try FfiConverterOptionString.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
@@ -999,6 +1043,7 @@ public func FfiConverterTypeUsernameGeneratorRequest_lower(_ value: UsernameGene
}



extension UsernameGeneratorRequest: Equatable, Hashable {}


@@ -1054,7 +1099,7 @@ private enum InitializationResult {
// the code inside is only computed once.
private var initializationResult: InitializationResult {
// Get the bindings contract version from our ComponentInterface
let bindings_contract_version = 25
let bindings_contract_version = 26
// Get the scaffolding contract version by calling the into the dylib
let scaffolding_contract_version = ffi_bitwarden_generators_uniffi_contract_version()
if bindings_contract_version != scaffolding_contract_version {
@@ -1073,4 +1118,6 @@ private func uniffiEnsureInitialized() {
case .apiChecksumMismatch:
fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
}
}

// swiftlint:enable all
2,948 changes: 2,250 additions & 698 deletions Sources/BitwardenSdk/BitwardenSDK.swift

Large diffs are not rendered by default.