diff --git a/go.mod b/go.mod index 733c5984..3dca4d91 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index d52018ee..be8ba8bd 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/imports/imports_linux.go b/internal/imports/imports_linux.go index 51ab7b6b..e97c1042 100644 --- a/internal/imports/imports_linux.go +++ b/internal/imports/imports_linux.go @@ -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" diff --git a/main.go b/main.go index dd1e65c1..70d9fb2b 100644 --- a/main.go +++ b/main.go @@ -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" @@ -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,