Use map of identity_provider to accommodate env var enumerations.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-01-30 23:55:28 +00:00
parent 0474753333
commit 0b864801f5
6 changed files with 76 additions and 18 deletions

View File

@@ -60,7 +60,7 @@ pub fn get_config(&self, id: &str) -> Result<Provider> {
let providers = &self.services.config.identity_provider;
if let Some(provider) = providers
.iter()
.values()
.find(|config| config.id() == id)
.cloned()
{
@@ -68,11 +68,11 @@ pub fn get_config(&self, id: &str) -> Result<Provider> {
}
if let Some(provider) = providers
.iter()
.values()
.find(|config| config.brand == id.to_lowercase())
.filter(|_| {
providers
.iter()
.values()
.filter(|config| config.brand == id.to_lowercase())
.count()
.eq(&1)