[PR #835] [MERGED] [Auto-Logout] Update Service layer logic #2606

Closed
opened 2025-11-26 23:21:38 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/835
Author: @vincentsalucci
Created: 4/15/2020
Status: Merged
Merged: 4/16/2020
Merged by: @vincentsalucci

Base: feature-auto-logoutHead: fal-services


📝 Commits (4)

  • 6865e58 Initial commit of service logic update
  • f0ca72a Added default value for action
  • 7a4205e Updated ToggleTokensAsync conditional
  • ea58170 Removed unused variables, updated action conditional

📊 Changes

13 files changed (+106 additions, -28 deletions)

View changed files

📝 src/Android/Receivers/LockAlarmReceiver.cs (+1 -1)
📝 src/App/App.xaml.cs (+2 -2)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+3 -2)
📝 src/App/Services/MobileStorageService.cs (+2 -1)
📝 src/App/Utilities/AppHelpers.cs (+9 -3)
📝 src/Core/Abstractions/ITokenService.cs (+2 -1)
📝 src/Core/Abstractions/IVaultTimeoutService.cs (+3 -2)
📝 src/Core/Constants.cs (+2 -1)
📝 src/Core/Services/CryptoService.cs (+2 -2)
📝 src/Core/Services/TokenService.cs (+37 -0)
📝 src/Core/Services/VaultTimeoutService.cs (+36 -11)
📝 src/Core/Utilities/ServiceContainer.cs (+6 -1)
📝 src/iOS/AppDelegate.cs (+1 -1)

📄 Description

Objective

Prepare the service/dependent application layers for using new VaultTimeout logic to include logging out during timeout.

Code Changes

  • LockAlarmReceiver.cs: Updated call to use refactored name CheckVaultTimeoutAsync
  • App.xaml.cs: Updated Constants key reference to VaultTimeoutKey
  • SettingsPageViewModel.cs: Updated Constants key reference to VaultTimeoutKey. Added placeholder for new SetVaultTimeoutOptionsAsync method.
  • MobileStorageService.cs: Added new action key to preferenceStorageKeys.
  • AppHelper.cs: Updated Constants key reference to VaultTimeoutKey. Added default value for VaultTimeoutActionKey and set it to lock
  • ITokenService.cs: Added ToggleTokensAsync method reference
  • IVaultTimeoutService.cs: Name refactors CheckVaultTimeoutAsync and SetVaultTimeoutActionsAsync. Added LogOutAsync.
  • Constants.cs: Refactored LockOptionKey to VaultTimeoutKey. Added VaultTimeoutActionKey
  • CryptoService.cs: Updated Constants key reference to VaultTimeoutKey
  • TokenService.cs: Updated logic for whether or not to save token/refresh token based on the vault timeout and action saved. Added ToggleTokensAsync method which will properly clear out the tokens if necessary.
  • VaultTimeoutService.cs: Added TokenService dependency. Added loggedOutCallback dependency. Added logic for log out actions.
  • ServiceContainer.cs: Updated init for VaultTimeoutService. Added log out actions through messengerService.
  • AppDelegate.cs: Updated call to use refactored name CheckVaultTimeoutAsync

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/835 **Author:** [@vincentsalucci](https://github.com/vincentsalucci) **Created:** 4/15/2020 **Status:** ✅ Merged **Merged:** 4/16/2020 **Merged by:** [@vincentsalucci](https://github.com/vincentsalucci) **Base:** `feature-auto-logout` ← **Head:** `fal-services` --- ### 📝 Commits (4) - [`6865e58`](https://github.com/bitwarden/android/commit/6865e58adb7a2e4c2ab961aeaad59700c3518dcb) Initial commit of service logic update - [`f0ca72a`](https://github.com/bitwarden/android/commit/f0ca72a1fdbd80bcd663eb3551af0b6a112308ba) Added default value for action - [`7a4205e`](https://github.com/bitwarden/android/commit/7a4205efaab04bd421d88f44961e5b18398a2a84) Updated ToggleTokensAsync conditional - [`ea58170`](https://github.com/bitwarden/android/commit/ea58170813bcb2f662890ab1b68bb035031b8874) Removed unused variables, updated action conditional ### 📊 Changes **13 files changed** (+106 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Receivers/LockAlarmReceiver.cs` (+1 -1) 📝 `src/App/App.xaml.cs` (+2 -2) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+3 -2) 📝 `src/App/Services/MobileStorageService.cs` (+2 -1) 📝 `src/App/Utilities/AppHelpers.cs` (+9 -3) 📝 `src/Core/Abstractions/ITokenService.cs` (+2 -1) 📝 `src/Core/Abstractions/IVaultTimeoutService.cs` (+3 -2) 📝 `src/Core/Constants.cs` (+2 -1) 📝 `src/Core/Services/CryptoService.cs` (+2 -2) 📝 `src/Core/Services/TokenService.cs` (+37 -0) 📝 `src/Core/Services/VaultTimeoutService.cs` (+36 -11) 📝 `src/Core/Utilities/ServiceContainer.cs` (+6 -1) 📝 `src/iOS/AppDelegate.cs` (+1 -1) </details> ### 📄 Description ## Objective > Prepare the service/dependent application layers for using new `VaultTimeout` logic to include logging out during timeout. ## Code Changes - **LockAlarmReceiver.cs**: Updated call to use refactored name `CheckVaultTimeoutAsync` - **App.xaml.cs**: Updated Constants key reference to `VaultTimeoutKey` - **SettingsPageViewModel.cs**: Updated Constants key reference to `VaultTimeoutKey`. Added placeholder for new `SetVaultTimeoutOptionsAsync` method. - **MobileStorageService.cs**: Added new action key to `preferenceStorageKeys`. - **AppHelper.cs**: Updated Constants key reference to `VaultTimeoutKey`. Added default value for `VaultTimeoutActionKey` and set it to `lock` - **ITokenService.cs**: Added `ToggleTokensAsync` method reference - **IVaultTimeoutService.cs**: Name refactors `CheckVaultTimeoutAsync` and `SetVaultTimeoutActionsAsync`. Added `LogOutAsync`. - **Constants.cs**: Refactored `LockOptionKey` to `VaultTimeoutKey`. Added `VaultTimeoutActionKey` - **CryptoService.cs**: Updated Constants key reference to `VaultTimeoutKey` - **TokenService.cs**: Updated logic for whether or not to save token/refresh token based on the vault timeout and action saved. Added `ToggleTokensAsync` method which will properly clear out the tokens if necessary. - **VaultTimeoutService.cs**: Added `TokenService` dependency. Added `loggedOutCallback` dependency. Added logic for log out actions. - **ServiceContainer.cs**: Updated init for `VaultTimeoutService`. Added log out actions through `messengerService`. - **AppDelegate.cs**: Updated call to use refactored name `CheckVaultTimeoutAsync` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:21:38 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#2606