Skip to content

Validate media type regex for OCI artifact types per RFC 6838#467

Closed
Copilot wants to merge 1 commit intoalert-autofix-38from
copilot/sub-pr-466
Closed

Validate media type regex for OCI artifact types per RFC 6838#467
Copilot wants to merge 1 commit intoalert-autofix-38from
copilot/sub-pr-466

Conversation

Copy link
Contributor

Copilot AI commented Nov 22, 2025

Verified that the regex on line 60 of ArtifactType.java correctly validates both standard media types and OCI artifact types according to RFC 6838/RFC 2045.

Validation Performed

  • Confirmed regex implements RFC 2045 token specification: [A-Za-z0-9!#$%&'*+\-.^_{|}~]`
  • Verified all OCI media types in codebase pass validation (e.g., application/vnd.oci.image.manifest.v1+json)
  • Tested edge cases including all valid token special characters and invalid tspecials
  • All unit tests pass (3/3 in ArtifactTypeTest)

Key Points

OCI artifact types are media types—both follow RFC 6838. The regex correctly:

  • Validates type/subtype format with RFC 2045 tokens
  • Allows valid characters: alphanumerics + ! # $ % & ' * + - . ^ _ { | } ~`
  • Rejects invalid characters: spaces, control chars, tspecials (<>()@,;:\"[]?=)

No code changes required—the existing implementation is correct.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update regular expression for artifact type validation Validate media type regex for OCI artifact types per RFC 6838 Nov 22, 2025
Copilot AI requested a review from jonesbusy November 22, 2025 15:36
@jonesbusy jonesbusy closed this Nov 22, 2025
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