Skip to content

Commit

Permalink
Merge pull request hybridgroup#369 from zenbulabs/nats-adaptor-tls-su…
Browse files Browse the repository at this point in the history
…pport

Allow NATS options to pass in the NATS adaptor for TLS support.
  • Loading branch information
deadprogram authored Feb 16, 2017
2 parents 3407c88 + 4c74d03 commit 6ce713a
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 10 deletions.
42 changes: 42 additions & 0 deletions platforms/nats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,53 @@ func main() {
}
```

To run with TLS enabled, set the URL scheme prefix to tls://. Make sure the NATS server has TLS enabled and use the NATS option parameters to pass in the TLS settings to the adaptor. Refer to the github.com/nats-io/go-nats README for more TLS option parameters.

```go
package main

import (
"fmt"
"time"
natsio "github.com/nats-io/nats"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/nats"
)

func main() {
natsAdaptor := nats.NewNatsAdaptor("tls://localhost:4222", 1234, natsio.RootCAs("certs/ca.pem"))

work := func() {
natsAdaptor.On("hello", func(data []byte) {
fmt.Println("hello")
})
natsAdaptor.On("hola", func(data []byte) {
fmt.Println("hola")
})
data := []byte("o")
gobot.Every(1*time.Second, func() {
natsAdaptor.Publish("hello", data)
})
gobot.Every(5*time.Second, func() {
natsAdaptor.Publish("hola", data)
})
}

robot := gobot.NewRobot("natsBot",
[]gobot.Connection{natsAdaptor},
work,
)

robot.Start()
}
```

### Supported Features

* Publish messages
* Respond to incoming message events
* Support for Username/password authentication
* Support for NATS adaptor options to support TLS

### Upcoming Features

Expand Down
43 changes: 37 additions & 6 deletions platforms/nats/nats_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package nats
import (
"github.com/nats-io/nats"
"gobot.io/x/gobot"
"net/url"
"strings"
)

// Adaptor is a configuration struct for interacting with a NATS server.
Expand All @@ -20,30 +22,59 @@ type Adaptor struct {
}

// NewAdaptor populates a new NATS Adaptor.
func NewAdaptor(host string, clientID int) *Adaptor {
func NewAdaptor(host string, clientID int, options ...nats.Option) *Adaptor {
hosts, err := processHostString(host)

return &Adaptor{
name: gobot.DefaultName("NATS"),
Host: host,
Host: hosts,
clientID: clientID,
connect: func() (*nats.Conn, error) {
return nats.Connect("nats://" + host)
if err != nil {
return nil, err
}
return nats.Connect(hosts, options...)
},
}
}

// NewAdaptorWithAuth populates a NATS Adaptor including username and password.
func NewAdaptorWithAuth(host string, clientID int, username string, password string) *Adaptor {
func NewAdaptorWithAuth(host string, clientID int, username string, password string, options ...nats.Option) *Adaptor {
hosts, err := processHostString(host)

return &Adaptor{
Host: host,
Host: hosts,
clientID: clientID,
username: username,
password: password,
connect: func() (*nats.Conn, error) {
return nats.Connect("nats://" + username + ":" + password + "@" + host)
if err != nil {
return nil, err
}
return nats.Connect(hosts, append(options, nats.UserInfo(username, password))...)
},
}
}

func processHostString(host string) (string, error) {
urls := strings.Split(host, ",")
for i, s := range urls {
s = strings.TrimSpace(s)
if !strings.HasPrefix(s, "tls://") && !strings.HasPrefix(s, "nats://") {
s = "nats://" + s
}

u, err := url.Parse(s)
if err != nil {
return "", err
}

urls[i] = u.String()
}

return strings.Join(urls, ","), nil
}

// Name returns the logical client name.
func (a *Adaptor) Name() string { return a.name }

Expand Down
55 changes: 51 additions & 4 deletions platforms/nats/nats_adaptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@ package nats
import (
"errors"
"fmt"
"testing"

"github.com/nats-io/nats"
"gobot.io/x/gobot"
"gobot.io/x/gobot/gobottest"
"github.com/nats-io/nats"
"testing"
)

var _ gobot.Adaptor = (*Adaptor)(nil)

func connStub(options ...nats.Option) func() (*nats.Conn, error) {
return func() (*nats.Conn, error) {
opts := nats.DefaultOptions
for _, opt := range options {
if err := opt(&opts); err != nil {
return nil, err
}
}
c := &nats.Conn{Opts: opts}
return c, nil
}
}

func initTestNatsAdaptor() *Adaptor {
a := NewAdaptor("localhost:4222", 9999)
a.connect = func() (*nats.Conn, error) {
Expand All @@ -21,9 +33,44 @@ func initTestNatsAdaptor() *Adaptor {
return a
}

func initTestNatsAdaptorTLS(options ...nats.Option) *Adaptor {
a := NewAdaptor("tls://localhost:4242", 49999, options...)
a.connect = connStub(options...)
return a
}

func TestNatsAdaptorReturnsHost(t *testing.T) {
a := initTestNatsAdaptor()
gobottest.Assert(t, a.Host, "localhost:4222")
gobottest.Assert(t, a.Host, "nats://localhost:4222")
}

func TestNatsAdapterSetsRootCAs(t *testing.T) {
a := initTestNatsAdaptorTLS(nats.RootCAs("test_certs/catest.pem"))
gobottest.Assert(t, a.Host, "tls://localhost:4242")
a.Connect()
o := a.client.Opts
gobottest.Assert(t, len(o.TLSConfig.RootCAs.Subjects()), 1)
gobottest.Assert(t, o.Secure, true)
}

func TestNatsAdapterSetsClientCerts(t *testing.T) {
a := initTestNatsAdaptorTLS(nats.ClientCert("test_certs/client-cert.pem", "test_certs/client-key.pem"))
gobottest.Assert(t, a.Host, "tls://localhost:4242")
a.Connect()
certs := a.client.Opts.TLSConfig.Certificates
gobottest.Assert(t, len(certs), 1)
gobottest.Assert(t, a.client.Opts.Secure, true)
}

func TestNatsAdapterSetsClientCertsWithUserInfo(t *testing.T) {
a := initTestNatsAdaptorTLS(nats.ClientCert("test_certs/client-cert.pem", "test_certs/client-key.pem"), nats.UserInfo("test", "testwd"))
gobottest.Assert(t, a.Host, "tls://localhost:4242")
a.Connect()
certs := a.client.Opts.TLSConfig.Certificates
gobottest.Assert(t, len(certs), 1)
gobottest.Assert(t, a.client.Opts.Secure, true)
gobottest.Assert(t, a.client.Opts.User, "test")
gobottest.Assert(t, a.client.Opts.Password, "testwd")
}

// TODO: implement this test without requiring actual server connection
Expand Down
54 changes: 54 additions & 0 deletions platforms/nats/test_certs/catest-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,A22F189537986661D31D1E3E2E4883C9

4M+2g/t6q7FfWY7zA8J4JsIRDy3H0y5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T5O+1xBykoU7J6OhXu4pe3rlNy4yJLd
PFBB/JwzlDb9CxO4zN3ZrFUvwB9W/N0hAA+o9jTnTEtxyM7gitFkrGXHJIACfZmM
WmoEYhEsqn0To78SGfe5jqp56DKPM7onhNWXUu+ZkRi4xFQXJqvwKjZpXV2oQOcS
8JULyft9AmY7sChoNINlALdGRCXmKqoLg16suN7r6WpJx2peQg7fPsPxcb9/9hEM
cmrISL7CoZOX01PyQyxL2KEEYjjef5Licz0ywk8DmUv1ABqtP7Uxha8dSuSq6mtc
DVcO+YXS8DDsH5UvrGSsMO2Q+P9Juu8Nx+u2LfEF8ANds0L1mKa+3S8JQU8y28g9
34wHQiSA88m7t841J9pJ7+Nlymac3qRRTIyvu7SIz7dTBjPuAdDf/GPfG42YF9D9
sp0NXLzR1Sp2+4ZWrxZoezt8Sljnhl9olSqtrMrV/Dtco/04RXnepCBmE+JIA5sx
s+CxWaDjzc2+CN1BOO9Bi9fGsXSmbcGnQ3+UyJWfIPDENUhAdI7ccLCim6R5MDIL
Z7bpXR1zw6eIGdFcSsG0dXspPGARQdsFI6r+OroK7MaUkbHE7qjX93LMqd0a/h87
QNUQZleBNAllrFeKvcCwuzVamJyv5gbgdbibpy7Ue5URUxlyy4RCUHnZXLJ7kOE4
Xu8bCzK6nZJ+AQBadtFDT45RWjtMoexkvjZszVgtZLz0TGWnK0SOf/t8MeJ+FKu8
aob7iYLX1xAt9ztnpcR7unDaBiYmePghc9b8SrVfcQdjUe0TxGsW2kQmu6QYvvQ1
pRGmvxRPk2KUUG2rCNlZDfNscEGiIE6Ff4wLQr9N01zXpWx1w3uURcIlZzFvXKOi
UtnHbqI49qnJTz/iVGREd0PqHTu+yVKal4OVpGNLMSV9K+ERVI40gllC5tiHX0A+
dRlXxI+s7vJ9rwtyq32XYZtvKiuqCdsMQyOJ2fNaQ4bz06OxvtV301LXxXv1Kya/
-----END RSA PRIVATE KEY-----
38 changes: 38 additions & 0 deletions platforms/nats/test_certs/catest.pem
Original file line number Di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eDjwrl5JNcXEPIwkWyye6NB5XJvAeEiOAL1+IU1iV6Oyy
e4ZHMcpSo22m4EFha8zlYD7CaJHo6JBcSqaLMWFaRY1rWakl12/0fJ68R7OioJ/0
3Y3j24hdtuAAccLMzH3YI7uM/mzJhmBAgUXc5Kt6I81vgds7yBio7zaOeC+2+cOq
5uUwm9dfOMZxnJI+HnXDFVyGgGlANQbb
-----END CERTIFICATE-----
31 changes: 31 additions & 0 deletions platforms/nats/test_certs/client-cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFPjCCAyagAwIBAgIJAMSwPHLUBjPUMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYD
VQQGEwJVUzEPMA0GA1UECBMGSGF3YWlpMREwDwYDVQQHEwhIb25vbHVsdTERMA8G
A1UEChMIR29ib3QuaW8xFDASBgNVBAsTC09wZW4gU291cmNlMRIwEAYDVQQDEwls
b2NhbGhvc3QxIjAgBgkqhkiG9w0BCQEWE25vd2hlcmVAbm93aGVyZS5jb20wHhcN
MTcwMjEzMDEzNTI5WhcNMjIwMjEyMDEzNTI5WjARMQ8wDQYDVQQDEwZjbGllbnQw
ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/9f5QeY89ILj2LX4j2t3R
V8LO7YUMcarLENtpu37lpni43Bfn38PZUX5Mgmt7EufcZ6nTxmdhCUBQWz9bCCwl
f7Ukxs8vkpDdxXCSCSzafZsxVtaV21yPT9ACr2uYahTR5q4ChblfMd7u0hpbmcTZ
LfXzErds92Dept9k1W8tgSzzvv9qK5Wld5ZeYsiSanUC23Jl2CIy9T0H3AnRko+p
Lli/szQX9A11Dbjd/SKQam+ca618sZ9kRQQRNQHVLtKhnlZDITZHjExQqlDTcWGQ
vRODJIuxJt2L4Qx0tl2poQ2GT2Zxtt7/uY5Lmbga2OOoxBfbp8ar4n/APt19/r+5
Qape/vgGypTh9CjzMBE8cIDXVik4eVR2mRsCuYyZY8fNO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----
51 changes: 51 additions & 0 deletions platforms/nats/test_certs/client-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKAIBAAKCAgEAv/X+UHmPPSC49i1+I9rd0VfCzu2FDHGqyxDbabt+5aZ4uNwX
59/D2VF+TIJrexLn3Gep08ZnYQlAUFs/WwgsJX+1JMbPL5KQ3cVwkgks2n2bMVbW
ldtcj0/QAq9rmGoU0eauAoW5XzHe7tIaW5nE2S318xK3bPdg3qbfZNVvLYEs877/
aiuVpXeWXmLIkmp1AttyZdgiMvU9B9wJ0ZKPqS5Yv7M0F/QNdQ243f0ikGpvnGut
fLGfZEUEETUB1S7SoZ5WQyE2R4xMUKpQ03FhkL0TgySLsSbdi+EMdLZdqaENhk9m
cbbe/7mOS5m4GtjjqMQX26fGq+J/wD7dff6/uUGqXv74BsqU4fQo8zARPHCA11Yp
OHlUdpkbArmMmWPHzTtO4Nsz2fmXPVaWGeXNy24enAld3uZTHC32bQYI+GOtBmSS
JFHIH2aSBv6ZWfekxuAmXVdTcyNXR0T/dVBbxmxMY59Tt4U10nte+PgDxhqHRyAK
W2OOZuSXc/l2DVKL2oIaqLq9r7yJ/ZIIJa/jlPKPOMWHOmyDWpxKMEZebmCC/3In
WE/Nw7nDNDfLsleBTZvv7Uu2VuLwpvFhHeZnJNqe2Qv8Kx8GQferUU+XWzQK27ZV
zde0X8nhs6a08+1Qdcsc81TfTlNK8RoAHN+mwg8X/Y0vp86ak919j/RCWC0CAwEA
AQKCAgAw+IGDaC95ibKF4v8uCHTUJg5lmcR6czj+CvPeml16GqjriAJ1PemJtDeD
LzZaNG2AFdYGV7Qh1ilZFp4oDAKvIlBE7I8IdNyOJwNbzglqR+bihGPD4S1Qxiyr
srLBNDbRgYbcz96FgYR86o6c1bKZMRdwhlLS8pz80Bdncuek9TJRkGU6YZoQl1x+
AbdnWs81BmS9xJCc7WE/cwvyMfCCWXd8mCvu/Gy+cty5jQ1XSD/m6LV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