Skip to content

Commit 89a75d0

Browse files
committed
fixup! Merge branch 'main' into dean/app-sharing
1 parent 40300a7 commit 89a75d0

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

coderd/httpmw/apikey.go

-1
Original file line numberDiff line numberDiff line change
@@ -427,5 +427,4 @@ func RedirectToLogin(rw http.ResponseWriter, r *http.Request, message string) {
427427
}
428428

429429
http.Redirect(rw, r, u.String(), http.StatusTemporaryRedirect)
430-
return
431430
}

coderd/httpmw/userparam.go

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ func UserParam(r *http.Request) database.User {
3535

3636
// ExtractUserParam extracts a user from an ID/username in the {user} URL
3737
// parameter.
38+
//
39+
//nolint:revive
3840
func ExtractUserParam(db database.Store, redirectToLoginOnMe bool) func(http.Handler) http.Handler {
3941
return func(next http.Handler) http.Handler {
4042
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {

coderd/workspaceapps.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ func (api *API) workspaceAppsProxyPath(rw http.ResponseWriter, r *http.Request)
5858
return
5959
}
6060

61-
AppSharingLevel := database.AppSharingLevelOwner
61+
appSharingLevel := database.AppSharingLevelOwner
6262
if app.SharingLevel != "" {
63-
AppSharingLevel = app.SharingLevel
63+
appSharingLevel = app.SharingLevel
6464
}
65-
authed, ok := api.fetchWorkspaceApplicationAuth(rw, r, workspace, AppSharingLevel)
65+
authed, ok := api.fetchWorkspaceApplicationAuth(rw, r, workspace, appSharingLevel)
6666
if !ok {
6767
return
6868
}
@@ -191,11 +191,11 @@ func (api *API) handleSubdomainApplications(middlewares ...func(http.Handler) ht
191191

192192
// Verify application auth. This function will redirect or
193193
// return an error page if the user doesn't have permission.
194-
SharingLevel := database.AppSharingLevelOwner
194+
sharingLevel := database.AppSharingLevelOwner
195195
if workspaceAppPtr != nil && workspaceAppPtr.SharingLevel != "" {
196-
SharingLevel = workspaceAppPtr.SharingLevel
196+
sharingLevel = workspaceAppPtr.SharingLevel
197197
}
198-
if !api.verifyWorkspaceApplicationSubdomainAuth(rw, r, host, workspace, SharingLevel) {
198+
if !api.verifyWorkspaceApplicationSubdomainAuth(rw, r, host, workspace, sharingLevel) {
199199
return
200200
}
201201

@@ -598,11 +598,11 @@ type proxyApplication struct {
598598
func (api *API) proxyWorkspaceApplication(proxyApp proxyApplication, rw http.ResponseWriter, r *http.Request) {
599599
ctx := r.Context()
600600

601-
SharingLevel := database.AppSharingLevelOwner
601+
sharingLevel := database.AppSharingLevelOwner
602602
if proxyApp.App != nil && proxyApp.App.SharingLevel != "" {
603-
SharingLevel = proxyApp.App.SharingLevel
603+
sharingLevel = proxyApp.App.SharingLevel
604604
}
605-
if !api.checkWorkspaceApplicationAuth(rw, r, proxyApp.Workspace, SharingLevel) {
605+
if !api.checkWorkspaceApplicationAuth(rw, r, proxyApp.Workspace, sharingLevel) {
606606
return
607607
}
608608

enterprise/coderd/workspaceagents_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ func setupWorkspaceAgent(t *testing.T, client *codersdk.Client, user codersdk.Cr
129129
defer cancel()
130130

131131
resources := coderdtest.AwaitWorkspaceAgents(t, client, workspace.ID)
132-
agent, err := client.WorkspaceAgent(ctx, resources[0].Agents[0].ID)
132+
agnt, err := client.WorkspaceAgent(ctx, resources[0].Agents[0].ID)
133133
require.NoError(t, err)
134134

135-
return workspace, agent
135+
return workspace, agnt
136136
}

0 commit comments

Comments
 (0)