Kyrodan / KeeAnywhere

A cloud storage provider plugin for KeePass Password Safe

Home Page:https://keeanywhere.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot add / manage multiple Azure Blob / File storage accounts

r2-4u opened this issue · comments

I have 2 Azure Blob storage accounts;
As soon as you add the second account of the same provider (In this case Azure Blob Storage), the system will always tell you "This account already exists. Updating account data only"

Partial workaround:
Add the details for the first Azure Blob Account, save your configuration; open the local config file, and copy the JSON data to a safe place.
Now add the second Azure Blob Account (which will overwrite the first one) and after saving, close keepass.
Open the config file again, and paste the data of the first account again.

Now you will have 2 Azure Blob Accounts, and they both work.
HOWEVER, you can no longer configure them in the Tools - KeeAnywhere Settings window, as a runtime error will occur.

System.InvalidOperationException: Reeks bevat meerdere overeenkomende elementen
bij System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
bij KeeAnywhere.UIService.d__5.MoveNext()
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bij KeeAnywhere.Forms.SettingsForm.d__a.MoveNext()
bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Both AzureBlobs use the same container name "keepass"; accountname is (of course) different.

This does not work;

I have 2 accounts; "XsharedSSA" and "YsharedSSA"
When I have XsharedSSA in KeeAnywhere, and I press ADD Account and enter all the data for YsharedSSA, it overwrites XsharedSSA instead of creating a new entry.

I found out what the bug is:
The new entry ALWAYS has account ID "Azure Blob Account". (You cannot change this in the 3 field setup window)
So if you add a second account, it too will get the same "Azure Blob Account" account ID; (Which is wrong)
So it is considered the same account. (which is then Correct)
Renaming the account will change the "name" true, but it will not change the account ID, so it will still not work.
However, if you change the account ID manually in the KeeAnywhere.Accounts.Json , THEN you can add a second account and it works fine.

Example of the working config file:

[
  {
    "Id": "Azure Blob Account",
    "Type": "AzureBlob",
    "Name": "Xsharedssa",
    "Secret": "..redacted..",
    "AdditionalSettings": {
      "AzureItemName": "keepass"
    }
  },
  {
    "Id": "Azure Blob Account2",
    "Type": "AzureBlob",
    "Name": "Ysharedssa",
    "Secret": "..redacted..",
    "AdditionalSettings": {
      "AzureItemName": "keepass"
    }
  }

]