canton-admin 0.3.0

Canton admin client: party management, user self-inspect, and topology read (gRPC).
Documentation
//! Canton administrative client: party management, user self-inspect, and
//! topology read.
//!
//! Canton exposes these across **two** gRPC endpoints, so this crate provides
//! two clients:
//!
//! - [`AdminClient`] — party management ([`PartyManagementService`]) and user
//!   self-inspect ([`UserManagementService`]), served on the **Ledger API**
//!   port (e.g. `:3901`), the same channel/auth as the ledger client. Party
//!   admin RPCs require the `ParticipantAdmin` right; self-inspect
//!   ([`AdminClient::current_user`] / [`AdminClient::current_user_rights`])
//!   works with any authenticated token.
//! - [`TopologyClient`] — topology **read** (party→participant mappings,
//!   namespace delegations, vetted packages) via `TopologyManagerReadService`,
//!   served on the Canton **admin API** port (e.g. `:3902`).
//!
//! Both build on the shared [`canton_core::Config`] (endpoint, auth, TLS,
//! retry).
//!
//! # Scope
//!
//! Party management here is **allocation and discovery**: allocate a party,
//! list the parties a participant knows, look specific ones up. Updating a
//! party's details (`UpdatePartyDetails`), the identity-provider fields, and
//! the participant-permission options of `AllocateParty` are deliberately not
//! wrapped — Milestone 1 covers the client surface an application needs to act
//! on the ledger, and party *administration* beyond that belongs to the
//! operator tooling rather than to an SDK's first release. Anything not
//! wrapped is still reachable through [`canton_proto`] on the same channel.
//!
//! [`PartyManagementService`]: https://docs.daml.com
//! [`UserManagementService`]: https://docs.daml.com
//!
//! ```no_run
//! # async fn run() -> canton_admin::Result<()> {
//! use canton_admin::{AdminClient, Config};
//!
//! let admin = AdminClient::connect_lazy(Config::new("http://localhost:3901"))?;
//! let me = admin.current_user().await?;
//! println!("acting as: {:?}", admin.acting_parties().await?);
//! # let _ = me;
//! # Ok(())
//! # }
//! ```
#![cfg_attr(docsrs, feature(doc_cfg))]

mod client;
mod external_party;
mod topology;

pub use canton_core::{
    Auth, Config, Error, ErrorCategory, ErrorInfo, ResourceInfo, Result, RetryConfig, TlsConfig,
};
pub use canton_proto::com::daml::ledger::api::v2::PackageStatus;
pub use client::AdminClient;
pub use external_party::ExternalPartyTopology;
pub use topology::{Entry, Store, TopologyClient};

/// Generated Ledger API admin protobuf types (party & user management).
pub use canton_proto::com::daml::ledger::api::v2::admin as proto;
/// Generated Canton protocol types (topology mapping items).
pub use canton_proto::com::digitalasset::canton::protocol::v30 as protocol_proto;
/// Generated Canton admin-API topology types (query/result envelopes).
pub use canton_proto::com::digitalasset::canton::topology::admin::v30 as topology_proto;