aafanasev / sekret

Kotlin compiler plugin to hide secret data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't use toString() method for nested properties

ryanlewis opened this issue · comments

Consider the following example:

data class Credentials(val username: String, val password: String)
data class Config(val credentials: Credentials)

val config = Config(Credentials("foo", "bar"))
println("using $config")

// using Config(credentials=Credentials(username=foo, password=bar))

If using Sekret and adding @Secret to the password property of the Credentials class, you get output like the following instead:

using Config(credentials=Credentials@27a6ea4)

I'm not able to repro with Kotlin 1.8.0 + Sekret 0.1.4 + Gradle 7.4.2

Screenshot 2023-01-19 at 23 40 44

build.gradle.kts

plugins {
    kotlin("jvm") version "1.8.0"
    id("net.afanasev.sekret") version "0.1.4"
    application
}

group = "org.example"
version = "1.0-SNAPSHOT"

application {
    mainClass.set("MainKt")
}

repositories {
    mavenCentral()
}

dependencies {
    implementation("net.afanasev:sekret-annotation:0.1.4")
}

Could you share your environment details?

I'll close this one - I think this possibly could have been some cached build artifacts built prior to your latest release.