We generally use the term interceptor, and that is the term used in the Go
API itself. So interceptor means something pretty precise. On client-side
Auth is commonly not implemented using an interceptor and instead may use
PerRPCCredentials. But on server-side, authn/authz is an interceptor. If
you wanted to call "all those things, like interceptors, PerRPCCredentials,
and other glue" middleware, that would be fair. If talking about a specific
implementation of something, probably better to use a more precise term.
With that approach, go-grpc-middleware as a repository name is fine, as it
has lots of various stuff, and which specific APIs it uses will vary over
time.

Essentially, in the context of gRPC, I think middleware is best suited as a
conceptual term. That said, it's also a term that is common in some
communities and unfamiliar in others. I rarely use the term myself, but I
may use it when talking to new users or the community while searching for
mutually-understood lingo. For a new user, "if you want middleware,
generally use an interceptor" can be exactly what they're needing.

I'll note that interceptor happens to be a cross-language term; most grpc
languages use that same word for essentially the same thing. Other terms
have to be translated, like PerRPCCredentials may be CallCredentials in
another language. Generally we'll use the precise term (e.g.,
"PerRPCCredentials") in whatever language context we are in/we are most
familiar with/the audience is most familiar with.

On Sun, Apr 3, 2022 at 3:04 PM Pavel Patrin <pavelpat...@gmail.com> wrote:

> Hello everyone. I'm completely sure this question was discussed a lot of
> times, but I can't find anything about it here or in official docs.
>
>
> We have two places:
>
>    -
>
>    https://grpc.io/ - it uses the term "Interceptor" and avoids using
>    "Middleware".
>    -
>
>    https://github.com/grpc-ecosystem/go-grpc-middleware - uses both
>    Middleware and Interceptor, and looks like they didn't distinguish between
>    themselves.
>
> I'm writing a configuration object for Golang service, and choosing how to
> name the field: "WithAuthMiddleware" or "WithAuthInterceptor". What is the
> official gRPC community position about it?
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/185fa072-34ca-43ed-a618-49a8103ca06an%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/185fa072-34ca-43ed-a618-49a8103ca06an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oO9OWo2cpu%3Di3y%3DHtRBOnW3Osd8aKg5-fBAqsjT6P2Dtg%40mail.gmail.com.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to