extract

Recursively inspects the primary constructor parameters of klass and returns a list of SecretFieldInfo for every secret field found.

The extraction logic:

  1. For each parameter annotated with @Secret, a SecretFieldInfo is created using the annotation's MaskStrategy and visibleChars.

  2. For each parameter of type SecretString without a @Secret annotation, a SecretFieldInfo is created with MaskStrategy.FULL and visibleChars = 0.

  3. For each parameter whose type is a data class, the method recurses, prepending the current field name to all discovered paths.

If klass has no primary constructor, an empty list is returned.

Return

A list of SecretFieldInfo entries, one per secret field.

Since

1.0

Parameters

klass

The KClass to inspect (typically a data class).

prefix

A dot-separated path prefix for nested calls. Defaults to "" (root level).

See also