Skip to content

feat(yang-push): make anydata_strict validation configurable - #42

Open
rodonile wants to merge 1 commit into
network-analytics:mainfrom
rodonile:anydata-strict-flag
Open

feat(yang-push): make anydata_strict validation configurable#42
rodonile wants to merge 1 commit into
network-analytics:mainfrom
rodonile:anydata-strict-flag

Conversation

@rodonile

@rodonile rodonile commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

Adds a config knob to toggle strict validation of anydata nodes (libyang's ANYDATA_STRICT flag) when validating YANG-Push notifications, by default enabled.

Changes

  • ValidationActorHandle::new now takes an anydata_strict: bool parameter, stored on the actor and used in validate_message to conditionally OR DataParserFlags::ANYDATA_STRICT into the parser flags
  • Added UdpNotifConfig::anydata_strict_validation (defaults to true via serde when omitted)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configuration knob in the collector to control whether YANG-Push validation enforces libyang’s ANYDATA_STRICT parsing behavior for anydata nodes (defaulting to enabled), and threads that setting through to the yang-push validation actor.

Changes:

  • Introduces UdpNotifConfig::anydata_strict_validation (serde-defaults to true) and documents it in the example YAML.
  • Extends ValidationActorHandle::new / ValidationActor to carry an anydata_strict boolean and uses it to conditionally apply DataParserFlags::ANYDATA_STRICT.
  • Updates collector initialization to pass the new config value into the validation actor.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
crates/yang-push/src/validation/mod.rs Stores an anydata_strict flag on the validation actor and conditionally applies ANYDATA_STRICT during payload parsing; updates actor handle constructor and tests call sites.
crates/collector/src/lib.rs Wires the new collector config flag into ValidationActorHandle::new calls.
crates/collector/src/config.rs Adds UdpNotifConfig::anydata_strict_validation with a true default.
crates/collector/config_udpnotif_telemetry.yaml Documents/configures anydata_strict_validation in the sample config.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/yang-push/src/validation/mod.rs
Comment thread crates/yang-push/src/validation/mod.rs
Comment thread crates/yang-push/src/validation/mod.rs
Comment thread crates/yang-push/src/validation/mod.rs
Add anydata_strict parameter to ValidationActorHandle::new to toggle
DataParserFlags::ANYDATA_STRICT during YANG validation. Wire it into
UdpNotifConfig as anydata_strict_validation (default: true) so it can
be set per-collector without a code change.
@rodonile
rodonile force-pushed the anydata-strict-flag branch from 3204f5a to a225177 Compare August 20, 2026 12:46
@rodonile
rodonile enabled auto-merge (rebase) August 20, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants