Skip to content

Commit

Permalink
ipn/localapi: require only read permission for WatchIPNBus (#7798)
Browse files Browse the repository at this point in the history
Allow calls to `WatchIPNBus` to be permformed by clients with
Readonly permissions. This brings it in line with the permissions
required for `Status`, which also exposes the similar information.

This allows clients to get realtime updates about the tailnet
in their own applications, without needing to actively poll the
`Status` endpoint.

Fixes #7797

Signed-off-by: Dominic Black <dom@encore.dev>
  • Loading branch information
DomBlack committed Jun 4, 2023
1 parent dc1d882 commit 570cb01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipn/localapi/localapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,8 @@ func InUseOtherUserIPNStream(w http.ResponseWriter, r *http.Request, err error)
}

func (h *Handler) serveWatchIPNBus(w http.ResponseWriter, r *http.Request) {
if !h.PermitWrite {
http.Error(w, "denied", http.StatusForbidden)
if !h.PermitRead {
http.Error(w, "watch ipn bus access denied", http.StatusForbidden)
return
}
f, ok := w.(http.Flusher)
Expand Down

0 comments on commit 570cb01

Please sign in to comment.