Skip to content

Commit

Permalink
README fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ncoblentz committed Nov 29, 2023
1 parent e89ce74 commit cc32d01
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Proxy/HTTP/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,33 @@ return false;
### Find role within JWT claims
#### Author: Trikster
```java
if (!requestResponse.hasResponse())
{
return false;
}

var body = requestResponse.response().bodyToString().trim();

if (requestResponse.response().hasHeader("authorization")) {
var authValue = requestResponse.response().headerValue("authorization");

if (authValue.startsWith("Bearer ey")) {
var tokens = authValue.split("\\.");

if (tokens.length == 3) {
var decodedClaims = utilities().base64Utils().decode(tokens[1], Base64DecodingOptions.URL).toString();

return decodedClaims.toLowerCase().contains("role");
}
}
}

return false;

```
## [FilterOnSpecificHighlightColor.bambda](https://github.com/PortSwigger/bambdas/blob/main/Proxy/HTTP/FilterOnSpecificHighlightColor.bambda)
### Shows requests/responses highlighted with a specific color
#### Author: [Nick Coblentz ](https://github.com/ncoblentz)
```java
return requestResponse.annotations().highlightColor().equals(HighlightColor.CYAN);
```

0 comments on commit cc32d01

Please sign in to comment.