Tools for auth token interception and authentication (#152)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-07-07 12:14:26 -07:00
1 parent f69d6b9952
commit c44a4c4795
14 files changed
+445 -11

No files matched your search

+2 -1
View File
@@ -112,7 +112,8 @@ func handleGrpcGateway(c *Controller) (http.Handler, error) {
// Register*ServiceHandlerServer methods ignore the passed in ctx. Using the baseContext now just in case this changes
// in the future, at which point we'll want to be using the baseContext.
ctx := c.baseContext
mux := runtime.NewServeMux(runtime.WithProtoErrorHandler(handlers.ErrorHandler(c.logger)))
mux := runtime.NewServeMux(runtime.WithMetadata(handlers.TokenAuthenticator(c.logger, c.AuthTokenRepoFn)),
runtime.WithProtoErrorHandler(handlers.ErrorHandler(c.logger)))
hcs, err := host_catalogs.NewService(c.StaticHostRepoFn)
if err != nil {
return nil, fmt.Errorf("failed to create host catalog handler service: %w", err)