mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-10 00:42:29 -06:00
[PM-28184] Update feature flag used for no logout on KDF change (#2135)
This commit is contained in:
parent
bb67af1452
commit
6dadf79bf8
@ -19,6 +19,9 @@ extension FeatureFlag: @retroactive CaseIterable {
|
||||
|
||||
/// Flag to enable/disable forced KDF updates.
|
||||
static let forceUpdateKdfSettings = FeatureFlag(rawValue: "pm-18021-force-update-kdf-settings")
|
||||
|
||||
/// Flag to enable/disable not logging out when a user's KDF settings are changed.
|
||||
static let noLogoutOnKdfChange = FeatureFlag(rawValue: "pm-23995-no-logout-on-kdf-change")
|
||||
|
||||
public static var allCases: [FeatureFlag] {
|
||||
[
|
||||
@ -27,6 +30,7 @@ extension FeatureFlag: @retroactive CaseIterable {
|
||||
.cipherKeyEncryption,
|
||||
.enableCipherKeyEncryption,
|
||||
.forceUpdateKdfSettings,
|
||||
.noLogoutOnKdfChange,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,9 +226,9 @@ class DefaultNotificationService: NotificationService {
|
||||
guard let data: LogoutNotification = notificationData.data() else { return }
|
||||
|
||||
if data.reason == .kdfChange,
|
||||
// TODO: PM-26960 Remove user ID check with forceUpdateKdfSettings feature flag.
|
||||
// TODO: PM-26960 Remove user ID check with noLogoutOnKdfChange feature flag.
|
||||
data.userId == userId,
|
||||
await configService.getFeatureFlag(.forceUpdateKdfSettings) {
|
||||
await configService.getFeatureFlag(.noLogoutOnKdfChange) {
|
||||
// Don't log the user out for KDF changes.
|
||||
break
|
||||
}
|
||||
|
||||
@ -502,12 +502,12 @@ class NotificationServiceTests: BitwardenTestCase { // swiftlint:disable:this ty
|
||||
XCTAssertTrue(delegate.routeToLandingCalled)
|
||||
}
|
||||
|
||||
/// `messageReceived(_:notificationDismissed:notificationTapped:)` handles logout requests and will route
|
||||
/// to the landing screen if the logged-out account was the currently active account.
|
||||
/// `messageReceived(_:notificationDismissed:notificationTapped:)` handles logout requests and
|
||||
/// doesn't route to the landing screen if the logout reason was because of a KDF change.
|
||||
@MainActor
|
||||
func test_messageReceived_logout_activeUser_kdfChange() async throws {
|
||||
let activeAccount = Account.fixture()
|
||||
configService.featureFlagsBool[.forceUpdateKdfSettings] = true
|
||||
configService.featureFlagsBool[.noLogoutOnKdfChange] = true
|
||||
stateService.setIsAuthenticated()
|
||||
stateService.accounts = [activeAccount]
|
||||
|
||||
@ -532,9 +532,9 @@ class NotificationServiceTests: BitwardenTestCase { // swiftlint:disable:this ty
|
||||
/// `messageReceived(_:notificationDismissed:notificationTapped:)` handles logout requests and will route
|
||||
/// to the landing screen if the logged-out account was the currently active account.
|
||||
@MainActor
|
||||
func test_messageReceived_logout_activeUser_kdfChange_forceUpdateKdfSettingsOff() async throws {
|
||||
func test_messageReceived_logout_activeUser_kdfChange_noLogoutOnKdfChangeOff() async throws {
|
||||
let activeAccount = Account.fixture()
|
||||
configService.featureFlagsBool[.forceUpdateKdfSettings] = false
|
||||
configService.featureFlagsBool[.noLogoutOnKdfChange] = false
|
||||
stateService.setIsAuthenticated()
|
||||
stateService.accounts = [activeAccount]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user