Skip to content

Commit

Permalink
Merge pull request #507 from anastasia-malysheva/add-auth-monitor
Browse files Browse the repository at this point in the history
Enable auth monitorConnectionServer
  • Loading branch information
denis-tingaikin authored Aug 1, 2022
2 parents 9fad736 + 6df8734 commit 8a9c837
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/networkservicemesh/api v1.4.1-0.20220711153918-a59689088578
github.com/networkservicemesh/sdk v0.5.1-0.20220728125347-990b34144761
github.com/networkservicemesh/sdk-k8s v0.0.0-20220728130337-cfa53d82a9be
github.com/networkservicemesh/sdk-sriov v0.0.0-20220728130120-4c3a69aace4e
github.com/networkservicemesh/sdk-sriov v0.0.0-20220729123117-6e6ba322cdf3
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/spiffe/go-spiffe/v2 v2.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ github.com/networkservicemesh/sdk-k8s v0.0.0-20220728130337-cfa53d82a9be h1:rsff
github.com/networkservicemesh/sdk-k8s v0.0.0-20220728130337-cfa53d82a9be/go.mod h1:Vg5rNDJG2w6xMbCHLdMC8xkrLWblFA/i5MhgTL81GLc=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220728125711-2cca96db15dd h1:uXKpMHCRRQy2Aal39xr4pxAzPVLIIhOSI8i/rAwJSLI=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220728125711-2cca96db15dd/go.mod h1:Ut82Iu6JDq14ZFGZ2ykU5V3qp2YirGPOH+VuVKx+QSs=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220728130120-4c3a69aace4e h1:aBKrwN1RhJU5WaSaZRC2aID7GPc5QeJzAsUiXptLYkk=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220728130120-4c3a69aace4e/go.mod h1:vZ69kHXaNP67jA5OhgBXCWpDUxXlfY6kQcOxv30R4oU=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220729123117-6e6ba322cdf3 h1:LBj7yqMo81Pz7iWXw8e0reufeDikTeTDW8Z2yoM9Dpc=
github.com/networkservicemesh/sdk-sriov v0.0.0-20220729123117-6e6ba322cdf3/go.mod h1:vZ69kHXaNP67jA5OhgBXCWpDUxXlfY6kQcOxv30R4oU=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down
1 change: 1 addition & 0 deletions internal/imports/imports_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
_ "github.com/networkservicemesh/sdk/pkg/tools/grpcutils"
_ "github.com/networkservicemesh/sdk/pkg/tools/log"
_ "github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
_ "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: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ import (
"github.com/networkservicemesh/sdk/pkg/tools/grpcutils"
"github.com/networkservicemesh/sdk/pkg/tools/log"
"github.com/networkservicemesh/sdk/pkg/tools/log/logruslogger"
monitorauthorize "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"
"github.com/networkservicemesh/sdk/pkg/tools/token"
"github.com/networkservicemesh/sdk/pkg/tools/tracing"

Expand Down Expand Up @@ -214,10 +216,13 @@ func main() {
// ********************************************************************************
log.FromContext(ctx).Infof("executing phase 6: create sriovns network service endpoint (time since start: %s)", time.Since(starttime))
// ********************************************************************************
var spiffeidMap spire.SpiffeIDConnectionMap

endpoint := forwarder.NewServer(
ctx,
config.Name,
authorize.NewServer(),
authorize.NewServer(authorize.WithSpiffeIDConnectionMap(&spiffeidMap)),
monitorauthorize.NewMonitorConnectionServer(monitorauthorize.WithSpiffeIDConnectionMap(&spiffeidMap)),
spiffejwt.TokenGeneratorFunc(source, config.MaxTokenLifetime),
pciPool,
resourcePool,
Expand Down

0 comments on commit 8a9c837

Please sign in to comment.