This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathschema.go
3758 lines (3582 loc) · 261 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"`
}
type AnnotationsParams struct {
// Content description: The file's content.
Content string `json:"content"`
// File description: The file's URI.
File string `json:"file"`
}
type AnnotationsResult struct {
// Annotations description: Annotations that attach items to specific ranges in the file.
Annotations []*OpenCodeGraphAnnotation `json:"annotations"`
// Items description: Items that contain information relevant to the file.
Items []*OpenCodeGraphItem `json:"items"`
}
// AttributionGateway description: Use this gateway parameters for customers that bring their own key. Otherwise gateway endpoint is used.
type AttributionGateway struct {
// AccessToken description: Only for use to override token for attribution gateway access. If 'licenseKey' is set, a default access token is generated.
AccessToken string `json:"accessToken,omitempty"`
// Endpoint description: Endpoint where Cody gateway can be accessed for attribution.
Endpoint string `json:"endpoint,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: DEPRECATED: No effect, audit logs are always set to SRC_LOG_LEVEL
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"`
// AllowNoExpiration description: Allows new tokens to be created without specifying an expiration.
AllowNoExpiration *bool `json:"allowNoExpiration,omitempty"`
// DefaultExpirationDays description: The default duration selection when creating a new access token. This value will be added to the expirationOptionDays if it is not already present
DefaultExpirationDays *int `json:"defaultExpirationDays,omitempty"`
// ExpirationOptionDays description: Options users will see for the number of days until token expiration. The defaultExpirationDays will be added to the list if not already present.
ExpirationOptionDays []int `json:"expirationOptionDays,omitempty"`
// MaxTokensPerUser description: The maximum number of active access tokens a user may have.
MaxTokensPerUser *int `json:"maxTokensPerUser,omitempty"`
}
// AuthAllowedIpAddress description: IP allowlist for access to the Sourcegraph instance. If set, only requests from these IP addresses will be allowed. By default client IP is infered connected client IP address, and you may configure to use a request header to determine the user IP.
type AuthAllowedIpAddress struct {
// ClientIpAddress description: List of client IP addresses to allow. If empty, all IP addresses are allowed. This is useful to restrict who can open connection with the Sorcegraph instance, e.g., the request source range of the upsteam application load balancer.
ClientIpAddress []string `json:"clientIpAddress,omitempty"`
// Enabled description: Whether to enable the IP allowlist.
Enabled bool `json:"enabled,omitempty"`
// ErrorMessageTemplate description: A template to customize the error message display to users on unauthorized access. Available template variables: `{{.Error}}`, `{{.UserIP}}`
ErrorMessageTemplate string `json:"errorMessageTemplate,omitempty"`
// TrustedClientIpAddress description: List of trusted client IP addresses that will bypass user IP address check. If empty, nothing can be bypass. This is useful to support access from trusted internal services. It will always permit connection from `127.0.0.1`. You must include the IP range allocated for the Sourcegraph deployment services to allow inter-service communication, e.g., kubernetes pod ip range.
TrustedClientIpAddress []string `json:"trustedClientIpAddress,omitempty"`
// UserIpAddress description: List of user IP addresses to allow. If empty, all IP addresses are allowed.
UserIpAddress []string `json:"userIpAddress,omitempty"`
// UserIpRequestHeaders description: An optional list of case-insensitive request header names to use for resolving the callers user IP address. You must ensure that the header is coming from a trusted source. If the header contains multiple IP addresses, the right-most is used. If no IP is found from provided headers, the connected client IP address is used.
UserIpRequestHeaders []string `json:"userIpRequestHeaders,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"`
// NoSignIn description: Hides the configured auth provider from the sign in page, but still allows users to connect an external account using their Account Security page to enable permissions syncing.
NoSignIn bool `json:"noSignIn,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
Bitbucketserver *BitbucketServerAuthProvider
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.Bitbucketserver != nil {
return json.Marshal(v.Bitbucketserver)
}
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 "bitbucketserver":
return json.Unmarshal(data, &v.Bitbucketserver)
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", "bitbucketserver", "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"`
NoSignIn bool `json:"noSignIn,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"`
// GitURLType description: The type of Git URLs to use for cloning and fetching Git repositories.
//
// If "http", Sourcegraph will access repositories using Git URLs of the form http(s)://dev.azure.com/myrepo.git.
//
// If "ssh", Sourcegraph will access repositories using Git URLs of the form [email protected]:v3/myrepo. See the documentation for how to provide SSH private keys and known_hosts: https://sourcegraph.com/docs/admin/repo/auth.
GitURLType string `json:"gitURLType,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"`
// RateLimit description: Rate limit applied when making background API requests.
RateLimit *AzureDevOpsRateLimit `json:"rateLimit,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"`
}
// AzureDevOpsRateLimit description: Rate limit applied when making background API requests.
type AzureDevOpsRateLimit 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 100, which implies that for a requests per hour limit as low as 1, users will continue to be able to send a maximum of 100 requests immediately, provided that the complexity cost of each request is 1.
RequestsPerHour float64 `json:"requestsPerHour"`
}
type BackendAPIConfig struct {
// AuthHeader description: Value of Authorization header (if required)
AuthHeader string `json:"authHeader,omitempty"`
// Url description: Full URL of backend API
Url string `json:"url"`
}
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"`
// Version description: The version of the batch spec schema. Defaults to 1.
Version float64 `json:"version,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"`
}
// Batches description: The configuration for the batches queue.
type Batches struct {
// Limit description: The maximum number of dequeues allowed within the expiration window.
Limit int `json:"limit"`
// Weight description: The relative weight of this queue. Higher weights mean a higher chance of being picked at random.
Weight int `json:"weight"`
}
// 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"`
NoSignIn bool `json:"noSignIn,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://sourcegraph.com/docs/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 {
// AccessToken description: The workspace access token to use when authenticating with Bitbucket Cloud.
AccessToken string `json:"accessToken,omitempty"`
// 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,omitempty"`
// Authorization description: If non-null, enforces Bitbucket Cloud repository permissions. This requires that there is an item in the [site configuration json](https://sourcegraph.com/docs/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 [email protected]:myteam/myproject.git. See the documentation for how to provide SSH private keys and known_hosts: https://sourcegraph.com/docs/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"`
// 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 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,omitempty"`
// 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"`
}
// BitbucketServerAuthProvider description: Configures the Bitbucket Server OAuth authentication provider for SSO. In addition to specifying this configuration object, you must also create a OAuth App on your Bitbucket Server instance: https://confluence.atlassian.com/bitbucketserver0720/configure-an-incoming-link-1116282013.html. The application should have the repository read permission and the callback URL set to the concatenation of your Sourcegraph instance URL and "/.auth/bitbucketserver/callback".
type BitbucketServerAuthProvider struct {
// AllowSignup description: Allows new visitors to sign up for accounts via Bitbucket Server OAuth. If false, users signing in via Bitbucket Server must have an existing Sourcegraph account, which will be linked to their Bitbucket Server identity after sign-in.
AllowSignup bool `json:"allowSignup,omitempty"`
// ClientID description: The ID of the Bitbucket OAuth app.
ClientID string `json:"clientID"`
// 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"`
NoSignIn bool `json:"noSignIn,omitempty"`
Order int `json:"order,omitempty"`
Type string `json:"type"`
// Url description: URL of the Bitbucket Server instance.
Url string `json:"url,omitempty"`
}
// 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,omitempty"`
// 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,omitempty"`
Oauth2 bool `json:"oauth2,omitempty"`
}
// 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://sourcegraph.com/docs/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://[email protected]/myproject/myrepo.git. See the documentation for how to provide SSH private keys and known_hosts: https://sourcegraph.com/docs/admin/repo/auth.
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://sourcegraph.com/docs/admin/code_hosts/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"`
// Fork description: Whether to publish the changeset to a fork of the target repository. If omitted, the changeset will be published to a branch directly on the target repository, unless the global `batches.enforceFork` setting is enabled. If set, this property will override any global setting.
Fork bool `json:"fork,omitempty"`
// 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.
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"`
}
type CapabilitiesParams struct {
}
type CapabilitiesResult struct {
// Selector description: Selects the scope (repositories, files, and languages) in which this provider should be called.
//
// At least 1 must be satisfied for the provider to be called. If empty, the provider is never called. If undefined, the provider is called on all files.
Selector []*Selector `json:"selector,omitempty"`
}
// 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"`
// Fork description: Whether to publish the changeset to a fork of the target repository. If omitted, the changeset will be published to a branch directly on the target repository, unless the global `batches.enforceFork` setting is enabled. If set, this property will override any global setting.
Fork bool `json:"fork,omitempty"`
// 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"`
}
// ClientSideModelConfig description: No client-side model configuration is currently available.
type ClientSideModelConfig struct {
Openaicompatible *ClientSideModelConfigOpenAICompatible `json:"openaicompatible,omitempty"`
}
// ClientSideModelConfigOpenAICompatible description: Advanced configuration options that are only respected if the model is provided by an openaicompatible provider.
type ClientSideModelConfigOpenAICompatible struct {
AutoCompleteMultilineMaxTokens int `json:"autoCompleteMultilineMaxTokens,omitempty"`
AutoCompleteSinglelineMaxTokens int `json:"autoCompleteSinglelineMaxTokens,omitempty"`
AutoCompleteTemperature float64 `json:"autoCompleteTemperature,omitempty"`
AutoCompleteTopK float64 `json:"autoCompleteTopK,omitempty"`
AutoCompleteTopP float64 `json:"autoCompleteTopP,omitempty"`
// AutocompleteMultilineTimeout description: How long the client should wait for autocomplete results to come back (milliseconds), before giving up and not displaying an autocomplete result at all.
//
// This applies on multi-line completions, which are based on intent-detection when e.g. a code block is being completed, e.g. 'func parseURL(url string) {<completion>'
//
// Note: similar to hidden Cody client config option 'cody.autocomplete.advanced.timeout.multiline' If user has configured that, it will be respected instead of this.
AutocompleteMultilineTimeout int `json:"autocompleteMultilineTimeout,omitempty"`
// AutocompleteSinglelineTimeout description: How long the client should wait for autocomplete results to come back (milliseconds), before giving up and not displaying an autocomplete result at all.
//
// This applies on single-line completions, e.g. 'var i = <completion>'
//
// Note: similar to hidden Cody client config option 'cody.autocomplete.advanced.timeout.singleline' If user has configured that, it will be respected instead of this.
AutocompleteSinglelineTimeout int `json:"autocompleteSinglelineTimeout,omitempty"`
ChatMaxTokens int `json:"chatMaxTokens,omitempty"`
// ChatPreInstruction description: Custom instruction to be included at the start of all chat messages
// when using this model, e.g. 'Answer all questions in Spanish.'
//
// Note: similar to Cody client config option 'cody.chat.preInstruction'; if user has configured that it will be used instead of this.
ChatPreInstruction string `json:"chatPreInstruction,omitempty"`
ChatTemperature float64 `json:"chatTemperature,omitempty"`
ChatTopK float64 `json:"chatTopK,omitempty"`
ChatTopP float64 `json:"chatTopP,omitempty"`
// ContextSizeHintPrefixCharacters description: A hint the client should use when producing context to send to the LLM.
// The maximum length of the document prefix (text before the cursor) to include, in characters.
ContextSizeHintPrefixCharacters *int `json:"contextSizeHintPrefixCharacters,omitempty"`
// ContextSizeHintSuffixCharacters description: A hint the client should use when producing context to send to the LLM.
// The maximum length of the document suffix (text after the cursor) to include, in characters.
ContextSizeHintSuffixCharacters *int `json:"contextSizeHintSuffixCharacters,omitempty"`
// ContextSizeHintTotalCharacters description: A hint the client should use when producing context to send to the LLM.
// The maximum length of all context (prefix + suffix + snippets), in characters.
ContextSizeHintTotalCharacters *int `json:"contextSizeHintTotalCharacters,omitempty"`
EditMaxTokens int `json:"editMaxTokens,omitempty"`
// EditPostInstruction description: Custom instruction to be included at the end of all edit commands
// when using this model, e.g. 'Write all unit tests with Jest instead of detected framework.'
//
// Note: similar to Cody client config option 'cody.edit.preInstruction'; if user has configured that it will be respected instead of this.
EditPostInstruction string `json:"editPostInstruction,omitempty"`
EditTemperature float64 `json:"editTemperature,omitempty"`
EditTopK float64 `json:"editTopK,omitempty"`
EditTopP float64 `json:"editTopP,omitempty"`
// EndOfText description: End of text identifier used by the model.
EndOfText string `json:"endOfText,omitempty"`
StopSequences []string `json:"stopSequences,omitempty"`
}
// ClientSideProviderConfig description: No client-side provider configuration is currently available.
type ClientSideProviderConfig struct {
}
// 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"`
}
// CodeMonitors description: Configuration options for code monitors
type CodeMonitors struct {
// Concurrency description: The number of code monitor jobs allowed to run concurrenctly. Decrease to reduce peak load.
Concurrency int `json:"concurrency,omitempty"`
// PollInterval description: The interval at which a monitor checks for new changes. Increase to reduce average load.
PollInterval string `json:"pollInterval,omitempty"`
}
// Codeintel description: The configuration for the codeintel queue.
type Codeintel struct {
// Limit description: The maximum number of dequeues allowed within the expiration window.
Limit int `json:"limit"`
// Weight description: The relative weight of this queue. Higher weights mean a higher chance of being picked at random.
Weight int `json:"weight"`
}
type CodyContextFilterItem struct {
// RepoNamePattern description: Regular expression which matches a set of repository names. The pattern is evaluated using Go regular expression syntax (https://golang.org/pkg/regexp/). By default, the pattern matches partially. Use \"^...$\" for whole-string matching.
RepoNamePattern string `json:"repoNamePattern"`
}
// CodyContextFilters description: Rules defining the repositories that will never be shared by Cody with third-party LLM providers.
type CodyContextFilters struct {
// Exclude description: List of rules specifying repositories that Cody should excluded from context in requests to third-party LLMs. These rules are applied only to repositories matching the include rules.
Exclude []*CodyContextFilterItem `json:"exclude,omitempty"`
// Include description: List of rules specifying repositories that Cody may include as context in requests to third-party LLMs. If defined, only repositories matching these rules will be considered for sharing. If not defined, all repositories may be shared.
Include []*CodyContextFilterItem `json:"include,omitempty"`
}
// CodyGateway description: Configuration related to the Cody Gateway service management. This should only be used on sourcegraph.com.
type CodyGateway struct {
// BigQueryDataset description: The dataset to pull BigQuery Cody Gateway related events from.
BigQueryDataset string `json:"bigQueryDataset,omitempty"`
// BigQueryGoogleProjectID description: The project ID to pull BigQuery Cody Gatewayrelated events from.
BigQueryGoogleProjectID string `json:"bigQueryGoogleProjectID,omitempty"`
// BigQueryTable description: The table in the dataset to pull BigQuery Cody Gateway related events from.
BigQueryTable string `json:"bigQueryTable,omitempty"`
}
type CodyProConfig struct {
// SamsBackendOrigin description: Origin of the SAMS backend. (Must match the SAMS OIDC registration in auth.providers.)
SamsBackendOrigin string `json:"samsBackendOrigin,omitempty"`
// SscBackendOrigin description: Origin of the Self-serve Cody backend.
SscBackendOrigin string `json:"sscBackendOrigin,omitempty"`
// SscBaseUrl description: The base URL of the Self-Serve Cody site.
SscBaseUrl string `json:"sscBaseUrl,omitempty"`
// StripePublishableKey description: Stripe Publishable Key for use in Stripe Checkout, Stripe Elements. This is not considered a secret.
StripePublishableKey string `json:"stripePublishableKey,omitempty"`
// UseEmbeddedUI description: Whether Cody Pro UI is served from sourcegraph.com. If false, users are directed to https://accounts.sourcegraph.com/cody to manage their Cody Pro subscription.
UseEmbeddedUI bool `json:"useEmbeddedUI,omitempty"`
}
// CodyRerankerCohere description: Re-ranker using Cohere API
type CodyRerankerCohere struct {
ApiKey string `json:"apiKey"`
Model string `json:"model,omitempty"`
Type string `json:"type"`
}
// CodyRerankerIdentity description: Identity re-ranker
type CodyRerankerIdentity struct {
Type string `json:"type"`
}
// CodyServerSideContext description: Configuration for Server-side context API
type CodyServerSideContext struct {
// IntentDetectionAPI description: Configuration for intent detection API
IntentDetectionAPI *IntentDetectionAPI `json:"intentDetectionAPI,omitempty"`
// Reranker description: Reranker to use for rankContext requests
Reranker *Reranker `json:"reranker,omitempty"`
}
// CommitGraphUpdates description: Customize strategy used for commit graph updates
type CommitGraphUpdates struct {
// DefaultBranchOnly description: Disables precise code nav on non-default branches. Specify repo names using regex syntax.
DefaultBranchOnly []string `json:"defaultBranchOnly,omitempty"`
}
// Completions description: Configuration for the completions service.
type Completions struct {
// AccessToken description: The access token used to authenticate with the external completions provider. If using the default provider 'sourcegraph', and if 'licenseKey' is set, a default access token is generated.
AccessToken string `json:"accessToken,omitempty"`
// AzureChatModel description: Optional: Specify the Azure OpenAI model name for chat completions. This is only needed when you want to count tokens associated with your azure model
AzureChatModel string `json:"azureChatModel,omitempty"`
// AzureCompletionModel description: Optional: Specify the Azure OpenAI model name for chat completions. This is only needed when you want to count tokens associated with your azure model
AzureCompletionModel string `json:"azureCompletionModel,omitempty"`
// AzureUseDeprecatedCompletionsAPIForOldModels description: Enables the use of the older completions API for select Azure OpenAI models.
AzureUseDeprecatedCompletionsAPIForOldModels bool `json:"azureUseDeprecatedCompletionsAPIForOldModels,omitempty"`
// ChatModel description: The model used for chat completions. If using the default provider 'sourcegraph', a reasonable default model will be set.
// NOTE: The Anthropic messages API does not support model names like claude-2 or claude-instant-1 where only the major version is specified as they are retired. We recommend using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison
ChatModel string `json:"chatModel,omitempty"`
// ChatModelMaxTokens description: The maximum number of tokens to use as client when talking to chatModel. If not set, clients need to set their own limit. If smartContextWindow is enabled, this value will be overridden by the clients.
ChatModelMaxTokens int `json:"chatModelMaxTokens,omitempty"`
// CompletionModel description: The model used for code completion. If using the default provider 'sourcegraph', a reasonable default model will be set.
// NOTE: The Anthropic messages API does not support model names like claude-2 or claude-instant-1 where only the major version is specified as they are retired. We recommend using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison
CompletionModel string `json:"completionModel,omitempty"`
// CompletionModelMaxTokens description: The maximum number of tokens to use as client when talking to completionModel. If not set, clients need to set their own limit.
CompletionModelMaxTokens int `json:"completionModelMaxTokens,omitempty"`
// DisableClientConfigAPI description: Should not be set. If set to true, disables the use of the new client config API. This new API has no user-facing effect, this opt-out is provided only as an escape hatch in case of issues.
DisableClientConfigAPI *bool `json:"disableClientConfigAPI,omitempty"`
// Enabled description: DEPRECATED. Use cody.enabled instead to turn Cody on/off.
Enabled *bool `json:"enabled,omitempty"`
// Endpoint description: The endpoint under which to reach the provider. Currently only used for provider types "sourcegraph", "openai" and "anthropic". The default values are "https://cody-gateway.sourcegraph.com", "https://api.openai.com/v1/chat/completions", and "https://api.anthropic.com/v1/messages" for Sourcegraph, OpenAI, and Anthropic, respectively.
Endpoint string `json:"endpoint,omitempty"`
// FastChatModel description: The model used for fast chat completions.
// NOTE: The Anthropic messages API does not support model names like claude-2 or claude-instant-1 where only the major version is specified as they are retired. We recommend using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison
FastChatModel string `json:"fastChatModel,omitempty"`
// FastChatModelMaxTokens description: The maximum number of tokens to use as client when talking to fastChatModel. If not set, clients need to set their own limit.
FastChatModelMaxTokens int `json:"fastChatModelMaxTokens,omitempty"`
// Model description: DEPRECATED. Use chatModel instead.
Model string `json:"model,omitempty"`
// PerCommunityUserChatMonthlyInteractionLimit description: If > 0, enables the maximum number of completions interactions allowed to be made by a single Community user in a month. This is for Cody PLG and applies to Dotcom only.
PerCommunityUserChatMonthlyInteractionLimit int `json:"perCommunityUserChatMonthlyInteractionLimit,omitempty"`
// PerCommunityUserChatMonthlyLLMRequestLimit description: If > 0, limits the number of completions requests allowed for a Community user in a month. This is for Self-serve Cody and applies to Dotcom only.
PerCommunityUserChatMonthlyLLMRequestLimit int `json:"perCommunityUserChatMonthlyLLMRequestLimit,omitempty"`
// PerCommunityUserCodeCompletionsMonthlyInteractionLimit description: If > 0, enables the maximum number of code completions interactions allowed to be made by a single Community user in a month. This is for Cody PLG and applies to Dotcom only.
PerCommunityUserCodeCompletionsMonthlyInteractionLimit int `json:"perCommunityUserCodeCompletionsMonthlyInteractionLimit,omitempty"`
// PerCommunityUserCodeCompletionsMonthlyLLMRequestLimit description: If > 0, limits the number of code completions requests allowed for a Community user in a month. This is for Self-serve Cody and applies to Dotcom only.
PerCommunityUserCodeCompletionsMonthlyLLMRequestLimit int `json:"perCommunityUserCodeCompletionsMonthlyLLMRequestLimit,omitempty"`
// PerProUserChatDailyInteractionLimit description: If > 0, enables the maximum number of completions interactions allowed to be made by a single Pro user in a day. This is for Cody PLG and applies to Dotcom only.
PerProUserChatDailyInteractionLimit int `json:"perProUserChatDailyInteractionLimit,omitempty"`
// PerProUserChatDailyLLMRequestLimit description: If > 0, limits the number of completions requests allowed for a Pro user in a day. This is for Self-serve Cody and applies to Dotcom only.
PerProUserChatDailyLLMRequestLimit int `json:"perProUserChatDailyLLMRequestLimit,omitempty"`
// PerProUserCodeCompletionsDailyInteractionLimit description: If > 0, enables the maximum number of code completions interactions allowed to be made by a single Pro user in a day. This is for Cody PLG and applies to Dotcom only.
PerProUserCodeCompletionsDailyInteractionLimit int `json:"perProUserCodeCompletionsDailyInteractionLimit,omitempty"`
// PerProUserCodeCompletionsDailyLLMRequestLimit description: If > 0, limits the number of code completions requests allowed for a Pro user in a day. This is for Self-serve Cody and applies to Dotcom only.
PerProUserCodeCompletionsDailyLLMRequestLimit int `json:"perProUserCodeCompletionsDailyLLMRequestLimit,omitempty"`
// PerUserCodeCompletionsDailyLimit description: If > 0, limits the number of code completions requests allowed for a user in a day. On instances that allow anonymous requests, we enforce the rate limit by IP.
PerUserCodeCompletionsDailyLimit int `json:"perUserCodeCompletionsDailyLimit,omitempty"`
// PerUserDailyLimit description: If > 0, limits the number of completions requests allowed for a user in a day. On instances that allow anonymous requests, we enforce the rate limit by IP.
PerUserDailyLimit int `json:"perUserDailyLimit,omitempty"`
// Provider description: The external completions provider. Defaults to 'sourcegraph'.
Provider string `json:"provider,omitempty"`
// SmartContextWindow description: Whether the maximum number of tokens should be automatically adjusted by the client based on the name of chatModel. If enabled, it will override the value set in chatModelMaxTokens.
SmartContextWindow string `json:"smartContextWindow,omitempty"`
// User description: The user field for OpenAI config for both AzureOpenAI and OpenAI
User string `json:"user,omitempty"`
}
// ConfigFeatures description: Configuration for the completions service.
type ConfigFeatures struct {
// AutoComplete description: Enable/Disable AutoComplete for the clients
AutoComplete bool `json:"autoComplete,omitempty"`
// Chat description: Enable/Disable Chat for the clients
Chat bool `json:"chat,omitempty"`
// Commands description: Enable/Disable special commands for the clients
Commands bool `json:"commands,omitempty"`
}
// ContextWindow description: Context window for the model
type ContextWindow struct {
MaxInputTokens int `json:"maxInputTokens"`
MaxOutputTokens int `json:"maxOutputTokens"`
}
// 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"`
}
// DefaultModelConfig description: The model configuration that is applied to every model for a given provider.
type DefaultModelConfig struct {
// Capabilities description: Whether the model can be used for chat, just autocomplete, etc.
Capabilities []string `json:"capabilities"`
Category string `json:"category"`
ClientSideConfig *ClientSideModelConfig `json:"clientSideConfig,omitempty"`
ContextWindow ContextWindow `json:"contextWindow"`
ServerSideConfig *ServerSideModelConfig `json:"serverSideConfig,omitempty"`
Status string `json:"status"`
}
type DefaultModels struct {
// Chat description: The qualified name of the model to use for chat, in '${ProviderID}::${APIVersionID}::${ModelID}' format
Chat string `json:"chat,omitempty"`
// CodeCompletion description: The qualified name of the model to use for code completion, in '${ProviderID}::${APIVersionID}::${ModelID}' format
CodeCompletion string `json:"codeCompletion,omitempty"`
// FastChat description: The qualified name of the model to use for fast chat, in '${ProviderID}::${APIVersionID}::${ModelID}' format
FastChat string `json:"fastChat,omitempty"`
}
// DequeueCacheConfig description: The configuration for the dequeue cache of multiqueue executors. Each queue defines a limit of dequeues in the expiration window as well as a weight, indicating how frequently a queue is picked at random. For example, a weight of 4 for batches and 1 for codeintel means out of 5 dequeues, statistically batches will be picked 4 times and codeintel 1 time (unless one of those queues is at its limit).
type DequeueCacheConfig struct {
// Batches description: The configuration for the batches queue.
Batches *Batches `json:"batches,omitempty"`
// Codeintel description: The configuration for the codeintel queue.
Codeintel *Codeintel `json:"codeintel,omitempty"`
}
type DoNotUsePhonyDiscriminantType struct {
// DoNotUseThisProperty description: Do not use/set this property, it is useless. go-jsonschema has an issue where it does not support writing a tagged union unless it can find a field each of the union types do NOT have in common; this type merely exists to provide a field that is not in common with all other oneOf types. https://sourcegraph.com/github.com/sourcegraph/go-jsonschema/-/blob/compiler/generator_tagged_union_type.go?L47-49
DoNotUseThisProperty string `json:"doNotUseThisProperty,omitempty"`
Type string `json:"type"`
}
// Dotcom description: Configuration options for Sourcegraph.com only.
type Dotcom struct {
// CodyGateway description: Configuration related to the Cody Gateway service management. This should only be used on sourcegraph.com.
CodyGateway *CodyGateway `json:"codyGateway,omitempty"`
CodyProConfig *CodyProConfig `json:"codyProConfig,omitempty"`
// EnterprisePortalEnableProxies description: Whether to enable Enterprise Portal auth proxies for site admins.
EnterprisePortalEnableProxies *bool `json:"enterprisePortal.enableProxies,omitempty"`
// MinimumExternalAccountAge description: The minimum amount of days a Github or GitLab account must exist, before being allowed on Sourcegraph.com.
MinimumExternalAccountAge int `json:"minimumExternalAccountAge,omitempty"`
// MinimumExternalAccountAgeExemptList description: A list of email addresses that are allowed to be exempted from the minimumExternalAccountAge requirement.
MinimumExternalAccountAgeExemptList []string `json:"minimumExternalAccountAgeExemptList,omitempty"`
// SamsClientID description: The clientID for SAMS production instance.
SamsClientID string `json:"sams.clientID,omitempty"`
// SamsClientSecret description: The clientSecret for SAMS production instance.
SamsClientSecret string `json:"sams.clientSecret,omitempty"`
// SamsServer description: The server URL for SAMS production instance.
SamsServer string `json:"sams.server,omitempty"`
// SamsDevClientID description: The clientID for SAMS development instance.
SamsDevClientID string `json:"samsDev.clientID,omitempty"`
// SamsDevClientSecret description: The clientSecret for SAMS development instance.
SamsDevClientSecret string `json:"samsDev.clientSecret,omitempty"`
// SamsDevServer description: The server URL for SAMS development instance.
SamsDevServer string `json:"samsDev.server,omitempty"`
// SlackLicenseAnomallyWebhook description: Slack webhook for when there is an anomaly detected with license key usage.
SlackLicenseAnomallyWebhook string `json:"slackLicenseAnomallyWebhook,omitempty"`
// SlackLicenseCreationWebhook description: Slack webhook for when a license key is created.
SlackLicenseCreationWebhook string `json:"slackLicenseCreationWebhook,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. For provider sourcegraph, this is optional.
AccessToken string `json:"accessToken,omitempty"`
// Dimensions description: The dimensionality of the embedding vectors. Required field if not using the sourcegraph provider.
Dimensions int `json:"dimensions,omitempty"`
// Enabled description: Toggles whether embedding service is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Endpoint description: The endpoint under which to reach the provider. Sensible default will be used for each provider.
Endpoint string `json:"endpoint,omitempty"`
// ExcludeChunkOnError description: Whether to cancel indexing a repo if embedding a single file fails. If true, the chunk that cannot generate embeddings is not indexed and the remainder of the repository proceeds with indexing.
ExcludeChunkOnError *bool `json:"excludeChunkOnError,omitempty"`
// 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"`
// FileFilters description: Filters that allow you to specify which files in a repository should get embedded.
FileFilters *FileFilters `json:"fileFilters,omitempty"`
// Incremental description: Whether to generate embeddings incrementally. If true, only files that have changed since the last run will be processed.
Incremental *bool `json:"incremental,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"`
// MinimumInterval description: The time to wait between runs. Valid time units are "s", "m", "h". Example values: "30s", "5m", "1h".
MinimumInterval string `json:"minimumInterval,omitempty"`
// Model description: The model used for embedding. A default model will be used for each provider, if not set.
Model string `json:"model,omitempty"`
// PerCommunityUserEmbeddingsMonthlyLimit description: If > 0, limits the number of tokens allowed to be embedded by a Community user in a month. This is for Self-serve Cody and applies to Dotcom only.
PerCommunityUserEmbeddingsMonthlyLimit int `json:"perCommunityUserEmbeddingsMonthlyLimit,omitempty"`
// PerProUserEmbeddingsMonthlyLimit description: If > 0, limits the number of tokens allowed to be embedded by a Pro user in a month. This is for Self-serve Cody and applies to Dotcom only.
PerProUserEmbeddingsMonthlyLimit int `json:"perProUserEmbeddingsMonthlyLimit,omitempty"`
// PolicyRepositoryMatchLimit description: The maximum number of repositories that can be matched by a global embeddings policy
PolicyRepositoryMatchLimit *int `json:"policyRepositoryMatchLimit,omitempty"`
// Provider description: The provider to use for generating embeddings. Defaults to sourcegraph.
Provider string `json:"provider,omitempty"`
// Url description: The url to the external embedding API service. Deprecated, use endpoint instead.
Url string `json:"url,omitempty"`
}
// EncryptionKey description: Config for a key
type EncryptionKey struct {
Cloudkms *CloudKMSEncryptionKey
Awskms *AWSKMSEncryptionKey
Mounted *MountedEncryptionKey
Noop *NoOpEncryptionKey
}
func (v EncryptionKey) MarshalJSON() ([]byte, error) {