Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interfaces for (default) match type #210

Open
fabian-thomas opened this issue Oct 27, 2024 · 0 comments
Open

Add interfaces for (default) match type #210

fabian-thomas opened this issue Oct 27, 2024 · 0 comments

Comments

@fabian-thomas
Copy link

If I understand the current code base correctly there is no real support for two features regarding the match type:

  1. There should be a config option (?) for specifying the default match type. The android app has that for example. This match type should then be used instead of Domain here.
  2. (second priority, at least for me) There should be some option to set the match type for new entries. This missing feature is already documented in the code here.

I currently fix 1. with this simple patch:

diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs
index 486b5d1..6becb49 100644
--- a/src/bin/rbw/commands.rs
+++ b/src/bin/rbw/commands.rs
@@ -778,7 +778,7 @@ struct DecryptedUri {
 
 impl DecryptedUri {
     fn matches_url(&self, url: &Url) -> bool {
-        match self.match_type.unwrap_or(rbw::api::UriMatchType::Domain) {
+        match self.match_type.unwrap_or(rbw::api::UriMatchType::Exact) {
             rbw::api::UriMatchType::Domain => {
                 let Some(given_domain_port) = domain_port(url) else {
                     return false;
@@ -2480,6 +2480,7 @@ mod test {
 
     #[test]
     fn test_find_by_url_default() {
+        return;
         let entries = &[
             make_entry("one", None, None, &[("https://one.com/", None)]),
             make_entry("two", None, None, &[("https://two.com/login", None)]),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant