Skip to content

Commit

Permalink
Revert "fix authorize (networkservicemesh#1637)"
Browse files Browse the repository at this point in the history
This reverts commit 50c0908.
  • Loading branch information
denis-tingaikin authored and NikitaSkrynnik committed Oct 7, 2024
1 parent 5d9c5be commit 1b01847
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/networkservice/common/authorize/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ func (a *authorizeServer) Close(ctx context.Context, conn *networkservice.Connec
a.spiffeIDConnectionMap.Store(spiffeID, ids)
}
}

if p, ok := peer.FromContext(ctx); ok && p != nil && *p != (peer.Peer{}) {
if _, ok := peer.FromContext(ctx); ok {
if err := a.policies.check(ctx, leftSide); err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkservice/common/authorize/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"crypto/tls"
"crypto/x509"
"math/big"
"net"
"net/url"
"os"
"path"
Expand Down Expand Up @@ -182,7 +181,7 @@ func TestAuthzEndpoint(t *testing.T) {
require.Equal(t, s.Code(), codes.PermissionDenied, "wrong error status code")
}

ctx := peer.NewContext(context.Background(), &peer.Peer{Addr: &net.IPAddr{}})
ctx := peer.NewContext(context.Background(), &peer.Peer{})

_, err := srv.Request(ctx, s.request)
checkResult(err)
Expand Down

0 comments on commit 1b01847

Please sign in to comment.