MCPcopy Create free account
hub / github.com/couchbase/cbft / extractMetaHeader

Function extractMetaHeader

grpc_auth.go:88–104  ·  view source on GitHub ↗
(ctx context.Context, header string)

Source from the content-addressed store, hash-verified

86}
87
88func extractMetaHeader(ctx context.Context, header string) (string, error) {
89 md, ok := metadata.FromIncomingContext(ctx)
90 if !ok {
91 return "", fmt.Errorf("no headers in request")
92 }
93
94 headerValue, ok := md[header]
95 if !ok {
96 return "", fmt.Errorf("no headers in request")
97 }
98
99 if len(headerValue) != 1 {
100 return "", fmt.Errorf("more than 1 header in request")
101 }
102
103 return headerValue[0], nil
104}
105
106type authWrapper struct {
107 mgr *cbgt.Manager

Callers 5

updateRpcFocusStatsFunction · 0.85
SearchMethod · 0.85
serverInterceptorFunction · 0.85
tryBasicAuthFunction · 0.85
verifyRPCAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected