Skip to content

internal: Add support for 'sensitive' JSON tag for bundle config fields#5896

Open
andrewnester wants to merge 5 commits into
mainfrom
feat/sensitive-fields
Open

internal: Add support for 'sensitive' JSON tag for bundle config fields#5896
andrewnester wants to merge 5 commits into
mainfrom
feat/sensitive-fields

Conversation

@andrewnester

Copy link
Copy Markdown
Contributor

Changes

Add support for 'sensitive' JSON tag for bundle config fields

Why

This allows us to mark certain fields (for example, secrets.value) as sensitive and let CLI handle masking it in command outputs.

Used in #5861

Tests

Added unit tests. Will be tests end to end with unit tests with UC secrets

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/bundle/ - needs approval

Files: bundle/config/mask.go, bundle/config/mask_test.go
Suggested: @pietern
Also eligible: @denik, @janniklasrose, @shreyas-goenka, @lennartkats-db, @anton-107

/cmd/bundle/ - needs approval

Files: cmd/bundle/validate.go
Suggested: @pietern
Also eligible: @denik, @janniklasrose, @shreyas-goenka, @lennartkats-db, @anton-107

General files (require maintainer)

Files: libs/dyn/convert/struct_info.go, libs/structs/structtag/bundletag.go, libs/structs/structtag/bundletag_test.go
Based on git history:

  • @pietern -- recent work in bundle/config/, libs/dyn/convert/

Any maintainer (@anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 687b636

Run: 29102740653

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 230 1078 5:11
💚​ aws windows 4 4 232 1076 7:25
💚​ aws-ucws linux 4 4 316 995 6:01
💚​ aws-ucws windows 4 4 318 993 7:13
💚​ azure linux 4 4 230 1077 5:14
💚​ azure windows 4 4 232 1075 7:02
💚​ azure-ucws linux 4 4 318 992 6:07
💚​ azure-ucws windows 4 4 320 990 7:36
💚​ gcp linux 4 4 229 1079 5:28
💚​ gcp windows 4 4 231 1077 7:02
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 10 slowest tests (at least 2 minutes):
duration env testname
6:28 azure-ucws windows TestAccept
6:24 aws windows TestAccept
6:15 aws-ucws windows TestAccept
6:07 gcp windows TestAccept
6:00 azure windows TestAccept
3:03 gcp linux TestAccept
2:55 azure linux TestAccept
2:55 aws linux TestAccept
2:51 aws-ucws linux TestAccept
2:49 azure-ucws linux TestAccept

Comment thread bundle/config/mask.go

for fieldName := range fields {
fv, err := dyn.GetByPath(resource, dyn.NewPath(dyn.Key(fieldName)))
if err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Error does not necessarily imply that the field is not present. We should check for the "not found" error?

Comment thread bundle/config/mask.go
continue
}
s, ok := fv.AsString()
if !ok || s == "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we error or panic if a non-string field has the "sensitive" tag? Seems like we should enforce that invariant rather than silently accepting it.

Comment thread cmd/bundle/validate.go
return nil
}
buf, err := json.MarshalIndent(b.Config.Value().AsAny(), "", " ")
v, err := bundleconfig.MaskSensitiveFields(b.Config.Value())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This only masks the values in the final output. Should we be more agressive and mask it out before? Maybe even disallow references to these values? Do we need direct interpolation in UC secrets case?

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.

3 participants