Skip to content

Allow custom manifest sources via [manifest] url template + format - #201

Open
aitronz wants to merge 1 commit into
OpenSteam001:mainfrom
aitronz:manifest-custom-sources
Open

aitronz wants to merge 1 commit into
OpenSteam001:mainfrom
aitronz:manifest-custom-sources

Conversation

@aitronz

@aitronz aitronz commented Sep 13, 2026

Copy link
Copy Markdown

Why

Manifest providers are hardcoded: 3 entries in kProviders (src/Utils/SteamMetadata/ManifestClient.cpp), selected by name through [manifest] url. Anyone running their own request-code endpoint had to patch code and rebuild to use it.

What

  • [manifest] url now accepts a built-in name (opensteamtool / wudrm / steamrun) or a custom http(s) URL template containing a {gid} placeholder.
  • New [manifest] format key selects the response parser for custom URLs: plain (bare digits, default) or steamrun ({"content":"..."}). Built-in providers keep their hardcoded parsers, so existing configs cannot break.
  • Custom templates are validated at config time with the same authority rules Http::Execute enforces (non-empty host, valid :port), so a malformed URL warns and falls back to the default instead of installing a dead provider.
  • plain parsing is strict (full-consumption via Numbers::ParseUInt64, trailing newline tolerated), so error pages starting with digits are rejected rather than misread as codes.
  • The default provider name is a single shared constant (ManifestClient::kDefaultProviderName); invalid url / unknown format log a warning and fall back to it (existing fallback behavior).
  • Lua fetch_manifest_code / fetch_manifest_code_ex keep top priority, untouched.
  • Docs updated: opensteamtool.example.toml + EN/ES/ZH READMEs.
[manifest]
url = "https://my.server/manifest/{gid}"
format = "plain"

Verification

  • git diff --check clean on all touched files; content diffs reviewed.
  • Validation/parsing logic exercised with a harness compiled against the real Numbers.cpp (strict rejections, newline tolerance, overflow, bad ports/hosts/schemes — all pass).
  • No test infra exists in this repo; full build left to CI (Windows-only codebase, developed on Linux).
  • Behavior matrix covered by construction: built-in names unchanged, custom plain/steamrun, invalid url → warn + default, unknown format → warn + plain.

Out of scope

Non request-code protocols (auth headers, app_id-keyed file-download APIs serving manifest ZIPs) cannot be expressed as a URL template — those belong in manifest.lua (http_get/http_post with headers), which already supports arbitrary endpoints.

Copilot AI lite review requested due to automatic review settings September 13, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Plain parsing accepts trailing data, and custom URL validation mishandles query-only or malformed templates.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds configurable custom HTTP manifest sources with {gid} URL templates and selectable response formats while preserving built-in providers and Lua precedence.

Changes:

  • Adds plain and steamrun custom manifest parsers.
  • Updates configuration fallback behavior and documentation.
  • Normalizes line endings in touched files.
File summaries
File Summary
src/xinput1_4/xinput1_4.def Line-ending normalization.
src/Utils/SteamMetadata/ManifestClient.h Custom provider API declarations.
src/Utils/SteamMetadata/ManifestClient.cpp Custom URL providers and response parsing; URL validation and strict parsing findings remain.
src/Utils/Logging/Log.h Line-ending normalization.
src/Utils/Config/LuaFileWatcher.h Line-ending normalization.
src/Utils/Config/Config.h Manifest configuration documentation updates.
src/Utils/Config/Config.cpp Manifest format loading and provider fallback handling.
src/Hook/Hooks_Package.h Line-ending normalization.
src/Hook/Hooks_CallBack.h Line-ending normalization.
src/Hook/Hooks_CallBack.cpp Line-ending normalization.
src/dwmapi/dwmapi.cpp Line-ending normalization.
src/dllmain.h Line-ending normalization.
README.md English documentation updates.
README_ZH.md Chinese documentation updates.
README_ES.md Spanish documentation updates.
opensteamtool.example.toml Custom manifest configuration example.
build.bat Line-ending normalization.
.github/workflows/ci.yml Line-ending normalization.
Review details

Suppressed comments (1)

src/Utils/SteamMetadata/ManifestClient.cpp:75

  • IsCustomTemplate accepts query-only URLs such as https://host?gid={gid}, but OSTPlatform::Http::ParseUrl treats the whole host?gid=... string as the hostname when there is no slash, so WinHttpConnect cannot resolve the request. Since the new setting is documented as an arbitrary http(s) URL template, either normalize this valid URI form in the HTTP parser or reject/document it explicitly instead of activating a provider that will fail on every request.
        const bool http = url.starts_with("http://") || url.starts_with("https://");
        return http && url.find("{gid}") != std::string_view::npos;
  • Files reviewed: 8/18 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Utils/SteamMetadata/ManifestClient.cpp Outdated
Comment thread src/Utils/SteamMetadata/ManifestClient.cpp
@aitronz
aitronz force-pushed the manifest-custom-sources branch 5 times, most recently from 3a745e2 to 96fca33 Compare September 13, 2026 19:03
[manifest] url now accepts a built-in provider name or a custom
http(s) URL template containing {gid}. A new [manifest] format key
("plain" | "steamrun", default "plain") selects the response
parser for custom URLs; built-in providers keep their hardcoded
parsers. Invalid values warn and fall back to opensteamtool.
@aitronz
aitronz force-pushed the manifest-custom-sources branch from 96fca33 to 3d7bf81 Compare September 13, 2026 19:09
aitronz added a commit to aitronz/OpenSteamTool-exp that referenced this pull request Sep 13, 2026
…t] url template + format (aitronz)

# Conflicts:
#	README.md
YS-CODE-GO added a commit to YS-CODE-GO/OpenSteamTool that referenced this pull request Sep 14, 2026
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.

2 participants