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

Update Bambda Checker to support logger view filter Bambdas & add examples #44

Merged
merged 2 commits into from
Dec 15, 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
4 changes: 2 additions & 2 deletions .github/workflows/bambda-checker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:

- name: Validate Bambdas & update READMEs
run: |
[ $(sha256sum BambdaChecker-1.1.jar | awk '{ print $1 }') = '21805c494ccea16158081855326810e3715034900a1cd18d9e2b9ab7f108de57' ]
java -jar BambdaChecker-1.1.jar
[ $(sha256sum BambdaChecker-1.2.jar | awk '{ print $1 }') = '30959be3dce023d3b53c4e2507b9db7fed8bfe41501b14bb8c0d4d3a0a50fd71' ]
java -jar BambdaChecker-1.2.jar
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bambda-checker-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:

- name: Validate Bambdas & update READMEs
run: |
[ $(sha256sum BambdaChecker-1.1.jar | awk '{ print $1 }') = '21805c494ccea16158081855326810e3715034900a1cd18d9e2b9ab7f108de57' ]
java -jar BambdaChecker-1.1.jar
[ $(sha256sum BambdaChecker-1.2.jar | awk '{ print $1 }') = '30959be3dce023d3b53c4e2507b9db7fed8bfe41501b14bb8c0d4d3a0a50fd71' ]
java -jar BambdaChecker-1.2.jar
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bambda-checker-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:

- name: Validate Bambdas
run: |
[ $(sha256sum BambdaChecker-1.1.jar | awk '{ print $1 }') = '21805c494ccea16158081855326810e3715034900a1cd18d9e2b9ab7f108de57' ]
java -jar BambdaChecker-1.1.jar validateonly
[ $(sha256sum BambdaChecker-1.2.jar | awk '{ print $1 }') = '30959be3dce023d3b53c4e2507b9db7fed8bfe41501b14bb8c0d4d3a0a50fd71' ]
java -jar BambdaChecker-1.2.jar validateonly
Binary file renamed BambdaChecker-1.1.jar → BambdaChecker-1.2.jar
Binary file not shown.
19 changes: 19 additions & 0 deletions Logger/View/HighlightToolType.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Highlights messages according to their tool type.
* @author ps-porpoise
**/
var highlights = Map.of(
ToolType.TARGET, HighlightColor.RED,
ToolType.PROXY, HighlightColor.BLUE,
ToolType.INTRUDER, HighlightColor.CYAN,
ToolType.REPEATER, HighlightColor.MAGENTA,
ToolType.EXTENSIONS, HighlightColor.ORANGE,
ToolType.SCANNER, HighlightColor.GREEN,
ToolType.SEQUENCER, HighlightColor.PINK
);

requestResponse.annotations().setHighlightColor(
highlights.getOrDefault(requestResponse.toolSource().toolType(), HighlightColor.NONE)
);

return true;
8 changes: 8 additions & 0 deletions Logger/View/SlowResponses.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Finds slow responses.
* @author ps-porpoise
**/
var delta = requestResponse.timingData().timeBetweenRequestSentAndStartOfResponse();
var threshold = Duration.ofSeconds(3);

return delta != null && delta.toMillis() >= threshold.toMillis();