-
Notifications
You must be signed in to change notification settings - Fork 568
/
mock_pachd.go
2395 lines (2245 loc) · 123 KB
/
mock_pachd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package testpachd
import (
"context"
"net"
"runtime"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"github.com/pachyderm/pachyderm/v2/src/admin"
"github.com/pachyderm/pachyderm/v2/src/auth"
"github.com/pachyderm/pachyderm/v2/src/enterprise"
"github.com/pachyderm/pachyderm/v2/src/identity"
authmw "github.com/pachyderm/pachyderm/v2/src/internal/middleware/auth"
"github.com/pachyderm/pachyderm/v2/src/internal/middleware/validation"
"github.com/pachyderm/pachyderm/v2/src/internal/pctx"
"github.com/pachyderm/pachyderm/v2/src/license"
"github.com/pachyderm/pachyderm/v2/src/logs"
"github.com/pachyderm/pachyderm/v2/src/metadata"
"github.com/pachyderm/pachyderm/v2/src/pfs"
"github.com/pachyderm/pachyderm/v2/src/pps"
"github.com/pachyderm/pachyderm/v2/src/proxy"
"github.com/pachyderm/pachyderm/v2/src/storage"
"github.com/pachyderm/pachyderm/v2/src/task"
"github.com/pachyderm/pachyderm/v2/src/transaction"
"github.com/pachyderm/pachyderm/v2/src/internal/errors"
"github.com/pachyderm/pachyderm/v2/src/internal/grpcutil"
errorsmw "github.com/pachyderm/pachyderm/v2/src/internal/middleware/errors"
loggingmw "github.com/pachyderm/pachyderm/v2/src/internal/middleware/logging"
"github.com/pachyderm/pachyderm/v2/src/internal/transactionenv/txncontext"
authserver "github.com/pachyderm/pachyderm/v2/src/server/auth"
version "github.com/pachyderm/pachyderm/v2/src/version/versionpb"
)
/* Admin Server Mocks */
type inspectClusterFunc func(context.Context, *admin.InspectClusterRequest) (*admin.ClusterInfo, error)
type mockInspectCluster struct{ handler inspectClusterFunc }
func (mock *mockInspectCluster) Use(cb inspectClusterFunc) { mock.handler = cb }
type adminServerAPI struct {
admin.UnsafeAPIServer
mock *mockAdminServer
}
type mockAdminServer struct {
api adminServerAPI
InspectCluster mockInspectCluster
}
func (api *adminServerAPI) InspectCluster(ctx context.Context, req *admin.InspectClusterRequest) (*admin.ClusterInfo, error) {
if api.mock.InspectCluster.handler != nil {
return api.mock.InspectCluster.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock admin.InspectCluster")
}
/* Auth Server Mocks */
type activateAuthFunc func(context.Context, *auth.ActivateRequest) (*auth.ActivateResponse, error)
type deactivateAuthFunc func(context.Context, *auth.DeactivateRequest) (*auth.DeactivateResponse, error)
type getConfigurationFunc func(context.Context, *auth.GetConfigurationRequest) (*auth.GetConfigurationResponse, error)
type setConfigurationFunc func(context.Context, *auth.SetConfigurationRequest) (*auth.SetConfigurationResponse, error)
type modifyRoleBindingFunc func(context.Context, *auth.ModifyRoleBindingRequest) (*auth.ModifyRoleBindingResponse, error)
type getRoleBindingFunc func(context.Context, *auth.GetRoleBindingRequest) (*auth.GetRoleBindingResponse, error)
type authenticateFunc func(context.Context, *auth.AuthenticateRequest) (*auth.AuthenticateResponse, error)
type authorizeFunc func(context.Context, *auth.AuthorizeRequest) (*auth.AuthorizeResponse, error)
type getPermissionsFunc func(context.Context, *auth.GetPermissionsRequest) (*auth.GetPermissionsResponse, error)
type getPermissionsForPrincipalFunc func(context.Context, *auth.GetPermissionsForPrincipalRequest) (*auth.GetPermissionsResponse, error)
type whoAmIFunc func(context.Context, *auth.WhoAmIRequest) (*auth.WhoAmIResponse, error)
type getRolesForPermissionFunc func(context.Context, *auth.GetRolesForPermissionRequest) (*auth.GetRolesForPermissionResponse, error)
type getOIDCLoginFunc func(context.Context, *auth.GetOIDCLoginRequest) (*auth.GetOIDCLoginResponse, error)
type getRobotTokenFunc func(context.Context, *auth.GetRobotTokenRequest) (*auth.GetRobotTokenResponse, error)
type revokeAuthTokenFunc func(context.Context, *auth.RevokeAuthTokenRequest) (*auth.RevokeAuthTokenResponse, error)
type revokeAuthTokensForUserFunc func(context.Context, *auth.RevokeAuthTokensForUserRequest) (*auth.RevokeAuthTokensForUserResponse, error)
type setGroupsForUserFunc func(context.Context, *auth.SetGroupsForUserRequest) (*auth.SetGroupsForUserResponse, error)
type modifyMembersFunc func(context.Context, *auth.ModifyMembersRequest) (*auth.ModifyMembersResponse, error)
type getGroupsFunc func(context.Context, *auth.GetGroupsRequest) (*auth.GetGroupsResponse, error)
type getGroupsForPrincipalFunc func(context.Context, *auth.GetGroupsForPrincipalRequest) (*auth.GetGroupsResponse, error)
type getUsersFunc func(context.Context, *auth.GetUsersRequest) (*auth.GetUsersResponse, error)
type extractAuthTokensFunc func(context.Context, *auth.ExtractAuthTokensRequest) (*auth.ExtractAuthTokensResponse, error)
type restoreAuthTokenFunc func(context.Context, *auth.RestoreAuthTokenRequest) (*auth.RestoreAuthTokenResponse, error)
type deleteExpiredAuthTokensFunc func(context.Context, *auth.DeleteExpiredAuthTokensRequest) (*auth.DeleteExpiredAuthTokensResponse, error)
type RotateRootTokenFunc func(context.Context, *auth.RotateRootTokenRequest) (*auth.RotateRootTokenResponse, error)
type checkClusterIsAuthorizedFunc func(context.Context, ...auth.Permission) error
type checkProjectIsAuthorizedFunc func(context.Context, *pfs.Project, ...auth.Permission) error
type checkRepoIsAuthorizedFunc func(context.Context, *pfs.Repo, ...auth.Permission) error
type checkClusterIsAuthorizedInTransactionFunc func(context.Context, *txncontext.TransactionContext, ...auth.Permission) error
type checkProjectIsAuthorizedInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pfs.Project, ...auth.Permission) error
type checkRepoIsAuthorizedInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pfs.Repo, ...auth.Permission) error
type authorizeInTransactionFunc func(context.Context, *txncontext.TransactionContext, *auth.AuthorizeRequest) (*auth.AuthorizeResponse, error)
type modifyRoleBindingInTransactionFunc func(context.Context, *txncontext.TransactionContext, *auth.ModifyRoleBindingRequest) (*auth.ModifyRoleBindingResponse, error)
type getRoleBindingInTransactionFunc func(context.Context, *txncontext.TransactionContext, *auth.GetRoleBindingRequest) (*auth.GetRoleBindingResponse, error)
type addPipelineReaderToRepoInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pfs.Repo, *pps.Pipeline) error
type addPipelineWriterToRepoInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pps.Pipeline) error
type addPipelineWriterToSourceRepoInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pfs.Repo, *pps.Pipeline) error
type removePipelineReaderFromRepoInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pfs.Repo, *pps.Pipeline) error
type createRoleBindingInTransactionFunc func(context.Context, *txncontext.TransactionContext, string, []string, *auth.Resource) error
type deleteRoleBindingInTransactionFunc func(context.Context, *txncontext.TransactionContext, *auth.Resource) error
type getPipelineAuthTokenInTransactionFunc func(context.Context, *txncontext.TransactionContext, *pps.Pipeline) (string, error)
type revokeAuthTokenInTransactionFunc func(context.Context, *txncontext.TransactionContext, *auth.RevokeAuthTokenRequest) (*auth.RevokeAuthTokenResponse, error)
type getPermissionsInTransactionFunc func(context.Context, *txncontext.TransactionContext, *auth.GetPermissionsRequest) (*auth.GetPermissionsResponse, error)
type mockActivateAuth struct{ handler activateAuthFunc }
type mockDeactivateAuth struct{ handler deactivateAuthFunc }
type mockGetConfiguration struct{ handler getConfigurationFunc }
type mockSetConfiguration struct{ handler setConfigurationFunc }
type mockModifyRoleBinding struct{ handler modifyRoleBindingFunc }
type mockGetRoleBinding struct{ handler getRoleBindingFunc }
type mockAuthenticate struct{ handler authenticateFunc }
type mockAuthorize struct{ handler authorizeFunc }
type mockGetPermissions struct{ handler getPermissionsFunc }
type mockGetPermissionsForPrincipal struct {
handler getPermissionsForPrincipalFunc
}
type mockWhoAmI struct{ handler whoAmIFunc }
type mockGetRolesForPermission struct{ handler getRolesForPermissionFunc }
type mockGetOIDCLogin struct{ handler getOIDCLoginFunc }
type mockGetRobotToken struct{ handler getRobotTokenFunc }
type mockRevokeAuthToken struct{ handler revokeAuthTokenFunc }
type mockRevokeAuthTokensForUser struct{ handler revokeAuthTokensForUserFunc }
type mockSetGroupsForUser struct{ handler setGroupsForUserFunc }
type mockModifyMembers struct{ handler modifyMembersFunc }
type mockGetGroups struct{ handler getGroupsFunc }
type mockGetGroupsForPrincipal struct{ handler getGroupsForPrincipalFunc }
type mockGetUsers struct{ handler getUsersFunc }
type mockExtractAuthTokens struct{ handler extractAuthTokensFunc }
type mockRestoreAuthToken struct{ handler restoreAuthTokenFunc }
type mockDeleteExpiredAuthTokens struct{ handler deleteExpiredAuthTokensFunc }
type mockRotateRootToken struct{ handler RotateRootTokenFunc }
type mockCheckClusterIsAuthorized struct {
handler checkClusterIsAuthorizedFunc
}
type mockCheckRepoIsAuthorized struct {
handler checkRepoIsAuthorizedFunc
}
type mockCheckProjectIsAuthorized struct {
handler checkProjectIsAuthorizedFunc
}
type mockCheckClusterIsAuthorizedInTransaction struct {
handler checkClusterIsAuthorizedInTransactionFunc
}
type mockCheckProjectIsAuthorizedInTransaction struct {
handler checkProjectIsAuthorizedInTransactionFunc
}
type mockCheckRepoIsAuthorizedInTransaction struct {
handler checkRepoIsAuthorizedInTransactionFunc
}
type mockAuthorizeInTransaction struct {
handler authorizeInTransactionFunc
}
type mockModifyRoleBindingInTransaction struct {
handler modifyRoleBindingInTransactionFunc
}
type mockGetRoleBindingInTransaction struct {
handler getRoleBindingInTransactionFunc
}
type mockAddPipelineReaderToRepoInTransaction struct {
handler addPipelineReaderToRepoInTransactionFunc
}
type mockAddPipelineWriterToRepoInTransaction struct {
handler addPipelineWriterToRepoInTransactionFunc
}
type mockAddPipelineWriterToSourceRepoInTransaction struct {
handler addPipelineWriterToSourceRepoInTransactionFunc
}
type mockRemovePipelineReaderFromRepoInTransaction struct {
handler removePipelineReaderFromRepoInTransactionFunc
}
type mockCreateRoleBindingInTransaction struct {
handler createRoleBindingInTransactionFunc
}
type mockDeleteRoleBindingInTransaction struct {
handler deleteRoleBindingInTransactionFunc
}
type mockGetPipelineAuthTokenInTransaction struct {
handler getPipelineAuthTokenInTransactionFunc
}
type mockRevokeAuthTokenInTransaction struct {
handler revokeAuthTokenInTransactionFunc
}
type mockGetPermissionsInTransaction struct {
handler getPermissionsInTransactionFunc
}
func (mock *mockActivateAuth) Use(cb activateAuthFunc) { mock.handler = cb }
func (mock *mockDeactivateAuth) Use(cb deactivateAuthFunc) { mock.handler = cb }
func (mock *mockGetConfiguration) Use(cb getConfigurationFunc) { mock.handler = cb }
func (mock *mockSetConfiguration) Use(cb setConfigurationFunc) { mock.handler = cb }
func (mock *mockModifyRoleBinding) Use(cb modifyRoleBindingFunc) { mock.handler = cb }
func (mock *mockGetRoleBinding) Use(cb getRoleBindingFunc) { mock.handler = cb }
func (mock *mockAuthenticate) Use(cb authenticateFunc) { mock.handler = cb }
func (mock *mockAuthorize) Use(cb authorizeFunc) { mock.handler = cb }
func (mock *mockWhoAmI) Use(cb whoAmIFunc) { mock.handler = cb }
func (mock *mockGetRolesForPermission) Use(cb getRolesForPermissionFunc) { mock.handler = cb }
func (mock *mockGetOIDCLogin) Use(cb getOIDCLoginFunc) { mock.handler = cb }
func (mock *mockGetRobotToken) Use(cb getRobotTokenFunc) { mock.handler = cb }
func (mock *mockRevokeAuthToken) Use(cb revokeAuthTokenFunc) { mock.handler = cb }
func (mock *mockRevokeAuthTokensForUser) Use(cb revokeAuthTokensForUserFunc) { mock.handler = cb }
func (mock *mockSetGroupsForUser) Use(cb setGroupsForUserFunc) { mock.handler = cb }
func (mock *mockModifyMembers) Use(cb modifyMembersFunc) { mock.handler = cb }
func (mock *mockGetGroups) Use(cb getGroupsFunc) { mock.handler = cb }
func (mock *mockGetGroupsForPrincipal) Use(cb getGroupsForPrincipalFunc) { mock.handler = cb }
func (mock *mockGetPermissions) Use(cb getPermissionsFunc) { mock.handler = cb }
func (mock *mockGetPermissionsForPrincipal) Use(cb getPermissionsForPrincipalFunc) { mock.handler = cb }
func (mock *mockGetUsers) Use(cb getUsersFunc) { mock.handler = cb }
func (mock *mockExtractAuthTokens) Use(cb extractAuthTokensFunc) { mock.handler = cb }
func (mock *mockRestoreAuthToken) Use(cb restoreAuthTokenFunc) { mock.handler = cb }
func (mock *mockDeleteExpiredAuthTokens) Use(cb deleteExpiredAuthTokensFunc) { mock.handler = cb }
func (mock *mockRotateRootToken) Use(cb RotateRootTokenFunc) { mock.handler = cb }
func (mock *mockCheckClusterIsAuthorized) Use(cb checkClusterIsAuthorizedFunc) {
mock.handler = cb
}
func (mock *mockCheckProjectIsAuthorized) Use(cb checkProjectIsAuthorizedFunc) {
mock.handler = cb
}
func (mock *mockCheckRepoIsAuthorized) Use(cb checkRepoIsAuthorizedFunc) {
mock.handler = cb
}
func (mock *mockCheckClusterIsAuthorizedInTransaction) Use(cb checkClusterIsAuthorizedInTransactionFunc) {
mock.handler = cb
}
func (mock *mockCheckProjectIsAuthorizedInTransaction) Use(cb checkProjectIsAuthorizedInTransactionFunc) {
mock.handler = cb
}
func (mock *mockCheckRepoIsAuthorizedInTransaction) Use(cb checkRepoIsAuthorizedInTransactionFunc) {
mock.handler = cb
}
func (mock *mockAuthorizeInTransaction) Use(cb authorizeInTransactionFunc) {
mock.handler = cb
}
func (mock *mockModifyRoleBindingInTransaction) Use(cb modifyRoleBindingInTransactionFunc) {
mock.handler = cb
}
func (mock *mockGetRoleBindingInTransaction) Use(cb getRoleBindingInTransactionFunc) {
mock.handler = cb
}
func (mock *mockAddPipelineReaderToRepoInTransaction) Use(cb addPipelineReaderToRepoInTransactionFunc) {
mock.handler = cb
}
func (mock *mockAddPipelineWriterToRepoInTransaction) Use(cb addPipelineWriterToRepoInTransactionFunc) {
mock.handler = cb
}
func (mock *mockAddPipelineWriterToSourceRepoInTransaction) Use(cb addPipelineWriterToSourceRepoInTransactionFunc) {
mock.handler = cb
}
func (mock *mockRemovePipelineReaderFromRepoInTransaction) Use(cb removePipelineReaderFromRepoInTransactionFunc) {
mock.handler = cb
}
func (mock *mockCreateRoleBindingInTransaction) Use(cb createRoleBindingInTransactionFunc) {
mock.handler = cb
}
func (mock *mockDeleteRoleBindingInTransaction) Use(cb deleteRoleBindingInTransactionFunc) {
mock.handler = cb
}
func (mock *mockGetPipelineAuthTokenInTransaction) Use(cb getPipelineAuthTokenInTransactionFunc) {
mock.handler = cb
}
func (mock *mockRevokeAuthTokenInTransaction) Use(cb revokeAuthTokenInTransactionFunc) {
mock.handler = cb
}
func (mock *mockGetPermissionsInTransaction) Use(cb getPermissionsInTransactionFunc) {
mock.handler = cb
}
type authServerAPI struct {
auth.UnsafeAPIServer
mock *mockAuthServer
}
type mockAuthServer struct {
api authServerAPI
Activate mockActivateAuth
Deactivate mockDeactivateAuth
GetConfiguration mockGetConfiguration
SetConfiguration mockSetConfiguration
ModifyRoleBinding mockModifyRoleBinding
GetRoleBinding mockGetRoleBinding
Authenticate mockAuthenticate
Authorize mockAuthorize
GetPermissions mockGetPermissions
GetPermissionsForPrincipal mockGetPermissionsForPrincipal
WhoAmI mockWhoAmI
GetRolesForPermission mockGetRolesForPermission
GetOIDCLogin mockGetOIDCLogin
GetRobotToken mockGetRobotToken
RevokeAuthToken mockRevokeAuthToken
RevokeAuthTokensForUser mockRevokeAuthTokensForUser
SetGroupsForUser mockSetGroupsForUser
ModifyMembers mockModifyMembers
GetGroups mockGetGroups
GetGroupsForPrincipal mockGetGroupsForPrincipal
GetUsers mockGetUsers
ExtractAuthTokens mockExtractAuthTokens
RestoreAuthToken mockRestoreAuthToken
DeleteExpiredAuthTokens mockDeleteExpiredAuthTokens
RotateRootToken mockRotateRootToken
CheckClusterIsAuthorized mockCheckClusterIsAuthorized
CheckProjectIsAuthorized mockCheckProjectIsAuthorized
CheckRepoIsAuthorized mockCheckRepoIsAuthorized
CheckClusterIsAuthorizedInTransaction mockCheckClusterIsAuthorizedInTransaction
CheckProjectIsAuthorizedInTransaction mockCheckProjectIsAuthorizedInTransaction
CheckRepoIsAuthorizedInTransaction mockCheckRepoIsAuthorizedInTransaction
AuthorizeInTransaction mockAuthorizeInTransaction
ModifyRoleBindingInTransaction mockModifyRoleBindingInTransaction
GetRoleBindingInTransaction mockGetRoleBindingInTransaction
AddPipelineReaderToRepoInTransaction mockAddPipelineReaderToRepoInTransaction
AddPipelineWriterToRepoInTransaction mockAddPipelineWriterToRepoInTransaction
AddPipelineWriterToSourceRepoInTransaction mockAddPipelineWriterToSourceRepoInTransaction
RemovePipelineReaderFromRepoInTransaction mockRemovePipelineReaderFromRepoInTransaction
CreateRoleBindingInTransaction mockCreateRoleBindingInTransaction
DeleteRoleBindingInTransaction mockDeleteRoleBindingInTransaction
GetPipelineAuthTokenInTransaction mockGetPipelineAuthTokenInTransaction
RevokeAuthTokenInTransaction mockRevokeAuthTokenInTransaction
GetPermissionsInTransaction mockGetPermissionsInTransaction
}
func (api *authServerAPI) Activate(ctx context.Context, req *auth.ActivateRequest) (*auth.ActivateResponse, error) {
if api.mock.Activate.handler != nil {
return api.mock.Activate.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.Activate")
}
func (api *authServerAPI) Deactivate(ctx context.Context, req *auth.DeactivateRequest) (*auth.DeactivateResponse, error) {
if api.mock.Deactivate.handler != nil {
return api.mock.Deactivate.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.Deactivate")
}
func (api *authServerAPI) GetConfiguration(ctx context.Context, req *auth.GetConfigurationRequest) (*auth.GetConfigurationResponse, error) {
if api.mock.GetConfiguration.handler != nil {
return api.mock.GetConfiguration.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetConfiguration")
}
func (api *authServerAPI) SetConfiguration(ctx context.Context, req *auth.SetConfigurationRequest) (*auth.SetConfigurationResponse, error) {
if api.mock.SetConfiguration.handler != nil {
return api.mock.SetConfiguration.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.SetConfiguration")
}
func (api *authServerAPI) GetRoleBinding(ctx context.Context, req *auth.GetRoleBindingRequest) (*auth.GetRoleBindingResponse, error) {
if api.mock.GetRoleBinding.handler != nil {
return api.mock.GetRoleBinding.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetRoleBinding")
}
func (api *authServerAPI) ModifyRoleBinding(ctx context.Context, req *auth.ModifyRoleBindingRequest) (*auth.ModifyRoleBindingResponse, error) {
if api.mock.ModifyRoleBinding.handler != nil {
return api.mock.ModifyRoleBinding.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.ModifyRoleBinding")
}
func (api *authServerAPI) Authenticate(ctx context.Context, req *auth.AuthenticateRequest) (*auth.AuthenticateResponse, error) {
if api.mock.Authenticate.handler != nil {
return api.mock.Authenticate.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.Authenticate")
}
func (api *authServerAPI) GetPermissions(ctx context.Context, req *auth.GetPermissionsRequest) (*auth.GetPermissionsResponse, error) {
if api.mock.GetPermissions.handler != nil {
return api.mock.GetPermissions.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetPermissions")
}
func (api *authServerAPI) GetPermissionsForPrincipal(ctx context.Context, req *auth.GetPermissionsForPrincipalRequest) (*auth.GetPermissionsResponse, error) {
if api.mock.GetPermissionsForPrincipal.handler != nil {
return api.mock.GetPermissionsForPrincipal.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetPermissions")
}
func (api *authServerAPI) Authorize(ctx context.Context, req *auth.AuthorizeRequest) (*auth.AuthorizeResponse, error) {
if api.mock.Authorize.handler != nil {
return api.mock.Authorize.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.Authorize")
}
func (api *authServerAPI) WhoAmI(ctx context.Context, req *auth.WhoAmIRequest) (*auth.WhoAmIResponse, error) {
if api.mock.WhoAmI.handler != nil {
return api.mock.WhoAmI.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.WhoAmI")
}
func (api *authServerAPI) GetRolesForPermission(ctx context.Context, req *auth.GetRolesForPermissionRequest) (*auth.GetRolesForPermissionResponse, error) {
if api.mock.GetRolesForPermission.handler != nil {
return api.mock.GetRolesForPermission.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetRolesForPermission")
}
func (api *authServerAPI) GetOIDCLogin(ctx context.Context, req *auth.GetOIDCLoginRequest) (*auth.GetOIDCLoginResponse, error) {
if api.mock.GetOIDCLogin.handler != nil {
return api.mock.GetOIDCLogin.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetOIDCLogin")
}
func (api *authServerAPI) GetRobotToken(ctx context.Context, req *auth.GetRobotTokenRequest) (*auth.GetRobotTokenResponse, error) {
if api.mock.GetRobotToken.handler != nil {
return api.mock.GetRobotToken.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetRobotToken")
}
func (api *authServerAPI) RevokeAuthToken(ctx context.Context, req *auth.RevokeAuthTokenRequest) (*auth.RevokeAuthTokenResponse, error) {
if api.mock.RevokeAuthToken.handler != nil {
return api.mock.RevokeAuthToken.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.RevokeAuthToken")
}
func (api *authServerAPI) RevokeAuthTokensForUser(ctx context.Context, req *auth.RevokeAuthTokensForUserRequest) (*auth.RevokeAuthTokensForUserResponse, error) {
if api.mock.RevokeAuthTokensForUser.handler != nil {
return api.mock.RevokeAuthTokensForUser.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.RevokeAuthTokensForUser")
}
func (api *authServerAPI) SetGroupsForUser(ctx context.Context, req *auth.SetGroupsForUserRequest) (*auth.SetGroupsForUserResponse, error) {
if api.mock.SetGroupsForUser.handler != nil {
return api.mock.SetGroupsForUser.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.SetGroupsForUser")
}
func (api *authServerAPI) ModifyMembers(ctx context.Context, req *auth.ModifyMembersRequest) (*auth.ModifyMembersResponse, error) {
if api.mock.ModifyMembers.handler != nil {
return api.mock.ModifyMembers.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.ModifyMembers")
}
func (api *authServerAPI) GetGroups(ctx context.Context, req *auth.GetGroupsRequest) (*auth.GetGroupsResponse, error) {
if api.mock.GetGroups.handler != nil {
return api.mock.GetGroups.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetGroups")
}
func (api *authServerAPI) GetGroupsForPrincipal(ctx context.Context, req *auth.GetGroupsForPrincipalRequest) (*auth.GetGroupsResponse, error) {
if api.mock.GetGroupsForPrincipal.handler != nil {
return api.mock.GetGroupsForPrincipal.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetGroupsForPrincipal")
}
func (api *authServerAPI) GetUsers(ctx context.Context, req *auth.GetUsersRequest) (*auth.GetUsersResponse, error) {
if api.mock.GetUsers.handler != nil {
return api.mock.GetUsers.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetUsers")
}
func (api *authServerAPI) ExtractAuthTokens(ctx context.Context, req *auth.ExtractAuthTokensRequest) (*auth.ExtractAuthTokensResponse, error) {
if api.mock.ExtractAuthTokens.handler != nil {
return api.mock.ExtractAuthTokens.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.ExtractAuthTokens")
}
func (api *authServerAPI) RestoreAuthToken(ctx context.Context, req *auth.RestoreAuthTokenRequest) (*auth.RestoreAuthTokenResponse, error) {
if api.mock.RestoreAuthToken.handler != nil {
return api.mock.RestoreAuthToken.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.RestoreAuthToken")
}
func (api *authServerAPI) DeleteExpiredAuthTokens(ctx context.Context, req *auth.DeleteExpiredAuthTokensRequest) (*auth.DeleteExpiredAuthTokensResponse, error) {
if api.mock.DeleteExpiredAuthTokens.handler != nil {
return api.mock.DeleteExpiredAuthTokens.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.DeleteExpiredAuthTokens")
}
func (api *authServerAPI) RotateRootToken(ctx context.Context, req *auth.RotateRootTokenRequest) (*auth.RotateRootTokenResponse, error) {
if api.mock.RotateRootToken.handler != nil {
return api.mock.RotateRootToken.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock auth.RotateRootToken")
}
func (api *authServerAPI) CheckClusterIsAuthorized(ctx context.Context, p ...auth.Permission) error {
if api.mock.CheckClusterIsAuthorized.handler != nil {
return api.mock.CheckClusterIsAuthorized.handler(ctx, p...)
}
return errors.Errorf("unhandled pachd mock auth.CheckClusterIsAuthorized")
}
func (api *authServerAPI) CheckProjectIsAuthorized(ctx context.Context, project *pfs.Project, permission ...auth.Permission) error {
if api.mock.CheckProjectIsAuthorized.handler != nil {
return api.mock.CheckProjectIsAuthorized.handler(ctx, project, permission...)
}
return errors.Errorf("unhandled pachd mock auth.CheckProjectIsAuthorized")
}
func (api *authServerAPI) CheckRepoIsAuthorized(ctx context.Context, repo *pfs.Repo, permission ...auth.Permission) error {
if api.mock.CheckRepoIsAuthorized.handler != nil {
return api.mock.CheckRepoIsAuthorized.handler(ctx, repo, permission...)
}
return errors.Errorf("unhandled pachd mock auth.CheckRepoIsAuthorized")
}
func (api *authServerAPI) CheckClusterIsAuthorizedInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, permission ...auth.Permission) error {
if api.mock.CheckClusterIsAuthorizedInTransaction.handler != nil {
return api.mock.CheckClusterIsAuthorizedInTransaction.handler(ctx, transactionContext, permission...)
}
return errors.Errorf("unhandled pachd mock auth.CheckClusterIsAuthorizedInTransaction")
}
func (api *authServerAPI) CheckRepoIsAuthorizedInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, repo *pfs.Repo, permission ...auth.Permission) error {
if api.mock.CheckRepoIsAuthorizedInTransaction.handler != nil {
return api.mock.CheckRepoIsAuthorizedInTransaction.handler(ctx, transactionContext, repo, permission...)
}
return errors.Errorf("unhandled pachd mock auth.CheckRepoIsAuthorizedInTransaction")
}
func (api *authServerAPI) CheckProjectIsAuthorizedInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, project *pfs.Project, permission ...auth.Permission) error {
if api.mock.CheckProjectIsAuthorizedInTransaction.handler != nil {
return api.mock.CheckProjectIsAuthorizedInTransaction.handler(ctx, transactionContext, project, permission...)
}
return errors.Errorf("unhandled pachd mock auth.CheckProjectIsAuthorizedInTransaction")
}
func (api *authServerAPI) AuthorizeInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, request *auth.AuthorizeRequest) (*auth.AuthorizeResponse, error) {
if api.mock.AuthorizeInTransaction.handler != nil {
return api.mock.AuthorizeInTransaction.handler(ctx, transactionContext, request)
}
return nil, errors.Errorf("unhandled pachd mock auth.AuthorizeInTransaction")
}
func (api *authServerAPI) ModifyRoleBindingInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, request *auth.ModifyRoleBindingRequest) (*auth.ModifyRoleBindingResponse, error) {
if api.mock.ModifyRoleBindingInTransaction.handler != nil {
return api.mock.ModifyRoleBindingInTransaction.handler(ctx, transactionContext, request)
}
return nil, errors.Errorf("unhandled pachd mock auth.ModifyRoleBindingInTransaction")
}
func (api *authServerAPI) GetRoleBindingInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, request *auth.GetRoleBindingRequest) (*auth.GetRoleBindingResponse, error) {
if api.mock.GetRoleBindingInTransaction.handler != nil {
return api.mock.GetRoleBindingInTransaction.handler(ctx, transactionContext, request)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetRoleBindingInTransaction")
}
func (api *authServerAPI) AddPipelineReaderToRepoInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, r *pfs.Repo, p *pps.Pipeline) error {
if api.mock.AddPipelineReaderToRepoInTransaction.handler != nil {
return api.mock.AddPipelineReaderToRepoInTransaction.handler(ctx, transactionContext, r, p)
}
return errors.Errorf("unhandled pachd mock auth.AddPipelineReaderToRepoInTransaction")
}
func (api *authServerAPI) AddPipelineWriterToRepoInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, p *pps.Pipeline) error {
if api.mock.AddPipelineWriterToRepoInTransaction.handler != nil {
return api.mock.AddPipelineWriterToRepoInTransaction.handler(ctx, transactionContext, p)
}
return errors.Errorf("unhandled pachd mock auth.AddPipelineWriterToRepoInTransaction")
}
func (api *authServerAPI) AddPipelineWriterToSourceRepoInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, r *pfs.Repo, p *pps.Pipeline) error {
if api.mock.AddPipelineWriterToSourceRepoInTransaction.handler != nil {
return api.mock.AddPipelineWriterToSourceRepoInTransaction.handler(ctx, transactionContext, r, p)
}
return errors.Errorf("unhandled pachd mock auth.AddPipelineWriterToSourceRepoInTransaction")
}
func (api *authServerAPI) RemovePipelineReaderFromRepoInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, r *pfs.Repo, p *pps.Pipeline) error {
if api.mock.RemovePipelineReaderFromRepoInTransaction.handler != nil {
return api.mock.RemovePipelineReaderFromRepoInTransaction.handler(ctx, transactionContext, r, p)
}
return errors.Errorf("unhandled pachd mock auth.RemovePipelineReaderFromRepoInTransaction")
}
func (api *authServerAPI) CreateRoleBindingInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, s string, strings []string, resource *auth.Resource) error {
if api.mock.CreateRoleBindingInTransaction.handler != nil {
return api.mock.CreateRoleBindingInTransaction.handler(ctx, transactionContext, s, strings, resource)
}
return errors.Errorf("unhandled pachd mock auth.CreateRoleBindingInTransaction")
}
func (api *authServerAPI) DeleteRoleBindingInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, resource *auth.Resource) error {
if api.mock.DeleteRoleBindingInTransaction.handler != nil {
return api.mock.DeleteRoleBindingInTransaction.handler(ctx, transactionContext, resource)
}
return errors.Errorf("unhandled pachd mock auth.DeleteRoleBindingInTransaction")
}
func (api *authServerAPI) GetPipelineAuthTokenInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, p *pps.Pipeline) (string, error) {
if api.mock.GetPipelineAuthTokenInTransaction.handler != nil {
return api.mock.GetPipelineAuthTokenInTransaction.handler(ctx, transactionContext, p)
}
return "", errors.Errorf("unhandled pachd mock auth.GetPipelineAuthTokenInTransaction")
}
func (api *authServerAPI) RevokeAuthTokenInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, request *auth.RevokeAuthTokenRequest) (*auth.RevokeAuthTokenResponse, error) {
if api.mock.RevokeAuthTokenInTransaction.handler != nil {
return api.mock.RevokeAuthTokenInTransaction.handler(ctx, transactionContext, request)
}
return nil, errors.Errorf("unhandled pachd mock auth.RevokeAuthTokenInTransaction")
}
func (api *authServerAPI) GetPermissionsInTransaction(ctx context.Context, transactionContext *txncontext.TransactionContext, request *auth.GetPermissionsRequest) (*auth.GetPermissionsResponse, error) {
if api.mock.GetPermissionsInTransaction.handler != nil {
return api.mock.GetPermissionsInTransaction.handler(ctx, transactionContext, request)
}
return nil, errors.Errorf("unhandled pachd mock auth.GetPermissionsInTransaction")
}
/* License Server Mocks */
type activateLicenseFunc func(context.Context, *license.ActivateRequest) (*license.ActivateResponse, error)
type getActivationCodeLicenseFunc func(context.Context, *license.GetActivationCodeRequest) (*license.GetActivationCodeResponse, error)
type deleteAllLicenseFunc func(context.Context, *license.DeleteAllRequest) (*license.DeleteAllResponse, error)
type addClusterFunc func(context.Context, *license.AddClusterRequest) (*license.AddClusterResponse, error)
type deleteClusterFunc func(context.Context, *license.DeleteClusterRequest) (*license.DeleteClusterResponse, error)
type listClustersFunc func(context.Context, *license.ListClustersRequest) (*license.ListClustersResponse, error)
type updateClusterFunc func(context.Context, *license.UpdateClusterRequest) (*license.UpdateClusterResponse, error)
type heartbeatLicenseFunc func(context.Context, *license.HeartbeatRequest) (*license.HeartbeatResponse, error)
type listUserClustersFunc func(context.Context, *license.ListUserClustersRequest) (*license.ListUserClustersResponse, error)
type mockActivateLicense struct{ handler activateLicenseFunc }
type mockGetActivationCodeLicense struct{ handler getActivationCodeLicenseFunc }
type mockDeleteAllLicense struct{ handler deleteAllLicenseFunc }
type mockAddCluster struct{ handler addClusterFunc }
type mockDeleteCluster struct{ handler deleteClusterFunc }
type mockListClusters struct{ handler listClustersFunc }
type mockUpdateCluster struct{ handler updateClusterFunc }
type mockHeartbeatLicense struct{ handler heartbeatLicenseFunc }
type mockListUserClusters struct{ handler listUserClustersFunc }
func (mock *mockActivateLicense) Use(cb activateLicenseFunc) { mock.handler = cb }
func (mock *mockGetActivationCodeLicense) Use(cb getActivationCodeLicenseFunc) { mock.handler = cb }
func (mock *mockDeleteAllLicense) Use(cb deleteAllLicenseFunc) { mock.handler = cb }
func (mock *mockAddCluster) Use(cb addClusterFunc) { mock.handler = cb }
func (mock *mockDeleteCluster) Use(cb deleteClusterFunc) { mock.handler = cb }
func (mock *mockListClusters) Use(cb listClustersFunc) { mock.handler = cb }
func (mock *mockUpdateCluster) Use(cb updateClusterFunc) { mock.handler = cb }
func (mock *mockHeartbeatLicense) Use(cb heartbeatLicenseFunc) { mock.handler = cb }
func (mock *mockListUserClusters) Use(cb listUserClustersFunc) { mock.handler = cb }
type licenseServerAPI struct {
license.UnsafeAPIServer
mock *mockLicenseServer
}
type mockLicenseServer struct {
api licenseServerAPI
Activate mockActivateLicense
GetActivationCode mockGetActivationCodeLicense
DeleteAll mockDeleteAllLicense
AddCluster mockAddCluster
DeleteCluster mockDeleteCluster
ListClusters mockListClusters
UpdateCluster mockUpdateCluster
Heartbeat mockHeartbeatLicense
ListUserClusters mockListUserClusters
}
func (api *licenseServerAPI) Activate(ctx context.Context, req *license.ActivateRequest) (*license.ActivateResponse, error) {
if api.mock.Activate.handler != nil {
return api.mock.Activate.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.Activate")
}
func (api *licenseServerAPI) GetActivationCode(ctx context.Context, req *license.GetActivationCodeRequest) (*license.GetActivationCodeResponse, error) {
if api.mock.GetActivationCode.handler != nil {
return api.mock.GetActivationCode.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.GetActivationCode")
}
func (api *licenseServerAPI) DeleteAll(ctx context.Context, req *license.DeleteAllRequest) (*license.DeleteAllResponse, error) {
if api.mock.DeleteAll.handler != nil {
return api.mock.DeleteAll.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.Activate")
}
func (api *licenseServerAPI) AddCluster(ctx context.Context, req *license.AddClusterRequest) (*license.AddClusterResponse, error) {
if api.mock.AddCluster.handler != nil {
return api.mock.AddCluster.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.AddCluster")
}
func (api *licenseServerAPI) DeleteCluster(ctx context.Context, req *license.DeleteClusterRequest) (*license.DeleteClusterResponse, error) {
if api.mock.DeleteCluster.handler != nil {
return api.mock.DeleteCluster.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.DeleteCluster")
}
func (api *licenseServerAPI) ListClusters(ctx context.Context, req *license.ListClustersRequest) (*license.ListClustersResponse, error) {
if api.mock.ListClusters.handler != nil {
return api.mock.ListClusters.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.ListClusters")
}
func (api *licenseServerAPI) UpdateCluster(ctx context.Context, req *license.UpdateClusterRequest) (*license.UpdateClusterResponse, error) {
if api.mock.UpdateCluster.handler != nil {
return api.mock.UpdateCluster.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.UpdateCluster")
}
func (api *licenseServerAPI) Heartbeat(ctx context.Context, req *license.HeartbeatRequest) (*license.HeartbeatResponse, error) {
if api.mock.Heartbeat.handler != nil {
return api.mock.Heartbeat.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.Heartbeat")
}
func (api *licenseServerAPI) ListUserClusters(ctx context.Context, req *license.ListUserClustersRequest) (*license.ListUserClustersResponse, error) {
if api.mock.ListUserClusters.handler != nil {
return api.mock.ListUserClusters.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock license.ListUserClusters")
}
/* Identity Server Mocks */
type setIdentityServerConfigFunc func(context.Context, *identity.SetIdentityServerConfigRequest) (*identity.SetIdentityServerConfigResponse, error)
type getIdentityServerConfigFunc func(context.Context, *identity.GetIdentityServerConfigRequest) (*identity.GetIdentityServerConfigResponse, error)
type createIDPConnectorFunc func(context.Context, *identity.CreateIDPConnectorRequest) (*identity.CreateIDPConnectorResponse, error)
type updateIDPConnectorFunc func(context.Context, *identity.UpdateIDPConnectorRequest) (*identity.UpdateIDPConnectorResponse, error)
type listIDPConnectorsFunc func(context.Context, *identity.ListIDPConnectorsRequest) (*identity.ListIDPConnectorsResponse, error)
type getIDPConnectorFunc func(context.Context, *identity.GetIDPConnectorRequest) (*identity.GetIDPConnectorResponse, error)
type deleteIDPConnectorFunc func(context.Context, *identity.DeleteIDPConnectorRequest) (*identity.DeleteIDPConnectorResponse, error)
type createOIDCClientFunc func(context.Context, *identity.CreateOIDCClientRequest) (*identity.CreateOIDCClientResponse, error)
type updateOIDCClientFunc func(context.Context, *identity.UpdateOIDCClientRequest) (*identity.UpdateOIDCClientResponse, error)
type getOIDCClientFunc func(context.Context, *identity.GetOIDCClientRequest) (*identity.GetOIDCClientResponse, error)
type listOIDCClientsFunc func(context.Context, *identity.ListOIDCClientsRequest) (*identity.ListOIDCClientsResponse, error)
type deleteOIDCClientFunc func(context.Context, *identity.DeleteOIDCClientRequest) (*identity.DeleteOIDCClientResponse, error)
type deleteAllFunc func(context.Context, *identity.DeleteAllRequest) (*identity.DeleteAllResponse, error)
type mockSetIdentityServerConfig struct{ handler setIdentityServerConfigFunc }
type mockGetIdentityServerConfig struct{ handler getIdentityServerConfigFunc }
type mockCreateIDPConnector struct{ handler createIDPConnectorFunc }
type mockUpdateIDPConnector struct{ handler updateIDPConnectorFunc }
type mockListIDPConnectors struct{ handler listIDPConnectorsFunc }
type mockGetIDPConnector struct{ handler getIDPConnectorFunc }
type mockDeleteIDPConnector struct{ handler deleteIDPConnectorFunc }
type mockCreateOIDCClient struct{ handler createOIDCClientFunc }
type mockUpdateOIDCClient struct{ handler updateOIDCClientFunc }
type mockGetOIDCClient struct{ handler getOIDCClientFunc }
type mockListOIDCClients struct{ handler listOIDCClientsFunc }
type mockDeleteOIDCClient struct{ handler deleteOIDCClientFunc }
type mockDeleteAll struct{ handler deleteAllFunc }
func (mock *mockSetIdentityServerConfig) Use(cb setIdentityServerConfigFunc) { mock.handler = cb }
func (mock *mockGetIdentityServerConfig) Use(cb getIdentityServerConfigFunc) { mock.handler = cb }
func (mock *mockCreateIDPConnector) Use(cb createIDPConnectorFunc) { mock.handler = cb }
func (mock *mockUpdateIDPConnector) Use(cb updateIDPConnectorFunc) { mock.handler = cb }
func (mock *mockListIDPConnectors) Use(cb listIDPConnectorsFunc) { mock.handler = cb }
func (mock *mockGetIDPConnector) Use(cb getIDPConnectorFunc) { mock.handler = cb }
func (mock *mockDeleteIDPConnector) Use(cb deleteIDPConnectorFunc) { mock.handler = cb }
func (mock *mockCreateOIDCClient) Use(cb createOIDCClientFunc) { mock.handler = cb }
func (mock *mockUpdateOIDCClient) Use(cb updateOIDCClientFunc) { mock.handler = cb }
func (mock *mockGetOIDCClient) Use(cb getOIDCClientFunc) { mock.handler = cb }
func (mock *mockListOIDCClients) Use(cb listOIDCClientsFunc) { mock.handler = cb }
func (mock *mockDeleteOIDCClient) Use(cb deleteOIDCClientFunc) { mock.handler = cb }
func (mock *mockDeleteAll) Use(cb deleteAllFunc) { mock.handler = cb }
type identityServerAPI struct {
identity.UnsafeAPIServer
mock *mockIdentityServer
}
type mockIdentityServer struct {
api identityServerAPI
SetIdentityServerConfig mockSetIdentityServerConfig
GetIdentityServerConfig mockGetIdentityServerConfig
CreateIDPConnector mockCreateIDPConnector
UpdateIDPConnector mockUpdateIDPConnector
ListIDPConnectors mockListIDPConnectors
GetIDPConnector mockGetIDPConnector
DeleteIDPConnector mockDeleteIDPConnector
CreateOIDCClient mockCreateOIDCClient
UpdateOIDCClient mockUpdateOIDCClient
GetOIDCClient mockGetOIDCClient
ListOIDCClients mockListOIDCClients
DeleteOIDCClient mockDeleteOIDCClient
DeleteAll mockDeleteAll
}
func (api *identityServerAPI) SetIdentityServerConfig(ctx context.Context, req *identity.SetIdentityServerConfigRequest) (*identity.SetIdentityServerConfigResponse, error) {
if api.mock.SetIdentityServerConfig.handler != nil {
return api.mock.SetIdentityServerConfig.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.SetIdentityServerConfig")
}
func (api *identityServerAPI) GetIdentityServerConfig(ctx context.Context, req *identity.GetIdentityServerConfigRequest) (*identity.GetIdentityServerConfigResponse, error) {
if api.mock.GetIdentityServerConfig.handler != nil {
return api.mock.GetIdentityServerConfig.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.GetIdentityServerConfig")
}
func (api *identityServerAPI) CreateIDPConnector(ctx context.Context, req *identity.CreateIDPConnectorRequest) (*identity.CreateIDPConnectorResponse, error) {
if api.mock.CreateIDPConnector.handler != nil {
return api.mock.CreateIDPConnector.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.CreateIDPConnector")
}
func (api *identityServerAPI) UpdateIDPConnector(ctx context.Context, req *identity.UpdateIDPConnectorRequest) (*identity.UpdateIDPConnectorResponse, error) {
if api.mock.UpdateIDPConnector.handler != nil {
return api.mock.UpdateIDPConnector.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.UpdateIDPConnector")
}
func (api *identityServerAPI) ListIDPConnectors(ctx context.Context, req *identity.ListIDPConnectorsRequest) (*identity.ListIDPConnectorsResponse, error) {
if api.mock.ListIDPConnectors.handler != nil {
return api.mock.ListIDPConnectors.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.ListIDPConnectors")
}
func (api *identityServerAPI) GetIDPConnector(ctx context.Context, req *identity.GetIDPConnectorRequest) (*identity.GetIDPConnectorResponse, error) {
if api.mock.GetIDPConnector.handler != nil {
return api.mock.GetIDPConnector.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.GetIDPConnector")
}
func (api *identityServerAPI) DeleteIDPConnector(ctx context.Context, req *identity.DeleteIDPConnectorRequest) (*identity.DeleteIDPConnectorResponse, error) {
if api.mock.DeleteIDPConnector.handler != nil {
return api.mock.DeleteIDPConnector.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.DeleteIDPConnector")
}
func (api *identityServerAPI) CreateOIDCClient(ctx context.Context, req *identity.CreateOIDCClientRequest) (*identity.CreateOIDCClientResponse, error) {
if api.mock.CreateOIDCClient.handler != nil {
return api.mock.CreateOIDCClient.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.CreateOIDCClient")
}
func (api *identityServerAPI) UpdateOIDCClient(ctx context.Context, req *identity.UpdateOIDCClientRequest) (*identity.UpdateOIDCClientResponse, error) {
if api.mock.UpdateOIDCClient.handler != nil {
return api.mock.UpdateOIDCClient.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.UpdateOIDCClient")
}
func (api *identityServerAPI) GetOIDCClient(ctx context.Context, req *identity.GetOIDCClientRequest) (*identity.GetOIDCClientResponse, error) {
if api.mock.GetOIDCClient.handler != nil {
return api.mock.GetOIDCClient.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.identityServerAPI")
}
func (api *identityServerAPI) ListOIDCClients(ctx context.Context, req *identity.ListOIDCClientsRequest) (*identity.ListOIDCClientsResponse, error) {
if api.mock.ListOIDCClients.handler != nil {
return api.mock.ListOIDCClients.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.ListOIDCClients")
}
func (api *identityServerAPI) DeleteOIDCClient(ctx context.Context, req *identity.DeleteOIDCClientRequest) (*identity.DeleteOIDCClientResponse, error) {
if api.mock.DeleteOIDCClient.handler != nil {
return api.mock.DeleteOIDCClient.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.DeleteOIDCClient")
}
func (api *identityServerAPI) DeleteAll(ctx context.Context, req *identity.DeleteAllRequest) (*identity.DeleteAllResponse, error) {
if api.mock.DeleteAll.handler != nil {
return api.mock.DeleteAll.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock identity.DeleteAll")
}
/* Enterprise Server Mocks */
type activateEnterpriseFunc func(context.Context, *enterprise.ActivateRequest) (*enterprise.ActivateResponse, error)
type getStateFunc func(context.Context, *enterprise.GetStateRequest) (*enterprise.GetStateResponse, error)
type getActivationCodeFunc func(context.Context, *enterprise.GetActivationCodeRequest) (*enterprise.GetActivationCodeResponse, error)
type deactivateEnterpriseFunc func(context.Context, *enterprise.DeactivateRequest) (*enterprise.DeactivateResponse, error)
type heartbeatEnterpriseFunc func(context.Context, *enterprise.HeartbeatRequest) (*enterprise.HeartbeatResponse, error)
type pauseFunc func(context.Context, *enterprise.PauseRequest) (*enterprise.PauseResponse, error)
type pauseStatusFunc func(context.Context, *enterprise.PauseStatusRequest) (*enterprise.PauseStatusResponse, error)
type unpauseFunc func(context.Context, *enterprise.UnpauseRequest) (*enterprise.UnpauseResponse, error)
type mockActivateEnterprise struct{ handler activateEnterpriseFunc }
type mockGetState struct{ handler getStateFunc }
type mockGetActivationCode struct{ handler getActivationCodeFunc }
type mockDeactivateEnterprise struct{ handler deactivateEnterpriseFunc }
type mockHeartbeatEnterprise struct{ handler heartbeatEnterpriseFunc }
type mockPause struct{ handler pauseFunc }
type mockPauseStatus struct{ handler pauseStatusFunc }
type mockUnpause struct{ handler unpauseFunc }
func (mock *mockActivateEnterprise) Use(cb activateEnterpriseFunc) { mock.handler = cb }
func (mock *mockGetState) Use(cb getStateFunc) { mock.handler = cb }
func (mock *mockGetActivationCode) Use(cb getActivationCodeFunc) { mock.handler = cb }
func (mock *mockDeactivateEnterprise) Use(cb deactivateEnterpriseFunc) { mock.handler = cb }
func (mock *mockHeartbeatEnterprise) Use(cb heartbeatEnterpriseFunc) { mock.handler = cb }
func (mock *mockPause) Use(cb pauseFunc) { mock.handler = cb }
func (mock *mockPauseStatus) Use(cb pauseStatusFunc) { mock.handler = cb }
func (mock *mockUnpause) Use(cb unpauseFunc) { mock.handler = cb }
type enterpriseServerAPI struct {
enterprise.UnsafeAPIServer
mock *mockEnterpriseServer
}
type mockEnterpriseServer struct {
api enterpriseServerAPI
Activate mockActivateEnterprise
GetState mockGetState
GetActivationCode mockGetActivationCode
Deactivate mockDeactivateEnterprise
Heartbeat mockHeartbeatEnterprise
Pause mockPause
PauseStatus mockPauseStatus
Unpause mockUnpause
}
func (api *enterpriseServerAPI) Activate(ctx context.Context, req *enterprise.ActivateRequest) (*enterprise.ActivateResponse, error) {
if api.mock.Activate.handler != nil {
return api.mock.Activate.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.Activate")
}
func (api *enterpriseServerAPI) GetState(ctx context.Context, req *enterprise.GetStateRequest) (*enterprise.GetStateResponse, error) {
if api.mock.GetState.handler != nil {
return api.mock.GetState.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.GetState")
}
func (api *enterpriseServerAPI) GetActivationCode(ctx context.Context, req *enterprise.GetActivationCodeRequest) (*enterprise.GetActivationCodeResponse, error) {
if api.mock.GetActivationCode.handler != nil {
return api.mock.GetActivationCode.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.GetActivationCode")
}
func (api *enterpriseServerAPI) Deactivate(ctx context.Context, req *enterprise.DeactivateRequest) (*enterprise.DeactivateResponse, error) {
if api.mock.Deactivate.handler != nil {
return api.mock.Deactivate.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.Deactivate")
}
func (api *enterpriseServerAPI) Heartbeat(ctx context.Context, req *enterprise.HeartbeatRequest) (*enterprise.HeartbeatResponse, error) {
if api.mock.Heartbeat.handler != nil {
return api.mock.Heartbeat.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.Heartbeat")
}
func (api *enterpriseServerAPI) Pause(ctx context.Context, req *enterprise.PauseRequest) (*enterprise.PauseResponse, error) {
if api.mock.Heartbeat.handler != nil {
return api.mock.Pause.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.Pause")
}
func (api *enterpriseServerAPI) PauseStatus(ctx context.Context, req *enterprise.PauseStatusRequest) (*enterprise.PauseStatusResponse, error) {
if api.mock.Heartbeat.handler != nil {
return api.mock.PauseStatus.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.PauseStatus")
}
func (api *enterpriseServerAPI) Unpause(ctx context.Context, req *enterprise.UnpauseRequest) (*enterprise.UnpauseResponse, error) {
if api.mock.Heartbeat.handler != nil {
return api.mock.Unpause.handler(ctx, req)
}
return nil, errors.Errorf("unhandled pachd mock enterprise.Unpause")
}
/* PFS Server Mocks */
type activateAuthPFSFunc func(context.Context, *pfs.ActivateAuthRequest) (*pfs.ActivateAuthResponse, error)
type createRepoFunc func(context.Context, *pfs.CreateRepoRequest) (*emptypb.Empty, error)
type inspectRepoFunc func(context.Context, *pfs.InspectRepoRequest) (*pfs.RepoInfo, error)
type listRepoFunc func(*pfs.ListRepoRequest, pfs.API_ListRepoServer) error
type deleteRepoFunc func(context.Context, *pfs.DeleteRepoRequest) (*pfs.DeleteRepoResponse, error)
type deleteReposFunc func(context.Context, *pfs.DeleteReposRequest) (*pfs.DeleteReposResponse, error)
type startCommitFunc func(context.Context, *pfs.StartCommitRequest) (*pfs.Commit, error)
type finishCommitFunc func(context.Context, *pfs.FinishCommitRequest) (*emptypb.Empty, error)
type inspectCommitFunc func(context.Context, *pfs.InspectCommitRequest) (*pfs.CommitInfo, error)
type listCommitFunc func(*pfs.ListCommitRequest, pfs.API_ListCommitServer) error
type squashCommitSetFunc func(context.Context, *pfs.SquashCommitSetRequest) (*emptypb.Empty, error)
type dropCommitSetFunc func(context.Context, *pfs.DropCommitSetRequest) (*emptypb.Empty, error)
type squashCommitFunc func(context.Context, *pfs.SquashCommitRequest) (*pfs.SquashCommitResponse, error)
type dropCommitFunc func(context.Context, *pfs.DropCommitRequest) (*pfs.DropCommitResponse, error)
type inspectCommitSetFunc func(*pfs.InspectCommitSetRequest, pfs.API_InspectCommitSetServer) error
type listCommitSetFunc func(*pfs.ListCommitSetRequest, pfs.API_ListCommitSetServer) error
type FindCommitsFunc func(*pfs.FindCommitsRequest, pfs.API_FindCommitsServer) error
type walkCommitProvenanceFunc func(*pfs.WalkCommitProvenanceRequest, pfs.API_WalkCommitProvenanceServer) error
type walkCommitSubvenanceFunc func(*pfs.WalkCommitSubvenanceRequest, pfs.API_WalkCommitSubvenanceServer) error
type subscribeCommitFunc func(*pfs.SubscribeCommitRequest, pfs.API_SubscribeCommitServer) error
type clearCommitFunc func(context.Context, *pfs.ClearCommitRequest) (*emptypb.Empty, error)
type createBranchFunc func(context.Context, *pfs.CreateBranchRequest) (*emptypb.Empty, error)
type inspectBranchFunc func(context.Context, *pfs.InspectBranchRequest) (*pfs.BranchInfo, error)
type listBranchFunc func(*pfs.ListBranchRequest, pfs.API_ListBranchServer) error
type deleteBranchFunc func(context.Context, *pfs.DeleteBranchRequest) (*emptypb.Empty, error)
type walkBranchProvenanceFunc func(*pfs.WalkBranchProvenanceRequest, pfs.API_WalkBranchProvenanceServer) error
type walkBranchSubvenanceFunc func(*pfs.WalkBranchSubvenanceRequest, pfs.API_WalkBranchSubvenanceServer) error
type createProjectFunc func(context.Context, *pfs.CreateProjectRequest) (*emptypb.Empty, error)
type inspectProjectFunc func(context.Context, *pfs.InspectProjectRequest) (*pfs.ProjectInfo, error)
type inspectProjectV2Func func(context.Context, *pfs.InspectProjectV2Request) (*pfs.InspectProjectV2Response, error)
type listProjectFunc func(*pfs.ListProjectRequest, pfs.API_ListProjectServer) error
type deleteProjectFunc func(context.Context, *pfs.DeleteProjectRequest) (*emptypb.Empty, error)
type modifyFileFunc func(pfs.API_ModifyFileServer) error
type getFileTARFunc func(*pfs.GetFileRequest, pfs.API_GetFileTARServer) error
type getFileFunc func(*pfs.GetFileRequest, pfs.API_GetFileServer) error
type inspectFileFunc func(context.Context, *pfs.InspectFileRequest) (*pfs.FileInfo, error)