Skip to content

Add URI-scheme value reference resolver#293

Merged
JE-Chen merged 2 commits into
devfrom
feat/secret-ref-batch
Jun 21, 2026
Merged

Add URI-scheme value reference resolver#293
JE-Chen merged 2 commits into
devfrom
feat/secret-ref-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

Adds general read-time value indirection — store a pointer (env://TOKEN, file://./token, secret://api-key) in config rather than the value. interpolate hardcoded only ${secrets.NAME} and AssetStore references were vault-name-only.

  • resolve_ref(ref, *, env, secret_resolver, base_dir)env:// (injectable mapping → os.environ), file:// (realpath + optional base_dir traversal guard), secret:// (injectable resolver → governance broker).
  • resolve_refs_in(obj, ...) — recursively resolves every reference in a nested structure.
  • is_ref(value), RefResolver (bundles injectable backends), SecretRefError.

Layers

  • Headless core: utils/secret_ref/ (pure stdlib os/re, zero PySide6).
  • Facade: 5 symbols + __all__.
  • Executor: AC_resolve_ref, AC_resolve_refs.
  • MCP: ac_resolve_ref, ac_resolve_refs (read-only).
  • Script Builder: both under Security.
  • Tests: test/unit_test/headless/test_secret_ref_batch.py (10 tests; injected env/secret backends, traversal guard).
  • Docs: v85_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest test/unit_test/headless/test_secret_ref_batch.py → 10 passed.
  • ruff check je_auto_control/ clean; pylint 10.00/10; bandit clean; radon CC clean.
  • Package stays Qt-free.

interpolate hardcoded only ${secrets.NAME} and AssetStore references were
vault-name-only — there was no general read-time indirection. Add a
resolver for env://, file:// (with an optional base_dir traversal guard),
and secret:// (injectable resolver or the governance broker), plus
recursive resolution of nested structures. The env reader, secret
resolver, and base dir are injectable. Wired through facade, executor
(AC_resolve_ref / AC_resolve_refs), MCP, and the Script Builder with a
headless test batch and EN/Zh docs.
@codacy-production

codacy-production Bot commented Jun 21, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 51 complexity · 0 duplication

Metric Results
Complexity 51
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen
JE-Chen merged commit 09e9cb8 into dev Jun 21, 2026
16 checks passed
@JE-Chen
JE-Chen deleted the feat/secret-ref-batch branch June 21, 2026 17:38
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant