{
  "reins": "0.1",
  "generator": "conformance/tools/make-vectors.mjs",
  "title": "Origins: of a URL, in an allowlist, of hello.surface.url",
  "spec": "SPEC.md section 5, \"Origins\"",
  "rule": [
    "a web origin is the serialised origin of an http:, https:, ws:, wss: or ftp: URL",
    "every file: URL has the origin file://",
    "blob: has the web origin of the http(s) URL after \"blob:\", else null",
    "any other scheme: scheme://host[:port] from the text between // and the next /, ? or # (credentials dropped, lower case) when it fits the app-origin form, else null",
    "entries: exact, scheme://host:* (web and app origins), * (web origins only); file://, an app origin and null only by an entry that names them",
    "hello.surface.url has the connection origin when its origin equals it; a null connection takes any URL without a web origin"
  ],
  "note": "Computed here from the text of SPEC 5, with the WHATWG URL parser used for web origins only. A `urlOrigin` case whose origin is the JSON value null is not a URL; the string \"null\" is the opaque origin. The values for file: and app-scheme URLs do not come from a URL library: Node reports \"null\" for both, Chromium does not.",
  "urlOrigin": [
    {
      "url": "http://localhost:5173/menu?x=1#top",
      "origin": "http://localhost:5173"
    },
    {
      "url": "https://Example.COM:443/a",
      "origin": "https://example.com"
    },
    {
      "url": "http://127.0.0.1:80/",
      "origin": "http://127.0.0.1"
    },
    {
      "url": "ws://127.0.0.1:7346/",
      "origin": "ws://127.0.0.1:7346"
    },
    {
      "url": "wss://hub.example:8443/socket",
      "origin": "wss://hub.example:8443"
    },
    {
      "url": "ftp://files.example/pub",
      "origin": "ftp://files.example"
    },
    {
      "url": "http://[::1]:8080/x",
      "origin": "http://[::1]:8080"
    },
    {
      "url": "https://user:pw@example.com/",
      "origin": "https://example.com"
    },
    {
      "url": "file:///C:/Users/me/app/index.html",
      "origin": "file://"
    },
    {
      "url": "file:///home/me/app/index.html",
      "origin": "file://"
    },
    {
      "url": "file://server/share/index.html",
      "origin": "file://"
    },
    {
      "url": "file://localhost/etc/hosts",
      "origin": "file://"
    },
    {
      "url": "app://notes/index.html",
      "origin": "app://notes"
    },
    {
      "url": "app://Notes/index.html#/settings",
      "origin": "app://notes"
    },
    {
      "url": "app://notes:8080/index.html?tab=1",
      "origin": "app://notes:8080"
    },
    {
      "url": "app://user:pw@notes/index.html",
      "origin": "app://notes"
    },
    {
      "url": "app://notes",
      "origin": "app://notes"
    },
    {
      "url": "reins-probe://notes/page.html",
      "origin": "reins-probe://notes"
    },
    {
      "url": "chrome-extension://abcdefghijklmnopabcdefghijklmnop/popup.html",
      "origin": "chrome-extension://abcdefghijklmnopabcdefghijklmnop"
    },
    {
      "url": "vscode-webview://0a1b2c3d/index.html",
      "origin": "vscode-webview://0a1b2c3d"
    },
    {
      "url": "app://notes:0/x",
      "origin": "null"
    },
    {
      "url": "app://notes:65536/x",
      "origin": null
    },
    {
      "url": "app://notes:080/x",
      "origin": "app://notes:80"
    },
    {
      "url": "app://no%74es/x",
      "origin": "null"
    },
    {
      "url": "app://-notes/x",
      "origin": "app://-notes"
    },
    {
      "url": "app://-/index.html",
      "origin": "app://-"
    },
    {
      "url": "app://./index.html",
      "origin": "app://."
    },
    {
      "url": "app://notes./index.html",
      "origin": "app://notes."
    },
    {
      "url": "app://my_app/index.html",
      "origin": "app://my_app"
    },
    {
      "url": "app://no tes/x",
      "origin": null
    },
    {
      "url": "app:///index.html",
      "origin": "null"
    },
    {
      "url": "app:notes/index.html",
      "origin": "null"
    },
    {
      "url": "blob:http://localhost:5173/3f0c9c1e-6f5e-4d9b-9a44-0d6c6b0e8a11",
      "origin": "http://localhost:5173"
    },
    {
      "url": "blob:https://example.com/3f0c9c1e-6f5e-4d9b-9a44-0d6c6b0e8a11",
      "origin": "https://example.com"
    },
    {
      "url": "blob:null/3f0c9c1e-6f5e-4d9b-9a44-0d6c6b0e8a11",
      "origin": "null"
    },
    {
      "url": "blob:file:///C:/x/3f0c9c1e",
      "origin": "null"
    },
    {
      "url": "data:text/html,<p>hi",
      "origin": "null"
    },
    {
      "url": "about:blank",
      "origin": "null"
    },
    {
      "url": "javascript:void(0)",
      "origin": "null"
    },
    {
      "url": "not a url",
      "origin": null
    },
    {
      "url": "",
      "origin": null
    }
  ],
  "allowed": [
    {
      "origin": "http://localhost:5173",
      "entries": [
        "http://localhost:5173"
      ],
      "expect": true
    },
    {
      "origin": "http://localhost:5173",
      "entries": [
        "http://localhost:5174"
      ],
      "expect": false
    },
    {
      "origin": "https://localhost:5173",
      "entries": [
        "http://localhost:5173"
      ],
      "expect": false
    },
    {
      "origin": "http://example.com",
      "entries": [
        "http://example.com:80"
      ],
      "expect": true
    },
    {
      "origin": "http://example.com",
      "entries": [
        "http://example.com/"
      ],
      "expect": true
    },
    {
      "origin": "http://example.com",
      "entries": [],
      "expect": false
    },
    {
      "origin": "http://localhost:3000",
      "entries": [
        "http://localhost:*"
      ],
      "expect": true
    },
    {
      "origin": "http://localhost",
      "entries": [
        "http://localhost:*"
      ],
      "expect": true
    },
    {
      "origin": "https://localhost:3000",
      "entries": [
        "http://localhost:*"
      ],
      "expect": false
    },
    {
      "origin": "http://localhost.evil.com:3000",
      "entries": [
        "http://localhost:*"
      ],
      "expect": false
    },
    {
      "origin": "https://anything.example",
      "entries": [
        "*"
      ],
      "expect": true
    },
    {
      "origin": "ws://127.0.0.1:7346",
      "entries": [
        "*"
      ],
      "expect": true
    },
    {
      "origin": "http://localhost:5173/path",
      "entries": [
        "*"
      ],
      "expect": false
    },
    {
      "origin": "http://user@localhost:5173",
      "entries": [
        "http://localhost:5173"
      ],
      "expect": false
    },
    {
      "origin": "not an origin",
      "entries": [
        "*"
      ],
      "expect": false
    },
    {
      "origin": "http://localhost:5173",
      "entries": [
        "http://localhost:5173/path"
      ],
      "expect": false
    },
    {
      "origin": "null",
      "entries": [
        "*"
      ],
      "expect": false
    },
    {
      "origin": "null",
      "entries": [
        "null"
      ],
      "expect": true
    },
    {
      "origin": "null",
      "entries": [
        "file://",
        "app://notes"
      ],
      "expect": false
    },
    {
      "origin": "file://",
      "entries": [
        "*"
      ],
      "expect": false
    },
    {
      "origin": "file://",
      "entries": [
        "file://"
      ],
      "expect": true
    },
    {
      "origin": "file://",
      "entries": [
        "file:///"
      ],
      "expect": true
    },
    {
      "origin": "file://",
      "entries": [
        "null"
      ],
      "expect": false
    },
    {
      "origin": "file://",
      "entries": [
        "file://*",
        "file://localhost",
        "http://localhost:*"
      ],
      "expect": false
    },
    {
      "origin": "file://server",
      "entries": [
        "file://",
        "file://server",
        "*"
      ],
      "expect": false
    },
    {
      "origin": "file:///C:/app/index.html",
      "entries": [
        "file://",
        "*"
      ],
      "expect": false
    },
    {
      "origin": "app://notes",
      "entries": [
        "*"
      ],
      "expect": false
    },
    {
      "origin": "app://notes",
      "entries": [
        "app://notes"
      ],
      "expect": true
    },
    {
      "origin": "app://notes",
      "entries": [
        "app://notes/"
      ],
      "expect": true
    },
    {
      "origin": "app://notes",
      "entries": [
        "APP://Notes"
      ],
      "expect": true
    },
    {
      "origin": "app://notes",
      "entries": [
        "app://other"
      ],
      "expect": false
    },
    {
      "origin": "app://notes",
      "entries": [
        "app://notes:*"
      ],
      "expect": true
    },
    {
      "origin": "app://notes:8080",
      "entries": [
        "app://notes:*"
      ],
      "expect": true
    },
    {
      "origin": "app://notes:8080",
      "entries": [
        "app://notes"
      ],
      "expect": false
    },
    {
      "origin": "app://notes",
      "entries": [
        "app://notes:8080"
      ],
      "expect": false
    },
    {
      "origin": "app://notes",
      "entries": [
        "other://notes",
        "app://notes.evil",
        "null",
        "file://"
      ],
      "expect": false
    },
    {
      "origin": "app://notes.evil",
      "entries": [
        "app://notes:*"
      ],
      "expect": false
    },
    {
      "origin": "app://Notes",
      "entries": [
        "app://notes",
        "*"
      ],
      "expect": false
    },
    {
      "origin": "app://notes/index.html",
      "entries": [
        "app://notes",
        "*"
      ],
      "expect": false
    },
    {
      "origin": "app://user@notes",
      "entries": [
        "app://notes",
        "*"
      ],
      "expect": false
    },
    {
      "origin": "app://-",
      "entries": [
        "app://-"
      ],
      "expect": true
    },
    {
      "origin": "app://-",
      "entries": [
        "*",
        "app://."
      ],
      "expect": false
    },
    {
      "origin": "app://.",
      "entries": [
        "app://."
      ],
      "expect": true
    },
    {
      "origin": "app://notes.",
      "entries": [
        "app://notes"
      ],
      "expect": false
    },
    {
      "origin": "chrome-extension://abcdefghijklmnopabcdefghijklmnop",
      "entries": [
        "*"
      ],
      "expect": false
    },
    {
      "origin": "chrome-extension://abcdefghijklmnopabcdefghijklmnop",
      "entries": [
        "chrome-extension://abcdefghijklmnopabcdefghijklmnop"
      ],
      "expect": true
    }
  ],
  "surfaceUrl": [
    {
      "origin": "http://localhost:5173",
      "url": "http://localhost:5173/menu",
      "expect": true
    },
    {
      "origin": "http://localhost:5173",
      "url": "http://localhost:5174/menu",
      "expect": false
    },
    {
      "origin": "http://localhost:5173",
      "url": "blob:http://localhost:5173/3f0c9c1e",
      "expect": true
    },
    {
      "origin": "file://",
      "url": "file:///C:/Users/me/app/index.html",
      "expect": true
    },
    {
      "origin": "file://",
      "url": "file://server/share/index.html",
      "expect": true
    },
    {
      "origin": "file://",
      "url": "app://notes/index.html",
      "expect": false
    },
    {
      "origin": "file://",
      "url": "http://localhost:5173/",
      "expect": false
    },
    {
      "origin": "app://notes",
      "url": "app://notes/index.html#/settings",
      "expect": true
    },
    {
      "origin": "app://notes",
      "url": "app://other/index.html",
      "expect": false
    },
    {
      "origin": "app://notes",
      "url": "app://notes:8080/index.html",
      "expect": false
    },
    {
      "origin": "app://notes",
      "url": "file:///C:/app/index.html",
      "expect": false
    },
    {
      "origin": "app://notes",
      "url": "https://notes/index.html",
      "expect": false
    },
    {
      "origin": "app://-",
      "url": "app://-/index.html",
      "expect": true
    },
    {
      "origin": "app://.",
      "url": "app://./index.html#/settings",
      "expect": true
    },
    {
      "origin": "app://-",
      "url": "app://./index.html",
      "expect": false
    },
    {
      "origin": "null",
      "url": "reins-plain://notes/page.html",
      "expect": true
    },
    {
      "origin": "null",
      "url": "file:///C:/app/index.html",
      "expect": true
    },
    {
      "origin": "null",
      "url": "data:text/html,<p>hi",
      "expect": true
    },
    {
      "origin": "null",
      "url": "blob:null/3f0c9c1e",
      "expect": true
    },
    {
      "origin": "null",
      "url": "http://localhost:5173/",
      "expect": false
    },
    {
      "origin": "null",
      "url": "blob:http://localhost:5173/3f0c9c1e",
      "expect": false
    },
    {
      "origin": "null",
      "url": "not a url",
      "expect": false
    }
  ]
}
