Skip to content

[Scanning] Parse OCI Link headers per RFC 8288 - #380

Merged
LarsLaskowski merged 3 commits into
mainfrom
claude/admiring-mayer-lcophh
Oct 30, 2026
Merged

LarsLaskowski merged 3 commits into
mainfrom
claude/admiring-mayer-lcophh

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

OCI tag listings split every Link header value on , before looking for rel="next", so a next-page target containing a comma was cut in two and the listing ended as succeeded with only part of the tags. The header is now parsed per RFC 8288: entries are split only on commas outside an angle-bracketed URI target and outside quoted parameters, and next is matched as an exact, case-insensitive token of the first rel parameter (quoted, unquoted or as part of a relation list). The complete target is still handed unchanged to the same-origin pagination guard. The fix is contributed by @seragAhmed; the two original commits keep their authorship.

🎫 Issues

Closes #302

💬 Reviewer Notes

Look at GetNextTagsLink and the new Link header scanner in src/DockerUpdateGuard/Images/OciRegistryClient.cs; PaginationLinkGuard (record 0004) is untouched and still validates every target before a request is sent. A malformed entry is skipped and, when no entry has a well-formed next target, the listing ends as succeeded with the tags read so far, as before; docs/areas/registries.md describes this. The missing page cap on the paging loop is a separate, older problem tracked in #301.

📑 Test Plan

New tests in OciRegistryClientTests cover a comma inside the target, several entries and header values, a quoted comma, a fake rel inside title, an escaped quote, unquoted rel=next, a relation list, a second rel parameter, an unterminated target and a foreign comma-bearing target that must still fail. The full suite passes (1005 host and 21 data tests) with 97.9 % coverage on changed lines.

✅ Checklist

  • I have added or updated Unit Tests for the change.
  • I have tested my changes.
  • I have run Format and Build from .squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file.
  • The Coverage gate in .squad/stack.md passes (line coverage on new or changed production code and overall).
  • I have updated the project documentation (README.md, ARCHITECTURE.md) to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • New dependencies, if any, were added the way Dependencies in .squad/stack.md prescribes.
  • The C# rules in csharp.instructions.md are followed.

⏭ Next Steps

The paging loop has no page cap or loop detection (#301).

@LarsLaskowski LarsLaskowski added the bug Something isn't working label Oct 30, 2026 — with Claude
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski marked this pull request as ready for review October 30, 2026 19:21
@LarsLaskowski
LarsLaskowski merged commit 5786626 into main Oct 30, 2026
6 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/admiring-mayer-lcophh branch October 30, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OCI tag listing truncates a Link header target that contains a comma

3 participants