Skip to content

Commit

Permalink
Updates for auth monitorConnectionServer element (#527)
Browse files Browse the repository at this point in the history
* enable authorize monitor connection server

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* fix imports

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
  • Loading branch information
anastasia-malysheva authored Jul 29, 2022
1 parent edf2e58 commit 191577a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/imports/imports_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
_ "github.com/networkservicemesh/sdk/pkg/tools/log"
_ "github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
_ "github.com/networkservicemesh/sdk/pkg/tools/log/spanlogger"
_ "github.com/networkservicemesh/sdk/pkg/tools/monitorconnection/authorize"
_ "github.com/networkservicemesh/sdk/pkg/tools/opentelemetry"
_ "github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
_ "github.com/networkservicemesh/sdk/pkg/tools/spire"
Expand Down
7 changes: 5 additions & 2 deletions internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

"github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
"github.com/networkservicemesh/sdk/pkg/tools/log/spanlogger"
"github.com/networkservicemesh/sdk/pkg/tools/spire"

"github.com/edwarnicke/grpcfd"
"github.com/sirupsen/logrus"
Expand All @@ -44,6 +45,7 @@ import (
"github.com/networkservicemesh/sdk/pkg/tools/grpcutils"
"github.com/networkservicemesh/sdk/pkg/tools/listenonurl"
"github.com/networkservicemesh/sdk/pkg/tools/log"
authmonitor "github.com/networkservicemesh/sdk/pkg/tools/monitorconnection/authorize"
"github.com/networkservicemesh/sdk/pkg/tools/spiffejwt"
"github.com/networkservicemesh/sdk/pkg/tools/token"
"github.com/networkservicemesh/sdk/pkg/tools/tracing"
Expand Down Expand Up @@ -116,11 +118,12 @@ func RunNsmgr(ctx context.Context, configuration *config.Config) error {
tlsClientConfig.MinVersion = tls.VersionTLS12
tlsServerConfig := tlsconfig.MTLSServerConfig(m.source, m.source, tlsconfig.AuthorizeAny())
tlsServerConfig.MinVersion = tls.VersionTLS12

spiffeIDConnMap := spire.SpiffeIDConnectionMap{}
mgrOptions := []nsmgr.Option{
nsmgr.WithName(configuration.Name),
nsmgr.WithURL(u.String()),
nsmgr.WithAuthorizeServer(authorize.NewServer()),
nsmgr.WithAuthorizeServer(authorize.NewServer(authorize.WithSpiffeIDConnectionMap(&spiffeIDConnMap))),
nsmgr.WithAuthorizeMonitorConnectionServer(authmonitor.NewMonitorConnectionServer(authmonitor.WithSpiffeIDConnectionMap(&spiffeIDConnMap))),
nsmgr.WithDialTimeout(configuration.DialTimeout),
nsmgr.WithForwarderServiceName(configuration.ForwarderNetworkServiceName),
nsmgr.WithDialOptions(
Expand Down

0 comments on commit 191577a

Please sign in to comment.