Skip to content

Commit

Permalink
add opa policy chain elements
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Sep 16, 2022
1 parent 3568be1 commit d86db43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"google.golang.org/grpc/credentials"

"github.com/networkservicemesh/sdk/pkg/registry/chains/memory"
"github.com/networkservicemesh/sdk/pkg/registry/common/authorize"
"github.com/networkservicemesh/sdk/pkg/tools/debug"
"github.com/networkservicemesh/sdk/pkg/tools/grpcutils"
"github.com/networkservicemesh/sdk/pkg/tools/log"
Expand Down Expand Up @@ -144,7 +145,13 @@ func main() {
),
),
)
memory.NewServer(ctx, time.Minute, &config.ProxyRegistryURL, clientOptions...).Register(server)
memory.NewServer(
ctx,
memory.WithAuthorizeNSRegistryServer(authorize.NewNetworkServiceRegistryServer()),
memory.WithAuthorizeNSERegistryServer(authorize.NewNetworkServiceEndpointRegistryServer()),
memory.WithExpireDuration(time.Minute),
memory.WithProxyRegistryURL(&config.ProxyRegistryURL),
memory.WithDialOptions(clientOptions...)).Register(server)

for i := 0; i < len(config.ListenOn); i++ {
srvErrCh := grpcutils.ListenAndServe(ctx, &config.ListenOn[i], server)
Expand Down
1 change: 1 addition & 0 deletions pkg/imports/imports_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
_ "github.com/kelseyhightower/envconfig"
_ "github.com/networkservicemesh/api/pkg/api/registry"
_ "github.com/networkservicemesh/sdk/pkg/registry/chains/memory"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/authorize"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/begin"
_ "github.com/networkservicemesh/sdk/pkg/registry/common/refresh"
_ "github.com/networkservicemesh/sdk/pkg/registry/core/next"
Expand Down

0 comments on commit d86db43

Please sign in to comment.