Skip to content

Commit f457df9

Browse files
authored
Address/Suppress various CodeQL items (#236)
1 parent 2367e35 commit f457df9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

azuremanaged/src/main/java/com/microsoft/durabletask/azuremanaged/DurableTaskSchedulerConnectionString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static Map<String, String> parseConnectionString(String connectionString
153153
// Parse the supported auth types in a case-insensitive way
154154
switch (authType.toLowerCase().trim()) {
155155
case "defaultazure":
156-
return new DefaultAzureCredentialBuilder().build();
156+
return new DefaultAzureCredentialBuilder().build(); // CodeQL [SM05141] Use DefaultAzureCredential explicitly for local development and is decided by the user
157157
case "managedidentity":
158158
return new ManagedIdentityCredentialBuilder().clientId(getClientId()).build();
159159
case "workloadidentity":

client/src/main/java/com/microsoft/durabletask/util/UUIDGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public static UUID generate(int version, String algorithm, UUID namespace, Strin
2929

3030
private static MessageDigest hasher(String algorithm) {
3131
try {
32-
return MessageDigest.getInstance(algorithm);
32+
return MessageDigest.getInstance(algorithm); /* CodeQL [SM05136] Suppressed: SHA1 is not used for cryptographic purposes here. The information being hashed is not sensitive,
33+
and the goal is to generate a deterministic Guid. We cannot update to SHA2-based algorithms without breaking
34+
customers' inflight orchestrations. */
3335
} catch (NoSuchAlgorithmException e) {
3436
throw new RuntimeException(String.format("%s not supported.", algorithm));
3537
}

samples/src/main/java/io/durabletask/samples/OrchestrationController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import org.springframework.web.bind.annotation.RequestParam;
99
import org.springframework.web.bind.annotation.RestController;
1010

11+
import org.springframework.web.util.HtmlUtils;
12+
1113
@RestController
1214
public class OrchestrationController {
1315

@@ -19,7 +21,7 @@ public OrchestrationController() {
1921

2022
@GetMapping("/hello")
2123
public String greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
22-
return String.format("Hello, %s!", name);
24+
return String.format("Hello, %s!", HtmlUtils.htmlEscape(name));
2325
}
2426

2527
@GetMapping("/placeOrder")

0 commit comments

Comments
 (0)