Skip to content

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

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

cloudonly wants to merge 1 commit 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.

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

None yet

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)

1 participant