VerifySource inspects whether the context contains one of the passed cluster keys, and returns a context containing the result.
(ctx context.Context, validKeys [][]byte)
| 51 | // VerifySource inspects whether the context contains one of the passed cluster keys, |
| 52 | // and returns a context containing the result. |
| 53 | func VerifySource(ctx context.Context, validKeys [][]byte) context.Context { |
| 54 | err := verifySource(ctx, validKeys) |
| 55 | return NewContext(ctx, err) |
| 56 | } |
| 57 | |
| 58 | func verifySource(ctx context.Context, validKeys [][]byte) error { |
| 59 | md := rpcmetadata.FromIncomingContext(ctx) |