Skip to content

Conversation

varjolintu
Copy link
Member

@varjolintu varjolintu commented Sep 12, 2023

Adds support for URL wildcards and exact URL if the address is wrapped insinde " e.g. "https://example.com/page.php". Without wildcards, URL's are handled normally with the old/current implementation.

This feature is restricted to Additional URLs only, because storing URLs in wildcard form is not recommended, and it breaks the possibility to open the URL to a browser.

The wildcards can be used freely, and some example addresses are:

  • https://*.example.com/page/*
  • https://192.*.168.1/
  • subdomain.of.*.example.com/page/*/login

Fixes #3718.

Testing strategy

Manually, and added automatic tests.

Type of change

  • ✅ New feature (change that adds functionality)

@varjolintu varjolintu added this to the v2.8.0 milestone Sep 12, 2023
@varjolintu varjolintu changed the title Ddd support for URL wildcards and exact URL Add support for URL wildcards and exact URL Sep 12, 2023
@varjolintu varjolintu marked this pull request as draft September 12, 2023 07:20
@mfrakka

This comment has been minimized.

@varjolintu

This comment has been minimized.

@mfrakka

This comment has been minimized.

@mfrakka

This comment has been minimized.

@mfrakka

This comment has been minimized.

@droidmonkey

This comment has been minimized.

@mfrakka

This comment has been minimized.

@varjolintu
Copy link
Member Author

varjolintu commented Dec 4, 2023

TODO: Check if using https://doc.qt.io/qt-6/qregularexpression.html#wildcardToRegularExpression is preferred after Qt6 upgrade. Qt5 does not support https://doc.qt.io/qt-6/qregularexpression.html#WildcardConversionOption-enum.

@droidmonkey
Copy link
Member

Oh nice that will likely replace one of our tools functions.

@phoerious phoerious added pr: new feature Pull request adds a new feature and removed new feature labels Nov 22, 2024
@droidmonkey
Copy link
Member

droidmonkey commented Jan 12, 2025

@varjolintu can you rebase this onto develop?

Also want to make the change that wildcards are only valid in the "extra urls" and not the main url so click to open will still work.

@varjolintu
Copy link
Member Author

@varjolintu can you rebase this onto develop?

Also want to make the change that wildcards are only valid in the "extra urls" and not the main url so click to open will still work.

This change would be very welcome. I was also concerned about this if wildcards are used in the main URLs.

@varjolintu varjolintu force-pushed the feature/add_support_for_url_wildcards branch from 9ab03a5 to 55ddd9d Compare January 12, 2025 20:38
@varjolintu varjolintu force-pushed the feature/add_support_for_url_wildcards branch from 55ddd9d to a20fa8e Compare January 21, 2025 14:41
@varjolintu
Copy link
Member Author

varjolintu commented Jan 21, 2025

Made the necessary changes. Wildcards and exact URL is now only supported in the Additional URLs section.
UrlTools::isValidurl("") needed some extra handling for the loose comparison.

@droidmonkey droidmonkey force-pushed the feature/add_support_for_url_wildcards branch from 1575ac5 to 029f28a Compare February 1, 2025 17:15
@droidmonkey
Copy link
Member

@varjolintu do you think this is ready for 2.7.10?

@varjolintu
Copy link
Member Author

@varjolintu do you think this is ready for 2.7.10?

I think so. Only thing I was wondering is that should we prevent Additional URLs that are just * or *.com etc. But then again, it's up to the user what to use.

@droidmonkey
Copy link
Member

droidmonkey commented Feb 2, 2025

I do believe there should at least be a root host and TLD, otherwise you are opening this feature up to phishing attacks. We can allow it but show the "red not valid" background color. Nothing really prevents the user from entering a broken url.

@varjolintu varjolintu force-pushed the feature/add_support_for_url_wildcards branch from 029f28a to 590cd3c Compare February 3, 2025 06:12
@Shnoulle

This comment was marked as off-topic.

@varjolintu

This comment was marked as off-topic.

@droidmonkey droidmonkey force-pushed the feature/add_support_for_url_wildcards branch from 62f2a34 to c34d1bd Compare February 9, 2025 20:02
@droidmonkey droidmonkey merged commit 9ba6ada into keepassxreboot:develop Feb 10, 2025
11 checks passed
@droidmonkey
Copy link
Member

@varjolintu I messed around with this a little and I think the invalid URL tester still needs some work:

image

@droidmonkey droidmonkey added the pr: backported Pull request backported to previous release label Feb 11, 2025
droidmonkey added a commit that referenced this pull request Feb 11, 2025
* Add support for URL wildcards with Additional URL feature

* Only check TLD if wildcard is used

* Avoid using network function in no-feature build

---------

Co-authored-by: varjolintu <sami.vanttinen@ahmala.org>
Co-authored-by: Jonathan White <support@dmapps.us>
@varjolintu varjolintu deleted the feature/add_support_for_url_wildcards branch February 11, 2025 05:50
@varjolintu
Copy link
Member Author

@droidmonkey I'll make a quick fix to it.

pull bot pushed a commit to blog2i2j/keepassxreboot.._..keepassxc that referenced this pull request Feb 22, 2025
* Add support for URL wildcards with Additional URL feature

* Only check TLD if wildcard is used

* Avoid using network function in no-feature build

---------

Co-authored-by: varjolintu <sami.vanttinen@ahmala.org>
Co-authored-by: Jonathan White <support@dmapps.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Browser pr: backported Pull request backported to previous release pr: new feature Pull request adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow limited wildcard matching for Browser Integration URLs
5 participants