- Use daemon threads in
FileWatcher
to enable clean shutdown.
- Add withPrintFn option to the config builder to support logging config with a user defined function
- Add better yaml errors when invalid file #354
- Fix formatting for secrets which contain new lines #363
- Moves
GcpSecretManagerPreprocessor
from azure to gcp package #362
- Added BooleanArrayDecoder
- Updated to latest SnakeYML version to avoid CVE
- Added support for
ByteArray
.
- TOML now supports heterogenous arrays.
- Add
prefix
option toEnvironmentVariablesPropertySource
which is then stripped from env vars before resolution is applied.
- Correct conversion between bytes and other units #347
- Fixed NPE in reporter with empty sources #345
- Do not add mask to prefix if string is less than prefix length
- Avoid reporting remote keys used in multiple places.
- Add fallback version of
Environment.forEnvVar
- Provide
Environment
to decoders and preprocessors through theDecoderContext
.
- Added
Environment
abstraction - Added
XdgConfigPropertySource
for loading config from $XDG_CONFIG_HOME - Added support for GCP Secrets Manager. To use import
hoplite-gcp
and set your keys to begcpsm://mykey
. - Added support for AWS Secrets Manager using Amazon's SDK version 2. The syntax is the same, but import
hoplite-aws2
instead ofhoplite-aws
. - Added
CascadeMode
to control how config should cascade through files. - Added decoder for
java.util.Locale
PrefixObfuscator
can now be configured by prefix length and mask.- Added remote-lookup details to the report to show keys used from AWS Secrets Manager, GCP cloud etc.
- Support squashing arrays into a comma delimited list by setting
flattenArraysToString
on the config builder. #339 - Support map lookup in AWS preprocessors #341
- Fix sealed subclass picking #338
Breaking Changes
These breaking changes are to advanced customization features. Most users will need to change no code.
ReporterBuilder
has been removed - specify the obfuscator and secrets policy directly on theConfigLoaderBuilder
.SecretsPolicy
interface has been changed to directly useNode
s and not justPath
s.- The
Preprocessor
interface has changed to have an extra parameter namedDecoderContext
.
- Fixed sealed class ordering in Kotlin 1.7.x #331
- Unable to decode Double and Float from a whole number #330
- Fixed snake/kebab case keys that end with a number #238
- Added an automatically registered
EnvironmentVariablesOverridePropertySource
which allows for environment variables of the formconfig.override.foo
to be automatically resolved asfoo
.
- Added a
AzureKeyVaultPreprocessor
to supportazurekeyvault://key
syntax for fetching secrets from Azure Key Vault. Requires thehoplite-azure
module. - Added a
VaultSecretPreprocessor
to supportvault://key
syntax for fetching secrets from a Hashicorp Valut instance. Requires thehoplite-vault
module.
- Fix for TOML keys containing dots are not decoded properly in maps #322
- Fix for unused config false-positive when using strict mode and maps #320
- Fixed anchors in yaml when using multiple files #307
- Added
subscribe
toReloadableConfig
- Added
Base64
type and decoder - Added
hoplite-micrometer-datadog
module - Added
hoplite-micrometer-prometheus
module - Added
hoplite-micrometer-statsd
module - Updated AWS secrets preprocessor to support
awssm://key
syntax - Updated Consul preprocessor to support
consul://key
syntax - Added
withPreprocessingIterations
to support repeated applications of preprocessors - Added
PropsPropertySource
to programmatically provide aProperties
based source.
- Added alphabetical key sort in reports #306
- Breaking change Added
constructor
andKClass
parameters to theParameterMapper
interface to allow inspection of annotations on fields #311 - Fixed snakecase variable throwing unused error with strict() #312
- Fixed sealed type subclass decode failure when single string field #313
- Added
withClassLoader
option to theConfigLoaderBuilder
. This classloader is used when loading the service registry for decoders.
- Print report even when config fails to parse.
- Added aws2 module for AWS support using the AWS SDK version 2
- Report should print after preprocessors have run.
- Fixed bug in
DefaultObfuscator
to avoid obfuscating booleans/numbers in yml.
- Optionally make using an unresolved substitution value not an error (#300)
- Fixed unresolved error typo (#301)
- Trim input keys in
AwsSecretsManagerPreprocessor
- Better errors when key are missing in
AwsSecretsManagerPreprocessor
- Updated default obfuscator to not obfuscate non-strings (#299)
- AWS ParameterStorePathPropertySource should support GetParametersByPathResult's nextToken (#295)
- Added
allowEmptyTree
onConfigLoaderBuilder
to not error if all property sources return no values.
- Added
SecretsPolicy
toReporter
to determine which fields should be obfuscated. - Adedd
HashObfuscator
to use the first 8 characters of the SHA-256 for obfuscation.
- Improved error messages from AWS Secrets Manager
- Adjusted default obfuscator to obfuscate all fields
- Fixed arg names used in constructor error message
- Requires Kotlin 1.6 or higher
- Requires JDK 11 or higher
ConfigLoader.Builder
has been removed and replaced withConfigLoaderBuilder
which has clearer semantics around defaults, and how to override defaults.- The env vars property source is no longer registered by default. Env vars are typically used to override specific config values, not as an entire source of values, so this avoids some subtle runtime bugs.
- Using an unresolved substitution value, eg ${foo} where foo doesn't exist, is now an error.
- The
ConfigLoader.loadConfig
functions that accept a File or Path have been removed to simply the config loader class. Instead, use the equivalent methods onConfigLoaderBuilder
ParameterMapper
s now returnSet<String>
rather thanString
to allow each parameter mapper to return more than one alternative name. This is only of relevance if you have written custom parameter mappers.Preprocessor
now returns errors as types, rather than throwing exceptions. This is only of relevance if you have written custom preprocessors.
ConfigLoaderBuilder.report
has been added to output a report of the property sources, the resolved config values ( obfuscated), and which config values were unused.ConfigLoaderBuilder.strict
mode reports unused config values at any level. If a property source provides a value that is not used, the config loader will error when strict mode is on.- Multiple
@ConfigAlias
annotations are now supported per field - Better error handling on preprocessors.
- Added support for sealed class objects in Json by defining empty maps #245
- Fixed regression with multiple constructors introduced in 1.4.10
- Moved LocalTimeDecoder to core module
- Fixed regression with ConfigSouce::fromPath #234
- Added ParameterStorePathPreprocessor
- Added ParameterStorePathPropertySource
- add LocalTimeDecoder (#233) - Jan Brezina
- Added order to defaults (Sources, Preprocessors and ParamMappers) (#229) - David Gomes
- Added extension methods for Minutes and Seconds to Kotlin durations.
- data class with multiple constructors can select appropriate constructor to load (#231) - alexis-airwallex
- Added
Minutes
andSeconds
as types and added decoders for both.
- Added support for watchers via the
hoplite-watch
andhoplite-watch-consul
modules. - Added config builder option to not include the default decoders and processors.
- Re-added support for Java8
- Added AwsSecretsManagerPreprocessor preprocessor.
- Bumped AWS client version to 1.12.36
- Added Consul preprocessor.
- Adds basic command line property source. (#217)
- Arrow moduled upgraded to arrow 0.13.2
- Added overload to support config when the config class is not reified. #213
- Support for yaml aliases #208.
- Kotlin version is now 1.4.30
- Breaking: The
PropertySource
interface has been changed to accept aPropertySourceContext
. This only affects users who have written their own custom PropertySource. - Added
@ConfigAlias
to allow a data class field to map to multiple values. #197 - Added strict option to
ConfigLoader.Builder
to throw an error if a config value is unused. Lenient mode is still the default. #187 - Bumped all module deps to latest versions
- Added support for ISO format in
Instant
decoder #192 - Added suport for objects in sealed classes #194
- Added {{style}} syntax for lookups across files.
- Fixed value types to allow for underlying types that are not strings. Eg,
data class Weight(val value: Int)
- Allows data classes with a single field named
value
to be treated as inline classes. Egdata class RetailerId(val value: String)
can be parsed directly fromretailerId: "SAKS"
without requiring another level of nesting #164
- Added
hoplite-vavr
module #185 - Added convenience methods to
PropertySource
to read from strings, streams and optional paths #186
- Fixed decoding of sets of enums #181
- Added
kotlinx-datetime
module #166 - Fix parser registry for custom mappings #179