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

@sensitive doesn't work when applied to list and map targets #3757

Closed
rcoh opened this issue Jul 12, 2024 · 0 comments · Fixed by #3765
Closed

@sensitive doesn't work when applied to list and map targets #3757

rcoh opened this issue Jul 12, 2024 · 0 comments · Fixed by #3765

Comments

@rcoh
Copy link
Collaborator

rcoh commented Jul 12, 2024

Consider the following model:

map Timestamps {
    key: String
    value: SensitiveTimestamp 
}

@sensitive
timestamp SensitiveTimestamp

Because the debug printer currently operates on the field level it won't catch that the value in this map are sensitive.

The same issue also applies to list targets.

github-merge-queue bot pushed a commit that referenced this issue Jul 17, 2024
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
Lists and maps with sensitive members were not being properly redacted.
Closes #3757

## Description
<!--- Describe your changes in detail -->
Updated `Shape.shouldRedact` method to properly check for list and map
shapes with sensitive members. Also updated the test definition so it
would actually run since previously the test code was generated in a
nested function inside a no-op function and never run.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Added test cases for lists with sensitive members, maps with sensitive
keys, and maps with sensitive values.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates


----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
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 a pull request may close this issue.

1 participant