lockbox-datastore icon indicating copy to clipboard operation
lockbox-datastore copied to clipboard

Enhancements to `origin(s)` property

Open linuxwolf opened this issue 7 years ago • 1 comments

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 origins must 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 origins present 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 origins values into the above format

linuxwolf avatar Mar 16 '18 17:03 linuxwolf

Related to mozilla-lockbox/lockbox-extension#521

linuxwolf avatar Mar 16 '18 17:03 linuxwolf