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

Use SafeConstructor class for SnakeYAML #23091

Merged
merged 1 commit into from
Jan 22, 2022
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
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