[jboss-jira] [JBoss JIRA] (WFCORE-1800) Executing a read-attribute operation is allowed on non-existing resources with for attributes with defined read handlers
Brian Stansberry (JIRA)
issues at jboss.org
Thu Sep 15 12:23:00 EDT 2016
[ https://issues.jboss.org/browse/WFCORE-1800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294102#comment-13294102 ]
Brian Stansberry commented on WFCORE-1800:
------------------------------------------
Background comment on this for anyone interested in it that I mentioned to James when we were discussing this:
[10:10 AM] Brian Stansberry: a kernel-wide fix just makes me nervous about unintentionally breaking something
[10:11 AM] James R Perkins: Okay. It made me a bit nervous too which is why I didn't submit a PR :)
[10:12 AM] Brian Stansberry: I think a long time ago we said that runtime-only resources still have to expose a Resource in the tree, but I believe that was still after a lot of subsystems were written
Basically a fix for this would likely further enforce the rule that a Resource must be present in the tree, which may break some old stuff. I think it's the right thing to do at some point anyway, but as part of it we need to recognize the potential for breakage and do some analysis of runtime-only resources to ensure they are done correctly.
TBH there may have been some other changes (e.g. in read-resource handling) that would have resulted in breakage if this rule wasn't being followed. But we should be cautious.
> Executing a read-attribute operation is allowed on non-existing resources with for attributes with defined read handlers
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: WFCORE-1800
> URL: https://issues.jboss.org/browse/WFCORE-1800
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Reporter: James Perkins
> Assignee: Brian Stansberry
> Attachments: WFCORE-1800.patch
>
>
> If an attribute defines an {{OperationStepHandler}} the global {{read-attribute}} operation will execute the handler regardless if the resource exists.
> Here's an example that will successfully execute and return the name {{invalid}} for the {{name}} attribute even though the resource does not exist.
> {code}
> /path=invalid(name=name)
> {code}
> For attributes that use the default means of reading the attribute value the {{context.readResource(PathAddress.EMPTY_ADDRESS, false)}} is already invoked which will cause a failure. For attributes which define a custom read OSH the outcome is unpredictable as the existence of the resource is not validated before invoking the OSH.
> The attached patch simply invokes the {{context.readResource(PathAddress.EMPTY_ADDRESS, false)}} before the invocation of the custom OSH.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list