Auth: Make GitHub auth's allowed_organizations be case insensitive (#66879)

* Auth: Make GitHub auth's allowed_organizations be case insensitive

* Apply code suggestion to use strings.EqualFold
This commit is contained in:
Erik Sundell
2023-04-20 12:36:22 +02:00
committed by GitHub
parent b1129a4375
commit 4089514432
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"net/http"
"regexp"
"strings"
"golang.org/x/oauth2"
@@ -67,7 +68,7 @@ func (s *SocialGithub) IsOrganizationMember(client *http.Client, organizationsUr
for _, allowedOrganization := range s.allowedOrganizations {
for _, organization := range organizations {
if organization == allowedOrganization {
if strings.EqualFold(organization, allowedOrganization) {
return true
}
}