diff options
author | Ivan Tham <pickfire@riseup.net> | 2021-12-29 17:57:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 09:57:28 +0000 |
commit | 8b5be3f7857605dd0c152610fbf2fb750f717b67 (patch) | |
tree | fe0bec38c84d6c6e15554b2b8b5607ab2db3d8a8 /format-common | |
parent | 05f9e976ed1787a29503f433d0cc3958ecae6f21 (diff) |
Recognize mail as alternative to email (#1629)
* Recognize mail as alternative to email
* Add test
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'format-common')
-rw-r--r-- | format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt | 1 | ||||
-rw-r--r-- | format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt | 1 |
2 files changed, 2 insertions, 0 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 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) } |