Skip to content

Commit 64e80fb

Browse files
committed
Linting
1 parent cf763cb commit 64e80fb

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

coderd/authzquery/apikey.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
func (q *AuthzQuerier) DeleteAPIKeyByID(ctx context.Context, id string) error {
13-
return delete(q.log, q.auth, q.db.GetAPIKeyByID, q.db.DeleteAPIKeyByID)(ctx, id)
13+
return deleteQ(q.log, q.auth, q.db.GetAPIKeyByID, q.db.DeleteAPIKeyByID)(ctx, id)
1414
}
1515

1616
func (q *AuthzQuerier) GetAPIKeyByID(ctx context.Context, id string) (database.APIKey, error) {

coderd/authzquery/authz.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func insertWithReturn[ObjectType any, ArgumentType any,
9696
}
9797
}
9898

99-
func delete[ObjectType rbac.Objecter, ArgumentType any,
99+
func deleteQ[ObjectType rbac.Objecter, ArgumentType any,
100100
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
101101
Delete func(ctx context.Context, arg ArgumentType) error](
102102
// Arguments

coderd/authzquery/group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
func (q *AuthzQuerier) DeleteGroupByID(ctx context.Context, id uuid.UUID) error {
13-
return delete(q.log, q.auth, q.db.GetGroupByID, q.db.DeleteGroupByID)(ctx, id)
13+
return deleteQ(q.log, q.auth, q.db.GetGroupByID, q.db.DeleteGroupByID)(ctx, id)
1414
}
1515

1616
func (q *AuthzQuerier) DeleteGroupMemberFromGroup(ctx context.Context, arg database.DeleteGroupMemberFromGroupParams) error {

coderd/authzquery/license.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (q *AuthzQuerier) GetLicenseByID(ctx context.Context, id int32) (database.L
3232
}
3333

3434
func (q *AuthzQuerier) DeleteLicense(ctx context.Context, id int32) (int32, error) {
35-
err := delete(q.log, q.auth, q.db.GetLicenseByID, func(ctx context.Context, id int32) error {
35+
err := deleteQ(q.log, q.auth, q.db.GetLicenseByID, func(ctx context.Context, id int32) error {
3636
_, err := q.db.DeleteLicense(ctx, id)
3737
return err
3838
})(ctx, id)

coderd/authzquery/organization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (q *AuthzQuerier) canAssignRoles(ctx context.Context, orgID *uuid.UUID, add
119119
}
120120

121121
if len(removed) > 0 && q.authorizeContext(ctx, rbac.ActionDelete, roleAssign) != nil {
122-
return xerrors.Errorf("not authorized to delete roles")
122+
return xerrors.Errorf("not authorized to deleteQ roles")
123123
}
124124

125125
for _, roleName := range grantedRoles {

coderd/authzquery/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func (q *AuthzQuerier) SoftDeleteTemplateByID(ctx context.Context, id uuid.UUID)
260260
UpdatedAt: database.Now(),
261261
})
262262
}
263-
return delete(q.log, q.auth, q.db.GetTemplateByID, deleteF)(ctx, id)
263+
return deleteQ(q.log, q.auth, q.db.GetTemplateByID, deleteF)(ctx, id)
264264
}
265265

266266
// Deprecated: use SoftDeleteTemplateByID instead.

coderd/authzquery/user.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (q *AuthzQuerier) SoftDeleteUserByID(ctx context.Context, id uuid.UUID) err
122122
Deleted: true,
123123
})
124124
}
125-
return delete(q.log, q.auth, q.db.GetUserByID, deleteF)(ctx, id)
125+
return deleteQ(q.log, q.auth, q.db.GetUserByID, deleteF)(ctx, id)
126126
}
127127

128128
// UpdateUserDeletedByID
@@ -134,7 +134,7 @@ func (q *AuthzQuerier) UpdateUserDeletedByID(ctx context.Context, arg database.U
134134
}
135135
// This uses the rbac.ActionDelete action always as this function should always delete.
136136
// We should delete this function in favor of 'SoftDeleteUserByID'.
137-
return delete(q.log, q.auth, fetch, q.db.UpdateUserDeletedByID)(ctx, arg)
137+
return deleteQ(q.log, q.auth, fetch, q.db.UpdateUserDeletedByID)(ctx, arg)
138138
}
139139

140140
func (q *AuthzQuerier) UpdateUserHashedPassword(ctx context.Context, arg database.UpdateUserHashedPasswordParams) error {
@@ -177,7 +177,7 @@ func (q *AuthzQuerier) UpdateUserStatus(ctx context.Context, arg database.Update
177177
}
178178

179179
func (q *AuthzQuerier) DeleteGitSSHKey(ctx context.Context, userID uuid.UUID) error {
180-
return delete(q.log, q.auth, q.db.GetGitSSHKey, q.db.DeleteGitSSHKey)(ctx, userID)
180+
return deleteQ(q.log, q.auth, q.db.GetGitSSHKey, q.db.DeleteGitSSHKey)(ctx, userID)
181181
}
182182

183183
func (q *AuthzQuerier) GetGitSSHKey(ctx context.Context, userID uuid.UUID) (database.GitSSHKey, error) {

coderd/authzquery/workspace.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func (q *AuthzQuerier) UpdateWorkspaceBuildByID(ctx context.Context, arg databas
421421
}
422422

423423
func (q *AuthzQuerier) SoftDeleteWorkspaceByID(ctx context.Context, id uuid.UUID) error {
424-
return delete(q.log, q.auth, q.db.GetWorkspaceByID, func(ctx context.Context, id uuid.UUID) error {
424+
return deleteQ(q.log, q.auth, q.db.GetWorkspaceByID, func(ctx context.Context, id uuid.UUID) error {
425425
return q.db.UpdateWorkspaceDeletedByID(ctx, database.UpdateWorkspaceDeletedByIDParams{
426426
ID: id,
427427
Deleted: true,
@@ -431,12 +431,12 @@ func (q *AuthzQuerier) SoftDeleteWorkspaceByID(ctx context.Context, id uuid.UUID
431431

432432
// Deprecated: Use SoftDeleteWorkspaceByID
433433
func (q *AuthzQuerier) UpdateWorkspaceDeletedByID(ctx context.Context, arg database.UpdateWorkspaceDeletedByIDParams) error {
434-
// TODO delete me, placeholder for database.Store
434+
// TODO deleteQ me, placeholder for database.Store
435435
fetch := func(ctx context.Context, arg database.UpdateWorkspaceDeletedByIDParams) (database.Workspace, error) {
436436
return q.db.GetWorkspaceByID(ctx, arg.ID)
437437
}
438-
// This function is always used to delete.
439-
return delete(q.log, q.auth, fetch, q.db.UpdateWorkspaceDeletedByID)(ctx, arg)
438+
// This function is always used to deleteQ.
439+
return deleteQ(q.log, q.auth, fetch, q.db.UpdateWorkspaceDeletedByID)(ctx, arg)
440440
}
441441

442442
func (q *AuthzQuerier) UpdateWorkspaceLastUsedAt(ctx context.Context, arg database.UpdateWorkspaceLastUsedAtParams) error {

coderd/coderdtest/authorize.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ func (a *AuthTester) Test(ctx context.Context, assertRoute map[string]RouteCheck
517517
assert.Equal(t, http.StatusForbidden, resp.StatusCode, "expect unauthorized")
518518
}
519519
}
520-
if a.authorizer.LastCall() != nil {
521-
last := a.authorizer.LastCall()
520+
if a.authorizer.lastCall() != nil {
521+
last := a.authorizer.lastCall()
522522
if routeAssertions.AssertAction != "" {
523523
assert.Equal(t, routeAssertions.AssertAction, last.Action, "resource action")
524524
}
@@ -709,9 +709,9 @@ func (f *fakePreparedAuthorizer) CompileToSQL(_ context.Context, _ regosql.Conve
709709
return f.HardCodedSQLString, nil
710710
}
711711

712-
// LastCall is implemented to support legacy tests.
712+
// lastCall is implemented to support legacy tests.
713713
// Deprecated
714-
func (r *RecordingAuthorizer) LastCall() *authCall {
714+
func (r *RecordingAuthorizer) lastCall() *authCall {
715715
r.RLock()
716716
defer r.RUnlock()
717717
if len(r.Called) == 0 {

0 commit comments

Comments
 (0)