-
Notifications
You must be signed in to change notification settings - Fork 84
/
root_resolver.go
1506 lines (1231 loc) · 77.2 KB
/
root_resolver.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 domain
import (
"context"
"fmt"
"net/http"
"net/url"
assignmentOp "github.com/kyma-incubator/compass/components/director/internal/domain/assignmentoperation"
"github.com/kyma-incubator/compass/components/director/internal/domain/operation"
systemfielddiscoveryengine "github.com/kyma-incubator/compass/components/director/internal/system-field-discovery-engine"
"github.com/kyma-incubator/compass/components/director/internal/domain/aspecteventresource"
"github.com/kyma-incubator/compass/components/director/internal/domain/aspect"
"github.com/kyma-incubator/compass/components/director/internal/domain/integrationdependency"
ordpackage "github.com/kyma-incubator/compass/components/director/internal/domain/package"
ordapiclient "github.com/kyma-incubator/compass/components/director/internal/open_resource_discovery/apiclient"
sfapiclient "github.com/kyma-incubator/compass/components/director/internal/systemfetcher/apiclient"
"github.com/kyma-incubator/compass/components/director/internal/destinationcreator"
"github.com/kyma-incubator/compass/components/director/internal/domain/destination"
"github.com/kyma-incubator/compass/components/director/internal/domain/formationconstraint/operators"
"github.com/kyma-incubator/compass/components/director/internal/domain/certsubjectmapping"
"github.com/kyma-incubator/compass/components/director/internal/domain/formationconstraint"
"github.com/kyma-incubator/compass/components/director/internal/domain/formationtemplateconstraintreferences"
databuilder "github.com/kyma-incubator/compass/components/director/internal/domain/webhook/datainputbuilder"
"github.com/kyma-incubator/compass/components/director/internal/domain/formationassignment"
"github.com/kyma-incubator/compass/components/director/pkg/retry"
webhookclient "github.com/kyma-incubator/compass/components/director/pkg/webhook_client"
"github.com/kyma-incubator/compass/components/director/internal/domain/formationtemplate"
"github.com/kyma-incubator/compass/components/director/internal/domain/subscription"
"github.com/kyma-incubator/compass/components/director/internal/selfregmanager"
pkgadapters "github.com/kyma-incubator/compass/components/director/pkg/adapters"
"github.com/kyma-incubator/compass/components/director/pkg/model"
dataloader "github.com/kyma-incubator/compass/components/director/internal/dataloaders"
"github.com/kyma-incubator/compass/components/director/internal/domain/api"
"github.com/kyma-incubator/compass/components/director/internal/domain/application"
"github.com/kyma-incubator/compass/components/director/internal/domain/apptemplate"
"github.com/kyma-incubator/compass/components/director/internal/domain/auth"
bundleutil "github.com/kyma-incubator/compass/components/director/internal/domain/bundle"
"github.com/kyma-incubator/compass/components/director/internal/domain/bundleinstanceauth"
"github.com/kyma-incubator/compass/components/director/internal/domain/bundlereferences"
"github.com/kyma-incubator/compass/components/director/internal/domain/document"
"github.com/kyma-incubator/compass/components/director/internal/domain/eventdef"
"github.com/kyma-incubator/compass/components/director/internal/domain/eventing"
"github.com/kyma-incubator/compass/components/director/internal/domain/fetchrequest"
"github.com/kyma-incubator/compass/components/director/internal/domain/formation"
"github.com/kyma-incubator/compass/components/director/internal/domain/healthcheck"
"github.com/kyma-incubator/compass/components/director/internal/domain/integrationsystem"
"github.com/kyma-incubator/compass/components/director/internal/domain/label"
"github.com/kyma-incubator/compass/components/director/internal/domain/labeldef"
"github.com/kyma-incubator/compass/components/director/internal/domain/oauth20"
"github.com/kyma-incubator/compass/components/director/internal/domain/onetimetoken"
"github.com/kyma-incubator/compass/components/director/internal/domain/runtime"
runtimectx "github.com/kyma-incubator/compass/components/director/internal/domain/runtime_context"
"github.com/kyma-incubator/compass/components/director/internal/domain/scenarioassignment"
"github.com/kyma-incubator/compass/components/director/internal/domain/spec"
"github.com/kyma-incubator/compass/components/director/internal/domain/systemauth"
"github.com/kyma-incubator/compass/components/director/internal/domain/tenant"
"github.com/kyma-incubator/compass/components/director/internal/domain/version"
"github.com/kyma-incubator/compass/components/director/internal/domain/viewer"
"github.com/kyma-incubator/compass/components/director/internal/domain/webhook"
"github.com/kyma-incubator/compass/components/director/internal/features"
"github.com/kyma-incubator/compass/components/director/internal/metrics"
"github.com/kyma-incubator/compass/components/director/internal/uid"
"github.com/kyma-incubator/compass/components/director/pkg/accessstrategy"
"github.com/kyma-incubator/compass/components/director/pkg/config"
"github.com/kyma-incubator/compass/components/director/pkg/consumer"
"github.com/kyma-incubator/compass/components/director/pkg/graphql"
httputil "github.com/kyma-incubator/compass/components/director/pkg/http"
"github.com/kyma-incubator/compass/components/director/pkg/log"
"github.com/kyma-incubator/compass/components/director/pkg/normalizer"
"github.com/kyma-incubator/compass/components/director/pkg/persistence"
"github.com/kyma-incubator/compass/components/director/pkg/time"
hydraClient "github.com/ory/hydra-client-go/v2"
)
var _ graphql.ResolverRoot = &RootResolver{}
// RootResolver missing godoc
type RootResolver struct {
appNameNormalizer normalizer.Normalizator
app *application.Resolver
appTemplate *apptemplate.Resolver
api *api.Resolver
eventAPI *eventdef.Resolver
eventing *eventing.Resolver
integrationDependency *integrationdependency.Resolver
doc *document.Resolver
formation *formation.Resolver
formationAssignment *formationassignment.Resolver
runtime *runtime.Resolver
runtimeContext *runtimectx.Resolver
healthCheck *healthcheck.Resolver
webhook *webhook.Resolver
labelDef *labeldef.Resolver
token *onetimetoken.Resolver
systemAuth *systemauth.Resolver
oAuth20 *oauth20.Resolver
intSys *integrationsystem.Resolver
viewer *viewer.Resolver
tenant *tenant.Resolver
mpBundle *bundleutil.Resolver
bundleInstanceAuth *bundleinstanceauth.Resolver
scenarioAssignment *scenarioassignment.Resolver
subscription *subscription.Resolver
formationTemplate *formationtemplate.Resolver
formationConstraint *formationconstraint.Resolver
constraintReference *formationtemplateconstraintreferences.Resolver
certSubjectMapping *certsubjectmapping.Resolver
}
// NewRootResolver missing godoc
func NewRootResolver(
appNameNormalizer normalizer.Normalizator,
transact persistence.Transactioner,
cfgProvider *config.Provider,
oneTimeTokenCfg onetimetoken.Config,
oAuth20Cfg oauth20.Config,
pairingAdapters *pkgadapters.Adapters,
featuresConfig features.Config,
metricsCollector *metrics.Collector,
retryHTTPExecutor *retry.HTTPExecutor,
httpClient, internalFQDNHTTPClient, internalGatewayHTTPClient, securedHTTPClient, mtlsHTTPClient *http.Client,
selfRegConfig config.SelfRegConfig,
systemFieldDiscoveryEngineConfig config.SystemFieldDiscoveryEngineConfig,
tokenLength int,
hydraURL *url.URL,
accessStrategyExecutorProvider *accessstrategy.Provider,
subscriptionConfig subscription.Config,
tenantOnDemandAPIConfig tenant.FetchOnDemandAPIConfig,
ordWebhookMappings []application.ORDWebhookMapping,
tenantMappingConfig map[string]interface{},
callbackURL string,
appTemplateProductLabel string,
destinationCreatorConfig *destinationcreator.Config,
ordAggregatorClientConfig ordapiclient.OrdAggregatorClientConfig,
systemFetcherClientConfig sfapiclient.SystemFetcherSyncClientConfig,
environmentConsumerSubjects []string,
) (*RootResolver, error) {
timeService := time.NewService()
oAuth20HTTPClient := &http.Client{
Timeout: oAuth20Cfg.HTTPClientTimeout,
Transport: httputil.NewCorrelationIDTransport(httputil.NewServiceAccountTokenTransport(httputil.NewHTTPTransportWrapper(http.DefaultTransport.(*http.Transport)))),
}
configuration := hydraClient.Configuration{
Scheme: hydraURL.Scheme,
HTTPClient: oAuth20HTTPClient,
}
configuration.Servers = []hydraClient.ServerConfiguration{
{
URL: oAuth20Cfg.URL,
},
}
hydra := hydraClient.NewAPIClient(&configuration)
metricsCollector.InstrumentOAuth20HTTPClient(oAuth20HTTPClient)
tokenConverter := onetimetoken.NewConverter(oneTimeTokenCfg.LegacyConnectorURL)
authConverter := auth.NewConverterWithOTT(tokenConverter)
runtimeContextConverter := runtimectx.NewConverter()
frConverter := fetchrequest.NewConverter(authConverter)
versionConverter := version.NewConverter()
docConverter := document.NewConverter(frConverter)
webhookConverter := webhook.NewConverter(authConverter)
specConverter := spec.NewConverter(frConverter)
apiConverter := api.NewConverter(versionConverter, specConverter)
eventAPIConverter := eventdef.NewConverter(versionConverter, specConverter)
aspectEventResourceConverter := aspecteventresource.NewConverter()
aspectConverter := aspect.NewConverter(aspectEventResourceConverter)
integrationDependencyConv := integrationdependency.NewConverter(versionConverter, aspectConverter)
pkgConverter := ordpackage.NewConverter()
labelDefConverter := labeldef.NewConverter()
labelConverter := label.NewConverter()
systemAuthConverter := systemauth.NewConverter(authConverter)
intSysConverter := integrationsystem.NewConverter()
tenantConverter := tenant.NewConverter()
bundleConverter := bundleutil.NewConverter(authConverter, apiConverter, eventAPIConverter, docConverter)
appConverter := application.NewConverter(webhookConverter, bundleConverter)
appWithTenantsConverter := application.NewAppWithTenantsConverter(appConverter, tenantConverter)
appTemplateConverter := apptemplate.NewConverter(appConverter, webhookConverter)
bundleInstanceAuthConv := bundleinstanceauth.NewConverter(authConverter)
assignmentConv := scenarioassignment.NewConverter()
bundleReferenceConv := bundlereferences.NewConverter()
formationConv := formation.NewConverter()
runtimeConverter := runtime.NewConverter(webhookConverter)
formationTemplateConverter := formationtemplate.NewConverter(webhookConverter)
formationAssignmentConv := formationassignment.NewConverter()
formationConstraintConverter := formationconstraint.NewConverter()
appTemplateConv := apptemplate.NewConverter(appConverter, webhookConverter)
constraintReferencesConverter := formationtemplateconstraintreferences.NewConverter()
certSubjectMappingConv := certsubjectmapping.NewConverter()
destinationConv := destination.NewConverter()
healthcheckRepo := healthcheck.NewRepository()
runtimeRepo := runtime.NewRepository(runtimeConverter)
runtimeContextRepo := runtimectx.NewRepository(runtimectx.NewConverter())
applicationRepo := application.NewRepository(appConverter)
appTemplateRepo := apptemplate.NewRepository(appTemplateConverter)
labelRepo := label.NewRepository(labelConverter)
labelDefRepo := labeldef.NewRepository(labelDefConverter)
webhookRepo := webhook.NewRepository(webhookConverter)
apiRepo := api.NewRepository(apiConverter)
eventAPIRepo := eventdef.NewRepository(eventAPIConverter)
aspectRepo := aspect.NewRepository(aspectConverter)
aspectEventResourceRepo := aspecteventresource.NewRepository(aspectEventResourceConverter)
integrationDependencyRepo := integrationdependency.NewRepository(integrationDependencyConv)
pkgRepo := ordpackage.NewRepository(pkgConverter)
specRepo := spec.NewRepository(specConverter)
docRepo := document.NewRepository(docConverter)
fetchRequestRepo := fetchrequest.NewRepository(frConverter)
systemAuthRepo := systemauth.NewRepository(systemAuthConverter)
intSysRepo := integrationsystem.NewRepository(intSysConverter)
tenantRepo := tenant.NewRepository(tenantConverter)
bundleRepo := bundleutil.NewRepository(bundleConverter)
bundleInstanceAuthRepo := bundleinstanceauth.NewRepository(bundleInstanceAuthConv)
scenarioAssignmentRepo := scenarioassignment.NewRepository(assignmentConv)
bundleReferenceRepo := bundlereferences.NewRepository(bundleReferenceConv)
formationTemplateRepo := formationtemplate.NewRepository(formationTemplateConverter)
formationRepo := formation.NewRepository(formationConv)
formationAssignmentRepo := formationassignment.NewRepository(formationAssignmentConv)
formationConstraintRepo := formationconstraint.NewRepository(formationConstraintConverter)
constraintReferencesRepo := formationtemplateconstraintreferences.NewRepository(constraintReferencesConverter)
certSubjectMappingRepo := certsubjectmapping.NewRepository(certSubjectMappingConv)
destinationRepo := destination.NewRepository(destinationConv)
uidSvc := uid.NewService()
assignmentOperationConv := assignmentOp.NewConverter()
assignmentOperationRepo := assignmentOp.NewRepository(assignmentOperationConv)
assignmentOperationSvc := assignmentOp.NewService(assignmentOperationRepo, uidSvc)
labelSvc := label.NewLabelService(labelRepo, labelDefRepo, uidSvc)
appTemplateSvc := apptemplate.NewService(appTemplateRepo, webhookRepo, uidSvc, labelSvc, labelRepo, applicationRepo, timeService)
labelDefSvc := labeldef.NewService(labelDefRepo, labelRepo, scenarioAssignmentRepo, tenantRepo, uidSvc)
fetchRequestSvc := fetchrequest.NewServiceWithRetry(fetchRequestRepo, httpClient, accessStrategyExecutorProvider, retryHTTPExecutor)
specSvc := spec.NewService(specRepo, fetchRequestRepo, uidSvc, fetchRequestSvc)
bundleReferenceSvc := bundlereferences.NewService(bundleReferenceRepo, uidSvc)
apiSvc := api.NewService(apiRepo, uidSvc, specSvc, bundleReferenceSvc)
eventAPISvc := eventdef.NewService(eventAPIRepo, uidSvc, specSvc, bundleReferenceSvc)
tenantSvc := tenant.NewServiceWithLabels(tenantRepo, uidSvc, labelRepo, labelSvc, tenantConverter)
webhookSvc := webhook.NewService(webhookRepo, applicationRepo, uidSvc, tenantSvc, tenantMappingConfig, callbackURL)
docSvc := document.NewService(docRepo, fetchRequestRepo, uidSvc)
scenarioAssignmentSvc := scenarioassignment.NewService(scenarioAssignmentRepo, labelDefSvc)
healthCheckSvc := healthcheck.NewService(healthcheckRepo)
systemAuthSvc := systemauth.NewService(systemAuthRepo, uidSvc)
oAuth20Svc := oauth20.NewService(cfgProvider, oAuth20Cfg.PublicAccessTokenEndpoint, hydra.OAuth2Api)
intSysSvc := integrationsystem.NewService(intSysRepo, uidSvc)
eventingSvc := eventing.NewService(appNameNormalizer, runtimeRepo, labelRepo)
aspectSvc := aspect.NewService(aspectRepo, uidSvc)
aspectEventResourceSvc := aspecteventresource.NewService(aspectEventResourceRepo, uidSvc)
integrationDependencySvc := integrationdependency.NewService(integrationDependencyRepo, uidSvc)
packageSvc := ordpackage.NewService(pkgRepo, uidSvc)
bundleInstanceAuthSvc := bundleinstanceauth.NewService(bundleInstanceAuthRepo, uidSvc)
bundleSvc := bundleutil.NewService(bundleRepo, apiSvc, eventAPISvc, docSvc, bundleInstanceAuthSvc, uidSvc)
webhookClient := webhookclient.NewClient(securedHTTPClient, mtlsHTTPClient)
webhookLabelBuilder := databuilder.NewWebhookLabelBuilder(labelRepo)
webhookTenantBuilder := databuilder.NewWebhookTenantBuilder(webhookLabelBuilder, tenantRepo)
certSubjectTenantBuilder := databuilder.NewWebhookCertSubjectBuilder(certSubjectMappingRepo)
webhookDataInputBuilder := databuilder.NewWebhookDataInputBuilder(applicationRepo, appTemplateRepo, runtimeRepo, runtimeContextRepo, webhookLabelBuilder, webhookTenantBuilder, certSubjectTenantBuilder)
formationConstraintSvc := formationconstraint.NewService(formationConstraintRepo, constraintReferencesRepo, uidSvc, formationConstraintConverter)
destinationCreatorSvc := destinationcreator.NewService(mtlsHTTPClient, destinationCreatorConfig, applicationRepo, runtimeRepo, runtimeContextRepo, labelRepo, tenantRepo)
destinationSvc := destination.NewService(transact, destinationRepo, tenantRepo, uidSvc, destinationCreatorSvc)
constraintEngine := operators.NewConstraintEngine(transact, formationConstraintSvc, tenantSvc, scenarioAssignmentSvc, destinationSvc, destinationCreatorSvc, systemAuthSvc, formationRepo, labelRepo, labelSvc, applicationRepo, runtimeContextRepo, formationTemplateRepo, formationAssignmentRepo, nil, nil, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
notificationsBuilder := formation.NewNotificationsBuilder(webhookConverter, constraintEngine, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
notificationsGenerator := formation.NewNotificationsGenerator(applicationRepo, appTemplateRepo, runtimeRepo, runtimeContextRepo, labelRepo, webhookRepo, webhookDataInputBuilder, notificationsBuilder)
notificationSvc := formation.NewNotificationService(tenantRepo, webhookClient, notificationsGenerator, constraintEngine, webhookConverter, formationTemplateRepo, formationAssignmentRepo, formationRepo)
faNotificationSvc := formationassignment.NewFormationAssignmentNotificationService(formationAssignmentRepo, webhookConverter, webhookRepo, tenantRepo, webhookDataInputBuilder, formationRepo, notificationsBuilder, runtimeContextRepo, labelSvc, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
formationAssignmentStatusSvc := formationassignment.NewFormationAssignmentStatusService(formationAssignmentRepo, constraintEngine, faNotificationSvc)
formationAssignmentSvc := formationassignment.NewService(formationAssignmentRepo, uidSvc, applicationRepo, runtimeRepo, runtimeContextRepo, notificationSvc, faNotificationSvc, assignmentOperationSvc, labelSvc, formationRepo, formationAssignmentStatusSvc, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
formationStatusSvc := formation.NewFormationStatusService(formationRepo, labelDefRepo, labelDefSvc, notificationSvc, constraintEngine)
formationSvc := formation.NewService(transact, applicationRepo, labelDefRepo, labelRepo, formationRepo, formationTemplateRepo, labelSvc, uidSvc, labelDefSvc, scenarioAssignmentRepo, scenarioAssignmentSvc, tenantSvc, runtimeRepo, runtimeContextRepo, formationAssignmentSvc, assignmentOperationSvc, faNotificationSvc, notificationSvc, constraintEngine, webhookRepo, formationStatusSvc, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
appSvc := application.NewService(appNameNormalizer, cfgProvider, applicationRepo, webhookRepo, runtimeRepo, labelRepo, intSysRepo, labelSvc, bundleSvc, uidSvc, formationSvc, selfRegConfig.SelfRegisterDistinguishLabelKey, ordWebhookMappings)
runtimeContextSvc := runtimectx.NewService(runtimeContextRepo, labelRepo, runtimeRepo, labelSvc, formationSvc, tenantSvc, uidSvc)
runtimeSvc := runtime.NewService(runtimeRepo, labelRepo, labelSvc, uidSvc, formationSvc, tenantSvc, webhookSvc, runtimeContextSvc, featuresConfig.ProtectedLabelPattern, featuresConfig.ImmutableLabelPattern, featuresConfig.RuntimeTypeLabelKey, featuresConfig.KymaRuntimeTypeLabelValue, featuresConfig.KymaApplicationNamespaceValue, featuresConfig.KymaAdapterWebhookMode, featuresConfig.KymaAdapterWebhookType, featuresConfig.KymaAdapterWebhookURLTemplate, featuresConfig.KymaAdapterWebhookInputTemplate, featuresConfig.KymaAdapterWebhookHeaderTemplate, featuresConfig.KymaAdapterWebhookOutputTemplate)
tokenSvc := onetimetoken.NewTokenService(systemAuthSvc, appSvc, appConverter, tenantSvc, internalFQDNHTTPClient, onetimetoken.NewTokenGenerator(tokenLength), oneTimeTokenCfg, pairingAdapters, timeService)
systemFieldDiscoveryEngine, err := systemfielddiscoveryengine.NewSystemFieldDiscoveryEngine(systemFieldDiscoveryEngineConfig, labelSvc, webhookSvc, uidSvc)
if err != nil {
return nil, err
}
subscriptionSvc := subscription.NewService(runtimeSvc, runtimeContextSvc, tenantSvc, labelSvc, appTemplateSvc, appConverter, appTemplateConv, appSvc, uidSvc, systemFieldDiscoveryEngine, subscriptionConfig.GlobalSubaccountIDLabelKey, subscriptionConfig.SubscriptionLabelKey, subscriptionConfig.RuntimeTypeLabelKey, subscriptionConfig.ProviderLabelKey)
tenantOnDemandSvc := tenant.NewFetchOnDemandService(internalGatewayHTTPClient, tenantOnDemandAPIConfig)
formationTemplateSvc := formationtemplate.NewService(formationTemplateRepo, uidSvc, formationTemplateConverter, tenantSvc, webhookRepo, webhookSvc, labelSvc)
constraintReferenceSvc := formationtemplateconstraintreferences.NewService(constraintReferencesRepo, constraintReferencesConverter)
certSubjectMappingSvc := certsubjectmapping.NewService(certSubjectMappingRepo)
constraintEngine.SetFormationAssignmentNotificationService(faNotificationSvc)
constraintEngine.SetFormationAssignmentService(formationAssignmentSvc)
opConv := operation.NewConverter()
opRepo := operation.NewRepository(opConv)
opSvc := operation.NewService(opRepo, uidSvc)
selfRegisterManager, err := selfregmanager.NewSelfRegisterManager(selfRegConfig, &selfregmanager.CallerProvider{}, appTemplateProductLabel)
if err != nil {
return nil, err
}
return &RootResolver{
appNameNormalizer: appNameNormalizer,
appTemplate: apptemplate.NewResolver(transact, appSvc, appConverter, appTemplateSvc, appTemplateConverter, webhookSvc, webhookConverter, labelSvc, selfRegisterManager, uidSvc, systemFieldDiscoveryEngine, certSubjectMappingSvc, appTemplateProductLabel, ordAggregatorClientConfig, environmentConsumerSubjects),
app: application.NewResolver(transact, appSvc, webhookSvc, oAuth20Svc, systemAuthSvc, appConverter, appWithTenantsConverter, webhookConverter, systemAuthConverter, eventingSvc, bundleSvc, bundleConverter, specSvc, apiSvc, eventAPISvc, integrationDependencySvc, integrationDependencyConv, aspectSvc, aspectEventResourceSvc, apiConverter, eventAPIConverter, appTemplateSvc, appTemplateConverter, opSvc, opConv, selfRegConfig.SelfRegisterDistinguishLabelKey, featuresConfig.TokenPrefix),
api: api.NewResolver(transact, apiSvc, runtimeSvc, bundleSvc, bundleReferenceSvc, apiConverter, frConverter, specSvc, specConverter, appSvc),
eventAPI: eventdef.NewResolver(transact, eventAPISvc, bundleSvc, bundleReferenceSvc, eventAPIConverter, frConverter, specSvc, specConverter),
eventing: eventing.NewResolver(transact, eventingSvc, appSvc),
integrationDependency: integrationdependency.NewResolver(transact, integrationDependencySvc, integrationDependencyConv, aspectSvc, aspectEventResourceSvc, appSvc, appTemplateSvc, packageSvc),
doc: document.NewResolver(transact, docSvc, appSvc, bundleSvc, frConverter),
formation: formation.NewResolver(transact, formationSvc, formationConv, formationAssignmentSvc, formationAssignmentConv, tenantOnDemandSvc, tenantSvc),
formationAssignment: formationassignment.NewResolver(transact, applicationRepo, appConverter, runtimeRepo, runtimeConverter, runtimeContextRepo, runtimeContextConverter, assignmentOperationSvc, assignmentOperationConv),
runtime: runtime.NewResolver(transact, runtimeSvc, scenarioAssignmentSvc, systemAuthSvc, oAuth20Svc, runtimeConverter, systemAuthConverter, eventingSvc, bundleInstanceAuthSvc, selfRegisterManager, uidSvc, subscriptionSvc, runtimeContextSvc, runtimeContextConverter, webhookSvc, webhookConverter, tenantOnDemandSvc, formationSvc, tenantSvc, formation.NewASAEngine(scenarioAssignmentRepo, runtimeRepo, runtimeContextRepo, formationRepo, formationTemplateRepo, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)),
runtimeContext: runtimectx.NewResolver(transact, runtimeContextSvc, runtimeContextConverter),
healthCheck: healthcheck.NewResolver(healthCheckSvc),
webhook: webhook.NewResolver(transact, webhookSvc, appSvc, appTemplateSvc, runtimeSvc, formationTemplateSvc, webhookConverter),
labelDef: labeldef.NewResolver(transact, labelDefSvc, formationSvc, labelDefConverter),
token: onetimetoken.NewTokenResolver(transact, tokenSvc, tokenConverter, oneTimeTokenCfg.SuggestTokenHeaderKey),
systemAuth: systemauth.NewResolver(transact, systemAuthSvc, oAuth20Svc, tokenSvc, systemAuthConverter, authConverter),
oAuth20: oauth20.NewResolver(transact, oAuth20Svc, appSvc, runtimeSvc, intSysSvc, systemAuthSvc, systemAuthConverter),
intSys: integrationsystem.NewResolver(transact, intSysSvc, systemAuthSvc, oAuth20Svc, intSysConverter, systemAuthConverter),
viewer: viewer.NewViewerResolver(),
tenant: tenant.NewResolver(transact, tenantSvc, tenantConverter, tenantOnDemandSvc, systemFetcherClientConfig),
mpBundle: bundleutil.NewResolver(transact, bundleSvc, bundleInstanceAuthSvc, bundleReferenceSvc, apiSvc, eventAPISvc, docSvc, bundleConverter, bundleInstanceAuthConv, apiConverter, eventAPIConverter, docConverter, specSvc, appSvc),
bundleInstanceAuth: bundleinstanceauth.NewResolver(transact, bundleInstanceAuthSvc, bundleSvc, bundleInstanceAuthConv, bundleConverter),
scenarioAssignment: scenarioassignment.NewResolver(transact, scenarioAssignmentSvc, assignmentConv, tenantSvc),
subscription: subscription.NewResolver(transact, subscriptionSvc, ordAggregatorClientConfig),
formationTemplate: formationtemplate.NewResolver(transact, formationTemplateConverter, formationTemplateSvc, webhookConverter, formationConstraintSvc, formationConstraintConverter),
formationConstraint: formationconstraint.NewResolver(transact, formationConstraintConverter, formationConstraintSvc),
constraintReference: formationtemplateconstraintreferences.NewResolver(transact, constraintReferencesConverter, constraintReferenceSvc),
certSubjectMapping: certsubjectmapping.NewResolver(transact, certSubjectMappingConv, certSubjectMappingSvc, uidSvc),
}, nil
}
// BundlesDataloader missing godoc
func (r *RootResolver) BundlesDataloader(ids []dataloader.ParamBundle) ([]*graphql.BundlePage, []error) {
return r.app.BundlesDataLoader(ids)
}
// APIDefinitionsDataloader missing godoc
func (r *RootResolver) APIDefinitionsDataloader(ids []dataloader.ParamAPIDef) ([]*graphql.APIDefinitionPage, []error) {
return r.mpBundle.APIDefinitionsDataLoader(ids)
}
// EventDefinitionsDataloader missing godoc
func (r *RootResolver) EventDefinitionsDataloader(ids []dataloader.ParamEventDef) ([]*graphql.EventDefinitionPage, []error) {
return r.mpBundle.EventDefinitionsDataLoader(ids)
}
// IntegrationDependenciesDataloader is the Integration Dependencies dataloader used in the graphql API router
func (r *RootResolver) IntegrationDependenciesDataloader(ids []dataloader.ParamIntegrationDependency) ([]*graphql.IntegrationDependencyPage, []error) {
return r.app.IntegrationDependenciesDataLoader(ids)
}
// DocumentsDataloader missing godoc
func (r *RootResolver) DocumentsDataloader(ids []dataloader.ParamDocument) ([]*graphql.DocumentPage, []error) {
return r.mpBundle.DocumentsDataLoader(ids)
}
// FetchRequestAPIDefDataloader missing godoc
func (r *RootResolver) FetchRequestAPIDefDataloader(ids []dataloader.ParamFetchRequestAPIDef) ([]*graphql.FetchRequest, []error) {
return r.api.FetchRequestAPIDefDataLoader(ids)
}
// FetchRequestEventDefDataloader missing godoc
func (r *RootResolver) FetchRequestEventDefDataloader(ids []dataloader.ParamFetchRequestEventDef) ([]*graphql.FetchRequest, []error) {
return r.eventAPI.FetchRequestEventDefDataLoader(ids)
}
// FetchRequestDocumentDataloader missing godoc
func (r *RootResolver) FetchRequestDocumentDataloader(ids []dataloader.ParamFetchRequestDocument) ([]*graphql.FetchRequest, []error) {
return r.doc.FetchRequestDocumentDataLoader(ids)
}
// RuntimeContextsDataloader missing godoc
func (r *RootResolver) RuntimeContextsDataloader(ids []dataloader.ParamRuntimeContext) ([]*graphql.RuntimeContextPage, []error) {
return r.runtime.RuntimeContextsDataLoader(ids)
}
// FormationAssignmentsDataLoader missing godoc
func (r *RootResolver) FormationAssignmentsDataLoader(ids []dataloader.ParamFormationAssignment) ([]*graphql.FormationAssignmentPage, []error) {
return r.formation.FormationAssignmentsDataLoader(ids)
}
// FormationParticipantDataloader is a dataloader for formation participants
func (r *RootResolver) FormationParticipantDataloader(ids []dataloader.ParamFormationParticipant) ([]graphql.FormationParticipant, []error) {
return r.formationAssignment.FormationParticipantDataLoader(ids)
}
// StatusDataLoader is the FormationStatus dataloader used in the graphql API router
func (r *RootResolver) StatusDataLoader(ids []dataloader.ParamFormationStatus) ([]*graphql.FormationStatus, []error) {
return r.formation.StatusDataLoader(ids)
}
// FormationConstraintsDataLoader is the FormationConstraint dataloader used in the graphql API router
func (r *RootResolver) FormationConstraintsDataLoader(ids []dataloader.ParamFormationConstraint) ([][]*graphql.FormationConstraint, []error) {
return r.formationTemplate.FormationConstraintsDataLoader(ids)
}
// AssignmentOperationsDataLoader is the AssignmentOperations dataloader used in the graphql API router
func (r *RootResolver) AssignmentOperationsDataLoader(ids []dataloader.ParamAssignmentOperation) ([]*graphql.AssignmentOperationPage, []error) {
return r.formationAssignment.AssignmentOperationsDataLoader(ids)
}
// Mutation missing godoc
func (r *RootResolver) Mutation() graphql.MutationResolver {
return &mutationResolver{r}
}
// Query missing godoc
func (r *RootResolver) Query() graphql.QueryResolver {
return &queryResolver{r}
}
// Application missing godoc
func (r *RootResolver) Application() graphql.ApplicationResolver {
return &applicationResolver{r}
}
// ApplicationTemplate missing godoc
func (r *RootResolver) ApplicationTemplate() graphql.ApplicationTemplateResolver {
return &applicationTemplateResolver{r}
}
// Runtime missing godoc
func (r *RootResolver) Runtime() graphql.RuntimeResolver {
return &runtimeResolver{r}
}
// RuntimeContext missing godoc
func (r *RootResolver) RuntimeContext() graphql.RuntimeContextResolver {
return &runtimeContextResolver{r}
}
// Formation missing godoc
func (r *RootResolver) Formation() graphql.FormationResolver {
return &formationResolver{r}
}
// FormationAssignment is resolver for formation assignments
func (r *RootResolver) FormationAssignment() graphql.FormationAssignmentResolver {
return &formationAssignmentResolver{r}
}
// APISpec missing godoc
func (r *RootResolver) APISpec() graphql.APISpecResolver {
return &apiSpecResolver{r}
}
// Document missing godoc
func (r *RootResolver) Document() graphql.DocumentResolver {
return &documentResolver{r}
}
// EventSpec missing godoc
func (r *RootResolver) EventSpec() graphql.EventSpecResolver {
return &eventSpecResolver{r}
}
// Bundle missing godoc
func (r *RootResolver) Bundle() graphql.BundleResolver {
return &BundleResolver{r}
}
// IntegrationSystem missing godoc
func (r *RootResolver) IntegrationSystem() graphql.IntegrationSystemResolver {
return &integrationSystemResolver{r}
}
// OneTimeTokenForApplication missing godoc
func (r *RootResolver) OneTimeTokenForApplication() graphql.OneTimeTokenForApplicationResolver {
return &oneTimeTokenForApplicationResolver{r}
}
// OneTimeTokenForRuntime missing godoc
func (r *RootResolver) OneTimeTokenForRuntime() graphql.OneTimeTokenForRuntimeResolver {
return &oneTimeTokenForRuntimeResolver{r}
}
// Tenant missing godoc
func (r *RootResolver) Tenant() graphql.TenantResolver {
return &tenantResolver{r}
}
// EventDefinition resolver for Event Defs
func (r *RootResolver) EventDefinition() graphql.EventDefinitionResolver {
return &eventDefinitionResolver{r}
}
// APIDefinition resolver for API Defs
func (r *RootResolver) APIDefinition() graphql.APIDefinitionResolver {
return &apiDefinitionResolver{r}
}
type queryResolver struct {
*RootResolver
}
func (r *queryResolver) FormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error) {
return r.formationConstraint.FormationConstraint(ctx, id)
}
func (r *queryResolver) FormationConstraints(ctx context.Context) ([]*graphql.FormationConstraint, error) {
return r.formationConstraint.FormationConstraints(ctx)
}
func (r *queryResolver) FormationConstraintsByFormationType(ctx context.Context, formationTemplateID string) ([]*graphql.FormationConstraint, error) {
return r.formationConstraint.FormationConstraintsByFormationType(ctx, formationTemplateID)
}
func (r *queryResolver) Formation(ctx context.Context, id string) (*graphql.Formation, error) {
return r.formation.Formation(ctx, id)
}
// FormationByName returns a formation retrieved by name
func (r *queryResolver) FormationByName(ctx context.Context, name string) (*graphql.Formation, error) {
return r.formation.FormationByName(ctx, name)
}
func (r *queryResolver) Formations(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.FormationPage, error) {
return r.formation.Formations(ctx, first, after)
}
func (r *queryResolver) FormationsForObject(ctx context.Context, objectID string) ([]*graphql.Formation, error) {
return r.formation.FormationsForObject(ctx, objectID)
}
func (r *queryResolver) FormationTemplate(ctx context.Context, id string) (*graphql.FormationTemplate, error) {
return r.formationTemplate.FormationTemplate(ctx, id)
}
func (r *queryResolver) FormationTemplates(ctx context.Context, filters []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.FormationTemplatePage, error) {
return r.formationTemplate.FormationTemplates(ctx, filters, first, after)
}
func (r *queryResolver) FormationTemplatesByName(ctx context.Context, name string, first *int, after *graphql.PageCursor) (*graphql.FormationTemplatePage, error) {
return r.formationTemplate.FormationTemplatesByName(ctx, &name, first, after)
}
// Viewer missing godoc
func (r *queryResolver) Viewer(ctx context.Context) (*graphql.Viewer, error) {
return r.viewer.Viewer(ctx)
}
// ApisForApplication resolves to APIDefinition page for a given application ID
func (r *queryResolver) ApisForApplication(ctx context.Context, appID string, first *int, after *graphql.PageCursor) (*graphql.APIDefinitionPage, error) {
return r.api.APIDefinitionsForApplication(ctx, appID, first, after)
}
// EventsForApplication resolves to EventDefinition page for a given application ID
func (r *queryResolver) EventsForApplication(ctx context.Context, appID string, first *int, after *graphql.PageCursor) (*graphql.EventDefinitionPage, error) {
return r.eventAPI.EventDefinitionsForApplication(ctx, appID, first, after)
}
// Applications missing godoc
func (r *queryResolver) Applications(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationPage, error) {
consumerInfo, err := consumer.LoadFromContext(ctx)
if err != nil {
return nil, err
}
if consumerInfo.Type == consumer.Runtime {
log.C(ctx).Debugf("Consumer type is of type %v. Filtering response based on scenarios...", consumer.Runtime)
return r.app.ApplicationsForRuntime(ctx, consumerInfo.ConsumerID, first, after)
}
return r.app.Applications(ctx, filter, first, after)
}
// ApplicationsGlobal retrieves a page of applications with their associated tenants filtered by the provided filters.
func (r *queryResolver) ApplicationsGlobal(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationWithTenantsPage, error) {
return r.app.ApplicationsGlobal(ctx, filter, first, after)
}
// Application missing godoc
func (r *queryResolver) Application(ctx context.Context, id string) (*graphql.Application, error) {
return r.app.Application(ctx, id)
}
// ApplicationBySystemNumber returns an application retrieved by systemNumber
func (r *queryResolver) ApplicationBySystemNumber(ctx context.Context, systemNumber string) (*graphql.Application, error) {
return r.app.ApplicationBySystemNumber(ctx, systemNumber)
}
// ApplicationsByLocalTenantID returns applications retrieved by local tenant id and optionally - a filter
func (r *queryResolver) ApplicationsByLocalTenantID(ctx context.Context, localTenantID string, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationPage, error) {
return r.app.ApplicationsByLocalTenantID(ctx, localTenantID, filter, first, after)
}
// ApplicationByLocalTenantIDAndAppTemplateID returns an application retrieved by local tenant id and app template id
func (r *queryResolver) ApplicationByLocalTenantIDAndAppTemplateID(ctx context.Context, localTenantID, appTemplateID string) (*graphql.Application, error) {
return r.app.ApplicationByLocalTenantIDAndAppTemplateID(ctx, localTenantID, appTemplateID)
}
// ApplicationTemplates missing godoc
func (r *queryResolver) ApplicationTemplates(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationTemplatePage, error) {
return r.appTemplate.ApplicationTemplates(ctx, filter, first, after)
}
// ApplicationTemplate missing godoc
func (r *queryResolver) ApplicationTemplate(ctx context.Context, id string) (*graphql.ApplicationTemplate, error) {
return r.appTemplate.ApplicationTemplate(ctx, id)
}
// ApplicationsForRuntime missing godoc
func (r *queryResolver) ApplicationsForRuntime(ctx context.Context, runtimeID string, first *int, after *graphql.PageCursor) (*graphql.ApplicationPage, error) {
apps, err := r.app.ApplicationsForRuntime(ctx, runtimeID, first, after)
if err != nil {
return nil, err
}
labels, err := r.runtime.GetLabel(ctx, runtimeID, runtime.IsNormalizedLabel)
if err != nil {
return nil, err
}
shouldNormalize := true
if labels != nil {
labelsMap := (map[string]interface{})(*labels)
shouldNormalize = labelsMap[runtime.IsNormalizedLabel] == nil || labelsMap[runtime.IsNormalizedLabel] == "true"
}
if shouldNormalize {
for i := range apps.Data {
apps.Data[i].Name = r.appNameNormalizer.Normalize(apps.Data[i].Name)
}
}
for i := range apps.Data {
if apps.Data[i].SystemNumber != nil {
apps.Data[i].Name = fmt.Sprintf("%s-%s", apps.Data[i].Name, *apps.Data[i].SystemNumber)
}
}
return apps, nil
}
// Runtimes missing godoc
func (r *queryResolver) Runtimes(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.RuntimePage, error) {
return r.runtime.Runtimes(ctx, filter, first, after)
}
// Runtime missing godoc
func (r *queryResolver) Runtime(ctx context.Context, id string) (*graphql.Runtime, error) {
return r.runtime.Runtime(ctx, id)
}
// RuntimeByTokenIssuer missing godoc
func (r *queryResolver) RuntimeByTokenIssuer(ctx context.Context, issuer string) (*graphql.Runtime, error) {
return r.runtime.RuntimeByTokenIssuer(ctx, issuer)
}
// LabelDefinitions missing godoc
func (r *queryResolver) LabelDefinitions(ctx context.Context) ([]*graphql.LabelDefinition, error) {
return r.labelDef.LabelDefinitions(ctx)
}
// LabelDefinition missing godoc
func (r *queryResolver) LabelDefinition(ctx context.Context, key string) (*graphql.LabelDefinition, error) {
return r.labelDef.LabelDefinition(ctx, key)
}
// BundleByInstanceAuth missing godoc
func (r *queryResolver) BundleByInstanceAuth(ctx context.Context, authID string) (*graphql.Bundle, error) {
return r.bundleInstanceAuth.BundleByInstanceAuth(ctx, authID)
}
// BundleInstanceAuth missing godoc
func (r *queryResolver) BundleInstanceAuth(ctx context.Context, id string) (*graphql.BundleInstanceAuth, error) {
return r.bundleInstanceAuth.BundleInstanceAuth(ctx, id)
}
// HealthChecks missing godoc
func (r *queryResolver) HealthChecks(ctx context.Context, types []graphql.HealthCheckType, origin *string, first *int, after *graphql.PageCursor) (*graphql.HealthCheckPage, error) {
return r.healthCheck.HealthChecks(ctx, types, origin, first, after)
}
// IntegrationSystems missing godoc
func (r *queryResolver) IntegrationSystems(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.IntegrationSystemPage, error) {
return r.intSys.IntegrationSystems(ctx, first, after)
}
// IntegrationSystem missing godoc
func (r *queryResolver) IntegrationSystem(ctx context.Context, id string) (*graphql.IntegrationSystem, error) {
return r.intSys.IntegrationSystem(ctx, id)
}
// Tenants fetches tenants by page and search term
func (r *queryResolver) Tenants(ctx context.Context, first *int, after *graphql.PageCursor, searchTerm *string) (*graphql.TenantPage, error) {
return r.tenant.Tenants(ctx, first, after, searchTerm)
}
// RootTenants fetches the top parents external IDs for a given external tenant
func (r *queryResolver) RootTenants(ctx context.Context, externalTenant string) ([]*graphql.Tenant, error) {
return r.tenant.RootTenants(ctx, externalTenant)
}
// AutomaticScenarioAssignmentForScenario missing godoc
func (r *queryResolver) AutomaticScenarioAssignmentForScenario(ctx context.Context, scenarioName string) (*graphql.AutomaticScenarioAssignment, error) {
return r.scenarioAssignment.GetAutomaticScenarioAssignmentForScenarioName(ctx, scenarioName)
}
// AutomaticScenarioAssignmentsForSelector missing godoc
func (r *queryResolver) AutomaticScenarioAssignmentsForSelector(ctx context.Context, selector graphql.LabelSelectorInput) ([]*graphql.AutomaticScenarioAssignment, error) {
return r.scenarioAssignment.AutomaticScenarioAssignmentsForSelector(ctx, selector)
}
// AutomaticScenarioAssignments missing godoc
func (r *queryResolver) AutomaticScenarioAssignments(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.AutomaticScenarioAssignmentPage, error) {
return r.scenarioAssignment.AutomaticScenarioAssignments(ctx, first, after)
}
// SystemAuth missing godoc
func (r *queryResolver) SystemAuth(ctx context.Context, id string) (graphql.SystemAuth, error) {
return r.systemAuth.SystemAuth(ctx, id)
}
// SystemAuthByToken missing godoc
func (r *queryResolver) SystemAuthByToken(ctx context.Context, id string) (graphql.SystemAuth, error) {
return r.systemAuth.SystemAuthByToken(ctx, id)
}
func (r *queryResolver) CertificateSubjectMapping(ctx context.Context, id string) (*graphql.CertificateSubjectMapping, error) {
return r.certSubjectMapping.CertificateSubjectMapping(ctx, id)
}
func (r *queryResolver) CertificateSubjectMappings(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.CertificateSubjectMappingPage, error) {
return r.certSubjectMapping.CertificateSubjectMappings(ctx, first, after)
}
type mutationResolver struct {
*RootResolver
}
func (r *mutationResolver) AddTenantAccess(ctx context.Context, in graphql.TenantAccessInput) (*graphql.TenantAccess, error) {
return r.tenant.AddTenantAccess(ctx, in)
}
func (r *mutationResolver) RemoveTenantAccess(ctx context.Context, tenantID string, resourceID string, resourceType graphql.TenantAccessObjectType) (*graphql.TenantAccess, error) {
return r.tenant.RemoveTenantAccess(ctx, tenantID, resourceID, resourceType)
}
func (r *mutationResolver) UpdateFormationConstraint(ctx context.Context, id string, in graphql.FormationConstraintUpdateInput) (*graphql.FormationConstraint, error) {
return r.formationConstraint.UpdateFormationConstraint(ctx, id, in)
}
func (r *mutationResolver) ResynchronizeFormationNotifications(ctx context.Context, formationID string, reset *bool) (*graphql.Formation, error) {
return r.formation.ResynchronizeFormationNotifications(ctx, formationID, reset)
}
func (r *mutationResolver) FinalizeDraftFormation(ctx context.Context, formationID string) (*graphql.Formation, error) {
return r.formation.FinalizeDraftFormation(ctx, formationID)
}
func (r *mutationResolver) AttachConstraintToFormationTemplate(ctx context.Context, constraintID string, formationTemplateID string) (*graphql.ConstraintReference, error) {
return r.constraintReference.AttachConstraintToFormationTemplate(ctx, constraintID, formationTemplateID)
}
func (r *mutationResolver) DetachConstraintFromFormationTemplate(ctx context.Context, constraintID string, formationTemplateID string) (*graphql.ConstraintReference, error) {
return r.constraintReference.DetachConstraintFromFormationTemplate(ctx, constraintID, formationTemplateID)
}
func (r *mutationResolver) CreateFormationConstraint(ctx context.Context, formationConstraint graphql.FormationConstraintInput) (*graphql.FormationConstraint, error) {
return r.formationConstraint.CreateFormationConstraint(ctx, formationConstraint)
}
func (r *mutationResolver) DeleteFormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error) {
return r.formationConstraint.DeleteFormationConstraint(ctx, id)
}
func (r *mutationResolver) CreateFormationTemplate(ctx context.Context, in graphql.FormationTemplateRegisterInput) (*graphql.FormationTemplate, error) {
return r.formationTemplate.CreateFormationTemplate(ctx, in)
}
func (r *mutationResolver) DeleteFormationTemplate(ctx context.Context, id string) (*graphql.FormationTemplate, error) {
return r.formationTemplate.DeleteFormationTemplate(ctx, id)
}
func (r *mutationResolver) UpdateFormationTemplate(ctx context.Context, id string, in graphql.FormationTemplateUpdateInput) (*graphql.FormationTemplate, error) {
return r.formationTemplate.UpdateFormationTemplate(ctx, id, in)
}
func (r *mutationResolver) AssignFormation(ctx context.Context, objectID string, objectType graphql.FormationObjectType, formation graphql.FormationInput) (*graphql.Formation, error) {
return r.formation.AssignFormation(ctx, objectID, objectType, formation)
}
func (r *mutationResolver) UnassignFormation(ctx context.Context, objectID string, objectType graphql.FormationObjectType, formation graphql.FormationInput) (*graphql.Formation, error) {
return r.formation.UnassignFormation(ctx, objectID, objectType, formation)
}
func (r *mutationResolver) UnassignFormationGlobal(ctx context.Context, objectID string, objectType graphql.FormationObjectType, formationID string) (*graphql.Formation, error) {
return r.formation.UnassignFormationGlobal(ctx, objectID, objectType, formationID)
}
func (r *mutationResolver) CreateFormation(ctx context.Context, formationInput graphql.FormationInput) (*graphql.Formation, error) {
return r.formation.CreateFormation(ctx, formationInput)
}
func (r *mutationResolver) DeleteFormation(ctx context.Context, formation graphql.FormationInput) (*graphql.Formation, error) {
return r.formation.DeleteFormation(ctx, formation)
}
// RegisterApplication missing godoc
func (r *mutationResolver) RegisterApplication(ctx context.Context, in graphql.ApplicationRegisterInput, _ *graphql.OperationMode) (*graphql.Application, error) {
return r.app.RegisterApplication(ctx, in)
}
// UpdateApplication missing godoc
func (r *mutationResolver) UpdateApplication(ctx context.Context, id string, in graphql.ApplicationUpdateInput) (*graphql.Application, error) {
return r.app.UpdateApplication(ctx, id, in)
}
// UnregisterApplication missing godoc
func (r *mutationResolver) UnregisterApplication(ctx context.Context, id string, _ *graphql.OperationMode) (*graphql.Application, error) {
return r.app.UnregisterApplication(ctx, id)
}
// UnpairApplication removes system auths, hydra client credentials and performs the "unpair" flow in the database
func (r *mutationResolver) UnpairApplication(ctx context.Context, id string, _ *graphql.OperationMode) (*graphql.Application, error) {
return r.app.UnpairApplication(ctx, id)
}
// MergeApplications Merges properties from Source Application into Destination Application, provided that the Destination's
// Application does not have a value set for a given property. Then the Source Application is being deleted.
func (r *mutationResolver) MergeApplications(ctx context.Context, destID, srcID string) (*graphql.Application, error) {
return r.app.MergeApplications(ctx, destID, srcID)
}
// CreateApplicationTemplate missing godoc
func (r *mutationResolver) CreateApplicationTemplate(ctx context.Context, in graphql.ApplicationTemplateInput) (*graphql.ApplicationTemplate, error) {
return r.appTemplate.CreateApplicationTemplate(ctx, in)
}
// RegisterApplicationFromTemplate missing godoc
func (r *mutationResolver) RegisterApplicationFromTemplate(ctx context.Context, in graphql.ApplicationFromTemplateInput) (*graphql.Application, error) {
return r.appTemplate.RegisterApplicationFromTemplate(ctx, in)
}
// UpdateApplicationTemplate missing godoc
func (r *mutationResolver) UpdateApplicationTemplate(ctx context.Context, id string, override *bool, in graphql.ApplicationTemplateUpdateInput) (*graphql.ApplicationTemplate, error) {
return r.appTemplate.UpdateApplicationTemplate(ctx, id, override, in)
}
// DeleteApplicationTemplate missing godoc
func (r *mutationResolver) DeleteApplicationTemplate(ctx context.Context, id string) (*graphql.ApplicationTemplate, error) {
return r.appTemplate.DeleteApplicationTemplate(ctx, id)
}
// AddWebhook missing godoc
func (r *mutationResolver) AddWebhook(ctx context.Context, applicationID *string, applicationTemplateID *string, runtimeID *string, formationTemplateID *string, in graphql.WebhookInput) (*graphql.Webhook, error) {
return r.webhook.AddWebhook(ctx, applicationID, applicationTemplateID, runtimeID, formationTemplateID, in)
}
// UpdateWebhook missing godoc
func (r *mutationResolver) UpdateWebhook(ctx context.Context, webhookID string, in graphql.WebhookInput) (*graphql.Webhook, error) {
return r.webhook.UpdateWebhook(ctx, webhookID, in)
}
// DeleteWebhook missing godoc
func (r *mutationResolver) DeleteWebhook(ctx context.Context, webhookID string) (*graphql.Webhook, error) {
return r.webhook.DeleteWebhook(ctx, webhookID)
}
// UpdateAPIDefinition missing godoc
func (r *mutationResolver) UpdateAPIDefinition(ctx context.Context, id string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error) {
return r.api.UpdateAPIDefinition(ctx, id, in)
}
// UpdateAPIDefinitionForApplication updates an API Definition for a given application ID
func (r *mutationResolver) UpdateAPIDefinitionForApplication(ctx context.Context, id string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error) {
return r.api.UpdateAPIDefinitionForApplication(ctx, id, in)
}
// DeleteAPIDefinition missing godoc
func (r *mutationResolver) DeleteAPIDefinition(ctx context.Context, id string) (*graphql.APIDefinition, error) {
return r.api.DeleteAPIDefinition(ctx, id)
}
// RefetchAPISpec missing godoc
func (r *mutationResolver) RefetchAPISpec(ctx context.Context, apiID string) (*graphql.APISpec, error) {
return r.api.RefetchAPISpec(ctx, apiID)
}
// UpdateEventDefinition missing godoc
func (r *mutationResolver) UpdateEventDefinition(ctx context.Context, id string, in graphql.EventDefinitionInput) (*graphql.EventDefinition, error) {
return r.eventAPI.UpdateEventDefinition(ctx, id, in)
}
// UpdateEventDefinitionForApplication updates an Event Definition for a given application ID
func (r *mutationResolver) UpdateEventDefinitionForApplication(ctx context.Context, id string, in graphql.EventDefinitionInput) (*graphql.EventDefinition, error) {
return r.eventAPI.UpdateEventDefinitionForApplication(ctx, id, in)
}
// DeleteEventDefinition missing godoc
func (r *mutationResolver) DeleteEventDefinition(ctx context.Context, id string) (*graphql.EventDefinition, error) {
return r.eventAPI.DeleteEventDefinition(ctx, id)
}
// RefetchEventDefinitionSpec missing godoc
func (r *mutationResolver) RefetchEventDefinitionSpec(ctx context.Context, eventID string) (*graphql.EventSpec, error) {
return r.eventAPI.RefetchEventDefinitionSpec(ctx, eventID)
}
// RegisterRuntime missing godoc
func (r *mutationResolver) RegisterRuntime(ctx context.Context, in graphql.RuntimeRegisterInput) (*graphql.Runtime, error) {
return r.runtime.RegisterRuntime(ctx, in)
}
// UpdateRuntime missing godoc
func (r *mutationResolver) UpdateRuntime(ctx context.Context, id string, in graphql.RuntimeUpdateInput) (*graphql.Runtime, error) {
return r.runtime.UpdateRuntime(ctx, id, in)
}
// UnregisterRuntime missing godoc
func (r *mutationResolver) UnregisterRuntime(ctx context.Context, id string) (*graphql.Runtime, error) {
return r.runtime.DeleteRuntime(ctx, id)
}
// RegisterRuntimeContext missing godoc
func (r *mutationResolver) RegisterRuntimeContext(ctx context.Context, runtimeID string, in graphql.RuntimeContextInput) (*graphql.RuntimeContext, error) {
return r.runtimeContext.RegisterRuntimeContext(ctx, runtimeID, in)
}
// UpdateRuntimeContext missing godoc
func (r *mutationResolver) UpdateRuntimeContext(ctx context.Context, id string, in graphql.RuntimeContextInput) (*graphql.RuntimeContext, error) {
return r.runtimeContext.UpdateRuntimeContext(ctx, id, in)
}
// UnregisterRuntimeContext missing godoc
func (r *mutationResolver) UnregisterRuntimeContext(ctx context.Context, id string) (*graphql.RuntimeContext, error) {
return r.runtimeContext.DeleteRuntimeContext(ctx, id)
}
// DeleteDocument missing godoc
func (r *mutationResolver) DeleteDocument(ctx context.Context, id string) (*graphql.Document, error) {
return r.doc.DeleteDocument(ctx, id)
}
// CreateLabelDefinition missing godoc
func (r *mutationResolver) CreateLabelDefinition(ctx context.Context, in graphql.LabelDefinitionInput) (*graphql.LabelDefinition, error) {
return r.labelDef.CreateLabelDefinition(ctx, in)
}
// UpdateLabelDefinition missing godoc
func (r *mutationResolver) UpdateLabelDefinition(ctx context.Context, in graphql.LabelDefinitionInput) (*graphql.LabelDefinition, error) {
return r.labelDef.UpdateLabelDefinition(ctx, in)
}
// SetApplicationLabel missing godoc
func (r *mutationResolver) SetApplicationLabel(ctx context.Context, applicationID string, key string, value interface{}) (*graphql.Label, error) {
return r.app.SetApplicationLabel(ctx, applicationID, key, value)
}
// DeleteApplicationLabel missing godoc
func (r *mutationResolver) DeleteApplicationLabel(ctx context.Context, applicationID string, key string) (*graphql.Label, error) {
return r.app.DeleteApplicationLabel(ctx, applicationID, key)
}
// SetRuntimeLabel missing godoc
func (r *mutationResolver) SetRuntimeLabel(ctx context.Context, runtimeID string, key string, value interface{}) (*graphql.Label, error) {
return r.runtime.SetRuntimeLabel(ctx, runtimeID, key, value)
}
// DeleteRuntimeLabel missing godoc
func (r *mutationResolver) DeleteRuntimeLabel(ctx context.Context, runtimeID string, key string) (*graphql.Label, error) {
return r.runtime.DeleteRuntimeLabel(ctx, runtimeID, key)
}
// SetFormationTemplateLabel add the provided label key and value to a formation template with the specified ID.
// If the label does not exist, it will be created. In case the label is already present, it will be updated with the provided value.
func (r *mutationResolver) SetFormationTemplateLabel(ctx context.Context, formationTemplateID string, lblInput graphql.LabelInput) (*graphql.Label, error) {
return r.formationTemplate.SetFormationTemplateLabel(ctx, formationTemplateID, lblInput)
}
// DeleteFormationTemplateLabel deletes a formation template label with the specified label key and formation template ID
func (r *mutationResolver) DeleteFormationTemplateLabel(ctx context.Context, formationTemplateID string, key string) (*graphql.Label, error) {
return r.formationTemplate.DeleteFormationTemplateLabel(ctx, formationTemplateID, key)
}
// RequestOneTimeTokenForApplication missing godoc
func (r *mutationResolver) RequestOneTimeTokenForApplication(ctx context.Context, id string, systemAuthID *string) (*graphql.OneTimeTokenForApplication, error) {
return r.token.RequestOneTimeTokenForApplication(ctx, id, systemAuthID)
}
// RequestOneTimeTokenForRuntime missing godoc
func (r *mutationResolver) RequestOneTimeTokenForRuntime(ctx context.Context, id string, systemAuthID *string) (*graphql.OneTimeTokenForRuntime, error) {
return r.token.RequestOneTimeTokenForRuntime(ctx, id, systemAuthID)
}
// RequestClientCredentialsForRuntime missing godoc