Skip to content

feat: optimize ov privacy CLI commands - #6161

Merged
yeshion23333 merged 8 commits into
volcengine:mainfrom
MaojiaSheng:main
Oct 16, 2026
Merged

yeshion23333 merged 8 commits into
volcengine:mainfrom
MaojiaSheng:main

Conversation

@MaojiaSheng

@MaojiaSheng MaojiaSheng commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Description

以保存 GitHub Personal Access Token(PAT)为例:

# 首次写入或轮换 GitHub PAT;credential/github 是 target,pat 是 field
ov privacy upsert credential github --field-pat 'github_pat_...'

# target 只有 pat 一个字段时可以省略 field
ov privacy reference credential github
ov privacy resolve credential github

# 显式指定 field 的等价形式
ov privacy reference credential github pat
ov privacy resolve credential github pat
ov privacy resolve '{{ov_privacy:alice:viking://~/privacy/credential/github#/values/pat}}'

# 查看/切换历史版本,或删除 pat 字段(最后一个字段删除后 target 也会删除)
ov privacy versions credential github
ov privacy activate credential github 1
ov privacy delete credential github pat --yes

# 扫描一个明确的 URI;默认仅报告,--fix 才会替换明文 PAT
ov privacy scan --uri viking://~/resources/project-a
image

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Extended ov privacy with field-oriented upsert, reference, resolve, delete, version, and URI-scoped scan workflows.
  • Added owner-bound Privacy references with safe single-field discovery and explicit plaintext resolution.
  • Added server-side atomic field PATCH, field deletion, target cleanup, identifier validation, and payload capacity limits.
  • Added a native Rust Aho-Corasick Privacy matcher with PyO3 bindings, bounded match allocation, and process-local revision/TTL caching.
  • Applied deterministic Privacy sanitization before persistence and indexing across content writes, Skills, Resources, and direct VikingFS text writes.
  • Added fail-closed handling for ambiguous values, oversized content, and excessively dense replacements.
  • Added bounded ov privacy scan --uri dry-run/repair support with node, file-size, byte, match, repair, duration, rate, and concurrency limits.
  • Unified one shared PrivacySanitizer instance across service components and bounded visible-read sanitization.
  • Updated bilingual Privacy API/concept documentation and GitHub PAT examples.
  • Added API, service, sanitizer, write-path, validation, scan, concurrency, dotfile, and Skill-description regression coverage.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

@yeshion23333 yeshion23333 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复现两个需要修复的正确性问题:更新 Skill 会删除其正文仍在引用的 Privacy 配置;追加写入时,若已登记的密钥跨越追加边界,完整密钥会绕过脱敏,以明文落盘并进入后续索引。

Comment thread openviking/utils/skill_processor.py
Comment thread openviking/storage/content_write.py
@yeshion23333
yeshion23333 merged commit 97bf0fd into volcengine:main Oct 16, 2026
10 of 11 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants