Releases: DatL4g/Sekret
2.0.0-alpha-09
Fix for gradle configuration cache.
Still has the same Kotlin bug on Android as https://github.com/DatL4g/Sekret/releases/tag/v2.0.0-alpha-08.
Added target logging in case you are not sure which targets are detected/required.
Full Changelog: v2.0.0-alpha-08...v2.0.0-alpha-09
2.0.0-alpha-08
Support Kotlin 2.1.0
.
Seems like the new Kotlin version had some Gradle Plugin changes that where incompatible.
Keep in mind that Kotlin 2.1.0
has a bug that will cause the library to not work on some android devices.
https://youtrack.jetbrains.com/issue/KT-73559/K-Native-AndroidNativeArm64-linking-fails-starting-from-Kotlin-2.1.0
Only use this version if your ./gradlew yourApp:generateSekret
does not generate all target directories properly.
Then downgrade to 2.0.0-alpha-07
and Kotlin 2.0.21
for ./gradlew yourApp:createSekretNativeBinary
Full Changelog: v2.0.0-alpha-07...v2.0.0-alpha-08
2.0.0-alpha-07
- Updated to Kotlin
2.0.20
(fixes #7) - Fixes
maskNull.set(false)
not taking effect in gradle plugin
Full Changelog: v2.0.0-alpha-06...v2.0.0-alpha-07
2.0.0-alpha-06
This release refactors the gradle tasks to support configuration cache and Gradle 9.x.
What's Changed
- New
createSekretValue
task useful for CI/CD setups to modify the properties file - Update and split documentation #6
- Fix Gradle sync failing #4
Full Changelog: v2.0.0-alpha-05...v2.0.0-alpha-06
2.0.0-alpha-05
This release fixes some compile errors when using K2
2.0.0-alpha-04
This is a work in progress release as new features are added/planned.
Fixes some compile exceptions.
Take a look at the https://github.com/DatL4g/Sekret/releases/tag/v2.0.0-alpha-01 release first.
Common code
This release comes with a Sekret
class that can be called from common code.
// Nullable as Desktop-JVM and Android may return null
// Native targets will never return null
// JS targets will never return null
val secretValue: String? = Sekret.getValue(key)
Plugin Configuration
sekret {
/** Configuration for generating secrets */
properties {
enabled.set(true) // Important if you wan't to keep using generated secret
packageName.set("your.package.name")
// other value changes
nativeCopy {
desktopComposeResourcesFolder // set the location for desktop targets where the native binary should be placed
androidJNIFolder // set the location for android where the native binary should be placed
}
}
}
Tasks
This release comes with new tasks to support minimal configuration.
copySekretNativeBinary
Only copies the native binaries (Desktop-JVM and Android) to the specified directoriescreateSekretNativeBinary
Compile secrets to native binariescreateAndCopySekretNativeBinary
Combination ofcreateSekretNativeBinary
andcopySekretNativeBinary
generateSekretBuildScript
Generates a build script by checking your dependant targetgenerateSekret
Generates secrets provided in properties
2.0.0-alpha-01
This is a work in progress release as new features are added/planned.
Plugin Configuration
The sekret gradle plugin configuration changed to support minimal setup.
sekret {
/** New obfuscation configuration */
obfuscation {
secretMask.set("###")
secretMaskNull.set(true)
}
/** Configuration for generating secrets */
properties {
enabled.set(true) // Important if you wan't to keep using generated secret
packageName.set("your.package.name")
// other value changes
}
}
Obfuscation
Planned multiplatform compatible equivalent: https://github.com/LSPosed/LSParanoid
Added multiplatform compatible equivalent: https://github.com/aafanasev/sekret
To use these features add the annotations
dependecy to your build.gradle.kts
:
dependencies {
implementation("dev.datlag.sekret:annotations:<version>") // can be added to commonMain
}
Secret
You can apply a Secret
annotation to data
and value
class properties to prevent accidentally leaking the values.
For example you log user info:
data class User(
val name: String,
@Secret val password: String
)
val user = User("my-name", "my-password")
println(user.toString())
// can still be called
login(user.name, user.password)
Will result in something like this:
User(name=my-name, password=***)
Supported types
Type | Kotlin | Java |
---|---|---|
String | ✅ | ✅ |
StringBuilder | ✅ | ✅ |
CharSequence | ✅ | ✅ |
Appendable | ✅ | ✅ |
StringBuffer | NaN | ✅ |
CharArray | ❌ | ❌ |
1.0.1
Added missing WASM targets.
Full Changelog: v1.0.0...v1.0.1