>>Mhm, correct me if I am wrong but nt:unstructured allows the user to
>>define own properties on the fly as well, or?
>>I can name at least one security consultant who would freak out if
>>people can store content "uncontrolled" in the repository.
>
> Because exactly? There would be a reason that he is allowed to add or edit
> something in the first place.

Of course. But normally its well defined what you expect the user to enter.
Be it a blog comment (title, text, mail) or an order or whatever.
The developer knows about the syntax and semantics of these properties.
Not so for properties that are added by the user when circumventing the UI.
How should they be validated? Are they maybe accidentally rendered by
a defaultservlet?
Can the content be used for XSS then? etc.
The security guys that I had to work with are keen on controlling the
data. You don't need the data? Then why would you store it?

>
>>OK, then the message is: If I want to have support for input
>>validation it makes sense to have custom node types (which might
>>inherit from nt:unstructured).
>
> Not necessarily, I would opt for validation inside servlet filters, custom
> POST script/servlet or sling post processor. Node types should only be
> used for things that you know are really fixed and won't change much in
> the future. Such as the common nt:file and nt:folder definitions in the
> JCR spec.

OK, then you'd keep all rules that define your model and the
validation rules "in code" (or configured elsewhere).
You just don't use the abilities of the JCR to check node properties.

That makes me want to have a controller to validate my data against my
model and only pass the verified data to the view to render it ;-)
Can filters be used for that task?

Regards,
 Markus

Reply via email to