adapt-security / adapt-authoring

A server-based user interface for authoring eLearning courses using the Adapt framework.
http://adaptlearning.org
10 stars 5 forks source link

Need some logic around when to overwrite existing in-memory schemas #537

Closed taylortom closed 1 year ago

taylortom commented 1 year ago

The app stores a key/value list of all schemas registered for use (id -> filepath). Schemas are then loaded up at runtime as they're needed.

By design, it's currently possible to replace the filepath to an existing schema to allow customisation (a warning is logged when this happens), but this should probably be closed off a bit.

Side-note: schema files which are updated and use the same file path as the original file (i.e. where the original file is overwritten, like in plugin/framework upgrades) aren't affected by this, it's only for cases where the same schema name is registered to a new path.

taylortom commented 1 year ago

Schema updates have now been restricted, and JsonSchemaModule#registerSchema now has a replace option for this purpose.