Skip to content

Add WithRequestGate handler option - #962

Open
emcfarlane wants to merge 1 commit into
mainfrom
ed/addRequestGateOption
Open

Add WithRequestGate handler option#962
emcfarlane wants to merge 1 commit into
mainfrom
ed/addRequestGateOption

Conversation

@emcfarlane

Copy link
Copy Markdown
Contributor

This adds the handler option WithRequestGate that runs after the request headers are available and before any message is received. Returning an error rejects the RPC before the interceptor chain and before the request is decompressed or unmarshaled.

Checks like authentication are recommended at the HTTP layer, and RFC 002 added authn-go for that. However, users still reach for interceptors where unary RPCs run interceptors after the decode. This provides an in-library option that registers alongside interceptors ands voids this issue. Gates run for every stream type.

Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant