Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit60faeb9

Browse files
EmyrkThomasK33
authored andcommitted
chore: reject external auth early (#17712)
1 parentc05a5de commit60faeb9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎coderd/workspaceagents.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,15 @@ func (api *API) workspaceAgentsExternalAuth(rw http.ResponseWriter, r *http.Requ
15801580
return
15811581
}
15821582

1583+
// Pre-check if the caller can read the external auth links for the owner of the
1584+
// workspace. Do this up front because a sql.ErrNoRows is expected if the user is
1585+
// in the flow of authenticating. If no row is present, the auth check is delayed
1586+
// until the user authenticates. It is preferred to reject early.
1587+
if!api.Authorize(r,policy.ActionReadPersonal,rbac.ResourceUserObject(workspace.OwnerID)) {
1588+
httpapi.Forbidden(rw)
1589+
return
1590+
}
1591+
15831592
varpreviousToken*database.ExternalAuthLink
15841593
// handleRetrying will attempt to continually check for a new token
15851594
// if listen is true. This is useful if an error is encountered in the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp