mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 19:35:06 +00:00
refactor(vaults): pick kv vault behaviour from class flags and keep the api batch size
This commit is contained in:
@@ -254,7 +254,7 @@ key_vaults:
|
||||
The backend talks to endpoints under `uri` (for example `GET {uri}/{service}/{kid}` to look up a single key). It interprets a numeric `code` field in each JSON response to detect errors such as an invalid token, rate limiting, or an invalid service tag.
|
||||
|
||||
!!! warning "This is unshackle's own protocol, not a generic vault client"
|
||||
The `API` backend expects unshackle's specific HTTP request and response shape. An API or HTTP key-vault endpoint built for a different project or service will generally *not* be compatible. You cannot point this at an arbitrary third-party vault API and expect it to work. To bridge another service, put an adapter in front of it that speaks this format, or use the `HTTP` backend if one of its wire protocols matches. When pushing many keys at once it batches requests and automatically shrinks the batch size if the server rejects an over-large request.
|
||||
The `API` backend expects unshackle's specific HTTP request and response shape. An API or HTTP key-vault endpoint built for a different project or service will generally *not* be compatible. You cannot point this at an arbitrary third-party vault API and expect it to work. To bridge another service, put an adapter in front of it that speaks this format, or use the `HTTP` backend if one of its wire protocols matches. When pushing many keys at once it batches requests and automatically shrinks the batch size if the server rejects an over-large request. After a push that succeeds at a smaller size, later pushes to that vault start at that size.
|
||||
|
||||
!!! tip "DecryptLabs shortcut"
|
||||
An `API` vault whose `name` contains `decrypt_labs` will have its `token` filled in automatically from a global `decrypt_labs_api_key` in your config if you leave `token` unset. This lets you keep the API key in one place.
|
||||
@@ -284,6 +284,8 @@ $ unshackle kv add keys.txt EXAMPLE local shared
|
||||
|
||||
The service argument (`EXAMPLE` above) is normalized to its canonical tag automatically. Keys that already exist in a vault are reported as skipped.
|
||||
|
||||
If a vault answers and refuses the content keys, `kv add` shows one warning and continues with the next vault. If a vault is unreachable or still rate limited, `kv add` stops with an error.
|
||||
|
||||
### `kv search`: find a content key by KID
|
||||
|
||||
Search your vaults for a KID and print any matching content key.
|
||||
@@ -333,6 +335,8 @@ $ unshackle kv copy local ~/Downloads/key_store.db -s EXAMPLE
|
||||
|
||||
With `--service`, `kv copy` reads the table named by the service's vault tag and the table named by its plain tag. It writes both into the vault-tag table, which is the table a download reads. Without `--service`, each table keeps its name.
|
||||
|
||||
If the destination vault answers and refuses the content keys of a service, `kv copy` shows one warning and continues with the next service. If the destination vault is unreachable or still rate limited, `kv copy` stops with an error.
|
||||
|
||||
A pair the destination vault has flagged in `bad_keys` is left behind, so a copy does not undo a flag. `bad_keys` is never treated as a service, so its rows are never copied into a service table.
|
||||
|
||||
### `kv sync`: mirror vaults both ways
|
||||
|
||||
Reference in New Issue
Block a user