Enable use of regexp for matching sites#340
Conversation
|
Could be used for #199, pfn/passifox#633, pfn/passifox#574, pfn/passifox#312, If this PR gets accepted I probably would also adjust the chromeIPass plugin to be able to edit the regexp in the gui |
|
Hello, it's great to see there's finally an implementation targeting the original keepasshttp. I wonder if there's a possibility to add more features to this extension. For example, KeeFox supports 4 features: altURLs, regExURLs, blockedURLs, regExBlockedURLs, and all of them are arrays, so you can use multiple regular expressions via KeeFox. How about bringing this ability to KeePassHttp, too? I have written a detailed description for KeeFox's protocol: keepassxreboot/keepassxc#398 (comment) |
|
I've done almost exactly the same thing on my own. After i've done it and when i wanted to create a pull request, i saw this :) Nice work @Skywalker-11 Any news for PR accept from @pfn ? Repo seems dead since a while, should the community fork it for a more active development? |
This PR enables the use of regular expressions to match the correct keepass entries for the provided url.
To use this add a string field for the keepass entries named
KeePassHttp Settingsand set the value to{"RegExp":"WHATEVER_URL_REGEXP"}.In WHATEVER_URL_REGEXP (replace with the actual regexp you want to use) you have to escape every
\with an additional\so that the regular expression for matching the character/for example would result in\\/or for the character\it would be\\\\. This is because the value is stored as a JSON string which itself uses\for character escaping.Example url matches for url
https://example.org/this/is/a/path?with¶meters:{"RegExp":"^https:\\/\\/example.org\\/this\\/is\\/a\\/path\?with¶meters$"}(exact match){"RegExp":"^https:\\/\\/example.org\\/this\\/is\\/a\\/path\?.*$"}(with¶meterscan be anything){"RegExp":"^https:\\/\\/example.org\\/this\\/is\\/a\\/path\?"}(same:with¶meterscan be anything){"RegExp":"^https:\\/\\/example.org\\/"}(all urls on example.org){"RegExp":"^https:\\/\\/.*\.example.org\\/"}(all urls on example.org including subdomains for example.org){"RegExp":"^https:\\/\\/example.(org|com)\\/"}(all urls on example.org and example.com){"RegExp":"example.org\\/"}(matches all protocols for example.org (https, http, ftp, etc.) BUT ALSO all urls that has....example.org/....in it