diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fa3a57b3..c3dc1550 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,7 +17,7 @@ buildConfig = "3.0.3" owasp = "7.1.0.1" jacksonDatabind = "2.14.2" picocli = "4.6.3" -snakeYaml = "1.33" +snakeYaml = "2.0" #used for authz lib integration rundeck = "4.2.0-20220509" testcontainers = "1.17.2" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index c124d053..3be722f7 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -32,6 +32,7 @@ + @@ -4493,6 +4494,14 @@ + + + + + + + + diff --git a/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java b/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java index ede396d0..8011c03c 100644 --- a/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java +++ b/rd-cli-tool/src/main/java/org/rundeck/client/tool/Main.java @@ -285,7 +285,7 @@ private static void configYamlFormat(final RdBuilder belt, final RdClientConfig DumperOptions.FlowStyle.FLOW ); dumperOptions.setPrettyFlow(config.getBool("RD_YAML_PRETTY", true)); - Representer representer = new Representer(); + Representer representer = new Representer(dumperOptions); representer.addClassTag(JobItem.class, Tag.MAP); representer.addClassTag(ScheduledJobItem.class, Tag.MAP); representer.addClassTag(DateInfo.class, Tag.MAP); diff --git a/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java b/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java index bdf86954..8162c572 100644 --- a/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java +++ b/rd-cli-tool/src/main/java/org/rundeck/client/tool/commands/projects/Configure.java @@ -27,6 +27,7 @@ import org.rundeck.client.tool.options.ProjectNameOptions; import org.rundeck.client.tool.options.ProjectRequiredNameOptions; import org.rundeck.client.tool.options.UnparsedConfigOptions; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import picocli.CommandLine; @@ -157,7 +158,7 @@ public static Map loadConfig(final ConfigFileOptions opts, inputConfig.putAll(map); break; case yaml: - Yaml yaml = new Yaml(new SafeConstructor()); + Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); try (FileInputStream fis = new FileInputStream(input)) { Object load = yaml.load(fis); if (load instanceof Map) {