Updating SDK to f14c06f (1.0.0-2413-0eba924) (#1946)

Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com>
Co-authored-by: Álison Fernandes <vvolkgang@users.noreply.github.com>
Co-authored-by: Matt Czech <matt@livefront.com>
This commit is contained in:
bw-ghapp[bot] 2025-09-18 19:26:42 +01:00 committed by GitHub
parent 6d83b122ab
commit ca87c75381
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 142 additions and 23 deletions

View File

@ -44,6 +44,28 @@ class MockCryptoClient: CryptoClientProtocol {
var initializeUserCryptoRequest: InitUserCryptoRequest?
var initializeUserCryptoResult: Result<Void, Error> = .success(())
var makeUpdateKdfKdf: Kdf?
var makeUpdateKdfPassword: String?
var makeUpdateKdfResult: Result<UpdateKdfResponse, Error> = .success(
UpdateKdfResponse(
masterPasswordAuthenticationData: MasterPasswordAuthenticationData(
kdf: .pbkdf2(iterations: NonZeroU32(600_000)),
salt: "AUTHENTICATION_SALT",
masterPasswordAuthenticationHash: "MASTER_PASSWORD_AUTHENTICATION_HASH"
),
masterPasswordUnlockData: MasterPasswordUnlockData(
kdf: .pbkdf2(iterations: NonZeroU32(600_000)),
masterKeyWrappedUserKey: "MASTER_KEY_WRAPPED_USER_KEY",
salt: "UNLOCK_SALT"
),
oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData(
kdf: .pbkdf2(iterations: NonZeroU32(600_000)),
salt: "OLD_AUTHENTICATION_SALT",
masterPasswordAuthenticationHash: "MASTER_PASSWORD_AUTHENTICATION_HASH"
)
)
)
var updatePasswordNewPassword: String?
var updatePasswordResult: Result<UpdatePasswordResponse, Error> = .success(
UpdatePasswordResponse(
@ -95,6 +117,17 @@ class MockCryptoClient: CryptoClientProtocol {
return try initializeUserCryptoResult.get()
}
func makeUpdateKdf(password: String, kdf: Kdf) throws -> UpdateKdfResponse {
makeUpdateKdfPassword = password
makeUpdateKdfKdf = kdf
return try makeUpdateKdfResult.get()
}
func makeUpdatePassword(newPassword: String) throws -> UpdatePasswordResponse {
updatePasswordNewPassword = newPassword
return try updatePasswordResult.get()
}
func updatePassword(newPassword: String) throws -> BitwardenSdk.UpdatePasswordResponse {
updatePasswordNewPassword = newPassword
return try updatePasswordResult.get()

View File

@ -77,6 +77,7 @@ extension CipherListView {
creationDate: cipher.creationDate,
deletedDate: cipher.deletedDate,
revisionDate: cipher.revisionDate,
archivedDate: cipher.archivedDate,
copyableFields: [],
localData: cipher.localData.map(LocalDataView.init)
)
@ -138,7 +139,8 @@ extension Cipher {
passwordHistory: cipherView.passwordHistory?.map(PasswordHistory.init),
creationDate: cipherView.creationDate,
deletedDate: cipherView.deletedDate,
revisionDate: cipherView.revisionDate
revisionDate: cipherView.revisionDate,
archivedDate: cipherView.archivedDate
)
}
}
@ -171,7 +173,8 @@ extension CipherView {
passwordHistory: cipher.passwordHistory?.map(PasswordHistoryView.init),
creationDate: cipher.creationDate,
deletedDate: cipher.deletedDate,
revisionDate: cipher.revisionDate
revisionDate: cipher.revisionDate,
archivedDate: cipher.archivedDate
)
}
}

View File

@ -27,6 +27,7 @@ extension AttachmentView {
extension Cipher {
static func fixture(
archivedDate: Date? = nil,
attachments: [Attachment]? = nil,
card: Card? = nil,
collectionIds: [String] = [],
@ -80,13 +81,15 @@ extension Cipher {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
}
extension CipherView {
static func fixture(
archivedDate: Date? = nil,
attachments: [AttachmentView]? = nil,
card: CardView? = nil,
collectionIds: [String] = [],
@ -140,11 +143,13 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
static func cardFixture(
archivedDate: Date? = nil,
attachments: [AttachmentView]? = nil,
card: CardView = CardView.fixture(),
collectionIds: [String] = [],
@ -193,11 +198,13 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
static func loginFixture(
archivedDate: Date? = nil,
attachments: [AttachmentView]? = nil,
collectionIds: [String] = [],
creationDate: DateTime = Date(year: 2023, month: 11, day: 5, hour: 9, minute: 41),
@ -246,7 +253,8 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}

View File

@ -123,7 +123,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/bitwarden/sdk-swift",
"state" : {
"revision" : "bb36b4848c5006b4c14f53c07476d12e6f8708ef"
"revision" : "f14c06fd4f77b290dfd447aadd80a3bbc54da97c"
}
},
{

View File

@ -1,3 +1,4 @@
import BitwardenKit
import BitwardenSdk
@testable import BitwardenShared
@ -45,6 +46,28 @@ class MockCryptoClient: CryptoClientProtocol {
var initializeUserCryptoRequest: InitUserCryptoRequest?
var initializeUserCryptoResult: Result<Void, Error> = .success(())
var makeUpdateKdfKdf: Kdf?
var makeUpdateKdfPassword: String?
var makeUpdateKdfResult: Result<UpdateKdfResponse, Error> = .success(
UpdateKdfResponse(
masterPasswordAuthenticationData: MasterPasswordAuthenticationData(
kdf: .pbkdf2(iterations: NonZeroU32(Constants.pbkdf2Iterations)),
salt: "AUTHENTICATION_SALT",
masterPasswordAuthenticationHash: "MASTER_PASSWORD_AUTHENTICATION_HASH"
),
masterPasswordUnlockData: MasterPasswordUnlockData(
kdf: .pbkdf2(iterations: NonZeroU32(Constants.pbkdf2Iterations)),
masterKeyWrappedUserKey: "MASTER_KEY_WRAPPED_USER_KEY",
salt: "UNLOCK_SALT"
),
oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData(
kdf: .pbkdf2(iterations: NonZeroU32(Constants.pbkdf2Iterations)),
salt: "OLD_AUTHENTICATION_SALT",
masterPasswordAuthenticationHash: "MASTER_PASSWORD_AUTHENTICATION_HASH"
)
)
)
var updatePasswordNewPassword: String?
var updatePasswordResult: Result<UpdatePasswordResponse, Error> = .success(
UpdatePasswordResponse(
@ -97,6 +120,17 @@ class MockCryptoClient: CryptoClientProtocol {
return try initializeUserCryptoResult.get()
}
func makeUpdateKdf(password: String, kdf: Kdf) throws -> UpdateKdfResponse {
makeUpdateKdfPassword = password
makeUpdateKdfKdf = kdf
return try makeUpdateKdfResult.get()
}
func makeUpdatePassword(newPassword: String) throws -> UpdatePasswordResponse {
updatePasswordNewPassword = newPassword
return try updatePasswordResult.get()
}
func updatePassword(newPassword: String) throws -> BitwardenSdk.UpdatePasswordResponse {
updatePasswordNewPassword = newPassword
return try updatePasswordResult.get()

View File

@ -61,6 +61,7 @@ extension CipherDetailsResponseModel {
init(cipher: BitwardenSdk.Cipher) throws {
guard let id = cipher.id else { throw DataMappingError.invalidData }
self.init(
archivedDate: cipher.archivedDate,
attachments: cipher.attachments?.map(AttachmentResponseModel.init),
card: cipher.card.map(CipherCardModel.init),
collectionIds: cipher.collectionIds,
@ -353,7 +354,8 @@ extension BitwardenSdk.Cipher {
passwordHistory: model.passwordHistory?.map(PasswordHistory.init),
creationDate: model.creationDate,
deletedDate: model.deletedDate,
revisionDate: model.revisionDate
revisionDate: model.revisionDate,
archivedDate: model.archivedDate
)
}
}
@ -432,7 +434,8 @@ extension BitwardenSdk.CipherView: @retroactive Identifiable, Fido2UserVerifiabl
passwordHistory: nil,
creationDate: timeProvider.presentTime,
deletedDate: nil,
revisionDate: timeProvider.presentTime
revisionDate: timeProvider.presentTime,
archivedDate: nil
)
}
}

View File

@ -208,7 +208,8 @@ class CipherViewTests: BitwardenTestCase {
passwordHistory: nil,
creationDate: timeProvider.presentTime,
deletedDate: nil,
revisionDate: timeProvider.presentTime
revisionDate: timeProvider.presentTime,
archivedDate: nil
)
)
}
@ -258,7 +259,8 @@ class CipherViewTests: BitwardenTestCase {
passwordHistory: nil,
creationDate: timeProvider.presentTime,
deletedDate: nil,
revisionDate: timeProvider.presentTime
revisionDate: timeProvider.presentTime,
archivedDate: nil
)
)
}

View File

@ -67,6 +67,7 @@ extension CipherListView {
creationDate: cipher.creationDate,
deletedDate: cipher.deletedDate,
revisionDate: cipher.revisionDate,
archivedDate: cipher.archivedDate,
copyableFields: [],
localData: nil
)

View File

@ -22,6 +22,7 @@ extension CipherListView {
creationDate: Date = Date(),
deletedDate: Date? = nil,
revisionDate: Date = Date(),
archivedDate: Date? = nil,
copyableFields: [CopyableCipherFields] = [],
localData: LocalDataView? = nil
) -> CipherListView {
@ -45,6 +46,7 @@ extension CipherListView {
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate,
archivedDate: archivedDate,
copyableFields: copyableFields,
localData: localData
)
@ -70,6 +72,7 @@ extension CipherListView {
creationDate: Date = Date(),
deletedDate: Date? = nil,
revisionDate: Date = Date(),
archivedDate: Date? = nil,
copyableFields: [CopyableCipherFields] = [],
localData: LocalDataView? = nil
) -> CipherListView {
@ -93,6 +96,7 @@ extension CipherListView {
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate,
archivedDate: archivedDate,
copyableFields: copyableFields,
localData: localData
)

View File

@ -6,6 +6,9 @@ import Networking
struct CipherDetailsResponseModel: JSONResponse, Equatable {
// MARK: Properties
/// The date the cipher was archived.
let archivedDate: Date?
/// The cipher's list of attachments.
let attachments: [AttachmentResponseModel]?

View File

@ -4,6 +4,7 @@ import Foundation
extension CipherDetailsResponseModel {
static func fixture(
archivedDate: Date? = nil,
attachments: [AttachmentResponseModel]? = nil,
card: CipherCardModel? = nil,
collectionIds: [String] = [],
@ -31,6 +32,7 @@ extension CipherDetailsResponseModel {
viewPassword: Bool = false
) -> CipherDetailsResponseModel {
self.init(
archivedDate: archivedDate,
attachments: attachments,
card: card,
collectionIds: collectionIds,

View File

@ -47,6 +47,7 @@ class CipherAPIServiceTests: XCTestCase { // swiftlint:disable:this type_body_le
XCTAssertEqual(
response,
CipherDetailsResponseModel(
archivedDate: nil,
attachments: nil,
card: nil,
collectionIds: nil,
@ -101,6 +102,7 @@ class CipherAPIServiceTests: XCTestCase { // swiftlint:disable:this type_body_le
XCTAssertEqual(
response,
CipherDetailsResponseModel(
archivedDate: nil,
attachments: nil,
card: nil,
collectionIds: nil,
@ -221,6 +223,7 @@ class CipherAPIServiceTests: XCTestCase { // swiftlint:disable:this type_body_le
SaveAttachmentResponse(
attachmentId: "1",
cipherResponse: CipherDetailsResponseModel(
archivedDate: nil,
attachments: [
.init(
fileName: "2.q4Pl+Pz7D3sxr1VEKuwke",
@ -287,6 +290,7 @@ class CipherAPIServiceTests: XCTestCase { // swiftlint:disable:this type_body_le
XCTAssertEqual(
response,
CipherDetailsResponseModel(
archivedDate: nil,
attachments: nil,
card: nil,
collectionIds: nil,

View File

@ -77,6 +77,7 @@ extension CipherListView {
creationDate: cipher.creationDate,
deletedDate: cipher.deletedDate,
revisionDate: cipher.revisionDate,
archivedDate: cipher.archivedDate,
copyableFields: [],
localData: cipher.localData.map(LocalDataView.init)
)
@ -138,7 +139,8 @@ extension Cipher {
passwordHistory: cipherView.passwordHistory?.map(PasswordHistory.init),
creationDate: cipherView.creationDate,
deletedDate: cipherView.deletedDate,
revisionDate: cipherView.revisionDate
revisionDate: cipherView.revisionDate,
archivedDate: cipherView.archivedDate
)
}
}
@ -171,7 +173,8 @@ extension CipherView {
passwordHistory: cipher.passwordHistory?.map(PasswordHistoryView.init),
creationDate: cipher.creationDate,
deletedDate: cipher.deletedDate,
revisionDate: cipher.revisionDate
revisionDate: cipher.revisionDate,
archivedDate: cipher.archivedDate
)
}
}

View File

@ -27,6 +27,7 @@ extension AttachmentView {
extension Cipher {
static func fixture(
archivedDate: Date? = nil,
attachments: [Attachment]? = nil,
card: Card? = nil,
collectionIds: [String] = [],
@ -80,7 +81,8 @@ extension Cipher {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
}
@ -106,6 +108,7 @@ extension CipherListView {
creationDate: DateTime = Date(year: 2023, month: 11, day: 5, hour: 9, minute: 41),
deletedDate: DateTime? = nil,
revisionDate: DateTime = Date(year: 2023, month: 11, day: 5, hour: 9, minute: 41),
archivedDate: DateTime? = nil,
copyableFields: [CopyableCipherFields] = [],
localData: LocalDataView? = nil
) -> CipherListView {
@ -129,6 +132,7 @@ extension CipherListView {
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate,
archivedDate: archivedDate,
copyableFields: copyableFields,
localData: localData
)
@ -154,6 +158,7 @@ extension CipherListView {
creationDate: DateTime = Date(year: 2023, month: 11, day: 5, hour: 9, minute: 41),
deletedDate: DateTime? = nil,
revisionDate: DateTime = Date(year: 2023, month: 11, day: 5, hour: 9, minute: 41),
archivedDate: DateTime? = nil,
copyableFields: [CopyableCipherFields] = [],
localData: LocalDataView? = nil
) -> CipherListView {
@ -177,6 +182,7 @@ extension CipherListView {
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate,
archivedDate: archivedDate,
copyableFields: copyableFields,
localData: localData
)
@ -185,6 +191,7 @@ extension CipherListView {
extension CipherView {
static func fixture(
archivedDate: Date? = nil,
attachments: [AttachmentView]? = nil,
card: CardView? = nil,
collectionIds: [String] = [],
@ -238,11 +245,13 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
static func cardFixture(
archivedDate: Date? = nil,
attachments: [AttachmentView]? = nil,
card: CardView = CardView.fixture(),
collectionIds: [String] = [],
@ -291,11 +300,13 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
static func loginFixture(
archivedDate: Date? = nil,
attachments: [AttachmentView]? = nil,
collectionIds: [String] = [],
creationDate: DateTime = Date(year: 2023, month: 11, day: 5, hour: 9, minute: 41),
@ -344,7 +355,8 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}

View File

@ -17,6 +17,7 @@ class AddItemStateTests: XCTestCase {
assertInlineSnapshot(of: subject.newCipherView(creationDate: Date(year: 2023, month: 10, day: 20)), as: .dump) {
"""
CipherView
- archivedDate: Optional<Date>.none
- attachments: Optional<Array<AttachmentView>>.none
- card: Optional<CardView>.none
- collectionIds: 0 elements
@ -70,6 +71,7 @@ class AddItemStateTests: XCTestCase {
assertInlineSnapshot(of: subject.newCipherView(creationDate: Date(year: 2023, month: 9, day: 1)), as: .dump) {
"""
CipherView
- archivedDate: Optional<Date>.none
- attachments: Optional<Array<AttachmentView>>.none
- card: Optional<CardView>.none
- collectionIds: 0 elements

View File

@ -587,7 +587,8 @@ extension CipherItemState {
passwordHistory: nil,
creationDate: creationDate,
deletedDate: nil,
revisionDate: creationDate
revisionDate: creationDate,
archivedDate: nil
)
}
} // swiftlint:disable:this file_length

View File

@ -33,7 +33,8 @@ extension Cipher {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
@ -69,7 +70,8 @@ extension Cipher {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
}

View File

@ -199,7 +199,8 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
@ -349,7 +350,8 @@ extension CipherView {
passwordHistory: passwordHistory,
creationDate: creationDate,
deletedDate: deletedDate,
revisionDate: revisionDate
revisionDate: revisionDate,
archivedDate: archivedDate
)
}
}

View File

@ -14,7 +14,7 @@ include:
packages:
BitwardenSdk:
url: https://github.com/bitwarden/sdk-swift
revision: 730c5b9c07bc4980ec13982594ba79b28f38d19b # 1.0.0-2282-5658d61
revision: f14c06fd4f77b290dfd447aadd80a3bbc54da97c # 1.0.0-2413-0eba924
branch: unstable
Firebase:
url: https://github.com/firebase/firebase-ios-sdk