func (d *Daemon) checkTrustedClient(r *http.Request) error {
	trusted, _, _, err := d.Authenticate(r)
	if !trusted || err != nil {
		if err != nil {
			return err
		}

		return fmt.Errorf("Not authorized")
	}

	return nil
}
func (d *Daemon) checkTrustedClient(r *http.Request) error {
	trusted, _, _, err := d.Authenticate(r)
	if !trusted || err != nil {
		if err != nil {
			return err
		}

		return fmt.Errorf("Not authorized")
	}

	return nil
}
func ( d * Daemon ) checkTrustedClient ( r * http . Request ) error { trusted , _ , _ , err := d . Authenticate ( r ) if ! trusted || err != nil { if err != nil { return err } return fmt . Errorf ( " " ) } return nil }
// Convenience function around Authenticate
Convenience function around Authenticate