lockbox-datastore
lockbox-datastore copied to clipboard
Enhancements to `origin(s)` property
The current input validation for origins allows the value of each array element to be any string under 500 characters. However, this has implications that complicate other implementations (e.g., more complete site-name/origin matching).
In essence, the idea is for the datastore to help follow this gist.
-
At a minimum, the resulting value of each array element in
originsmust match{scheme}//{hostname}/{path}?{query}#{hash};/{path},?{query}, and#{hash}are optional. -
In addition to the search hashes called for in the gist, a search hash for the complete value is also generated if a
/{path},?{query}, or#{hash}are present. -
When adding an item, any
originspresent are coerced into the above pattern; if the array element does not match the pattern then it is treated as a if it were a simple domain name (prepending it with"https://"and ending with "/"). -
Existing data is coerced into this pattern when updating items
-
When retrieving items, it may coerce any
originsvalues into the above format
Related to mozilla-lockbox/lockbox-extension#521