Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-12606] Move Vault Timeout and Vault Timeout Settings to KM #13405

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jlf0dev
Copy link
Member

@jlf0dev jlf0dev commented Feb 14, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-12606

📔 Objective

Attempt 2 at moving Vault Timeout and Vault Timeout Settings to Key Management. This time keeping everything in common. Tested web, extension, desktop, and CLI.

This is mostly pure moves, only real change was exporting VaultTimeoutService as DefaultVaultTimeoutService and VaultTimeoutSettingsService as DefaultVaultTimeoutSettingsService. This meant renaming in consuming files.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.76%. Comparing base (d9dc3f3) to head (6cc8f90).
Report is 8 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (d9dc3f3) and HEAD (6cc8f90). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (d9dc3f3) HEAD (6cc8f90)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #13405       +/-   ##
===========================================
- Coverage   35.33%   15.76%   -19.58%     
===========================================
  Files        3130       27     -3103     
  Lines       92592     1884    -90708     
  Branches    16809        0    -16809     
===========================================
- Hits        32720      297    -32423     
+ Misses      57431     1587    -55844     
+ Partials     2441        0     -2441     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jlf0dev jlf0dev changed the title [PM-12606] Move Vault Timeout to KM [PM-12606] Move Vault Timeout and Vault Timeout Settings to KM Feb 14, 2025
Copy link
Contributor

github-actions bot commented Feb 14, 2025

Logo
Checkmarx One – Scan Summary & Details19344344-eca7-4573-a714-748d7a97f55d

Great job, no security vulnerabilities found in this Pull Request

@jlf0dev jlf0dev marked this pull request as ready for review February 14, 2025 19:21
@jlf0dev jlf0dev requested review from a team as code owners February 14, 2025 19:21
Copy link

Copy link
Contributor

@mzieniukbw mzieniukbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use relative imports when referencing the module we are in.
https://bitwarden.atlassian.net/wiki/spaces/EN/pages/1472626735/KM+Library+Strategy#Within-the-same-package

@@ -251,6 +253,7 @@ import AutofillService from "../autofill/services/autofill.service";
import { InlineMenuFieldQualificationService } from "../autofill/services/inline-menu-field-qualification.service";
import { SafariApp } from "../browser/safariApp";
import { BackgroundBrowserBiometricsService } from "../key-management/biometrics/background-browser-biometrics.service";
import VaultTimeoutService from "../key-management/vault-timeout/vault-timeout.service";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import VaultTimeoutService from "../key-management/vault-timeout/vault-timeout.service";
import { VaultTimeoutService } from "../key-management/vault-timeout/vault-timeout.service";

VaultTimeout,
VaultTimeoutAction,
VaultTimeoutStringType,
} from "@bitwarden/common/key-management/vault-timeout";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} from "@bitwarden/common/key-management/vault-timeout";
} from "../../key-management/vault-timeout";

VaultTimeout,
VaultTimeoutAction,
VaultTimeoutStringType,
} from "@bitwarden/common/key-management/vault-timeout";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} from "@bitwarden/common/key-management/vault-timeout";
} from "../../key-management/vault-timeout";

@@ -7,6 +7,7 @@ import {
UserDecryptionOptions,
UserDecryptionOptionsServiceAbstraction,
} from "@bitwarden/auth/common";
import { VaultTimeoutSettingsService } from "@bitwarden/common/key-management/vault-timeout";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { VaultTimeoutSettingsService } from "@bitwarden/common/key-management/vault-timeout";
import { VaultTimeoutSettingsService } from "../../key-management/vault-timeout";

import {
VaultTimeoutAction,
VaultTimeoutSettingsService,
} from "@bitwarden/common/key-management/vault-timeout";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} from "@bitwarden/common/key-management/vault-timeout";
} from "../../key-management/vault-timeout";

Comment on lines +11 to +21
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import {
FakeAccountService,
mockAccountServiceWith,
FakeStateProvider,
} from "@bitwarden/common/spec";
import { UserId } from "@bitwarden/common/types/guid";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use relative imports

Comment on lines +22 to +29
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { PolicyType } from "@bitwarden/common/admin-console/enums";
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { StateProvider } from "@bitwarden/common/platform/state";
import { UserId } from "@bitwarden/common/types/guid";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative imports

import {
UserKeyDefinition,
VAULT_TIMEOUT_SETTINGS_DISK_LOCAL,
} from "@bitwarden/common/platform/state";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} from "@bitwarden/common/platform/state";
} from "../../../platform/state";

Comment on lines +8 to +23
import { SearchService } from "@bitwarden/common/abstractions/search.service";
import { AccountInfo } from "@bitwarden/common/auth/abstractions/account.service";
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/master-password/fake-master-password.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { TaskSchedulerService } from "@bitwarden/common/platform/scheduling";
import { StateEventRunnerService } from "@bitwarden/common/platform/state";
import { FakeAccountService, mockAccountServiceWith } from "@bitwarden/common/spec";
import { UserId } from "@bitwarden/common/types/guid";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative import

Comment on lines +7 to +20
import { SearchService } from "@bitwarden/common/abstractions/search.service";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import { TaskSchedulerService, ScheduledTaskNames } from "@bitwarden/common/platform/scheduling";
import { StateEventRunnerService } from "@bitwarden/common/platform/state";
import { UserId } from "@bitwarden/common/types/guid";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants