Skip to content

Commit

Permalink
Merge pull request #278 from jcantrill/add_bearer_token
Browse files Browse the repository at this point in the history
Forward SA token to ES for auth
  • Loading branch information
openshift-merge-robot committed Mar 23, 2020
2 parents 481b229 + 59a4361 commit e149a98
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/k8shandler/elasticsearch_helper.go
Expand Up @@ -210,15 +210,12 @@ func updateIndexReplicas(clusterName, namespace string, client client.Client, in
}

func ensureTokenHeader(header http.Header) http.Header {

if header == nil {
header = map[string][]string{}
}

if saToken, ok := readSAToken(k8sTokenFile); ok {
header["x-forwarded-access-token"] = []string{
saToken,
}
header.Set("Authorization", fmt.Sprintf("Bearer %s", saToken))
}

return header
Expand Down

0 comments on commit e149a98

Please sign in to comment.