diff --git a/schema/google/showcase/v1beta1/echo.proto b/schema/google/showcase/v1beta1/echo.proto index eda1861a2..c73f3aa49 100644 --- a/schema/google/showcase/v1beta1/echo.proto +++ b/schema/google/showcase/v1beta1/echo.proto @@ -180,6 +180,15 @@ service Echo { body: "*" }; }; + + // This method returns authentication details from the incoming request, including things like + // Authorization headers for clients to verify that the correct headers are being sent. + rpc EchoAuthentication(EchoAuthenticationRequest) returns (EchoAuthenticationResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:authentication" + body: "*" + } + }; } // A severity enum used to test enum capabilities in GAPIC surfaces. @@ -390,3 +399,14 @@ message BlockResponse { // here. string content = 1; } + +// The request for EchoAuthentication method. This is currently empty but +// is included as a unique message (not Empty) in case we need to add to it +// later. +message EchoAuthenticationRequest { +} + +// The response for the EchoAuthentication method. +message EchoAuthenticationResponse { + repeated string headers = 1; +} diff --git a/server/services/echo_service.go b/server/services/echo_service.go index be39bce5a..dee0dc4e8 100644 --- a/server/services/echo_service.go +++ b/server/services/echo_service.go @@ -158,6 +158,10 @@ func (s *echoServerImpl) Chat(stream pb.Echo_ChatServer) error { } } +func (s *echoServerImpl) EchoAuthentication(ctx context.Context, in *pb.EchoAuthenticationRequest) (*pb.EchoAuthenticationResponse, error) { + // Stuff the Authorization header from the context into the response. +} + func (s *echoServerImpl) PagedExpandLegacy(ctx context.Context, in *pb.PagedExpandLegacyRequest) (*pb.PagedExpandResponse, error) { req := &pb.PagedExpandRequest{ Content: in.Content,