Skip to content

Commit

Permalink
Emit another column for sensitive api endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Aug 17, 2023
1 parent 9321a09 commit c6aba22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex
.collect(toList());

for (String sensitivePath : sensitivePaths) {
String fieldName = sensitivePaths.get(sensitivePaths.size() - 1);
endpoints.insertRow(ctx, new SensitiveApiEndpoints.Row(
getCursor().firstEnclosingOrThrow(J.CompilationUnit.class).getSourcePath().toString(),
method.getSimpleName(),
endpoint.getMethod(),
endpoint.getPath(),
fieldName.substring(fieldName.lastIndexOf("#") + 1),
sensitivePath
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public static class Row {
description = "The path of the API endpoint.")
String path;

@Column(displayName = "Sensitive field",
description = "The piece of sensitive data that is included.")
String sensitiveField;

@Column(displayName = "Sensitive data path",
description = "The sensitive data exposed by the API endpoint.")
String sensitiveDataPath;
Expand Down

0 comments on commit c6aba22

Please sign in to comment.