Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve namespace handling #49

Closed
SCadilhac opened this issue Oct 27, 2018 · 2 comments
Closed

Improve namespace handling #49

SCadilhac opened this issue Oct 27, 2018 · 2 comments
Assignees
Labels

Comments

@SCadilhac
Copy link
Contributor

As discussed in #39, the namespaces should be properly tagged using the xmlns attributes in the various XML representations, based on the corresponding Yang models.

@olofhagsand
Copy link
Member

olofhagsand commented Dec 12, 2018

There are more examples of not correct namespace handling.
In the following restconf example "example-jukebox:" is ignored:
GET /restconf/data/example-jukebox:jukebox/
It still (usually) works since the topnodes are scanned, but is not correct.
Same for netconf cases, such as:
rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0#" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
and others.

@olofhagsand olofhagsand self-assigned this Dec 12, 2018
olofhagsand added a commit that referenced this issue Dec 16, 2018
   * NACM module support (RFC8341 A1+A2)
   * Recovery user "_nacm_recovery" added.
     * Example use is restconf PUT when NACM edit-config is permitted, then automatic commit and discard are permitted using recovery user.
   * Example user changed adm1 to andy to comply with RFC8341 example

 * Yang code upgrade (RFC7950)
   * RPC method input parameters validated
     * see #4
* Correct XML namespace handling
   * XML multiple modules was based on "loose" semantics so that yang modules were found by iterating thorugh namespaces until a match was made. This did not adhere to proper [XML namespace handling](https://www.w3.org/TR/2009/REC-xml-names-20091208), and causes problems with overlapping names and false positives. Below see XML accepted (but wrong), and correct namespace declaration:
```
      <rpc><my-own-method></rpc> # Wrong but accepted
      <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> # Correct
        <my-own-method xmlns="http://example.net/me/my-own/1.0">
      </rpc>
```
   * To keep old loose semantics set config option CLICON_XML_NS_ITERATE (true by default)
   * XML to JSON translator support for mapping xmlns attribute to module name prefix.
   * Default namespace is still "urn:ietf:params:xml:ns:netconf:base:1.0"
   * See #49
* Changed all make tags --> make TAGS
* Keyvalue datastore removed (it has been disabled since 3.3.3)
* debug rpc added in example application (should be in clixon-config).
@olofhagsand
Copy link
Member

Namespaces should now be properly tagged with xmlns attribute for both netfonf and restconf. JSON uses module names for indicating namespaces. There is still a default namespace, so it is possible to call which means .
This is valid for the develop branch which will be merged into master and 3.9 during January.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants