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

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

New gnome keyring #73

wants to merge 37 commits into from

Conversation

bilelmoussaoui
Copy link
Owner

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

I have also fixed most of my review comments on that PR so we can replace it with this one

@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 <dhanuka@gnome.org>
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 <dhanuka@gnome.org>
@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
This change fixes the login.keyring being missing from the
`org.freedesktop.secrets` objects tree.
Also,
Implemented Clone trait for Service.
Implemented Clone trait for Item.
Updated Item::create_item.
Fixed all the server side clippy warnings.

Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Login password can't be empty. So, included a `panic!` to handle it.

Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
@warusadura
Copy link
Collaborator

Note: dropped following commits due to this change and rebased.

  • client: make key generation methods public and encrypt(): 8dcc58f
  • client: make crypto crate public under unstable feature: 145f964
  • client: Expose native_crypto API generate_iv() and encrypt(): e694e2e

@warusadura warusadura force-pushed the new-gnome-keyring branch 9 times, most recently from 6b45d4b to 9670b42 Compare May 12, 2024 10:18
Need this change for the server side Prompt implementation.

Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Needed for server side SecretExchange implementation.

Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
SecretExchange allows exchange of secrets between two processes on the
same system without exposing those secrets.

See https://gnome.pages.gitlab.gnome.org/gcr/gcr-4/class.SecretExchange.html

Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
@warusadura warusadura force-pushed the new-gnome-keyring branch 2 times, most recently from 3f33e2a to 5297310 Compare May 14, 2024 08:55
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
@warusadura warusadura force-pushed the new-gnome-keyring branch 2 times, most recently from 3ee5fc6 to 3049017 Compare May 15, 2024 16:03
Signed-off-by: Dhanuka Warusadura <dhanuka@gnome.org>
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
2 participants