bilelmoussaoui / oo7

James Bond went on a new mission as a Secret Service provider
https://bilelmoussaoui.github.io/oo7/oo7/
MIT License
63 stars 12 forks source link

File backend: the plan #5

Closed bilelmoussaoui closed 2 years ago

bilelmoussaoui commented 2 years ago

Currently we are exposing a bit too much of what I would consider internal API. See https://bilelmoussaoui.github.io/oo7/oo7/keyring/index.html. We can easily make things public if there is a demand for that but making them private is harder as it might break existing applications out there.

What I suggest is:

sophie-h commented 2 years ago

We could also have a

enum Error {
DBus(...),
Portal(...),
}

For the convenience API. It might have some benefits like clarifying which type was used and might be nicer if someone uses one backend explicitly.

bilelmoussaoui commented 2 years ago

Yes, the usage of the specific backend would still be possible as their generic APIs would still be available. The higher level functions are what "most of the apps" will use though. But making every constructor takes that is meh. It is up to the library to decide what is available to use otherwise every app will have it own implementation for checking if it is sandboxed or not... not great

sophie-h commented 2 years ago

Agree with all points.

I'm just not sure about keyring::Storage (aka portal::Keyring). We only need it public if people want to use different keyring files. But it's lacking all the convenience functions etc. Maybe just make it private for now as well?

bilelmoussaoui commented 2 years ago

We only need it public if people want to use different keyring files. But it's lacking all the convenience functions etc. Maybe just make it private for now as well?

Sure, I don't think it makes sense to allow users to use different keyring files, we want them to be compatible with libsecret and so with a potential future implementation of Passwords or whatever it is called. Otherwise that is gonna be a mess.

sophie-h commented 2 years ago

Actually, I might want to create an app primarily to show the Flatpak keyring entries. Maybe we can make portal::keyring available under a "unstable" feature or something similar?

bilelmoussaoui commented 2 years ago

You mean https://bilelmoussaoui.github.io/oo7/oo7/portal/api/struct.Keyring.html? or the other one? :p

sophie-h commented 2 years ago

Oh, it's api now. It would need almost everything public.

bilelmoussaoui commented 2 years ago

I think we have most of stuff from the issue covered, we can handle other stuff individually in the future