Skip to content

Commit 977e656

Browse files
bitwarden/sdk-internal@21432b5 1.0.0-2892-21432b5 - [PM-25012] Add data field to Cipher type, and add functions for client-side parsing of the field. (bitwarden/sdk-internal#517)
1 parent fa64d7c commit 977e656

File tree

4 files changed

+35
-11
lines changed

4 files changed

+35
-11
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-2878-8ef7951/BitwardenFFI-1.0.0-8ef7951.xcframework.zip",
34-
checksum: "a79e664aeb61802e68290c0f599764bbf45305689682e078a198213f0166fbf7")
33+
url: "https://github.com/bitwarden/sdk-swift/releases/download/v1.0.0-2892-21432b5/BitwardenFFI-1.0.0-21432b5.xcframework.zip",
34+
checksum: "ce11a13ea9a8211ee2f332f684919d0827da542aadb9d9b4fecb5463a4b0b428")
3535
]
3636
)

Sources/BitwardenSdk/BitwardenSDK.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8176,17 +8176,17 @@ private let initializationResult: InitializationResult = {
81768176
uniffiCallbackInitFido2CredentialStore()
81778177
uniffiCallbackInitFido2UserInterface()
81788178
uniffiCallbackInitFolderRepository()
8179-
uniffiEnsureBitwardenCryptoInitialized()
81808179
uniffiEnsureBitwardenCoreInitialized()
8181-
uniffiEnsureBitwardenCollectionsInitialized()
81828180
uniffiEnsureBitwardenFidoInitialized()
8181+
uniffiEnsureBitwardenVaultInitialized()
81838182
uniffiEnsureBitwardenExportersInitialized()
81848183
uniffiEnsureBitwardenGeneratorsInitialized()
8185-
uniffiEnsureBitwardenVaultInitialized()
81868184
uniffiEnsureBitwardenSshInitialized()
8187-
uniffiEnsureBitwardenStateInitialized()
8188-
uniffiEnsureBitwardenSendInitialized()
8185+
uniffiEnsureBitwardenCollectionsInitialized()
81898186
uniffiEnsureBitwardenEncodingInitialized()
8187+
uniffiEnsureBitwardenSendInitialized()
8188+
uniffiEnsureBitwardenCryptoInitialized()
8189+
uniffiEnsureBitwardenStateInitialized()
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-
uniffiEnsureBitwardenCryptoInitialized()
20352034
uniffiEnsureBitwardenCoreInitialized()
2035+
uniffiEnsureBitwardenCryptoInitialized()
20362036
return InitializationResult.ok
20372037
}()
20382038

Sources/BitwardenSdk/BitwardenVault.swift

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,14 +1240,15 @@ public struct Cipher {
12401240
public let deletedDate: DateTime?
12411241
public let revisionDate: DateTime
12421242
public let archivedDate: DateTime?
1243+
public let data: String?
12431244

12441245
// Default memberwise initializers are never public by default, so we
12451246
// declare one manually.
12461247
public init(id: CipherId?, organizationId: OrganizationId?, folderId: FolderId?, collectionIds: [CollectionId],
12471248
/**
12481249
* More recent ciphers uses individual encryption keys to encrypt the other fields of the
12491250
* Cipher.
1250-
*/key: EncString?, name: EncString, notes: EncString?, type: CipherType, login: Login?, identity: Identity?, card: Card?, secureNote: SecureNote?, sshKey: SshKey?, favorite: Bool, reprompt: CipherRepromptType, organizationUseTotp: Bool, edit: Bool, permissions: CipherPermissions?, viewPassword: Bool, localData: LocalData?, attachments: [Attachment]?, fields: [Field]?, passwordHistory: [PasswordHistory]?, creationDate: DateTime, deletedDate: DateTime?, revisionDate: DateTime, archivedDate: DateTime?) {
1251+
*/key: EncString?, name: EncString, notes: EncString?, type: CipherType, login: Login?, identity: Identity?, card: Card?, secureNote: SecureNote?, sshKey: SshKey?, favorite: Bool, reprompt: CipherRepromptType, organizationUseTotp: Bool, edit: Bool, permissions: CipherPermissions?, viewPassword: Bool, localData: LocalData?, attachments: [Attachment]?, fields: [Field]?, passwordHistory: [PasswordHistory]?, creationDate: DateTime, deletedDate: DateTime?, revisionDate: DateTime, archivedDate: DateTime?, data: String?) {
12511252
self.id = id
12521253
self.organizationId = organizationId
12531254
self.folderId = folderId
@@ -1275,6 +1276,7 @@ public struct Cipher {
12751276
self.deletedDate = deletedDate
12761277
self.revisionDate = revisionDate
12771278
self.archivedDate = archivedDate
1279+
self.data = data
12781280
}
12791281
}
12801282

@@ -1369,6 +1371,9 @@ extension Cipher: Equatable, Hashable {
13691371
if lhs.archivedDate != rhs.archivedDate {
13701372
return false
13711373
}
1374+
if lhs.data != rhs.data {
1375+
return false
1376+
}
13721377
return true
13731378
}
13741379

@@ -1400,6 +1405,7 @@ extension Cipher: Equatable, Hashable {
14001405
hasher.combine(deletedDate)
14011406
hasher.combine(revisionDate)
14021407
hasher.combine(archivedDate)
1408+
hasher.combine(data)
14031409
}
14041410
}
14051411

@@ -1438,7 +1444,8 @@ public struct FfiConverterTypeCipher: FfiConverterRustBuffer {
14381444
creationDate: FfiConverterTypeDateTime.read(from: &buf),
14391445
deletedDate: FfiConverterOptionTypeDateTime.read(from: &buf),
14401446
revisionDate: FfiConverterTypeDateTime.read(from: &buf),
1441-
archivedDate: FfiConverterOptionTypeDateTime.read(from: &buf)
1447+
archivedDate: FfiConverterOptionTypeDateTime.read(from: &buf),
1448+
data: FfiConverterOptionString.read(from: &buf)
14421449
)
14431450
}
14441451

@@ -1470,6 +1477,7 @@ public struct FfiConverterTypeCipher: FfiConverterRustBuffer {
14701477
FfiConverterOptionTypeDateTime.write(value.deletedDate, into: &buf)
14711478
FfiConverterTypeDateTime.write(value.revisionDate, into: &buf)
14721479
FfiConverterOptionTypeDateTime.write(value.archivedDate, into: &buf)
1480+
FfiConverterOptionString.write(value.data, into: &buf)
14731481
}
14741482
}
14751483

@@ -5565,6 +5573,10 @@ public enum CipherError: Swift.Error {
55655573

55665574
case AttachmentsWithoutKeys(message: String)
55675575

5576+
case Chrono(message: String)
5577+
5578+
case SerdeJson(message: String)
5579+
55685580
}
55695581

55705582

@@ -5597,6 +5609,14 @@ public struct FfiConverterTypeCipherError: FfiConverterRustBuffer {
55975609
message: try FfiConverterString.read(from: &buf)
55985610
)
55995611

5612+
case 5: return .Chrono(
5613+
message: try FfiConverterString.read(from: &buf)
5614+
)
5615+
5616+
case 6: return .SerdeJson(
5617+
message: try FfiConverterString.read(from: &buf)
5618+
)
5619+
56005620

56015621
default: throw UniffiInternalError.unexpectedEnumCase
56025622
}
@@ -5616,6 +5636,10 @@ public struct FfiConverterTypeCipherError: FfiConverterRustBuffer {
56165636
writeInt(&buf, Int32(3))
56175637
case .AttachmentsWithoutKeys(_ /* message is ignored*/):
56185638
writeInt(&buf, Int32(4))
5639+
case .Chrono(_ /* message is ignored*/):
5640+
writeInt(&buf, Int32(5))
5641+
case .SerdeJson(_ /* message is ignored*/):
5642+
writeInt(&buf, Int32(6))
56195643

56205644

56215645
}
@@ -9078,9 +9102,9 @@ private let initializationResult: InitializationResult = {
90789102
return InitializationResult.contractVersionMismatch
90799103
}
90809104

9081-
uniffiEnsureBitwardenCollectionsInitialized()
90829105
uniffiEnsureBitwardenCoreInitialized()
90839106
uniffiEnsureBitwardenCryptoInitialized()
9107+
uniffiEnsureBitwardenCollectionsInitialized()
90849108
return InitializationResult.ok
90859109
}()
90869110

0 commit comments

Comments
 (0)