Support private update feeds with an access token #2
Loading…
Reference in a new issue
No description provided.
Delete branch "f/private-update-feeds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WithVelopackUpdates gains an accessToken overload passed through to the Gitea/GitHub source, so private repositories can serve auto-updates. Null keeps the feed anonymous. Version 3.4.0.
904bd7b6e9b8435e77c7🤖 Claude AI Code Review
Code Review: Support private update feeds with an access token
1. Summary
This PR adds an
accessTokenoverload toWithVelopackUpdates, threading a token through to theGithubSource/GiteaSourceso private repositories can serve auto-updates. It also includes an unrelated but valid CI fix (reverting the SDK from .NET 11-preview back to .NET 10) and bumps the version to 3.4.0. The changes are small, focused, and well-documented.2. Code Quality
Strengths:
WithVelopackUpdates(repoUrl, autoCheck)delegates to the new overload, avoiding duplication.string.IsNullOrWhiteSpace(accessToken) ? null : accessTokennormalization is a nice touch — it defends against empty/whitespace tokens producing malformed auth requests.features.md, and release notes all consistently emphasize the "token is a secret" guidance.Minor observations:
autoCheckpositionally:WithVelopackUpdates(repoUrl, accessToken: null, autoCheck). This works but mixing named and positional args reads slightly oddly. ConsiderWithVelopackUpdates(repoUrl, accessToken: null, autoCheck: autoCheck)for clarity.3. Potential Issues
Overload resolution ambiguity (worth verifying):
Both overloads have
autoCheckwith a default value:A call like
WithVelopackUpdates("url", false)still resolves unambiguously to thebooloverload (better match thanstring?), so existing call sites are safe. ButWithVelopackUpdates("url", null)would now bind to the new overload — this is the intended behavior, just flag it as a subtle behavioral surface. No breaking change for existing callers.Token in memory / logging (low risk, worth a glance):
_options.UpdateAccessTokenfor the process lifetime. ConfirmCheapAvaloniaBlazorOptionsis not serialized anywhere (e.g., diagnostic dumps, logging of options objects) that would leak the token. If options are ever logged, the token should be redacted.UpdateServiceerror paths (not visible in this diff, but thecatchblock referenced at line 104 should be checked).Documentation accuracy:
The old doc line "Private update feeds are not supported yet" is correctly removed. Good — no stale claims left behind.
CI change scope:
The
.forgejo/workflows/build.ymlSDK revert is unrelated to the feature. It's a legitimate fix with a clear explanatory comment, but bundling an infra fix into a feature PR slightly muddies the changelog. Not blocking.4. Recommendations
[JsonIgnore]or similar ifUpdateAccessTokencould ever end up in serialized diagnostics, and consider overridingToString()redaction if the options object is logged.Func<string?>/callback for token retrieval (future enhancement, not blocking) — private feed tokens sometimes expire. A pull-based accessor would let consumers refresh tokens without rebuilding the host. For now the static string is fine given Velopack's API shape.autoCheck: autoCheckin the delegating call.GithubSource/GiteaSourcetreat anulltoken identically to the previous behavior — since the third arg (false) is preserved, this should be a pure superset. Worth a quick confirmation against the Velopack version in use.5. Verdict
APPROVE (with minor suggestions)
This is a well-scoped, well-documented change that maintains backward compatibility. The token normalization and clear secret-handling guidance show good attention to detail. The only follow-ups are defensive checks around whether the options object could leak the token via logging/serialization — worth confirming before merge, but not blocking given the token is only passed to the Velopack source constructor in the visible code path.
📊 Tokens: 4196 input + 1597 output | 💰 Cost: ~$0.0609
Generated by Claude Opus 4.8 via Gitea Actions