Skip to content

feat(cloud): add SHA-256 file integrity checksum verification UI (#282) - #289

Merged
DenizAltunkapan merged 5 commits into
Vault-Web:mainfrom
priyanshuvishwakarma273403:feat/cloud-file-checksum
Jul 27, 2026
Merged

feat(cloud): add SHA-256 file integrity checksum verification UI (#282)#289
DenizAltunkapan merged 5 commits into
Vault-Web:mainfrom
priyanshuvishwakarma273403:feat/cloud-file-checksum

Conversation

@priyanshuvishwakarma273403

Copy link
Copy Markdown
Contributor

📌 Description

This PR resolves #282 by adding a complete file integrity verification feature to the Cloud page UI. Users can now compute, view, copy, and compare the SHA-256 checksum of any stored file directly from the Cloud interface.


🚀 Key Changes

1. Service Layer & DTO (CloudService & FileChecksumDto)

  • Created FileChecksumDto (filePath, checksum, algorithm).
  • Added getFileChecksum(filePath: string) method in CloudService consuming the backend SHA-256 checksum endpoint (GET /api/files/checksum?path=...).
  • Added flexible property mapping to gracefully handle variations in backend response formats (checksum, hash, sha256).

2. UI Action & Checksum Dialog (CloudComponent)

  • Per-File Action Button: Added a dedicated "Verify file integrity (SHA-256)" action button (pi pi-shield) to every file entry row in the Cloud file browser table.
  • File Integrity Dialog (p-dialog):
    • Header & Path: Displays file name and full relative path.
    • Loading State: Shows a dedicated spinner and status text while large files are being hashed by the backend.
    • Formatted Hash Display: Displays computed SHA-256 hash in a monospace block for visual clarity.
    • Clipboard Copy: One-click copy button (pi pi-copy) with instant UiToastService feedback.
    • Hash Verification: Allows users to paste an expected SHA-256 hash

@priyanshuvishwakarma273403

Copy link
Copy Markdown
Contributor Author

kindly review this pr.
thank you

@DenizAltunkapan DenizAltunkapan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this, the checksum flow is a nice addition and the dialog states (loading / error / result / verify) are well thought out.

Before I can approve there are a few things to sort out.

1. Merge conflicts (blocking)

The branch is out of date with main and conflicts in five files, all from the recent cloud work that already landed:

  • frontend/src/app/pages/cloud/cloud.component.ts
  • frontend/src/app/pages/cloud/cloud.component.html
  • frontend/src/app/pages/cloud/cloud.component.spec.ts
  • frontend/src/app/services/cloud.service.ts
  • frontend/src/app/services/cloud.service.spec.ts

Please rebase onto latest main and resolve these. Since the conflicts touch the same regions as the virus-scan and unsaved-edit changes, double check nothing gets dropped on either side while resolving, and rerun the full spec suite afterwards.

The inline comments below can be handled in the same pass.

Comment thread frontend/src/app/pages/cloud/cloud.component.ts Outdated
Comment thread frontend/src/app/pages/cloud/cloud.component.ts Outdated
Comment thread frontend/src/app/services/cloud.service.ts
Comment thread frontend/src/app/pages/cloud/cloud.component.html
@DenizAltunkapan

Copy link
Copy Markdown
Member

@priyanshuvishwakarma273403 thanks for resolving the conflicts, but the resolution dropped tests that are on main. cloud.component.spec.ts on main has three describe blocks (virus scan, Secure Send Flow, unsaved-edit guard), your branch now only keeps the virus scan one. The Secure Send and unsaved-edit guard specs from #287 and #290 are gone, and CI is green simply because deleted tests cannot fail. Please restore those two blocks from main and merge your checksum specs alongside them.

Also, the four inline comments from my review are still unaddressed. Happy to take another look once both are in.

@DenizAltunkapan DenizAltunkapan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the follow-up, this is close now. The spec blocks from main are all restored (virus scan, Secure Send, unsaved-edit guard) alongside the new checksum specs, the conflict resolution is clean with no production code lost, and the dialog dismiss now routes through onChecksumDialogHide with a full reset. The checksumRequestId guard against stale responses is a nice extra.

One item from the earlier review is still open: the clipboard copy reports success unconditionally. Details inline. Fix that and I am happy to approve.

Comment thread frontend/src/app/pages/cloud/cloud.component.ts Outdated
Comment thread frontend/src/app/pages/cloud/cloud.component.ts Outdated
@DenizAltunkapan
DenizAltunkapan merged commit 8ffcd1d into Vault-Web:main Jul 27, 2026
2 checks passed
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