Open michaelkruglos opened 6 years ago
We'd like to be able to represent tweek resources in a form similar to URI or URN. Useful application of this format could be permalinks, granting permissions to resources etc.
RESOURCE = CONTEXT_DEFFINITIONS ":" PROP_OR_KEY_DEFFINITION
CONTEXT_DEFFINITIONS = CONTEXT_DEFFINITION | CONTEXT_DEFFINITIONS "+" CONTEXT_DEFFINITION
CONTEXT_DEFFINITION = CONTEXT_TYPE "=" CONTEXT_ID
PROP_OR_KEY_DEFFINITION = PROP_NAME | "/" KEY_PATH
PROP_NAME = [a-zA-Z]
KEY_PATH = [a-z0-9_/]
CONTEXT_TYPE = [a-z]
CONTEXT_ID = [a-zA-Z0-9%]
CONTEXT_ID
must contain only characters matching regular expression [a-zA-Z0-9]
or [%][0-9a-fA-F][0-9a-fA-F]
(percent encoding) . All other characters must be percent encoded.An example where values are requested for key named /path/to/key
and device context identified as a2df519d-4515-4732-b995-17172aaad7c1
device=a2df519d-4515-4732-b995-17172aaad7c1:/path/to/key
An example where values are requested for key named /user/specific/key
and user identified as user@example.com
user=user@example.com:/user/specific/key
An example where specific context key is device.OsType
device=a2df519d-4515-4732-b995-17172aaad7c1:device.OsType
@asafkotzer feel free to add your remarks :)
Adding content of this document to the repo
We'd like to define resource identifiers format for Tweek resources, such that they can be easily addressed.
One of the suggestions for context properties is
context_type.context_id:propname
, and for calculation of valuescontext_type.context_id:path/to/key
.We could try to think about it in terms of URN https://en.wikipedia.org/wiki/Uniform_Resource_Name