Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
Allow clear text password (#157)
Browse files Browse the repository at this point in the history
support Aurora token authentication with --allow-cleartext-password
  • Loading branch information
tirsen authored Sep 29, 2020
1 parent 90ed407 commit a454a3d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 38 deletions.
67 changes: 35 additions & 32 deletions cmd/dumpling/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,39 @@ import (
)

var (
databases []string
tablesList []string
host string
user string
port int
password string
threads int
outputDir string
fileSizeStr string
statementSize uint64
logLevel string
logFile string
logFormat string
consistency string
snapshot string
noViews bool
statusAddr string
rows uint64
where string
fileType string
noHeader bool
noSchemas bool
noData bool
csvNullValue string
sql string
filters []string
caseSensitive bool
caPath string
certPath string
keyPath string
csvSeparator string
csvDelimiter string
databases []string
tablesList []string
host string
user string
port int
password string
allowCleartextPasswords bool
threads int
outputDir string
fileSizeStr string
statementSize uint64
logLevel string
logFile string
logFormat string
consistency string
snapshot string
noViews bool
statusAddr string
rows uint64
where string
fileType string
noHeader bool
noSchemas bool
noData bool
csvNullValue string
sql string
filters []string
caseSensitive bool
caPath string
certPath string
keyPath string
csvSeparator string
csvDelimiter string

completeInsert bool
dumpEmptyDatabase bool
Expand Down Expand Up @@ -94,6 +95,7 @@ func main() {
pflag.StringVarP(&user, "user", "u", "root", "Username with privileges to run the dump")
pflag.IntVarP(&port, "port", "P", 4000, "TCP/IP port to connect to")
pflag.StringVarP(&password, "password", "p", "", "User password")
pflag.BoolVar(&allowCleartextPasswords, "allow-cleartext-passwords", false, "Allow passwords to be sent in cleartext (warning: don't use without TLS)")
pflag.IntVarP(&threads, "threads", "t", 4, "Number of goroutines to use, default 4")
pflag.StringVarP(&fileSizeStr, "filesize", "F", "", "The approximate size of output file")
pflag.Uint64VarP(&statementSize, "statement-size", "s", export.UnspecifiedSize, "Attempted size of INSERT statement in bytes")
Expand Down Expand Up @@ -180,6 +182,7 @@ func main() {
conf.User = user
conf.Port = port
conf.Password = password
conf.AllowCleartextPasswords = allowCleartextPasswords
conf.Threads = threads
conf.FileSize = fileSize
conf.StatementSize = statementSize
Expand Down
16 changes: 10 additions & 6 deletions v4/export/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import (
type Config struct {
storage.BackendOptions

Databases []string
Host string
User string
Port int
Password string `json:"-"`
Security struct {
Databases []string
Host string
User string
Port int
Password string `json:"-"`
AllowCleartextPasswords bool
Security struct {
CAPath string
CertPath string
KeyPath string
Expand Down Expand Up @@ -121,6 +122,9 @@ func (conf *Config) GetDSN(db string) string {
if len(conf.Security.CAPath) > 0 {
dsn += "&tls=dumpling-tls-target"
}
if conf.AllowCleartextPasswords {
dsn += "&allowCleartextPasswords=1"
}
return dsn
}

Expand Down

0 comments on commit a454a3d

Please sign in to comment.