Team LBAC: Limit access to data source (#78376)
* Team LBAC: Limit access to data source * Fix tests
This commit is contained in:
@@ -376,9 +376,12 @@ func validateTeamHTTPHeaderJSON(jsonData *simplejson.Json) error {
|
||||
datasourcesLogger.Error("Unable to marshal TeamHTTPHeaders")
|
||||
return errors.New("validation error, invalid format of TeamHTTPHeaders")
|
||||
}
|
||||
if teamHTTPHeadersJSON == nil {
|
||||
return nil
|
||||
}
|
||||
// whitelisting ValidHeaders
|
||||
// each teams headers
|
||||
for _, teamheaders := range teamHTTPHeadersJSON {
|
||||
for _, teamheaders := range teamHTTPHeadersJSON.Headers {
|
||||
for _, header := range teamheaders {
|
||||
if !slices.ContainsFunc(validHeaders, func(v string) bool {
|
||||
return http.CanonicalHeaderKey(v) == http.CanonicalHeaderKey(header.Header)
|
||||
|
||||
Reference in New Issue
Block a user