Skip to content

Commit

Permalink
add usage and new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaopeuko committed May 21, 2024
1 parent 7bcb266 commit bd2d0cb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Example 1: Basic Usage](#example-1-basic-usage)
- [Example 2: Custom Usage](#example-2-custom-usage)
- [Example 3: Config Usage](#example-3-config-usage)
- [Example 4: Compose](#example-4-compose)
- [Features](#features)

Secure your Python data structures and secrets with Secured. This package provides a straightforward solution for obscuring sensitive data in applications. It's specifically designed for developers who need to protect API keys, database credentials, and other critical configuration details from accidental exposure. Featuring customizable security measures, our tool allows you to control how sensitive information is represented and managed securely. It's ideal for projects that demand high data confidentiality and integrity. Please note that this provides a thin layer of protection.
Expand Down Expand Up @@ -70,6 +71,26 @@ print(secured.config.name) # Using dot notation
print(secured.config["name"]) # Using dictionary-like notation
```

### Example 4: Compose

```python
from secured.secured import Secured

# Define the custom secure message
message = "🔒 <Data Secured> 🔒"

# Example secured object
CONFIG_PATH = "examples/config.yaml"
DATABASE_URL = "mysql://{user}:{password}@localhost/dbname"
secure = Secured(CONFIG_PATH, secure=True, message=message)

# Usage in code
secure_database_url = secure.compose(DATABASE_URL, user="guest", password="guest_password")
print(secure_database_url) # Output: 🔒 <Data Secured> 🔒
print(secure_database_url.get_original()) # Careful! This will print the original data, do not use it.
print(secure_database_url == "mysql://guest:guest_password@localhost/dbname") # Output: True
```

## Features

- **Data Protection**: Helps prevent the accidental logging or display of sensitive information.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "secured"
version = "0.1.2"
version = "0.1.3"
description = ""
authors = ["Joao Paulo Euko"]
license = "MIT"
Expand Down

0 comments on commit bd2d0cb

Please sign in to comment.