MCPcopy Index your code
hub / github.com/jetify-com/devbox / request

Method request

internal/plugin/github.go:147–167  ·  view source on GitHub ↗
(contentURL string)

Source from the content-addressed store, hash-verified

145}
146
147func (p *githubPlugin) request(contentURL string) (*http.Request, error) {
148 req, err := http.NewRequest(http.MethodGet, contentURL, nil)
149 if err != nil {
150 return nil, err
151 }
152
153 // Add github token to request if available
154 ghToken := os.Getenv("GITHUB_TOKEN")
155
156 if ghToken != "" {
157 authValue := fmt.Sprintf("token %s", ghToken)
158 req.Header.Add("Authorization", authValue)
159 slog.Debug(
160 "GITHUB_TOKEN env var found, adding to request's auth header",
161 "headerValue",
162 getRedactedAuthHeader(req),
163 )
164 }
165
166 return req, nil
167}
168
169func (p *githubPlugin) LockfileKey() string {
170 return p.ref.String()

Callers 2

FileContentMethod · 0.95
TestGithubPluginAuthFunction · 0.95

Calls 2

getRedactedAuthHeaderFunction · 0.85
AddMethod · 0.45

Tested by 1

TestGithubPluginAuthFunction · 0.76