Skip to content

Commit

Permalink
Use SafeConstructor class for SnakeYAML
Browse files Browse the repository at this point in the history
  • Loading branch information
rsvoboda committed Jan 21, 2022
1 parent 350aecf commit 06a8c62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/quarkusbuilditemdoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.jboss.forge.roaster.model.source.FieldSource;
import org.jboss.forge.roaster.model.source.JavaClassSource;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
import picocli.CommandLine;
import picocli.CommandLine.Command;

Expand Down Expand Up @@ -151,7 +152,7 @@ private Path findPom(Path path) {

private Map<String, String> extractNames(Path root, Iterable<String> extensionDirs) throws IOException {
Map<String, String> names = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
Yaml yaml = new Yaml();
Yaml yaml = new Yaml(new SafeConstructor());
for (String extension : extensionDirs) {
Path yamlPath = root.resolve("extensions/" + extension + "/runtime/src/main/resources/META-INF/quarkus-extension.yaml");
if (Files.exists(yamlPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.logging.Logger;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;

import io.netty.handler.codec.http.HttpHeaderNames;
import io.quarkus.builder.Version;
Expand Down Expand Up @@ -72,7 +73,7 @@ private void initLazyState() {
synchronized (extensions) {
if (extensions.isEmpty()) {
try {
final Yaml yaml = new Yaml();
final Yaml yaml = new Yaml(new SafeConstructor());
ClassPathUtils.consumeAsPaths("/META-INF/quarkus-extension.yaml", p -> {
try {
final String desc;
Expand Down

0 comments on commit 06a8c62

Please sign in to comment.