Crate lesspass_client

Source
Expand description

lesspass-client is a tiny-crate for interacting with LessPass server API from Rust.

§Overview

lesspass-client can interact with several implementations of LessPass server API, it is specially designed to use with Rockpass (a small and ultrasecure Lesspass database server written in Rust) and official ones.

§Using the Client

use lesspass_client::{Client, Result};

#[tokio::main]
async fn main() -> Result<()> {
    // Define a host URL to conect to
    let url = "https://api.lesspass.com";

    // Create LessPass API client
    let client = Client::new(url);

    // Perform an authentication with user and password
    let token = client
        .create_token("[email protected]", "password")
        .await?;

    // Get the password list
    let passwords = client.get_passwords(&token.access).await?;

    // Print the list
    println!("{:?}", passwords);
    Ok(())
}

For details, see:

  • Client for implementation of LessPass server API client.
  • CLI for a full example of use.

Modules§

model

Structs§

Client
Client for connecting to LessPass server
Error

Type Aliases§

Result
A Result alias where the Err case is lesspass_client::Error.