Skip to content

Add digest field to versions API for updater digest checking - #194

Merged
admdly merged 2 commits into
mainfrom
add-release-digest-field
Aug 13, 2026
Merged

Add digest field to versions API for updater digest checking#194
admdly merged 2 commits into
mainfrom
add-release-digest-field

Conversation

@admdly

@admdly admdly commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a digest field to release objects returned by the versions/v1 API, so the FOSSBilling updater can verify downloaded update packages via SHA-256 digest checking.

GitHub already computes and returns a SHA-256 digest (sha256:<hex>) for each release asset in its Releases API response, so this is just surfaced through — no new subrequest or hashing needed. digest is null for older assets predating GitHub's digest support.

This is a purely additive, non-breaking change to the existing response shape.

GitHub computes a SHA-256 digest for each release asset. Surface it as
`digest` (sha256:<hex>, or null if GitHub hasn't computed one) on
release objects returned by the versions/v1 API, so the FOSSBilling
updater can verify downloaded update packages against it.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
🔵 In progress
View logs
api ac1ca97 Commit Preview URL

Branch Preview URL
Aug 13 2026, 06:23 AM

@admdly admdly self-assigned this Aug 13, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/services/versions/v1/interfaces.ts">

<violation number="1" location="src/services/versions/v1/interfaces.ts:12">
P2: When an existing `CACHE_KV` entry is served after deployment, the API omits `digest` instead of returning the declared `null` fallback, so digest-aware consumers cannot verify those releases until manual `/update` or cache expiry. Normalize legacy cached releases before returning them, or version and invalidate the cache.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/versions/v1/interfaces.ts
Cache entries written before the digest field was introduced omit the
key entirely rather than storing null. Since the code only cast the
parsed JSON to Releases without normalizing, those legacy entries were
served with digest absent instead of the documented null fallback,
until a manual /update or the 24h cache TTL refreshed them.

Normalize digest to null for any cached release missing it in
parseCachedReleases, which both the cache-hit and stale-fallback paths
go through.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

Auto-approved: Adds a nullable 'digest' field to the versions API response—purely additive and non-breaking, surfaced from GitHub's existing SHA-256 data. Tests confirm both new and cache-normalized behavior.

Re-trigger cubic

@admdly
admdly merged commit aac7586 into main Aug 13, 2026
9 checks passed
@admdly
admdly deleted the add-release-digest-field branch August 13, 2026 06:28
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