MCPcopy Index your code
hub / github.com/dnote/dnote / parseAuthHeader

Function parseAuthHeader

pkg/server/middleware/helpers.go:113–126  ·  view source on GitHub ↗
(h string)

Source from the content-addressed store, hash-verified

111}
112
113func parseAuthHeader(h string) (authHeader, error) {
114 parts := strings.Split(h, " ")
115
116 if len(parts) != 2 {
117 return authHeader{}, errors.New("Invalid authorization header")
118 }
119
120 parsed := authHeader{
121 scheme: parts[0],
122 credential: parts[1],
123 }
124
125 return parsed, nil
126}
127
128// getSessionKeyFromAuth reads and returns a session key from the Authorization header
129func getSessionKeyFromAuth(r *http.Request) (string, error) {

Callers 1

getSessionKeyFromAuthFunction · 0.70

Calls 1

NewMethod · 0.80

Tested by

no test coverage detected