Skip to content

hamkee-dev-group/secrets-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secrets API

A secure API for storing and managing encrypted secrets built with Rust ideal for security-critical applications where performance and correctness are essential.

Overview

This project provides an API for storing encrypted data securely. It leverages modern Rust libraries to create a high-performance, type-safe application with strong security guarantees.

Features

  • Secure Storage: All secrets are stored encrypted
  • UUID-Based Access: Secrets are accessed via UUIDs
  • Serializable Models: API responses are cleanly structured using serialization
  • RESTful API: Simple and intuitive RESTful endpoints (encrypt/decrypt)

Architecture

The project is built with the following technologies:

  • Loco.rs: Modern Rust framework for building applications
  • SeaORM: Async ORM for Rust
  • AES256 Encryption: Industry-standard encryption for data security

Project Structure

secrets/
├── src/
│   ├── models/
│   │   └── secrets.rs       # Data models and serialization
│   ├── cryptography/
│   │   └── encryption.rs    # Encryption/decryption logic
│   ├── routes.rs            # API endpoints
│   └── main.rs              # Application entry point
└── ...

API Endpoints

Endpoint Method Description
/secrets/decrypt/:uid POST Retrieve a secret by UUID
/secrets/encrypt POST Create a new secret

Getting Started

Prerequisites

  • Rust 1.70+
  • (Optional) PostgreSQL or other supported database

Installation

  1. Clone this repository and:

    cd secrets
  2. Build the project:

    cargo build --release
  3. Run the server:

Usage Example

Creating a Secret

curl -X POST http://localhost:5150/secrets \
  -H "Content-Type: application/json" \
  -d '{"data": "your-secret-data", "passphrase": "your-secure-passphrase"}'

Retrieving a Secret

curl http://localhost:5150/secrets/123e4567-e89b-12d3-a456-426614174000

Development

Adding a New Remote Repository

# Add a GitHub remote
git remote add origin https://github.com/yourusername/secrets.git

# Verify remotes
git remote -v

# Push to remote
git push -u origin main

Running Tests

cargo test

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Secrets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages