pib-client 0.4.0

API client for pib-service
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// SPDX-FileCopyrightText: Politik im Blick developers
// SPDX-FileCopyrightText: Wolfgang Silbermayr <wolfgang@silbermayr.at>
//
// SPDX-License-Identifier: AGPL-3.0-or-later OR EUPL-1.2

/// A trait for providing authorization tokens for client requests.
#[async_trait::async_trait(?Send)]
pub trait Authorization {
    /// Get a valid access token.
    ///
    /// The implementation of this method may perform extra actions under the
    /// hood, e.g. refreshing expired tokens.
    async fn get_access_token(&self) -> anyhow::Result<String>;
}