sort grant type supported

Signed-off-by: ariary <ariary9.2@hotmail.fr>
This commit is contained in:
ariary 2021-10-06 08:29:14 -04:00
parent c6f6dd69e9
commit 7bc966217d
2 changed files with 2 additions and 1 deletions

View file

@ -110,7 +110,6 @@ func (s *Server) discoveryHandler() (http.HandlerFunc, error) {
sort.Strings(d.ResponseTypes) sort.Strings(d.ResponseTypes)
d.GrantTypes = s.supportedGrantTypes d.GrantTypes = s.supportedGrantTypes
sort.Strings(d.GrantTypes)
data, err := json.MarshalIndent(d, "", " ") data, err := json.MarshalIndent(d, "", " ")
if err != nil { if err != nil {

View file

@ -11,6 +11,7 @@ import (
"net/url" "net/url"
"os" "os"
"path" "path"
"sort"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@ -225,6 +226,7 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
if c.PasswordConnector != "" { if c.PasswordConnector != "" {
supportedGrant = append(supportedGrant, grantTypePassword) supportedGrant = append(supportedGrant, grantTypePassword)
} }
sort.Strings(supportedGrant)
webFS := web.FS() webFS := web.FS()
if c.Web.Dir != "" { if c.Web.Dir != "" {