revault_api 0.5.1-aarch64-linux → 0.6.1-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +140 -423
- data/lib/revault/binding_operations.rb +1255 -0
- data/lib/revault/domain_models.rb +808 -0
- data/lib/revault/native_library.rb +80 -0
- data/lib/revault/vault.rb +1600 -0
- data/native/linux-aarch64-gnu/librevault_api.so +0 -0
- data/native/linux-aarch64-gnu/librevault_ruby_shim.so +0 -0
- data/native/revault_ruby_shim.c +557 -0
- data/revault_api.rb +11 -0
- metadata +25 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8b15fe5ec92afa3a0ebb7d6e4860f3aa4465dacfb7742f673e5f1c861c0caa3
|
|
4
|
+
data.tar.gz: 5f626bd108fc823f3c1d6750f414c27fef74cc010a1e6e8a1209a0b53251767c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 224c418e1b1fbc6c7c7a9c20d0583546d1f74aca7c465f9326f27e59eafdb5eee07d135be5d20045100e8165a43c3581b71906041ed8ea7b83b2fc832f54ab2d
|
|
7
|
+
data.tar.gz: 58276a5cf60ec26b4a1494eb6b21259466d7682e15b0c80e8926a07bd33d945f94428609f761759f3a75dddcca3ff04301b8bce79a765d80bb4b6787937a317d
|
data/README.md
CHANGED
|
@@ -1,441 +1,158 @@
|
|
|
1
|
-
# reVault
|
|
1
|
+
# reVault for Ruby
|
|
2
2
|
|
|
3
3
|
reVault is a fast, local toolkit for creating secure portable archives called
|
|
4
|
-
Lockboxes. Each Lockbox is encrypted, compressed, and signed. It can store
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* file permissions and symbolic links
|
|
8
|
-
* variables such as API keys
|
|
9
|
-
* forms such as login details
|
|
4
|
+
Lockboxes. Each Lockbox is encrypted, compressed, and signed. It can store
|
|
5
|
+
files and directory trees, variables such as API keys, and forms such as login
|
|
6
|
+
details.
|
|
10
7
|
|
|
11
8
|
Lockboxes are easy to copy, share, and back up, and they do not require a
|
|
12
9
|
hosted service. The engine is designed for speed and effective compression.
|
|
13
10
|
Applications can read, write, and seek within stored files without extracting
|
|
14
|
-
the archive, and recover data from partial corruption.
|
|
11
|
+
the archive, and recover data from partial corruption. reVault provides a
|
|
12
|
+
command line tool for everyday work and APIs for application code.
|
|
15
13
|
|
|
16
14
|
Read the [reVault manual](https://docs.revault.onepub.dev/) for the quick start,
|
|
17
15
|
core concepts, and security model.
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
reVault runs on Linux, macOS, and Windows. You can use it through the command
|
|
25
|
-
line interface or through libraries for supported programming languages.
|
|
26
|
-
|
|
27
|
-
The main components are:
|
|
28
|
-
|
|
29
|
-
* `revault_cli` for everyday command line use
|
|
30
|
-
* `revault_lockbox_api` for creating and working with Lockboxes
|
|
31
|
-
* `revault_vault_api` for creating and managing Vaults
|
|
32
|
-
|
|
33
|
-
## The main concepts
|
|
34
|
-
|
|
35
|
-
* A **Lockbox** is a portable archive with the `.lbox` extension.
|
|
36
|
-
* A **key** or password controls who can open a Lockbox.
|
|
37
|
-
* A **Vault** stores local profiles, contacts, keys, and remembered access to
|
|
38
|
-
Lockboxes.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
> **Pre-release:** the Rust implementation is currently alpha software. The
|
|
42
|
-
> archive format and public APIs may change between releases. Do not use it as
|
|
43
|
-
> the only copy of important data, and keep vault backups and profile recovery
|
|
44
|
-
> material offline.
|
|
45
|
-
|
|
46
|
-
## Installation
|
|
47
|
-
|
|
48
|
-
The best way to start with reVault is to install the CLI tooling.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### crates.io
|
|
52
|
-
The easist way to install the reVault CLI is from crates.io
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
cargo install revault_cli
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### repo
|
|
60
|
-
|
|
61
|
-
You can also install the CLI by cloning the github repo.
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
git clone https://github.com/onepub-dev/reVault.git
|
|
65
|
-
cd reVault/rust
|
|
66
|
-
cargo xtask install-cli
|
|
67
|
-
cargo xtask dev-tools
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
# Initialise your vault
|
|
71
|
-
|
|
72
|
-
In order to create a lockbox you must first initialise your Vault.
|
|
73
|
-
|
|
74
|
-
When you install the reVault CLI, Cargo installs both `lockbox` app and its alias `lbx` into `~/.cargo/bin`.
|
|
75
|
-
Ensure that directory is on your `PATH`.
|
|
76
|
-
|
|
77
|
-
`cargo xtask dev-tools` installs `revault-tool`, the repository developer
|
|
78
|
-
command hub. Run `revault-tool --help` to see release preparation/publication,
|
|
79
|
-
binding generation and checks, conformance tests, and the `dev` commands that
|
|
80
|
-
wrap repository validation tasks.
|
|
81
|
-
|
|
82
|
-
To initialise your vault run:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
lbx vault init
|
|
86
|
-
```
|
|
87
|
-
The init command will create the keys need to create/open and close lockboxes.
|
|
88
|
-
The keys are stored in your reVault vault.
|
|
89
|
-
|
|
90
|
-
The init command will also dump those keys to the terminal. You need to backup those
|
|
91
|
-
keys safely.
|
|
92
|
-
* If you loose the keys you will not be able to access any lockbox - there is no way to recover from this!!!
|
|
93
|
-
* If some else gets access to those keys then they have access to all of your lockboxes.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## CLI Quick Start
|
|
97
|
-
|
|
98
|
-
Create a lockbox for the default vault profile: (recommended)
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
lockbox secrets.lbox create
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
For a lockbox protected by a passphrase instead of a vault profile:
|
|
105
|
-
|
|
106
|
-
This form is less secure than using a profile.
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
lockbox secrets.lbox create --password
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Open it for normal commands:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
lockbox secrets.lbox open
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Persistent directory mirrors
|
|
119
|
-
|
|
120
|
-
A mirror project records a one-way relationship between a host directory and
|
|
121
|
-
an exclusively managed directory inside the lockbox. The project definition,
|
|
122
|
-
including its include and exclude rules, is encrypted inside the lockbox and
|
|
123
|
-
travels with it.
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
lbx secrets.lbox mirrors source create --from ./src --to /projects/source
|
|
127
|
-
lbx secrets.lbox mirrors source rules add exclude target/** '*.tmp'
|
|
128
|
-
lbx secrets.lbox mirrors source status
|
|
129
|
-
lbx secrets.lbox mirrors source update
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
`status` previews the complete plan; `update` recalculates and applies it.
|
|
133
|
-
Multiple projects can coexist when their destination directories do not
|
|
134
|
-
overlap. See the [CLI guide](docs/cli_how_to.md#mirror-a-host-directory-safely)
|
|
135
|
-
for ownership, deletion, rule, and safety details.
|
|
136
|
-
|
|
137
|
-
The open is cached in a per-user in-memory agent which will automatically close
|
|
138
|
-
it after about 30mins. Lock it when you are done:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
lockbox secrets.lbox close
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Add files:
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
lockbox secrets.lbox add --recursive ./project --to project/
|
|
148
|
-
lockbox secrets.lbox add ./generated.env --to secrets/prod.env
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
List and extract:
|
|
17
|
+
Your Vault holds your profile and contacts. The CLI protects a new Lockbox for
|
|
18
|
+
your profile by default, and you can grant access to contacts using their
|
|
19
|
+
public keys. Use password access when you do not have a recipient's contact
|
|
20
|
+
(public key) details.
|
|
152
21
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
lockbox secrets.lbox list '/project/**/*.rs'
|
|
156
|
-
lockbox secrets.lbox extract /project/README.md ./out/README.md
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
See [docs/cli_how_to.md](docs/cli_how_to.md) for command-focused examples.
|
|
160
|
-
|
|
161
|
-
## Profiles And Sharing
|
|
162
|
-
|
|
163
|
-
Create another local profile:
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
lockbox vault profiles create laptop
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Create an independent encrypted vault with a fresh profile and register that
|
|
170
|
-
profile's public key as a contact in the current vault:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
lbx vault beget production
|
|
174
|
-
# Creates production.vault.lbx with profile:production.
|
|
175
|
-
# Saves only the public key locally as contact:production.
|
|
176
|
-
|
|
177
|
-
lbx access grant shared.lbox contact:production
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Use `--output` to choose the new vault path, `--contact-name` to avoid a local
|
|
181
|
-
contact-name collision, or `--no-contact` to leave the current vault unchanged.
|
|
182
|
-
`beget` never grants lockbox access automatically and never copies private
|
|
183
|
-
material from the current vault.
|
|
184
|
-
|
|
185
|
-
List profiles and export a public key:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
lockbox vault profiles list
|
|
189
|
-
lockbox vault profiles export ./laptop.pub --name laptop
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
Import a contact public key after independently verifying its fingerprint:
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
lockbox vault contacts import alice ./alice.pub \
|
|
196
|
-
--fingerprint <fingerprint> \
|
|
197
|
-
--fingerprint-channel phone-call-to-owner
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
Create a lockbox for a recipient:
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
lockbox shared.lbox create --for alice
|
|
204
|
-
```
|
|
22
|
+
Platform gems contain the matching reVault engine and provide Lockbox, Vault,
|
|
23
|
+
key, and session agent classes through Fiddle.
|
|
205
24
|
|
|
206
|
-
|
|
25
|
+
## Installation and native runtime
|
|
207
26
|
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
lockbox shared.lbox access list
|
|
211
|
-
lockbox shared.lbox access revoke alice
|
|
27
|
+
```shell
|
|
28
|
+
gem install revault_api
|
|
212
29
|
```
|
|
213
30
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
lockbox vault profiles backup ./default.profile-backup
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Private vault keys are stored inside the local vault as secret variable records,
|
|
222
|
-
not as normal files in the vault lockbox. See the CLI help and
|
|
223
|
-
[CLI how-to](docs/cli_how_to.md) for vault backup and profile recovery.
|
|
224
|
-
|
|
225
|
-
## Variables
|
|
226
|
-
|
|
227
|
-
Variables are encrypted metadata, not files. They do not appear in file
|
|
228
|
-
listings and are loaded only when variable commands or APIs request them. The
|
|
229
|
-
command group is `variables`.
|
|
230
|
-
|
|
231
|
-
Plain variables are for values that are useful configuration but not high-value
|
|
232
|
-
secrets:
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
lockbox secrets.lbox variables set DATABASE_URL --value 'postgres://localhost/app'
|
|
236
|
-
lockbox secrets.lbox variables set DATABASE_URL='postgres://localhost/app'
|
|
237
|
-
lockbox secrets.lbox variables get DATABASE_URL
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
With a session-default lockbox, assignment syntax is also supported:
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
lockbox variables set DATABASE_URL='postgres://localhost/app'
|
|
244
|
-
lockbox variables set DATABASE_URL 'postgres://localhost/app'
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Secret variables are for passwords, API tokens, signing keys, and similar
|
|
248
|
-
material. They use secure-memory handling in the variable path and must be provided
|
|
249
|
-
through an explicit source:
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
lockbox secrets.lbox variables set --secret API_TOKEN --interactive
|
|
253
|
-
lockbox secrets.lbox variables set --secret API_TOKEN --file ./api-token.txt
|
|
254
|
-
lockbox secrets.lbox variables set --secret API_TOKEN --stdin
|
|
255
|
-
lockbox secrets.lbox variables set --secret API_TOKEN --from-env API_TOKEN
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
Avoid passing secrets as command-line arguments. Shell history and process
|
|
259
|
-
inspection can expose argv. Prefer `--interactive`, `--stdin`, `--file`, or
|
|
260
|
-
`--from-env`.
|
|
261
|
-
|
|
262
|
-
Sensitivity is chosen when a variable is created. Updating the value preserves
|
|
263
|
-
that sensitivity. To change plain to secret, or secret to plain, delete and
|
|
264
|
-
recreate the variable.
|
|
265
|
-
|
|
266
|
-
## Avoiding Leaks
|
|
267
|
-
|
|
268
|
-
Use these defaults unless you have a specific reason not to:
|
|
269
|
-
|
|
270
|
-
- Use `lockbox open` and the local agent instead of repeatedly passing
|
|
271
|
-
passwords or private keys.
|
|
272
|
-
- Use secret variables for credentials and tokens.
|
|
273
|
-
- Do not store secrets as normal files when variable semantics are appropriate.
|
|
274
|
-
- Do not pass secret values on the command line.
|
|
275
|
-
- Keep private key exports offline, short-lived, and permission-restricted.
|
|
276
|
-
- Prefer recipient keys over shared passwords for team access.
|
|
277
|
-
- Run `lockbox secrets.lbox close` when an open should no longer be cached.
|
|
278
|
-
- Use `lockbox secrets.lbox visualize` for diagnostics; it intentionally avoids
|
|
279
|
-
printing file paths, file contents, variable names, or variable values.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
Lockbox protects data inside the container. It cannot protect a secret after you
|
|
283
|
-
write it to a normal terminal, shell history, clipboard, exported file, build
|
|
284
|
-
log, or process environment controlled by other tooling.
|
|
285
|
-
|
|
286
|
-
## Key Server, Topology, and Replication
|
|
287
|
-
|
|
288
|
-
`revault_key_server` is a short-lived rendezvous service for sharing candidate
|
|
289
|
-
contact public keys. A publisher uploads a payload, verifies their email, and
|
|
290
|
-
shares the resulting publish code with the recipient. The recipient uses that
|
|
291
|
-
code to receive the candidate key, then verifies its fingerprint independently
|
|
292
|
-
before trusting it. The server does not establish profile trust and is not a
|
|
293
|
-
store for private keys.
|
|
294
|
-
|
|
295
|
-
### Single server
|
|
296
|
-
|
|
297
|
-
A first deployment uses one server with `server_id = 0`. Publish codes include
|
|
298
|
-
that server id as their first digit, followed by a random code body. Using a
|
|
299
|
-
self-routing code from the start keeps pending publishes compatible if the
|
|
300
|
-
deployment later gains standby servers.
|
|
301
|
-
|
|
302
|
-
### Topology servers
|
|
303
|
-
|
|
304
|
-
Servers publish a topology document containing the known server URLs and the
|
|
305
|
-
primary/failover route for each publish-code owner id. Clients use it as follows:
|
|
306
|
-
|
|
307
|
-
- For a publish, discover the cluster through a topology endpoint, select a
|
|
308
|
-
key-server member, and keep that choice sticky locally.
|
|
309
|
-
- For receive and delete, read the publish code's first digit, contact that
|
|
310
|
-
owner id's primary server, then use only its configured failovers.
|
|
311
|
-
- Do not fail over after a rate-limit response; hopping servers must not bypass
|
|
312
|
-
abuse controls.
|
|
313
|
-
|
|
314
|
-
DNS can provide normal host resolution, but it is not the routing mechanism.
|
|
315
|
-
Round-robin DNS alone can send a receive request to a server that does not own
|
|
316
|
-
the corresponding publish code.
|
|
317
|
-
|
|
318
|
-
### Replication and failover
|
|
319
|
-
|
|
320
|
-
Each server is authoritative for the codes carrying its own server id. It sends
|
|
321
|
-
signed state events—published payloads, receive counts, payload lifecycle
|
|
322
|
-
tombstones, and rate-limit blocks—to configured standby peers through the separate
|
|
323
|
-
`/v1/replicate` endpoint. Events carry an origin server id, epoch, and sequence
|
|
324
|
-
number, so standbys apply duplicates idempotently and never replicate received
|
|
325
|
-
peer events again.
|
|
326
|
-
|
|
327
|
-
Replication does not make the cluster hot/hot. A standby keeps replica state
|
|
328
|
-
but serves an owner's payloads only after an operator explicitly promotes it for
|
|
329
|
-
that owner id. This avoids two servers consuming a single-use publish at the
|
|
330
|
-
same time during a network partition. See the [key-server deployment guide](https://github.com/onepub-dev/reVault/blob/master/rust/revault_key_server/README.md), [configuration reference](https://github.com/onepub-dev/reVault/blob/master/rust/revault_key_server/KEY_SERVER_CONFIG.md), and [redundancy design](https://github.com/onepub-dev/reVault/blob/master/rust/revault_key_server/REDUNDANCY.md) for the deployment and recovery procedures.
|
|
331
|
-
|
|
332
|
-
## Rust Library
|
|
333
|
-
|
|
334
|
-
Use `revault_lockbox_api` when you need the portable storage engine:
|
|
335
|
-
|
|
336
|
-
```rust
|
|
337
|
-
use revault_lockbox_api::{Lockbox, LockboxOpen, LockboxPath, LockboxProtection, SecretVec};
|
|
338
|
-
use std::path::Path;
|
|
339
|
-
|
|
340
|
-
let key = SecretVec::try_from_slice(b"correct horse battery staple")?;
|
|
341
|
-
let signing_key = revault_lockbox_api::OwnerSigningKeyPair::generate()?;
|
|
342
|
-
let mut lockbox = Lockbox::create_file(
|
|
343
|
-
Path::new("secrets.lbox"),
|
|
344
|
-
LockboxProtection::ContentKey(key.try_clone()?),
|
|
345
|
-
&signing_key,
|
|
346
|
-
)?;
|
|
347
|
-
|
|
348
|
-
lockbox.add_file(&LockboxPath::new("/docs/a.txt")?, b"alpha", false)?;
|
|
349
|
-
lockbox.add_file(&LockboxPath::new("/docs/b.txt")?, b"bravo", false)?;
|
|
350
|
-
lockbox.commit()?;
|
|
351
|
-
|
|
352
|
-
let reopened = Lockbox::open(
|
|
353
|
-
Path::new("secrets.lbox"),
|
|
354
|
-
LockboxOpen::ContentKey(&key),
|
|
355
|
-
)?;
|
|
356
|
-
let file = reopened.get_file(&LockboxPath::new("/docs/a.txt")?)?;
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
Use `revault_vault_api` for native applications that want the Vault and
|
|
360
|
-
Session Agent behavior:
|
|
361
|
-
|
|
362
|
-
```rust
|
|
363
|
-
use revault_vault_api::{local_vault, SecretString};
|
|
364
|
-
|
|
365
|
-
let vault = local_vault();
|
|
366
|
-
let password = SecretString::try_from_bytes(b"pw".to_vec())?;
|
|
367
|
-
|
|
368
|
-
vault.create_lockbox_with_password("secrets.lbox", &password)?;
|
|
369
|
-
|
|
370
|
-
let lockbox = vault.open_lockbox_with_password("secrets.lbox", &password)?;
|
|
371
|
-
let mut lockbox = lockbox;
|
|
372
|
-
lockbox.add_file_from_path("notes.txt", &revault_lockbox_api::LockboxPath::new("/notes.txt")?)?;
|
|
373
|
-
lockbox.commit()?;
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
## Documentation
|
|
377
|
-
|
|
378
|
-
Performance results for Lockbox using the published pure-Rust
|
|
379
|
-
`zstd-complete 0.1.0` crate, compared with encrypted GPG and unencrypted ZIP,
|
|
380
|
-
are documented in the
|
|
381
|
-
[benchmark report](docs/lockbox_gpg_zip_benchmark_2026_08_30.md).
|
|
382
|
-
|
|
383
|
-
- [reVault manual](https://docs.revault.onepub.dev/): installation, concepts,
|
|
384
|
-
CLI workflows, language APIs, and operational guidance.
|
|
385
|
-
- [CLI how-to](docs/cli_how_to.md): command examples.
|
|
386
|
-
- [CI/CD with reVault](docs/ci_cd.md): proposed bootstrap and ephemeral CI
|
|
387
|
-
workflow for encrypted deployment secrets.
|
|
388
|
-
- [Session Agent](docs/lockbox_session_agent.md): temporary Lockbox access
|
|
389
|
-
lifecycle, protocol, and security model.
|
|
390
|
-
- [Archive format](rust/revault_lockbox_api/ARCHIVE_FORMAT.md): lockbox archive details and page
|
|
391
|
-
layout.
|
|
392
|
-
- [Rust development](docs/rust_development.md): build, test, and API docs.
|
|
393
|
-
- [Dependency review](rust/docs/dependency_review.md): dependency and security
|
|
394
|
-
review notes.
|
|
395
|
-
|
|
396
|
-
## Development
|
|
397
|
-
|
|
398
|
-
Follow the [reVault terminology standard](docs/terminology.md) when updating
|
|
399
|
-
the manual, READMEs, CLI help, API guides, or other user-facing material.
|
|
400
|
-
|
|
401
|
-
Run the Rust checks:
|
|
402
|
-
|
|
403
|
-
```bash
|
|
404
|
-
cd rust
|
|
405
|
-
cargo fmt --all
|
|
406
|
-
cargo check --workspace --all-targets --all-features
|
|
407
|
-
cargo test --workspace
|
|
408
|
-
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
Generate Rust API docs:
|
|
412
|
-
|
|
413
|
-
```bash
|
|
414
|
-
cd rust
|
|
415
|
-
revault-tool dev generate-api-docs
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### Release checklist
|
|
419
|
-
|
|
420
|
-
Before publishing a component:
|
|
421
|
-
|
|
422
|
-
1. update its version and package README;
|
|
423
|
-
2. regenerate class and method documentation;
|
|
424
|
-
3. run the binding conformance examples;
|
|
425
|
-
4. run the manual validation job;
|
|
426
|
-
5. confirm migration notes and compatibility statements; and
|
|
427
|
-
6. retain the tagged repository documentation as the release snapshot.
|
|
428
|
-
|
|
429
|
-
For complete procedures, read the [CLI distribution guide](docs/cli_distribution.md)
|
|
430
|
-
and the [binding contribution and release guide](bindings/CONTRIBUTING.md).
|
|
31
|
+
RubyGems publishes a platform gem for each supported operating system and
|
|
32
|
+
architecture. Each gem contains the matching reVault library and a Ruby shim;
|
|
33
|
+
the package loads both through Fiddle. Install the gem matching the Ruby
|
|
34
|
+
process architecture.
|
|
431
35
|
|
|
432
|
-
|
|
36
|
+
`Revault.load(native_library_path)` can load a native library supplied by the
|
|
37
|
+
application. Otherwise, reVault checks `REVAULT_LIBRARY` and then the library
|
|
38
|
+
installed by the gem. A bare name uses the operating system search path.
|
|
39
|
+
Selection is shared by the process and occurs before the Ruby API loads.
|
|
433
40
|
|
|
434
|
-
|
|
41
|
+
The [complete method example index](https://github.com/onepub-dev/reVault/blob/main/bindings/API_EXAMPLES.md)
|
|
42
|
+
is maintained in the source repository.
|
|
435
43
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
44
|
+
```ruby
|
|
45
|
+
runtime = Revault.load # only loads the native runtime
|
|
46
|
+
signing = runtime.generate_profile_signing_key_pair
|
|
47
|
+
public_signing_key = signing.public_key
|
|
48
|
+
box = runtime.lockbox_create("\0" * 32)
|
|
49
|
+
box.set_owner_signing_key(signing) # Profile becomes this Lockbox's owner
|
|
50
|
+
box.add_file('/hello.txt', "hello\n", false)
|
|
51
|
+
box.set_variable('owner', 'alice')
|
|
52
|
+
box.set_secret_variable('token', 'secret')
|
|
53
|
+
box.with_secret_variable('token') do |token|
|
|
54
|
+
# Consume the temporary mutable String only inside this block.
|
|
55
|
+
end
|
|
56
|
+
box.commit
|
|
57
|
+
box.free
|
|
58
|
+
public_signing_key.free; signing.free
|
|
59
|
+
|
|
60
|
+
persistent = Revault::Vault.open_or_create('/tmp/revault-vault', Revault::SecretString.new('Vault passphrase'))
|
|
61
|
+
persistent.close
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The temporary secret String is overwritten after the block. Ruby strings are
|
|
65
|
+
not reliably zeroizable once copied, so do not retain or duplicate it.
|
|
66
|
+
`AgentSession` is explicit and caches selected content keys temporarily;
|
|
67
|
+
ordinary Lockbox operations never contact the agent.
|
|
68
|
+
|
|
69
|
+
## Core API concepts
|
|
70
|
+
|
|
71
|
+
- `Revault` loads the runtime.
|
|
72
|
+
- `Vault` owns persistent local state.
|
|
73
|
+
- `Lockbox` owns an open archive.
|
|
74
|
+
- `AgentSession` caches selected content keys.
|
|
75
|
+
|
|
76
|
+
Free or close each object independently.
|
|
77
|
+
|
|
78
|
+
## API documentation and support
|
|
79
|
+
|
|
80
|
+
The gem source documents the public classes and methods for its release. The
|
|
81
|
+
[method examples](https://github.com/onepub-dev/reVault/blob/main/bindings/API_EXAMPLES.md)
|
|
82
|
+
and [Ruby conformance program](https://github.com/onepub-dev/reVault/blob/main/bindings/e2e/ruby/conformance.rb)
|
|
83
|
+
cover the common operation inventory.
|
|
84
|
+
|
|
85
|
+
## Create, open, and replace
|
|
86
|
+
|
|
87
|
+
Open methods require existing Vaults and Lockboxes and never create missing
|
|
88
|
+
state. Use open or create only when creation is acceptable and replacement
|
|
89
|
+
methods only after an explicit destructive choice. `commit` persists pending
|
|
90
|
+
Lockbox changes; `close` or `free` releases the handle and content key held by the current process
|
|
91
|
+
without deleting the archive.
|
|
92
|
+
|
|
93
|
+
Open that archive with its Lockbox password, a profile key, or a credential
|
|
94
|
+
resolved from the Vault. A profile signing key becomes a Lockbox owner key only
|
|
95
|
+
after explicit assignment.
|
|
96
|
+
|
|
97
|
+
## Secrets, failures, and ownership
|
|
98
|
+
|
|
99
|
+
A vault passphrase, Lockbox password, and 32-byte content key are different
|
|
100
|
+
secrets. Prefer mutable owned strings with minimal lifetime and overwrite them
|
|
101
|
+
after use. Do not copy secret values received by a callback into retained Ruby
|
|
102
|
+
objects. Close objects that own native resources in `ensure` blocks.
|
|
103
|
+
|
|
104
|
+
Native failures raise typed exceptions with structured details. Public code
|
|
105
|
+
should not depend on transport handles or mutable global error state.
|
|
106
|
+
|
|
107
|
+
## Optional session agent
|
|
108
|
+
|
|
109
|
+
Ordinary Lockbox operations never start or consult the agent. Use
|
|
110
|
+
`AgentSession` when Lockbox keys need to be shared across processes or remain
|
|
111
|
+
available after the process that opened the Lockbox exits. Closing an entry
|
|
112
|
+
forgets the cached key, not the Lockbox file or a credential stored in the
|
|
113
|
+
Vault.
|
|
114
|
+
|
|
115
|
+
## Platform credential store
|
|
116
|
+
|
|
117
|
+
The operating system credential store can hold the Vault passphrase. The
|
|
118
|
+
user's operating system login normally unlocks that store. After login,
|
|
119
|
+
another process running as that user may be able to retrieve the passphrase if
|
|
120
|
+
the access policy applied to the saved Vault passphrase does not require
|
|
121
|
+
approval for each retrieval. Exact access depends on the operating system, the
|
|
122
|
+
credential store configuration, and that access policy.
|
|
123
|
+
|
|
124
|
+
A process that retrieves the Vault passphrase can open the Vault. The Vault
|
|
125
|
+
can then provide access to Lockboxes through profile keys or remembered
|
|
126
|
+
Lockbox passwords. Both remain encrypted inside the Vault; they are not copied
|
|
127
|
+
to the operating system credential store.
|
|
128
|
+
|
|
129
|
+
Agent expiry improves memory hygiene. It is not an authentication boundary
|
|
130
|
+
after login if the saved Vault passphrase can be retrieved without approval.
|
|
131
|
+
|
|
132
|
+
Missing or placeholder YARD class/method documentation is a binding defect.
|
|
133
|
+
|
|
134
|
+
## V4 storage compatibility
|
|
135
|
+
|
|
136
|
+
The v4 development core requires a matching rebuilt native runtime (or WASM
|
|
137
|
+
carrier) and migration of older Vault/Lockbox containers. Migrate the Vault
|
|
138
|
+
first with `lockbox doctor migrate vault --replace`, then each archive with
|
|
139
|
+
`lockbox doctor migrate lockbox <path> --replace`; retain the migration backups.
|
|
140
|
+
These changes do not add facade methods. Writable file opens inherit native
|
|
141
|
+
transaction recovery; explicit read-only opens can report recovery required.
|
|
142
|
+
A commit error may occur after publication, so reopen and inspect persisted
|
|
143
|
+
state before retrying. With library handles closed, use the CLI's
|
|
144
|
+
`lockbox <path> doctor compact` for explicit compaction; it discards old commit
|
|
145
|
+
history. See the repository's [v4 binding contract and release checks](https://github.com/onepub-dev/reVault/blob/master/bindings/README.md#v4-storage-and-transaction-maintenance).
|
|
146
|
+
## Reciprocal contact exchange
|
|
147
|
+
|
|
148
|
+
Use the shared Rust-backed `ContactExchange` workflow to exchange one Profile's
|
|
149
|
+
encryption and signing public keys in both directions. Sessions retain protected
|
|
150
|
+
Vault credentials but release every Vault lock before network calls or user
|
|
151
|
+
interaction. Compare both identities and the entire fingerprint through an
|
|
152
|
+
independently authenticated channel before saving a Contact.
|
|
153
|
+
|
|
154
|
+
The [exchange guide](https://github.com/onepub-dev/reVault/blob/main/bindings/EXCHANGE.md)
|
|
155
|
+
documents each language's entry point, credential ownership, retries, verification,
|
|
156
|
+
archive author checks, cancellation, and cleanup. The language's executable
|
|
157
|
+
conformance runner covers session creation, offline status decoding and cleanup;
|
|
158
|
+
the shared native/CLI tests cover reciprocal exchange and persisted archives.
|