Commit 243ab6bd authored by Jeff Mitchell's avatar Jeff Mitchell
Browse files

Add default mount param to userpass cli handler

parent 8325d3a0
No related merge requests found
Showing with 5 additions and 3 deletions
+5 -3
......@@ -10,7 +10,9 @@ import (
"github.com/mitchellh/mapstructure"
)
type CLIHandler struct{}
type CLIHandler struct {
DefaultMount string
}
func (h *CLIHandler) Auth(c *api.Client, m map[string]string) (string, error) {
var data struct {
......@@ -37,7 +39,7 @@ func (h *CLIHandler) Auth(c *api.Client, m map[string]string) (string, error) {
data.Password = password
}
if data.Mount == "" {
data.Mount = "userpass"
data.Mount = h.DefaultMount
}
options := map[string]interface{}{
......
......@@ -110,7 +110,7 @@ func Commands(metaPtr *meta.Meta) map[string]cli.CommandFactory {
Meta: *metaPtr,
Handlers: map[string]command.AuthHandler{
"github": &credGitHub.CLIHandler{},
"userpass": &credUserpass.CLIHandler{},
"userpass": &credUserpass.CLIHandler{DefaultMount: "userpass"},
"ldap": &credLdap.CLIHandler{},
"okta": &credOkta.CLIHandler{},
"cert": &credCert.CLIHandler{},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment