From 8b5be3f7857605dd0c152610fbf2fb750f717b67 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 29 Dec 2021 17:57:28 +0800 Subject: Recognize mail as alternative to email (#1629) * Recognize mail as alternative to email * Add test Co-authored-by: Harsh Shandilya --- .../src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt | 1 + .../src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt | 1 + 2 files changed, 2 insertions(+) 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 81398b45..2bccd2cc 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 @@ -216,6 +216,7 @@ constructor( "user:", "account:", "email:", + "mail:", "name:", "handle:", "id:", diff --git a/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt b/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt index 32066cc3..0f63a74a 100644 --- a/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt +++ b/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt @@ -119,6 +119,7 @@ class PasswordEntryTest { assertEquals("foo@example.com", makeEntry("\nemail: foo@example.com").username) assertEquals("username", makeEntry("\nidentity: username\nlogin: another_username").username) assertEquals("username", makeEntry("\nLOGiN:username").username) + assertEquals("foo@example.com", makeEntry("pass\nmail: foo@example.com").username) assertNull(makeEntry("secret\nextra\ncontent\n").username) } -- cgit v1.2.3