keepassnatmsg icon indicating copy to clipboard operation
keepassnatmsg copied to clipboard

Ask questions about URL matching rules

Open diaodeng opened this issue 1 year ago • 7 comments

image Record A sets the field starting with URL and the field starting with KPH: to www.test2.com Record A default URL is www.test1.com Record B's default URL is www.test2.com image

Access address: www.test2.com My understanding is that if I only activate 13 or only activate 14, it should be able to match records A and B, but in reality, no matter how I set it, it can only match record B. Is it my understanding problem?

Do not want to achieve the above matching logic by copying A.

diaodeng avatar Oct 10 '23 17:10 diaodeng

Software version used image

diaodeng avatar Oct 10 '23 17:10 diaodeng

I have the same problem on my side with my database. I think the problem is with the "Match URL schemes" option. Try unchecking this option and then redoing your test to see.

damienfinck avatar Nov 18 '23 13:11 damienfinck

Hi, I've created a PR https://github.com/smorks/keepassnatmsg/pull/115 to correct this compatibility problem between the 2 options.

damienfinck avatar Dec 31 '23 14:12 damienfinck

@diaodeng : Reading your explanation again, I realize that I've misunderstood. I have indeed corrected a bug in the plugin, but probably not the one you're describing.

I tried to reproduce what you said, and I think I did the same as you.

image

First entry:

  • Title: A
  • Username: A
  • URL: https://example.org

Second Entry:

  • Title: B
  • Username: B
  • URL: https://keepass.info/help/kb/testform.html
  • Other string fields:
    • Name: KPH: URL_test2
      • Value: https://keepass.info/help/kb/testform.html
    • Name: URL_test2
      • Value: https://keepass.info/help/kb/testform.html

And I visit the website https://keepass.info/help/kb/testform.html

With this, if I check option 13, it only offers me B If I only check option 14, it only offers me B

I think this behavior is normal.

Option 13 makes one entry work with multiple URLs. Option 14 allows multiple fields to be completed on a form in a website (in addition to username and password fields).

So entry A is not output in any case, because :

  • it does not contain "https://keepass.info/help/kb/testform.html" in the URL field
  • it doesn't contain any other field whose name begins with "URL" (and if "Search string fields for URL" option is checked)

Entry B is always output via its URL field.

Does this answer your questions?

damienfinck avatar Jan 04 '24 22:01 damienfinck

@damienfinck We should understand it differently.

There should be the account test111 here. image image

This way doesn't match, right? It's an incomplete domain name. image

diaodeng avatar Jan 08 '24 05:01 diaodeng

Hi,

Answer to question n°1: With the default KeePassNatMsg options, you'll only have the test123 entry. But if you check the "Search string fields for URL" option in the "Advanced" tab of the KeePassNatMsg options, you'll get 2 results (test123 and test111). The "KPH" field is not useful in this case and can be removed. It is not used to match URLs, only form fields.

Answer to question n°2: The algorithm currently in place search for entries for "accounts.google.com". If entries are found in the database, the algorithm continues with these entries. If no entries are found, we look for entries for "google.com" in the database. In your case, there are entries for "accounts.google.com", so entries with "google.com" will not be used.

damienfinck avatar Jan 08 '24 18:01 damienfinck

Ok, got it. Thank you very much for your answer.

diaodeng avatar Jan 09 '24 04:01 diaodeng