Skip to content

Commit fefeb20

Browse files
authored
WIP: v3 (#112)
* feat: encode secret as webpack instead of json+base64 * test: add msgpack deserialization failure tests for Payload * test: add serialize tests verifying msgpack byte format * remove usage of deprecated decode_bytes function * docs: update API.md to document MessagePack payload encoding * docs: update base64-encoding.md to reflect MessagePack serialization * docs: update openapi.yaml to reflect MessagePack payload format * chore: bump version to 3.0.0 * feat: PayloadData does now also have data in bytes instead of base64 encoded string in typescript implementation * feat: encode to messagepack in typescript * fix: fix tests * fix: secrets send by CLI could not be parsed * fix: allow either array or uint8array for data * feat: replace UUID by ULID * fix: fix tests replacing UUIDs with ULIDs * fix: add v4 feature for uuid to use UUIDs as request IDs * chore(nix): update cargo hash * doc: add breaking changes to readme
1 parent 8b7abfc commit fefeb20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+793
-655
lines changed

Cargo.lock

Lines changed: 67 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ members = [
1010
]
1111

1212
[workspace.dependencies]
13-
hakanai-lib = { path = "lib", version = "2.20.4" }
13+
hakanai-lib = { path = "lib", version = "3.0.0" }
1414

1515
[profile.release]
1616
opt-level = "z"

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Hakanai embodies the Japanese concept of transience - secrets that exist only fo
2525

2626
**Enhanced Security Mode**: With `--separate-key`, the secret URL and decryption key are provided separately, allowing you to share them through different communication channels for defense in depth.
2727

28+
## Breaking Changes
29+
30+
With version 3.x hakanai has switched from using UUIDs as secret identifiers to ULIDs. This allows for shorter URLs. Secret URLs created with previous versions below 3.x will not work anymore. Also the secret storage format has changed. Secrets are now encoded using MessagePack instead of JSON. This change reduces secret size significantly since binary data has not to be base64-encoded anymore.
31+
2832
## Quick Start
2933

3034
### Docker Compose (Recommended)
@@ -74,13 +78,13 @@ echo "restricted secret" | hakanai send --allow-ip 192.168.1.0/24 --allow-countr
7478

7579
```bash
7680
# Get using the URL returned by send
77-
hakanai get https://hakanai.example.com/s/uuid-here
81+
hakanai get https://hakanai.example.com/s/ulid-here
7882

7983
# Get with separate key (when --separate-key was used)
80-
hakanai get https://hakanai.example.com/s/uuid-here --key base64-key
84+
hakanai get https://hakanai.example.com/s/ulid-here --key base64-key
8185

8286
# Save to custom location
83-
hakanai get https://hakanai.example.com/s/uuid-here --output-dir /downloads/
87+
hakanai get https://hakanai.example.com/s/ulid-here --output-dir /downloads/
8488
```
8589

8690
### Web Interface

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Hakanai implements a zero-knowledge architecture where:
8181
#### Application Security (Built-in)
8282

8383
- **Authentication**: Token-based with SHA-256 hashing
84-
- **Input Validation**: UUID format validation, size limits
84+
- **Input Validation**: ULID format validation, size limits
8585
- **CORS Policy**: Restrictive by default
8686
- **Security Headers**: X-Frame-Options, X-Content-Type-Options, HSTS
8787
- **Memory Safety**: Sensitive data zeroized after use

0 commit comments

Comments
 (0)