parsec_service/
lib.rs

1// Copyright 2019 Contributors to the Parsec project.
2// SPDX-License-Identifier: Apache-2.0
3//! Parsec service documentation
4//!
5//! This is the source code documentation for Parsec (Platform AbstRaction for
6//! SECurity) service. For a more in-depth guide of the system architecture,
7//! supported operations and other Parsec-related topics, see our
8//! [Parsec Book](https://parallaxsecond.github.io/parsec-book/index.html).
9#![deny(
10    nonstandard_style,
11    dead_code,
12    improper_ctypes,
13    non_shorthand_field_patterns,
14    no_mangle_generic_items,
15    overflowing_literals,
16    path_statements,
17    patterns_in_fns_without_body,
18    unconditional_recursion,
19    unused,
20    unused_allocation,
21    unused_comparisons,
22    unused_parens,
23    while_true,
24    missing_debug_implementations,
25    missing_docs,
26    trivial_casts,
27    trivial_numeric_casts,
28    unused_extern_crates,
29    unused_import_braces,
30    unused_qualifications,
31    unused_results,
32    missing_copy_implementations
33)]
34// This one is hard to avoid.
35#![allow(clippy::multiple_crate_versions)]
36
37#[allow(unused)]
38macro_rules! format_error {
39    ($message:expr, $error:expr) => {
40        if crate::utils::GlobalConfig::log_error_details() {
41            log::error!("{}; Error: {}", $message, $error)
42        } else {
43            log::error!("{};", $message)
44        }
45    };
46}
47
48#[allow(unused)]
49macro_rules! deprecation_check {
50    ($operation:ident, $warning:expr, $return_flag:expr) => {
51        if let Err(ResponseStatus::DeprecatedPrimitive) = $operation.check_deprecated() {
52            log::warn!("{}", $warning);
53            if $return_flag && !crate::utils::GlobalConfig::allow_deprecated() {
54                return Err(ResponseStatus::DeprecatedPrimitive);
55            }
56        }
57    };
58}
59
60#[allow(unused)]
61macro_rules! warn_on_deprecated {
62    ($operation:ident, $warning:expr) => {
63        deprecation_check!($operation, $warning, false);
64    };
65}
66
67#[allow(unused)]
68macro_rules! return_on_deprecated {
69    ($operation:ident, $warning:expr) => {
70        deprecation_check!($operation, $warning, true);
71    };
72}
73
74pub mod authenticators;
75pub mod back;
76pub mod front;
77pub mod key_info_managers;
78pub mod providers;
79pub mod utils;