Skip to content

Conversation

SaintPatrck
Copy link
Contributor

🎟️ Tracking

PM-15056

📔 Objective

Introduce the exportVaultDataToCxf function to the VaultRepository and its implementation. This function allows exporting selected ciphers to a CXF file.

The following changes were made:

  • Added getSelectedCiphers to CiphersDao and VaultDiskSource to retrieve specific ciphers by their IDs.
  • Created an AccountJson.toSdkAccount() extension function to convert AccountJson to the SDK's Account model.
  • Implemented exportVaultDataToCxf in VaultRepositoryImpl to utilize the new data source methods and the SDK for CXF export.
  • Added corresponding tests for the new functionalities.

⏰ 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

This commit introduces the `exportVaultDataToCxf` function to the `VaultRepository` and its implementation. This function allows exporting selected ciphers to a CXF file.

The following changes were made:
- Added `getSelectedCiphers` to `CiphersDao` and `VaultDiskSource` to retrieve specific ciphers by their IDs.
- Created an `AccountJson.toSdkAccount()` extension function to convert `AccountJson` to the SDK's `Account` model.
- Implemented `exportVaultDataToCxf` in `VaultRepositoryImpl` to utilize the new data source methods and the SDK for CXF export.
- Added corresponding tests for the new functionalities.
Copy link
Contributor

github-actions bot commented Sep 5, 2025

Logo
Checkmarx One – Scan Summary & Details52a5311a-6f95-4979-984a-b03ebe2fd0d6

Great job! No new security vulnerabilities introduced in this pull request

Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 78.57143% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.90%. Comparing base (1d6e733) to head (e564ab2).

Files with missing lines Patch % Lines
...arden/data/vault/repository/VaultRepositoryImpl.kt 57.14% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5847      +/-   ##
==========================================
- Coverage   83.91%   83.90%   -0.02%     
==========================================
  Files         693      694       +1     
  Lines       53353    53381      +28     
  Branches     7331     7335       +4     
==========================================
+ Hits        44773    44790      +17     
- Misses       5993     6000       +7     
- Partials     2587     2591       +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

val account = authDiskSource.userState
?.activeAccount
?.toSdkAccount()
?: return NoActiveUserException().asFailure()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we do this and avoid the extra error:

    override suspend fun exportVaultDataToCxf(
        ciphers: List<CipherListView>,
    ): Result<String> {
        val account = authDiskSource.userState
            ?.activeAccount
            ?.toSdkAccount()
            ?: return NoActiveUserException().asFailure()
        val userId = account.id
        ...

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.

2 participants