[YANGTOOLS-1077] Validate YANG strings for forbidden characters Created: 31/Jan/20 Updated: 12/Feb/20 Resolved: 12/Feb/20 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | codecs |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Martin Bugáň | Assignee: | Martin Bugáň |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
According to RFC7950, YANG strings can't store forbidden characters defined in Section 14, https://tools.ietf.org/html/rfc7950#section-14 Here is the particular section of the rule: yang-string = *yang-char UPDATE: "yang strings" means not only string literals written in the .yang files themselves, but also all data of the builtin type string [1] (and presumably any derived type). [1] https://tools.ietf.org/html/rfc7950#section-9.4 |
| Comments |
| Comment by Vratko Polak [ 03/Feb/20 ] |
|
I am not sure what will be the proper place to add the validation, but just before here [1] looks reasonable. |
| Comment by Robert Varga [ 12/Feb/20 ] |
|
After thinking about this quite a bit, I do not believe it is feasible to implement this. The reason for that boils down to the fact we would have to either encapsulate String objects to express they have been validated or validate them at each surface where plain Java meets YANG-modeled world. That is just not feasible. |