MCPcopy Create free account
hub / github.com/perkeep/perkeep / AllowedAccess

Method AllowedAccess

pkg/auth/auth.go:216–224  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

214}
215
216func (t *tokenAuth) AllowedAccess(r *http.Request) Operation {
217 if authTokenHeaderMatches(r) {
218 return OpAll
219 }
220 if websocketTokenMatches(r) {
221 return OpAll
222 }
223 return 0
224}
225
226func (t *tokenAuth) AddAuthHeader(r *http.Request) {
227 r.Header.Set("Authorization", "Token "+t.token)

Callers

nothing calls this directly

Calls 2

authTokenHeaderMatchesFunction · 0.85
websocketTokenMatchesFunction · 0.85

Tested by

no test coverage detected