[MGNLREST-62] Add possibility to put context attributes to the rest response in command endpoint Created: 16/Feb/15 Updated: 21/Nov/17 Resolved: 23/Feb/15 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.1 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Jaroslav Simak | Assignee: | Jaroslav Simak |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Documentation update required: |
Yes
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
ilgun -> As far as I could grasp when I was working on
Therefore the success message relies on the command throwing exceptions or not. |
| Comments |
| Comment by Jan Haderka [ 20/Feb/15 ] |
|
allowing caller to configure what params he wants to suck out of context seems like very insecure option opening door to exploits. It should be configured on the server not decided by caller. |
| Comment by Jaroslav Simak [ 20/Feb/15 ] |
|
Attached configuration example. |
| Comment by Jan Haderka [ 20/Feb/15 ] |
|
exposedContextParams or returnedContextParams or responseContextParams or something like that to make it obvious what happens with params listed in there? |
| Comment by Philip Mundt [ 31/Oct/16 ] |
|
jsimak could you please update the description of this issue? We need to know:
|
| Comment by Philip Mundt [ 01/Nov/16 ] |
|
Actually we just figured this is not usable. The interface specifies info.magnolia.rest.service.command.definition.CommandDefinition#getResponseContextParameters() which is correctly implemented by info.magnolia.rest.service.command.definition.ConfiguredCommandDefinition#getResponseContextParameters() however, the setter is called info.magnolia.rest.service.command.definition.ConfiguredCommandDefinition#setContextParameters() (notice the missing Response), therefore N2B will most likely have difficulties setting those I guess. @Override public Collection<String> getResponseContextParameters() { return responseContextParameters; } public void setContextParameters(Collection<String> responseContextParameters) { this.responseContextParameters = responseContextParameters; } |
| Comment by Antti Hietala [ 02/Mar/17 ] |
|
Requires a documentation update. Commands endpoint v2 allows you to configure context parameters which are then sent back in the response if the command is executed successfully. This feature is not documented in the REST API docs and it is difficult to discover on your own because the example commands that ship with the REST Service module (/modules/rest-services/rest-endpoints/commands) don't have any context attributes. Please document and provide an example. |