Skip to content

Commit

Permalink
Merge pull request #6 from NickolasHKraus/fix-apikey
Browse files Browse the repository at this point in the history
Address Kong Admin token and Kong Admin API key issues
  • Loading branch information
loafoe authored Mar 30, 2022
2 parents ff498d6 + 3f33525 commit 0c9d829
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kong/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ func GetKongClient(opt Config) (*kong.Client, error) {

var headers []string
if opt.APIKey != "" {
headers = append(headers, fmt.Sprintf("kong-admin-token:%v", opt.APIKey))
headers = append(headers, fmt.Sprintf("apikey:%v", opt.APIKey))
}
if opt.AdminToken != "" {
headers = append(headers, fmt.Sprintf("kong-admin-token:%v", opt.AdminToken))
}
if opt.Username != "" || opt.Password != "" {
headers = append(headers, fmt.Sprintf("Authorization: Basic %v", basicAuth(opt.Username, opt.Password)))
Expand Down

0 comments on commit 0c9d829

Please sign in to comment.