Skip to content

Commit 677e157

Browse files
bitwarden/sdk-internal@b9cf7b7 2.0.0-3520-b9cf7b7 - Update CoreClient's BwHttpClient to include new default headers (bitwarden/sdk-internal#621)
1 parent 1cf6c3b commit 677e157

File tree

5 files changed

+47
-15
lines changed

5 files changed

+47
-15
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let package = Package(
3030
dependencies: ["BitwardenSdk"]),
3131
.binaryTarget(
3232
name: "BitwardenFFI",
33-
url: "https://github.com/bitwarden/sdk-swift/releases/download/v2.0.0-3514-fe36732/BitwardenFFI-2.0.0-fe36732.xcframework.zip",
34-
checksum: "1f5a37b7f195340cb80dc58116bf93cba58a60051cbd3e5aef694dea34f85df9")
33+
url: "https://github.com/bitwarden/sdk-swift/releases/download/v2.0.0-3520-b9cf7b7/BitwardenFFI-2.0.0-b9cf7b7.xcframework.zip",
34+
checksum: "1d51fdc8685eec6b7a9c91f9b79887e1c7cd2f2293966cacb51bb248ed669cc0")
3535
]
3636
)

Sources/BitwardenSdk/BitwardenCollections.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,8 @@ private let initializationResult: InitializationResult = {
998998
return InitializationResult.contractVersionMismatch
999999
}
10001000

1001-
uniffiEnsureBitwardenCoreInitialized()
10021001
uniffiEnsureBitwardenCryptoInitialized()
1002+
uniffiEnsureBitwardenCoreInitialized()
10031003
return InitializationResult.ok
10041004
}()
10051005

Sources/BitwardenSdk/BitwardenCore.swift

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,8 @@ public func FfiConverterTypeAuthRequestResponse_lower(_ value: AuthRequestRespon
910910
* user_agent: "Bitwarden Rust-SDK".to_string(),
911911
* device_type: DeviceType::SDK,
912912
* bitwarden_client_version: None,
913+
* bitwarden_package_type: None,
914+
* device_identifier: None,
913915
* };
914916
* let default = ClientSettings::default();
915917
* ```
@@ -932,9 +934,18 @@ public struct ClientSettings {
932934
*/
933935
public let deviceType: DeviceType
934936
/**
935-
* Bitwarden Client Version to send to Bitwarden.
937+
* Device identifier to send to Bitwarden. Optional for now in transition period.
938+
*/
939+
public let deviceIdentifier: String?
940+
/**
941+
* Bitwarden Client Version to send to Bitwarden. Optional for now in transition period.
936942
*/
937943
public let bitwardenClientVersion: String?
944+
/**
945+
* Bitwarden Package Type to send to Bitwarden. We should evaluate this field to see if it
946+
* should be optional later.
947+
*/
948+
public let bitwardenPackageType: String?
938949

939950
// Default memberwise initializers are never public by default, so we
940951
// declare one manually.
@@ -952,13 +963,22 @@ public struct ClientSettings {
952963
* Device type to send to Bitwarden. Defaults to SDK
953964
*/deviceType: DeviceType,
954965
/**
955-
* Bitwarden Client Version to send to Bitwarden.
956-
*/bitwardenClientVersion: String?) {
966+
* Device identifier to send to Bitwarden. Optional for now in transition period.
967+
*/deviceIdentifier: String?,
968+
/**
969+
* Bitwarden Client Version to send to Bitwarden. Optional for now in transition period.
970+
*/bitwardenClientVersion: String?,
971+
/**
972+
* Bitwarden Package Type to send to Bitwarden. We should evaluate this field to see if it
973+
* should be optional later.
974+
*/bitwardenPackageType: String?) {
957975
self.identityUrl = identityUrl
958976
self.apiUrl = apiUrl
959977
self.userAgent = userAgent
960978
self.deviceType = deviceType
979+
self.deviceIdentifier = deviceIdentifier
961980
self.bitwardenClientVersion = bitwardenClientVersion
981+
self.bitwardenPackageType = bitwardenPackageType
962982
}
963983
}
964984

@@ -984,9 +1004,15 @@ extension ClientSettings: Equatable, Hashable {
9841004
if lhs.deviceType != rhs.deviceType {
9851005
return false
9861006
}
1007+
if lhs.deviceIdentifier != rhs.deviceIdentifier {
1008+
return false
1009+
}
9871010
if lhs.bitwardenClientVersion != rhs.bitwardenClientVersion {
9881011
return false
9891012
}
1013+
if lhs.bitwardenPackageType != rhs.bitwardenPackageType {
1014+
return false
1015+
}
9901016
return true
9911017
}
9921018

@@ -995,7 +1021,9 @@ extension ClientSettings: Equatable, Hashable {
9951021
hasher.combine(apiUrl)
9961022
hasher.combine(userAgent)
9971023
hasher.combine(deviceType)
1024+
hasher.combine(deviceIdentifier)
9981025
hasher.combine(bitwardenClientVersion)
1026+
hasher.combine(bitwardenPackageType)
9991027
}
10001028
}
10011029

@@ -1012,7 +1040,9 @@ public struct FfiConverterTypeClientSettings: FfiConverterRustBuffer {
10121040
apiUrl: FfiConverterString.read(from: &buf),
10131041
userAgent: FfiConverterString.read(from: &buf),
10141042
deviceType: FfiConverterTypeDeviceType.read(from: &buf),
1015-
bitwardenClientVersion: FfiConverterOptionString.read(from: &buf)
1043+
deviceIdentifier: FfiConverterOptionString.read(from: &buf),
1044+
bitwardenClientVersion: FfiConverterOptionString.read(from: &buf),
1045+
bitwardenPackageType: FfiConverterOptionString.read(from: &buf)
10161046
)
10171047
}
10181048

@@ -1021,7 +1051,9 @@ public struct FfiConverterTypeClientSettings: FfiConverterRustBuffer {
10211051
FfiConverterString.write(value.apiUrl, into: &buf)
10221052
FfiConverterString.write(value.userAgent, into: &buf)
10231053
FfiConverterTypeDeviceType.write(value.deviceType, into: &buf)
1054+
FfiConverterOptionString.write(value.deviceIdentifier, into: &buf)
10241055
FfiConverterOptionString.write(value.bitwardenClientVersion, into: &buf)
1056+
FfiConverterOptionString.write(value.bitwardenPackageType, into: &buf)
10251057
}
10261058
}
10271059

@@ -5429,8 +5461,8 @@ private let initializationResult: InitializationResult = {
54295461
}
54305462

54315463
uniffiCallbackInitClientManagedTokens()
5432-
uniffiEnsureBitwardenCryptoInitialized()
54335464
uniffiEnsureBitwardenEncodingInitialized()
5465+
uniffiEnsureBitwardenCryptoInitialized()
54345466
return InitializationResult.ok
54355467
}()
54365468

Sources/BitwardenSdk/BitwardenSDK.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8246,17 +8246,17 @@ private let initializationResult: InitializationResult = {
82468246
uniffiCallbackInitFido2CredentialStore()
82478247
uniffiCallbackInitFido2UserInterface()
82488248
uniffiCallbackInitFolderRepository()
8249+
uniffiEnsureBitwardenVaultInitialized()
8250+
uniffiEnsureBitwardenFidoInitialized()
8251+
uniffiEnsureBitwardenCryptoInitialized()
8252+
uniffiEnsureBitwardenExportersInitialized()
82498253
uniffiEnsureBitwardenSshInitialized()
8250-
uniffiEnsureBitwardenStateInitialized()
82518254
uniffiEnsureBitwardenEncodingInitialized()
82528255
uniffiEnsureBitwardenSendInitialized()
8253-
uniffiEnsureBitwardenExportersInitialized()
8254-
uniffiEnsureBitwardenCryptoInitialized()
8255-
uniffiEnsureBitwardenCoreInitialized()
82568256
uniffiEnsureBitwardenCollectionsInitialized()
8257-
uniffiEnsureBitwardenVaultInitialized()
82588257
uniffiEnsureBitwardenGeneratorsInitialized()
8259-
uniffiEnsureBitwardenFidoInitialized()
8258+
uniffiEnsureBitwardenCoreInitialized()
8259+
uniffiEnsureBitwardenStateInitialized()
82608260
return InitializationResult.ok
82618261
}()
82628262

Sources/BitwardenSdk/BitwardenVault.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9142,9 +9142,9 @@ private let initializationResult: InitializationResult = {
91429142
return InitializationResult.contractVersionMismatch
91439143
}
91449144

9145+
uniffiEnsureBitwardenCoreInitialized()
91459146
uniffiEnsureBitwardenCryptoInitialized()
91469147
uniffiEnsureBitwardenCollectionsInitialized()
9147-
uniffiEnsureBitwardenCoreInitialized()
91489148
return InitializationResult.ok
91499149
}()
91509150

0 commit comments

Comments
 (0)