Skip to content

feat(providers): support subtree path credential templates - #5675

Open
cloudonly wants to merge 3 commits into
NVIDIA:mainfrom
cloudonly:feat/5544-path-template-subtree/cloudonly
Open

cloudonly wants to merge 3 commits into
NVIDIA:mainfrom
cloudonly:feat/5544-path-template-subtree/cloudonly

Conversation

@cloudonly

Copy link
Copy Markdown

Summary

Allow a terminal /** in a credential's path_template so a bot can use one token for getUpdates, sendMessage, and other API methods. Templates without that suffix retain exact matching, and the credential must remain in its declared path slot.

Related Issue

Closes #5544

Changes

  • Share path-template validation between provider credential compilation and request-time credential resolution.
  • Match the fixed template path and its descendants while rejecting misplaced or repeated credential placeholders, undeclared suffixes on the credential segment, and dot-segment traversal.
  • Preserve independent endpoint authorization and literal matching for stars outside the terminal /** suffix.
  • Cover credential binding, REST relay, and forward proxy behavior with regression tests.
  • Add a concurrent HTTP client regression: keep getUpdates pending, complete sendMessage with the same credential, and only then release the polling response.
  • Update provider documentation and CLI guidance with the Telegram-style /bot{credential}/** example.

Release Notes

Testing

  • Rust formatting, scoped Clippy, and library tests pass
  • Unit tests added/updated
  • E2E tests added/updated

Validation:

Rust checks use the repository-pinned Rust 1.95.0 toolchain with default features:

  • cargo fmt -p openshell-core -p openshell-supervisor-network -- --check — passed.
  • cargo clippy --locked -p openshell-core -p openshell-supervisor-network --all-targets -- -D warnings — passed.
  • cargo test --locked -p openshell-core -p openshell-supervisor-network --lib — 2,378 passed, 2 ignored (655 core tests and 1,723 network tests).
  • npx --yes markdownlint-cli2@0.22.0 docs/how-it-works/providers/overview.mdx docs/how-it-works/providers/profiles.mdx skills/openshell-cli/SKILL.md — passed before rebasing, 0 errors. The documentation edits were unchanged by the rebase; a rerun was unavailable in this environment.
  • uv run tasks/scripts/check_docs_nav.py — passed.
  • Negative control: temporarily disabling subtree placement makes the new concurrent regression fail because the request location is unauthorized; restoring subtree placement makes it pass.

The concurrent test uses a shared HTTP client and production request parsing, credential resolution, body forwarding, and response relay against a loopback Bot API fixture. Live Telegram SDK/API and sandbox E2E tests were not run. Fern strict validation was not run in this environment.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable)

Allow a terminal /** in path_template so one path-placed credential serves multiple API methods while preserving exact templates and endpoint authorization. Keep the credential slot anchored and reject duplicate, misplaced, and traversal-bearing references.

Cover long-polling getUpdates alongside sendMessage using one HTTP client and one credential through the production REST relay. Update provider documentation and CLI guidance.

Closes NVIDIA#5544

Signed-off-by: Luomu <enrondg@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@cloudonly

Copy link
Copy Markdown
Author

I have read the DCO document and I hereby sign the DCO.

@johntmyers johntmyers added the test:e2e Requires end-to-end coverage label Nov 19, 2026
@johntmyers

Copy link
Copy Markdown
Collaborator

/ok to test c89a978

@github-actions

Copy link
Copy Markdown

Label test:e2e applied, but pull-request/5675 does not exist yet. A maintainer needs to comment /ok to test c89a978f5ef3f6a66fd65834a8119b56dfbb3d32 to mirror this PR. Once the mirror exists, re-apply the label or re-run Branch E2E Checks from the Actions tab.

@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

PR Review Status

The initial code review found no blocking findings. The subtree matching keeps the credential in its declared slot, preserves separate endpoint authorization, and includes regression coverage plus provider documentation updates.

I applied test:e2e and posted /ok to test for the current head. The mirror now matches, Branch Checks and Helm Lint are queued or running, E2E is running, and Trivy Changes is queued after workflow approval. Gator will inspect the results next cycle.

Blocking findings:

  • No blocking findings remain.

Carried findings:

  • None.

Non-blocking suggestions:

  • None.
Gator metadata
  • Validation: Implements accepted issue Allow a wildcard/prefix in path_template for path-placed credentials (e.g. Telegram Bot API) #5544 with focused provider credential subtree matching.
  • Docs: Provider overview, profile configuration, and CLI skill updated; no navigation change needed.
  • Checks: DCO and vouch pass; required current-head workflows queued or running.
  • E2E: test:e2e applied; Branch E2E Checks run 44632740976 is in progress.
  • Head SHA: c89a978f5ef3f6a66fd65834a8119b56dfbb3d32
  • Base SHA: ecce59560682d2bfe9d62c710063b061b6077939
  • Merge base SHA: 96fabf3e3b0f975d9635e847b86944ffc3a02c24
  • Patch ID: 3819c494b04285e26825d6bf7581ed61334ef875
  • Gator payload: 13
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added the gator:watch-pipeline Gator is monitoring PR CI/CD status label Nov 19, 2026
@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. configuration — No explicit risk acceptance found

path_template: /bot{credential}/** previously matched that literal path only but now matches the base path and its descendants.

  • Impact: Existing profiles relying on literal terminal /** matching now resolve credentials for previously rejected descendant requests without any profile edit.
  • Action: Preserve exact matching for existing path_template values and introduce subtree matching through an explicit opt-in with migration guidance.
  • PR: feat(providers): support subtree path credential templates #5675
Review details
  • Execution: complete
  • Candidate: PR #5675 (8ae6ba1155c328efafd12ed2d059c939774459f6)
  • Baseline: ecce59560682d2bfe9d62c710063b061b6077939 (ecce59560682d2bfe9d62c710063b061b6077939)
  • Reviewed: rust-sdk, python-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
@johntmyers johntmyers added gator:approval-needed Gator completed review; maintainer approval needed gator:in-review Gator is reviewing or awaiting PR review feedback and removed gator:watch-pipeline Gator is monitoring PR CI/CD status gator:approval-needed Gator completed review; maintainer approval needed labels Nov 19, 2026
@johntmyers

Copy link
Copy Markdown
Collaborator

/ok to test 0e4eb42

@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

PR Review Status

The follow-up code review found no blocking findings. The new path_subtree opt-in preserves exact matching for existing path credentials, keeps the credential in its declared slot, and rejects ambiguous encoded paths. Regression coverage and provider documentation were updated with the new configuration.

I refreshed the test mirror for this head and approved the required Trivy workflow. Helm Lint passed; Branch Checks, E2E, and Trivy are queued or running. Gator will inspect their results next cycle.

Blocking findings:

  • No blocking findings remain.

Carried findings:

  • None.
Gator metadata
  • Validation: Focused implementation of accepted issue Allow a wildcard/prefix in path_template for path-placed credentials (e.g. Telegram Bot API) #5544; the explicit subtree style satisfies its opt-in prefix-matching use case.
  • Docs: Provider overview, profile configuration, and CLI skill updated; no navigation change needed.
  • Checks: DCO and issue acceptance pass. Required current-head workflows have started; Helm Lint passed.
  • E2E: test:e2e remains applied; current-head Branch E2E Checks run 44640188733 is queued.
  • Head SHA: 0e4eb426335ccfb1f002adae6ae8103660657d3c
  • Base SHA: ecce59560682d2bfe9d62c710063b061b6077939
  • Merge base SHA: 96fabf3e3b0f975d9635e847b86944ffc3a02c24
  • Patch ID: dfea91b299f34cc6ad15fd81d0266234a711a38b
  • Gator payload: 13
  • Review mode: follow_up
  • Previous reviewed SHA: c89a978f5ef3f6a66fd65834a8119b56dfbb3d32
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:blocked Gator is blocked by process or repository gates and removed gator:in-review Gator is reviewing or awaiting PR review feedback gator:watch-pipeline Gator is monitoring PR CI/CD status labels Nov 19, 2026
Signed-off-by: Luomu <enrondg@gmail.com>
@johntmyers

Copy link
Copy Markdown
Collaborator

/ok to test c3ea334

@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

PR Review Status

The follow-up review found no blocking findings. Both previously reviewed author commits are unchanged; the merge resolution adopts the upstream provider overview, and the profile documentation retains the explicit path_subtree configuration guidance.

I refreshed the test mirror for this head and authorized the required Trivy workflow. Helm Lint passed; Branch Checks and E2E are running, and Trivy is queued. Gator will inspect the results next cycle.

Blocking findings:

  • No blocking findings remain.

Carried findings:

  • None.
Gator metadata
  • Validation: Focused implementation of accepted issue Allow a wildcard/prefix in path_template for path-placed credentials (e.g. Telegram Bot API) #5544.
  • Docs: Profile configuration and CLI guidance cover subtree placement; overview reconciled with upstream. No navigation change needed.
  • Checks: DCO and issue acceptance passed; Helm Lint passed. Current-head Branch Checks run 44668264141 is running; Trivy Changes run 44666997479 is queued.
  • E2E: test:e2e remains applied; current-head Branch E2E Checks run 44668264428 is running.
  • Head SHA: c3ea334a7bafa5881af209440ad99fc9f00c5cf1
  • Base SHA: c24fcd232f84c132d1e9c163b0375e5c6c8e0614
  • Merge base SHA: c24fcd232f84c132d1e9c163b0375e5c6c8e0614
  • Patch ID: c40debe5cd3cf1cfa5af384563dd8176e9e59817
  • Gator payload: 13
  • Review mode: follow_up
  • Previous reviewed SHA: 0e4eb426335ccfb1f002adae6ae8103660657d3c
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:watch-pipeline

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status and removed gator:blocked Gator is blocked by process or repository gates labels Nov 20, 2026

This branch has not been deployed

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

Labels

gator:watch-pipeline Gator is monitoring PR CI/CD status test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow a wildcard/prefix in path_template for path-placed credentials (e.g. Telegram Bot API)

2 participants