Commit Graph

15 Commits (8d146db9ad6767295af4da619981b504e6d10301)

Author SHA1 Message Date
Mark Rushakoff 290d06f98f fix(swagger): synchronize enum with defined error constants 2019-03-01 11:58:11 -08:00
Kelvin Wang 79ce30691e update(http): remove kerrors, change the default to be influxdb error 2019-01-25 10:29:26 -08:00
Michael Desa bfb865cd72 feat(influxdb): authorize org service operations
feat(influxdb): add unauthorized error code

feat(testing): export ErrorsEqual method

feat(authorizer): add Authorize method that authorizers permissions

feat(authorizer): add org service that authorizes actions to a wrapped org service

feat(http): use authorized org service in org handler

feat(authorizer): rename Authorize to IsAllowed
2019-01-16 14:41:57 -05:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Michael Desa 338e0587d0 fix(platform): nest view beneath dashboard cell
feat(platform): add functional options for platform errors

fix(testing): set dashboard ids properly in dashboard tests

feat(bolt): add dashboard specific views

fix(bolt): delete view when cell is removed or dashboard is deleted
2019-01-08 18:11:13 -05:00
Michael Desa b590259a97 fix(platform): check for (*platform.Error)(nil) in error functions
As of https://github.com/influxdata/platform/pull/2192 a panic was
introduced in the startup of platform. It is the result of
`Error{Code,Op,Message}` being passed a `(*platform.Error)(nil)`
instead of an `(error)(nil)`.

Specifically
```
   if err == nil {
        return ""
    } else if e, ok := err.(*Error); ok && e.Code != "" {
        return e.Code
    }
```
will panic when err is `(*platform.Error)(nil)` as the `err == nil`
check will fail and the `e, ok := err.(*Error); ok && e.Code != ""` will
succeed and panic on `e.Code`, as `e` is nil.

This panic could have been avoided if all methods returned `error`
instead of `*platform.Error`.
2019-01-04 11:02:26 -05:00
zhulongcheng f3bf670706 rename msg to message for platform.Error json 2018-12-27 10:34:00 +08:00
zhulongcheng e73d4fc637 add MethodNotAllowed handler 2018-12-23 15:55:45 +08:00
Michael Desa 9d1ed7a8d6 fix(platform): rename "msg" field to "message" for Error json 2018-12-19 13:13:15 -05:00
Kelvin Wang d939732141 fix(platform): use json struct instead of string for embed error 2018-12-17 11:18:04 -05:00
Kelvin Wang 25eebd0084 fix(http): convert auth errors 2018-11-16 19:33:20 -05:00
Kelvin Wang 8d15d70360 fix(http): convert auth errors 2018-11-16 19:30:34 -05:00
Chris Goller 6054288f3e feat(kit/grpc): add translation between gRPC status and platform.Error 2018-11-15 21:16:48 -06:00
Kelvin Wang 3552af6386 feat: add onboarding defaults 2018-09-27 15:02:17 -04:00
Kelvin Wang 4cd8a48c39 feat(errors): add errors lib 2018-09-07 21:45:47 -05:00