1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// Copyright 2019 Dmitry Tantsur <divius.inside@gmail.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! 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.
//!
//! See [openstack crate](https://crates.io/crates/openstack) for these features.
//!
//! # Requirements
//!
//! This crate requires Rust 2018 edition and relies heavily on
//! [futures](https://crates.io/crates/futures) 0.1. It has not yet been updated for the new
//! `async`/`await` syntax and may not be compatible with it out-of-box.
//!
//! # Usage
//!
//! Your entry point to the API is the [Session](struct.Session.html) structure. To create it you
//! need an authentication type object first. It can be obtained by:
//! * Using [Password](identity/struct.Password.html) authentication against the Identity service.
//! * Using [NoAuth](struct.NoAuth.html) authentication type, allowing access to standalone
//!   services without authentication.
//!
//! A `Session` can be created directly by loading it:
//! * From the `clouds.yaml` configuration file using [from_config](fn.from_config.html).
//! * From environment variables using [from_env](fn.from_env.html).
//!
//! See [Session](struct.Session.html) documentation for the details on using a `Session` for making
//! OpenStack calls.
//!
//! If you need to work with a small number of servics, [Adapter](struct.Adapter.html) provides a
//! more convenient interface. An adapter can be created directly using
//! [Adapter::new](struct.Adapter.html#method.new) or from an existing `Session` using
//! [Session::adapter](struct.Session.html#method.adapter) or
//! [Session::into_adapter](struct.Session.html#method.into_adapter).

#![crate_name = "osauth"]
#![crate_type = "lib"]
// NOTE: we do not use generic deny(warnings) to avoid breakages with new
// versions of the compiler. Add more warnings here as you discover them.
// Taken from https://github.com/rust-unofficial/patterns/
#![deny(
    bare_trait_objects,
    const_err,
    dead_code,
    improper_ctypes,
    legacy_directory_ownership,
    missing_copy_implementations,
    missing_debug_implementations,
    missing_docs,
    non_shorthand_field_patterns,
    no_mangle_generic_items,
    overflowing_literals,
    path_statements,
    patterns_in_fns_without_body,
    plugin_as_library,
    private_in_public,
    safe_extern_statics,
    trivial_casts,
    trivial_numeric_casts,
    unconditional_recursion,
    unions_with_drop_fields,
    unsafe_code,
    unused,
    unused_allocation,
    unused_comparisons,
    unused_doc_comments,
    unused_import_braces,
    unused_parens,
    unused_qualifications,
    unused_results,
    while_true
)]

mod adapter;
mod apiversion;
mod auth;
mod cache;
mod catalog;
mod config;
mod error;
pub mod identity;
mod protocol;
pub mod request;
pub mod services;
mod session;
#[cfg(feature = "sync")]
pub mod sync;
mod url;

pub use crate::adapter::Adapter;
pub use crate::apiversion::ApiVersion;
pub use crate::auth::{AuthType, NoAuth};
pub use crate::config::{from_config, from_env};
pub use crate::error::{Error, ErrorKind};
pub use crate::session::Session;