Skip to content

2.0.0-alpha-01

Pre-release
Pre-release
Compare
Choose a tag to compare
@DatL4g DatL4g released this 23 Jan 15:39
· 43 commits to master since this release
4115a34

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