feat(sensitive): schema.Path for sensitive_paths + LeafSchema sensitive flag + include_sensitive rename - #123
Open
steiler wants to merge 2 commits into
Open
feat(sensitive): schema.Path for sensitive_paths + LeafSchema sensitive flag + include_sensitive rename#123steiler wants to merge 2 commits into
steiler wants to merge 2 commits into
Conversation
Three related changes bundled together as they are mutually dependent:
1. schema.proto / sdcpb/schema.pb.go
Add `bool sensitive = 22` to LeafSchema and `bool sensitive = 24`
to LeafListSchema. Schema-server sets this flag when it detects the
sdcio-ext:sensitive extension on a parsed leaf; data-server reads it
at northbound render time.
2. data.proto / sdcpb/data.pb.go
- TransactionIntent.sensitive_paths: repeated string → repeated schema.Path
Structured paths eliminate the string-based validation that rejected
key predicates; keys are stripped at union time via ToXPath(true).
- GetIntentRequest.expose_sensitive → include_sensitive
- BlameConfigRequest.expose_sensitive → include_sensitive
3. tree_persist.proto / tree_persist/tree_persist.pb.go
Intent.sensitive_paths: repeated string → repeated schema.Path
Consistent with data.proto; no conversion needed at the persist
boundary. Field number unchanged — this is a WIP break.
Add tree_persist_sensitive_test.go: round-trip + legacy-blob tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
Convenience method so callers can check sensitivity without a type switch on the oneof field. Returns false for containers and nil receivers. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR extends the SDC protobuf surface so northbound callers can classify sensitive configuration: schema carries a static baseline (
sensitiveon leaf types), transactions can declare per-intent path markers, and read APIs support an explicit admin bypass flag. It supports the sensitive-data design (key-pruned paths,***redaction, union of markers across intents for merged views).Motivation
sdcio-ext:sensitiveonce goyang#4 fixesApplyDeviatefor extensions. Consumers need a first-classboolonLeafSchema/LeafListSchema.repeated schema.Pathmatches other path fields and avoids ad-hoc string validation.expose_sensitive→include_sensitiveonGetIntentRequest/BlameConfigRequestfor clearer API semantics (same field numbers).SchemaElem.IsSensitive()delegates toLeafSchema/LeafListSchemaGetSensitive()so callers avoid duplicating oneof switches.API changes (summary)
schema.protoLeafSchema.sensitive(22),LeafListSchema.sensitive(24)data.protoGetIntentRequest.include_sensitive,BlameConfigRequest.include_sensitive;TransactionIntent.sensitive_pathsasrepeated schema.Pathtree_persist.protoIntent.sensitive_pathsasrepeated schema.Path(field 8)sdcpb/schema_elem_additions.go(*SchemaElem).IsSensitive()Compatibility notes
include_sensitive: Wire-compatible rename fromexpose_sensitive(unchanged field numbers).Intent.sensitive_pathsfield 8: Type change fromrepeated stringtorepeated schema.Path— wire-breaking for that field; acceptable while no production persistence depends on the old encoding. Regenerated Go and tests cover round-trip and legacy blob behaviour where applicable.Related PRs
ApplyDeviateextension propagationSensitivefrom YANGTest plan
go test ./...insdc-protos(includestree_persist_sensitive_test.goround-trip / backward-compat coverage)*.pb.gomatches*.protoin CI