mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 10:10:42 -07:00
Merge pull request #1804 from nats-io/fix_import_cycle_detection
Fixed service import cycle detection that broke with JS clustering
This commit is contained in:
@@ -3632,6 +3632,8 @@ func (c *client) processServiceImport(si *serviceImport, acc *Account, msg []byt
|
||||
// Copy our pubArg and account
|
||||
pacopy := c.pa
|
||||
oacc := c.acc
|
||||
// Change this so that we detect recursion
|
||||
c.pa.psi = si
|
||||
|
||||
// Place our client info for the request in the message.
|
||||
// This will survive going across routes, etc.
|
||||
|
||||
@@ -217,9 +217,6 @@ func TestAccountCycleServiceNonCycleChain(t *testing.T) {
|
||||
|
||||
// bug: https://github.com/nats-io/nats-server/issues/1769
|
||||
func TestServiceImportReplyMatchCycle(t *testing.T) {
|
||||
// FIXME(dlc) - failing
|
||||
t.SkipNow()
|
||||
|
||||
conf := createConfFile(t, []byte(`
|
||||
port: -1
|
||||
accounts {
|
||||
@@ -260,9 +257,6 @@ func TestServiceImportReplyMatchCycle(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceImportReplyMatchCycleMultiHops(t *testing.T) {
|
||||
// FIXME(dlc) - Fix!
|
||||
t.SkipNow()
|
||||
|
||||
conf := createConfFile(t, []byte(`
|
||||
port: -1
|
||||
accounts {
|
||||
|
||||
@@ -32,6 +32,8 @@ import (
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
var noOpErrHandler = func(_ *nats.Conn, _ *nats.Subscription, _ error) {}
|
||||
|
||||
func TestTLSConnection(t *testing.T) {
|
||||
srv, opts := RunServerWithConfig("./configs/tls.conf")
|
||||
defer srv.Shutdown()
|
||||
@@ -1497,7 +1499,7 @@ func TestTLSClientAuthWithRDNSequence(t *testing.T) {
|
||||
`
|
||||
port: -1
|
||||
%s
|
||||
|
||||
|
||||
authorization {
|
||||
users = [
|
||||
{ user = "DC=com, DC=example, CN=*.example.com, O=NATS, OU=NATS, L=Los Angeles, ST=CA, C=US" }
|
||||
@@ -1516,7 +1518,7 @@ func TestTLSClientAuthWithRDNSequence(t *testing.T) {
|
||||
`
|
||||
port: -1
|
||||
%s
|
||||
|
||||
|
||||
authorization {
|
||||
users = [
|
||||
{ user = "CN=*.example.com,OU=NATS,O=NATS,L=Los Angeles,ST=CA,C=US,DC=example,DC=com" }
|
||||
@@ -1659,6 +1661,7 @@ func TestTLSClientAuthWithRDNSequence(t *testing.T) {
|
||||
nc, err := nats.Connect(fmt.Sprintf("tls://localhost:%d", opts.Port),
|
||||
test.certs,
|
||||
nats.RootCAs("./configs/certs/rdns/ca.pem"),
|
||||
nats.ErrorHandler(noOpErrHandler),
|
||||
)
|
||||
if test.err == nil && err != nil {
|
||||
t.Errorf("Expected to connect, got %v", err)
|
||||
@@ -1911,6 +1914,7 @@ func TestTLSClientSVIDAuth(t *testing.T) {
|
||||
nc, err := nats.Connect(fmt.Sprintf("tls://localhost:%d", opts.Port),
|
||||
test.certs,
|
||||
nats.RootCAs("./configs/certs/svid/ca.pem"),
|
||||
nats.ErrorHandler(noOpErrHandler),
|
||||
)
|
||||
if test.err == nil && err != nil {
|
||||
t.Errorf("Expected to connect, got %v", err)
|
||||
|
||||
Reference in New Issue
Block a user