Feature request: Secure parameter binding
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
play framework |
Fix Committed
|
Medium
|
Nicolas Leroux | ||
1.0 |
Won't Fix
|
Undecided
|
Nicolas Leroux | ||
1.1 |
Fix Committed
|
Medium
|
Nicolas Leroux |
Bug Description
I mean situation, when, e.g., I have a controller with method
public static void create(Client client ) {
ClientJPA c=ClientJPA.
// how to make 'c' to get properties from 'client' ???
c.save()
show(c);
}
And Client class is not JPAModel direcltly, but an another class with
properties, that I just allowed to update. This method is safe because
avoids situation, when client updates properties that was not on my
form(some kind of spoofing). Now, I dont know, how to assign vaules of
JPAModel with properties from my class.
I know I can do it with line by line assignments, but its not nice
solution when having many fields.
We can even have some generic Form class, that my form will extend. This base class could add methods like print form as table, json, xml.
Changed in play: | |
status: | New → Confirmed |
Changed in play: | |
status: | Confirmed → In Progress |
summary: |
- Feature request: Secure params biding + Feature request: Secure params binding |
summary: |
- Feature request: Secure params binding + Feature request: Secure parameter binding |
Changed in play: | |
importance: | Undecided → Medium |
Changed in play: | |
status: | In Progress → Fix Committed |
I see 3 options for that issue:
1) Provide an helper class that delegates to the jakarta common beanutils "myAttribute" )
2) Add a new annotation: @NoBinding
3) As I happen to work on the @As annotation that is a binding annotation, add a new attribute for it that exclude a propery: @As(exclude=
I am still debating between option 2) and 3).