Added tests Added ac to routes and functions Proxy processer and auth servicer Added options and extensive logging Fixed calls to rbac in service, added default http handler on gateway root
19 lines
314 B
Go
19 lines
314 B
Go
package apigw
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
type (
|
|
defaultErrorHandler struct{}
|
|
)
|
|
|
|
func (h defaultErrorHandler) Exec(ctx context.Context, scope *scp, err error) {
|
|
// set http status code
|
|
scope.Writer().WriteHeader(http.StatusInternalServerError)
|
|
|
|
// set body
|
|
scope.Writer().Write([]byte(err.Error()))
|
|
}
|