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

Skip enum members when looking for potentially sensitive shapes/data #1661

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ private List<ValidationEvent> scanShapes(Model model) {
Shape containingShape = model.expectShape(memberShape.getContainer());
Shape targetShape = model.expectShape(memberShape.getTarget());

if (!containingShape.hasTrait(SensitiveTrait.class) && !targetShape.hasTrait(SensitiveTrait.class)) {
if (!containingShape.hasTrait(SensitiveTrait.class)
&& !containingShape.isEnumShape()
&& !targetShape.hasTrait(SensitiveTrait.class)) {
Optional<ValidationEvent> optionalValidationEvent =
detectSensitiveTerms(memberShape.getMemberName(), memberShape);
optionalValidationEvent.ifPresent(validationEvents::add);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ structure BillingAddress {
safeBank: MySensitiveString,
// should get flagged
firstName: FirstName,
lastName: LastName
lastName: LastName,
someEnum: MyEnum
}

@sensitive
Expand All @@ -53,6 +54,11 @@ structure SafeBillingAddress {
lastName: MySensitiveString
}

enum MyEnum {
// should not be flagged
IP_ADDRESS
}

string MyString

@sensitive
Expand Down