influxdb/authorizer
Jonathan A. Sternberg cbd04f2884
refactor: http error serialization matches the new error schema (#15196)
The http error schema has been changed to simplify the outward facing
API. The `op` and `error` attributes have been dropped because they
confused people. The `error` attribute will likely be readded in some
form in the future, but only as additional context and will not be
required or even suggested for the UI to use.

Errors are now output differently both when they are serialized to JSON
and when they are output as strings. The `op` is no longer used if it is
present. It will only appear as an optional attribute if at all. The
`message` attribute for an error is always output and it will be the
prefix for any nested error. When this is serialized to JSON, the
message is automatically flattened so a nested error such as:

    influxdb.Error{
        Msg: errors.New("something bad happened"),
        Err: io.EOF,
    }

This would be written to the message as:

    something bad happened: EOF

This matches a developers expectations much more easily as most
programmers assume that wrapping an error will act as a prefix for the
inner error.

This is flattened when written out to HTTP in order to make this logic
immaterial to a frontend developer.

The code is still present and plays an important role in categorizing
the error type. On the other hand, the code will not be output as part
of the message as it commonly plays a redundant and confusing role when
humans read it. The human readable message usually gives more context
and a message like with the code acting as a prefix is generally not
desired. But, the code plays a very important role in helping to
identify categories of errors and so it is very important as part of the
return response.
2019-09-19 10:06:47 -05:00
..
auth.go if(influxdb): updated auth shall return 2019-04-01 12:56:29 -04:00
auth_test.go if(influxdb): updated auth shall return 2019-04-01 12:56:29 -04:00
authorize.go feat(influxdb): authorize org service operations 2019-01-16 14:41:57 -05:00
bucket.go feat(http): block writes to system buckets (#14920) 2019-09-05 11:22:18 -07:00
bucket_test.go remove org from bucket 2019-04-22 18:39:05 -04:00
check.go fix(authorizer): use authorizeWriteOrg and authorizeReadOrg for checks 2019-08-28 09:09:17 -04:00
check_test.go fix(authorizer): use authorizeWriteOrg and authorizeReadOrg for checks 2019-08-28 09:09:17 -04:00
dashboard.go feat(authorizer): add authorized dashboard service 2019-01-17 16:04:16 -05:00
dashboard_test.go test(authorizer): add dashboard service tests 2019-01-17 16:04:16 -05:00
label.go organizationID -> orgID 2019-04-12 01:29:42 -07:00
label_test.go organizationID -> orgID 2019-04-12 01:29:42 -07:00
notification_endpoint.go fix(http): fix notfication endpoint secret store 2019-08-28 16:02:17 -04:00
notification_endpoint_test.go fix(http): fix notfication endpoint secret store 2019-08-28 16:02:17 -04:00
notification_rule.go fix(authorizer): use authorizeWriteOrg and authorizeReadOrg for rules 2019-08-28 09:15:52 -04:00
notification_rule_test.go fix(authorizer): use authorizeWriteOrg and authorizeReadOrg for rules 2019-08-28 09:15:52 -04:00
org.go feat(influxdb): authorize org service operations 2019-01-16 14:41:57 -05:00
org_test.go feat(authorizer): add authorized bucket service 2019-01-16 15:37:19 -05:00
scraper.go check write bucket permission when creating a scraper 2019-05-15 21:44:23 +08:00
scraper_test.go check write bucket permission when creating a scraper 2019-05-15 21:44:23 +08:00
secret.go Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
secret_test.go chore(authorizer): refactor order of checks 2019-01-22 19:23:23 +01:00
source.go fix(authorizer): allow default source orgID to be in the sources list 2019-01-18 13:14:43 -05:00
source_test.go feat(authorizer): source authorizer 2019-01-18 14:05:36 +01:00
task.go chore(ci): update go-tools 2019-08-22 10:55:05 -05:00
task_test.go refactor: http error serialization matches the new error schema (#15196) 2019-09-19 10:06:47 -05:00
telegraf.go fix(influxdb): rename telegraf orgID 2019-06-03 16:20:53 -04:00
telegraf_test.go fix(influxdb): rename telegraf orgID 2019-06-03 16:20:53 -04:00
urm.go feat(influxdb): add authorized user resource mappings 2019-01-18 14:22:08 -05:00
urm_test.go feat(influxdb): add authorized user resource mappings 2019-01-18 14:22:08 -05:00
user.go feat(influxdb): add authorization for user actions 2019-01-17 16:05:24 -05:00
user_test.go feat(influxdb): add authorization for user actions 2019-01-17 16:05:24 -05:00
util_test.go feat(authorizer): add authorized bucket service 2019-01-16 15:37:19 -05:00
variable.go Rename all occurences of Macro to Variable 2019-02-14 13:21:57 -08:00
variable_test.go feat(influxd): Tracing refactor (#12318) 2019-03-04 11:48:11 -08:00