Skip to content

Commit

Permalink
fixup! providers: add "akamai" provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Saika committed Mar 27, 2024
1 parent a1c1712 commit 68b1d18
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/providers/akamai/akamai.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package akamai

import (
"encoding/base64"
"errors"
"fmt"
"net/http"
"net/url"
Expand All @@ -44,7 +45,15 @@ var (
)

func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
encoded, err := f.FetchToBuffer(userdataURL, resource.FetchOptions{})
if f.AkamaiMetadataToken == "" {
return types.Config{}, report.Report{}, errors.New("akamai metadata token not set")
}

encoded, err := f.FetchToBuffer(userdataURL, resource.FetchOptions{
Headers: http.Header{
"Metadata-Token": []string{f.AkamaiMetadataToken},
},
})
if err != nil {
return types.Config{}, report.Report{}, err
}
Expand Down

0 comments on commit 68b1d18

Please sign in to comment.