Sort OIDC providers for deterministic API response order

EnabledProviders() iterated a map, producing nondeterministic order.
Sort the slice before returning to ensure stable UI and test behavior.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-22 11:35:18 +01:00
parent 3e4a7d3638
commit 7e757bfa06

View File

@@ -30,6 +30,7 @@ import (
"io"
"math/big"
"net/http"
"slices"
"strings"
"sync"
"time"
@@ -258,6 +259,7 @@ func (s *Service) EnabledProviders() []coredata.OIDCProvider {
for p := range s.providers {
providers = append(providers, p)
}
slices.Sort(providers)
return providers
}