func VerifyBasicAuth(username string, password string) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		auth := req.Header.Get("Authorization")
		Expect(auth).ShouldNot(Equal(""), "Authorization header must be specified")

		decoded, err := base64.StdEncoding.DecodeString(auth[6:])
		Expect(err).ShouldNot(HaveOccurred())

		Expect(string(decoded)).Should(Equal(fmt.Sprintf("%s:%s", username, password)), "Authorization mismatch")
	}
}
func VerifyBasicAuth(username string, password string) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		auth := req.Header.Get("Authorization")
		Expect(auth).ShouldNot(Equal(""), "Authorization header must be specified")

		decoded, err := base64.StdEncoding.DecodeString(auth[6:])
		Expect(err).ShouldNot(HaveOccurred())

		Expect(string(decoded)).Should(Equal(fmt.Sprintf("%s:%s", username, password)), "Authorization mismatch")
	}
}
func VerifyBasicAuth ( username string , password string ) http . HandlerFunc { return func ( w http . ResponseWriter , req * http . Request ) { auth := req . Header . Get ( " " ) Expect ( auth ) . ShouldNot ( Equal ( " " ) , " " ) decoded , err := base64 . StdEncoding . DecodeString ( auth [ 6 : ] ) Expect ( err ) . ShouldNot ( HaveOccurred ( ) ) Expect ( string ( decoded ) ) . Should ( Equal ( fmt . Sprintf ( " " , username , password ) ) , " " ) } }
//VerifyBasicAuth returns a handler that verifies the request contains a BasicAuth Authorization header
//matching the passed in username and password
VerifyBasicAuth returns a handler that verifies the request contains a BasicAuth Authorization header matching the passed in username and password