Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

feat(backend): Add CLI, public Rust API, zstd compression, tests, and clippy/lint cleanup - #6

Merged
Amitminer merged 4 commits into
devfrom
beta
Jul 11, 2025
Merged

feat(backend): Add CLI, public Rust API, zstd compression, tests, and clippy/lint cleanup#6
Amitminer merged 4 commits into
devfrom
beta

Conversation

@Amitminer

@Amitminer Amitminer commented Jul 11, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added a command-line interface (CLI) for file encryption and decryption with password or key support.
    • Integrated automatic zstd compression before encryption and decompression after decryption for both API and CLI.
    • Introduced a public Rust API for encrypting and decrypting files with compression support.
  • Documentation

    • Updated README to document new CLI, compression behavior, and Rust API usage examples.
    • Expanded API documentation to clarify automatic compression in encryption and decryption endpoints.
  • Tests

    • Added integration tests for API and CLI covering encryption and decryption workflows.
  • Chores

    • Updated dependency versions and added new dependencies for CLI and compression support.
    • Removed example environment file.

- Add CLI for encrypting and decrypting files via command-line interface
- Integrate automatic, lossless file compression using zstd
- Add and fix integration tests (including hurl tests)
- Fix all clippy and lint warnings for clean builds
- No changes made to the frontend
@vercel

vercel Bot commented Jul 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
encryptx ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2025 4:34pm

@coderabbitai

coderabbitai Bot commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce automatic zstd compression before encryption and decompression after decryption across the EncryptX backend, updating the API, CLI, and documentation accordingly. A new CLI module is added for command-line encryption/decryption. Test suites are expanded to cover both API and CLI flows. Dependency versions are adjusted, and new dependencies for compression and CLI handling are included.

Changes

File(s) Change Summary
README.md Updated documentation to describe automatic zstd compression, new CLI, and Rust API usage.
encryptx-backend/Cargo.toml Dependency versions adjusted; added zstd, clap, dhat; enabled debug info; added dev-dependencies and features.
encryptx-backend/example.env Deleted example environment variable file.
encryptx-backend/src/cli/mod.rs New CLI module for file encryption/decryption with password/key, input validation, and error handling.
encryptx-backend/src/crypto/mod.rs Reformatted and restyled function signatures and error handling; no logic changes.
encryptx-backend/src/lib.rs Added api module with async functions for file encryption/decryption with compression and error handling.
encryptx-backend/src/main.rs Integrated CLI, added compression to API endpoints, simplified health check, improved error formatting.
encryptx-backend/tests/api.hurl Added Hurl-based API integration tests for password and key-based encryption/decryption.
encryptx-backend/tests/cli.rs Added async integration test for encrypting and decrypting a file using the Rust API.
encryptx-backend/tests/test.txt New sample plaintext file ("hello world") for testing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI/API
    participant Backend
    participant zstd
    participant Crypto

    User->>CLI/API: Provide file, password/key, command
    CLI/API->>zstd: Compress file bytes
    zstd-->>CLI/API: Compressed bytes
    CLI/API->>Crypto: Encrypt compressed bytes (password/key)
    Crypto-->>CLI/API: Encrypted bytes
    CLI/API->>User: Output encrypted file

    User->>CLI/API: Provide encrypted file, password/key, command
    CLI/API->>Crypto: Decrypt file (password/key)
    Crypto-->>CLI/API: Compressed bytes
    CLI/API->>zstd: Decompress bytes
    zstd-->>CLI/API: Original file bytes
    CLI/API->>User: Output decrypted file
Loading

Poem

🐇
EncryptX learned a clever trick,
Compressing files before they click!
With zstd’s speed, your bytes grow small,
Then crypto locks them, safe for all.
CLI hops in, tests abound—
Secure and swift, the best around!
—Rabbit, with a twinkle and a hop


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between abc14f1 and 759f966.

⛔ Files ignored due to path filters (1)
  • encryptx-frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • README.md (3 hunks)
  • encryptx-backend/Cargo.toml (1 hunks)
  • encryptx-backend/example.env (0 hunks)
  • encryptx-backend/src/cli/mod.rs (1 hunks)
  • encryptx-backend/src/crypto/mod.rs (12 hunks)
  • encryptx-backend/src/lib.rs (1 hunks)
  • encryptx-backend/src/main.rs (13 hunks)
  • encryptx-backend/tests/api.hurl (1 hunks)
  • encryptx-backend/tests/cli.rs (1 hunks)
  • encryptx-backend/tests/test.txt (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Amitminer
Amitminer merged commit 583259b into dev Jul 11, 2025
6 of 7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Sep 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant