From 657a06764108ba680a7b180262f956b17aa1df8e Mon Sep 17 00:00:00 2001 From: Drew Wells Date: Fri, 16 Jun 2023 07:24:42 -0500 Subject: [PATCH] authorizor options were being ignored --- grpc_opa/server_interceptor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grpc_opa/server_interceptor.go b/grpc_opa/server_interceptor.go index d4973ad..e5656f5 100644 --- a/grpc_opa/server_interceptor.go +++ b/grpc_opa/server_interceptor.go @@ -35,9 +35,13 @@ func NewDefaultConfig(application string, opts ...Option) *Config { opt(cfg) } + opts = append([]Option{WithOpaClienter(opa_client.New(cfg.address, opa_client.WithHTTPClient(cfg.httpCli)))}, opts...) + + authorizer := NewDefaultAuthorizer(application, opts...) + if cfg.authorizer == nil { logrus.Info("authorizers empty, using default authorizer") - cfg.authorizer = []Authorizer{NewDefaultAuthorizer(application, opts...)} + cfg.authorizer = []Authorizer{authorizer} } return cfg