sourcegraph/schema/schema.go
Camden Cheek ee3a710b7c
Chore: remove enablePreciseOccurrences feature flag (#64229)
Just removes a redundant feature flag.
2024-08-02 00:02:53 +00:00

3735 lines
260 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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
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"`
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 git@ssh.dev.azure.com: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 git@bitbucket.org: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"`
}
// 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://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://git@example.bitbucket.org/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) {
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 ExcludedGerritProject struct {
// Name description: The name of a Gerrit project to exclude from mirroring.
Name string `json:"name,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"`
// Size description: If set, repositories with a size above the specified one will be excluded.
Size string `json:"size,omitempty"`
// Stars description: If set, repositories stars less than the specified number will be.
Stars string `json:"stars,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"`
}
// ExecutorsMultiqueue description: The configuration for multiqueue executors.
type ExecutorsMultiqueue struct {
// 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).
DequeueCacheConfig *DequeueCacheConfig `json:"dequeueCacheConfig,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 {
// BatchChangesEnablePerforce description: When enabled, batch changes will be executable on Perforce depots.
BatchChangesEnablePerforce bool `json:"batchChanges.enablePerforce,omitempty"`
// CodeintelSyntacticIndexingEnabled description: When enabled, syntactic indexing jobs will be scheduled for all enabled repos
CodeintelSyntacticIndexingEnabled bool `json:"codeintelSyntacticIndexing.enabled,omitempty"`
// CodyServerSideContext description: Configuration for Server-side context API
CodyServerSideContext *CodyServerSideContext `json:"cody.serverSideContext,omitempty"`
// CodyContextIgnore description: Enabled filtering of remote Cody context based on repositories ./cody/ignore file
CodyContextIgnore *bool `json:"codyContextIgnore,omitempty"`
// CommitGraphUpdates description: Customize strategy used for commit graph updates
CommitGraphUpdates *CommitGraphUpdates `json:"commitGraphUpdates,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"`
// EnableGithubInternalRepoVisibility description: Enable support for visibility of internal Github repositories
EnableGithubInternalRepoVisibility bool `json:"enableGithubInternalRepoVisibility,omitempty"`
// EnablePermissionsWebhooks description: DEPRECATED: No longer has any effect.
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"`
// LanguageDetection description: Setting for customizing language detection behavior
LanguageDetection *LanguageDetection `json:"languageDetection,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"`
// PerforceChangelistMapping description: Allow mapping of Perforce changelists to their commit SHAs in the DB
PerforceChangelistMapping string `json:"perforceChangelistMapping,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"`
// ScipBasedAPIs description: Enable usage of new CodeGraph and usagesForSymbol APIs
ScipBasedAPIs *bool `json:"scipBasedAPIs,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"`
// SearchJobs description: Enables search jobs (long-running exhaustive) search feature and its UI
SearchJobs *bool `json:"searchJobs,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, "batchChanges.enablePerforce")
delete(m, "codeintelSyntacticIndexing.enabled")
delete(m, "cody.serverSideContext")
delete(m, "codyContextIgnore")
delete(m, "commitGraphUpdates")
delete(m, "customGitFetch")
delete(m, "debug.log")
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, "languageDetection")
delete(m, "npmPackages")
delete(m, "pagure")
delete(m, "passwordPolicy")
delete(m, "perforce")
delete(m, "perforceChangelistMapping")
delete(m, "pythonPackages")
delete(m, "ranking")
delete(m, "rateLimitAnonymous")
delete(m, "rubyPackages")
delete(m, "rustPackages")
delete(m, "scipBasedAPIs")
delete(m, "search.index.branches")
delete(m, "search.index.query.contexts")
delete(m, "search.index.revisions")
delete(m, "search.sanitization")
delete(m, "searchJobs")
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"`
}
// FileFilters description: Filters that allow you to specify which files in a repository should get embedded.
type FileFilters struct {
// 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"`
// IncludedFilePathPatterns description: A list of glob patterns that match file paths you want to include in embeddings. If specified, all files not matching these include patterns are excluded.
IncludedFilePathPatterns []string `json:"includedFilePathPatterns,omitempty"`
// MaxFileSizeBytes description: The maximum file size (in bytes) to include in embeddings. Must be between 0 and 100000 (1 MB).
MaxFileSizeBytes int `json:"maxFileSizeBytes,omitempty"`
}
// 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,omitempty"`
// 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://sourcegraph.com/docs/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://sourcegraph.com/docs/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"`
// Exclude description: A list of repositories to never mirror from this Gerrit instance. Takes precedence over "projects" configuration.
//
// Supports excluding by name ({"name": "owner/name"})
Exclude []*ExcludedGerritProject `json:"exclude,omitempty"`
// GitURLType description: The type of Git URLs to use for cloning and fetching Git repositories on this Gerrit instance.
//
// If "http", Sourcegraph will access Gerrit repositories using Git URLs of the form http(s)://gerrit.example.com/a/myteam/myproject.git (using https: if the Gerrit instance uses HTTPS).
//
// If "ssh", Sourcegraph will access Gerrit repositories using Git URLs of the form git@gerrit.example.com:myteam/myproject.git. The exact hostname and port will be fetched from /ssh_info. 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"`
// 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"`
// RepositoryPathPattern description: The pattern used to generate the corresponding Sourcegraph repository name for a Gerrit repository. In the pattern, the variable "{host}" is replaced with the Gerrit host (such as gerrit.example.com), and "{name}" is replaced with the Gerrit repository's name (such as "myrepo").
//
// For example, if your Gerrit URL is https://gerrit.example.com and your Sourcegraph URL is https://src.example.com, then a repositoryPathPattern of "{host}/{name}" would mean that a Gerrit repository at https://gerrit.example.com/myrepo is available on Sourcegraph at https://src.example.com/gerrit.example.com/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"`
// Url description: URL of a Gerrit instance, such as https://gerrit.example.com.
Url string `json:"url"`
// Username description: A username for authentication with 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.
PrivateKey string `json:"privateKey,omitempty"`
// Slug description: The slug of the GitHub App for Sourcegraph.
Slug string `json:"slug,omitempty"`
}
// GitHubAppDetails description: If non-null, this is a GitHub App connection with some additional properties.
type GitHubAppDetails struct {
// AppID description: The ID of the GitHub App.
AppID int `json:"appID,omitempty"`
// BaseURL description: The base URL of the GitHub App.
BaseURL string `json:"baseURL,omitempty"`
// CloneAllRepositories description: Clone all repositories for this App installation.
CloneAllRepositories bool `json:"cloneAllRepositories,omitempty"`
// InstallationID description: The installation ID of this connection.
InstallationID int `json:"installationID,omitempty"`
}
// GitHubAuthProvider description: Configures the GitHub (or GitHub Enterprise) OAuth authentication provider for SSO. In addition to specifying this configuration object, you must also create a OAuth App on your GitHub instance: https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/. When a user signs into Sourcegraph or links their GitHub account to their existing Sourcegraph account, GitHub will prompt the user for the repo scope.
type GitHubAuthProvider struct {
// AllowGroupsPermissionsSync description: Experimental: Allows sync of GitHub teams and organizations permissions across all external services associated with this provider to allow enabling of [repository permissions caching](https://sourcegraph.com/docs/admin/code_hosts/github#teams-and-organizations-permissions-caching).
AllowGroupsPermissionsSync bool `json:"allowGroupsPermissionsSync,omitempty"`
// AllowOrgs description: Restricts new logins and signups (if allowSignup is true) to members of these GitHub organizations. Existing sessions won't be invalidated. Leave empty or unset for no org restrictions.
AllowOrgs []string `json:"allowOrgs,omitempty"`
// AllowOrgsMap description: Restricts new logins and signups (if allowSignup is true) to members of GitHub teams. Each list of teams should have their Github org name as a key. Subteams inheritance is not supported, therefore only members of the listed teams will be granted access. Existing sessions won't be invalidated. Leave empty or unset for no team restrictions.
AllowOrgsMap map[string][]string `json:"allowOrgsMap,omitempty"`
// AllowSignup description: Allows new visitors to sign up for accounts via GitHub authentication. If false, users signing in via GitHub must have an existing Sourcegraph account, which will be linked to their GitHub identity after sign-in.
AllowSignup bool `json:"allowSignup,omitempty"`
// ClientID description: The Client ID of the GitHub OAuth app, accessible from https://github.com/settings/developers (or the same path on GitHub Enterprise).
ClientID string `json:"clientID"`
// ClientSecret description: The Client Secret of the GitHub OAuth app, accessible from https://github.com/settings/developers (or the same path on GitHub Enterprise).
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 GitHub instance, such as https://github.com or https://github-enterprise.example.com.
Url string `json:"url,omitempty"`
}
// GitHubAuthorization description: If non-null, enforces GitHub 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 "github" with the same `url` field as specified in this `GitHubConnection`.
type GitHubAuthorization struct {
// GroupsCacheTTL description: Experimental: If set, configures hours cached permissions from teams and organizations should be kept for. Setting a negative value disables syncing from teams and organizations, and falls back to the default behaviour of syncing all permisisons directly from user-repository affiliations instead. [Learn more](https://sourcegraph.com/docs/admin/code_hosts/github#teams-and-organizations-permissions-caching).
GroupsCacheTTL float64 `json:"groupsCacheTTL,omitempty"`
// MarkInternalReposAsPublic description: If true, internal repositories will be accessible to all users on Sourcegraph as if they were public. This overrides repository permissions but allows easier discovery and access to internal repositories, and may be desirable if all users on the Sourcegraph instance should have access to all internal repositories anyways. Defaults to false.
MarkInternalReposAsPublic bool `json:"markInternalReposAsPublic,omitempty"`
// SyncInternalRepoPermissions description: If true, access to internal repositories will be synced as part of user permission syncs. This can lead to slower user permission syncs for organizations with many internal repositories. Defaults to false.
SyncInternalRepoPermissions bool `json:"syncInternalRepoPermissions,omitempty"`
}
// GitHubConnection description: Configuration for a connection to GitHub or GitHub Enterprise.
type GitHubConnection struct {
// Authorization description: If non-null, enforces GitHub 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 "github" with the same `url` field as specified in this `GitHubConnection`.
Authorization *GitHubAuthorization `json:"authorization,omitempty"`
// Certificate description: TLS certificate of the GitHub Enterprise 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 GitHub instance. Takes precedence over "orgs", "repos", and "repositoryQuery" configuration.
//
// Supports excluding by name ({"name": "owner/name"}) or by ID ({"id": "MDEwOlJlcG9zaXRvcnkxMTczMDM0Mg=="}).
//
// Note: ID is the GitHub GraphQL ID, not the GitHub database ID. eg: "curl https://api.github.com/repos/vuejs/vue | jq .node_id"
Exclude []*ExcludedGitHubRepo `json:"exclude,omitempty"`
// GitHubAppDetails description: If non-null, this is a GitHub App connection with some additional properties.
GitHubAppDetails *GitHubAppDetails `json:"gitHubAppDetails,omitempty"`
// GitURLType description: The type of Git URLs to use for cloning and fetching Git repositories on this GitHub instance.
//
// If "http", Sourcegraph will access GitHub repositories using Git URLs of the form http(s)://github.com/myteam/myproject.git (using https: if the GitHub instance uses HTTPS).
//
// If "ssh", Sourcegraph will access GitHub repositories using Git URLs of the form git@github.com:myteam/myproject.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"`
// GithubAppInstallationID description: DEPRECATED: The installation ID of the GitHub App.
GithubAppInstallationID string `json:"githubAppInstallationID,omitempty"`
// InitialRepositoryEnablement description: Deprecated and ignored field which will be removed entirely in the next release. GitHub repositories can no longer be enabled or disabled explicitly. Configure repositories to be mirrored via "repos", "exclude" and "repositoryQuery" instead.
InitialRepositoryEnablement bool `json:"initialRepositoryEnablement,omitempty"`
// Orgs description: An array of organization names identifying GitHub organizations whose repositories should be mirrored on Sourcegraph.
Orgs []string `json:"orgs,omitempty"`
// Pending description: Whether the code host connection is in a pending state.
Pending bool `json:"pending,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to GitHub.
RateLimit *GitHubRateLimit `json:"rateLimit,omitempty"`
// Repos description: An array of repository "owner/name" strings specifying which GitHub or GitHub Enterprise repositories to mirror on Sourcegraph.
Repos []string `json:"repos,omitempty"`
// RepositoryPathPattern description: The pattern used to generate the corresponding Sourcegraph repository name for a GitHub or GitHub Enterprise repository. In the pattern, the variable "{host}" is replaced with the GitHub host (such as github.example.com), and "{nameWithOwner}" is replaced with the GitHub repository's "owner/path" (such as "myorg/myrepo").
//
// For example, if your GitHub Enterprise URL is https://github.example.com and your Sourcegraph URL is https://src.example.com, then a repositoryPathPattern of "{host}/{nameWithOwner}" would mean that a GitHub repository at https://github.example.com/myorg/myrepo is available on Sourcegraph at https://src.example.com/github.example.com/myorg/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"`
// RepositoryQuery description: An array of strings specifying which GitHub or GitHub Enterprise repositories to mirror on Sourcegraph. The valid values are:
//
// - `public` mirrors all public repositories for GitHub Enterprise and is the equivalent of `none` for GitHub
//
// - `internal` mirrors all internal repositories for GitHub Enterprise and is the equivalent of `none` for GitHub
//
// - `affiliated` mirrors all repositories affiliated with the configured token's user:
// - Private repositories with read access
// - Public repositories owned by the user or their orgs
// - Public repositories with write access
//
// - `none` mirrors no repositories (except those specified in the `repos` configuration property or added manually)
//
// - All other values are executed as a GitHub advanced repository search as described at https://github.com/search/advanced. Example: to sync all repositories from the "sourcegraph" organization including forks the query would be "org:sourcegraph fork:true".
//
// If multiple values are provided, their results are unioned.
//
// If you need to narrow the set of mirrored repositories further (and don't want to enumerate it with a list or query set as above), create a new bot/machine user on GitHub or GitHub Enterprise that is only affiliated with the desired repositories.
RepositoryQuery []string `json:"repositoryQuery,omitempty"`
// Token description: A GitHub personal access token. Create one for GitHub.com at https://github.com/settings/tokens/new?description=Sourcegraph (for GitHub Enterprise, replace github.com with your instance's hostname). See https://sourcegraph.com/docs/admin/code_hosts/github#github-api-access for which scopes are required for which use cases.
Token string `json:"token,omitempty"`
// Url description: URL of a GitHub instance, such as https://github.com or https://github-enterprise.example.com.
Url string `json:"url"`
// Webhooks description: An array of configurations defining existing GitHub webhooks that send updates back to Sourcegraph.
Webhooks []*GitHubWebhook `json:"webhooks,omitempty"`
}
// GitHubRateLimit description: Rate limit applied when making background API requests to GitHub.
type GitHubRateLimit 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 GitHubWebhook struct {
// Org description: The name of the GitHub organization to which the webhook belongs
Org string `json:"org"`
// Secret description: The secret used when creating the webhook
Secret string `json:"secret"`
}
// GitLabAuthProvider description: Configures the GitLab OAuth authentication provider for SSO. In addition to specifying this configuration object, you must also create a OAuth App on your GitLab instance: https://docs.gitlab.com/ee/integration/oauth_provider.html. The application should have `api` and `read_user` scopes and the callback URL set to the concatenation of your Sourcegraph instance URL and "/.auth/gitlab/callback".
type GitLabAuthProvider struct {
// AllowGroups description: Restricts new logins and signups (if allowSignup is true) to members of these GitLab groups. Existing sessions won't be invalidated. Make sure to inform the full path for groups or subgroups instead of their names. Leave empty or unset for no group restrictions.
AllowGroups []string `json:"allowGroups,omitempty"`
// AllowSignup description: Allows new visitors to sign up for accounts via GitLab authentication. If false, users signing in via GitLab must have an existing Sourcegraph account, which will be linked to their GitLab 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 Client ID of the GitLab OAuth app, accessible from https://gitlab.com/oauth/applications (or the same path on your private GitLab instance).
ClientID string `json:"clientID"`
// ClientSecret description: The Client Secret of the GitLab OAuth app, accessible from https://gitlab.com/oauth/applications (or the same path on your private GitLab instance).
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"`
// SsoURL description: An alternate sign-in URL used to ease SSO sign-in flows, such as https://gitlab.com/groups/your-group/saml/sso?token=xxxxxx
SsoURL string `json:"ssoURL,omitempty"`
// SyncInternalRepoPermissions description: Whether to sync permissions for internal repositories on GitLab. Setting this to false can be useful when internal repositories are configured to be public on Sourcegraph.
SyncInternalRepoPermissions *bool `json:"syncInternalRepoPermissions,omitempty"`
// TokenRefreshWindowMinutes description: Time in minutes before token expiry when we should attempt to refresh it
TokenRefreshWindowMinutes int `json:"tokenRefreshWindowMinutes,omitempty"`
Type string `json:"type"`
// Url description: URL of the GitLab instance, such as https://gitlab.com or https://gitlab.example.com.
Url string `json:"url,omitempty"`
}
// GitLabAuthorization description: If non-null, enforces GitLab repository permissions. This requires that there be an item in the `auth.providers` field of type "gitlab" with the same `url` field as specified in this `GitLabConnection`.
type GitLabAuthorization struct {
// IdentityProvider description: The source of identity to use when computing permissions. This defines how to compute the GitLab identity to use for a given Sourcegraph user.
IdentityProvider IdentityProvider `json:"identityProvider"`
}
// GitLabConnection description: Configuration for a connection to GitLab (GitLab.com or GitLab self-managed).
type GitLabConnection struct {
// Authorization description: If non-null, enforces GitLab repository permissions. This requires that there be an item in the `auth.providers` field of type "gitlab" with the same `url` field as specified in this `GitLabConnection`.
Authorization *GitLabAuthorization `json:"authorization,omitempty"`
// Certificate description: TLS certificate of the GitLab 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 projects to never mirror from this GitLab instance. Takes precedence over "projects" and "projectQuery" configuration. Supports excluding by name ({"name": "group/name"}) or by ID ({"id": 42}).
Exclude []*ExcludedGitLabProject `json:"exclude,omitempty"`
// GitURLType description: The type of Git URLs to use for cloning and fetching Git repositories on this GitLab instance.
//
// If "http", Sourcegraph will access GitLab repositories using Git URLs of the form http(s)://gitlab.example.com/myteam/myproject.git (using https: if the GitLab instance uses HTTPS).
//
// If "ssh", Sourcegraph will access GitLab repositories using Git URLs of the form git@example.gitlab.com: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"`
// InitialRepositoryEnablement description: Deprecated and ignored field which will be removed entirely in the next release. GitLab repositories can no longer be enabled or disabled explicitly.
InitialRepositoryEnablement bool `json:"initialRepositoryEnablement,omitempty"`
// MarkInternalReposAsPublic description: If true, internal repositories will be accessible to all users on Sourcegraph as if they were public, and user permission syncs will no longer check for public repositories. This overrides repository permissions but allows easier discovery and access to internal repositories, and may be desirable if all users on the Sourcegraph instance should have access to all internal repositories anyways. Defaults to false.
MarkInternalReposAsPublic bool `json:"markInternalReposAsPublic,omitempty"`
// NameTransformations description: An array of transformations will apply to the repository name. Currently, only regex replacement is supported. All transformations happen after "repositoryPathPattern" is processed.
NameTransformations []*GitLabNameTransformation `json:"nameTransformations,omitempty"`
// ProjectQuery description: An array of strings specifying which GitLab projects to mirror on Sourcegraph. Each string is a URL path and query that targets a GitLab API endpoint returning a list of projects. If the string only contains a query, then "projects" is used as the path. Examples: "?membership=true&search=foo", "groups/mygroup/projects".
//
// The special string "none" can be used as the only element to disable this feature. Projects matched by multiple query strings are only imported once. Here are a few endpoints that return a list of projects: https://docs.gitlab.com/ee/api/projects.html#list-all-projects, https://docs.gitlab.com/ee/api/groups.html#list-a-groups-projects, https://docs.gitlab.com/ee/api/search.html#scope-projects.
ProjectQuery []string `json:"projectQuery"`
// Projects description: A list of projects to mirror from this GitLab instance. Supports including by name ({"name": "group/name"}) or by ID ({"id": 42}).
Projects []*GitLabProject `json:"projects,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to GitLab.
RateLimit *GitLabRateLimit `json:"rateLimit,omitempty"`
// RepositoryPathPattern description: The pattern used to generate a the corresponding Sourcegraph repository name for a GitLab project. In the pattern, the variable "{host}" is replaced with the GitLab URL's host (such as gitlab.example.com), and "{pathWithNamespace}" is replaced with the GitLab project's "namespace/path" (such as "myteam/myproject").
//
// For example, if your GitLab is https://gitlab.example.com and your Sourcegraph is https://src.example.com, then a repositoryPathPattern of "{host}/{pathWithNamespace}" would mean that a GitLab project at https://gitlab.example.com/myteam/myproject is available on Sourcegraph at https://src.example.com/gitlab.example.com/myteam/myproject.
//
// 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"`
// Token description: A GitLab access token with "api" scope. Can be a personal access token (PAT) or an OAuth token. If you are enabling permissions with identity provider type "username", this token should also have "sudo" scope.
Token string `json:"token"`
// TokenOauthExpiry description: The OAuth token expiry (Unix timestamp in seconds)
TokenOauthExpiry int `json:"token.oauth.expiry,omitempty"`
// TokenOauthRefresh description: The OAuth refresh token
TokenOauthRefresh string `json:"token.oauth.refresh,omitempty"`
// TokenType description: The type of the token
TokenType string `json:"token.type,omitempty"`
// Url description: URL of a GitLab instance, such as https://gitlab.example.com or (for GitLab.com) https://gitlab.com.
Url string `json:"url"`
// Webhooks description: An array of webhook configurations
Webhooks []*GitLabWebhook `json:"webhooks,omitempty"`
}
type GitLabNameTransformation struct {
// Regex description: The regex to match for the occurrences of its replacement.
Regex string `json:"regex,omitempty"`
// Replacement description: The replacement used to replace all matched occurrences by the regex.
Replacement string `json:"replacement,omitempty"`
}
type GitLabProject struct {
// Id description: The ID of a GitLab project (as returned by the GitLab instance's API) to mirror.
Id int `json:"id,omitempty"`
// Name description: The name of a GitLab project ("group/name") to mirror.
Name string `json:"name,omitempty"`
}
// GitLabRateLimit description: Rate limit applied when making background API requests to GitLab.
type GitLabRateLimit 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 GitLabWebhook struct {
// Secret description: The secret used to authenticate incoming webhook requests
Secret string `json:"secret"`
}
// GitRecorder description: Record git operations that are executed on configured repositories.
type GitRecorder struct {
// IgnoredGitCommands description: List of git commands that should be ignored and not recorded.
IgnoredGitCommands []string `json:"ignoredGitCommands,omitempty"`
// Repos description: List of repositories whose git operations should be recorded. To record commands on all repositories, simply pass in an asterisk as the only item in the array.
Repos []string `json:"repos,omitempty"`
// Size description: Defines how many recordings to keep. Once this size is reached, the oldest entry will be removed.
Size int `json:"size,omitempty"`
}
// Github description: GitHub configuration, both for queries and receiving release webhooks.
type Github struct {
// Repository description: The repository to get the latest version of.
Repository *Repository `json:"repository,omitempty"`
// Token description: The access token to use when communicating with GitHub.
Token string `json:"token"`
// Uri description: The URI of the GitHub instance.
Uri string `json:"uri,omitempty"`
// WebhookSecret description: The release webhook secret.
WebhookSecret string `json:"webhookSecret"`
}
// GitoliteConnection description: Configuration for a connection to Gitolite.
type GitoliteConnection struct {
// Exclude description: A list of repositories to never mirror from this Gitolite instance. Supports excluding by exact name ({"name": "foo"}).
Exclude []*ExcludedGitoliteRepo `json:"exclude,omitempty"`
// Host description: Gitolite host that stores the repositories (e.g., git@gitolite.example.com, ssh://git@gitolite.example.com:2222/).
Host string `json:"host"`
// Phabricator description: This is DEPRECATED
Phabricator *Phabricator `json:"phabricator,omitempty"`
// PhabricatorMetadataCommand description: This is DEPRECATED
PhabricatorMetadataCommand string `json:"phabricatorMetadataCommand,omitempty"`
// Prefix description: Repository name prefix that will map to this Gitolite host. This should likely end with a trailing slash. E.g., "gitolite.example.com/".
//
// It is important that the Sourcegraph repository name generated with this prefix be unique to this code host. If different code hosts generate repository names that collide, Sourcegraph's behavior is undefined.
Prefix string `json:"prefix"`
}
// GoModulesConnection description: Configuration for a connection to Go module proxies
type GoModulesConnection struct {
// Dependencies description: An array of strings specifying Go modules to mirror in Sourcegraph.
Dependencies []string `json:"dependencies,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to the configured Go module proxies.
RateLimit *GoRateLimit `json:"rateLimit,omitempty"`
// Urls description: The list of Go module proxy URLs to fetch modules from. 404 Not found or 410 Gone responses will result in the next URL to be attempted.
Urls []string `json:"urls"`
}
// GoRateLimit description: Rate limit applied when making background API requests to the configured Go module proxies.
type GoRateLimit 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"`
}
// HTTPHeaderAuthProvider description: Configures the HTTP header authentication provider (which authenticates users by consulting an HTTP request header set by an authentication proxy such as https://github.com/bitly/oauth2_proxy).
type HTTPHeaderAuthProvider struct {
// EmailHeader description: The name (case-insensitive) of an HTTP header whose value is taken to be the email of the client requesting the page. Set this value when using an HTTP proxy that authenticates requests, and you don't want the extra configurability of the other authentication methods.
EmailHeader string `json:"emailHeader,omitempty"`
// StripUsernameHeaderPrefix description: The prefix that precedes the username portion of the HTTP header specified in `usernameHeader`. If specified, the prefix will be stripped from the header value and the remainder will be used as the username. For example, if using Google Identity-Aware Proxy (IAP) with Google Sign-In, set this value to `accounts.google.com:`.
StripUsernameHeaderPrefix string `json:"stripUsernameHeaderPrefix,omitempty"`
Type string `json:"type"`
// UsernameHeader description: The name (case-insensitive) of an HTTP header whose value is taken to be the username of the client requesting the page. Set this value when using an HTTP proxy that authenticates requests, and you don't want the extra configurability of the other authentication methods.
UsernameHeader string `json:"usernameHeader"`
}
type Header struct {
Key string `json:"key"`
Sensitive bool `json:"sensitive,omitempty"`
Value string `json:"value"`
}
// IdentityProvider description: The source of identity to use when computing permissions. This defines how to compute the GitLab identity to use for a given Sourcegraph user.
type IdentityProvider struct {
Oauth *OAuthIdentity
Username *UsernameIdentity
}
func (v IdentityProvider) MarshalJSON() ([]byte, error) {
if v.Oauth != nil {
return json.Marshal(v.Oauth)
}
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 *IdentityProvider) 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 "oauth":
return json.Unmarshal(data, &v.Oauth)
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{"oauth", "username"})
}
type ImportChangesets struct {
// ExternalIDs description: The changesets to import from the code host. For GitHub this is the PR number, for GitLab this is the MR number, for Bitbucket Server this is the PR number.
ExternalIDs []any `json:"externalIDs"`
// Repository description: The repository name as configured on your Sourcegraph instance.
Repository string `json:"repository"`
}
// IntentDetectionAPI description: Configuration for intent detection API
type IntentDetectionAPI struct {
// Default description: Default URL for intent detection API
Default *BackendAPIConfig `json:"default,omitempty"`
// Edit description: Default URL for intent detection API
Edit *BackendAPIConfig `json:"edit,omitempty"`
// Extra description: Array of additional intent detection API configs
Extra []*BackendAPIConfig `json:"extra,omitempty"`
// Search description: Default URL for intent detection API
Search *BackendAPIConfig `json:"search,omitempty"`
}
// JVMPackagesConnection description: Configuration for a connection to a JVM packages repository.
type JVMPackagesConnection struct {
// Maven description: Configuration for resolving from Maven repositories.
Maven Maven `json:"maven"`
}
// LanguageDetection description: Setting for customizing language detection behavior
type LanguageDetection struct {
// GraphQL description: What to take into account for computing 'languages' for the GraphQL API. This setting indirectly affects client-side code attempting to determine languages, such as search-based code navigation and the files sidebar.
GraphQL string `json:"graphQL"`
}
// LinkStep description: Link step
type LinkStep struct {
Type any `json:"type"`
Value string `json:"value"`
Variant any `json:"variant,omitempty"`
}
// Log description: Configuration for logging and alerting, including to external services.
type Log struct {
// AuditLog description: EXPERIMENTAL: Configuration for audit logging (specially formatted log entries for tracking sensitive events)
AuditLog *AuditLog `json:"auditLog,omitempty"`
// SecurityEventLog description: EXPERIMENTAL: Configuration for security event logging
SecurityEventLog *SecurityEventLog `json:"securityEventLog,omitempty"`
// Sentry description: Configuration for Sentry
Sentry *Sentry `json:"sentry,omitempty"`
}
// Maven description: Configuration for resolving from Maven repositories.
type Maven struct {
// Credentials description: Contents of a coursier.credentials file needed for accessing the Maven repositories. See the 'Inline' section at https://get-coursier.io/docs/other-credentials#inline for more details.
Credentials string `json:"credentials,omitempty"`
// Dependencies description: An array of artifact "groupID:artifactID:version" strings specifying which Maven artifacts to mirror on Sourcegraph.
Dependencies []string `json:"dependencies,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to the Maven repository.
RateLimit *MavenRateLimit `json:"rateLimit,omitempty"`
// Repositories description: The url at which the maven repository can be found.
Repositories []string `json:"repositories,omitempty"`
}
// MavenRateLimit description: Rate limit applied when making background API requests to the Maven repository.
type MavenRateLimit 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"`
}
// ModelFilters description: Filters that allow you to constrain which models are available to users.
type ModelFilters struct {
// Allow description: Constrain models to only those in this allow list. Wildcards may be used here, but not regexp.
Allow []string `json:"allow,omitempty"`
// Deny description: Any models in this deny list will not be allowed. Wildcards may be used here, but not regexp.
Deny []string `json:"deny,omitempty"`
// StatusFilter description: Constrain models to just those matching one of the supplied statuses
StatusFilter []string `json:"statusFilter,omitempty"`
}
type ModelOverride 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"`
// DisplayName description: display name
DisplayName string `json:"displayName"`
// ModelName description: model name used when sending requests to the LLM provider's backend API.
ModelName string `json:"modelName"`
// ModelRef description: The qualified name of the model in '${ProviderID}::${APIVersionID}::${ModelID}' format
ModelRef string `json:"modelRef"`
ServerSideConfig *ServerSideModelConfig `json:"serverSideConfig,omitempty"`
Status string `json:"status"`
}
type Mount struct {
// Mountpoint description: The path in the container to mount the path on the local machine to.
Mountpoint string `json:"mountpoint"`
// Path description: The path on the local machine to mount. The path must be in the same directory or a subdirectory of the batch spec.
Path string `json:"path"`
}
// MountedEncryptionKey description: This encryption key is mounted from a given file path or an environment variable.
type MountedEncryptionKey struct {
EnvVarName string `json:"envVarName,omitempty"`
Filepath string `json:"filepath,omitempty"`
Keyname string `json:"keyname"`
Type string `json:"type"`
Version string `json:"version,omitempty"`
}
// NoOpEncryptionKey description: This encryption key is a no op, leaving your data in plaintext (not recommended).
type NoOpEncryptionKey struct {
Type string `json:"type"`
}
type Notice struct {
// Dismissible description: Whether this notice can be dismissed (closed) by the user.
Dismissible bool `json:"dismissible,omitempty"`
// Location description: The location where this notice is shown: "top" for the top of every page, "home" for the homepage.
Location string `json:"location"`
// Message description: The message to display. Markdown formatting is supported.
Message string `json:"message"`
// StyleOverrides description: Overrides for the notice's default style. You probably want to use notice 'variant' setting instead.
StyleOverrides *StyleOverrides `json:"styleOverrides,omitempty"`
Variant string `json:"variant,omitempty"`
}
type Notifications 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"`
}
type Notifier struct {
Slack *NotifierSlack
Pagerduty *NotifierPagerduty
Webhook *NotifierWebhook
Email *NotifierEmail
Opsgenie *NotifierOpsGenie
}
func (v Notifier) MarshalJSON() ([]byte, error) {
if v.Slack != nil {
return json.Marshal(v.Slack)
}
if v.Pagerduty != nil {
return json.Marshal(v.Pagerduty)
}
if v.Webhook != nil {
return json.Marshal(v.Webhook)
}
if v.Email != nil {
return json.Marshal(v.Email)
}
if v.Opsgenie != nil {
return json.Marshal(v.Opsgenie)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *Notifier) 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 "email":
return json.Unmarshal(data, &v.Email)
case "opsgenie":
return json.Unmarshal(data, &v.Opsgenie)
case "pagerduty":
return json.Unmarshal(data, &v.Pagerduty)
case "slack":
return json.Unmarshal(data, &v.Slack)
case "webhook":
return json.Unmarshal(data, &v.Webhook)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"slack", "pagerduty", "webhook", "email", "opsgenie"})
}
// NotifierEmail description: Email notifier
type NotifierEmail struct {
// Address description: Address to send email to
Address string `json:"address"`
Type string `json:"type"`
}
// NotifierOpsGenie description: OpsGenie notifier
type NotifierOpsGenie struct {
ApiKey string `json:"apiKey,omitempty"`
ApiUrl string `json:"apiUrl,omitempty"`
// Priority description: Defines the importance of an alert. Allowed values are P1, P2, P3, P4, P5 - or a Go template that resolves to one of those values. By default, Sourcegraph will fill this in for you if a value isn't specified here.
Priority string `json:"priority,omitempty"`
// Responders description: List of responders responsible for notifications.
Responders []*Responders `json:"responders,omitempty"`
// Tags description: Comma separated list of tags attached to the notifications - or a Go template that produces such a list. Sourcegraph provides some default ones if this value isn't specified.
Tags string `json:"tags,omitempty"`
Type string `json:"type"`
}
// NotifierPagerduty description: PagerDuty notifier
type NotifierPagerduty struct {
ApiUrl string `json:"apiUrl,omitempty"`
// IntegrationKey description: Integration key for the PagerDuty Events API v2 - see https://developer.pagerduty.com/docs/events-api-v2/overview
IntegrationKey string `json:"integrationKey"`
// Severity description: Severity level for PagerDuty alert
Severity string `json:"severity,omitempty"`
Type string `json:"type"`
}
// NotifierSlack description: Slack notifier
type NotifierSlack struct {
// Icon_emoji description: Provide an emoji to use as the icon for the bots message. Ex :smile:
Icon_emoji string `json:"icon_emoji,omitempty"`
// Icon_url description: Provide a URL to an image to use as the icon for the bots message.
Icon_url string `json:"icon_url,omitempty"`
// Recipient description: Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@<user>, all lowercase, no whitespace), or a channel reference (#<channel>, all lowercase, no whitespace).
Recipient string `json:"recipient,omitempty"`
Type string `json:"type"`
// Url description: Slack incoming webhook URL.
Url string `json:"url,omitempty"`
// Username description: Set the username for the bots message.
Username string `json:"username,omitempty"`
}
// NotifierWebhook description: Webhook notifier
type NotifierWebhook struct {
BearerToken string `json:"bearerToken,omitempty"`
Password string `json:"password,omitempty"`
Type string `json:"type"`
Url string `json:"url"`
Username string `json:"username,omitempty"`
}
// NpmPackagesConnection description: Configuration for a connection to an npm packages repository.
type NpmPackagesConnection struct {
// Credentials description: Access token for logging into the npm registry.
Credentials string `json:"credentials,omitempty"`
// Dependencies description: An array of "(@scope/)?packageName@version" strings specifying which npm packages to mirror on Sourcegraph.
Dependencies []string `json:"dependencies,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to the npm registry.
RateLimit *NpmRateLimit `json:"rateLimit,omitempty"`
// Registry description: The URL at which the npm registry can be found.
Registry string `json:"registry"`
}
// NpmRateLimit description: Rate limit applied when making background API requests to the npm registry.
type NpmRateLimit 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 OAuthIdentity struct {
Type string `json:"type"`
}
type ObservabilityAlerts struct {
// DisableSendResolved description: Disable notifications when alerts resolve themselves.
DisableSendResolved bool `json:"disableSendResolved,omitempty"`
// Level description: Sourcegraph alert level to subscribe to notifications for.
Level string `json:"level"`
Notifier Notifier `json:"notifier"`
// Owners description: Do not use. When set, only receive alerts owned by the specified teams. Used by Sourcegraph internally.
Owners []string `json:"owners,omitempty"`
}
// ObservabilityClient description: EXPERIMENTAL: Configuration for client observability
type ObservabilityClient struct {
// OpenTelemetry description: Configuration for the client OpenTelemetry exporter
OpenTelemetry *OpenTelemetry `json:"openTelemetry,omitempty"`
}
// ObservabilityTracing description: Configures distributed tracing within Sourcegraph. To learn more, refer to https://sourcegraph.com/docs/admin/observability/tracing
type ObservabilityTracing struct {
// Debug description: Turns on debug logging of tracing client requests. This can be useful for debugging connectivity issues between the tracing client and tracing backend, the performance overhead of tracing, and other issues related to the use of distributed tracing. May have performance implications in production.
Debug bool `json:"debug,omitempty"`
// Sampling description: Determines the conditions under which distributed traces are recorded. "none" turns off tracing entirely. "selective" (default) sends traces whenever `?trace=1` is present in the URL (though background jobs may still emit traces). "all" sends traces on every request. Note that this only affects the behavior of the distributed tracing client. To learn more about additional sampling and traace export configuration with the default tracing type "opentelemetry", refer to https://sourcegraph.com/docs/admin/observability/opentelemetry#tracing
Sampling string `json:"sampling,omitempty"`
// Type description: Determines what tracing provider to enable. For "opentelemetry", the required backend is an OpenTelemetry collector instance (deployed by default with Sourcegraph). For "jaeger", a Jaeger instance is required to be configured via Jaeger client environment variables: https://github.com/jaegertracing/jaeger-client-go#environment-variables
Type string `json:"type,omitempty"`
// UrlTemplate description: Template for linking to trace URLs - '{{ .TraceID }}' is replaced with the trace ID, and {{ .ExternalURL }} is replaced with the value of 'externalURL'. If none is set, no links are generated.
UrlTemplate string `json:"urlTemplate,omitempty"`
}
// OnQuery description: A Sourcegraph search query that matches a set of repositories (and branches). Each matched repository branch is added to the list of repositories that the batch change will be run on.
type OnQuery struct {
// RepositoriesMatchingQuery description: A Sourcegraph search query that matches a set of repositories (and branches). If the query matches files, symbols, or some other object inside a repository, the object's repository is included.
RepositoriesMatchingQuery string `json:"repositoriesMatchingQuery"`
}
// OnRepository description: A specific repository (and branch) that is added to the list of repositories that the batch change will be run on.
type OnRepository struct {
// Branch description: The repository branch to propose changes to. If unset, the repository's default branch is used. If this field is defined, branches cannot be.
Branch string `json:"branch,omitempty"`
// Branches description: The repository branches to propose changes to. If unset, the repository's default branch is used. If this field is defined, branch cannot be.
Branches []string `json:"branches,omitempty"`
// Repository description: The name of the repository (as it is known to Sourcegraph).
Repository string `json:"repository"`
}
type OnboardingStep struct {
Action any `json:"action"`
CompleteAfterEvents []string `json:"completeAfterEvents,omitempty"`
// Id description: Unique step ID
Id string `json:"id"`
Info string `json:"info,omitempty"`
// Label description: Label of the step shown to the user
Label string `json:"label"`
// Tooltip description: More information about this step
Tooltip string `json:"tooltip,omitempty"`
}
// OnboardingTask description: An onboarding task
type OnboardingTask struct {
Icon any `json:"icon,omitempty"`
// RequiredSteps description: Set this property if only a subset of steps are required for this task to complete.
RequiredSteps float64 `json:"requiredSteps,omitempty"`
// Steps description: Steps that need to be completed by the user
Steps []*OnboardingStep `json:"steps"`
// Title description: Title of this task
Title string `json:"title,omitempty"`
}
// OnboardingTourConfiguration description: Configuration for a onboarding tour.
type OnboardingTourConfiguration struct {
DefaultSnippets map[string]any `json:"defaultSnippets,omitempty"`
Tasks []*OnboardingTask `json:"tasks"`
}
type OpenAICompatibleEndpoint struct {
AccessToken string `json:"accessToken,omitempty"`
Url string `json:"url"`
}
type OpenCodeGraphAnnotation struct {
Item OpenCodeGraphItemRef `json:"item"`
Range OpenCodeGraphRange `json:"range"`
}
// OpenCodeGraphData description: Metadata about code
type OpenCodeGraphData struct {
Annotations []*OpenCodeGraphAnnotation `json:"annotations"`
Items []*OpenCodeGraphItem `json:"items"`
}
type OpenCodeGraphImage struct {
Alt string `json:"alt,omitempty"`
Height float64 `json:"height,omitempty"`
Url string `json:"url"`
Width float64 `json:"width,omitempty"`
}
type OpenCodeGraphItem struct {
Detail string `json:"detail,omitempty"`
Id string `json:"id"`
Image *OpenCodeGraphImage `json:"image,omitempty"`
// Preview description: Show a preview of the link.
Preview bool `json:"preview,omitempty"`
// PreviewUrl description: If `preview` is set, show this URL as the preview instead of `url`.
PreviewUrl string `json:"previewUrl,omitempty"`
Title string `json:"title"`
// Url description: An external URL with more information.
Url string `json:"url,omitempty"`
}
type OpenCodeGraphItemRef struct {
Id string `json:"id"`
}
type OpenCodeGraphPosition struct {
Character int `json:"character"`
Line int `json:"line"`
}
type OpenCodeGraphRange struct {
End OpenCodeGraphPosition `json:"end"`
Start OpenCodeGraphPosition `json:"start"`
}
// OpenIDConnectAuthProvider description: Configures the OpenID Connect authentication provider for SSO.
type OpenIDConnectAuthProvider struct {
// AllowSignup description: Allows new visitors to sign up for accounts via OpenID Connect authentication. If false, users signing in via OpenID Connect must have an existing Sourcegraph account, which will be linked to their OpenID Connect identity after sign-in.
AllowSignup *bool `json:"allowSignup,omitempty"`
// ClientID description: The client ID for the OpenID Connect client for this site.
//
// For Google Apps: obtain this value from the API console (https://console.developers.google.com), as described at https://developers.google.com/identity/protocols/OpenIDConnect#getcredentials
ClientID string `json:"clientID"`
// ClientSecret description: The client secret for the OpenID Connect client for this site.
//
// For Google Apps: obtain this value from the API console (https://console.developers.google.com), as described at https://developers.google.com/identity/protocols/OpenIDConnect#getcredentials
ClientSecret string `json:"clientSecret"`
// ConfigID description: An identifier that can be used to reference this authentication provider in other parts of the config. For example, in configuration for a code host, you may want to designate this authentication provider as the identity provider for the code host.
ConfigID string `json:"configID,omitempty"`
DisplayName string `json:"displayName,omitempty"`
DisplayPrefix *string `json:"displayPrefix,omitempty"`
Hidden bool `json:"hidden,omitempty"`
// Issuer description: The URL of the OpenID Connect issuer.
//
// For Google Apps: https://accounts.google.com
Issuer string `json:"issuer"`
NoSignIn bool `json:"noSignIn,omitempty"`
Order int `json:"order,omitempty"`
// RequireEmailDomain description: Only allow users to authenticate if their email domain is equal to this value (example: mycompany.com). Do not include a leading "@". If not set, all users on this OpenID Connect provider can authenticate to Sourcegraph.
RequireEmailDomain string `json:"requireEmailDomain,omitempty"`
// SingleIdentityPerUser description: When true, any user can connect exactly one identity from the identity provider.
SingleIdentityPerUser bool `json:"singleIdentityPerUser,omitempty"`
Type string `json:"type"`
}
// OpenTelemetry description: Configuration for the client OpenTelemetry exporter
type OpenTelemetry struct {
// Endpoint description: OpenTelemetry tracing collector endpoint. By default, Sourcegraph's "/-/debug/otlp" endpoint forwards data to the configured collector backend.
Endpoint string `json:"endpoint,omitempty"`
}
// OrganizationInvitations description: Configuration for organization invitations.
type OrganizationInvitations struct {
// ExpiryTime description: Time before the invitation expires, in hours (experimental, not enforced at the moment).
ExpiryTime int `json:"expiryTime,omitempty"`
// SigningKey description: Base64 encoded HMAC Signing key to sign a JWT token, which is attached to each invitation URL.
// More documentation here: https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodHMAC
//
// If not provided, will fall back to legacy invitation to an organization.
//
// The legacy invitation will be deprecated in the future and creating an organization invitation will fail with an error if this setting is not present.
SigningKey string `json:"signingKey"`
}
// OtherExternalServiceConnection description: Configuration for a Connection to Git repositories for which an external service integration isn't yet available.
type OtherExternalServiceConnection struct {
// Exclude description: A list of repositories to never mirror by name after applying repositoryPathPattern. Supports excluding by exact name ({"name": "myrepo"}) or regular expression ({"pattern": ".*secret.*"}).
Exclude []*ExcludedOtherRepo `json:"exclude,omitempty"`
// MakeReposPublicOnDotCom description: Whether or not these repositories should be marked as public on Sourcegraph.com. Defaults to false.
MakeReposPublicOnDotCom bool `json:"makeReposPublicOnDotCom,omitempty"`
Repos []string `json:"repos"`
// RepositoryPathPattern description: The pattern used to generate the corresponding Sourcegraph repository name for the repositories. In the pattern, the variable "{base}" is replaced with the Git clone base URL host and path, and "{repo}" is replaced with the repository path taken from the `repos` field.
//
// For example, if your Git clone base URL is https://git.example.com/repos and `repos` contains the value "my/repo", then a repositoryPathPattern of "{base}/{repo}" would mean that a repository at https://git.example.com/repos/my/repo is available on Sourcegraph at https://sourcegraph.example.com/git.example.com/repos/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.
//
// Note: These patterns are ignored if using src-expose / src-serve.
RepositoryPathPattern string `json:"repositoryPathPattern,omitempty"`
Url string `json:"url,omitempty"`
}
type OutputVariable struct {
// Format description: The expected format of the output. If set, the output is being parsed in that format before being stored in the var. If not set, 'text' is assumed to the format.
Format string `json:"format,omitempty"`
// Value description: The value of the output, which can be a template string.
Value string `json:"value"`
}
// PagureConnection description: Configuration for a connection to Pagure.
type PagureConnection struct {
// Forks description: If true, it includes forks in the returned projects.
Forks bool `json:"forks,omitempty"`
// Namespace description: Filters projects by namespace.
Namespace string `json:"namespace,omitempty"`
// Pattern description: Filters projects by pattern string.
Pattern string `json:"pattern,omitempty"`
// RateLimit description: Rate limit applied when making API requests to Pagure.
RateLimit *PagureRateLimit `json:"rateLimit,omitempty"`
// Tags description: Filters the projects returned by their tags.
Tags []string `json:"tags,omitempty"`
// Token description: API token for the Pagure instance.
Token string `json:"token,omitempty"`
// Url description: URL of a Pagure instance, such as https://pagure.example.com
Url string `json:"url,omitempty"`
}
// PagureRateLimit description: Rate limit applied when making API requests to Pagure.
type PagureRateLimit 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"`
}
// ParentSourcegraph description: URL to fetch unreachable repository details from. Defaults to "https://sourcegraph.com"
type ParentSourcegraph struct {
Url string `json:"url,omitempty"`
}
// PasswordPolicy description: DEPRECATED: this is now a standard feature see: auth.passwordPolicy
type PasswordPolicy struct {
// Enabled description: Enables password policy
Enabled bool `json:"enabled,omitempty"`
// MinimumLength description: DEPRECATED: replaced by auth.minPasswordLength
MinimumLength int `json:"minimumLength,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"`
}
// PerforceAuthorization description: If non-null, enforces Perforce depot permissions.
type PerforceAuthorization struct {
// IgnoreRulesWithHost description: Ignore host-based protection rules (any rule with something other than a wildcard in the Host field).
IgnoreRulesWithHost bool `json:"ignoreRulesWithHost,omitempty"`
// SubRepoPermissions description: Experimental: infer sub-repository permissions from protection rules.
SubRepoPermissions bool `json:"subRepoPermissions,omitempty"`
}
// PerforceConnection description: Configuration for a connection to Perforce Server.
type PerforceConnection struct {
// Authorization description: If non-null, enforces Perforce depot permissions.
Authorization *PerforceAuthorization `json:"authorization,omitempty"`
// Depots description: Depots can have arbitrary paths, e.g. a path to depot root or a subdirectory.
Depots []string `json:"depots,omitempty"`
// FusionClient description: Configuration for the experimental p4-fusion client
FusionClient *FusionClient `json:"fusionClient,omitempty"`
// MaxChanges description: Only import at most n changes when possible (git p4 clone --max-changes).
MaxChanges float64 `json:"maxChanges,omitempty"`
// P4Client description: Client specified as an option for p4 CLI (P4CLIENT, also enables '--use-client-spec')
P4Client string `json:"p4.client,omitempty"`
// P4Passwd description: The ticket value for the user (P4PASSWD). You can get this by running `p4 login -p` or `p4 login -pa`. It should look like `6211C5E719EDE6925855039E8F5CC3D2`.
P4Passwd string `json:"p4.passwd"`
// P4Port description: The Perforce Server address to be used for p4 CLI (P4PORT).
P4Port string `json:"p4.port"`
// P4User description: The user to be authenticated for p4 CLI (P4USER).
P4User string `json:"p4.user"`
// RepositoryPathPattern description: The pattern used to generate the corresponding Sourcegraph repository name for a Perforce depot. In the pattern, the variable "{depot}" is replaced with the Perforce depot's path.
//
// For example, if your Perforce depot path is "//Sourcegraph/" and your Sourcegraph URL is https://src.example.com, then a repositoryPathPattern of "perforce/{depot}" would mean that the Perforce depot is available on Sourcegraph at https://src.example.com/perforce/Sourcegraph.
//
// It is important that the Sourcegraph repository name generated with this pattern be unique to this Perforce Server. If different Perforce Servers generate repository names that collide, Sourcegraph's behavior is undefined.
RepositoryPathPattern string `json:"repositoryPathPattern,omitempty"`
}
// PermissionsUserMapping description: Settings for Sourcegraph explicit permissions, which allow the site admin to explicitly manage repository permissions via the GraphQL API. This will mark repositories as restricted by default.
type PermissionsUserMapping struct {
// BindID description: The type of identifier to identify a user. The default is "email", which uses the email address to identify a user. Use "username" to identify a user by their username. Changing this setting will erase any permissions created for users that do not yet exist.
BindID string `json:"bindID,omitempty"`
// Enabled description: Whether permissions user mapping is enabled.
Enabled bool `json:"enabled,omitempty"`
}
// Phabricator description: This is DEPRECATED
type Phabricator struct {
// CallsignCommand description: Bash command that prints out the Phabricator callsign for a Gitolite repository. This will be run with environment variable $REPO set to the name of the repository and used to obtain the Phabricator metadata for a Gitolite repository. (Note: this requires `bash` to be installed.)
CallsignCommand string `json:"callsignCommand"`
// Url description: URL of the Phabricator instance that integrates with this Gitolite instance. This should be set
Url string `json:"url"`
}
// PhabricatorConnection description: Configuration for a connection to Phabricator.
type PhabricatorConnection struct {
// Repos description: The list of repositories available on Phabricator.
Repos []*Repos `json:"repos,omitempty"`
// Token description: API token for the Phabricator instance.
Token string `json:"token,omitempty"`
// Url description: URL of a Phabricator instance, such as https://phabricator.example.com
Url string `json:"url,omitempty"`
}
type ProviderOverride struct {
ClientSideConfig *ClientSideProviderConfig `json:"clientSideConfig,omitempty"`
DefaultModelConfig *DefaultModelConfig `json:"defaultModelConfig,omitempty"`
// DisplayName description: display name
DisplayName string `json:"displayName"`
// Id description: provider ID
Id string `json:"id"`
ServerSideConfig *ServerSideProviderConfig `json:"serverSideConfig,omitempty"`
}
// PythonPackagesConnection description: Configuration for a connection to Python simple repository APIs compatible with PEP 503
type PythonPackagesConnection struct {
// Dependencies description: An array of strings specifying Python packages to mirror in Sourcegraph.
Dependencies []string `json:"dependencies,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to the configured Python simple repository APIs.
RateLimit *PythonRateLimit `json:"rateLimit,omitempty"`
// Urls description: The list of Python simple repository URLs to fetch packages from. 404 Not found or 410 Gone responses will result in the next URL to be attempted.
Urls []string `json:"urls"`
}
// PythonRateLimit description: Rate limit applied when making background API requests to the configured Python simple repository APIs.
type PythonRateLimit 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 QuickLink struct {
// Description description: A description for this quick link
Description string `json:"description,omitempty"`
// Name description: The human-readable name for this quick link
Name string `json:"name"`
// Url description: The URL of this quick link (absolute or relative)
Url string `json:"url"`
}
// Ranking description: Experimental search result ranking options.
type Ranking struct {
// DocumentRanksWeight description: Controls the impact of document ranks on the final ranking. This is intended for internal testing purposes only, it's not recommended for users to change this.
DocumentRanksWeight *float64 `json:"documentRanksWeight,omitempty"`
// FlushWallTimeMS description: Controls the amount of time that Zoekt shards collect and rank results. Larger values give a more stable ranking, but searches can take longer to return an initial result.
FlushWallTimeMS int `json:"flushWallTimeMS,omitempty"`
// MaxQueueMatchCount description: DEPRECATED: This setting has no effect.
MaxQueueMatchCount *int `json:"maxQueueMatchCount,omitempty"`
// MaxQueueSizeBytes description: The maximum number of bytes that can be buffered to sort results. The default is -1 (unbounded). Setting this to a positive integer protects frontend against OOMs.
MaxQueueSizeBytes *int `json:"maxQueueSizeBytes,omitempty"`
// MaxReorderDurationMS description: DEPRECATED: This setting has no effect.
MaxReorderDurationMS int `json:"maxReorderDurationMS,omitempty"`
// MaxReorderQueueSize description: DEPRECATED: This setting has no effect.
MaxReorderQueueSize *int `json:"maxReorderQueueSize,omitempty"`
// RepoScores description: a map of URI directories to numeric scores for specifying search result importance, like {"github.com": 500, "github.com/sourcegraph": 300, "github.com/sourcegraph/sourcegraph": 100}. Would rank "github.com/sourcegraph/sourcegraph" as 500+300+100=900, and "github.com/other/foo" as 500.
RepoScores map[string]float64 `json:"repoScores,omitempty"`
}
type RateLimits struct {
// GraphQLMaxAliases description: Maximum number of aliases allowed in a GraphQL query
GraphQLMaxAliases int `json:"graphQLMaxAliases,omitempty"`
// GraphQLMaxDepth description: Maximum depth of nested objects allowed for GraphQL queries. Changes to this setting require a restart.
GraphQLMaxDepth int `json:"graphQLMaxDepth,omitempty"`
// GraphQLMaxDuplicateFieldCount description: Maximum number of duplicate fields allowed in a GraphQL request
GraphQLMaxDuplicateFieldCount int `json:"graphQLMaxDuplicateFieldCount,omitempty"`
// GraphQLMaxFieldCount description: Maximum number of estimated fields allowed in a GraphQL response
GraphQLMaxFieldCount int `json:"graphQLMaxFieldCount,omitempty"`
// GraphQLMaxUniqueFieldCount description: Maximum number of unique fields allowed in a GraphQL request
GraphQLMaxUniqueFieldCount int `json:"graphQLMaxUniqueFieldCount,omitempty"`
}
// RepoPurgeWorker description: Configuration for repository purge worker.
type RepoPurgeWorker struct {
// DeletedTTLMinutes description: Repository TTL in minutes after deletion before it becomes eligible to be purged. A migration or admin could accidentally remove all or a significant number of repositories - recloning all of them is slow, so a TTL acts as a grace period so that admins can recover from accidental deletions
DeletedTTLMinutes int `json:"deletedTTLMinutes,omitempty"`
// IntervalMinutes description: Interval in minutes at which to run purge jobs. Set to 0 to disable.
IntervalMinutes int `json:"intervalMinutes,omitempty"`
}
type Repos struct {
// Callsign description: The unique Phabricator identifier for the repository, like 'MUX'.
Callsign string `json:"callsign"`
// Path description: Display path for the url e.g. gitolite/my/repo
Path string `json:"path"`
}
// Repository description: The repository to get the latest version of.
type Repository struct {
// Name description: The repository name.
Name string `json:"name,omitempty"`
// Owner description: The repository namespace.
Owner string `json:"owner,omitempty"`
}
type RequestMessage struct {
Method string `json:"method"`
Params any `json:"params,omitempty"`
Settings map[string]any `json:"settings,omitempty"`
}
// Reranker description: Reranker to use for rankContext requests
type Reranker struct {
Identity *CodyRerankerIdentity
Cohere *CodyRerankerCohere
}
func (v Reranker) MarshalJSON() ([]byte, error) {
if v.Identity != nil {
return json.Marshal(v.Identity)
}
if v.Cohere != nil {
return json.Marshal(v.Cohere)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *Reranker) 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 "cohere":
return json.Unmarshal(data, &v.Cohere)
case "identity":
return json.Unmarshal(data, &v.Identity)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"identity", "cohere"})
}
type Responders struct {
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Username string `json:"username,omitempty"`
}
type ResponseError struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
type ResponseMessage struct {
Error *ResponseError `json:"error,omitempty"`
Result any `json:"result,omitempty"`
}
// RestartStep description: Restart step
type RestartStep struct {
Type any `json:"type"`
Value string `json:"value"`
}
// RubyPackagesConnection description: Configuration for a connection to Ruby packages
type RubyPackagesConnection struct {
// Dependencies description: An array of strings specifying Ruby packages to mirror in Sourcegraph.
Dependencies []string `json:"dependencies,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to the configured Ruby repository APIs.
RateLimit *RubyRateLimit `json:"rateLimit,omitempty"`
// Repository description: The URL at which the maven repository can be found.
Repository string `json:"repository,omitempty"`
}
// RubyRateLimit description: Rate limit applied when making background API requests to the configured Ruby repository APIs.
type RubyRateLimit 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"`
}
// RustPackagesConnection description: Configuration for a connection to Rust packages
type RustPackagesConnection struct {
// Dependencies description: An array of strings specifying Rust packages to mirror in Sourcegraph.
Dependencies []string `json:"dependencies,omitempty"`
// RateLimit description: Rate limit applied when making background API requests to the configured Rust repository APIs.
RateLimit *RustRateLimit `json:"rateLimit,omitempty"`
}
// RustRateLimit description: Rate limit applied when making background API requests to the configured Rust repository APIs.
type RustRateLimit 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"`
}
// SAMLAuthProvider description: Configures the SAML authentication provider for SSO.
//
// Note: if you are using IdP-initiated login, you must have *at most one* SAMLAuthProvider in the `auth.providers` array.
type SAMLAuthProvider struct {
// AllowGroups description: Restrict login to members of these groups
AllowGroups []string `json:"allowGroups,omitempty"`
// AllowSignup description: Allows new visitors to sign up for accounts via SAML authentication. If false, users signing in via SAML must have an existing Sourcegraph account, which will be linked to their SAML identity after sign-in.
AllowSignup *bool `json:"allowSignup,omitempty"`
// ConfigID description: An identifier that can be used to reference this authentication provider in other parts of the config. For example, in configuration for a code host, you may want to designate this authentication provider as the identity provider for the code host.
ConfigID string `json:"configID,omitempty"`
DisplayName string `json:"displayName,omitempty"`
DisplayPrefix *string `json:"displayPrefix,omitempty"`
// GroupsAttributeName description: Name of the SAML assertion attribute that holds group membership for allowGroups setting
GroupsAttributeName string `json:"groupsAttributeName,omitempty"`
Hidden bool `json:"hidden,omitempty"`
// IdentityProviderMetadata description: The SAML Identity Provider metadata XML contents (for static configuration of the SAML Service Provider). The value of this field should be an XML document whose root element is `<EntityDescriptor>` or `<EntityDescriptors>`. To escape the value into a JSON string, you may want to use a tool like https://json-escape-text.now.sh.
IdentityProviderMetadata string `json:"identityProviderMetadata,omitempty"`
// IdentityProviderMetadataURL description: The SAML Identity Provider metadata URL (for dynamic configuration of the SAML Service Provider).
IdentityProviderMetadataURL string `json:"identityProviderMetadataURL,omitempty"`
// InsecureSkipAssertionSignatureValidation description: Whether the Service Provider should (insecurely) accept assertions from the Identity Provider without a valid signature.
InsecureSkipAssertionSignatureValidation bool `json:"insecureSkipAssertionSignatureValidation,omitempty"`
// NameIDFormat description: The SAML NameID format to use when performing user authentication.
NameIDFormat string `json:"nameIDFormat,omitempty"`
NoSignIn bool `json:"noSignIn,omitempty"`
Order int `json:"order,omitempty"`
// ServiceProviderCertificate description: The SAML Service Provider certificate in X.509 encoding (begins with "-----BEGIN CERTIFICATE-----"). This certificate is used by the Identity Provider to validate the Service Provider's AuthnRequests and LogoutRequests. It corresponds to the Service Provider's private key (`serviceProviderPrivateKey`). To escape the value into a JSON string, you may want to use a tool like https://json-escape-text.now.sh.
ServiceProviderCertificate string `json:"serviceProviderCertificate,omitempty"`
// ServiceProviderIssuer description: The SAML Service Provider name, used to identify this Service Provider. This is required if the "externalURL" field is not set (as the SAML metadata endpoint is computed as "<externalURL>.auth/saml/metadata"), or when using multiple SAML authentication providers.
ServiceProviderIssuer string `json:"serviceProviderIssuer,omitempty"`
// ServiceProviderPrivateKey description: The SAML Service Provider private key in PKCS#8 encoding (begins with "-----BEGIN PRIVATE KEY-----"). This private key is used to sign AuthnRequests and LogoutRequests. It corresponds to the Service Provider's certificate (`serviceProviderCertificate`). To escape the value into a JSON string, you may want to use a tool like https://json-escape-text.now.sh.
ServiceProviderPrivateKey string `json:"serviceProviderPrivateKey,omitempty"`
// SignRequests description: Sign AuthnRequests and LogoutRequests sent to the Identity Provider using the Service Provider's private key (`serviceProviderPrivateKey`). It defaults to true if the `serviceProviderPrivateKey` and `serviceProviderCertificate` are set, and false otherwise.
SignRequests *bool `json:"signRequests,omitempty"`
Type string `json:"type"`
// UsernameAttributeNames description: Names of the SAML assertions attributes to check for a user's username. Checked in the order the names are provided.
UsernameAttributeNames []string `json:"usernameAttributeNames,omitempty"`
}
// SMTPServerConfig description: The SMTP server used to send transactional emails.
// Please see https://sourcegraph.com/docs/admin/config/email
type SMTPServerConfig struct {
// AdditionalHeaders description: Additional headers to include on SMTP messages that cannot be configured with other 'email.smtp' fields.
AdditionalHeaders []*Header `json:"additionalHeaders,omitempty"`
// Authentication description: The type of authentication to use for the SMTP server.
Authentication string `json:"authentication"`
// Domain description: The HELO domain to provide to the SMTP server (if needed).
Domain string `json:"domain,omitempty"`
// Host description: The SMTP server host.
Host string `json:"host"`
// NoVerifyTLS description: Disable TLS verification
NoVerifyTLS bool `json:"noVerifyTLS,omitempty"`
// Password description: The password to use when communicating with the SMTP server.
Password string `json:"password,omitempty"`
// Port description: The SMTP server port.
Port int `json:"port"`
// Username description: The username to use when communicating with the SMTP server.
Username string `json:"username,omitempty"`
}
type SearchIndexRevisionsRule struct {
// Name description: Regular expression which matches against the name of a repository (e.g. "^github\.com/owner/name$").
Name string `json:"name,omitempty"`
// Revisions description: Revisions to index
Revisions []string `json:"revisions"`
}
// SearchLimits description: Limits that search applies for number of repositories searched and timeouts.
type SearchLimits struct {
// CommitDiffMaxRepos description: The maximum number of repositories to search across when doing a "type:diff" or "type:commit". The user is prompted to narrow their query if the limit is exceeded. There is a separate limit (commitDiffWithTimeFilterMaxRepos) when "after:" or "before:" is specified because those queries are faster. Defaults to 50.
CommitDiffMaxRepos int `json:"commitDiffMaxRepos,omitempty"`
// CommitDiffWithTimeFilterMaxRepos description: The maximum number of repositories to search across when doing a "type:diff" or "type:commit" with a "after:" or "before:" filter. The user is prompted to narrow their query if the limit is exceeded. There is a separate limit (commitDiffMaxRepos) when "after:" or "before:" is not specified because those queries are slower. Defaults to 10000.
CommitDiffWithTimeFilterMaxRepos int `json:"commitDiffWithTimeFilterMaxRepos,omitempty"`
// MaxRepos description: The maximum number of repositories to search across. The user is prompted to narrow their query if exceeded. Any value less than or equal to zero means unlimited.
MaxRepos int `json:"maxRepos,omitempty"`
// MaxTimeoutSeconds description: The maximum value for "timeout:" that search will respect. "timeout:" values larger than maxTimeoutSeconds are capped at maxTimeoutSeconds. Note: You need to ensure your load balancer / reverse proxy in front of Sourcegraph won't timeout the request for larger values. Note: Too many large rearch requests may harm Soucregraph for other users. Note: Experimental search jobs do not respect this limit. Defaults to 1 minute.
MaxTimeoutSeconds int `json:"maxTimeoutSeconds,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.
type SearchSanitization struct {
// OrgName description: Optionally specify the name of an organization within this Sourcegraph instance containing users whose searches should not be sanitized. Admins: ensure that ALL members of this org are trusted users. If no org exists with the given name then there will be no effect. If no org name is specified then all non-admin users will have their searches sanitized if this feature is enabled.
OrgName string `json:"orgName,omitempty"`
// SanitizePatterns description: An array of regular expressions representing matched content that should be omitted from search result events. This does not prevent users from accessing file contents through other means if they have read access. Values added to this array must be valid Go regular expressions. Site admins will not have their search results sanitized.
SanitizePatterns []string `json:"sanitizePatterns,omitempty"`
}
type SearchScope struct {
// Name description: The human-readable name for this search scope
Name string `json:"name"`
// Value description: The query string of this search scope
Value string `json:"value"`
}
// SearchStep description: Search query step
type SearchStep struct {
// Query description: The query template to use.
Query string `json:"query"`
// Snippets description: Possible code snippets for this query. Can also be a language -> code snippets map.
Snippets any `json:"snippets,omitempty"`
Type any `json:"type"`
}
// SecurityEventLog description: EXPERIMENTAL: Configuration for security event logging
type SecurityEventLog struct {
// Location description: Where to output the security event log [none, auditlog, database, all] where auditlog is the default logging to stdout with the specified audit log format
Location string `json:"location,omitempty"`
}
// Selector description: Defines a scope in which a provider is called, as a subset of languages, repositories, and/or files.
//
// To satisfy a selector, all of the selector's conditions must be met. For example, if both `path` and `content` are specified, the file must satisfy both conditions.
type Selector struct {
// ContentContains description: A literal string that must be present in the file's content.
ContentContains string `json:"contentContains,omitempty"`
// Path description: A glob that must match the file path. If the file's location is represented as a URI, the URI's scheme is stripped before being matched against this glob.
//
// Use `**/` before the glob to match in any parent directory. Use `/**` after the glob to match any files under a directory. Leading slashes are stripped from the path before being matched against the glob.
Path string `json:"path,omitempty"`
}
type SelfHostedModel struct {
// ApiVersion description: API version
ApiVersion string `json:"apiVersion,omitempty"`
// Model description: Which default model configuration to use. Sourcegraph provides default model configuration for select models. Arbitrary models can be configured in 'modelOverrides'
Model string `json:"model,omitempty"`
Override *SelfHostedModelOverride `json:"override,omitempty"`
// Provider description: provider ID
Provider string `json:"provider"`
}
// SelfHostedModelOverride description: Properties to override in the default model configuration
type SelfHostedModelOverride struct {
ClientSideConfig *ClientSideModelConfigOpenAICompatible `json:"clientSideConfig,omitempty"`
ContextWindow *ContextWindow `json:"contextWindow,omitempty"`
// DisplayName description: Display name
DisplayName string `json:"displayName,omitempty"`
ServerSideConfig *ServerSideModelConfigOpenAICompatible `json:"serverSideConfig,omitempty"`
}
// Sentry description: Configuration for Sentry
type Sentry struct {
// BackendDSN description: Sentry Data Source Name (DSN) for backend errors. Per the Sentry docs (https://docs.sentry.io/quickstart/#about-the-dsn), it should match the following pattern: '{PROTOCOL}://{PUBLIC_KEY}@{HOST}/{PATH}{PROJECT_ID}'.
BackendDSN string `json:"backendDSN,omitempty"`
// CodeIntelDSN description: Sentry Data Source Name (DSN) for code intel errors. Per the Sentry docs (https://docs.sentry.io/quickstart/#about-the-dsn), it should match the following pattern: '{PROTOCOL}://{PUBLIC_KEY}@{HOST}/{PATH}{PROJECT_ID}'.
CodeIntelDSN string `json:"codeIntelDSN,omitempty"`
// Dsn description: Sentry Data Source Name (DSN). Per the Sentry docs (https://docs.sentry.io/quickstart/#about-the-dsn), it should match the following pattern: '{PROTOCOL}://{PUBLIC_KEY}@{HOST}/{PATH}{PROJECT_ID}'.
Dsn string `json:"dsn,omitempty"`
}
type ServerSideModelConfig struct {
AwsBedrockProvisionedThroughput *ServerSideModelConfigAwsBedrockProvisionedThroughput
Openaicompatible *ServerSideModelConfigOpenAICompatible
Unused *DoNotUsePhonyDiscriminantType
}
func (v ServerSideModelConfig) MarshalJSON() ([]byte, error) {
if v.AwsBedrockProvisionedThroughput != nil {
return json.Marshal(v.AwsBedrockProvisionedThroughput)
}
if v.Openaicompatible != nil {
return json.Marshal(v.Openaicompatible)
}
if v.Unused != nil {
return json.Marshal(v.Unused)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *ServerSideModelConfig) 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 "awsBedrockProvisionedThroughput":
return json.Unmarshal(data, &v.AwsBedrockProvisionedThroughput)
case "openaicompatible":
return json.Unmarshal(data, &v.Openaicompatible)
case "unused":
return json.Unmarshal(data, &v.Unused)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"awsBedrockProvisionedThroughput", "openaicompatible", "unused"})
}
type ServerSideModelConfigAwsBedrockProvisionedThroughput struct {
// Arn description: The 'provisioned throughput ARN' to use when sending requests to AWS Bedrock
Arn string `json:"arn"`
Type string `json:"type"`
}
// ServerSideModelConfigOpenAICompatible description: Configuration that is only respected if the model is provided by an openaicompatible provider.
type ServerSideModelConfigOpenAICompatible struct {
// ApiModel description: The literal string value of the 'model' field that will be sent to the /chat/completions API, for example. If set, Sourcegraph treats this as an opaque string and sends it directly to the API, inferring no information from it. By default, the configured model name is sent.
ApiModel string `json:"apiModel,omitempty"`
Type string `json:"type"`
}
type ServerSideProviderConfig struct {
AwsBedrock *ServerSideProviderConfigAWSBedrock
AzureOpenAI *ServerSideProviderConfigAzureOpenAI
Anthropic *ServerSideProviderConfigAnthropicProvider
Fireworks *ServerSideProviderConfigFireworksProvider
Google *ServerSideProviderConfigGoogleProvider
Openai *ServerSideProviderConfigOpenAIProvider
HuggingfaceTgi *ServerSideProviderConfigHuggingfaceTGIProvider
Openaicompatible *ServerSideProviderConfigOpenAICompatibleProvider
Sourcegraph *ServerSideProviderConfigSourcegraphProvider
Unused *DoNotUsePhonyDiscriminantType
}
func (v ServerSideProviderConfig) MarshalJSON() ([]byte, error) {
if v.AwsBedrock != nil {
return json.Marshal(v.AwsBedrock)
}
if v.AzureOpenAI != nil {
return json.Marshal(v.AzureOpenAI)
}
if v.Anthropic != nil {
return json.Marshal(v.Anthropic)
}
if v.Fireworks != nil {
return json.Marshal(v.Fireworks)
}
if v.Google != nil {
return json.Marshal(v.Google)
}
if v.Openai != nil {
return json.Marshal(v.Openai)
}
if v.HuggingfaceTgi != nil {
return json.Marshal(v.HuggingfaceTgi)
}
if v.Openaicompatible != nil {
return json.Marshal(v.Openaicompatible)
}
if v.Sourcegraph != nil {
return json.Marshal(v.Sourcegraph)
}
if v.Unused != nil {
return json.Marshal(v.Unused)
}
return nil, errors.New("tagged union type must have exactly 1 non-nil field value")
}
func (v *ServerSideProviderConfig) 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 "anthropic":
return json.Unmarshal(data, &v.Anthropic)
case "awsBedrock":
return json.Unmarshal(data, &v.AwsBedrock)
case "azureOpenAI":
return json.Unmarshal(data, &v.AzureOpenAI)
case "fireworks":
return json.Unmarshal(data, &v.Fireworks)
case "google":
return json.Unmarshal(data, &v.Google)
case "huggingface-tgi":
return json.Unmarshal(data, &v.HuggingfaceTgi)
case "openai":
return json.Unmarshal(data, &v.Openai)
case "openaicompatible":
return json.Unmarshal(data, &v.Openaicompatible)
case "sourcegraph":
return json.Unmarshal(data, &v.Sourcegraph)
case "unused":
return json.Unmarshal(data, &v.Unused)
}
return fmt.Errorf("tagged union type must have a %q property whose value is one of %s", "type", []string{"awsBedrock", "azureOpenAI", "anthropic", "fireworks", "google", "openai", "huggingface-tgi", "openaicompatible", "sourcegraph", "unused"})
}
type ServerSideProviderConfigAWSBedrock struct {
// AccessToken description: Leave empty to rely on instance role bindings or other AWS configurations in frontend service. <ACCESS_KEY_ID>:<SECRET_ACCESS_KEY> if directly configuring the credentials, or <ACCESS_KEY_ID>:<SECRET_ACCESS_KEY>:<SESSION_TOKEN> if a session token is also required.
AccessToken string `json:"accessToken"`
// Endpoint description: For Pay-as-you-go, set it to an AWS region code (e.g., us-west-2) when using a public Amazon Bedrock endpoint; For Provisioned Throughput, set it to the provisioned VPC endpoint for the bedrock-runtime API (e.g., 'https://vpce-0a10b2345cd67e89f-abc0defg.bedrock-runtime.us-west-2.vpce.amazonaws.com')
Endpoint string `json:"endpoint"`
// Region description: Region to use when configuring API clients. (Since the 'frontend' binary's container won't be able to pick this up from the host OS's environment variables.)
Region string `json:"region"`
Type string `json:"type"`
}
type ServerSideProviderConfigAnthropicProvider struct {
AccessToken string `json:"accessToken"`
Endpoint string `json:"endpoint"`
Type string `json:"type"`
}
type ServerSideProviderConfigAzureOpenAI struct {
// AccessToken description: As of 5.2.4 the access token can be left empty and it will rely on Environmental, Workload Identity or Managed Identity credentials configured for the frontend and worker services; Set it to <API_KEY> if directly configuring the credentials using the API key specified in the Azure portal
AccessToken string `json:"accessToken"`
// Endpoint description: Endpoint from the Azure OpenAI Service portal
Endpoint string `json:"endpoint"`
Type string `json:"type"`
// UseDeprecatedCompletionsAPI description: Enables the use of the older completions API for select Azure OpenAI models. This is just an escape hatch, for backwards compatibility, because not all Azure OpenAI models are available on the 'newer' completions API.
UseDeprecatedCompletionsAPI bool `json:"useDeprecatedCompletionsAPI"`
// User description: The user field passed along to OpenAI-provided models.
User string `json:"user"`
}
type ServerSideProviderConfigFireworksProvider struct {
AccessToken string `json:"accessToken"`
Endpoint string `json:"endpoint"`
Type string `json:"type"`
}
type ServerSideProviderConfigGoogleProvider struct {
AccessToken string `json:"accessToken"`
Endpoint string `json:"endpoint"`
Type string `json:"type"`
}
type ServerSideProviderConfigHuggingfaceTGIProvider struct {
// EnableVerboseLogs description: Whether to enable verbose logging of requests. When enabled, grep for 'OpenAICompatible' in the frontend container logs to see the requests Cody makes to the endpoint.
EnableVerboseLogs bool `json:"enableVerboseLogs,omitempty"`
Endpoints []*OpenAICompatibleEndpoint `json:"endpoints"`
Type string `json:"type"`
}
type ServerSideProviderConfigOpenAICompatibleProvider struct {
// EnableVerboseLogs description: Whether to enable verbose logging of requests. When enabled, grep for 'OpenAICompatible' in the frontend container logs to see the requests Cody makes to the endpoint.
EnableVerboseLogs bool `json:"enableVerboseLogs,omitempty"`
Endpoints []*OpenAICompatibleEndpoint `json:"endpoints"`
Type string `json:"type"`
}
type ServerSideProviderConfigOpenAIProvider struct {
AccessToken string `json:"accessToken"`
Endpoint string `json:"endpoint"`
Type string `json:"type"`
}
type ServerSideProviderConfigSourcegraphProvider struct {
AccessToken string `json:"accessToken"`
Endpoint string `json:"endpoint"`
Type string `json:"type"`
}
// Settings description: Configuration settings for users and organizations on Sourcegraph.
type Settings struct {
// AlertsHideObservabilitySiteAlerts description: Disables observability-related site alert banners.
AlertsHideObservabilitySiteAlerts *bool `json:"alerts.hideObservabilitySiteAlerts,omitempty"`
// AlertsShowMajorMinorUpdates description: Whether to show alerts for major and minor version updates. Alerts for patch version updates will be shown if `alerts.showPatchUpdates` is true.
AlertsShowMajorMinorUpdates bool `json:"alerts.showMajorMinorUpdates,omitempty"`
// AlertsShowPatchUpdates description: Whether to show alerts for patch version updates. Alerts for major and minor version updates will be shown if `alerts.showMajorMinorUpdatess` is true.
AlertsShowPatchUpdates bool `json:"alerts.showPatchUpdates,omitempty"`
// BasicCodeIntelGlobalSearchesEnabled description: Whether to run global searches over all repositories. On instances with many repositories, this can lead to issues such as: low quality results, slow response times, or significant load on the Sourcegraph instance. Defaults to true.
BasicCodeIntelGlobalSearchesEnabled bool `json:"basicCodeIntel.globalSearchesEnabled,omitempty"`
// BasicCodeIntelIncludeArchives description: Whether to include archived repositories in search results.
BasicCodeIntelIncludeArchives bool `json:"basicCodeIntel.includeArchives,omitempty"`
// BasicCodeIntelIncludeForks description: Whether to include forked repositories in search results.
BasicCodeIntelIncludeForks bool `json:"basicCodeIntel.includeForks,omitempty"`
// BasicCodeIntelIndexOnly description: Whether to use only indexed requests to the search API.
BasicCodeIntelIndexOnly bool `json:"basicCodeIntel.indexOnly,omitempty"`
// BasicCodeIntelUnindexedSearchTimeout description: The timeout (in milliseconds) for un-indexed search requests.
BasicCodeIntelUnindexedSearchTimeout float64 `json:"basicCodeIntel.unindexedSearchTimeout,omitempty"`
// CodeIntelDisableRangeQueries description: Whether to fetch multiple precise definitions and references on hover.
CodeIntelDisableRangeQueries bool `json:"codeIntel.disableRangeQueries,omitempty"`
// CodeIntelDisableSearchBased description: Never fall back to search-based code intelligence.
CodeIntelDisableSearchBased bool `json:"codeIntel.disableSearchBased,omitempty"`
// CodeIntelMixPreciseAndSearchBasedReferences description: Whether to supplement precise references with search-based results.
CodeIntelMixPreciseAndSearchBasedReferences bool `json:"codeIntel.mixPreciseAndSearchBasedReferences,omitempty"`
// CodeIntelTraceExtension description: Whether to enable trace logging on the extension.
CodeIntelTraceExtension bool `json:"codeIntel.traceExtension,omitempty"`
// ExperimentalFeatures description: Experimental features and settings.
ExperimentalFeatures *SettingsExperimentalFeatures `json:"experimentalFeatures,omitempty"`
// FileSidebarVisibleByDefault description: Whether the sidebar on the repo view should be open by default.
FileSidebarVisibleByDefault bool `json:"fileSidebarVisibleByDefault,omitempty"`
// HistoryDefaultPageSize description: Custom page size for the history tab. If set, the history tab will populate that number of commits the first time the history tab is opened and then double the number of commits progressively.
HistoryDefaultPageSize int `json:"history.defaultPageSize,omitempty"`
// HistoryPreferAbsoluteTimestamps description: Show absolute timestamps in the history panel and only show relative timestamps (e.g.: "5 days ago") in tooltip when hovering.
HistoryPreferAbsoluteTimestamps bool `json:"history.preferAbsoluteTimestamps,omitempty"`
// InsightsAggregationsExtendedTimeout description: The number of seconds to execute the aggregation for when running in extended timeout mode. This value should always be less than any proxy timeout if one exists. The maximum value is equal to searchLimits.maxTimeoutSeconds
InsightsAggregationsExtendedTimeout int `json:"insights.aggregations.extendedTimeout,omitempty"`
// Motd description: DEPRECATED: Use `notices` instead.
//
// An array (often with just one element) of messages to display at the top of all pages, including for unauthenticated users. Users may dismiss a message (and any message with the same string value will remain dismissed for the user).
//
// Markdown formatting is supported.
//
// Usually this setting is used in global and organization settings. If set in user settings, the message will only be displayed to that user. (This is useful for testing the correctness of the message's Markdown formatting.)
//
// MOTD stands for "message of the day" (which is the conventional Unix name for this type of message).
Motd []string `json:"motd,omitempty"`
// Notices description: Custom informational messages to display to users at specific locations in the Sourcegraph user interface.
//
// Usually this setting is used in global and organization settings. If set in user settings, the message will only be displayed to that single user.
Notices []*Notice `json:"notices,omitempty"`
// OpenInEditor description: Group of settings related to opening files in an editor.
OpenInEditor *SettingsOpenInEditor `json:"openInEditor,omitempty"`
// OrgsAllMembersBatchChangesAdmin description: If enabled, all members of the org will be treated as admins (e.g. can edit, apply, delete) for all batch changes created in that org.
OrgsAllMembersBatchChangesAdmin *bool `json:"orgs.allMembersBatchChangesAdmin,omitempty"`
// PerforceCodeHostToSwarmMap description: Key-value pairs of code host URLs to Swarm URLs. Keys should have no prefix and should not end with a slash, like "perforce.company.com:1666". Values should look like "https://swarm.company.com/", with a slash at the end.
PerforceCodeHostToSwarmMap map[string]string `json:"perforce.codeHostToSwarmMap,omitempty"`
// Quicklinks description: DEPRECATED: This setting will be removed in a future version of Sourcegraph.
Quicklinks []*QuickLink `json:"quicklinks,omitempty"`
// SearchContextLines description: The default number of lines to show as context below and above search results. Default is 1.
SearchContextLines *int `json:"search.contextLines,omitempty"`
// SearchDefaultCaseSensitive description: Whether query patterns are treated case sensitively. Patterns are case insensitive by default.
SearchDefaultCaseSensitive bool `json:"search.defaultCaseSensitive,omitempty"`
// SearchDefaultMode description: DEPRECATED: this setting is no longer read when the default 'keyword' patterntype is enabled, which always uses the 'precise' mode. Smart search will be removed in a future release.
SearchDefaultMode string `json:"search.defaultMode,omitempty"`
// SearchDefaultPatternType description: The default pattern type that search queries will be interpreted as.
SearchDefaultPatternType string `json:"search.defaultPatternType,omitempty"`
// SearchDisplayLimit description: The number of results we send down during a search. Note: this is different to the count: in the query. The search will continue once we hit displayLimit and updated filters and statistics will continue to stream down. Defaults to 1500.
SearchDisplayLimit *int `json:"search.displayLimit,omitempty"`
// SearchHideSuggestions description: Disable search suggestions below the search bar when constructing queries. Defaults to false.
SearchHideSuggestions *bool `json:"search.hideSuggestions,omitempty"`
// SearchIncludeArchived description: Whether searches should include searching archived repositories.
SearchIncludeArchived *bool `json:"search.includeArchived,omitempty"`
// SearchIncludeForks description: Whether searches should include searching forked repositories.
SearchIncludeForks *bool `json:"search.includeForks,omitempty"`
// SearchScopes description: Predefined search snippets that can be appended to any search (also known as search scopes)
SearchScopes []*SearchScope `json:"search.scopes,omitempty"`
Additional map[string]any `json:"-"` // additionalProperties not explicitly defined in the schema
}
func (v Settings) MarshalJSON() ([]byte, error) {
m := make(map[string]any, len(v.Additional))
for k, v := range v.Additional {
m[k] = v
}
type wrapper Settings
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 *Settings) UnmarshalJSON(data []byte) error {
type wrapper Settings
var s wrapper
if err := json.Unmarshal(data, &s); err != nil {
return err
}
*v = Settings(s)
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
return err
}
delete(m, "alerts.hideObservabilitySiteAlerts")
delete(m, "alerts.showMajorMinorUpdates")
delete(m, "alerts.showPatchUpdates")
delete(m, "basicCodeIntel.globalSearchesEnabled")
delete(m, "basicCodeIntel.includeArchives")
delete(m, "basicCodeIntel.includeForks")
delete(m, "basicCodeIntel.indexOnly")
delete(m, "basicCodeIntel.unindexedSearchTimeout")
delete(m, "codeIntel.disableRangeQueries")
delete(m, "codeIntel.disableSearchBased")
delete(m, "codeIntel.mixPreciseAndSearchBasedReferences")
delete(m, "codeIntel.traceExtension")
delete(m, "experimentalFeatures")
delete(m, "fileSidebarVisibleByDefault")
delete(m, "history.defaultPageSize")
delete(m, "history.preferAbsoluteTimestamps")
delete(m, "insights.aggregations.extendedTimeout")
delete(m, "motd")
delete(m, "notices")
delete(m, "openInEditor")
delete(m, "orgs.allMembersBatchChangesAdmin")
delete(m, "perforce.codeHostToSwarmMap")
delete(m, "quicklinks")
delete(m, "search.contextLines")
delete(m, "search.defaultCaseSensitive")
delete(m, "search.defaultMode")
delete(m, "search.defaultPatternType")
delete(m, "search.displayLimit")
delete(m, "search.hideSuggestions")
delete(m, "search.includeArchived")
delete(m, "search.includeForks")
delete(m, "search.scopes")
if len(m) > 0 {
v.Additional = make(map[string]any, len(m))
}
for k, vv := range m {
v.Additional[k] = vv
}
return nil
}
// SettingsExperimentalFeatures description: Experimental features and settings.
type SettingsExperimentalFeatures struct {
// BatchChangesExecution description: Enables/disables the Batch Changes server side execution feature.
BatchChangesExecution *bool `json:"batchChangesExecution,omitempty"`
// ClientSearchResultRanking description: How to rank search results in the client
ClientSearchResultRanking *string `json:"clientSearchResultRanking,omitempty"`
// CodeInsightsCompute description: Enables Compute powered Code Insights
CodeInsightsCompute *bool `json:"codeInsightsCompute,omitempty"`
// CodeInsightsRepoUI description: Specifies which (code insight repo) editor to use for repo query UI
CodeInsightsRepoUI *string `json:"codeInsightsRepoUI,omitempty"`
// CodeMonitoringWebHooks description: Shows code monitor webhook and Slack webhook actions in the UI, allowing users to configure them.
CodeMonitoringWebHooks *bool `json:"codeMonitoringWebHooks,omitempty"`
// EnableLazyBlobSyntaxHighlighting description: Fetch un-highlighted blob contents to render immediately, decorate with syntax highlighting once loaded.
EnableLazyBlobSyntaxHighlighting *bool `json:"enableLazyBlobSyntaxHighlighting,omitempty"`
// EnableLazyFileResultSyntaxHighlighting description: Fetch un-highlighted file result contents to render immediately, decorate with syntax highlighting once loaded.
EnableLazyFileResultSyntaxHighlighting *bool `json:"enableLazyFileResultSyntaxHighlighting,omitempty"`
// EnableSearchFilePrefetch description: Pre-fetch plaintext file revisions from search results on hover/focus.
EnableSearchFilePrefetch *bool `json:"enableSearchFilePrefetch,omitempty"`
// EnableSidebarFilePrefetch description: Pre-fetch plaintext file revisions from sidebar on hover/focus.
EnableSidebarFilePrefetch *bool `json:"enableSidebarFilePrefetch,omitempty"`
// FuzzyFinder description: Enables fuzzy finder with the keyboard shortcut `Cmd+K` on macOS and `Ctrl+K` on Linux/Windows.
FuzzyFinder *bool `json:"fuzzyFinder,omitempty"`
// FuzzyFinderActions description: Enables the 'Actions' tab of the fuzzy finder
FuzzyFinderActions *bool `json:"fuzzyFinderActions,omitempty"`
// FuzzyFinderAll description: Enables the 'All' tab of the fuzzy finder
FuzzyFinderAll *bool `json:"fuzzyFinderAll,omitempty"`
// FuzzyFinderCaseInsensitiveFileCountThreshold description: The maximum number of files a repo can have to use case-insensitive fuzzy finding
FuzzyFinderCaseInsensitiveFileCountThreshold *float64 `json:"fuzzyFinderCaseInsensitiveFileCountThreshold,omitempty"`
// FuzzyFinderNavbar description: Enables the 'Fuzzy finder' action in the global navigation bar
FuzzyFinderNavbar *bool `json:"fuzzyFinderNavbar,omitempty"`
// FuzzyFinderRepositories description: Enables the 'Repositories' tab of the fuzzy finder
FuzzyFinderRepositories *bool `json:"fuzzyFinderRepositories,omitempty"`
// FuzzyFinderSymbols description: Enables the 'Symbols' tab of the fuzzy finder
FuzzyFinderSymbols *bool `json:"fuzzyFinderSymbols,omitempty"`
// GoCodeCheckerTemplates description: Shows a panel with code insights templates for go code checker results.
GoCodeCheckerTemplates *bool `json:"goCodeCheckerTemplates,omitempty"`
// KeywordSearch description: DEPRECATED: this setting is no longer used. To disable keyword search, set `search.defaultPatternType: standard` instead.
KeywordSearch bool `json:"keywordSearch,omitempty"`
// NewCodyWeb description: Enables new experimental Cody Web UI
NewCodyWeb *bool `json:"newCodyWeb,omitempty"`
// NewSearchNavigationUI description: Enables new experimental search UI navigation
NewSearchNavigationUI *bool `json:"newSearchNavigationUI,omitempty"`
// NewSearchResultFiltersPanel description: Enables new experimental search results filters panel
NewSearchResultFiltersPanel *bool `json:"newSearchResultFiltersPanel,omitempty"`
// NewSearchResultsUI description: Enables new experimental search results UI, such as preview panel feature and updated search and filter layouts.
NewSearchResultsUI *bool `json:"newSearchResultsUI,omitempty"`
// ProactiveSearchResultsAggregations description: Search results aggregations are triggered automatically with a search.
ProactiveSearchResultsAggregations *bool `json:"proactiveSearchResultsAggregations,omitempty"`
// SearchContextsQuery description: DEPRECATED: This feature is now permanently enabled. Enables query based search contexts
SearchContextsQuery *bool `json:"searchContextsQuery,omitempty"`
// SearchQueryInput description: Specify which version of the search query input to use
SearchQueryInput *string `json:"searchQueryInput,omitempty"`
// SearchResultsAggregations description: Display aggregations for your search results on the search screen.
SearchResultsAggregations *bool `json:"searchResultsAggregations,omitempty"`
// ShowCodeMonitoringLogs description: Shows code monitoring logs tab.
ShowCodeMonitoringLogs *bool `json:"showCodeMonitoringLogs,omitempty"`
// SymbolKindTags description: Show the initial letter of the symbol kind instead of icons.
SymbolKindTags bool `json:"symbolKindTags,omitempty"`
Additional map[string]any `json:"-"` // additionalProperties not explicitly defined in the schema
}
func (v SettingsExperimentalFeatures) MarshalJSON() ([]byte, error) {
m := make(map[string]any, len(v.Additional))
for k, v := range v.Additional {
m[k] = v
}
type wrapper SettingsExperimentalFeatures
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 *SettingsExperimentalFeatures) UnmarshalJSON(data []byte) error {
type wrapper SettingsExperimentalFeatures
var s wrapper
if err := json.Unmarshal(data, &s); err != nil {
return err
}
*v = SettingsExperimentalFeatures(s)
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
return err
}
delete(m, "batchChangesExecution")
delete(m, "clientSearchResultRanking")
delete(m, "codeInsightsCompute")
delete(m, "codeInsightsRepoUI")
delete(m, "codeMonitoringWebHooks")
delete(m, "enableLazyBlobSyntaxHighlighting")
delete(m, "enableLazyFileResultSyntaxHighlighting")
delete(m, "enableSearchFilePrefetch")
delete(m, "enableSidebarFilePrefetch")
delete(m, "fuzzyFinder")
delete(m, "fuzzyFinderActions")
delete(m, "fuzzyFinderAll")
delete(m, "fuzzyFinderCaseInsensitiveFileCountThreshold")
delete(m, "fuzzyFinderNavbar")
delete(m, "fuzzyFinderRepositories")
delete(m, "fuzzyFinderSymbols")
delete(m, "goCodeCheckerTemplates")
delete(m, "keywordSearch")
delete(m, "newCodyWeb")
delete(m, "newSearchNavigationUI")
delete(m, "newSearchResultFiltersPanel")
delete(m, "newSearchResultsUI")
delete(m, "proactiveSearchResultsAggregations")
delete(m, "searchContextsQuery")
delete(m, "searchQueryInput")
delete(m, "searchResultsAggregations")
delete(m, "showCodeMonitoringLogs")
delete(m, "symbolKindTags")
if len(m) > 0 {
v.Additional = make(map[string]any, len(m))
}
for k, vv := range m {
v.Additional[k] = vv
}
return nil
}
// SettingsOpenInEditor description: Group of settings related to opening files in an editor.
type SettingsOpenInEditor struct {
// CustomUrlPattern description: If you add "custom" to openineditor.editorIds, this must be set. Use the placeholders "%file", "%line", and "%col" to mark where the file path, line number, and column number must be insterted. Example URL for IntelliJ IDEA: "idea://open?file=%file&line=%line&column=%col"
CustomUrlPattern string `json:"custom.urlPattern,omitempty"`
// EditorIds description: The editor to open files in. If set to this to "custom", you must also set "custom.urlPattern"
EditorIds []string `json:"editorIds,omitempty"`
// JetbrainsForceApi description: Forces using protocol handlers (like ikea://open?file=...) or the built-in REST API (http://localhost:63342/api/file...). If omitted, protocol handlers are used if available, otherwise the built-in REST API is used.
JetbrainsForceApi string `json:"jetbrains.forceApi,omitempty"`
// ProjectPathsDefault description: The absolute path on your computer where your git repositories live. All git repos to open have to be cloned under this path with their original names. "/Users/yourusername/src" is a valid absolute path, "~/src" is not. Works both with and without a trailing slash.
ProjectPathsDefault string `json:"projectPaths.default,omitempty"`
// ProjectPathsLinux description: Overrides the default path when the browser detects Linux. Works both with and without a trailing slash.
ProjectPathsLinux string `json:"projectPaths.linux,omitempty"`
// ProjectPathsMac description: Overrides the default path when the browser detects macOS. Works both with and without a trailing slash.
ProjectPathsMac string `json:"projectPaths.mac,omitempty"`
// ProjectPathsWindows description: Overrides the default path when the browser detects Windows. Doesn't need a trailing backslash.
ProjectPathsWindows string `json:"projectPaths.windows,omitempty"`
// Replacements description: Each key will be replaced by the corresponding value in the final URL. Keys are regular expressions, values can contain backreferences ($1, $2, ...).
Replacements map[string]string `json:"replacements,omitempty"`
// VscodeIsProjectPathUNCPath description: Indicates that the given project path is a UNC (Universal Naming Convention) path.
VscodeIsProjectPathUNCPath bool `json:"vscode.isProjectPathUNCPath,omitempty"`
// VscodeRemoteHostForSSH description: The remote host as "USER@HOSTNAME". This needs you to install the extension called "Remote Development by Microsoft" in your VS Code.
VscodeRemoteHostForSSH string `json:"vscode.remoteHostForSSH,omitempty"`
// VscodeUseInsiders description: If set, files will open in VS Code Insiders rather than VS Code.
VscodeUseInsiders bool `json:"vscode.useInsiders,omitempty"`
// VscodeUseSSH description: If set, files will open on a remote server via SSH. This requires vscode.remoteHostForSSH to be specified and VS Code extension "Remote Development by Microsoft" installed in your VS Code.
VscodeUseSSH bool `json:"vscode.useSSH,omitempty"`
}
// SiteConfiguration description: Configuration for a Sourcegraph site.
type SiteConfiguration struct {
// RedirectUnsupportedBrowser description: Prompts user to install new browser for non es5
RedirectUnsupportedBrowser bool `json:"RedirectUnsupportedBrowser,omitempty"`
// AttributionEnabled description: Enable/Disable attribution search for Cody-generated snippets
AttributionEnabled *bool `json:"attribution.enabled,omitempty"`
// AttributionGateway description: Use this gateway parameters for customers that bring their own key. Otherwise gateway endpoint is used.
AttributionGateway *AttributionGateway `json:"attribution.gateway,omitempty"`
// AuthAccessRequest description: The config options for access requests
AuthAccessRequest *AuthAccessRequest `json:"auth.accessRequest,omitempty"`
// AuthAccessTokens description: Settings for access tokens, which enable external tools to access the Sourcegraph API with the privileges of the user.
AuthAccessTokens *AuthAccessTokens `json:"auth.accessTokens,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.
AuthAllowedIpAddress *AuthAllowedIpAddress `json:"auth.allowedIpAddress,omitempty"`
// AuthEnableUsernameChanges description: Enables users to change their username after account creation. Warning: setting this to be true has security implications if you have enabled (or will at any point in the future enable) repository permissions with an option that relies on username equivalency between Sourcegraph and an external service or authentication provider. Do NOT set this to true if you are using non-built-in authentication OR rely on username equivalency for repository permissions.
AuthEnableUsernameChanges bool `json:"auth.enableUsernameChanges,omitempty"`
// AuthLockout description: The config options for account lockout
AuthLockout *AuthLockout `json:"auth.lockout,omitempty"`
// AuthMinPasswordLength description: The minimum number of Unicode code points that a password must contain.
AuthMinPasswordLength int `json:"auth.minPasswordLength,omitempty"`
// AuthPasswordPolicy description: Enables and configures password policy. This will allow admins to enforce password complexity and length requirements.
AuthPasswordPolicy *AuthPasswordPolicy `json:"auth.passwordPolicy,omitempty"`
// AuthPasswordResetLinkExpiry description: The duration (in seconds) that a password reset link is considered valid.
AuthPasswordResetLinkExpiry int `json:"auth.passwordResetLinkExpiry,omitempty"`
// AuthPrimaryLoginProvidersCount description: The number of auth providers that will be shown to the user on the login screen. Other providers are shown under `Other login methods` section.
AuthPrimaryLoginProvidersCount int `json:"auth.primaryLoginProvidersCount,omitempty"`
// AuthProviders description: The authentication providers to use for identifying and signing in users. See instructions below for configuring SAML, OpenID Connect (including Google Workspace), and HTTP authentication proxies. Multiple authentication providers are supported (by specifying multiple elements in this array).
AuthProviders []AuthProviders `json:"auth.providers,omitempty"`
// AuthPublic description: WARNING: This option has been removed as of 3.8.
AuthPublic bool `json:"auth.public,omitempty"`
// AuthSessionExpiry description: The duration of a user session, after which it expires and the user is required to re-authenticate. The default is 90 days. There is typically no need to set this, but some users may have specific internal security requirements.
//
// The string format is that of the Duration type in the Go time package (https://golang.org/pkg/time/#ParseDuration). E.g., "720h", "43200m", "2592000s" all indicate a timespan of 30 days.
//
// Note: changing this field does not affect the expiration of existing sessions. If you would like to enforce this limit for existing sessions, you must log out currently signed-in users. You can force this by removing all keys beginning with "session_" from the Redis store:
//
// * For deployments using `sourcegraph/server`: `docker exec $CONTAINER_ID redis-cli --raw keys 'session_*' | xargs docker exec $CONTAINER_ID redis-cli del`
// * For cluster deployments:
// ```
// REDIS_POD="$(kubectl get pods -l app=redis-store -o jsonpath={.items[0].metadata.name})";
// kubectl exec "$REDIS_POD" -- redis-cli --raw keys 'session_*' | xargs kubectl exec "$REDIS_POD" -- redis-cli --raw del;
// ```
//
AuthSessionExpiry string `json:"auth.sessionExpiry,omitempty"`
// AuthUnlockAccountLinkExpiry description: Validity expressed in minutes of the unlock account token
AuthUnlockAccountLinkExpiry int `json:"auth.unlockAccountLinkExpiry,omitempty"`
// AuthUnlockAccountLinkSigningKey description: Base64-encoded HMAC signing key to sign the JWT token for account unlock URLs
AuthUnlockAccountLinkSigningKey string `json:"auth.unlockAccountLinkSigningKey,omitempty"`
// AuthUserOrgMap description: Ensure that matching users are members of the specified orgs (auto-joining users to the orgs if they are not already a member). Provide a JSON object of the form `{"*": ["org1", "org2"]}`, where org1 and org2 are orgs that all users are automatically joined to. Currently the only supported key is `"*"`.
AuthUserOrgMap map[string][]string `json:"auth.userOrgMap,omitempty"`
// AuthzEnforceForSiteAdmins description: When true, site admins will only be able to see private code they have access to via our authz system.
AuthzEnforceForSiteAdmins bool `json:"authz.enforceForSiteAdmins,omitempty"`
// BatchChangesAutoDeleteBranch description: Automatically delete branches created for Batch Changes changesets when the changeset is merged or closed, for supported code hosts. Overrides any setting on the repository on the code host itself.
BatchChangesAutoDeleteBranch bool `json:"batchChanges.autoDeleteBranch,omitempty"`
// BatchChangesChangesetsRetention description: How long changesets will be retained after they have been detached from a batch change.
BatchChangesChangesetsRetention string `json:"batchChanges.changesetsRetention,omitempty"`
// BatchChangesDisableWebhooksWarning description: Hides Batch Changes warnings about webhooks not being configured.
BatchChangesDisableWebhooksWarning bool `json:"batchChanges.disableWebhooksWarning,omitempty"`
// BatchChangesEnabled description: Enables/disables the Batch Changes feature.
BatchChangesEnabled *bool `json:"batchChanges.enabled,omitempty"`
// BatchChangesEnforceForks description: When enabled, all branches created by batch changes will be pushed to forks of the original repository.
BatchChangesEnforceForks bool `json:"batchChanges.enforceForks,omitempty"`
// BatchChangesRejectUnverifiedCommit description: Reject unverified commits when creating a Batch Change
BatchChangesRejectUnverifiedCommit *bool `json:"batchChanges.rejectUnverifiedCommit,omitempty"`
// BatchChangesRestrictToAdmins description: When enabled, only site admins can create and apply batch changes.
BatchChangesRestrictToAdmins *bool `json:"batchChanges.restrictToAdmins,omitempty"`
// BatchChangesRolloutWindows description: Specifies specific windows, which can have associated rate limits, to be used when reconciling published changesets (creating or updating). All days and times are handled in UTC.
BatchChangesRolloutWindows *[]*BatchChangeRolloutWindow `json:"batchChanges.rolloutWindows,omitempty"`
// Branding description: Customize Sourcegraph homepage logo and search icon.
Branding *Branding `json:"branding,omitempty"`
// CloneProgressLog description: Whether clone progress should be logged to a file. If enabled, logs are written to files in the OS default path for temporary files.
CloneProgressLog bool `json:"cloneProgress.log,omitempty"`
// CodeIntelAutoIndexingAllowGlobalPolicies description: Whether auto-indexing policies may apply to all repositories on the Sourcegraph instance. Default is false. The policyRepositoryMatchLimit setting still applies to such auto-indexing policies.
CodeIntelAutoIndexingAllowGlobalPolicies *bool `json:"codeIntelAutoIndexing.allowGlobalPolicies,omitempty"`
// CodeIntelAutoIndexingEnabled description: Enables/disables the code intel auto-indexing feature. Currently experimental.
CodeIntelAutoIndexingEnabled *bool `json:"codeIntelAutoIndexing.enabled,omitempty"`
// CodeIntelAutoIndexingIndexerMap description: Overrides the default Docker images used by auto-indexing.
CodeIntelAutoIndexingIndexerMap map[string]string `json:"codeIntelAutoIndexing.indexerMap,omitempty"`
// CodeIntelAutoIndexingPolicyRepositoryMatchLimit description: The maximum number of repositories to which a single auto-indexing policy can apply. Default is -1, which is unlimited.
CodeIntelAutoIndexingPolicyRepositoryMatchLimit *int `json:"codeIntelAutoIndexing.policyRepositoryMatchLimit,omitempty"`
// CodeIntelRankingDocumentReferenceCountsCronExpression description: A cron expression indicating when to run the document reference counts graph reduction job.
CodeIntelRankingDocumentReferenceCountsCronExpression *string `json:"codeIntelRanking.documentReferenceCountsCronExpression,omitempty"`
// CodeIntelRankingDocumentReferenceCountsDerivativeGraphKeyPrefix description: An arbitrary identifier used to group calculated rankings from SCIP data (excluding the SCIP export).
CodeIntelRankingDocumentReferenceCountsDerivativeGraphKeyPrefix string `json:"codeIntelRanking.documentReferenceCountsDerivativeGraphKeyPrefix,omitempty"`
// CodeIntelRankingDocumentReferenceCountsEnabled description: Enables/disables the document reference counts feature. Currently experimental.
CodeIntelRankingDocumentReferenceCountsEnabled *bool `json:"codeIntelRanking.documentReferenceCountsEnabled,omitempty"`
// CodeIntelRankingDocumentReferenceCountsGraphKey description: An arbitrary identifier used to group calculated rankings from SCIP data (including the SCIP export).
CodeIntelRankingDocumentReferenceCountsGraphKey string `json:"codeIntelRanking.documentReferenceCountsGraphKey,omitempty"`
// CodeIntelRankingStaleResultsAge description: The interval at which to run the reduce job that computes document reference counts. Default is 24hrs.
CodeIntelRankingStaleResultsAge int `json:"codeIntelRanking.staleResultsAge,omitempty"`
// CodeMonitors description: Configuration options for code monitors
CodeMonitors *CodeMonitors `json:"codeMonitors,omitempty"`
// CodyContextFilters description: Rules defining the repositories that will never be shared by Cody with third-party LLM providers.
CodyContextFilters *CodyContextFilters `json:"cody.contextFilters,omitempty"`
// CodyEnabled description: Enable or disable Cody instance-wide. When Cody is disabled, all Cody endpoints and GraphQL queries will return errors, Cody will not show up in the site-admin sidebar, and Cody in the global navbar will only show a call-to-action for site-admins to enable Cody.
CodyEnabled *bool `json:"cody.enabled,omitempty"`
// CodyPermissions description: Whether to enable Cody role-based access controls. Only respected if cody.restrictUsersFeatureFlag is not set. See https://sourcegraph.com/docs/admin/access_control
CodyPermissions *bool `json:"cody.permissions,omitempty"`
// CodyRestrictUsersFeatureFlag description: DEPRECATED; see cody.permissions instead. PRIOR DESCRIPTION: Cody to only be enabled for users that have a feature flag labeled "cody" set to true. You must create a feature flag with this ID after enabling this setting: https://docs-legacy.sourcegraph.com/dev/how-to/use_feature_flags#create-a-feature-flag. This setting only has an effect if cody.enabled is true.
CodyRestrictUsersFeatureFlag *bool `json:"cody.restrictUsersFeatureFlag,omitempty"`
// Completions description: Configuration for the completions service.
Completions *Completions `json:"completions,omitempty"`
// ConfigFeatures description: Configuration for the completions service.
ConfigFeatures *ConfigFeatures `json:"configFeatures,omitempty"`
// CorsOrigin description: Required when using any of the native code host integrations for Phabricator, GitLab, or Bitbucket Server. It is a space-separated list of allowed origins for cross-origin HTTP requests which should be the base URL for your Phabricator, GitLab, or Bitbucket Server instance.
CorsOrigin string `json:"corsOrigin,omitempty"`
// DebugSearchSymbolsParallelism description: (debug) controls the amount of symbol search parallelism. Defaults to 20. It is not recommended to change this outside of debugging scenarios. This option will be removed in a future version.
DebugSearchSymbolsParallelism int `json:"debug.search.symbolsParallelism,omitempty"`
// DefaultRateLimit description: The rate limit (in requests per hour) for the default rate limiter in the rate limiters registry. By default this is disabled and the default rate limit is infinity.
DefaultRateLimit *int `json:"defaultRateLimit,omitempty"`
// DisableAutoCodeHostSyncs description: Disable periodic syncs of configured code host connections (repository metadata, permissions, batch changes changesets, etc)
DisableAutoCodeHostSyncs bool `json:"disableAutoCodeHostSyncs,omitempty"`
// DisableAutoGitUpdates description: Disable periodically fetching git contents for existing repositories.
DisableAutoGitUpdates bool `json:"disableAutoGitUpdates,omitempty"`
// DisableFeedbackSurvey description: Disable the feedback survey
DisableFeedbackSurvey bool `json:"disableFeedbackSurvey,omitempty"`
// DisableNonCriticalTelemetry description: DEPRECATED. Has no effect.
DisableNonCriticalTelemetry bool `json:"disableNonCriticalTelemetry,omitempty"`
// DisablePublicRepoRedirects description: DEPRECATED! Disable redirects to sourcegraph.com when visiting public repositories that can't exist on this server.
DisablePublicRepoRedirects bool `json:"disablePublicRepoRedirects,omitempty"`
// Dotcom description: Configuration options for Sourcegraph.com only.
Dotcom *Dotcom `json:"dotcom,omitempty"`
// EmailAddress description: The "from" address for emails sent by this server.
// Please see https://sourcegraph.com/docs/admin/config/email
EmailAddress string `json:"email.address,omitempty"`
// EmailSenderName description: The name to use in the "from" address for emails sent by this server.
EmailSenderName string `json:"email.senderName,omitempty"`
// EmailSmtp description: The SMTP server used to send transactional emails.
// Please see https://sourcegraph.com/docs/admin/config/email
EmailSmtp *SMTPServerConfig `json:"email.smtp,omitempty"`
// EmailTemplates description: Configurable templates for some email types sent by Sourcegraph.
EmailTemplates *EmailTemplates `json:"email.templates,omitempty"`
// Embeddings description: Configuration for embeddings service.
Embeddings *Embeddings `json:"embeddings,omitempty"`
// EncryptionKeys description: Configuration for encryption keys used to encrypt data at rest in the database.
EncryptionKeys *EncryptionKeys `json:"encryption.keys,omitempty"`
// ExecutorsAccessToken description: The shared secret between Sourcegraph and executors. The value must contain at least 20 characters.
ExecutorsAccessToken string `json:"executors.accessToken,omitempty"`
// ExecutorsBatcheshelperImage description: The image to use for batch changes in executors. Use this value to pull from a custom image registry.
ExecutorsBatcheshelperImage string `json:"executors.batcheshelperImage,omitempty"`
// ExecutorsBatcheshelperImageTag description: The tag to use for the batcheshelper image in executors. Use this value to use a custom tag. Sourcegraph by default uses the best match, so use this setting only if you really need to overwrite it and make sure to keep it updated.
ExecutorsBatcheshelperImageTag string `json:"executors.batcheshelperImageTag,omitempty"`
// ExecutorsFrontendURL description: The URL where Sourcegraph executors can reach the Sourcegraph instance. If not set, defaults to externalURL. URLs with a path (other than `/`) are not allowed. For Docker executors, the special hostname `host.docker.internal` can be used to refer to the Docker container's host.
ExecutorsFrontendURL string `json:"executors.frontendURL,omitempty"`
// ExecutorsLsifGoImage description: The tag to use for the lsif-go image in executors. Use this value to use a custom tag. Sourcegraph by default uses the best match, so use this setting only if you really need to overwrite it and make sure to keep it updated.
ExecutorsLsifGoImage string `json:"executors.lsifGoImage,omitempty"`
// ExecutorsMultiqueue description: The configuration for multiqueue executors.
ExecutorsMultiqueue *ExecutorsMultiqueue `json:"executors.multiqueue,omitempty"`
// ExecutorsSrcCLIImage description: The image to use for src-cli in executors. Use this value to pull from a custom image registry.
ExecutorsSrcCLIImage string `json:"executors.srcCLIImage,omitempty"`
// ExecutorsSrcCLIImageTag description: The tag to use for the src-cli image in executors. Use this value to use a custom tag. Sourcegraph by default uses the best match, so use this setting only if you really need to overwrite it and make sure to keep it updated.
ExecutorsSrcCLIImageTag string `json:"executors.srcCLIImageTag,omitempty"`
// ExperimentalFeatures description: Experimental features and settings.
ExperimentalFeatures *ExperimentalFeatures `json:"experimentalFeatures,omitempty"`
ExportUsageTelemetry *ExportUsageTelemetry `json:"exportUsageTelemetry,omitempty"`
// ExternalURL description: The externally accessible URL for Sourcegraph (i.e., what you type into your browser). Previously called `appURL`. Only root URLs are allowed.
ExternalURL string `json:"externalURL,omitempty"`
// GitCloneURLToRepositoryName description: JSON array of configuration that maps from Git clone URL to repository name. Sourcegraph automatically resolves remote clone URLs to their proper code host. However, there may be non-remote clone URLs (e.g., in submodule declarations) that Sourcegraph cannot automatically map to a code host. In this case, use this field to specify the mapping. The mappings are tried in the order they are specified and take precedence over automatic mappings.
GitCloneURLToRepositoryName []*CloneURLToRepositoryName `json:"git.cloneURLToRepositoryName,omitempty"`
// GitHubApp description: DEPRECATED: The config options for Sourcegraph GitHub App.
GitHubApp *GitHubApp `json:"gitHubApp,omitempty"`
// GitLongCommandTimeout description: Maximum number of seconds that a long Git command (e.g. clone or remote update) is allowed to execute. The default is 3600 seconds, or 1 hour.
GitLongCommandTimeout int `json:"gitLongCommandTimeout,omitempty"`
// GitMaxCodehostRequestsPerSecond description: Maximum number of remote code host git operations (e.g. clone or ls-remote) to be run per second per gitserver. Default is -1, which is unlimited.
GitMaxCodehostRequestsPerSecond *int `json:"gitMaxCodehostRequestsPerSecond,omitempty"`
// GitMaxConcurrentClones description: Maximum number of git clone processes that will be run concurrently per gitserver to update repositories. Note: the global git update scheduler respects gitMaxConcurrentClones. However, we allow each gitserver to run upto gitMaxConcurrentClones to allow for urgent fetches. Urgent fetches are used when a user is browsing a PR and we do not have the commit yet.
GitMaxConcurrentClones int `json:"gitMaxConcurrentClones,omitempty"`
// GitRecorder description: Record git operations that are executed on configured repositories.
GitRecorder *GitRecorder `json:"gitRecorder,omitempty"`
// GitUpdateInterval description: JSON array of repo name patterns and update intervals. If a repo matches a pattern, the associated interval will be used. If it matches no patterns a default backoff heuristic will be used. Pattern matches are attempted in the order they are provided.
GitUpdateInterval []*UpdateIntervalRule `json:"gitUpdateInterval,omitempty"`
// GitserverDiskUsageWarningThreshold description: Disk usage threshold at which to display warning notification. Value is a percentage.
GitserverDiskUsageWarningThreshold *int `json:"gitserver.diskUsageWarningThreshold,omitempty"`
// HtmlBodyBottom description: HTML to inject at the bottom of the `<body>` element on each page, for analytics scripts. Requires env var ENABLE_INJECT_HTML=true.
HtmlBodyBottom string `json:"htmlBodyBottom,omitempty"`
// HtmlBodyTop description: HTML to inject at the top of the `<body>` element on each page, for analytics scripts. Requires env var ENABLE_INJECT_HTML=true.
HtmlBodyTop string `json:"htmlBodyTop,omitempty"`
// HtmlHeadBottom description: HTML to inject at the bottom of the `<head>` element on each page, for analytics scripts. Requires env var ENABLE_INJECT_HTML=true.
HtmlHeadBottom string `json:"htmlHeadBottom,omitempty"`
// HtmlHeadTop description: HTML to inject at the top of the `<head>` element on each page, for analytics scripts. Requires env var ENABLE_INJECT_HTML=true.
HtmlHeadTop string `json:"htmlHeadTop,omitempty"`
// InsightsAggregationsBufferSize description: The size of the buffer for aggregations ran in-memory. A higher limit might strain memory for the frontend
InsightsAggregationsBufferSize int `json:"insights.aggregations.bufferSize,omitempty"`
// InsightsAggregationsProactiveResultLimit description: The maximum number of results a proactive search aggregation can accept before stopping
InsightsAggregationsProactiveResultLimit int `json:"insights.aggregations.proactiveResultLimit,omitempty"`
// InsightsBackfillInterruptAfter description: Set the number of seconds an insight series will spend backfilling before being interrupted. Series are interrupted to prevent long running insights from exhausting all of the available workers. Interrupted series will be placed back in the queue and retried based on their priority.
InsightsBackfillInterruptAfter int `json:"insights.backfill.interruptAfter,omitempty"`
// InsightsBackfillRepositoryConcurrency description: Number of repositories within the batch to backfill concurrently.
InsightsBackfillRepositoryConcurrency int `json:"insights.backfill.repositoryConcurrency,omitempty"`
// InsightsBackfillRepositoryGroupSize description: Set the number of repositories to batch in a group during backfilling.
InsightsBackfillRepositoryGroupSize int `json:"insights.backfill.repositoryGroupSize,omitempty"`
// InsightsHistoricalWorkerRateLimit description: Maximum number of historical Code Insights data frames that may be analyzed per second.
InsightsHistoricalWorkerRateLimit *float64 `json:"insights.historical.worker.rateLimit,omitempty"`
// InsightsHistoricalWorkerRateLimitBurst description: The allowed burst rate for the Code Insights historical worker rate limiter.
InsightsHistoricalWorkerRateLimitBurst int `json:"insights.historical.worker.rateLimitBurst,omitempty"`
// InsightsMaximumSampleSize description: The maximum number of data points that will be available to view for a series on a code insight. Points beyond that will be stored in a separate table and available for data export.
InsightsMaximumSampleSize int `json:"insights.maximumSampleSize,omitempty"`
// InsightsQueryWorkerConcurrency description: Number of concurrent executions of a code insight query on a worker node
InsightsQueryWorkerConcurrency int `json:"insights.query.worker.concurrency,omitempty"`
// InsightsQueryWorkerRateLimit description: Maximum number of Code Insights queries initiated per second on a worker node.
InsightsQueryWorkerRateLimit *float64 `json:"insights.query.worker.rateLimit,omitempty"`
// InsightsQueryWorkerRateLimitBurst description: The allowed burst rate for the Code Insights queries per second rate limiter.
InsightsQueryWorkerRateLimitBurst int `json:"insights.query.worker.rateLimitBurst,omitempty"`
// LicenseKey description: The license key associated with a Sourcegraph product subscription, which is necessary to activate Sourcegraph Enterprise functionality. To obtain this value, contact Sourcegraph to purchase a subscription. To escape the value into a JSON string, you may want to use a tool like https://json-escape-text.now.sh.
LicenseKey string `json:"licenseKey,omitempty"`
// Log description: Configuration for logging and alerting, including to external services.
Log *Log `json:"log,omitempty"`
// LsifEnforceAuth description: Whether or not LSIF uploads will be blocked unless a valid LSIF upload token is provided.
LsifEnforceAuth bool `json:"lsifEnforceAuth,omitempty"`
// MaxReposToSearch description: DEPRECATED: Configure maxRepos in search.limits. The maximum number of repositories to search across. The user is prompted to narrow their query if exceeded. Any value less than or equal to zero means unlimited.
MaxReposToSearch int `json:"maxReposToSearch,omitempty"`
ModelConfiguration *SiteModelConfiguration `json:"modelConfiguration,omitempty"`
// Notifications description: Notifications recieved from Sourcegraph.com to display in Sourcegraph.
Notifications []*Notifications `json:"notifications,omitempty"`
// ObservabilityAlerts description: Configure notifications for Sourcegraph's built-in alerts.
ObservabilityAlerts []*ObservabilityAlerts `json:"observability.alerts,omitempty"`
// ObservabilityCaptureSlowGraphQLRequestsLimit description: (debug) Set a limit to the amount of captured slow GraphQL requests being stored for visualization. For defining the threshold for a slow GraphQL request, see observability.logSlowGraphQLRequests.
ObservabilityCaptureSlowGraphQLRequestsLimit int `json:"observability.captureSlowGraphQLRequestsLimit,omitempty"`
// ObservabilityClient description: EXPERIMENTAL: Configuration for client observability
ObservabilityClient *ObservabilityClient `json:"observability.client,omitempty"`
// ObservabilityLogSlowGraphQLRequests description: (debug) logs all GraphQL requests slower than the specified number of milliseconds.
ObservabilityLogSlowGraphQLRequests int `json:"observability.logSlowGraphQLRequests,omitempty"`
// ObservabilityLogSlowSearches description: (debug) logs all search queries (issued by users, code intelligence, or API requests) slower than the specified number of milliseconds.
ObservabilityLogSlowSearches int `json:"observability.logSlowSearches,omitempty"`
// ObservabilitySilenceAlerts description: Silence individual Sourcegraph alerts by identifier.
ObservabilitySilenceAlerts []string `json:"observability.silenceAlerts,omitempty"`
// ObservabilityTracing description: Configures distributed tracing within Sourcegraph. To learn more, refer to https://sourcegraph.com/docs/admin/observability/tracing
ObservabilityTracing *ObservabilityTracing `json:"observability.tracing,omitempty"`
// OrganizationInvitations description: Configuration for organization invitations.
OrganizationInvitations *OrganizationInvitations `json:"organizationInvitations,omitempty"`
// OutboundRequestLogLimit description: The maximum number of outbound requests to retain. This is a global limit across all outbound requests. If the limit is exceeded, older items will be deleted. If the limit is 0, no outbound requests are logged.
OutboundRequestLogLimit int `json:"outboundRequestLogLimit,omitempty"`
// OwnBackgroundRepoIndexConcurrencyLimit description: The max number of concurrent Own jobs that will run per worker node.
OwnBackgroundRepoIndexConcurrencyLimit int `json:"own.background.repoIndexConcurrencyLimit,omitempty"`
// OwnBackgroundRepoIndexRateBurstLimit description: The maximum per second burst of repositories for Own jobs per worker node. Generally this value should not be less than the max concurrency.
OwnBackgroundRepoIndexRateBurstLimit int `json:"own.background.repoIndexRateBurstLimit,omitempty"`
// OwnBackgroundRepoIndexRateLimit description: The maximum per second rate of repositories for Own jobs per worker node.
OwnBackgroundRepoIndexRateLimit int `json:"own.background.repoIndexRateLimit,omitempty"`
// OwnBestEffortTeamMatching description: The Own service will attempt to match a Team by the last part of its handle if it contains a slash and no match is found for its full handle.
OwnBestEffortTeamMatching *bool `json:"own.bestEffortTeamMatching,omitempty"`
// ParentSourcegraph description: URL to fetch unreachable repository details from. Defaults to "https://sourcegraph.com"
ParentSourcegraph *ParentSourcegraph `json:"parentSourcegraph,omitempty"`
// PermissionsSyncJobCleanupInterval description: Time interval (in seconds) of how often cleanup worker should remove old jobs from permissions sync jobs table.
PermissionsSyncJobCleanupInterval int `json:"permissions.syncJobCleanupInterval,omitempty"`
// PermissionsSyncJobsHistorySize description: The number of last repo/user permission jobs to keep for history.
PermissionsSyncJobsHistorySize *int `json:"permissions.syncJobsHistorySize,omitempty"`
// PermissionsSyncOldestRepos description: Number of repo permissions to schedule for syncing in single scheduler iteration.
PermissionsSyncOldestRepos *int `json:"permissions.syncOldestRepos,omitempty"`
// PermissionsSyncOldestUsers description: Number of user permissions to schedule for syncing in single scheduler iteration.
PermissionsSyncOldestUsers *int `json:"permissions.syncOldestUsers,omitempty"`
// PermissionsSyncReposBackoffSeconds description: Don't sync a repo's permissions if it has synced within the last n seconds.
PermissionsSyncReposBackoffSeconds int `json:"permissions.syncReposBackoffSeconds,omitempty"`
// PermissionsSyncScheduleInterval description: Time interval (in seconds) of how often each component picks up authorization changes in external services.
PermissionsSyncScheduleInterval int `json:"permissions.syncScheduleInterval,omitempty"`
// PermissionsSyncUsersBackoffSeconds description: Don't sync a user's permissions if they have synced within the last n seconds.
PermissionsSyncUsersBackoffSeconds int `json:"permissions.syncUsersBackoffSeconds,omitempty"`
// PermissionsSyncUsersMaxConcurrency description: The maximum number of user-centric permissions syncing jobs that can be spawned concurrently. Service restart is required to take effect for changes.
PermissionsSyncUsersMaxConcurrency int `json:"permissions.syncUsersMaxConcurrency,omitempty"`
// PermissionsUserMapping description: Settings for Sourcegraph explicit permissions, which allow the site admin to explicitly manage repository permissions via the GraphQL API. This will mark repositories as restricted by default.
PermissionsUserMapping *PermissionsUserMapping `json:"permissions.userMapping,omitempty"`
// ProductResearchPageEnabled description: Enables users access to the product research page in their settings.
ProductResearchPageEnabled *bool `json:"productResearchPage.enabled,omitempty"`
RateLimits *RateLimits `json:"rateLimits,omitempty"`
// RedactOutboundRequestHeaders description: Enables redacting sensitive information from outbound requests. Important: We only respect this setting in development environments. In production, we always redact outbound requests.
RedactOutboundRequestHeaders *bool `json:"redactOutboundRequestHeaders,omitempty"`
// RepoConcurrentExternalServiceSyncers description: The number of concurrent external service syncers that can run.
RepoConcurrentExternalServiceSyncers int `json:"repoConcurrentExternalServiceSyncers,omitempty"`
// RepoListUpdateInterval description: Interval (in minutes) for checking code hosts (such as GitHub, Gitolite, etc.) for new repositories.
RepoListUpdateInterval int `json:"repoListUpdateInterval,omitempty"`
// RepoPurgeWorker description: Configuration for repository purge worker.
RepoPurgeWorker *RepoPurgeWorker `json:"repoPurgeWorker,omitempty"`
// ScimAuthToken description: The SCIM auth token is used to authenticate SCIM requests. If not set, SCIM is disabled.
ScimAuthToken string `json:"scim.authToken,omitempty"`
// ScimIdentityProvider description: Identity provider used for SCIM support. "STANDARD" should be used unless a more specific value is available
ScimIdentityProvider string `json:"scim.identityProvider,omitempty"`
// SearchIndexShardConcurrency description: The number of threads each indexserver should use to index shards. If not set, indexserver will use the number of available CPUs. This is exposed as a safeguard and should usually not require being set.
SearchIndexShardConcurrency int `json:"search.index.shardConcurrency,omitempty"`
// SearchIndexSymbolsEnabled description: Whether indexed symbol search is enabled. This is contingent on the indexed search configuration, and is true by default for instances with indexed search enabled. Enabling this will cause every repository to re-index, which is a time consuming (several hours) operation. Additionally, it requires more storage and ram to accommodate the added symbols information in the search index.
SearchIndexSymbolsEnabled *bool `json:"search.index.symbols.enabled,omitempty"`
// SearchLargeFiles description: A list of file glob patterns where matching files will be indexed and searched regardless of their size. Files still need to be valid utf-8 to be indexed. The glob pattern syntax can be found here: https://github.com/bmatcuk/doublestar#patterns.
SearchLargeFiles []string `json:"search.largeFiles,omitempty"`
// SearchLimits description: Limits that search applies for number of repositories searched and timeouts.
SearchLimits *SearchLimits `json:"search.limits,omitempty"`
// SscApiBaseUrl description: The base URL of the Self-Serve Cody API.
SscApiBaseUrl string `json:"ssc.apiBaseUrl,omitempty"`
// SscSamsHostName description: The hostname of SAMS instance to connect.
SscSamsHostName string `json:"ssc.samsHostName,omitempty"`
// SyntaxHighlighting description: Syntax highlighting configuration
SyntaxHighlighting *SyntaxHighlighting `json:"syntaxHighlighting,omitempty"`
// UpdateChannel description: The channel on which to automatically check for Sourcegraph updates.
UpdateChannel string `json:"update.channel,omitempty"`
// WebhookLogging description: Configuration for logging incoming webhooks.
WebhookLogging *WebhookLogging `json:"webhook.logging,omitempty"`
Additional map[string]any `json:"-"` // additionalProperties not explicitly defined in the schema
}
func (v SiteConfiguration) MarshalJSON() ([]byte, error) {
m := make(map[string]any, len(v.Additional))
for k, v := range v.Additional {
m[k] = v
}
type wrapper SiteConfiguration
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 *SiteConfiguration) UnmarshalJSON(data []byte) error {
type wrapper SiteConfiguration
var s wrapper
if err := json.Unmarshal(data, &s); err != nil {
return err
}
*v = SiteConfiguration(s)
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
return err
}
delete(m, "RedirectUnsupportedBrowser")
delete(m, "attribution.enabled")
delete(m, "attribution.gateway")
delete(m, "auth.accessRequest")
delete(m, "auth.accessTokens")
delete(m, "auth.allowedIpAddress")
delete(m, "auth.enableUsernameChanges")
delete(m, "auth.lockout")
delete(m, "auth.minPasswordLength")
delete(m, "auth.passwordPolicy")
delete(m, "auth.passwordResetLinkExpiry")
delete(m, "auth.primaryLoginProvidersCount")
delete(m, "auth.providers")
delete(m, "auth.public")
delete(m, "auth.sessionExpiry")
delete(m, "auth.unlockAccountLinkExpiry")
delete(m, "auth.unlockAccountLinkSigningKey")
delete(m, "auth.userOrgMap")
delete(m, "authz.enforceForSiteAdmins")
delete(m, "batchChanges.autoDeleteBranch")
delete(m, "batchChanges.changesetsRetention")
delete(m, "batchChanges.disableWebhooksWarning")
delete(m, "batchChanges.enabled")
delete(m, "batchChanges.enforceForks")
delete(m, "batchChanges.rejectUnverifiedCommit")
delete(m, "batchChanges.restrictToAdmins")
delete(m, "batchChanges.rolloutWindows")
delete(m, "branding")
delete(m, "cloneProgress.log")
delete(m, "codeIntelAutoIndexing.allowGlobalPolicies")
delete(m, "codeIntelAutoIndexing.enabled")
delete(m, "codeIntelAutoIndexing.indexerMap")
delete(m, "codeIntelAutoIndexing.policyRepositoryMatchLimit")
delete(m, "codeIntelRanking.documentReferenceCountsCronExpression")
delete(m, "codeIntelRanking.documentReferenceCountsDerivativeGraphKeyPrefix")
delete(m, "codeIntelRanking.documentReferenceCountsEnabled")
delete(m, "codeIntelRanking.documentReferenceCountsGraphKey")
delete(m, "codeIntelRanking.staleResultsAge")
delete(m, "codeMonitors")
delete(m, "cody.contextFilters")
delete(m, "cody.enabled")
delete(m, "cody.permissions")
delete(m, "cody.restrictUsersFeatureFlag")
delete(m, "completions")
delete(m, "configFeatures")
delete(m, "corsOrigin")
delete(m, "debug.search.symbolsParallelism")
delete(m, "defaultRateLimit")
delete(m, "disableAutoCodeHostSyncs")
delete(m, "disableAutoGitUpdates")
delete(m, "disableFeedbackSurvey")
delete(m, "disableNonCriticalTelemetry")
delete(m, "disablePublicRepoRedirects")
delete(m, "dotcom")
delete(m, "email.address")
delete(m, "email.senderName")
delete(m, "email.smtp")
delete(m, "email.templates")
delete(m, "embeddings")
delete(m, "encryption.keys")
delete(m, "executors.accessToken")
delete(m, "executors.batcheshelperImage")
delete(m, "executors.batcheshelperImageTag")
delete(m, "executors.frontendURL")
delete(m, "executors.lsifGoImage")
delete(m, "executors.multiqueue")
delete(m, "executors.srcCLIImage")
delete(m, "executors.srcCLIImageTag")
delete(m, "experimentalFeatures")
delete(m, "exportUsageTelemetry")
delete(m, "externalURL")
delete(m, "git.cloneURLToRepositoryName")
delete(m, "gitHubApp")
delete(m, "gitLongCommandTimeout")
delete(m, "gitMaxCodehostRequestsPerSecond")
delete(m, "gitMaxConcurrentClones")
delete(m, "gitRecorder")
delete(m, "gitUpdateInterval")
delete(m, "gitserver.diskUsageWarningThreshold")
delete(m, "htmlBodyBottom")
delete(m, "htmlBodyTop")
delete(m, "htmlHeadBottom")
delete(m, "htmlHeadTop")
delete(m, "insights.aggregations.bufferSize")
delete(m, "insights.aggregations.proactiveResultLimit")
delete(m, "insights.backfill.interruptAfter")
delete(m, "insights.backfill.repositoryConcurrency")
delete(m, "insights.backfill.repositoryGroupSize")
delete(m, "insights.historical.worker.rateLimit")
delete(m, "insights.historical.worker.rateLimitBurst")
delete(m, "insights.maximumSampleSize")
delete(m, "insights.query.worker.concurrency")
delete(m, "insights.query.worker.rateLimit")
delete(m, "insights.query.worker.rateLimitBurst")
delete(m, "licenseKey")
delete(m, "log")
delete(m, "lsifEnforceAuth")
delete(m, "maxReposToSearch")
delete(m, "modelConfiguration")
delete(m, "notifications")
delete(m, "observability.alerts")
delete(m, "observability.captureSlowGraphQLRequestsLimit")
delete(m, "observability.client")
delete(m, "observability.logSlowGraphQLRequests")
delete(m, "observability.logSlowSearches")
delete(m, "observability.silenceAlerts")
delete(m, "observability.tracing")
delete(m, "organizationInvitations")
delete(m, "outboundRequestLogLimit")
delete(m, "own.background.repoIndexConcurrencyLimit")
delete(m, "own.background.repoIndexRateBurstLimit")
delete(m, "own.background.repoIndexRateLimit")
delete(m, "own.bestEffortTeamMatching")
delete(m, "parentSourcegraph")
delete(m, "permissions.syncJobCleanupInterval")
delete(m, "permissions.syncJobsHistorySize")
delete(m, "permissions.syncOldestRepos")
delete(m, "permissions.syncOldestUsers")
delete(m, "permissions.syncReposBackoffSeconds")
delete(m, "permissions.syncScheduleInterval")
delete(m, "permissions.syncUsersBackoffSeconds")
delete(m, "permissions.syncUsersMaxConcurrency")
delete(m, "permissions.userMapping")
delete(m, "productResearchPage.enabled")
delete(m, "rateLimits")
delete(m, "redactOutboundRequestHeaders")
delete(m, "repoConcurrentExternalServiceSyncers")
delete(m, "repoListUpdateInterval")
delete(m, "repoPurgeWorker")
delete(m, "scim.authToken")
delete(m, "scim.identityProvider")
delete(m, "search.index.shardConcurrency")
delete(m, "search.index.symbols.enabled")
delete(m, "search.largeFiles")
delete(m, "search.limits")
delete(m, "ssc.apiBaseUrl")
delete(m, "ssc.samsHostName")
delete(m, "syntaxHighlighting")
delete(m, "update.channel")
delete(m, "webhook.logging")
if len(m) > 0 {
v.Additional = make(map[string]any, len(m))
}
for k, vv := range m {
v.Additional[k] = vv
}
return nil
}
// SiteModelConfiguration description: BETA FEATURE, only enable if you know what you are doing. If set, Cody will use the new model configuration system and ignore the old 'completions' site configuration entirely.
type SiteModelConfiguration struct {
DefaultModels *DefaultModels `json:"defaultModels,omitempty"`
// ModelOverrides description: Override, or add to, the list of models Cody is aware of and how they are configured to work
ModelOverrides []*ModelOverride `json:"modelOverrides,omitempty"`
// ModelOverridesRecommendedSettings description: Override, or add to, the list of models Cody is aware of - but let Sourcegraph configure how the model should work. Only available for select models.
//
// Specifying the same model both here and in 'modelOverrides' is not allowed.
ModelOverridesRecommendedSettings []string `json:"modelOverridesRecommendedSettings,omitempty"`
// ProviderOverrides description: Configures model providers. Here you can override how Cody connects to model providers and e.g. bring your own API keys or self-hosted models.
ProviderOverrides []*ProviderOverride `json:"providerOverrides,omitempty"`
// SelfHostedModels description: Add models to the list of models Cody is aware of, but let Sourcegraph provide default configuration for the model. Only available for select models, generic models can be configured in 'modelOverrides'.
//
// Specifying the same model both here and in 'modelOverrides' is not allowed.
SelfHostedModels []*SelfHostedModel `json:"selfHostedModels,omitempty"`
Sourcegraph *SourcegraphModelConfig `json:"sourcegraph,omitempty"`
}
// SourcegraphModelConfig description: If null, Cody will not use Sourcegraph's servers for model discovery.
type SourcegraphModelConfig struct {
// AccessToken description: The Cody gateway access token to use. If null, an access token will be automatically generated based on the product license.
AccessToken *string `json:"accessToken,omitempty"`
// Endpoint description: The Cody gateway URL to use for making LLM requests. If null, the production URL for Cody gateway will be used.
Endpoint *string `json:"endpoint,omitempty"`
ModelFilters *ModelFilters `json:"modelFilters,omitempty"`
}
// SrcCliVersionCache description: Configuration related to the src-cli version cache. This should only be used on sourcegraph.com.
type SrcCliVersionCache struct {
// Enabled description: Enables the src-cli version cache API endpoint.
Enabled bool `json:"enabled"`
// Github description: GitHub configuration, both for queries and receiving release webhooks.
Github Github `json:"github"`
// Interval description: The interval between version checks, expressed as a string that can be parsed by Go's time.ParseDuration.
Interval string `json:"interval,omitempty"`
}
// Step description: A command to run (as part of a sequence) in a repository branch to produce the required changes.
type Step struct {
// Container description: The Docker image used to launch the Docker container in which the shell command is run.
Container string `json:"container"`
// Env description: Environment variables to set in the step environment.
Env any `json:"env,omitempty"`
// Files description: Files that should be mounted into or be created inside the Docker container.
Files map[string]string `json:"files,omitempty"`
// If description: A condition to check before executing steps. Supports templating. The value 'true' is interpreted as true.
If any `json:"if,omitempty"`
// Mount description: Files that are mounted to the Docker container.
Mount []*Mount `json:"mount,omitempty"`
// Outputs description: Output variables of this step that can be referenced in the changesetTemplate or other steps via outputs.<name-of-output>
Outputs map[string]OutputVariable `json:"outputs,omitempty"`
// Run description: The shell command to run in the container. It can also be a multi-line shell script. The working directory is the root directory of the repository checkout.
Run string `json:"run"`
}
// StyleOverrides description: Overrides for the notice's default style. You probably want to use notice 'variant' setting instead.
type StyleOverrides struct {
// BackgroundColor description: The hex code of the background color for this notice.
BackgroundColor string `json:"backgroundColor,omitempty"`
// TextCentered description: Whether the notice text should be centered.
TextCentered bool `json:"textCentered,omitempty"`
// TextColor description: The hex code of the text color for this notice.
TextColor string `json:"textColor,omitempty"`
}
type SubRepoPermissions struct {
// Enabled description: Enables sub-repo permission checking
Enabled bool `json:"enabled,omitempty"`
// UserCacheSize description: The number of user permissions to cache
UserCacheSize int `json:"userCacheSize,omitempty"`
// UserCacheTTLSeconds description: The TTL in seconds for cached user permissions
UserCacheTTLSeconds int `json:"userCacheTTLSeconds,omitempty"`
}
// SymbolConfiguration description: Configure symbol generation
type SymbolConfiguration struct {
// Engine description: Manually specify overrides for symbol generation engine per language
Engine map[string]string `json:"engine"`
}
// SyntaxHighlighting description: Syntax highlighting configuration
type SyntaxHighlighting struct {
Engine *SyntaxHighlightingEngine `json:"engine,omitempty"`
Languages *SyntaxHighlightingLanguage `json:"languages,omitempty"`
// Symbols description: Configure symbol generation
Symbols *SymbolConfiguration `json:"symbols,omitempty"`
}
type SyntaxHighlightingEngine struct {
// Default description: The default syntax highlighting engine to use
Default string `json:"default,omitempty"`
// Overrides description: Manually specify overrides for syntax highlighting engine per language
Overrides map[string]string `json:"overrides,omitempty"`
}
type SyntaxHighlightingLanguage struct {
// Extensions description: Map of extension to language
Extensions map[string]string `json:"extensions,omitempty"`
// Patterns description: Map of patterns to language. Will return after first match, if any.
Patterns []*SyntaxHighlightingLanguagePatterns `json:"patterns,omitempty"`
}
type SyntaxHighlightingLanguagePatterns struct {
// Language description: Name of the language if pattern matches
Language string `json:"language"`
// Pattern description: Regular expression which matches the filepath
Pattern string `json:"pattern"`
}
// TlsExternal description: Global TLS/SSL settings for Sourcegraph to use when communicating with code hosts.
type TlsExternal struct {
// Certificates description: TLS certificates to accept. This is only necessary if you are using self-signed certificates or an internal CA. Can be an internal CA certificate or a self-signed certificate. To get the certificate of a webserver 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. NOTE: System Certificate Authorities are automatically included.
Certificates []string `json:"certificates,omitempty"`
// InsecureSkipVerify description: insecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
// If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks.
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}
// TransformChanges description: Optional transformations to apply to the changes produced in each repository.
type TransformChanges struct {
// Group description: A list of groups of changes in a repository that each create a separate, additional changeset for this repository, with all ungrouped changes being in the default changeset.
Group []*TransformChangesGroup `json:"group,omitempty"`
}
type TransformChangesGroup struct {
// Branch description: The branch on the repository to propose changes to. If unset, the repository's default branch is used.
Branch string `json:"branch"`
// Directory description: The directory path (relative to the repository root) of the changes to include in this group.
Directory string `json:"directory"`
// Repository description: Only apply this transformation in the repository with this name (as it is known to Sourcegraph).
Repository string `json:"repository,omitempty"`
}
type UpdateIntervalRule struct {
// Interval description: An integer representing the number of minutes to wait until the next update
Interval int `json:"interval"`
// Pattern description: A regular expression matching a repo name
Pattern string `json:"pattern"`
}
type UsernameIdentity struct {
Type string `json:"type"`
}
// VideoStep description: Video step
type VideoStep struct {
Type any `json:"type"`
Value string `json:"value"`
}
// WebhookLogging description: Configuration for logging incoming webhooks.
type WebhookLogging struct {
// Enabled description: Whether incoming webhooks are logged. If omitted, logging is enabled on sites without encryption. If one or more encryption keys are present, this setting must be enabled manually; as webhooks may contain sensitive data, admins of encrypted sites may want to enable webhook encryption via encryption.keys.webhookLogKey.
Enabled *bool `json:"enabled,omitempty"`
// Retention description: How long incoming webhooks are retained. The string format is that of the Duration type in the Go time package (https://golang.org/pkg/time/#ParseDuration). Values lower than 1 hour will be treated as 1 hour. By default, this is "72h", or three days.
Retention string `json:"retention,omitempty"`
}
// Webhooks description: DEPRECATED: Switch to "plugin.webhooks"
type Webhooks struct {
// Secret description: Secret for authenticating incoming webhook payloads
Secret string `json:"secret,omitempty"`
}
// WorkspaceConfiguration description: Configuration for how to setup workspaces in repositories
type WorkspaceConfiguration struct {
// In description: The repositories in which to apply the workspace configuration. Supports globbing.
In string `json:"in,omitempty"`
// OnlyFetchWorkspace description: If this is true only the files in the workspace (and additional .gitignore) are downloaded instead of an archive of the full repository.
OnlyFetchWorkspace bool `json:"onlyFetchWorkspace,omitempty"`
// RootAtLocationOf description: The name of the file that sits at the root of the desired workspace.
RootAtLocationOf string `json:"rootAtLocationOf"`
}