File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,15 @@ package main
22
33import (
44 "flag"
5+ "os"
6+
57 "github.com/grepplabs/kafka-proxy/plugin/local-auth/shared"
68 "github.com/hashicorp/go-plugin"
79 "github.com/sirupsen/logrus"
8- "os"
910)
1011
12+ const EnvSaslPassword = "SASL_PASSWORD"
13+
1114type PasswordAuthenticator struct {
1215 Username string
1316 Password string
@@ -29,6 +32,11 @@ func main() {
2932 passwordAuthenticator := & PasswordAuthenticator {}
3033 flags := passwordAuthenticator .flagSet ()
3134 flags .Parse (os .Args [1 :])
35+
36+ if passwordAuthenticator .Password == "" {
37+ passwordAuthenticator .Password = os .Getenv (EnvSaslPassword )
38+ }
39+
3240 if passwordAuthenticator .Username == "" || passwordAuthenticator .Password == "" {
3341 logrus .Errorf ("parameters username and password are required" )
3442 os .Exit (1 )
You can’t perform that action at this time.
0 commit comments