@@ -590,9 +590,9 @@ func As(ctx context.Context, actor rbac.Subject) context.Context {
590
590
// running the insertFunc. The insertFunc is expected to return the object that
591
591
// was inserted.
592
592
func insert [
593
- ObjectType any ,
594
- ArgumentType any ,
595
- Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
593
+ ObjectType any ,
594
+ ArgumentType any ,
595
+ Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
596
596
](
597
597
logger slog.Logger ,
598
598
authorizer rbac.Authorizer ,
@@ -603,9 +603,9 @@ func insert[
603
603
}
604
604
605
605
func insertWithAction [
606
- ObjectType any ,
607
- ArgumentType any ,
608
- Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
606
+ ObjectType any ,
607
+ ArgumentType any ,
608
+ Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
609
609
](
610
610
logger slog.Logger ,
611
611
authorizer rbac.Authorizer ,
@@ -632,10 +632,10 @@ func insertWithAction[
632
632
}
633
633
634
634
func deleteQ [
635
- ObjectType rbac.Objecter ,
636
- ArgumentType any ,
637
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
638
- Delete func (ctx context.Context , arg ArgumentType ) error ,
635
+ ObjectType rbac.Objecter ,
636
+ ArgumentType any ,
637
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
638
+ Delete func (ctx context.Context , arg ArgumentType ) error ,
639
639
](
640
640
logger slog.Logger ,
641
641
authorizer rbac.Authorizer ,
@@ -647,10 +647,10 @@ func deleteQ[
647
647
}
648
648
649
649
func updateWithReturn [
650
- ObjectType rbac.Objecter ,
651
- ArgumentType any ,
652
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
653
- UpdateQuery func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
650
+ ObjectType rbac.Objecter ,
651
+ ArgumentType any ,
652
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
653
+ UpdateQuery func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
654
654
](
655
655
logger slog.Logger ,
656
656
authorizer rbac.Authorizer ,
@@ -661,10 +661,10 @@ func updateWithReturn[
661
661
}
662
662
663
663
func update [
664
- ObjectType rbac.Objecter ,
665
- ArgumentType any ,
666
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
667
- Exec func (ctx context.Context , arg ArgumentType ) error ,
664
+ ObjectType rbac.Objecter ,
665
+ ArgumentType any ,
666
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
667
+ Exec func (ctx context.Context , arg ArgumentType ) error ,
668
668
](
669
669
logger slog.Logger ,
670
670
authorizer rbac.Authorizer ,
@@ -682,9 +682,9 @@ func update[
682
682
// user cannot read the resource. This is because the resource details are
683
683
// required to run a proper authorization check.
684
684
func fetchWithAction [
685
- ArgumentType any ,
686
- ObjectType rbac.Objecter ,
687
- DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
685
+ ArgumentType any ,
686
+ ObjectType rbac.Objecter ,
687
+ DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
688
688
](
689
689
logger slog.Logger ,
690
690
authorizer rbac.Authorizer ,
@@ -715,9 +715,9 @@ func fetchWithAction[
715
715
}
716
716
717
717
func fetch [
718
- ArgumentType any ,
719
- ObjectType rbac.Objecter ,
720
- DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
718
+ ArgumentType any ,
719
+ ObjectType rbac.Objecter ,
720
+ DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
721
721
](
722
722
logger slog.Logger ,
723
723
authorizer rbac.Authorizer ,
@@ -730,10 +730,10 @@ func fetch[
730
730
// from SQL 'exec' functions which only return an error.
731
731
// See fetchAndQuery for more information.
732
732
func fetchAndExec [
733
- ObjectType rbac.Objecter ,
734
- ArgumentType any ,
735
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
736
- Exec func (ctx context.Context , arg ArgumentType ) error ,
733
+ ObjectType rbac.Objecter ,
734
+ ArgumentType any ,
735
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
736
+ Exec func (ctx context.Context , arg ArgumentType ) error ,
737
737
](
738
738
logger slog.Logger ,
739
739
authorizer rbac.Authorizer ,
@@ -756,10 +756,10 @@ func fetchAndExec[
756
756
// **before** the query runs. The returns from the fetch are only used to
757
757
// assert rbac. The final return of this function comes from the Query function.
758
758
func fetchAndQuery [
759
- ObjectType rbac.Objecter ,
760
- ArgumentType any ,
761
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
762
- Query func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
759
+ ObjectType rbac.Objecter ,
760
+ ArgumentType any ,
761
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
762
+ Query func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
763
763
](
764
764
logger slog.Logger ,
765
765
authorizer rbac.Authorizer ,
@@ -793,9 +793,9 @@ func fetchAndQuery[
793
793
// fetchWithPostFilter is like fetch, but works with lists of objects.
794
794
// SQL filters are much more optimal.
795
795
func fetchWithPostFilter [
796
- ArgumentType any ,
797
- ObjectType rbac.Objecter ,
798
- DatabaseFunc func (ctx context.Context , arg ArgumentType ) ([]ObjectType , error ),
796
+ ArgumentType any ,
797
+ ObjectType rbac.Objecter ,
798
+ DatabaseFunc func (ctx context.Context , arg ArgumentType ) ([]ObjectType , error ),
799
799
](
800
800
authorizer rbac.Authorizer ,
801
801
action policy.Action ,
@@ -3872,7 +3872,13 @@ func (q *querier) InsertUserLink(ctx context.Context, arg database.InsertUserLin
3872
3872
}
3873
3873
3874
3874
func (q * querier ) InsertUserSecret (ctx context.Context , arg database.InsertUserSecretParams ) (database.UserSecret , error ) {
3875
- panic ("not implemented" )
3875
+ return database.UserSecret {}, nil
3876
+
3877
+ //if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceUserObject(arg.UserID)); err != nil {
3878
+ // return database.UserLink{}, err
3879
+ //}
3880
+
3881
+ //return q.db.InsertUserLink(ctx, arg)
3876
3882
}
3877
3883
3878
3884
func (q * querier ) InsertVolumeResourceMonitor (ctx context.Context , arg database.InsertVolumeResourceMonitorParams ) (database.WorkspaceAgentVolumeResourceMonitor , error ) {
0 commit comments