3
0
Files
corteza/internal/rbac/util.go
Tit Petric 7bf78fb4e0 upd(all): refactor
- moved rbac store and config to internal pkg,
- split auth authenticators to internal pkg,
- add rbac config object to internal/config,
- update package imports and references for auth,
- clean up main with pkg aliases
2018-09-13 12:05:06 +02:00

16 lines
305 B
Go

package rbac
import (
"github.com/pkg/errors"
"io/ioutil"
"net/http"
)
func toError(resp *http.Response) error {
body, err := ioutil.ReadAll(resp.Body)
if body == nil || err != nil {
return errors.Errorf("unexpected response (%d, %s)", resp.StatusCode, err)
}
return errors.New(string(body))
}