Commit Graph
7 Commits
Author SHA1 Message Date
Zayn Jarvis 0ea5815748 fix(crypto): 禁止重写 Vault root key on 临时 (503) read failures (#3423)
* fix(crypto): never overwrite Vault root key on transient read failures

Sweep finding B-01

* fix(crypto): clear cached ephemeral root key when Vault persist fails

The InvalidPath create branch cached the freshly generated root key in
self._root_key before encrypting/persisting it. If _encrypt_with_vault or
the KV write failed (transient transit/KV outage), get_root_key raised but
left the never-persisted key cached, so a retry returned it via the
`self._root_key is not None` fast path and encrypted data with a key that
vanishes on restart — the data-loss class this provider guards.

Wrap encrypt+persist in one try and null the cache before raising; add a
regression asserting the cache is cleared and the next call re-reads Vault.

Addresses the blocking review finding on #3423.
2026-07-24 17:30:34 +08:00
baojun-zhang b441622ee6 feat(metric): add metric system (#1357)
* feat(metric): add metric system

* feat(metric): add metric system

* feat(metric): add metric system

* fix(metric): do not cancel refresh tasks on deadline; trust only authenticated account id; avoid per-scrape rerank clients

* doc(metric): add metric guide doc

* doc(metric): add metric guide doc

* doc(metric): add metric guide doc

* doc(metric): add metric guide doc

* feat(metric): fix bug & change account dimension switch to default true
2026-04-14 20:55:02 +08:00
yc111233andyc111233 89c3aa34b9 test(crypto): add regression tests for decrypting short plaintext files (#1223)
Add tests covering the fix in PR #1163 where decrypt() raised
'Ciphertext too short' on plaintext files shorter than 4 bytes.

Tests added:
- test_decrypt_empty_plaintext: raw b'' returns b''
- test_decrypt_short_plaintext_less_than_4_bytes: b'X', b'AB', b'ABC' return as-is
- test_decrypt_magic_prefix_without_full_header: b'OVE1' raises CorruptedCiphertextError

Co-authored-by: yc111233 <yc111233@users.noreply.github.com>
2026-04-05 14:29:31 +08:00
baojun-zhang 821287dcec feat(encryption): add encrypt unit test for plaintext shorter than the magic header (#1217) 2026-04-05 13:06:46 +08:00
MaojiaShengandopenviking ce998873f9 lisence: change the main lisence to AGPL-3.0 (#1085)
* lisence: change the main lisence from Apache-2.0 to AGPL-v3

* lisence: change the main lisence from Apache-2.0 to AGPL-v3

* lisence: change the main lisence from Apache-2.0 to AGPL-v3

---------

Co-authored-by: openviking <openviking@example.com>
2026-03-30 14:37:42 +08:00
baojun-zhang 5bbb22a6ef feat: add encrypt doc && refactoring encrypt code (#893)
* feat: add encrypt doc && fix Partial reads/wrong location problem && refactoring duplicated code && add

* feat: reformat code

* feat: resolve comment

* feat: resolve comment

* feat: resolve comment
2026-03-23 19:23:11 +08:00
baojun-zhang 8cdecd9163 feat: Add multi-tenant file encryption capability (#828)
* feat: Add multi-tenant file encryption capability

* feat: move cli command `ov crypto` to `ov system crypto` && ruff format && add encryption config example

* feat: reformat code

* feat: adjust crypto.rs to support diff platform

* feat: reformat code
2026-03-21 13:35:46 +08:00