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

New gnome keyring #73

Draft
wants to merge 106 commits into
base: main
Choose a base branch
from
Draft

New gnome keyring #73

wants to merge 106 commits into from

Conversation

bilelmoussaoui
Copy link
Owner

@bilelmoussaoui bilelmoussaoui commented Feb 15, 2024

Switches #56 to use a branch from this repo so we can easily collaborate on it.

progress to-date:

  • D-Bus Secret Service API implementation - complete
  • Default keyring (login.keyring) support - complete
  • Multiple keyring support - not done

@warusadura
Copy link
Collaborator

warusadura commented Feb 16, 2024

Does it make sense to store the session along with an Item. As in,

pub struct Item {
    inner: RwLock<portal::Item>,
    path: OwnedObjectPath,
    keyring: Arc<Keyring>,
    locked: bool,
    session: OwnedObjectPath,
}

and then, store the same session inside Collection,

pub struct Collection {
    keyring: Arc<Keyring>,
    pub(crate) items: RwLock<Vec<super::item::Item>>,
    alias: RwLock<String>,
    label: String,
    locked: AtomicBool,
    created: Duration,
    modified: Duration,
    path: OwnedObjectPath,
    sessions: Vec<OwnedObjectPath>,
}

with this way we get access to all the available sessions and we can retrieve a session based on an objectpath. wdyt?

@bilelmoussaoui
Copy link
Owner Author

Does it make sense to store the session along with an Item. As in,

pub struct Item {
    inner: RwLock<portal::Item>,
    path: OwnedObjectPath,
    keyring: Arc<Keyring>,
    locked: bool,
    session: OwnedObjectPath,
}

and then, store the same session inside Collection,

pub struct Collection {
    keyring: Arc<Keyring>,
    pub(crate) items: RwLock<Vec<super::item::Item>>,
    alias: RwLock<String>,
    label: String,
    locked: AtomicBool,
    created: Duration,
    modified: Duration,
    path: OwnedObjectPath,
    sessions: Vec<OwnedObjectPath>,
}

with this way we get access to all the available sessions and we can retrieve a session based on an objectpath. wdyt?

Storing the session is required yes, but not just it ObjectPath. Instead you need to store the Sesssion itself which would contain more information than just the object path. Ideally we can store it as HashMap<OwnedObjectPath, Session>, same thing for collections & items I would say.

server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
warusadura added a commit that referenced this pull request Feb 19, 2024
Since Collection is not using and cannot be implemented (easily)
Copy or Clone traits, the only way to clone a struct Collection
is call Collection::new() passing getter values.

Removed set_collections() setter.
See: #73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
server/src/daemon/service.rs Outdated Show resolved Hide resolved
server/src/daemon/service.rs Outdated Show resolved Hide resolved
warusadura added a commit that referenced this pull request Feb 21, 2024
Removed RwLock wrapper from sessions
Removed async from all the methods

See: #73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
@warusadura warusadura force-pushed the new-gnome-keyring branch 2 times, most recently from 989307f to 1ea5e4e Compare February 29, 2024 10:45
@warusadura warusadura force-pushed the new-gnome-keyring branch 3 times, most recently from 69c5d72 to 9a7f106 Compare March 1, 2024 10:40
Signed-off-by: Dhanuka Warusadura <[email protected]>
Signed-off-by: Dhanuka Warusadura <[email protected]>
Signed-off-by: Dhanuka Warusadura <[email protected]>
Signed-off-by: Dhanuka Warusadura <[email protected]>
Signed-off-by: Dhanuka Warusadura <[email protected]>
Also updated the getter.

Signed-off-by: Dhanuka Warusadura <[email protected]>
According to the previous change/commit.

Signed-off-by: Dhanuka Warusadura <[email protected]>
… storage

Perform a decryption operation for the transit data (from client)
before creating a new item based on the data/arguments.

Signed-off-by: Dhanuka Warusadura <[email protected]>
And introduces encrypting item data before transit to the client side.

Signed-off-by: Dhanuka Warusadura <[email protected]>
This change fixes the SetSecret call failing to correctly update the
secret of an item.

Signed-off-by: Dhanuka Warusadura <[email protected]>
Signed-off-by: Dhanuka Warusadura <[email protected]>
@warusadura warusadura force-pushed the new-gnome-keyring branch 3 times, most recently from c0dfab7 to 9c44ad2 Compare October 15, 2024 07:58
warusadura added a commit that referenced this pull request Oct 15, 2024
Since Collection is not using and cannot be implemented (easily)
Copy or Clone traits, the only way to clone a struct Collection
is call Collection::new() passing getter values.

Removed set_collections() setter.
See: #73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
warusadura added a commit that referenced this pull request Oct 15, 2024
Removed RwLock wrapper from sessions
Removed async from all the methods

See: #73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
warusadura added a commit to warusadura/oo7 that referenced this pull request Oct 15, 2024
Since Collection is not using and cannot be implemented (easily)
Copy or Clone traits, the only way to clone a struct Collection
is call Collection::new() passing getter values.

Removed set_collections() setter.
See: bilelmoussaoui#73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
warusadura added a commit to warusadura/oo7 that referenced this pull request Oct 15, 2024
Removed RwLock wrapper from sessions
Removed async from all the methods

See: bilelmoussaoui#73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
warusadura added a commit to warusadura/oo7 that referenced this pull request Oct 15, 2024
Since Collection is not using and cannot be implemented (easily)
Copy or Clone traits, the only way to clone a struct Collection
is call Collection::new() passing getter values.

Removed set_collections() setter.
See: bilelmoussaoui#73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
warusadura added a commit to warusadura/oo7 that referenced this pull request Oct 15, 2024
Removed RwLock wrapper from sessions
Removed async from all the methods

See: bilelmoussaoui#73 (comment)

Signed-off-by: Dhanuka Warusadura <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server side support for D-Bus Secret Service API
4 participants