lesspass_client/
mod.rs

1//
2// lesspass-client
3// Copyright (C) 2021-2025 Óscar García Amor <ogarcia@connectical.com>
4// Distributed under terms of the GNU GPLv3 license.
5//
6
7//! lesspass-client is a tiny-crate for interacting with [LessPass][lesspass] server API from Rust.
8//!
9//! # Overview
10//!
11//! lesspass-client can interact with several implementations of LessPass server API,
12//! it is specially designed to use with [Rockpass][rockpass] (a small and ultrasecure
13//! Lesspass database server written in Rust) and [official][lesspassapi] ones.
14//!
15//! # Using the Client
16//! ```rust,no_run
17//! use lesspass_client::{Client, Result};
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<()> {
21//!     // Define a host URL to conect to
22//!     let url = "https://api.lesspass.com";
23//!
24//!     // Create LessPass API client
25//!     let client = Client::new(url);
26//!
27//!     // Perform an authentication with user and password
28//!     let token = client
29//!         .create_token("user@example.com", "password")
30//!         .await?;
31//!
32//!     // Get the password list
33//!     let passwords = client.get_passwords(&token.access).await?;
34//!
35//!     // Print the list
36//!     println!("{:?}", passwords);
37//!     Ok(())
38//! }
39//! ```
40//!
41//! For details, see:
42//! * [Client][Client] for implementation of LessPass server API client.
43//! * [CLI][cli] for a full example of use.
44//!
45//! [lesspass]: https://gitlab.com/lesspass/lesspass
46//! [rockpass]: https://gitlab.com/ogarcia/rockpass
47//! [lesspassapi]: https://github.com/lesspass/lesspass/tree/main/containers
48//! [cli]: https://gitlab.com/ogarcia/lesspass-client/-/blob/master/src/main.rs
49
50mod client;
51mod error;
52pub mod model;
53
54pub use client::Client;
55pub use error::{Error, Result};