#g-rpc #zitadel #clients

zitadel

An implementation of the ZITADEL gRPC API in Rust. Complemented with other useful elements such as ServiceAccount auth.

7 stable releases

Uses new Rust 2021

new 1.0.6 Jun 22, 2022
1.0.5 Jun 21, 2022
1.0.3 Apr 12, 2022
1.0.1 Mar 23, 2022
1.0.0 Feb 9, 2022

#96 in Authentication

Download history 3/week @ 2022-03-14 26/week @ 2022-03-21 27/week @ 2022-04-04 28/week @ 2022-04-11 2/week @ 2022-04-18 43/week @ 2022-04-25 52/week @ 2022-05-02 1/week @ 2022-05-09 21/week @ 2022-05-16 6/week @ 2022-05-23 17/week @ 2022-05-30 5/week @ 2022-06-06 21/week @ 2022-06-13 46/week @ 2022-06-20

91 downloads per month

MIT/Apache

5MB
11K SLoC

Prolog 11K SLoC Rust 491 SLoC // 0.0% comments

ZITADEL for Rust   Crates.io docs.rs Crates.io Crates.io

This repository contains the gRPC bindings for ZITADEL and other helpers to interact with the ZITADEL API.

With the help of the service account it is possible to access the ZITADEL API and use the management client to execute gRPC calls against the API.

Example

Fetch the first 1000 users in the organization of a service account:

use zitadel::credentials::ServiceAccount;
use zitadel::grpc::zitadel::management::v1::management_service_client::ManagementServiceClient;

#[tokio::main]
async fn main() {
    let service_account = ServiceAccount::load_from_file("./my_json_key.json")?;
    let client = ManagementServiceClient.connect("https://api.zitadel.ch");
    let access_token = service_account.authenticate().await?;
    let req = tonic::Request::new(ListUsersRequest {
        query: Some(ListQuery {
            offset: progressed as u64,
            limit: 1000,
            asc: true,
        }),
        sorting_column: 0,
        queries: vec![],
    });
    req.metadata_mut()
        .insert("authorization", format!("Bearer {}", access_token)
            .parse()
            .unwrap());
    let response = client.list_users(req).await?;

    Ok(());
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the package by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~14–26MB
~571K SLoC