-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add authorize Monitor connection elements. #1333
Add authorize Monitor connection elements. #1333
Conversation
…Server chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@@ -117,6 +119,16 @@ func WithAuthorizeServer(authorizeServer networkservice.NetworkServiceServer) Op | |||
} | |||
} | |||
|
|||
// WithAuthorizeMonitorServer sets authorization MonitorConnectionServer chain element | |||
func WithAuthorizeMonitorServer(authorizeMonitorServer networkservice.MonitorConnectionServer) Option { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply for other places
func WithAuthorizeMonitorServer(authorizeMonitorServer networkservice.MonitorConnectionServer) Option { | |
func WithAuthorizeMonitorConnectionServer(authorizeMonitorServer networkservice.MonitorConnectionServer) Option { |
for _, v := range in.PathSegments { | ||
seg = append(seg, v.GetId()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check only previous segment.
conn_ids := [y | y = input.spiffe_id_connection_map[input.service_spiffe_id][_]] | ||
count(input.path_segments) > 0 | ||
count(conn_ids) > 0 | ||
conn_ids == input.path_segments | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note: the client is always previous segment. Please check only previous id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@@ -55,7 +54,8 @@ func pemEncodingX509Cert(cert *x509.Certificate) string { | |||
return string(certpem) | |||
} | |||
|
|||
func parseX509Cert(authInfo credentials.AuthInfo) *x509.Certificate { | |||
// ParseX509Cert - parses x509 certificate from the passed credentials.AuthInfo | |||
func ParseX509Cert(authInfo credentials.AuthInfo) *x509.Certificate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this method in other package.
ids = &spire.ConnectionIDSet{} | ||
} | ||
var placer struct{} | ||
ids.Store(connID, placer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ids.Store(connID, placer) | |
ids.Store(connID, struct{}{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes
Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@@ -0,0 +1,36 @@ | |||
// Copyright (c) 2022 Cisco and/or its affiliates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1333 Commit: 990b341 Author: anastasia-malysheva Date: 2022-07-28 19:53:47 +0700 Message: - Add authorize Monitor connection elements. (#1333) * Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain. Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * rename options Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com> * update auth monitor police Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…Server chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.
Signed-off-by: anastasia.malysheva anastasia.malysheva@xored.com
Description
Issue link
#46
How Has This Been Tested?
Types of changes