x-samp
extensions
SAMP uses the idea of extensible vocabularies, in which items are labelled with a key string. Keys in the namespace
samp
(i.e. ones which start
samp.
) are reserved as well-known and defined in standard itself. Developers are free to define keys in other namespaces as they wish. Keys in the special
x-samp
namespace are used for those keys that are proposed for possible introduction into the standard in the future. Developers are encouraged to list such keys here, with an explanation of their purpose.
MTypes
See
SampMTypes for descriptions
Metadata items
-
x-samp.jnlp.url
: in the same way as samp.icon.url
, for Java-based application startup.
Subscription Annotations
The hub
declareSubscriptions()
method takes a subscriptions
map; the keys are the MType patterns
and the values are maps which can potentially
annotate the subscription to the MType(s) matching
the pattern in question. This form, rather than the perhaps more obvious list of MType patterns,
was introduced in case it became useful at some point in the future. Up till now, it hasn't been
used much (at all?).
Add below suggestions for well-known keys for use in this context.
-
x-samp.mostly-harmless
: A subscribing client can use this to note that an MType it subscribes to is known to be (in)capable of causing security breaches if invoked by a potentially untrusted client. A value of "1" means that it is safe for untrusted invocation, and "0" means it is unsafe. Any other value (or absence of the key) makes no comment. Hub implementations may use this information to modify their policies about whether untrusted or marginally trusted clients are blocked from sending the MType(s) so annotated to that client, but they should not rely on its presence (should fall back to some default policy if it is not supplied). Example:
declareSubscriptions({"test.echo", {"x-samp.mostly-harmless": "1"},
"system.delete-all-files", {"x-samp.mostly-harmless": "0"},
"table.load.votable", {}})
--
MarkTaylor - 23 Nov 2011