Skip to content

Commit c19ae04

Browse files
refactor: make fmt
1 parent 9dccf3e commit c19ae04

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ func As(ctx context.Context, actor rbac.Subject) context.Context {
482482
// running the insertFunc. The insertFunc is expected to return the object that
483483
// was inserted.
484484
func insert[
485-
ObjectType any,
486-
ArgumentType any,
487-
Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
485+
ObjectType any,
486+
ArgumentType any,
487+
Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
488488
](
489489
logger slog.Logger,
490490
authorizer rbac.Authorizer,
@@ -495,9 +495,9 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
495495
}
496496

497497
func insertWithAction[
498-
ObjectType any,
499-
ArgumentType any,
500-
Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
498+
ObjectType any,
499+
ArgumentType any,
500+
Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
501501
](
502502
logger slog.Logger,
503503
authorizer rbac.Authorizer,
@@ -524,10 +524,10 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
524524
}
525525

526526
func deleteQ[
527-
ObjectType rbac.Objecter,
528-
ArgumentType any,
529-
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
530-
Delete func(ctx context.Context, arg ArgumentType) error,
527+
ObjectType rbac.Objecter,
528+
ArgumentType any,
529+
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
530+
Delete func(ctx context.Context, arg ArgumentType) error,
531531
](
532532
logger slog.Logger,
533533
authorizer rbac.Authorizer,
@@ -539,10 +539,10 @@ Delete func(ctx context.Context, arg ArgumentType) error,
539539
}
540540

541541
func updateWithReturn[
542-
ObjectType rbac.Objecter,
543-
ArgumentType any,
544-
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
545-
UpdateQuery func(ctx context.Context, arg ArgumentType) (ObjectType, error),
542+
ObjectType rbac.Objecter,
543+
ArgumentType any,
544+
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
545+
UpdateQuery func(ctx context.Context, arg ArgumentType) (ObjectType, error),
546546
](
547547
logger slog.Logger,
548548
authorizer rbac.Authorizer,
@@ -553,10 +553,10 @@ UpdateQuery func(ctx context.Context, arg ArgumentType) (ObjectType, error),
553553
}
554554

555555
func update[
556-
ObjectType rbac.Objecter,
557-
ArgumentType any,
558-
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
559-
Exec func(ctx context.Context, arg ArgumentType) error,
556+
ObjectType rbac.Objecter,
557+
ArgumentType any,
558+
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
559+
Exec func(ctx context.Context, arg ArgumentType) error,
560560
](
561561
logger slog.Logger,
562562
authorizer rbac.Authorizer,
@@ -574,9 +574,9 @@ Exec func(ctx context.Context, arg ArgumentType) error,
574574
// user cannot read the resource. This is because the resource details are
575575
// required to run a proper authorization check.
576576
func fetchWithAction[
577-
ArgumentType any,
578-
ObjectType rbac.Objecter,
579-
DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
577+
ArgumentType any,
578+
ObjectType rbac.Objecter,
579+
DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
580580
](
581581
logger slog.Logger,
582582
authorizer rbac.Authorizer,
@@ -607,9 +607,9 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
607607
}
608608

609609
func fetch[
610-
ArgumentType any,
611-
ObjectType rbac.Objecter,
612-
DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
610+
ArgumentType any,
611+
ObjectType rbac.Objecter,
612+
DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
613613
](
614614
logger slog.Logger,
615615
authorizer rbac.Authorizer,
@@ -622,10 +622,10 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
622622
// from SQL 'exec' functions which only return an error.
623623
// See fetchAndQuery for more information.
624624
func fetchAndExec[
625-
ObjectType rbac.Objecter,
626-
ArgumentType any,
627-
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
628-
Exec func(ctx context.Context, arg ArgumentType) error,
625+
ObjectType rbac.Objecter,
626+
ArgumentType any,
627+
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
628+
Exec func(ctx context.Context, arg ArgumentType) error,
629629
](
630630
logger slog.Logger,
631631
authorizer rbac.Authorizer,
@@ -648,10 +648,10 @@ Exec func(ctx context.Context, arg ArgumentType) error,
648648
// **before** the query runs. The returns from the fetch are only used to
649649
// assert rbac. The final return of this function comes from the Query function.
650650
func fetchAndQuery[
651-
ObjectType rbac.Objecter,
652-
ArgumentType any,
653-
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
654-
Query func(ctx context.Context, arg ArgumentType) (ObjectType, error),
651+
ObjectType rbac.Objecter,
652+
ArgumentType any,
653+
Fetch func(ctx context.Context, arg ArgumentType) (ObjectType, error),
654+
Query func(ctx context.Context, arg ArgumentType) (ObjectType, error),
655655
](
656656
logger slog.Logger,
657657
authorizer rbac.Authorizer,
@@ -685,9 +685,9 @@ Query func(ctx context.Context, arg ArgumentType) (ObjectType, error),
685685
// fetchWithPostFilter is like fetch, but works with lists of objects.
686686
// SQL filters are much more optimal.
687687
func fetchWithPostFilter[
688-
ArgumentType any,
689-
ObjectType rbac.Objecter,
690-
DatabaseFunc func(ctx context.Context, arg ArgumentType) ([]ObjectType, error),
688+
ArgumentType any,
689+
ObjectType rbac.Objecter,
690+
DatabaseFunc func(ctx context.Context, arg ArgumentType) ([]ObjectType, error),
691691
](
692692
authorizer rbac.Authorizer,
693693
action policy.Action,

0 commit comments

Comments
 (0)