Skip to content

Release Java SDK v17.2.1#975

Open
stas-schaller wants to merge 12 commits intomasterfrom
release/sdk/java/core/v17.2.1
Open

Release Java SDK v17.2.1#975
stas-schaller wants to merge 12 commits intomasterfrom
release/sdk/java/core/v17.2.1

Conversation

@stas-schaller
Copy link
Copy Markdown
Contributor

@stas-schaller stas-schaller commented Mar 23, 2026

Summary

Release branch for Java SDK v17.2.1 — three changes: IL5 region support, serialization correctness for record create, and file attachment crash fix.

Changes

New Features

  • IL5 region mapping (KSM-902): added \"IL5\" -> \"il5.keepersecurity.us\" to the initializeStorage() region map in SecretsManager.kt. Tokens prefixed IL5: now route to the DoD Impact Level 5 environment.

Bug Fixes

  • Custom field omitted from record create payload (KSM-823): KeeperRecordData.custom defaulted to null, causing kotlinx-serialization to omit \"custom\" from the V3 API payload when no custom fields were set. Changed default to mutableListOf() and added @EncodeDefault to force inclusion. Regression test added.
  • KeeperFileData crash when lastModified absent (KSM-854): files uploaded by non-SDK clients (iOS, Android, Web Vault) omit lastModified; kotlinx-serialization treated it as required, throwing MissingFieldException and silently dropping the attachment. Added = 0 default, consistent with .NET SDK behavior (KSM-674).

Deferred to v17.2.2

  • Resource leaks in LocalConfigStorage and SecretsManager (KSM-855): deferred to v17.2.2 for faster v17.2.1 QA cycle. Full implementation available in feature branch feature/java-ksm-855-resource-leaks.

Breaking Changes

None.

Related Issues

@stas-schaller stas-schaller force-pushed the release/sdk/java/core/v17.2.1 branch from e5e9bc7 to 1802c4c Compare March 27, 2026 18:31
Add default value of 0 to KeeperFileData.lastModified so that
kotlinx-serialization does not throw MissingFieldException when
file metadata uploaded by non-SDK clients omits the field.

Also bumps version to 17.2.1 and adds regression tests for the
missing-field case plus guards for the integer and fractional cases.
… SecretsManager

Replace manual open/close patterns with Kotlin .use {} blocks and
try/finally + disconnect() to guarantee resource closure on exceptions.

LocalConfigStorage.kt:
- init block: BufferedReader now closed via .use {} (previously always leaked)
- saveToFile(): BufferedWriter wrapped in .use {}
- saveCachedValue(): FileOutputStream wrapped in .use {}
- getCachedValue(): FileInputStream wrapped in .use {}

SecretsManager.kt:
- postFunction(): replace with() block with try/finally + connection.disconnect()
- downloadFile(): same pattern; stream read via .use {}
- uploadFile(): same pattern; outputStream and response stream via .use {}

SecretsManagerTest.kt:
- uploadFile test: FileInputStream wrapped in .use {}
@stas-schaller stas-schaller force-pushed the release/sdk/java/core/v17.2.1 branch from 1802c4c to b1f61c1 Compare April 9, 2026 19:38
…yload

KeeperRecordData.custom defaulted to null, causing kotlinx-serialization
to omit the field from the V3 API payload when no custom fields were set.
Commander and Vault always include "custom": [] on every record.

- Change custom default from null to mutableListOf()
- Add @EncodeDefault to force serialization even when list is empty
  (kotlinx-serialization skips default-valued fields without this)
- Remove now-redundant null guards in SecretsManager.kt
- Add regression test: testRecordCreateEmptyCustomSerialized
@stas-schaller stas-schaller changed the title feat(sdk/java): release Java SDK v17.2.1 Release Java SDK v17.2.1 Apr 14, 2026
@stas-schaller stas-schaller marked this pull request as ready for review April 15, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keeper Java/Kotlin: Field 'lastModified' is required for type with serial name...

1 participant