MCPcopy Create free account
hub / github.com/dnote/dnote / parseAuthHeader

Function parseAuthHeader

pkg/server/controllers/helpers.go:136–149  ·  view source on GitHub ↗
(h string)

Source from the content-addressed store, hash-verified

134}
135
136func parseAuthHeader(h string) (authHeader, error) {
137 parts := strings.Split(h, " ")
138
139 if len(parts) != 2 {
140 return authHeader{}, errors.New("Invalid authorization header")
141 }
142
143 parsed := authHeader{
144 scheme: parts[0],
145 credential: parts[1],
146 }
147
148 return parsed, nil
149}
150
151type authHeader struct {
152 scheme string

Callers 1

getSessionKeyFromAuthFunction · 0.70

Calls 1

NewMethod · 0.80

Tested by

no test coverage detected