(ctx context.Context, header string)
| 86 | } |
| 87 | |
| 88 | func 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 | |
| 106 | type authWrapper struct { |
| 107 | mgr *cbgt.Manager |
no outgoing calls
no test coverage detected