Skip to content

Commit a0301b3

Browse files
committed
Merge branch 'develop'
2 parents 9c00173 + aff5e5d commit a0301b3

File tree

20 files changed

+166319
-30
lines changed

20 files changed

+166319
-30
lines changed

.github/workflows/maven-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121
strategy:
2222
matrix:
23-
java: [11, 17]
23+
java: [11, 17, 21]
2424
os: [ubuntu-latest]
2525
distribution: [temurin]
2626
include:

.github/workflows/maven-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- name: Configure GIT
2323
run: |

.github/workflows/release-from-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: write
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- uses: ncipollo/release-action@v1
1717
with:
1818
body: 'Changes: https://devops.wcm.io/conga/changes-report.html'

changes.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 https://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
2424
<body>
2525

26+
<release version="1.16.4" date="2023-10-18">
27+
<action type="fix" dev="sseifert" issue="47">
28+
Increase SnakeYAML codepoint limit to 64MB (from default 3MB).
29+
</action>
30+
</release>
31+
2632
<release version="1.16.2" date="2023-08-31">
2733
<action type="fix" dev="sseifert">
2834
conga-maven-plugin: Eliminate warning "Parameter 'repoSession' (user property 'repositorySystemSession') is read-only, must not be used in configuration".

generator/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>io.wcm.devops.conga</groupId>
2727
<artifactId>io.wcm.devops.conga.parent</artifactId>
28-
<version>1.16.2</version>
28+
<version>1.16.4</version>
2929
<relativePath>../parent/pom.xml</relativePath>
3030
</parent>
3131

@@ -44,7 +44,7 @@
4444
<dependency>
4545
<groupId>io.wcm.devops.conga</groupId>
4646
<artifactId>io.wcm.devops.conga.model</artifactId>
47-
<version>1.16.2</version>
47+
<version>1.16.4</version>
4848
<scope>compile</scope>
4949
</dependency>
5050

generator/src/main/java/io/wcm/devops/conga/generator/util/VariableStringResolver.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package io.wcm.devops.conga.generator.util;
2121

2222
import java.util.Map;
23+
import java.util.Objects;
2324
import java.util.regex.Matcher;
2425
import java.util.regex.Pattern;
2526

@@ -186,7 +187,7 @@ private Object resolveSingle(Matcher matcher, Map<String, Object> variables, int
186187
// resolve variable
187188
if (variableMatcher.matches()) {
188189
String valueProviderName = variableMatcher.group(VARIABLE_POS_VALUE_PROVIDER_NAME);
189-
String variable = StringUtils.defaultString(variableMatcher.group(VARIABLE_POS_VARIABLE_1), variableMatcher.group(VARIABLE_POS_VARIABLE_2));
190+
String variable = Objects.toString(variableMatcher.group(VARIABLE_POS_VARIABLE_1), variableMatcher.group(VARIABLE_POS_VARIABLE_2));
190191
String defaultValueString = variableMatcher.group(VARIABLE_POS_DEFAULT_VALUE);
191192

192193
Object valueObject = variableResolver.resolve(valueProviderName, variable, defaultValueString, variables);
@@ -241,7 +242,7 @@ private Object resolveMulti(Matcher matcher, Map<String, Object> variables, int
241242
// resolve variable
242243
if (variableMatcher.matches()) {
243244
String valueProviderName = variableMatcher.group(VARIABLE_POS_VALUE_PROVIDER_NAME);
244-
String variable = StringUtils.defaultString(variableMatcher.group(VARIABLE_POS_VARIABLE_1), variableMatcher.group(VARIABLE_POS_VARIABLE_2));
245+
String variable = Objects.toString(variableMatcher.group(VARIABLE_POS_VARIABLE_1), variableMatcher.group(VARIABLE_POS_VARIABLE_2));
245246
String defaultValueString = variableMatcher.group(VARIABLE_POS_DEFAULT_VALUE);
246247

247248
Object valueObject = variableResolver.resolve(valueProviderName, variable, defaultValueString, variables);

model/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>io.wcm.devops.conga</groupId>
2727
<artifactId>io.wcm.devops.conga.parent</artifactId>
28-
<version>1.16.2</version>
28+
<version>1.16.4</version>
2929
<relativePath>../parent/pom.xml</relativePath>
3030
</parent>
3131

@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>io.wcm.devops.conga</groupId>
4242
<artifactId>io.wcm.devops.conga.resource</artifactId>
43-
<version>1.16.2</version>
43+
<version>1.16.4</version>
4444
<scope>compile</scope>
4545
</dependency>
4646

model/src/main/java/io/wcm/devops/conga/model/reader/EnvironmentReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
*/
2020
package io.wcm.devops.conga.model.reader;
2121

22-
import org.yaml.snakeyaml.LoaderOptions;
2322
import org.yaml.snakeyaml.Yaml;
2423
import org.yaml.snakeyaml.constructor.Constructor;
2524

2625
import io.wcm.devops.conga.model.environment.Environment;
26+
import io.wcm.devops.conga.model.util.YamlUtil;
2727

2828
/**
2929
* Reads environment definitions.
@@ -38,7 +38,7 @@ public EnvironmentReader() {
3838
}
3939

4040
private static Yaml getYaml() {
41-
Constructor constructor = new Constructor(Environment.class, new LoaderOptions());
41+
Constructor constructor = new Constructor(Environment.class, YamlUtil.createLoaderOptions());
4242
return new Yaml(constructor);
4343
}
4444

model/src/main/java/io/wcm/devops/conga/model/reader/RoleReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
*/
2020
package io.wcm.devops.conga.model.reader;
2121

22-
import org.yaml.snakeyaml.LoaderOptions;
2322
import org.yaml.snakeyaml.Yaml;
2423
import org.yaml.snakeyaml.constructor.Constructor;
2524

2625
import io.wcm.devops.conga.model.role.Role;
26+
import io.wcm.devops.conga.model.util.YamlUtil;
2727

2828
/**
2929
* Reads role definitions.
@@ -38,7 +38,7 @@ public RoleReader() {
3838
}
3939

4040
private static Yaml getYaml() {
41-
Constructor constructor = new Constructor(Role.class, new LoaderOptions());
41+
Constructor constructor = new Constructor(Role.class, YamlUtil.createLoaderOptions());
4242
return new Yaml(constructor);
4343
}
4444

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* #%L
3+
* wcm.io
4+
* %%
5+
* Copyright (C) 2023 wcm.io
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package io.wcm.devops.conga.model.util;
21+
22+
import org.yaml.snakeyaml.LoaderOptions;
23+
24+
/**
25+
* Helper methods for SnakeYAML.
26+
*/
27+
public final class YamlUtil {
28+
29+
/*
30+
* Increase default codepoint limit from 3MB to 64MB.
31+
*/
32+
private static final int YAML_CODEPOINT_LIMIT = 64 * 1024 * 1024;
33+
34+
private YamlUtil() {
35+
// static methods only
36+
}
37+
38+
/**
39+
* Create a new loader options instances with default configuration.
40+
* @return SnakeYAML loader option.s
41+
*/
42+
public static LoaderOptions createLoaderOptions() {
43+
LoaderOptions options = new LoaderOptions();
44+
options.setCodePointLimit(YAML_CODEPOINT_LIMIT);
45+
return options;
46+
}
47+
48+
}

0 commit comments

Comments
 (0)