pib_client/authorization.rs
1// SPDX-FileCopyrightText: Politik im Blick developers
2// SPDX-FileCopyrightText: Wolfgang Silbermayr <wolfgang@silbermayr.at>
3//
4// SPDX-License-Identifier: AGPL-3.0-or-later OR EUPL-1.2
5
6/// A trait for providing authorization tokens for client requests.
7#[async_trait::async_trait(?Send)]
8pub trait Authorization {
9 /// Get a valid access token.
10 ///
11 /// The implementation of this method may perform extra actions under the
12 /// hood, e.g. refreshing expired tokens.
13 async fn get_access_token(&self) -> anyhow::Result<String>;
14}