Open iariasleon opened 8 years ago
LGTM, don´t apply in idPattern field
Sure? I mean, idPattern should allow characters such as (
that are part of the general forbidden chars in Orion (as these chars are needed by the regex syntax). However, I understand that "non ascii" susch as á
or ö
shouldn't be allowed.
(Reopened while we are still discussing this)
Maybe this restriction about forbidden chars is a little too strong for idPattern
, a regular expression. If a pattern like olé
is used, it will never be matched, just the same that happens when an inexistent attribute with only plain ASCII characters is used. Generally, with a regular expressions, the user should check that it will be fired as she expects, and with non plain ASCII chars it will never do as we don't allow the creation of attributes with forbidden chars.
Also as idPattern
never occurs in URLs, table or database names, etc, the reasons for forbidding non-ASCII characters in this case are not so important and could be relaxed for this field
Also as idPattern never occurs in URLs
Actually, it may occur in query entities operation, i.e. GET /v2/entities?idPattern=...
. However, that's a different story (the present issue is about subscriptions).
For this issue to be implementable, we need to define the set of allowed characters for idPattern
. Perhaps for ìd` as well.
Do we really want to restrict by not allowing 'exotic chars'?
I understand we should not allow 'dangerous' chars that make the broker vulnerable, but not allowing ñ, ç and é etc ... I don't see any reason for that.
So, in order for this issue to go forward, I believe we need to discuss this.
I agree with Ken, in this specific case (subscription in payload) but in another cases (url, etc), we can discuss in other issues.
Depend of the users create the regular expression correctly and I do not think that "not plain ascii chars" will be a security risk or maybe I'm wrong.
We should define the "forbidden chars for id patterns" set (applicable at least to idPattern
and typePattern
) starting with the "Field syntax restrictions" set defined in the NGSIv2 spec, then adding/removing as needed taking into account the nature of the regex and the security considerations.
in POST v2/subscriptions, in entities/idPattern field not plain ascii chars are allowed.
Dataset
subscription request
subscription response
doc in mongo
expected response