diff --git a/paket/src/keyring.rs b/paket/src/keyring.rs index d3f9132..b30a8a0 100644 --- a/paket/src/keyring.rs +++ b/paket/src/keyring.rs @@ -17,10 +17,13 @@ fn get_keyring_attributes_packstation() -> Vec<(&'static str, &'static str)> { ] } -pub async fn keyring_delete_all_items() -> oo7::Result<()> { - get_keyring() - .delete(&vec![get_keyring_base_attribute()]) - .await +pub async fn keyring_delete_all_items() { + let keyring = get_keyring(); + + let attr1 = get_keyring_attributes_refresh_token(); + let attr2 = get_keyring_attributes_packstation(); + + let _ = futures::join!(keyring.delete(&attr1), keyring.delete(&attr2),); } fn get_keyring<'a>() -> &'a oo7::Keyring { @@ -46,7 +49,26 @@ pub async fn keyring_get_refresh_token() -> oo7::Result> { pub async fn keyring_set_refresh_token(value: String) -> oo7::Result<()> { get_keyring() .create_item( - "Refresh Token", + "Paket: Login credentials", + &get_keyring_attributes_refresh_token(), + value, + true, + ) + .await +} + +pub async fn keyring_get_packstation() -> oo7::Result> { + let items = get_keyring() + .search_items(&get_keyring_attributes_packstation()) + .await?; + + todo!() +} + +pub async fn keyring_set_packstation(value: String) -> oo7::Result<()> { + get_keyring() + .create_item( + "Paket: Device keys", &get_keyring_attributes_refresh_token(), value, true,