Skip to content

Commit

Permalink
Update tap authz error with doc URL (#3196)
Browse files Browse the repository at this point in the history
When the Tap APIServer's SubjectAccessReview fails, return an error
message pointing the user to: https://linkerd.io/tap-rbac

Depends on linkerd/website#450
Part of #3191

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
  • Loading branch information
siggy authored Aug 6, 2019
1 parent 09fbea7 commit c253805
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controller/tap/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (h *handler) handleTap(w http.ResponseWriter, req *http.Request, p httprout
req.Header[h.groupHeader],
)
if err != nil {
err = fmt.Errorf("SubjectAccessReview failed with: %s", err)
err = fmt.Errorf("tap authorization failed (%s), visit https://linkerd.io/tap-rbac for more information", err)
h.log.Error(err)
renderJSONError(w, err, http.StatusForbidden)
return
Expand Down
2 changes: 1 addition & 1 deletion controller/tap/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestHandleTap(t *testing.T) {
},
code: http.StatusForbidden,
header: http.Header{"Content-Type": []string{"application/json"}},
body: `{"error":"SubjectAccessReview failed with: not authorized to access namespaces.tap.linkerd.io"}`,
body: `{"error":"tap authorization failed (not authorized to access namespaces.tap.linkerd.io), visit https://linkerd.io/tap-rbac for more information"}`,
},
}

Expand Down

0 comments on commit c253805

Please sign in to comment.