Crate osauth

Source
Expand description

Asynchronous OpenStack session and authentication.

§Introduction

This crate provides low-level asynchronous access to OpenStack API. It features:

  1. Authentication and token caching.
  2. Major and microversion handling.
  3. Service catalog integration.
  4. JSON API error handling.
  5. Service types for supported services.

It does NOT provide:

  1. Protocol structures for any services.
  2. Automatic microversion negotiation.
  3. High-level object-oriented API.

See openstack crate for these features.

§Requirements

This crate requires Rust 2021 edition and rustc version 1.71.0 or newer.

OpenStack releases starting with Train are officially supported, although support for releases older than 1.5 years is best-effort and may be dropped without a prior warning (it will not be considered a breaking change).

§Usage

Your entry point to the API is the Session structure. To create it you need an authentication type object first. It can be obtained by:

  • Using Password authentication against the Identity service.
  • Using NoAuth authentication type, allowing access to standalone services without authentication.
  • Using HTTP BasicAuth authentication type for services supporting it (only ironic and ironic-inspector at the moment).
  • By loading both authentication parameters and a session from:
    • clouds.yaml, clouds-public.yaml and secure.yaml configuration files using from_config.
    • environment variables using from_env.

See Session documentation for the details on using a Session for making OpenStack calls.

If you need to work with a small number of servics, Adapter provides a more convenient interface. An adapter can be created directly using Adapter::new or from an existing Session using Session::adapter or Session::into_adapter.

§Features

  • native-tls or rustls add TLS support with two alternative implementations, native-tls is enabled by default.
  • stream adds get_json_paginated and get_json_query_paginated to Session and Adapter; enabled by default.

Modules§

  • Low-level authenticated client.
  • Reusable JSON structures and protocol bits.
  • Authentication using Identity API v3.
  • OpenStack service types.

Macros§

  • A macro for defining serializable and deserializable protocol enums.

Structs§

Enums§

Traits§

Derive Macros§