Skip to content

Commit

Permalink
feat: expose health checks in middleware (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl authored Feb 3, 2023
1 parent 34d1217 commit e1357f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions middleware/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import (
_ "github.com/ory/jsonschema/v3/fileloader"
_ "github.com/ory/jsonschema/v3/httploader"
"github.com/ory/x/configx"
"github.com/ory/x/healthx"
"github.com/ory/x/logrusx"

"github.com/ory/oathkeeper/driver"
"github.com/ory/oathkeeper/driver/configuration"
"github.com/ory/oathkeeper/driver/health"
"github.com/ory/oathkeeper/proxy"
"github.com/ory/oathkeeper/rule"
"github.com/ory/oathkeeper/x"
Expand All @@ -26,13 +28,15 @@ type (
Logger() *logrusx.Logger
RuleMatcher() rule.Matcher
ProxyRequestHandler() proxy.RequestHandler
HealthEventManager() health.EventManager
}

middleware struct{ dependencies }

Middleware interface {
UnaryInterceptor() grpc.UnaryServerInterceptor
StreamInterceptor() grpc.StreamServerInterceptor
HealthxReadyCheckers() healthx.ReadyCheckers
}

options struct {
Expand Down Expand Up @@ -90,3 +94,7 @@ func New(ctx context.Context, opts ...Option) (Middleware, error) {

return m, nil
}

func (m *middleware) HealthxReadyCheckers() healthx.ReadyCheckers {
return m.HealthEventManager().HealthxReadyCheckers()
}

0 comments on commit e1357f8

Please sign in to comment.