Skip to content

How to bless asset references #247

@mikesamuel

Description

@mikesamuel

The TC39 asset reference +(@bmeck @sebmarkbage) separates information about modules from loading of modules.

Ir provides new syntax for [static asset references]:

asset Foo from "foo";
// Now the name Foo is an asset reference object which can be passed to import(...)

and API for dynamic asset references:

let assetReference = import.resolve("./foo" + fileExtension);

It would be nice if Trusted Types could recognize that

  • the "module-reference" in asset Name from "module-reference" is in the same protection domain as import * from "module-reference" when guarding dynamic import.
  • provide a policy function to bless at least one of
    • a dynamic asset reference
    • its underlying module specifier (perhaps before being passed to import.resolve.

import.resolve does not AFAICT, do any security work. No fetching happens. So it seems that import.resolve is not a sink.

Metadata

Metadata

Assignees

No one assigned

    Labels

    futureIn consideration for the future releases of the APIspectc39

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions