Merge pull request #360 from openziti/fix.updb.enroll.password.prompt

fixes ziti updb password prompt
This commit is contained in:
Andrew
2021-04-14 13:14:34 -04:00
committed by GitHub
3 changed files with 30 additions and 14 deletions
+18 -2
View File
@@ -148,10 +148,26 @@ func processEnrollment() error {
if tkn.EnrollmentMethod == "updb" {
if password == "" {
password, err = term.PromptPassword("updb enrollment requires a password", false)
password, err = term.PromptPassword("updb enrollment requires a password, please enter one: ", false)
password = strings.TrimSpace(password)
if err != nil {
return fmt.Errorf("failed to complete enrollment, updb requires a non-empty password")
return fmt.Errorf("failed to complete enrollment, updb requires a non-empty password: %v", err)
}
confirm, err := term.PromptPassword("please confirm what you entered: ", false)
if err != nil {
return fmt.Errorf("failed to complete enrollment, updb password confirmation failed: %v", err)
}
confirm = strings.TrimSpace(confirm)
if password != confirm {
return fmt.Errorf("failed to complete enrollment, passwords did not match")
}
flags.Password = password
}
return enroll.EnrollUpdb(flags)
+3 -3
View File
@@ -28,9 +28,9 @@ require (
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19
github.com/michaelquigley/pfxlog v0.3.7
github.com/openziti/edge v0.19.78
github.com/openziti/fabric v0.16.51
github.com/openziti/foundation v0.15.46
github.com/openziti/sdk-golang v0.15.38
github.com/openziti/fabric v0.16.53
github.com/openziti/foundation v0.15.48
github.com/openziti/sdk-golang v0.15.39
github.com/pborman/uuid v1.2.0
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
+9 -9
View File
@@ -613,15 +613,15 @@ github.com/openziti/bbolt v1.3.6-0.20210317142109-547da822475e h1:ST9+54UtCr96S5
github.com/openziti/bbolt v1.3.6-0.20210317142109-547da822475e/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
github.com/openziti/dilithium v0.3.3 h1:PLgQ6PMNLSTzCFbX/h98cmudgz/cU6TmjdSv5NAPD8k=
github.com/openziti/dilithium v0.3.3/go.mod h1:vsCjI2AU/hon9e+dLhUFbCNGesJDj2ASgkySOcpmvjo=
github.com/openziti/edge v0.19.74 h1:43gsaSE/tBjOyDHNMloFEdgD9WRGAZpihCBj9KrZTnY=
github.com/openziti/edge v0.19.74/go.mod h1:TUZs2pDysJL+aJvM1+bF88JLzK6yYcDh8DWrV0mMmVE=
github.com/openziti/fabric v0.16.51 h1:kXlEW9/TkWaUbExZy2SYAoqWRiPuhPaQ0vchzwLjyzg=
github.com/openziti/fabric v0.16.51/go.mod h1:Q8ZMLwNBHCKYDEp+38CEIXphiinhPb2lO8+UCAxaqu4=
github.com/openziti/foundation v0.15.46 h1:+7Q3dnwUpFnLjb4wtXFk/jaZwqaYpF0dyR1yp4eT/kA=
github.com/openziti/foundation v0.15.46/go.mod h1:NnSBTp9ZkcYsv6nYxZR0/NzoHfkIo6tjpBHDvBsPFqw=
github.com/openziti/sdk-golang v0.15.37/go.mod h1:UYITngFVgE1YQ/zoDt83Sqr36mj6NNcVHyetzqc6gdg=
github.com/openziti/sdk-golang v0.15.38 h1:KqW6A2LvPWCl6VhYHXP4Q7LtP+WbXaaTpGI0Cz73nQc=
github.com/openziti/sdk-golang v0.15.38/go.mod h1:UYITngFVgE1YQ/zoDt83Sqr36mj6NNcVHyetzqc6gdg=
github.com/openziti/edge v0.19.78 h1:Fd970IKzVagHz4qjYEB9obfQTYtsqE1BEoaf3j9tHHM=
github.com/openziti/edge v0.19.78/go.mod h1:dsgO/Ccd2EzKxPcagS84CQeVBO2tFRs5M2BVQs1SDYk=
github.com/openziti/fabric v0.16.53 h1:euH/rzJ7yTpUIFF5gRECVoPrUWGyoQYf2frdotcQBjk=
github.com/openziti/fabric v0.16.53/go.mod h1:bmbQB2A2ZgGbSxUT5dXYhgvD/hfpQQfrEq9ibj6x4LI=
github.com/openziti/foundation v0.15.47/go.mod h1:NnSBTp9ZkcYsv6nYxZR0/NzoHfkIo6tjpBHDvBsPFqw=
github.com/openziti/foundation v0.15.48 h1:NnL/xY684XeFiLBi5z0+uKf2tpPhlClbMeVmUQPF8Jo=
github.com/openziti/foundation v0.15.48/go.mod h1:NnSBTp9ZkcYsv6nYxZR0/NzoHfkIo6tjpBHDvBsPFqw=
github.com/openziti/sdk-golang v0.15.39 h1:xHv9tgfkkj1IQOFlztAMNsgd7Opa5hFrz2Zu6aPzKtw=
github.com/openziti/sdk-golang v0.15.39/go.mod h1:gNQRosz6RU80GmGNbXjGO6HKUtSlSOTEL2oTL2HLNwU=
github.com/oracle/oci-go-sdk v24.2.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 h1:fa50YL1pzKW+1SsBnJDOHppJN9stOEwS+CRWyUtyYGU=