Add unauthorized boolean the accesslog.#505
Add unauthorized boolean the accesslog.#505htuch merged 7 commits intoenvoyproxy:masterfrom colabsaumoh:access-log
Conversation
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
|
Is this actually better than an error code or an enum? A request can be
denied for many reasons. A boolean field typically leads to a dead ended
design, e.g. impossible to extend. We should avoid using boolean unless the
concept is extremely stable and unlikely to grow for next 10 years.
|
|
@wora fair point. I mentioned previously I was trying to address the feedback in a Envoy PR. |
|
@saumoh please reopen this PR. The original feedback still stands and we need to have parity between the textual access log and gRPC access log. The field doesn't necessarily have to be a boolean in the gRPC world. It could be an enum, etc. Thanks! |
|
@wora It isn't clear to me from your comment how to address the concern that you raised. |
|
@saumoh I think there are 2 options:
I don't really have a very strong opinion either way. |
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
|
@mattklein123 Appreciate the guidance and suggestion(s) on how to address this. |
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
mattklein123
left a comment
There was a problem hiding this comment.
In general this approach looks great to me. I would move forward with a complete PR.
|
|
||
| // Indicates that the request was deemed unauthorized and denied. | ||
| message Unauthorized { | ||
| bool is_unauthorized; |
There was a problem hiding this comment.
This bool seems redundant to me?
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
|
@mattklein123 Thanks for the feedback. I've update the PR. I kept the |
| // Reasons why the request was unauthorized | ||
| enum UnauthorizedType { | ||
| // Default is permitted | ||
| PERMITTED = 0; |
There was a problem hiding this comment.
Should this be under the Unauthorized message below? That way, there is no need to have a permitted default, it can just have for default TYPE_NAME_UNSPECIFIED = 0 as per https://github.com/envoyproxy/data-plane-api/blob/master/STYLE.md?
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
|
|
||
| message Unauthorized { | ||
| // Reasons why the request was unauthorized | ||
| enum UnauthorizedType { |
There was a problem hiding this comment.
I would rename this to Reason (it's already qualified as Unauthorized by the outer scope).
| } | ||
|
|
||
| // Indicates that the request was deemed unauthorized and denied. | ||
| Unauthorized unauthorized_denied = 13; |
There was a problem hiding this comment.
I think maybe unauthorized_details might be a clearer name.
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
|
@htuch Thanks for the comments...indeed the naming you suggested is better! :-) |
Adding support for gRPC access log support for response flag Unauthorized. Here we are adding support for envoyproxy/data-plane-api#505 Risk Level: Low Small optional feature. Testing: Added UT's. Docs Changes: N/A Signed-off-by: Saurabh Mohan <saurabh+github@tigera.io>
Title
In the proxy we've added an
Unauthorizedresponse flag. This PR adds the same to filter access logs.Once this PR is merged it will be possible to set the flag in
source/common/access_log/grpc_access_log_impl.ccSee also, comment in envoyproxy/envoy#2415
cc: @htuch
Signed-off-by: Saurabh Mohan saurabh+github@tigera.io