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:
@@ -30,6 +30,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"math/big"
|
"math/big"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -258,6 +259,7 @@ func (s *Service) EnabledProviders() []coredata.OIDCProvider {
|
|||||||
for p := range s.providers {
|
for p := range s.providers {
|
||||||
providers = append(providers, p)
|
providers = append(providers, p)
|
||||||
}
|
}
|
||||||
|
slices.Sort(providers)
|
||||||
return providers
|
return providers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user