forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.go
2826 lines (2695 loc) · 201 KB
/
schema.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
// Code generated by go-jsonschema-compiler. DO NOT EDIT.
package schema
import (
"encoding/json"
"errors"
"fmt"
)
// AWSCodeCommitConnection description: Configuration for a connection to AWS CodeCommit.
type AWSCodeCommitConnection struct {
// AccessKeyID description: The AWS access key ID to use when listing and updating repositories from AWS CodeCommit. Must have the AWSCodeCommitReadOnly IAM policy.
AccessKeyID string `json:"accessKeyID"`
// Exclude description: A list of repositories to never mirror from AWS CodeCommit.
//
// Supports excluding by name ({"name": "git-codecommit.us-west-1.amazonaws.com/repo-name"}) or by ARN ({"id": "arn:aws:codecommit:us-west-1:999999999999:name"}).
Exclude []*ExcludedAWSCodeCommitRepo `json:"exclude,omitempty"`
// GitCredentials description: The Git credentials used for authentication when cloning an AWS CodeCommit repository over HTTPS.
//
// See the AWS CodeCommit documentation on Git credentials for CodeCommit: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html#git-credentials-code-commit.
// For detailed instructions on how to create the credentials in IAM, see this page: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html
GitCredentials AWSCodeCommitGitCredentials `json:"gitCredentials"`
// InitialRepositoryEnablement description: Deprecated and ignored field which will be removed entirely in the next release. AWS CodeCommit repositories can no longer be enabled or disabled explicitly. Configure which repositories should not be mirrored via "exclude" instead.
InitialRepositoryEnablement bool `json:"initialRepositoryEnablement,omitempty"`
// Region description: The AWS region in which to access AWS CodeCommit. See the list of supported regions at https://docs.aws.amazon.com/codecommit/latest/userguide/regions.html#regions-git.
Region string `json:"region"`
// RepositoryPathPattern description: The pattern used to generate a the corresponding Sourcegraph repository name for an AWS CodeCommit repository. In the pattern, the variable "{name}" is replaced with the repository's name.
//
// For example, if your Sourcegraph instance is at https://src.example.com, then a repositoryPathPattern of "awsrepos/{name}" would mean that a AWS CodeCommit repository named "myrepo" is available on Sourcegraph at https://src.example.com/awsrepos/myrepo.
//
// It is important that the Sourcegraph repository name generated with this pattern be unique to this code host. If different code hosts generate repository names that collide, Sourcegraph's behavior is undefined.
RepositoryPathPattern string `json:"repositoryPathPattern,omitempty"`
// SecretAccessKey description: The AWS secret access key (that corresponds to the AWS access key ID set in `accessKeyID`).
SecretAccessKey string `json:"secretAccessKey"`
}
// AWSCodeCommitGitCredentials description: The Git credentials used for authentication when cloning an AWS CodeCommit repository over HTTPS.
//
// See the AWS CodeCommit documentation on Git credentials for CodeCommit: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html#git-credentials-code-commit.
// For detailed instructions on how to create the credentials in IAM, see this page: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html
type AWSCodeCommitGitCredentials struct {
// Password description: The Git password
Password string `json:"password"`
// Username description: The Git username
Username string `json:"username"`
}
// AWSKMSEncryptionKey description: AWS KMS Encryption Key, used to encrypt data in AWS environments
type AWSKMSEncryptionKey struct {
CredentialsFile string `json:"credentialsFile,omitempty"`
KeyId string `json:"keyId"`
Region string `json:"region,omitempty"`
Type string `json:"type"`
}
// App description: Configuration options for App only.
type App struct {
// DotcomAuthToken description: Authentication token for Sourcegraph.com. If present, indicates that the App account is connected to a Sourcegraph.com account.
DotcomAuthToken string `json:"dotcomAuthToken,omitempty"`
}
type AppNotifications struct {
// Key description: e.g. '2023-03-10-my-key'; MUST START WITH YYYY-MM-DD; a globally unique key used to track whether the message has been dismissed.
Key string `json:"key"`
// Message description: The Markdown message to display
Message string `json:"message"`
// VersionMax description: If present, this message will only be shown to Sourcegraph App instances in this inclusive version range.
VersionMax string `json:"version.max,omitempty"`
// VersionMin description: If present, this message will only be shown to Sourcegraph App instances in this inclusive version range.
VersionMin string `json:"version.min,omitempty"`
}
// AuditLog description: EXPERIMENTAL: Configuration for audit logging (specially formatted log entries for tracking sensitive events)
type AuditLog struct {
// GitserverAccess description: Capture gitserver access logs as part of the audit log.
GitserverAccess bool `json:"gitserverAccess"`
// GraphQL description: Capture GraphQL requests and responses as part of the audit log.
GraphQL bool `json:"graphQL"`
// InternalTraffic description: Capture security events performed by the internal traffic (adds significant noise).
InternalTraffic bool `json:"internalTraffic"`
// SeverityLevel description: Severity logging level for the audit log.
SeverityLevel string `json:"severityLevel,omitempty"`
}
// AuthAccessRequest description: The config options for access requests
type AuthAccessRequest struct {
// Enabled description: Enable/disable the access request feature, which allows users to request access if built-in signup is disabled.
Enabled *bool `json:"enabled,omitempty"`
}
// AuthAccessTokens description: Settings for access tokens, which enable external tools to access the Sourcegraph API with the privileges of the user.
type AuthAccessTokens struct {
// Allow description: Allow or restrict the use of access tokens. The default is "all-users-create", which enables all users to create access tokens. Use "none" to disable access tokens entirely. Use "site-admin-create" to restrict creation of new tokens to admin users (existing tokens will still work until revoked).
Allow string `json:"allow,omitempty"`
}
// AuthLockout description: The config options for account lockout
type AuthLockout struct {
// ConsecutivePeriod description: The number of seconds to be considered as a consecutive period
ConsecutivePeriod int `json:"consecutivePeriod,omitempty"`
// FailedAttemptThreshold description: The threshold of failed sign-in attempts in a consecutive period
FailedAttemptThreshold int `json:"failedAttemptThreshold,omitempty"`
// LockoutPeriod description: The number of seconds for the lockout period
LockoutPeriod int `json:"lockoutPeriod,omitempty"`
}
// AuthPasswordPolicy description: Enables and configures password policy. This will allow admins to enforce password complexity and length requirements.
type AuthPasswordPolicy struct {
// Enabled description: Enables password policy
Enabled bool `json:"enabled,omitempty"`
// NumberOfSpecialCharacters description: The required number of special characters
NumberOfSpecialCharacters int `json:"numberOfSpecialCharacters,omitempty"`
// RequireAtLeastOneNumber description: Does the password require a number
RequireAtLeastOneNumber bool `json:"requireAtLeastOneNumber,omitempty"`
// RequireUpperandLowerCase description: Require Mixed characters
RequireUpperandLowerCase bool `json:"requireUpperandLowerCase,omitempty"`
}
// AuthProviderCommon description: Common properties for authentication providers.
type AuthProviderCommon struct {
// DisplayName description: The name to use when displaying this authentication provider in the UI. Defaults to an auto-generated name with the type of authentication provider and other relevant identifiers (such as a hostname).
DisplayName string `json:"displayName,omitempty"`
// DisplayPrefix description: Defines the prefix of the auth provider button on the login screen. By default we show `Continue with <displayName>`. This propery allows you to change the `Continue with ` part to something else. Useful in cases where the displayName is not compatible with the prefix.
DisplayPrefix *string `json:"displayPrefix,omitempty"`
// Hidden description: Hides the configured auth provider from regular use through our web interface by omitting it from the JSContext, useful for experimental auth setups.
Hidden bool `json:"hidden,omitempty"`
// Order description: Determines order of auth providers on the login screen. Ordered as numbers, for example 1, 2, 3.
Order int `json:"order,omitempty"`
}
type AuthProviders struct {
AzureDevOps *AzureDevOpsAuthProvider
Bitbucketcloud *BitbucketCloudAuthProvider
Builtin *BuiltinAuthProvider
Gerrit *GerritAuthProvider
Github *GitHubAuthProvider
Gitlab *GitLabAuthProvider
HttpHeader *HTTPHeaderAuthProvider
Openidconnect *OpenIDConnectAuthProvider
Saml *SAMLAuthProvider
}
func (v AuthProviders) MarshalJSON() ([]byte, error) {
if v.AzureDevOps != nil {
return json.Marshal(v.AzureDevOps)
}
if v.Bitbucketcloud != nil {
return json.Marshal(v.Bitbucketcloud)
}
if v.Builtin != nil {
return json.Marshal(v.Builtin)
}
if v.Gerrit != nil {
return json.Marshal(v.Gerrit)
}
if v.Github != nil {
return json.Marshal(v.Github)
}
if v.Gitlab != nil {
return json.Marshal(v.Gitlab)
}
if v.HttpHeader != nil {
return json.Marshal(v.HttpHeader)
}
if v.Openidconnect != nil {
return json.Marshal(v.Openidconnect)
}
if v.Saml != nil {
return json.Marshal(v.Saml)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *AuthProviders) UnmarshalJSON(data []byte) error {
var d struct {
DiscriminantProperty string `json:"type"`
}
if err := json.Unmarshal(data, &d); err != nil {
return err
}
switch d.DiscriminantProperty {
case "azureDevOps":
return json.Unmarshal(data, &v.AzureDevOps)
case "bitbucketcloud":
return json.Unmarshal(data, &v.Bitbucketcloud)
case "builtin":
return json.Unmarshal(data, &v.Builtin)
case "gerrit":
return json.Unmarshal(data, &v.Gerrit)
case "github":
return json.Unmarshal(data, &v.Github)
case "gitlab":
return json.Unmarshal(data, &v.Gitlab)
case "http-header":
return json.Unmarshal(data, &v.HttpHeader)
case "openidconnect":
return json.Unmarshal(data, &v.Openidconnect)
case "saml":
return json.Unmarshal(data, &v.Saml)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"azureDevOps", "bitbucketcloud", "builtin", "gerrit", "github", "gitlab", "http-header", "openidconnect", "saml"})
}
// AzureDevOpsAuthProvider description: Azure auth provider for dev.azure.com
type AzureDevOpsAuthProvider struct {
// AllowOrgs description: Restricts new logins and signups (if allowSignup is true) to members of these Azure DevOps organizations only. Existing sessions won't be invalidated. Leave empty or unset for no org restrictions.
AllowOrgs []string `json:"allowOrgs,omitempty"`
// AllowSignup description: Allows new visitors to sign up for accounts Azure DevOps authentication. If false, users signing in via Azure DevOps must have an existing Sourcegraph account, which will be linked to their Azure DevOps identity after sign-in.
AllowSignup *bool `json:"allowSignup,omitempty"`
// ApiScope description: The OAuth API scope that should be used
ApiScope string `json:"apiScope,omitempty"`
// ClientID description: The app ID of the Azure OAuth app.
ClientID string `json:"clientID"`
// ClientSecret description: The client Secret of the Azure OAuth app.
ClientSecret string `json:"clientSecret"`
DisplayName string `json:"displayName,omitempty"`
DisplayPrefix *string `json:"displayPrefix,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Order int `json:"order,omitempty"`
Type string `json:"type"`
}
// AzureDevOpsConnection description: Configuration for a connection to Azure DevOps.
type AzureDevOpsConnection struct {
// EnforcePermissions description: A flag to enforce Azure DevOps repository access permissions
EnforcePermissions bool `json:"enforcePermissions,omitempty"`
// Exclude description: A list of repositories to never mirror from Azure DevOps Services.
Exclude []*ExcludedAzureDevOpsServerRepo `json:"exclude,omitempty"`
// Orgs description: An array of organization names identifying Azure DevOps organizations whose repositories should be mirrored on Sourcegraph.
Orgs []string `json:"orgs,omitempty"`
// Projects description: An array of projects "org/project" strings specifying which Azure DevOps projects' repositories should be mirrored on Sourcegraph.
Projects []string `json:"projects,omitempty"`
// Token description: The Personal Access Token associated with the Azure DevOps username used for authentication.
Token string `json:"token"`
// Url description: URL for Azure DevOps Services, set to https://dev.azure.com.
Url string `json:"url"`
// Username description: A username for authentication with the Azure DevOps code host.
Username string `json:"username"`
}
type BatchChangeRolloutWindow struct {
// Days description: Day(s) the window applies to. If omitted, this rule applies to all days of the week.
Days []string `json:"days,omitempty"`
// End description: Window end time. If omitted, no time window is applied to the day(s) that match this rule.
End string `json:"end,omitempty"`
// Rate description: The rate changesets will be published at.
Rate any `json:"rate"`
// Start description: Window start time. If omitted, no time window is applied to the day(s) that match this rule.
Start string `json:"start,omitempty"`
}
// BatchSpec description: A batch specification, which describes the batch change and what kinds of changes to make (or what existing changesets to track).
type BatchSpec struct {
// ChangesetTemplate description: A template describing how to create (and update) changesets with the file changes produced by the command steps.
ChangesetTemplate *ChangesetTemplate `json:"changesetTemplate,omitempty"`
// Description description: The description of the batch change.
Description string `json:"description,omitempty"`
// ImportChangesets description: Import existing changesets on code hosts.
ImportChangesets []*ImportChangesets `json:"importChangesets,omitempty"`
// Name description: The name of the batch change, which is unique among all batch changes in the namespace. A batch change's name is case-preserving.
Name string `json:"name"`
// On description: The set of repositories (and branches) to run the batch change on, specified as a list of search queries (that match repositories) and/or specific repositories.
On []any `json:"on,omitempty"`
// Steps description: The sequence of commands to run (for each repository branch matched in the `on` property) to produce the workspace changes that will be included in the batch change.
Steps []*Step `json:"steps,omitempty"`
// TransformChanges description: Optional transformations to apply to the changes produced in each repository.
TransformChanges *TransformChanges `json:"transformChanges,omitempty"`
// Workspaces description: Individual workspace configurations for one or more repositories that define which workspaces to use for the execution of steps in the repositories.
Workspaces []*WorkspaceConfiguration `json:"workspaces,omitempty"`
}
// BitbucketCloudAuthProvider description: Configures the Bitbucket Cloud OAuth authentication provider for SSO. In addition to specifying this configuration object, you must also create a OAuth App on your Bitbucket Cloud workspace: https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/. The application should have account, email, and repository scopes and the callback URL set to the concatenation of your Sourcegraph instance URL and "/.auth/bitbucketcloud/callback".
type BitbucketCloudAuthProvider struct {
// AllowSignup description: Allows new visitors to sign up for accounts via Bitbucket Cloud authentication. If false, users signing in via Bitbucket Cloud must have an existing Sourcegraph account, which will be linked to their Bitbucket Cloud identity after sign-in.
AllowSignup bool `json:"allowSignup,omitempty"`
// ApiScope description: The OAuth API scope that should be used
ApiScope string `json:"apiScope,omitempty"`
// ClientKey description: The Key of the Bitbucket OAuth app.
ClientKey string `json:"clientKey"`
// ClientSecret description: The Client Secret of the Bitbucket OAuth app.
ClientSecret string `json:"clientSecret"`
DisplayName string `json:"displayName,omitempty"`
DisplayPrefix *string `json:"displayPrefix,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Order int `json:"order,omitempty"`
Type string `json:"type"`
// Url description: URL of the Bitbucket Cloud instance.
Url string `json:"url,omitempty"`
}
// BitbucketCloudAuthorization description: If non-null, enforces Bitbucket Cloud repository permissions. This requires that there is an item in the [site configuration json](https://docs.sourcegraph.com/admin/config/site_config#auth-providers) `auth.providers` field, of type "bitbucketcloud" with the same `url` field as specified in this `BitbucketCloudConnection`.
type BitbucketCloudAuthorization struct {
// IdentityProvider description: The identity provider to use for user information. If not set, the `url` field is used.
IdentityProvider string `json:"identityProvider,omitempty"`
}
// BitbucketCloudConnection description: Configuration for a connection to Bitbucket Cloud.
type BitbucketCloudConnection struct {
// ApiURL description: The API URL of Bitbucket Cloud, such as https://api.bitbucket.org. Generally, admin should not modify the value of this option because Bitbucket Cloud is a public hosting platform.
ApiURL string `json:"apiURL,omitempty"`
// AppPassword description: The app password to use when authenticating to the Bitbucket Cloud. Also set the corresponding "username" field.
AppPassword string `json:"appPassword"`
// Authorization description: If non-null, enforces Bitbucket Cloud repository permissions. This requires that there is an item in the [site configuration json](https://docs.sourcegraph.com/admin/config/site_config#auth-providers) `auth.providers` field, of type "bitbucketcloud" with the same `url` field as specified in this `BitbucketCloudConnection`.
Authorization *BitbucketCloudAuthorization `json:"authorization,omitempty"`
// Exclude description: A list of repositories to never mirror from Bitbucket Cloud. Takes precedence over "teams" configuration.
//
// Supports excluding by name ({"name": "myorg/myrepo"}) or by UUID ({"uuid": "{fceb73c7-cef6-4abe-956d-e471281126bd}"}).
Exclude []*ExcludedBitbucketCloudRepo `json:"exclude,omitempty"`
// GitURLType description: The type of Git URLs to use for cloning and fetching Git repositories on this Bitbucket Cloud.
//
// If "http", Sourcegraph will access Bitbucket Cloud repositories using Git URLs of the form https://bitbucket.org/myteam/myproject.git.
//
// If "ssh", Sourcegraph will access Bitbucket Cloud repositories using Git URLs of the form git@bitbucket.org:myteam/myproject.git. See the documentation for how to provide SSH private keys and known_hosts: https://docs.sourcegraph.com/admin/repo/auth#repositories-that-need-http-s-or-ssh-authentication.
GitURLType string `json:"gitURLType,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to Bitbucket Cloud.
RateLimit *BitbucketCloudRateLimit `json:"rateLimit,omitempty"`
// RepositoryPathPattern description: The pattern used to generate the corresponding Sourcegraph repository name for a Bitbucket Cloud repository.
//
// - "{host}" is replaced with the Bitbucket Cloud URL's host (such as bitbucket.org), and "{nameWithOwner}" is replaced with the Bitbucket Cloud repository's "owner/path" (such as "myorg/myrepo").
//
// For example, if your Bitbucket Cloud is https://bitbucket.org and your Sourcegraph is https://src.example.com, then a repositoryPathPattern of "{host}/{nameWithOwner}" would mean that a Bitbucket Cloud repository at https://bitbucket.org/alice/my-repo is available on Sourcegraph at https://src.example.com/bitbucket.org/alice/my-repo.
//
// It is important that the Sourcegraph repository name generated with this pattern be unique to this code host. If different code hosts generate repository names that collide, Sourcegraph's behavior is undefined.
RepositoryPathPattern string `json:"repositoryPathPattern,omitempty"`
// Teams description: An array of team names identifying Bitbucket Cloud teams whose repositories should be mirrored on Sourcegraph.
Teams []string `json:"teams,omitempty"`
// Url description: URL of Bitbucket Cloud, such as https://bitbucket.org. Generally, admin should not modify the value of this option because Bitbucket Cloud is a public hosting platform.
Url string `json:"url"`
// Username description: The username to use when authenticating to the Bitbucket Cloud. Also set the corresponding "appPassword" field.
Username string `json:"username"`
// WebhookSecret description: A shared secret used to authenticate incoming webhooks (minimum 12 characters).
WebhookSecret string `json:"webhookSecret,omitempty"`
}
// BitbucketCloudRateLimit description: Rate limit applied when making background API requests to Bitbucket Cloud.
type BitbucketCloudRateLimit struct {
// Enabled description: true if rate limiting is enabled.
Enabled bool `json:"enabled"`
// RequestsPerHour description: Requests per hour permitted. This is an average, calculated per second. Internally, the burst limit is set to 500, which implies that for a requests per hour limit as low as 1, users will continue to be able to send a maximum of 500 requests immediately, provided that the complexity cost of each request is 1.
RequestsPerHour float64 `json:"requestsPerHour"`
}
// BitbucketServerAuthorization description: If non-null, enforces Bitbucket Server / Bitbucket Data Center repository permissions.
type BitbucketServerAuthorization struct {
// IdentityProvider description: The source of identity to use when computing permissions. This defines how to compute the Bitbucket Server / Bitbucket Data Center identity to use for a given Sourcegraph user. When 'username' is used, Sourcegraph assumes usernames are identical in Sourcegraph and Bitbucket Server / Bitbucket Data Center accounts and `auth.enableUsernameChanges` must be set to false for security reasons.
IdentityProvider BitbucketServerIdentityProvider `json:"identityProvider"`
// Oauth description: OAuth configuration specified when creating the Bitbucket Server / Bitbucket Data Center Application Link with incoming authentication. Two Legged OAuth with 'ExecuteAs=admin' must be enabled as well as user impersonation.
Oauth BitbucketServerOAuth `json:"oauth"`
}
// BitbucketServerConnection description: Configuration for a connection to Bitbucket Server / Bitbucket Data Center.
type BitbucketServerConnection struct {
// Authorization description: If non-null, enforces Bitbucket Server / Bitbucket Data Center repository permissions.
Authorization *BitbucketServerAuthorization `json:"authorization,omitempty"`
// Certificate description: TLS certificate of the Bitbucket Server / Bitbucket Data Center instance. This is only necessary if the certificate is self-signed or signed by an internal CA. To get the certificate run `openssl s_client -connect HOST:443 -showcerts < /dev/null 2> /dev/null | openssl x509 -outform PEM`. To escape the value into a JSON string, you may want to use a tool like https://json-escape-text.now.sh.
Certificate string `json:"certificate,omitempty"`
// Exclude description: A list of repositories to never mirror from this Bitbucket Server / Bitbucket Data Center instance. Takes precedence over "repos" and "repositoryQuery".
//
// Supports excluding by name ({"name": "projectKey/repositorySlug"}) or by ID ({"id": 42}).
Exclude []*ExcludedBitbucketServerRepo `json:"exclude,omitempty"`
// ExcludePersonalRepositories description: Whether or not personal repositories should be excluded or not. When true, Sourcegraph will ignore personal repositories it may have access to. See https://docs.sourcegraph.com/integration/bitbucket_server#excluding-personal-repositories for more information.
ExcludePersonalRepositories bool `json:"excludePersonalRepositories,omitempty"`
// GitURLType description: The type of Git URLs to use for cloning and fetching Git repositories on this Bitbucket Server / Bitbucket Data Center instance.
//
// If "http", Sourcegraph will access Bitbucket Server / Bitbucket Data Center repositories using Git URLs of the form http(s)://bitbucket.example.com/scm/myproject/myrepo.git (using https: if the Bitbucket Server / Bitbucket Data Center instance uses HTTPS).
//
// If "ssh", Sourcegraph will access Bitbucket Server / Bitbucket Data Center repositories using Git URLs of the form ssh://git@example.bitbucket.org/myproject/myrepo.git. See the documentation for how to provide SSH private keys and known_hosts: https://docs.sourcegraph.com/admin/repo/auth#repositories-that-need-http-s-or-ssh-authentication.
GitURLType string `json:"gitURLType,omitempty"`
// InitialRepositoryEnablement description: Deprecated and ignored field which will be removed entirely in the next release. BitBucket repositories can no longer be enabled or disabled explicitly.
InitialRepositoryEnablement bool `json:"initialRepositoryEnablement,omitempty"`
// Password description: The password to use when authenticating to the Bitbucket Server / Bitbucket Data Center instance. Also set the corresponding "username" field.
//
// For Bitbucket Server / Bitbucket Data Center instances that support personal access tokens (Bitbucket Server / Bitbucket Data Center version 5.5 and newer), it is recommended to provide a token instead (in the "token" field).
Password string `json:"password,omitempty"`
// Plugin description: Configuration for Bitbucket Server / Bitbucket Data Center Sourcegraph plugin
Plugin *BitbucketServerPlugin `json:"plugin,omitempty"`
// ProjectKeys description: An array of project key strings that defines a collection of repositories related to their associated project keys
ProjectKeys []string `json:"projectKeys,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to BitbucketServer.
RateLimit *BitbucketServerRateLimit `json:"rateLimit,omitempty"`
// Repos description: An array of repository "projectKey/repositorySlug" strings specifying repositories to mirror on Sourcegraph.
Repos []string `json:"repos,omitempty"`
// RepositoryPathPattern description: The pattern used to generate the corresponding Sourcegraph repository name for a Bitbucket Server / Bitbucket Data Center repository.
//
// - "{host}" is replaced with the Bitbucket Server / Bitbucket Data Center URL's host (such as bitbucket.example.com)
// - "{projectKey}" is replaced with the Bitbucket repository's parent project key (such as "PRJ")
// - "{repositorySlug}" is replaced with the Bitbucket repository's slug key (such as "my-repo").
//
// For example, if your Bitbucket Server / Bitbucket Data Center is https://bitbucket.example.com and your Sourcegraph is https://src.example.com, then a repositoryPathPattern of "{host}/{projectKey}/{repositorySlug}" would mean that a Bitbucket Server / Bitbucket Data Center repository at https://bitbucket.example.com/projects/PRJ/repos/my-repo is available on Sourcegraph at https://src.example.com/bitbucket.example.com/PRJ/my-repo.
//
// It is important that the Sourcegraph repository name generated with this pattern be unique to this code host. If different code hosts generate repository names that collide, Sourcegraph's behavior is undefined.
RepositoryPathPattern string `json:"repositoryPathPattern,omitempty"`
// RepositoryQuery description: An array of strings specifying which repositories to mirror on Sourcegraph. Each string is a URL query string with parameters that filter the list of returned repos. Examples: "?name=my-repo&projectname=PROJECT&visibility=private".
//
// The special string "none" can be used as the only element to disable this feature. Repositories matched by multiple query strings are only imported once. Here's the official Bitbucket Server / Bitbucket Data Center documentation about which query string parameters are valid: https://docs.atlassian.com/bitbucket-server/rest/6.1.2/bitbucket-rest.html#idp355
RepositoryQuery []string `json:"repositoryQuery,omitempty"`
// Token description: A Bitbucket Server / Bitbucket Data Center personal access token with Read permissions. When using batch changes, the token needs Write permissions. Create one at https://[your-bitbucket-hostname]/plugins/servlet/access-tokens/add. Also set the corresponding "username" field.
//
// For Bitbucket Server / Bitbucket Data Center instances that don't support personal access tokens (Bitbucket Server / Bitbucket Data Center version 5.4 and older), specify user-password credentials in the "username" and "password" fields.
Token string `json:"token,omitempty"`
// Url description: URL of a Bitbucket Server / Bitbucket Data Center instance, such as https://bitbucket.example.com.
Url string `json:"url"`
// Username description: The username to use when authenticating to the Bitbucket Server / Bitbucket Data Center instance. Also set the corresponding "token" or "password" field.
Username string `json:"username"`
// Webhooks description: DEPRECATED: Switch to "plugin.webhooks"
Webhooks *Webhooks `json:"webhooks,omitempty"`
}
// BitbucketServerIdentityProvider description: The source of identity to use when computing permissions. This defines how to compute the Bitbucket Server / Bitbucket Data Center identity to use for a given Sourcegraph user. When 'username' is used, Sourcegraph assumes usernames are identical in Sourcegraph and Bitbucket Server / Bitbucket Data Center accounts and `auth.enableUsernameChanges` must be set to false for security reasons.
type BitbucketServerIdentityProvider struct {
Username *BitbucketServerUsernameIdentity
}
func (v BitbucketServerIdentityProvider) MarshalJSON() ([]byte, error) {
if v.Username != nil {
return json.Marshal(v.Username)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *BitbucketServerIdentityProvider) UnmarshalJSON(data []byte) error {
var d struct {
DiscriminantProperty string `json:"type"`
}
if err := json.Unmarshal(data, &d); err != nil {
return err
}
switch d.DiscriminantProperty {
case "username":
return json.Unmarshal(data, &v.Username)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"username"})
}
// BitbucketServerOAuth description: OAuth configuration specified when creating the Bitbucket Server / Bitbucket Data Center Application Link with incoming authentication. Two Legged OAuth with 'ExecuteAs=admin' must be enabled as well as user impersonation.
type BitbucketServerOAuth struct {
// ConsumerKey description: The OAuth consumer key specified when creating the Bitbucket Server / Bitbucket Data Center Application Link with incoming authentication.
ConsumerKey string `json:"consumerKey"`
// SigningKey description: Base64 encoding of the OAuth PEM encoded RSA private key used to generate the public key specified when creating the Bitbucket Server / Bitbucket Data Center Application Link with incoming authentication.
SigningKey string `json:"signingKey"`
}
// BitbucketServerPlugin description: Configuration for Bitbucket Server / Bitbucket Data Center Sourcegraph plugin
type BitbucketServerPlugin struct {
// Permissions description: Enables fetching Bitbucket Server / Bitbucket Data Center permissions through the roaring bitmap endpoint. Warning: there may be performance degradation under significant load.
Permissions string `json:"permissions,omitempty"`
Webhooks *BitbucketServerPluginWebhooks `json:"webhooks,omitempty"`
}
type BitbucketServerPluginWebhooks struct {
// DisableSync description: Disallow Sourcegraph from automatically syncing webhook config with the Bitbucket Server / Bitbucket Data Center instance. For details of how the webhook is configured, see our docs: https://docs.sourcegraph.com/admin/external_service/bitbucket_server#webhooks
DisableSync bool `json:"disableSync,omitempty"`
// Secret description: Secret for authenticating incoming webhook payloads
Secret string `json:"secret"`
}
// BitbucketServerRateLimit description: Rate limit applied when making background API requests to BitbucketServer.
type BitbucketServerRateLimit struct {
// Enabled description: true if rate limiting is enabled.
Enabled bool `json:"enabled"`
// RequestsPerHour description: Requests per hour permitted. This is an average, calculated per second. Internally, the burst limit is set to 500, which implies that for a requests per hour limit as low as 1, users will continue to be able to send a maximum of 500 requests immediately, provided that the complexity cost of each request is 1.
RequestsPerHour float64 `json:"requestsPerHour"`
}
type BitbucketServerUsernameIdentity struct {
Type string `json:"type"`
}
type BranchChangesetSpec struct {
// BaseRef description: The full name of the Git ref in the base repository that this changeset is based on (and is proposing to be merged into). This ref must exist on the base repository.
BaseRef string `json:"baseRef"`
// BaseRepository description: The GraphQL ID of the repository that this changeset spec is proposing to change.
BaseRepository string `json:"baseRepository"`
// BaseRev description: The base revision this changeset is based on. It is the latest commit in baseRef at the time when the changeset spec was created.
BaseRev string `json:"baseRev"`
// Body description: The body (description) of the changeset on the code host.
Body string `json:"body"`
// Commits description: The Git commits with the proposed changes. These commits are pushed to the head ref.
Commits []*GitCommitDescription `json:"commits"`
// HeadRef description: The full name of the Git ref that holds the changes proposed by this changeset. This ref will be created or updated with the commits.
HeadRef string `json:"headRef"`
// HeadRepository description: The GraphQL ID of the repository that contains the branch with this changeset's changes. Fork repositories and cross-repository changesets are not yet supported. Therefore, headRepository must be equal to baseRepository.
HeadRepository string `json:"headRepository"`
// Published description: Whether to publish the changeset. An unpublished changeset can be previewed on Sourcegraph by any person who can view the batch change, but its commit, branch, and pull request aren't created on the code host. A published changeset results in a commit, branch, and pull request being created on the code host.
Published any `json:"published,omitempty"`
// Title description: The title of the changeset on the code host.
Title string `json:"title"`
// Version description: A field for versioning the payload.
Version int `json:"version,omitempty"`
}
type BrandAssets struct {
// Logo description: The URL to the image used on the homepage. This will replace the Sourcegraph logo on the homepage. Maximum width: 320px. We recommend using the following file formats: SVG, PNG
Logo string `json:"logo,omitempty"`
// Symbol description: The URL to the symbol used as the search icon. Recommended size: 24x24px. We recommend using the following file formats: SVG, PNG, ICO
Symbol string `json:"symbol,omitempty"`
}
// Branding description: Customize Sourcegraph homepage logo and search icon.
//
// Only available in Sourcegraph Enterprise.
type Branding struct {
// BrandName description: String to display everywhere the brand name should be displayed. Defaults to "Sourcegraph"
BrandName string `json:"brandName,omitempty"`
Dark *BrandAssets `json:"dark,omitempty"`
// DisableSymbolSpin description: Prevents the icon in the top-left corner of the screen from spinning on hover.
DisableSymbolSpin bool `json:"disableSymbolSpin,omitempty"`
// Favicon description: The URL of the favicon to be used for your instance. We recommend using the following file format: ICO
Favicon string `json:"favicon,omitempty"`
Light *BrandAssets `json:"light,omitempty"`
}
// BuiltinAuthProvider description: Configures the builtin username-password authentication provider.
type BuiltinAuthProvider struct {
// AllowSignup description: Allows new visitors to sign up for accounts. The sign-up page will be enabled and accessible to all visitors.
//
// SECURITY: If the site has no users (i.e., during initial setup), it will always allow the first user to sign up and become site admin **without any approval** (first user to sign up becomes the admin).
AllowSignup bool `json:"allowSignup,omitempty"`
Type string `json:"type"`
}
// ChangesetTemplate description: A template describing how to create (and update) changesets with the file changes produced by the command steps.
type ChangesetTemplate struct {
// Body description: The body (description) of the changeset.
Body string `json:"body,omitempty"`
// Branch description: The name of the Git branch to create or update on each repository with the changes.
Branch string `json:"branch"`
// Commit description: The Git commit to create with the changes.
Commit ExpandedGitCommitDescription `json:"commit"`
// Published description: Whether to publish the changeset. An unpublished changeset can be previewed on Sourcegraph by any person who can view the batch change, but its commit, branch, and pull request aren't created on the code host. A published changeset results in a commit, branch, and pull request being created on the code host. If omitted, the publication state is controlled from the Batch Changes UI.
Published any `json:"published,omitempty"`
// Title description: The title of the changeset.
Title string `json:"title"`
}
// CloneURLToRepositoryName description: Describes a mapping from clone URL to repository name. The `from` field contains a regular expression with named capturing groups. The `to` field contains a template string that references capturing group names. For instance, if `from` is "^../(?P<name>\w+)$" and `to` is "github.com/user/{name}", the clone URL "../myRepository" would be mapped to the repository name "github.com/user/myRepository".
type CloneURLToRepositoryName struct {
// From description: A regular expression that matches a set of clone URLs. The regular expression should use the Go regular expression syntax (https://golang.org/pkg/regexp/) and contain at least one named capturing group. The regular expression matches partially by default, so use "^...$" if whole-string matching is desired.
From string `json:"from"`
// To description: The repository name output pattern. This should use `{matchGroup}` syntax to reference the capturing groups from the `from` field.
To string `json:"to"`
}
// CloudKMSEncryptionKey description: Google Cloud KMS Encryption Key, used to encrypt data in Google Cloud environments
type CloudKMSEncryptionKey struct {
CredentialsFile string `json:"credentialsFile,omitempty"`
Keyname string `json:"keyname"`
Type string `json:"type"`
}
// Completions description: Configuration for the completions service.
type Completions struct {
// AccessToken description: The access token used to authenticate with the external completions provider.
AccessToken string `json:"accessToken"`
// ChatModel description: The model used for chat completions.
ChatModel string `json:"chatModel,omitempty"`
// CompletionModel description: The model used for code completion.
CompletionModel string `json:"completionModel,omitempty"`
// Enabled description: Toggles whether completions are enabled.
Enabled bool `json:"enabled"`
// Endpoint description: The endpoint under which to reach the provider. Currently only used for provider type LLM proxy.
Endpoint string `json:"endpoint,omitempty"`
// Model description: DEPRECATED. Use chatModel instead.
Model string `json:"model"`
// PerUserCodeCompletionsDailyLimit description: If > 0, enables the maximum number of code completions requests allowed to be made by a single user account in a day. On instances that allow anonymous requests, the rate limit is enforced by IP.
PerUserCodeCompletionsDailyLimit int `json:"perUserCodeCompletionsDailyLimit,omitempty"`
// PerUserDailyLimit description: If > 0, enables the maximum number of completions requests allowed to be made by a single user account in a day. On instances that allow anonymous requests, the rate limit is enforced by IP.
PerUserDailyLimit int `json:"perUserDailyLimit,omitempty"`
// Provider description: The external completions provider.
Provider string `json:"provider"`
}
// CustomGitFetchMapping description: Mapping from Git clone URl domain/path to git fetch command. The `domainPath` field contains the Git clone URL domain/path part. The `fetch` field contains the custom git fetch command.
type CustomGitFetchMapping struct {
// DomainPath description: Git clone URL domain/path
DomainPath string `json:"domainPath"`
// Fetch description: Git fetch command
Fetch string `json:"fetch"`
}
// DebugLog description: Turns on debug logging for specific debugging scenarios.
type DebugLog struct {
// ExtsvcGitlab description: Log GitLab API requests.
ExtsvcGitlab bool `json:"extsvc.gitlab,omitempty"`
}
// Dotcom description: Configuration options for Sourcegraph.com only.
type Dotcom struct {
// AppNotifications description: Notifications to display in the Sourcegraph app.
AppNotifications []*AppNotifications `json:"app.notifications,omitempty"`
// SlackLicenseExpirationWebhook description: Slack webhook for upcoming license expiration notifications.
SlackLicenseExpirationWebhook string `json:"slackLicenseExpirationWebhook,omitempty"`
// SrcCliVersionCache description: Configuration related to the src-cli version cache. This should only be used on sourcegraph.com.
SrcCliVersionCache *SrcCliVersionCache `json:"srcCliVersionCache,omitempty"`
}
type EmailTemplate struct {
// Html description: Template for HTML body
Html string `json:"html"`
// Subject description: Template for email subject header
Subject string `json:"subject"`
// Text description: Optional template for plain-text body. If not provided, a plain-text body will be automatically generated from the HTML template.
Text string `json:"text,omitempty"`
}
// EmailTemplates description: Configurable templates for some email types sent by Sourcegraph.
type EmailTemplates struct {
// ResetPassword description: Email sent on password resets. Available template variables: {{.Host}}, {{.Username}}, {{.URL}}
ResetPassword *EmailTemplate `json:"resetPassword,omitempty"`
// SetPassword description: Email sent on account creation, if a password reset URL is created. Available template variables: {{.Host}}, {{.Username}}, {{.URL}}
SetPassword *EmailTemplate `json:"setPassword,omitempty"`
}
// Embeddings description: Configuration for embeddings service.
type Embeddings struct {
// AccessToken description: The access token used to authenticate with the external embedding API service.
AccessToken string `json:"accessToken"`
// Dimensions description: The dimensionality of the embedding vectors.
Dimensions int `json:"dimensions"`
// Enabled description: Toggles whether embedding service is enabled.
Enabled bool `json:"enabled"`
// ExcludedFilePathPatterns description: A list of glob patterns that match file paths you want to exclude from embeddings. This is useful to exclude files with low information value (e.g., SVG files, test fixtures, mocks, auto-generated files, etc.).
ExcludedFilePathPatterns []string `json:"excludedFilePathPatterns,omitempty"`
// MaxCodeEmbeddingsPerRepo description: The maximum number of embeddings for code files to generate per repo
MaxCodeEmbeddingsPerRepo int `json:"maxCodeEmbeddingsPerRepo,omitempty"`
// MaxTextEmbeddingsPerRepo description: The maximum number of embeddings for text files to generate per repo
MaxTextEmbeddingsPerRepo int `json:"maxTextEmbeddingsPerRepo,omitempty"`
// Model description: The model used for embedding.
Model string `json:"model"`
// Url description: The url to the external embedding API service.
Url string `json:"url"`
}
// EncryptionKey description: Config for a key
type EncryptionKey struct {
Cloudkms *CloudKMSEncryptionKey
Awskms *AWSKMSEncryptionKey
Mounted *MountedEncryptionKey
Noop *NoOpEncryptionKey
}
func (v EncryptionKey) MarshalJSON() ([]byte, error) {
if v.Cloudkms != nil {
return json.Marshal(v.Cloudkms)
}
if v.Awskms != nil {
return json.Marshal(v.Awskms)
}
if v.Mounted != nil {
return json.Marshal(v.Mounted)
}
if v.Noop != nil {
return json.Marshal(v.Noop)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *EncryptionKey) UnmarshalJSON(data []byte) error {
var d struct {
DiscriminantProperty string `json:"type"`
}
if err := json.Unmarshal(data, &d); err != nil {
return err
}
switch d.DiscriminantProperty {
case "awskms":
return json.Unmarshal(data, &v.Awskms)
case "cloudkms":
return json.Unmarshal(data, &v.Cloudkms)
case "mounted":
return json.Unmarshal(data, &v.Mounted)
case "noop":
return json.Unmarshal(data, &v.Noop)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"cloudkms", "awskms", "mounted", "noop"})
}
// EncryptionKeys description: Configuration for encryption keys used to encrypt data at rest in the database.
type EncryptionKeys struct {
BatchChangesCredentialKey *EncryptionKey `json:"batchChangesCredentialKey,omitempty"`
// CacheSize description: number of values to keep in LRU cache
CacheSize int `json:"cacheSize,omitempty"`
// EnableCache description: enable LRU cache for decryption APIs
EnableCache bool `json:"enableCache,omitempty"`
ExecutorSecretKey *EncryptionKey `json:"executorSecretKey,omitempty"`
ExternalServiceKey *EncryptionKey `json:"externalServiceKey,omitempty"`
GitHubAppKey *EncryptionKey `json:"gitHubAppKey,omitempty"`
OutboundWebhookKey *EncryptionKey `json:"outboundWebhookKey,omitempty"`
UserExternalAccountKey *EncryptionKey `json:"userExternalAccountKey,omitempty"`
WebhookKey *EncryptionKey `json:"webhookKey,omitempty"`
WebhookLogKey *EncryptionKey `json:"webhookLogKey,omitempty"`
}
type ExcludedAWSCodeCommitRepo struct {
// Id description: The ID of an AWS Code Commit repository (as returned by the AWS API) to exclude from mirroring. Use this to exclude the repository, even if renamed, or to differentiate between repositories with the same name in multiple regions.
Id string `json:"id,omitempty"`
// Name description: The name of an AWS CodeCommit repository ("repo-name") to exclude from mirroring.
Name string `json:"name,omitempty"`
}
type ExcludedAzureDevOpsServerRepo struct {
// Name description: The name of an Azure DevOps Services organization, project, and repository ("orgName/projectName/repositoryName") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of an Azure DevOps Services repo.
Pattern string `json:"pattern,omitempty"`
}
type ExcludedBitbucketCloudRepo struct {
// Name description: The name of a Bitbucket Cloud repo ("myorg/myrepo") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of a Bitbucket Cloud repo.
Pattern string `json:"pattern,omitempty"`
// Uuid description: The UUID of a Bitbucket Cloud repo (as returned by the Bitbucket Cloud's API) to exclude from mirroring.
Uuid string `json:"uuid,omitempty"`
}
type ExcludedBitbucketServerRepo struct {
// Id description: The ID of a Bitbucket Server / Bitbucket Data Center repo (as returned by the Bitbucket Server / Bitbucket Data Center instance's API) to exclude from mirroring.
Id int `json:"id,omitempty"`
// Name description: The name of a Bitbucket Server / Bitbucket Data Center repo ("projectKey/repositorySlug") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of a Bitbucket Server / Bitbucket Data Center repo.
Pattern string `json:"pattern,omitempty"`
}
type ExcludedGitHubRepo struct {
// Archived description: If set to true, archived repositories will be excluded.
Archived bool `json:"archived,omitempty"`
// Forks description: If set to true, forks will be excluded.
Forks bool `json:"forks,omitempty"`
// Id description: The node ID of a GitHub repository (as returned by the GitHub instance's API) to exclude from mirroring. Use this to exclude the repository, even if renamed. Note: This is the GraphQL ID, not the GitHub database ID. eg: "curl https://api.github.com/repos/vuejs/vue | jq .node_id"
Id string `json:"id,omitempty"`
// Name description: The name of a GitHub repository ("owner/name") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of a GitHub repository ("owner/name").
Pattern string `json:"pattern,omitempty"`
}
type ExcludedGitLabProject struct {
// EmptyRepos description: Whether to exclude empty repositories.
EmptyRepos bool `json:"emptyRepos,omitempty"`
// Id description: The ID of a GitLab project (as returned by the GitLab instance's API) to exclude from mirroring.
Id int `json:"id,omitempty"`
// Name description: The name of a GitLab project ("group/name") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of a GitLab project ("group/name").
Pattern string `json:"pattern,omitempty"`
}
type ExcludedGitoliteRepo struct {
// Name description: The name of a Gitolite repo ("my-repo") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of a Gitolite repo to exclude from mirroring.
Pattern string `json:"pattern,omitempty"`
}
type ExcludedOtherRepo struct {
// Name description: The name of a Other repo ("my-repo") to exclude from mirroring.
Name string `json:"name,omitempty"`
// Pattern description: Regular expression which matches against the name of a Other repo to exclude from mirroring.
Pattern string `json:"pattern,omitempty"`
}
type ExistingChangesetSpec struct {
// BaseRepository description: The GraphQL ID of the repository that contains the existing changeset on the code host.
BaseRepository string `json:"baseRepository"`
// ExternalID description: The ID that uniquely identifies the existing changeset on the code host
ExternalID string `json:"externalID"`
// Version description: A field for versioning the payload.
Version int `json:"version,omitempty"`
}
// ExpandedGitCommitDescription description: The Git commit to create with the changes.
type ExpandedGitCommitDescription struct {
// Author description: The author of the Git commit.
Author *GitCommitAuthor `json:"author,omitempty"`
// Message description: The Git commit message.
Message string `json:"message"`
}
// ExperimentalFeatures description: Experimental features and settings.
type ExperimentalFeatures struct {
// CodyRestrictUsersFeatureFlag description: Restrict Cody to only be enabled for users that have a feature flag labeled "cody-experimental" set to true. You must create a feature flag with this ID after enabling this setting: https://docs.sourcegraph.com/dev/how-to/use_feature_flags#create-a-feature-flag.
CodyRestrictUsersFeatureFlag bool `json:"codyRestrictUsersFeatureFlag,omitempty"`
// CustomGitFetch description: JSON array of configuration that maps from Git clone URL domain/path to custom git fetch command. To enable this feature set environment variable `ENABLE_CUSTOM_GIT_FETCH` as `true` on gitserver.
CustomGitFetch []*CustomGitFetchMapping `json:"customGitFetch,omitempty"`
// DebugLog description: Turns on debug logging for specific debugging scenarios.
DebugLog *DebugLog `json:"debug.log,omitempty"`
// EnableGRPC description: Enables gRPC for communication between internal services
EnableGRPC bool `json:"enableGRPC,omitempty"`
// EnableGithubInternalRepoVisibility description: Enable support for visibility of internal Github repositories
EnableGithubInternalRepoVisibility bool `json:"enableGithubInternalRepoVisibility,omitempty"`
// EnablePermissionsWebhooks description: Enables webhook consumers to sync permissions from external services faster than the defaults schedule
EnablePermissionsWebhooks bool `json:"enablePermissionsWebhooks,omitempty"`
// EnableStorm description: Enables the Storm frontend architecture changes.
EnableStorm bool `json:"enableStorm,omitempty"`
// EventLogging description: Enables user event logging inside of the Sourcegraph instance. This will allow admins to have greater visibility of user activity, such as frequently viewed pages, frequent searches, and more. These event logs (and any specific user actions) are only stored locally, and never leave this Sourcegraph instance.
EventLogging string `json:"eventLogging,omitempty"`
// GitServerPinnedRepos description: List of repositories pinned to specific gitserver instances. The specified repositories will remain at their pinned servers on scaling the cluster. If the specified pinned server differs from the current server that stores the repository, then it must be re-cloned to the specified server.
GitServerPinnedRepos map[string]string `json:"gitServerPinnedRepos,omitempty"`
// GoPackages description: Allow adding Go package host connections
GoPackages string `json:"goPackages,omitempty"`
// InsightsAlternateLoadingStrategy description: Use an in-memory strategy of loading Code Insights. Should only be used for benchmarking on large instances, not for customer use currently.
InsightsAlternateLoadingStrategy bool `json:"insightsAlternateLoadingStrategy,omitempty"`
// InsightsBackfillerV2 description: DEPRECATED: Setting any value to this flag has no effect.
InsightsBackfillerV2 *bool `json:"insightsBackfillerV2,omitempty"`
// InsightsDataRetention description: Code insights data points beyond the sample size defined in the site configuration will be periodically archived
InsightsDataRetention *bool `json:"insightsDataRetention,omitempty"`
// JvmPackages description: Allow adding JVM package host connections
JvmPackages string `json:"jvmPackages,omitempty"`
// NpmPackages description: Allow adding npm package code host connections
NpmPackages string `json:"npmPackages,omitempty"`
// Pagure description: Allow adding Pagure code host connections
Pagure string `json:"pagure,omitempty"`
// PasswordPolicy description: DEPRECATED: this is now a standard feature see: auth.passwordPolicy
PasswordPolicy *PasswordPolicy `json:"passwordPolicy,omitempty"`
// Perforce description: Allow adding Perforce code host connections
Perforce string `json:"perforce,omitempty"`
// PythonPackages description: Allow adding Python package code host connections
PythonPackages string `json:"pythonPackages,omitempty"`
// Ranking description: Experimental search result ranking options.
Ranking *Ranking `json:"ranking,omitempty"`
// RateLimitAnonymous description: Configures the hourly rate limits for anonymous calls to the GraphQL API. Setting limit to 0 disables the limiter. This is only relevant if unauthenticated calls to the API are permitted.
RateLimitAnonymous int `json:"rateLimitAnonymous,omitempty"`
// RubyPackages description: Allow adding Ruby package host connections
RubyPackages string `json:"rubyPackages,omitempty"`
// RustPackages description: Allow adding Rust package code host connections
RustPackages string `json:"rustPackages,omitempty"`
// SearchIndexBranches description: A map from repository name to a list of extra revs (branch, ref, tag, commit sha, etc) to index for a repository. We always index the default branch ("HEAD") and revisions in version contexts. This allows specifying additional revisions. Sourcegraph can index up to 64 branches per repository.
SearchIndexBranches map[string][]string `json:"search.index.branches,omitempty"`
// SearchIndexQueryContexts description: Enables indexing of revisions of repos matching any query defined in search contexts.
SearchIndexQueryContexts bool `json:"search.index.query.contexts,omitempty"`
// SearchIndexRevisions description: An array of objects describing rules for extra revisions (branch, ref, tag, commit sha, etc) to be indexed for all repositories that match them. We always index the default branch ("HEAD") and revisions in version contexts. This allows specifying additional revisions. Sourcegraph can index up to 64 branches per repository.
SearchIndexRevisions []*SearchIndexRevisionsRule `json:"search.index.revisions,omitempty"`
// SearchSanitization description: Allows site admins to specify a list of regular expressions representing matched content that should be omitted from search results. Also allows admins to specify the name of an organization within their Sourcegraph instance whose members are trusted and will not have their search results sanitized. Enable this feature by adding at least one valid regular expression to the value of the `sanitizePatterns` field on this object. Site admins will not have their searches sanitized.
SearchSanitization *SearchSanitization `json:"search.sanitization,omitempty"`
// StructuralSearch description: Enables structural search.
StructuralSearch string `json:"structuralSearch,omitempty"`
SubRepoPermissions *SubRepoPermissions `json:"subRepoPermissions,omitempty"`
// TlsExternal description: Global TLS/SSL settings for Sourcegraph to use when communicating with code hosts.
TlsExternal *TlsExternal `json:"tls.external,omitempty"`
Additional map[string]any `json:"-"` // additionalProperties not explicitly defined in the schema
}
func (v ExperimentalFeatures) MarshalJSON() ([]byte, error) {
m := make(map[string]any, len(v.Additional))
for k, v := range v.Additional {
m[k] = v
}
type wrapper ExperimentalFeatures
b, err := json.Marshal(wrapper(v))
if err != nil {
return nil, err
}
var m2 map[string]any
if err := json.Unmarshal(b, &m2); err != nil {
return nil, err
}
for k, v := range m2 {
m[k] = v
}
return json.Marshal(m)
}
func (v *ExperimentalFeatures) UnmarshalJSON(data []byte) error {
type wrapper ExperimentalFeatures
var s wrapper
if err := json.Unmarshal(data, &s); err != nil {
return err
}
*v = ExperimentalFeatures(s)
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
return err
}
delete(m, "codyRestrictUsersFeatureFlag")
delete(m, "customGitFetch")
delete(m, "debug.log")
delete(m, "enableGRPC")
delete(m, "enableGithubInternalRepoVisibility")
delete(m, "enablePermissionsWebhooks")
delete(m, "enableStorm")
delete(m, "eventLogging")
delete(m, "gitServerPinnedRepos")
delete(m, "goPackages")
delete(m, "insightsAlternateLoadingStrategy")
delete(m, "insightsBackfillerV2")
delete(m, "insightsDataRetention")
delete(m, "jvmPackages")
delete(m, "npmPackages")
delete(m, "pagure")
delete(m, "passwordPolicy")
delete(m, "perforce")
delete(m, "pythonPackages")
delete(m, "ranking")
delete(m, "rateLimitAnonymous")
delete(m, "rubyPackages")
delete(m, "rustPackages")
delete(m, "search.index.branches")
delete(m, "search.index.query.contexts")
delete(m, "search.index.revisions")
delete(m, "search.sanitization")
delete(m, "structuralSearch")
delete(m, "subRepoPermissions")
delete(m, "tls.external")
if len(m) > 0 {
v.Additional = make(map[string]any, len(m))
}
for k, vv := range m {
v.Additional[k] = vv
}
return nil
}
type ExportUsageTelemetry struct {
// BatchSize description: Maximum number of events scraped from the events table in a single scrape.
BatchSize int `json:"batchSize,omitempty"`
// Enabled description: Toggles whether or not to export Sourcegraph telemetry. If enabled events will be scraped and sent to an analytics store. This is an opt-in setting, and only should only be enabled for customers that have agreed to event level data collection.
Enabled bool `json:"enabled,omitempty"`
// TopicName description: Destination pubsub topic name to export usage data
TopicName string `json:"topicName,omitempty"`
// TopicProjectName description: GCP project name containing the usage data pubsub topic
TopicProjectName string `json:"topicProjectName,omitempty"`
}
type ExternalIdentity struct {
// AuthProviderID description: The value of the `configID` field of the targeted authentication provider.
AuthProviderID string `json:"authProviderID"`
// AuthProviderType description: The `type` field of the targeted authentication provider.
AuthProviderType string `json:"authProviderType"`
// GitlabProvider description: The name that identifies the authentication provider to GitLab. This is passed to the `?provider=` query parameter in calls to the GitLab Users API. If you're not sure what this value is, you can look at the `identities` field of the GitLab Users API result (`curl -H 'PRIVATE-TOKEN: $YOUR_TOKEN' $GITLAB_URL/api/v4/users`).
GitlabProvider string `json:"gitlabProvider"`
Type string `json:"type"`
}
// FusionClient description: Configuration for the experimental p4-fusion client
type FusionClient struct {
// Enabled description: Enable the p4-fusion client for cloning and fetching repos
Enabled bool `json:"enabled"`
// FsyncEnable description: Enable fsync() while writing objects to disk to ensure they get written to permanent storage immediately instead of being cached. This is to mitigate data loss in events of hardware failure.
FsyncEnable bool `json:"fsyncEnable,omitempty"`
// IncludeBinaries description: Whether to include binary files
IncludeBinaries bool `json:"includeBinaries,omitempty"`
// LookAhead description: How many CLs in the future, at most, shall we keep downloaded by the time it is to commit them
LookAhead int `json:"lookAhead"`
// MaxChanges description: How many changes to fetch during initial clone. The default of -1 will fetch all known changes
MaxChanges int `json:"maxChanges,omitempty"`
// NetworkThreads description: The number of threads in the threadpool for running network calls. Defaults to the number of logical CPUs.
NetworkThreads int `json:"networkThreads,omitempty"`
// NetworkThreadsFetch description: The number of threads in the threadpool for running network calls when performing fetches. Defaults to the number of logical CPUs.
NetworkThreadsFetch int `json:"networkThreadsFetch,omitempty"`
// PrintBatch description: The p4 print batch size
PrintBatch int `json:"printBatch,omitempty"`
// Refresh description: How many times a connection should be reused before it is refreshed
Refresh int `json:"refresh,omitempty"`
// Retries description: How many times a command should be retried before the process exits in a failure
Retries int `json:"retries,omitempty"`
}
// GerritAuthProvider description: Gerrit auth provider
type GerritAuthProvider struct {
DisplayName string `json:"displayName,omitempty"`
DisplayPrefix *string `json:"displayPrefix,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Order int `json:"order,omitempty"`
Type string `json:"type"`
// Url description: URL of the Gerrit instance, such as https://gerrit-review.googlesource.com or https://gerrit.example.com.
Url string `json:"url"`
}
// GerritAuthorization description: If non-null, enforces Gerrit repository permissions. This requires that there is an item in the [site configuration json](https://docs.sourcegraph.com/admin/config/site_config#auth-providers) `auth.providers` field, of type "gerrit" with the same `url` field as specified in this `GerritConnection`.
type GerritAuthorization struct {
// IdentityProvider description: The identity provider to use for user information. If not set, the `url` field is used.
IdentityProvider string `json:"identityProvider,omitempty"`
}
// GerritConnection description: Configuration for a connection to Gerrit.
type GerritConnection struct {
// Authorization description: If non-null, enforces Gerrit repository permissions. This requires that there is an item in the [site configuration json](https://docs.sourcegraph.com/admin/config/site_config#auth-providers) `auth.providers` field, of type "gerrit" with the same `url` field as specified in this `GerritConnection`.
Authorization *GerritAuthorization `json:"authorization,omitempty"`
// Password description: The password associated with the Gerrit username used for authentication.
Password string `json:"password"`
// Projects description: An array of project strings specifying which Gerrit projects to mirror on Sourcegraph. If empty, all projects will be mirrored.
Projects []string `json:"projects,omitempty"`
// Url description: URL of a Gerrit instance, such as https://gerrit.example.com.
Url string `json:"url"`
// Username description: A username for authentication withe the Gerrit code host.
Username string `json:"username"`
}
// GitCommitAuthor description: The author of the Git commit.
type GitCommitAuthor struct {
// Email description: The Git commit author email.
Email string `json:"email"`
// Name description: The Git commit author name.
Name string `json:"name"`
}
// GitCommitDescription description: The Git commit to create with the changes.
type GitCommitDescription struct {
// AuthorEmail description: The Git commit author email.
AuthorEmail string `json:"authorEmail"`
// AuthorName description: The Git commit author name.
AuthorName string `json:"authorName"`
// Diff description: The commit diff (in unified diff format).
Diff string `json:"diff"`
// Message description: The Git commit message.
Message string `json:"message"`
// Version description: A field for versioning the payload.
Version int `json:"version,omitempty"`
}
// GitHubApp description: DEPRECATED: The config options for Sourcegraph GitHub App.
type GitHubApp struct {
// AppID description: The app ID of the GitHub App for Sourcegraph.
AppID string `json:"appID,omitempty"`
// ClientID description: The Client ID of the GitHub App for Sourcegraph, accessible from https://github.com/settings/apps .
ClientID string `json:"clientID,omitempty"`
// ClientSecret description: The Client Secret of the GitHub App for Sourcegraph, accessible from https://github.com/settings/apps .
ClientSecret string `json:"clientSecret,omitempty"`
// PrivateKey description: The base64-encoded private key of the GitHub App for Sourcegraph.