Skip to content

Commit 8c78fd3

Browse files
bitwarden/sdk-internal@29c09d4 1.0.0-2743-29c09d4 - Add headers Client-Name and Client-Version (bitwarden/sdk-internal#471)
1 parent 8266e16 commit 8c78fd3

File tree

6 files changed

+36
-14
lines changed

6 files changed

+36
-14
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/v1.0.0-2742-fc75b90/BitwardenFFI-1.0.0-fc75b90.xcframework.zip",
34-
checksum: "a781e7f84667247a95b4d65a629da91412b518ca15f743735f4c8c15e3a3b6f8")
33+
url: "https://github.com/bitwarden/sdk-swift/releases/download/v1.0.0-2743-29c09d4/BitwardenFFI-1.0.0-29c09d4.xcframework.zip",
34+
checksum: "d68682d65a6797667a324c9864b7b96c39349553cef6c5fbdacb5333045e5233")
3535
]
3636
)

Sources/BitwardenSdk/BitwardenCore.swift

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,7 @@ public func FfiConverterTypeAuthRequestResponse_lower(_ value: AuthRequestRespon
909909
* api_url: "https://api.bitwarden.com".to_string(),
910910
* user_agent: "Bitwarden Rust-SDK".to_string(),
911911
* device_type: DeviceType::SDK,
912+
* bitwarden_client_version: None,
912913
* };
913914
* let default = ClientSettings::default();
914915
* ```
@@ -930,6 +931,10 @@ public struct ClientSettings {
930931
* Device type to send to Bitwarden. Defaults to SDK
931932
*/
932933
public let deviceType: DeviceType
934+
/**
935+
* Bitwarden Client Version to send to Bitwarden.
936+
*/
937+
public let bitwardenClientVersion: String?
933938

934939
// Default memberwise initializers are never public by default, so we
935940
// declare one manually.
@@ -945,11 +950,15 @@ public struct ClientSettings {
945950
*/userAgent: String,
946951
/**
947952
* Device type to send to Bitwarden. Defaults to SDK
948-
*/deviceType: DeviceType) {
953+
*/deviceType: DeviceType,
954+
/**
955+
* Bitwarden Client Version to send to Bitwarden.
956+
*/bitwardenClientVersion: String?) {
949957
self.identityUrl = identityUrl
950958
self.apiUrl = apiUrl
951959
self.userAgent = userAgent
952960
self.deviceType = deviceType
961+
self.bitwardenClientVersion = bitwardenClientVersion
953962
}
954963
}
955964

@@ -975,6 +984,9 @@ extension ClientSettings: Equatable, Hashable {
975984
if lhs.deviceType != rhs.deviceType {
976985
return false
977986
}
987+
if lhs.bitwardenClientVersion != rhs.bitwardenClientVersion {
988+
return false
989+
}
978990
return true
979991
}
980992

@@ -983,6 +995,7 @@ extension ClientSettings: Equatable, Hashable {
983995
hasher.combine(apiUrl)
984996
hasher.combine(userAgent)
985997
hasher.combine(deviceType)
998+
hasher.combine(bitwardenClientVersion)
986999
}
9871000
}
9881001

@@ -998,7 +1011,8 @@ public struct FfiConverterTypeClientSettings: FfiConverterRustBuffer {
9981011
identityUrl: FfiConverterString.read(from: &buf),
9991012
apiUrl: FfiConverterString.read(from: &buf),
10001013
userAgent: FfiConverterString.read(from: &buf),
1001-
deviceType: FfiConverterTypeDeviceType.read(from: &buf)
1014+
deviceType: FfiConverterTypeDeviceType.read(from: &buf),
1015+
bitwardenClientVersion: FfiConverterOptionString.read(from: &buf)
10021016
)
10031017
}
10041018

@@ -1007,6 +1021,7 @@ public struct FfiConverterTypeClientSettings: FfiConverterRustBuffer {
10071021
FfiConverterString.write(value.apiUrl, into: &buf)
10081022
FfiConverterString.write(value.userAgent, into: &buf)
10091023
FfiConverterTypeDeviceType.write(value.deviceType, into: &buf)
1024+
FfiConverterOptionString.write(value.bitwardenClientVersion, into: &buf)
10101025
}
10111026
}
10121027

@@ -3508,6 +3523,7 @@ public enum DeviceType {
35083523
case windowsCli
35093524
case macOsCli
35103525
case linuxCli
3526+
case duckDuckGoBrowser
35113527

35123528
}
35133529
#if compiler(>=6)
@@ -3576,6 +3592,8 @@ public struct FfiConverterTypeDeviceType: FfiConverterRustBuffer {
35763592

35773593
case 26: return .linuxCli
35783594

3595+
case 27: return .duckDuckGoBrowser
3596+
35793597
default: throw UniffiInternalError.unexpectedEnumCase
35803598
}
35813599
}
@@ -3687,6 +3705,10 @@ public struct FfiConverterTypeDeviceType: FfiConverterRustBuffer {
36873705
case .linuxCli:
36883706
writeInt(&buf, Int32(26))
36893707

3708+
3709+
case .duckDuckGoBrowser:
3710+
writeInt(&buf, Int32(27))
3711+
36903712
}
36913713
}
36923714
}
@@ -5161,8 +5183,8 @@ private let initializationResult: InitializationResult = {
51615183
}
51625184

51635185
uniffiCallbackInitClientManagedTokens()
5164-
uniffiEnsureBitwardenCryptoInitialized()
51655186
uniffiEnsureBitwardenEncodingInitialized()
5187+
uniffiEnsureBitwardenCryptoInitialized()
51665188
return InitializationResult.ok
51675189
}()
51685190

Sources/BitwardenSdk/BitwardenFido.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3384,8 +3384,8 @@ private let initializationResult: InitializationResult = {
33843384
return InitializationResult.contractVersionMismatch
33853385
}
33863386

3387-
uniffiEnsureBitwardenVaultInitialized()
33883387
uniffiEnsureBitwardenCoreInitialized()
3388+
uniffiEnsureBitwardenVaultInitialized()
33893389
return InitializationResult.ok
33903390
}()
33913391

Sources/BitwardenSdk/BitwardenSDK.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8176,17 +8176,17 @@ private let initializationResult: InitializationResult = {
81768176
uniffiCallbackInitFido2CredentialStore()
81778177
uniffiCallbackInitFido2UserInterface()
81788178
uniffiCallbackInitFolderRepository()
8179-
uniffiEnsureBitwardenCollectionsInitialized()
8180-
uniffiEnsureBitwardenFidoInitialized()
8179+
uniffiEnsureBitwardenVaultInitialized()
81818180
uniffiEnsureBitwardenCryptoInitialized()
81828181
uniffiEnsureBitwardenGeneratorsInitialized()
81838182
uniffiEnsureBitwardenCoreInitialized()
8184-
uniffiEnsureBitwardenSshInitialized()
8185-
uniffiEnsureBitwardenSendInitialized()
8186-
uniffiEnsureBitwardenEncodingInitialized()
81878183
uniffiEnsureBitwardenExportersInitialized()
8184+
uniffiEnsureBitwardenFidoInitialized()
8185+
uniffiEnsureBitwardenSendInitialized()
8186+
uniffiEnsureBitwardenSshInitialized()
8187+
uniffiEnsureBitwardenCollectionsInitialized()
81888188
uniffiEnsureBitwardenStateInitialized()
8189-
uniffiEnsureBitwardenVaultInitialized()
8189+
uniffiEnsureBitwardenEncodingInitialized()
81908190
return InitializationResult.ok
81918191
}()
81928192

Sources/BitwardenSdk/BitwardenSend.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2031,8 +2031,8 @@ private let initializationResult: InitializationResult = {
20312031
return InitializationResult.contractVersionMismatch
20322032
}
20332033

2034-
uniffiEnsureBitwardenCoreInitialized()
20352034
uniffiEnsureBitwardenCryptoInitialized()
2035+
uniffiEnsureBitwardenCoreInitialized()
20362036
return InitializationResult.ok
20372037
}()
20382038

Sources/BitwardenSdk/BitwardenVault.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7662,8 +7662,8 @@ private let initializationResult: InitializationResult = {
76627662
}
76637663

76647664
uniffiEnsureBitwardenCollectionsInitialized()
7665-
uniffiEnsureBitwardenCryptoInitialized()
76667665
uniffiEnsureBitwardenCoreInitialized()
7666+
uniffiEnsureBitwardenCryptoInitialized()
76677667
return InitializationResult.ok
76687668
}()
76697669

0 commit comments

Comments
 (0)