Skip to content

Support mailto and acct scheme identity names in x-jsonld-self - #802

Merged
jviotti merged 1 commit into
mainfrom
jsonld-self-registry
Aug 5, 2026
Merged

Support mailto and acct scheme identity names in x-jsonld-self#802
jviotti merged 1 commit into
mainfrom
jsonld-self-registry

Conversation

@jviotti

@jviotti jviotti commented Aug 5, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Aug 5, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR extends the JSON-LD/RDF emission support for the x-jsonld-self keyword to accept scheme identity names in addition to RFC 6570 URI templates.

Changes:

  • Documented the new `x-jsonld-self` behavior and defined the supported scheme names: mailto and acct.
  • Added RDF tests covering successful scheme identity minting and failure when the instance value is outside the scheme’s domain.
  • Updated the JSON-LD output path to treat mailto/acct as special self patterns and mint canonical IRIs (with fail-loud errors on invalid inputs).
  • Introduced canonicalization helpers in sourcemeta::core to produce RFC 6068 mailto: and RFC 7565 acct: identity IRIs.
  • Refactored some Blaze schema-transform type-form checks into a shared helper for dialect-sensitive behavior.
  • Vendor updates include related Core OAuth/OIDC convenience helpers (scope membership, claim/scope mapping, claims-parameter handling) and small metadata accessor additions.

Technical Notes: Scheme identity names bypass URI-template expansion and instead canonicalize the instance string into a single blessed IRI spelling (percent-encoding + case normalization per scheme), ensuring consistent RDF IRI string comparison.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@cubic-dev-ai cubic-dev-ai Bot 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.

2 issues found across 30 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="docs/rdf.markdown">

<violation number="1" location="docs/rdf.markdown:111">
P2: The claim "reserved characters percent encoded" is imprecise: the engine deliberately leaves many RFC 3986 reserved sub-delimiters unencoded (mailto passes through `! $ ' ( ) * + :`; acct passes through every sub-delimiter in the user part), matching RFC 6068/7565 allowed-literal sets. A reader relying on the documented "single blessed spelling" could percent-encode those characters and mint a different IRI than the engine, defeating the equality guarantee this section describes.</violation>
</file>

<file name="test/rdf/fail_resolution_self_scheme_domain.sh">

<violation number="1" location="test/rdf/fail_resolution_self_scheme_domain.sh:12">
P3: The new negative test only covers the `mailto` scheme's resolution failure; `acct` — the other scheme added in this change — has no corresponding failure case. Since `acct` has its own source grammar and minting logic (RFC 7565), consider adding a symmetric negative test (e.g., an `acct` value whose host is missing/invalid) so both newly supported schemes have an exercised error path, matching the pass test that covers both.</violation>
</file>

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

Re-trigger cubic

Comment thread docs/rdf.markdown

| Name | Source Grammar | Minted Identity |
|------|----------------|-----------------|
| `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with reserved characters percent encoded and the domain name lowercased |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The claim "reserved characters percent encoded" is imprecise: the engine deliberately leaves many RFC 3986 reserved sub-delimiters unencoded (mailto passes through ! $ ' ( ) * + :; acct passes through every sub-delimiter in the user part), matching RFC 6068/7565 allowed-literal sets. A reader relying on the documented "single blessed spelling" could percent-encode those characters and mint a different IRI than the engine, defeating the equality guarantee this section describes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/rdf.markdown, line 111:

<comment>The claim "reserved characters percent encoded" is imprecise: the engine deliberately leaves many RFC 3986 reserved sub-delimiters unencoded (mailto passes through `! $ ' ( ) * + :`; acct passes through every sub-delimiter in the user part), matching RFC 6068/7565 allowed-literal sets. A reader relying on the documented "single blessed spelling" could percent-encode those characters and mint a different IRI than the engine, defeating the equality guarantee this section describes.</comment>

<file context>
@@ -98,6 +98,19 @@ instance property names, so a variable like `{+meta.slug}` binds a property
+
+| Name | Source Grammar | Minted Identity |
+|------|----------------|-----------------|
+| `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with reserved characters percent encoded and the domain name lowercased |
+| `acct` | An [RFC 7565](https://www.rfc-editor.org/rfc/rfc7565) `user@host` account, such as `juliet@capulet.example@shoppingsite.example` | Its `acct` IRI, such as `acct:juliet%40capulet.example@shoppingsite.example`, with reserved characters in the user part percent encoded and the host lowercased |
+
</file context>
Suggested change
| `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with reserved characters percent encoded and the domain name lowercased |
| `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with non-permitted characters percent encoded and the domain name lowercased |


cat << 'EOF' > "$TMP/schema.json"
{
"$schema": "https://json-schema.org/draft/2020-12/schema",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The new negative test only covers the mailto scheme's resolution failure; acct — the other scheme added in this change — has no corresponding failure case. Since acct has its own source grammar and minting logic (RFC 7565), consider adding a symmetric negative test (e.g., an acct value whose host is missing/invalid) so both newly supported schemes have an exercised error path, matching the pass test that covers both.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/rdf/fail_resolution_self_scheme_domain.sh, line 12:

<comment>The new negative test only covers the `mailto` scheme's resolution failure; `acct` — the other scheme added in this change — has no corresponding failure case. Since `acct` has its own source grammar and minting logic (RFC 7565), consider adding a symmetric negative test (e.g., an `acct` value whose host is missing/invalid) so both newly supported schemes have an exercised error path, matching the pass test that covers both.</comment>

<file context>
@@ -0,0 +1,63 @@
+
+cat << 'EOF' > "$TMP/schema.json"
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "type": "object",
+  "properties": {
</file context>

@jviotti
jviotti merged commit 01c310d into main Aug 5, 2026
15 checks passed
@jviotti
jviotti deleted the jsonld-self-registry branch August 5, 2026 16:58
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