Skip to content

Commit

Permalink
move model to initialization in SensitiveDataFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Mar 22, 2023
1 parent 8addd74 commit 292a9bb
Show file tree
Hide file tree
Showing 6 changed files with 443 additions and 434 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ final class StructureGenerator implements Runnable {
private final StructureShape shape;
private final boolean includeValidation;
private final RequiredMemberMode requiredMemberMode;
private final SensitiveDataFinder sensitiveDataFinder = new SensitiveDataFinder();
private final SensitiveDataFinder sensitiveDataFinder;

/**
* sets 'includeValidation' to 'false' and requiredMemberMode
Expand All @@ -96,6 +96,7 @@ final class StructureGenerator implements Runnable {
this.shape = shape;
this.includeValidation = includeValidation;
this.requiredMemberMode = requiredMemberMode;
sensitiveDataFinder = new SensitiveDataFinder(model);
}

@Override
Expand Down Expand Up @@ -189,7 +190,7 @@ private void renderStructureNamespace(StructuredMemberWriter structuredMemberWri
Symbol symbol = symbolProvider.toSymbol(shape);
String objectParam = "obj";

if (sensitiveDataFinder.findsSensitiveData(shape, model)) {
if (sensitiveDataFinder.findsSensitiveDataIn(shape)) {
writer.writeDocs("@internal");
writer.openBlock("export const $LFilterSensitiveLog = ($L: $L): any => ({", "})",
symbol.getName(),
Expand Down
Loading

0 comments on commit 292a9bb

Please sign in to comment.