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

Version settings-security model independently of JAR (impl/spec version) #94

Merged
merged 1 commit into from
Feb 2, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public static void write(Path target, SettingsSecurity configuration, boolean do
Path tempFile = parent.resolve(target.getFileName() + "."
+ Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp");

configuration.setModelVersion(specVersion());
// always set manually as some features don't require changes in the underlying model but still require
// adjustments of either minor or major version of the JAR
configuration.setModelVersion("4.0");
configuration.setModelEncoding(StandardCharsets.UTF_8.name());

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void readWrite() throws IOException {
Path path = Path.of("./target/sec.xml");
SettingsSecurity config = SecUtil.read(path);
assertNotNull(config);
assertEquals(SecUtil.specVersion(), config.getModelVersion());
assertEquals("4.0", config.getModelVersion());
assertEquals(StandardCharsets.UTF_8.name(), config.getModelEncoding());
assertEquals("magic:mighty", config.getDefaultDispatcher());
SecUtil.write(path, config, false);
Expand All @@ -79,7 +79,7 @@ void readWriteWithBackup() throws IOException {
Path path = Path.of("./target/sec.xml");
SettingsSecurity config = SecUtil.read(path);
assertNotNull(config);
assertEquals(SecUtil.specVersion(), config.getModelVersion());
assertEquals("4.0", config.getModelVersion());
assertEquals(StandardCharsets.UTF_8.name(), config.getModelEncoding());
assertEquals("magic:mighty", config.getDefaultDispatcher());
SecUtil.write(path, config, true);
Expand Down
Loading