aboutsummaryrefslogtreecommitdiff
path: root/format-common/src
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-05-23 18:21:02 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-05-23 18:21:02 +0530
commitb2b1e92b452db74ce03842ba467d2eddb4966b40 (patch)
tree1521ff124b417eb2481cc9050983f6e78112df1f /format-common/src
parente04371d64ae91ac2b797e77dc45c95c5f40b3981 (diff)
format-common: make `PasswordEntry#extraContentString` public API
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'format-common/src')
-rw-r--r--format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt8
1 files changed, 6 insertions, 2 deletions
diff --git a/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt b/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
index 96337bf7..b2633c71 100644
--- a/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
+++ b/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
@@ -5,7 +5,6 @@
package dev.msfjarvis.aps.data.passfile
-import androidx.annotation.VisibleForTesting
import com.github.michaelbull.result.mapBoth
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
@@ -52,6 +51,12 @@ constructor(
public val extraContent: Map<String, String>
/**
+ * Direct [String] representation of the extra content of this entry, before any transforms are
+ * applied. Only use this when the extra content is required in a formatting-preserving manner.
+ */
+ public val extraContentString: String
+
+ /**
* A [StateFlow] providing the current TOTP. It will emit a single empty string on initialization
* which is replaced with a real TOTP if applicable. Call [hasTotp] to verify whether or not you
* need to observe this value.
@@ -67,7 +72,6 @@ constructor(
private val totpSecret: String?
private val totpPeriod: Long
private val totpAlgorithm: String
- @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) internal val extraContentString: String
init {
val (foundPassword, passContent) = findAndStripPassword(content.split("\n".toRegex()))