Skip to main content

rustfs_iam/federation/
registry.rs

1// Copyright 2024 RustFS Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use super::FederatedIdentityProvider;
16use std::sync::Arc;
17
18/// Immutable registry of built-in federation adapters.
19pub struct FederatedIdentityRegistry {
20    standard_oidc: Arc<dyn FederatedIdentityProvider>,
21}
22
23impl FederatedIdentityRegistry {
24    pub fn new(standard_oidc: Arc<dyn FederatedIdentityProvider>) -> Self {
25        Self { standard_oidc }
26    }
27
28    pub(crate) fn standard_oidc(&self) -> &dyn FederatedIdentityProvider {
29        self.standard_oidc.as_ref()
30    }
31}