IAM-655: first iteration on the authorization middleware
code relies on the model defined in the spec ID-034
to be plugged as middleware, please use the With directive, not Use due to how theURLParam function operates
middlewares := make(chi.Middlewares, 0)
middlewares = append(
middlewares,
middleware.RequestID,
middleware.RequestLogger(logging.NewLogFormatter(logger)), // LogFormatter will only work if logger is set to DEBUG level,
)
router.Use(middlewares...)
chiMux := router.With(authMdw).(*chi.Mux)
roles.NewAPI(roles.NewService(ofga, tracer, monitor, logger), tracer, monitor, logger).RegisterEndpoints(chiMux)
IAM-655: first iteration on the authorization middleware
code relies on the model defined in the spec ID-034
to be plugged as middleware, please use the
With
directive, notUse
due to how theURLParam
function operatesChanges