Skip to content

Commit 2d07d53

Browse files
Misc fixes (#938)
* Null interpolation protection * Rules for Cursor * Rules for Windsurf --------- Co-authored-by: Erik Schultink <[email protected]>
1 parent 4b7920f commit 2d07d53

File tree

5 files changed

+61
-11
lines changed

5 files changed

+61
-11
lines changed

infra/modules/aws-psoxy-rest/test_script.tftpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
2+
23
METHOD=$${1:-"GET"}
34
API_PATH=$${2:-${try(example_api_get_requests[0].path, "")}}
45
CONTENT_TYPE=$${3:-""}
56
BODY=$${4:-""}
7+
68
echo "Quick test of ${function_name} ..."
79

810
${command_cli_call} -u "${proxy_endpoint_url}/" --health-check
@@ -14,6 +16,7 @@ ${command_cli_call} -u "${proxy_endpoint_url}$API_PATH" ${impersonation_param} -
1416
%{ endif ~}
1517

1618
echo "Invoke this script with any of the following as arguments to test other endpoints:"
19+
1720
%{ for example_api_get_request in example_api_get_requests ~}
1821
printf "\t%s\n" "${example_api_get_request.method} '${example_api_get_request.path}'"
1922
%{ endfor ~}

infra/modules/gcp-psoxy-rest/test_script.tftpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
2+
23
METHOD=$${1:-"GET"}
34
API_PATH=$${2:-${try(example_api_get_requests[0].path, "")}}
45
CONTENT_TYPE=$${3:-""}
56
BODY=$${4:-""}
7+
68
echo "Quick test of ${function_name} ..."
79

810
${command_cli_call} -u "${proxy_endpoint_url}/" --health-check
@@ -14,6 +16,7 @@ ${command_cli_call} -u "${proxy_endpoint_url}$API_PATH" ${impersonation_param} -
1416
%{ endif ~}
1517

1618
echo "Invoke this script with any of the following as arguments to test other endpoints:"
19+
1720
%{ for example_api_get_request in example_api_get_requests ~}
1821
printf "\t%s\n" "${example_api_get_request.method} '${example_api_get_request.path}'"
1922
%{ endfor ~}

java/core/src/main/java/co/worklytics/psoxy/rules/PrebuiltSanitizerRules.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
public class PrebuiltSanitizerRules {
88

99
static public final Map<String, RESTRules> DEFAULTS = ImmutableMap.<String, RESTRules>builder()
10-
.put("asana", co.worklytics.psoxy.rules.asana.PrebuiltSanitizerRules.ASANA)
11-
.putAll(co.worklytics.psoxy.rules.github.PrebuiltSanitizerRules.RULES_MAP)
12-
.putAll(co.worklytics.psoxy.rules.google.PrebuiltSanitizerRules.GOOGLE_DEFAULT_RULES_MAP)
13-
.putAll(co.worklytics.psoxy.rules.atlassian.jira.PrebuiltSanitizerRules.RULES_MAP)
14-
.putAll(co.worklytics.psoxy.rules.msft.PrebuiltSanitizerRules.MSFT_DEFAULT_RULES_MAP)
15-
.put("salesforce", co.worklytics.psoxy.rules.salesforce.PrebuiltSanitizerRules.SALESFORCE)
16-
.putAll(co.worklytics.psoxy.rules.slack.PrebuiltSanitizerRules.SLACK_DEFAULT_RULES_MAP)
17-
.putAll(co.worklytics.psoxy.rules.zoom.PrebuiltSanitizerRules.ZOOM_PREBUILT_RULES_MAP)
18-
.putAll(co.worklytics.psoxy.rules.dropbox.PrebuiltSanitizerRules.DROPBOX_PREBUILT_RULES_MAP)
19-
.build();
20-
}
10+
.put("asana", co.worklytics.psoxy.rules.asana.PrebuiltSanitizerRules.ASANA)
11+
.putAll(co.worklytics.psoxy.rules.cursor.PrebuiltSanitizerRules.CURSOR_DEFAULT_RULES_MAP)
12+
.putAll(co.worklytics.psoxy.rules.github.PrebuiltSanitizerRules.RULES_MAP)
13+
.putAll(co.worklytics.psoxy.rules.google.PrebuiltSanitizerRules.GOOGLE_DEFAULT_RULES_MAP)
14+
.putAll(co.worklytics.psoxy.rules.atlassian.jira.PrebuiltSanitizerRules.RULES_MAP)
15+
.putAll(co.worklytics.psoxy.rules.msft.PrebuiltSanitizerRules.MSFT_DEFAULT_RULES_MAP)
16+
.put("salesforce", co.worklytics.psoxy.rules.salesforce.PrebuiltSanitizerRules.SALESFORCE)
17+
.putAll(co.worklytics.psoxy.rules.slack.PrebuiltSanitizerRules.SLACK_DEFAULT_RULES_MAP)
18+
.putAll(co.worklytics.psoxy.rules.windsurf.PrebuiltSanitizerRules.WINDSURF_DEFAULT_RULES_MAP)
19+
.putAll(co.worklytics.psoxy.rules.zoom.PrebuiltSanitizerRules.ZOOM_PREBUILT_RULES_MAP)
20+
.putAll(co.worklytics.psoxy.rules.dropbox.PrebuiltSanitizerRules.DROPBOX_PREBUILT_RULES_MAP)
21+
.build();
22+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package co.worklytics.psoxy.rules.cursor;
2+
3+
import co.worklytics.psoxy.rules.RESTRules;
4+
import co.worklytics.psoxy.rules.Rules2;
5+
import com.google.common.collect.ImmutableMap;
6+
7+
import java.util.Map;
8+
9+
/**
10+
* Prebuilt sanitization rules for Cursor responses
11+
*/
12+
public class PrebuiltSanitizerRules {
13+
14+
15+
static final RESTRules CURSOR = Rules2.load("sources/cursor/cursor.yaml");
16+
17+
static public final Map<String, RESTRules> CURSOR_DEFAULT_RULES_MAP =
18+
ImmutableMap.<String, RESTRules>builder()
19+
.put("cursor", CURSOR)
20+
.build();
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package co.worklytics.psoxy.rules.windsurf;
2+
3+
import co.worklytics.psoxy.rules.RESTRules;
4+
import co.worklytics.psoxy.rules.Rules2;
5+
import com.google.common.collect.ImmutableMap;
6+
7+
import java.util.Map;
8+
9+
/**
10+
* Prebuilt sanitization rules for Cursor responses
11+
*/
12+
public class PrebuiltSanitizerRules {
13+
14+
15+
static final RESTRules WINDSURF = Rules2.load("sources/windsurf/windsurf.yaml");
16+
17+
static public final Map<String, RESTRules> WINDSURF_DEFAULT_RULES_MAP =
18+
ImmutableMap.<String, RESTRules>builder()
19+
.put("windsurf", WINDSURF)
20+
.build();
21+
}

0 commit comments

Comments
 (0)