Skip to content
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

auth user support and meta replica lag #3

Merged
merged 5 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
go: [ '1.21' ]
os: [ ubuntu-latest, macOS-latest ]
os: [ ubuntu-latest ]
runs-on: ${{matrix.os}}
steps:
- name: Checkout code
Expand Down
13 changes: 12 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package cmd

import (
"fmt"
"github.com/nats-io/nats.go"
"os"
"os/signal"
"runtime"
Expand All @@ -25,7 +26,6 @@ import (

nested "github.com/antonfisher/nested-logrus-formatter"
"github.com/nats-io/nats-surveyor/surveyor"
"github.com/nats-io/nats.go"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -54,6 +54,8 @@ func rootCmdArgs(args []string) []string {
"-nkey": "--nkey",
"-user": "--user",
"-password": "--password",
"-auth-user": "--auth-user",
"-auth-password": "--auth-password",
"-timeout": "--timeout",
"-port": "--port",
"-addr": "--addr",
Expand Down Expand Up @@ -163,6 +165,13 @@ func init() {
// password
rootCmd.Flags().String("password", "", "NATS user password")
_ = viper.BindPFlag("password", rootCmd.Flags().Lookup("password"))
// user
rootCmd.Flags().String("auth-user", "", "NATS authenticated user name or token")
_ = viper.BindPFlag("auth-user", rootCmd.Flags().Lookup("auth-user"))

// password
rootCmd.Flags().String("auth-password", "", "NATS authenticated user password")
_ = viper.BindPFlag("auth-password", rootCmd.Flags().Lookup("auth-password"))

// count
rootCmd.Flags().IntP("count", "c", 1, "Expected number of servers (-1 for undefined).")
Expand Down Expand Up @@ -248,6 +257,8 @@ func getSurveyorOpts() *surveyor.Options {
opts.Seed = viper.GetString("seed")
opts.NATSUser = viper.GetString("user")
opts.NATSPassword = viper.GetString("password")
opts.NATSAuthUser = viper.GetString("auth-user")
opts.NATSAuthPassword = viper.GetString("auth-password")
opts.ExpectedServers = viper.GetInt("count")
opts.PollTimeout = viper.GetDuration("timeout")
opts.ListenPort = viper.GetInt("port")
Expand Down
56 changes: 29 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
module github.com/nats-io/nats-surveyor

go 1.21
go 1.22.0

require (
github.com/antonfisher/nested-logrus-formatter v1.3.1
github.com/fsnotify/fsnotify v1.7.0
github.com/klauspost/compress v1.17.6
github.com/nats-io/jsm.go v0.1.0
github.com/nats-io/nats-server/v2 v2.10.10
github.com/nats-io/nats.go v1.33.0
github.com/fsnotify/fsnotify v1.8.0
github.com/klauspost/compress v1.17.11
github.com/nats-io/jsm.go v0.1.2
github.com/nats-io/nats-server/v2 v2.10.22
github.com/nats-io/nats.go v1.37.0
github.com/nats-io/nuid v1.0.1
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model v0.5.0
github.com/prometheus/common v0.46.0
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.60.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.19.0
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a
golang.org/x/sync v0.6.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.29.0
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
golang.org/x/sync v0.9.0
)

require (
github.com/antonmedv/expr v1.15.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/expr-lang/expr v1.16.9 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/minio/highwayhash v1.0.3 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nats-io/jwt/v2 v2.5.3 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nats-io/jwt/v2 v2.7.2 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading