Repository: bilelmoussaoui/oo7 (language: rust)

Issue:
Support `plain` secret transport
Hi,

I created [pass-secrets](https://github.com/nullobsi/pass-secrets), an alternative implementation of a DBus Secret-Service. Most applications work with it, but since this library forces the use of the Encrypted method that I have not implemented yet here:
https://github.com/bilelmoussaoui/oo7/blob/5e89053ed75ba4bc117c6ab9698aad595e297d72/src/keyring.rs#L55

https://github.com/nullobsi/pass-secrets/issues/10 someone is having some issues.

I plan on implementing this auth method sometime. But it seems a bit complicated and I want to make sure I get it right. As a stopgap and to prevent issues with other potential implmentations, it's reccomended to catch the error if it is an `org.freedesktop.DBus.Error.NotSupported`, and in that case attempt to use `plain` algorithm.

Thank you :)


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index 96cb162ac..236d7c3e7 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -10,7 +10,7 @@ jobs:
     name: Check
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions-rs/toolchain@v1
         with:
           profile: minimal
@@ -24,7 +24,7 @@ jobs:
     name: Test Suite
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Install dependencies
         run: |
           sudo apt-get install gnome-keyring dbus dbus-x11 -y
@@ -45,7 +45,7 @@ jobs:
     name: Rustfmt
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions-rs/toolchain@v1
         with:
           profile: minimal
@@ -61,7 +61,7 @@ jobs:
     name: Clippy
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions-rs/toolchain@v1
         with:
           profile: minimal
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 475937150..eefd9edc5 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -9,7 +9,7 @@ jobs:
   build-deploy:
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: actions-rs/toolchain@v1
         with:
           profile: minimal
diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml
index 3d18a950c..561b91383 100644
--- a/.github/workflows/typos.yml
+++ b/.github/workflows/typos.yml
@@ -7,7 +7,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Checkout Actions Repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
 
       - name: Check spelling of file.txt
         uses: crate-ci/typos@master
diff --git a/src/keyring.rs b/src/keyring.rs
index 640b7f0de..9ced62755 100644
--- a/src/keyring.rs
+++ b/src/keyring.rs
@@ -52,7 +52,13 @@ impl Keyring {
                 "Application is not sandboxed, falling back to the Sercret Service backend"
             );
         }
-        let service = dbus::Service::new(Algorithm::Encrypted).await?;
+        let service = match dbus::Service::new(Algorithm::Encrypted).await {
+            Ok(service) => Ok(service),
+            Err(dbus::Error::Zbus(zbus::Error::Unsupported)) => {
+                dbus::Service::new(Algorithm::Plain).await
+            }
+            Err(e) => Err(e),
+        }?;
         let collection = match service.default_collection().await {
             Ok(c) => Ok(c),
             Err(dbus::Error::NotFound(_)) => {


Test patch: