diff --git a/internal/completions/client/azureopenai/openai.go b/internal/completions/client/azureopenai/openai.go index 980a75616ef..7b6cc63b09a 100644 --- a/internal/completions/client/azureopenai/openai.go +++ b/internal/completions/client/azureopenai/openai.go @@ -30,7 +30,6 @@ var authProxyURL = os.Getenv("CODY_AZURE_OPENAI_IDENTITY_HTTP_PROXY") // it will acquire a short lived token and reusing the client // prevents acquiring a new token on every request. // The client will refresh the token as needed. - var apiClient completionsClient type completionsClient struct { @@ -123,10 +122,9 @@ type azureCompletionClient struct { func (c *azureCompletionClient) Complete( ctx context.Context, feature types.CompletionsFeature, - _ types.CompletionsVersion, + version types.CompletionsVersion, requestParams types.CompletionRequestParameters, ) (*types.CompletionResponse, error) { - switch feature { case types.CompletionsFeatureCode: return completeAutocomplete(ctx, c.client, requestParams) @@ -141,6 +139,35 @@ func completeAutocomplete( ctx context.Context, client CompletionsClient, requestParams types.CompletionRequestParameters, +) (*types.CompletionResponse, error) { + if requestParams.AzureUseDeprecatedCompletionsAPIForOldModels { + return doCompletionsAPIAutocomplete(ctx, client, requestParams) + } + return doChatCompletionsAPIAutocomplete(ctx, client, requestParams) +} + +func doChatCompletionsAPIAutocomplete( + ctx context.Context, + client CompletionsClient, + requestParams types.CompletionRequestParameters, +) (*types.CompletionResponse, error) { + response, err := client.GetChatCompletions(ctx, getChatOptions(requestParams), nil) + if err != nil { + return nil, toStatusCodeError(err) + } + if !hasValidFirstChatChoice(response.Choices) { + return &types.CompletionResponse{}, nil + } + return &types.CompletionResponse{ + Completion: *response.Choices[0].Delta.Content, + StopReason: string(*response.Choices[0].FinishReason), + }, nil +} + +func doCompletionsAPIAutocomplete( + ctx context.Context, + client CompletionsClient, + requestParams types.CompletionRequestParameters, ) (*types.CompletionResponse, error) { options, err := getCompletionsOptions(requestParams) if err != nil { @@ -150,7 +177,6 @@ func completeAutocomplete( if err != nil { return nil, toStatusCodeError(err) } - // Text and FinishReason are documented as REQUIRED but checking just to be safe if !hasValidFirstCompletionsChoice(response.Choices) { return &types.CompletionResponse{}, nil @@ -182,7 +208,7 @@ func completeChat( func (c *azureCompletionClient) Stream( ctx context.Context, feature types.CompletionsFeature, - _ types.CompletionsVersion, + version types.CompletionsVersion, requestParams types.CompletionRequestParameters, sendEvent types.SendCompletionEvent, ) error { @@ -201,6 +227,60 @@ func streamAutocomplete( client CompletionsClient, requestParams types.CompletionRequestParameters, sendEvent types.SendCompletionEvent, +) error { + if requestParams.AzureUseDeprecatedCompletionsAPIForOldModels { + return doStreamCompletionsAPI(ctx, client, requestParams, sendEvent) + } + return doStreamChatCompletionsAPI(ctx, client, requestParams, sendEvent) +} + +// Streaming with ChatCompletions API +func doStreamChatCompletionsAPI( + ctx context.Context, + client CompletionsClient, + requestParams types.CompletionRequestParameters, + sendEvent types.SendCompletionEvent, +) error { + resp, err := client.GetChatCompletionsStream(ctx, getChatOptions(requestParams), nil) + if err != nil { + return err + } + defer resp.ChatCompletionsStream.Close() + + var content string + for { + entry, err := resp.ChatCompletionsStream.Read() + if errors.Is(err, io.EOF) { + return nil + } + if err != nil { + return err + } + + if hasValidFirstChatChoice(entry.Choices) { + content += *entry.Choices[0].Delta.Content + finish := "" + if entry.Choices[0].FinishReason != nil { + finish = string(*entry.Choices[0].FinishReason) + } + ev := types.CompletionResponse{ + Completion: content, + StopReason: finish, + } + err := sendEvent(ev) + if err != nil { + return err + } + } + } +} + +// Streaming with Completions API +func doStreamCompletionsAPI( + ctx context.Context, + client CompletionsClient, + requestParams types.CompletionRequestParameters, + sendEvent types.SendCompletionEvent, ) error { options, err := getCompletionsOptions(requestParams) if err != nil { @@ -225,7 +305,6 @@ func streamAutocomplete( if err != nil { return err } - // hasValidFirstCompletionsChoice checks for a valid 1st choice which has text if hasValidFirstCompletionsChoice(entry.Choices) { content += *entry.Choices[0].Text @@ -261,6 +340,7 @@ func streamChat( // Azure sends incremental deltas for each message in a chat stream // build up the full message content over multiple responses var content string + for { entry, err := resp.ChatCompletionsStream.Read() // stream is done diff --git a/internal/completions/httpapi/handler.go b/internal/completions/httpapi/handler.go index 6a904d49f63..a68e5f0c893 100644 --- a/internal/completions/httpapi/handler.go +++ b/internal/completions/httpapi/handler.go @@ -105,6 +105,7 @@ func newCompletionsHandler( http.Error(w, err.Error(), http.StatusBadRequest) return } + requestParams.AzureUseDeprecatedCompletionsAPIForOldModels = completionsConfig.AzureUseDeprecatedCompletionsAPIForOldModels ctx, done := Trace(ctx, traceFamily, requestParams.Model, requestParams.MaxTokensToSample). WithErrorP(&err). diff --git a/internal/completions/types/types.go b/internal/completions/types/types.go index f428974b42c..11885e68254 100644 --- a/internal/completions/types/types.go +++ b/internal/completions/types/types.go @@ -48,21 +48,27 @@ type CodyCompletionRequestParameters struct { // that is faster (but probably "dumber"). Fast bool } +type CompletionRequest struct { + Feature CompletionsFeature + Version CompletionsVersion + Parameters CompletionRequestParameters +} type CompletionRequestParameters struct { // Prompt exists only for backwards compatibility. Do not use it in new // implementations. It will be removed once we are reasonably sure 99% // of VSCode extension installations are upgraded to a new Cody version. - Prompt string `json:"prompt"` - Messages []Message `json:"messages"` - MaxTokensToSample int `json:"maxTokensToSample,omitempty"` - Temperature float32 `json:"temperature,omitempty"` - StopSequences []string `json:"stopSequences,omitempty"` - TopK int `json:"topK,omitempty"` - TopP float32 `json:"topP,omitempty"` - Model string `json:"model,omitempty"` - Stream *bool `json:"stream,omitempty"` - Logprobs *uint8 `json:"logprobs"` + Prompt string `json:"prompt"` + Messages []Message `json:"messages"` + MaxTokensToSample int `json:"maxTokensToSample,omitempty"` + Temperature float32 `json:"temperature,omitempty"` + StopSequences []string `json:"stopSequences,omitempty"` + TopK int `json:"topK,omitempty"` + TopP float32 `json:"topP,omitempty"` + Model string `json:"model,omitempty"` + Stream *bool `json:"stream,omitempty"` + Logprobs *uint8 `json:"logprobs"` + AzureUseDeprecatedCompletionsAPIForOldModels bool `json:"azureUseDeprecatedCompletionsAPIForOldModels,omitempty"` } // IsStream returns whether a streaming response is requested. For backwards diff --git a/internal/conf/computed.go b/internal/conf/computed.go index 0f0f9a15e2b..6e24ec56e96 100644 --- a/internal/conf/computed.go +++ b/internal/conf/computed.go @@ -835,18 +835,19 @@ func GetCompletionsConfig(siteConfig schema.SiteConfiguration) (c *conftypes.Com } computedConfig := &conftypes.CompletionsConfig{ - Provider: conftypes.CompletionsProviderName(completionsConfig.Provider), - AccessToken: completionsConfig.AccessToken, - ChatModel: completionsConfig.ChatModel, - ChatModelMaxTokens: completionsConfig.ChatModelMaxTokens, - FastChatModel: completionsConfig.FastChatModel, - FastChatModelMaxTokens: completionsConfig.FastChatModelMaxTokens, - CompletionModel: completionsConfig.CompletionModel, - CompletionModelMaxTokens: completionsConfig.CompletionModelMaxTokens, - Endpoint: completionsConfig.Endpoint, - PerUserDailyLimit: completionsConfig.PerUserDailyLimit, - PerUserCodeCompletionsDailyLimit: completionsConfig.PerUserCodeCompletionsDailyLimit, - PerCommunityUserChatMonthlyLLMRequestLimit: completionsConfig.PerCommunityUserChatMonthlyLLMRequestLimit, + Provider: conftypes.CompletionsProviderName(completionsConfig.Provider), + AccessToken: completionsConfig.AccessToken, + ChatModel: completionsConfig.ChatModel, + ChatModelMaxTokens: completionsConfig.ChatModelMaxTokens, + FastChatModel: completionsConfig.FastChatModel, + FastChatModelMaxTokens: completionsConfig.FastChatModelMaxTokens, + AzureUseDeprecatedCompletionsAPIForOldModels: completionsConfig.AzureUseDeprecatedCompletionsAPIForOldModels, + CompletionModel: completionsConfig.CompletionModel, + CompletionModelMaxTokens: completionsConfig.CompletionModelMaxTokens, + Endpoint: completionsConfig.Endpoint, + PerUserDailyLimit: completionsConfig.PerUserDailyLimit, + PerUserCodeCompletionsDailyLimit: completionsConfig.PerUserCodeCompletionsDailyLimit, + PerCommunityUserChatMonthlyLLMRequestLimit: completionsConfig.PerCommunityUserChatMonthlyLLMRequestLimit, PerCommunityUserCodeCompletionsMonthlyLLMRequestLimit: completionsConfig.PerCommunityUserCodeCompletionsMonthlyLLMRequestLimit, PerProUserChatDailyLLMRequestLimit: completionsConfig.PerProUserChatDailyLLMRequestLimit, PerProUserCodeCompletionsDailyLLMRequestLimit: completionsConfig.PerProUserCodeCompletionsDailyLLMRequestLimit, diff --git a/internal/conf/conftypes/consts.go b/internal/conf/conftypes/consts.go index 68d0261e644..8674c7869df 100644 --- a/internal/conf/conftypes/consts.go +++ b/internal/conf/conftypes/consts.go @@ -12,6 +12,10 @@ type CompletionsConfig struct { CompletionModel string CompletionModelMaxTokens int + AzureCompletionModel string + AzureChatModel string + AzureUseDeprecatedCompletionsAPIForOldModels bool + AccessToken string Provider CompletionsProviderName Endpoint string diff --git a/schema/schema.go b/schema/schema.go index 865bd043702..b5224ed85f5 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -630,6 +630,8 @@ type CodyGateway struct { 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"` + // 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 recommed using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison ChatModel string `json:"chatModel,omitempty"` diff --git a/schema/site.schema.json b/schema/site.schema.json index 211d70a0cd5..144a17c23cc 100644 --- a/schema/site.schema.json +++ b/schema/site.schema.json @@ -24,13 +24,17 @@ "pointer": true }, "group": "Search", - "examples": [true] + "examples": [ + true + ] }, "search.index.shardConcurrency": { "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.", "type": "integer", "group": "Search", - "examples": ["10"] + "examples": [ + "10" + ] }, "search.largeFiles": { "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.", @@ -39,13 +43,21 @@ "type": "string" }, "group": "Search", - "examples": [["go.sum", "package-lock.json", "**/*.thrift"]] + "examples": [ + [ + "go.sum", + "package-lock.json", + "**/*.thrift" + ] + ] }, "debug.search.symbolsParallelism": { "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.", "type": "integer", "group": "Debug", - "examples": ["20"] + "examples": [ + "20" + ] }, "cloneProgress.log": { "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.", @@ -199,7 +211,10 @@ "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.", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "enabled" }, "passwordPolicy": { @@ -250,62 +265,92 @@ "structuralSearch": { "description": "Enables structural search.", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "perforce": { "description": "Allow adding Perforce code host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "enabled", "deprecationMessage": "Deprecated, Perforce is always enabled, setting is no longer used." }, "perforceChangelistMapping": { "description": "Allow mapping of Perforce changelists to their commit SHAs in the DB", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "goPackages": { "description": "Allow adding Go package host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "jvmPackages": { "description": "Allow adding JVM package host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "npmPackages": { "description": "Allow adding npm package code host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "pythonPackages": { "description": "Allow adding Python package code host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "rustPackages": { "description": "Allow adding Rust package code host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "rubyPackages": { "description": "Allow adding Ruby package host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "pagure": { "description": "Allow adding Pagure code host connections", "type": "string", - "enum": ["enabled", "disabled"], + "enum": [ + "enabled", + "disabled" + ], "default": "disabled" }, "subRepoPermissions": { @@ -347,7 +392,9 @@ "items": { "type": "string", "pattern": "^-----BEGIN CERTIFICATE-----\n", - "examples": ["-----BEGIN CERTIFICATE-----\n..."] + "examples": [ + "-----BEGIN CERTIFICATE-----\n..." + ] } } } @@ -360,7 +407,10 @@ "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": "object", "additionalProperties": false, - "required": ["domainPath", "fetch"], + "required": [ + "domainPath", + "fetch" + ], "properties": { "domainPath": { "description": "Git clone URL domain/path", @@ -393,10 +443,14 @@ "type": "object", "title": "SearchIndexRevisionsRule", "additionalProperties": false, - "required": ["revisions"], + "required": [ + "revisions" + ], "anyOf": [ { - "required": ["name"] + "required": [ + "name" + ] } ], "properties": { @@ -419,7 +473,11 @@ [ { "name": "^github.com/org/.*", - "revisions": ["3.17", "f6ca985c27486c2df5231ea3526caa4a4108ffb6", "v3.17.1"] + "revisions": [ + "3.17", + "f6ca985c27486c2df5231ea3526caa4a4108ffb6", + "v3.17.1" + ] } ] ] @@ -436,8 +494,14 @@ }, "examples": [ { - "github.com/sourcegraph/sourcegraph": ["3.17", "f6ca985c27486c2df5231ea3526caa4a4108ffb6", "v3.17.1"], - "name/of/repo": ["develop"] + "github.com/sourcegraph/sourcegraph": [ + "3.17", + "f6ca985c27486c2df5231ea3526caa4a4108ffb6", + "v3.17.1" + ], + "name/of/repo": [ + "develop" + ] } ] }, @@ -591,13 +655,18 @@ "languageDetection": { "description": "Setting for customizing language detection behavior", "type": "object", - "required": ["graphQL"], + "required": [ + "graphQL" + ], "additionalProperties": false, "properties": { "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.", "type": "string", - "enum": ["useFileContents", "useFileNamesOnly"], + "enum": [ + "useFileContents", + "useFileNamesOnly" + ], "default": "useFileContents" } } @@ -618,7 +687,9 @@ }, { "tls.external": { - "certificates": ["-----BEGIN CERTIFICATE-----\n..."], + "certificates": [ + "-----BEGIN CERTIFICATE-----\n..." + ], "insecureSkipVerify": true } } @@ -665,7 +736,9 @@ "items": { "title": "BatchChangeRolloutWindow", "type": "object", - "required": ["rate"], + "required": [ + "rate" + ], "additionalProperties": false, "properties": { "rate": { @@ -702,13 +775,18 @@ } }, "dependencies": { - "start": ["end"] + "start": [ + "end" + ] } }, "examples": [ { "rate": "10/hour", - "days": ["saturday", "sunday"], + "days": [ + "saturday", + "sunday" + ], "start": "06:00", "end": "20:00" } @@ -724,7 +802,11 @@ "description": "How long changesets will be retained after they have been detached from a batch change.", "type": "string", "group": "BatchChanges", - "examples": ["336h", "48h", "5h30m40s"] + "examples": [ + "336h", + "48h", + "5h30m40s" + ] }, "codeIntelAutoIndexing.enabled": { "description": "Enables/disables the code intel auto-indexing feature. Currently experimental.", @@ -790,13 +872,17 @@ "description": "An arbitrary identifier used to group calculated rankings from SCIP data (including the SCIP export).", "type": "string", "group": "Code intelligence", - "examples": ["dev"] + "examples": [ + "dev" + ] }, "codeIntelRanking.documentReferenceCountsDerivativeGraphKeyPrefix": { "description": "An arbitrary identifier used to group calculated rankings from SCIP data (excluding the SCIP export).", "type": "string", "group": "Code intelligence", - "examples": [""] + "examples": [ + "" + ] }, "codeIntelRanking.staleResultsAge": { "description": "The interval at which to run the reduce job that computes document reference counts. Default is 24hrs.", @@ -807,7 +893,9 @@ "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.", "type": "string", - "examples": ["https://my-phabricator.example.com https://my-bitbucket.example.com https://my-gitlab.example.com"], + "examples": [ + "https://my-phabricator.example.com https://my-bitbucket.example.com https://my-gitlab.example.com" + ], "pattern": "^((https?:\\/\\/[\\w-\\.]+)( https?:\\/\\/[\\w-\\.]+)*)|\\*$", "group": "Security" }, @@ -847,7 +935,10 @@ "items": { "title": "UpdateIntervalRule", "type": "object", - "required": ["pattern", "interval"], + "required": [ + "pattern", + "interval" + ], "additionalProperties": false, "properties": { "pattern": { @@ -880,7 +971,9 @@ "description": "DEPRECATED! Disable redirects to sourcegraph.com when visiting public repositories that can't exist on this server.", "type": "boolean", "group": "External services", - "examples": [true], + "examples": [ + true + ], "deprecationMessage": "Deprecated because it's no longer supported and hasn't been working for a while." }, "git.cloneURLToRepositoryName": { @@ -891,7 +984,10 @@ "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\\w+)$\" and `to` is \"github.com/user/{name}\", the clone URL \"../myRepository\" would be mapped to the repository name \"github.com/user/myRepository\".", "type": "object", "additionalProperties": false, - "required": ["from", "to"], + "required": [ + "from", + "to" + ], "properties": { "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.", @@ -938,24 +1034,37 @@ "title": "SyntaxHighlighting", "description": "Syntax highlighting configuration", "type": "object", - "required": ["engine", "languages"], + "required": [ + "engine", + "languages" + ], "properties": { "engine": { "title": "SyntaxHighlightingEngine", "type": "object", - "required": ["default"], + "required": [ + "default" + ], "properties": { "default": { "description": "The default syntax highlighting engine to use", "type": "string", - "enum": ["tree-sitter", "syntect", "scip-syntax"] + "enum": [ + "tree-sitter", + "syntect", + "scip-syntax" + ] }, "overrides": { "description": "Manually specify overrides for syntax highlighting engine per language", "type": "object", "additionalProperties": { "type": "string", - "enum": ["tree-sitter", "syntect", "scip-syntax"] + "enum": [ + "tree-sitter", + "syntect", + "scip-syntax" + ] } } } @@ -963,7 +1072,10 @@ "languages": { "title": "SyntaxHighlightingLanguage", "type": "object", - "required": ["extensions", "patterns"], + "required": [ + "extensions", + "patterns" + ], "properties": { "extensions": { "description": "Map of extension to language", @@ -978,7 +1090,10 @@ "items": { "title": "SyntaxHighlightingLanguagePatterns", "type": "object", - "required": ["pattern", "language"], + "required": [ + "pattern", + "language" + ], "properties": { "pattern": { "description": "Regular expression which matches the filepath", @@ -998,14 +1113,20 @@ "title": "SymbolConfiguration", "description": "Configure symbol generation", "type": "object", - "required": ["engine"], + "required": [ + "engine" + ], "properties": { "engine": { "description": "Manually specify overrides for symbol generation engine per language", "type": "object", "additionalProperties": { "type": "string", - "enum": ["universal-ctags", "scip-ctags", "off"] + "enum": [ + "universal-ctags", + "scip-ctags", + "off" + ] } } } @@ -1078,7 +1199,10 @@ }, "scim.identityProvider": { "type": "string", - "enum": ["STANDARD", "Azure AD"], + "enum": [ + "STANDARD", + "Azure AD" + ], "description": "Identity provider used for SCIM support. \"STANDARD\" should be used unless a more specific value is available", "default": "STANDARD", "group": "External services" @@ -1153,7 +1277,11 @@ "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).", "type": "string", - "enum": ["all-users-create", "site-admin-create", "none"], + "enum": [ + "all-users-create", + "site-admin-create", + "none" + ], "default": "all-users-create" }, "allowNoExpiration": { @@ -1167,13 +1295,27 @@ "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.", "type": "array", - "default": [7, 14, 30, 60, 90], + "default": [ + 7, + 14, + 30, + 60, + 90 + ], "items": { "type": "integer", "maximum": 365, "minimum": 1 }, - "examples": [[7, 14, 30, 60, 90]] + "examples": [ + [ + 7, + 14, + 30, + 60, + 90 + ] + ] }, "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", @@ -1199,20 +1341,38 @@ "default": { "allow": "all-users-create", "allowNoExpiration": false, - "expirationOptionDays": [7, 14, 30, 60, 90], + "expirationOptionDays": [ + 7, + 14, + 30, + 60, + 90 + ], "defaultExpirationDays": 90 }, "examples": [ { "allow": "site-admin-create", "allowNoExpiration": true, - "expirationOptionDays": [7, 14, 30, 60, 90], + "expirationOptionDays": [ + 7, + 14, + 30, + 60, + 90 + ], "defaultExpirationDays": 90 }, { "allow": "none", "allowNoExpiration": false, - "expirationOptionDays": [7, 14, 30, 60, 90], + "expirationOptionDays": [ + 7, + 14, + 30, + 60, + 90 + ], "defaultExpirationDays": 45 } ], @@ -1233,7 +1393,10 @@ "items": { "type": "string" }, - "examples": ["100.100.100.0/25", "23.34.56.21"] + "examples": [ + "100.100.100.0/25", + "23.34.56.21" + ] }, "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.", @@ -1241,7 +1404,10 @@ "items": { "type": "string" }, - "examples": ["100.100.100.0/25", "23.34.56.21"] + "examples": [ + "100.100.100.0/25", + "23.34.56.21" + ] }, "userIpAddress": { "description": "List of user IP addresses to allow. If empty, all IP addresses are allowed.", @@ -1249,7 +1415,10 @@ "items": { "type": "string" }, - "examples": ["100.100.100.0/25", "23.34.56.21"] + "examples": [ + "100.100.100.0/25", + "23.34.56.21" + ] }, "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.", @@ -1257,7 +1426,11 @@ "items": { "type": "string" }, - "examples": ["X-Forwarded-For", "X-Real-IP", "CF-Connecting-IP"] + "examples": [ + "X-Forwarded-For", + "X-Real-IP", + "CF-Connecting-IP" + ] }, "errorMessageTemplate": { "description": "A template to customize the error message display to users on unauthorized access. Available template variables: `{{.Error}}`, `{{.UserIP}}`", @@ -1294,7 +1467,10 @@ "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.", "type": "string", - "enum": ["email", "username"], + "enum": [ + "email", + "username" + ], "default": "email" } }, @@ -1410,7 +1586,11 @@ "description": "The SMTP server used to send transactional emails.\nPlease see https://sourcegraph.com/docs/admin/config/email", "type": "object", "additionalProperties": false, - "required": ["host", "port", "authentication"], + "required": [ + "host", + "port", + "authentication" + ], "properties": { "host": { "description": "The SMTP server host.", @@ -1431,7 +1611,11 @@ "authentication": { "description": "The type of authentication to use for the SMTP server.", "type": "string", - "enum": ["none", "PLAIN", "CRAM-MD5"] + "enum": [ + "none", + "PLAIN", + "CRAM-MD5" + ] }, "domain": { "description": "The HELO domain to provide to the SMTP server (if needed).", @@ -1447,7 +1631,10 @@ "items": { "title": "Header", "type": "object", - "required": ["key", "value"], + "required": [ + "key", + "value" + ], "additionalProperties": false, "properties": { "key": { @@ -1486,14 +1673,19 @@ "type": "string", "format": "email", "group": "Email", - "examples": ["noreply@sourcegraph.example.com"] + "examples": [ + "noreply@sourcegraph.example.com" + ] }, "email.senderName": { "description": "The name to use in the \"from\" address for emails sent by this server.", "type": "string", "group": "Email", "default": "Sourcegraph", - "examples": ["Our Company Sourcegraph", "Example Inc Sourcegraph"] + "examples": [ + "Our Company Sourcegraph", + "Example Inc Sourcegraph" + ] }, "email.templates": { "description": "Configurable templates for some email types sent by Sourcegraph.", @@ -1525,7 +1717,9 @@ "executors.frontendURL": { "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.", "type": "string", - "examples": ["https://sourcegraph.example.com"] + "examples": [ + "https://sourcegraph.example.com" + ] }, "executors.srcCLIImage": { "description": "The image to use for src-cli in executors. Use this value to pull from a custom image registry.", @@ -1535,12 +1729,16 @@ "executors.srcCLIImageTag": { "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.", "type": "string", - "examples": ["4.1.0"] + "examples": [ + "4.1.0" + ] }, "executors.lsifGoImage": { "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.", "type": "string", - "examples": ["sourcegraph/lsif-go"] + "examples": [ + "sourcegraph/lsif-go" + ] }, "executors.batcheshelperImage": { "description": "The image to use for batch changes in executors. Use this value to pull from a custom image registry.", @@ -1550,13 +1748,17 @@ "executors.batcheshelperImageTag": { "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.", "type": "string", - "examples": ["4.1.0"] + "examples": [ + "4.1.0" + ] }, "executors.accessToken": { "description": "The shared secret between Sourcegraph and executors. The value must contain at least 20 characters.", "type": "string", "pattern": "^(.{20,}|REDACTED)$", - "examples": ["my-super-secret-access-token"] + "examples": [ + "my-super-secret-access-token" + ] }, "executors.multiqueue": { "description": "The configuration for multiqueue executors.", @@ -1569,7 +1771,10 @@ "batches": { "description": "The configuration for the batches queue.", "type": "object", - "required": ["limit", "weight"], + "required": [ + "limit", + "weight" + ], "properties": { "limit": { "description": "The maximum number of dequeues allowed within the expiration window.", @@ -1586,7 +1791,10 @@ "codeintel": { "description": "The configuration for the codeintel queue.", "type": "object", - "required": ["limit", "weight"], + "required": [ + "limit", + "weight" + ], "properties": { "limit": { "description": "The maximum number of dequeues allowed within the expiration window.", @@ -1615,7 +1823,9 @@ }, "examples": [ { - "*": ["myorg1"] + "*": [ + "myorg1" + ] } ], "hide": true @@ -1680,10 +1890,19 @@ "deprecationMessage": "No effect, audit logs are always set to SRC_LOG_LEVEL", "description": "DEPRECATED: No effect, audit logs are always set to SRC_LOG_LEVEL", "type": "string", - "enum": ["DEBUG", "INFO", "WARN", "ERROR"] + "enum": [ + "DEBUG", + "INFO", + "WARN", + "ERROR" + ] } }, - "required": ["internalTraffic", "graphQL", "gitserverAccess"], + "required": [ + "internalTraffic", + "graphQL", + "gitserverAccess" + ], "examples": [ { "internalTraffic": false, @@ -1700,7 +1919,12 @@ "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", "type": "string", - "enum": ["none", "auditlog", "database", "all"], + "enum": [ + "none", + "auditlog", + "database", + "all" + ], "default": "auditlog" } }, @@ -1715,7 +1939,9 @@ "externalURL": { "description": "The externally accessible URL for Sourcegraph (i.e., what you type into your browser). Previously called `appURL`. Only root URLs are allowed.", "type": "string", - "examples": ["https://sourcegraph.example.com"] + "examples": [ + "https://sourcegraph.example.com" + ] }, "observability.client": { "description": "EXPERIMENTAL: Configuration for client observability", @@ -1729,7 +1955,10 @@ "endpoint": { "description": "OpenTelemetry tracing collector endpoint. By default, Sourcegraph's \"/-/debug/otlp\" endpoint forwards data to the configured collector backend.", "type": "string", - "examples": ["/-/debug/otlp", "https://COLLECTOR_ENDPOINT"], + "examples": [ + "/-/debug/otlp", + "https://COLLECTOR_ENDPOINT" + ], "default": "/-/debug/otlp" } } @@ -1755,13 +1984,20 @@ "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 ", "type": "string", - "enum": ["selective", "all", "none"], + "enum": [ + "selective", + "all", + "none" + ], "default": "selective" }, "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", - "enum": ["opentelemetry", "jaeger"], + "enum": [ + "opentelemetry", + "jaeger" + ], "default": "opentelemetry" }, "debug": { @@ -1800,19 +2036,31 @@ "type": "array", "items": { "type": "object", - "required": ["level", "notifier"], + "required": [ + "level", + "notifier" + ], "properties": { "level": { "description": "Sourcegraph alert level to subscribe to notifications for.", "type": "string", - "enum": ["warning", "critical"] + "enum": [ + "warning", + "critical" + ] }, "notifier": { "type": "object", "properties": { "type": { "type": "string", - "enum": ["slack", "pagerduty", "webhook", "email", "opsgenie"] + "enum": [ + "slack", + "pagerduty", + "webhook", + "email", + "opsgenie" + ] } }, "oneOf": [ @@ -1869,7 +2117,9 @@ "level": "warning", "notifier": { "type": "email", - "addresses": ["alerts@example.com"] + "addresses": [ + "alerts@example.com" + ] } } ] @@ -1880,25 +2130,39 @@ "items": { "type": "string" }, - "examples": [["warning_gitserver_disk_space_remaining"], ["critical_frontend_down", "warning_high_load"]] + "examples": [ + [ + "warning_gitserver_disk_space_remaining" + ], + [ + "critical_frontend_down", + "warning_high_load" + ] + ] }, "observability.logSlowSearches": { "description": "(debug) logs all search queries (issued by users, code intelligence, or API requests) slower than the specified number of milliseconds.", "type": "integer", "group": "Debug", - "examples": [10000] + "examples": [ + 10000 + ] }, "observability.logSlowGraphQLRequests": { "description": "(debug) logs all GraphQL requests slower than the specified number of milliseconds.", "type": "integer", "group": "Debug", - "examples": [10000] + "examples": [ + 10000 + ] }, "observability.captureSlowGraphQLRequestsLimit": { "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.", "type": "integer", "group": "Debug", - "examples": [2000] + "examples": [ + 2000 + ] }, "insights.backfill.interruptAfter": { "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.", @@ -1925,14 +2189,19 @@ "type": "integer", "group": "CodeInsights", "default": 1, - "examples": [10] + "examples": [ + 10 + ] }, "insights.query.worker.rateLimit": { "description": "Maximum number of Code Insights queries initiated per second on a worker node.", "type": "number", "group": "CodeInsights", "default": 20, - "examples": [10.0, 0.5], + "examples": [ + 10.0, + 0.5 + ], "!go": { "pointer": true } @@ -1942,14 +2211,20 @@ "type": "integer", "group": "CodeInsights", "default": 20, - "examples": [10, 20] + "examples": [ + 10, + 20 + ] }, "insights.historical.worker.rateLimit": { "description": "Maximum number of historical Code Insights data frames that may be analyzed per second.", "type": "number", "group": "CodeInsights", "default": 20, - "examples": [50.0, 0.5], + "examples": [ + 50.0, + 0.5 + ], "!go": { "pointer": true } @@ -1959,7 +2234,10 @@ "type": "integer", "group": "CodeInsights", "default": 20, - "examples": [10, 20] + "examples": [ + 10, + 20 + ] }, "insights.aggregations.bufferSize": { "description": "The size of the buffer for aggregations ran in-memory. A higher limit might strain memory for the frontend", @@ -1979,7 +2257,11 @@ "group": "CodeInsights", "default": 30, "maximum": 90, - "examples": [12, 24, 50] + "examples": [ + 12, + 24, + 50 + ] }, "own.bestEffortTeamMatching": { "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.", @@ -2092,14 +2374,29 @@ "items": { "type": "string" }, - "default": ["show", "rev-parse", "log", "diff", "ls-tree"] + "default": [ + "show", + "rev-parse", + "log", + "diff", + "ls-tree" + ] } }, "examples": [ { "size": 1000, - "repos": ["github.com/sourcegraph/sourcegraph", "github.com/gorilla/mux"], - "ignoredGitCommands": ["show", "rev-parse", "log", "diff", "ls-tree"] + "repos": [ + "github.com/sourcegraph/sourcegraph", + "github.com/gorilla/mux" + ], + "ignoredGitCommands": [ + "show", + "rev-parse", + "log", + "diff", + "ls-tree" + ] } ] }, @@ -2165,7 +2462,10 @@ "srcCliVersionCache": { "description": "Configuration related to the src-cli version cache. This should only be used on sourcegraph.com.", "type": "object", - "required": ["enabled", "github"], + "required": [ + "enabled", + "github" + ], "group": "Sourcegraph.com", "properties": { "enabled": { @@ -2176,7 +2476,10 @@ "github": { "description": "GitHub configuration, both for queries and receiving release webhooks.", "type": "object", - "required": ["token", "webhookSecret"], + "required": [ + "token", + "webhookSecret" + ], "properties": { "repository": { "description": "The repository to get the latest version of.", @@ -2243,7 +2546,10 @@ "type": "array", "items": { "type": "object", - "required": ["key", "message"], + "required": [ + "key", + "message" + ], "properties": { "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.", @@ -2268,7 +2574,9 @@ "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).", "type": "array", "items": { - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -2336,7 +2644,9 @@ "type": "string", "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.\n\nThe 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.\n\nNote: 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:\n\n* For deployments using `sourcegraph/server`: `docker exec $CONTAINER_ID redis-cli --raw keys 'session_*' | xargs docker exec $CONTAINER_ID redis-cli del`\n* For cluster deployments: \n ```\n REDIS_POD=\"$(kubectl get pods -l app=redis-store -o jsonpath={.items[0].metadata.name})\";\n kubectl exec \"$REDIS_POD\" -- redis-cli --raw keys 'session_*' | xargs kubectl exec \"$REDIS_POD\" -- redis-cli --raw del;\n ```\n", "default": "2160h", - "examples": ["168h"], + "examples": [ + "168h" + ], "group": "Authentication" }, "auth.enableUsernameChanges": { @@ -2431,10 +2741,17 @@ }, "update.channel": { "description": "The channel on which to automatically check for Sourcegraph updates.", - "type": ["string"], - "enum": ["release", "none"], + "type": [ + "string" + ], + "enum": [ + "release", + "none" + ], "default": "release", - "examples": ["none"], + "examples": [ + "none" + ], "group": "Misc." }, "productResearchPage.enabled": { @@ -2537,12 +2854,16 @@ "!go": { "pointer": true }, - "examples": [true] + "examples": [ + true + ] }, "organizationInvitations": { "description": "Configuration for organization invitations.", "type": "object", - "required": ["signingKey"], + "required": [ + "signingKey" + ], "properties": { "expiryTime": { "description": "Time before the invitation expires, in hours (experimental, not enforced at the moment).", @@ -2617,7 +2938,11 @@ "provider": { "type": "string", "description": "The provider to use for generating embeddings. Defaults to sourcegraph.", - "enum": ["openai", "azure-openai", "sourcegraph"] + "enum": [ + "openai", + "azure-openai", + "sourcegraph" + ] }, "endpoint": { "type": "string", @@ -2669,7 +2994,13 @@ "items": { "type": "string" }, - "examples": ["*.go", "*.ts", "*.md", "src/", "cmd/"] + "examples": [ + "*.go", + "*.ts", + "*.md", + "src/", + "cmd/" + ] }, "maxFileSizeBytes": { "description": "The maximum file size (in bytes) to include in embeddings. Must be between 0 and 100000 (1 MB).", @@ -2856,7 +3187,11 @@ "model": "text-embedding-ada-002", "accessToken": "your-access-token", "url": "https://api.openai.com/v1/embeddings", - "excludedFilePathPatterns": ["*.svg", "**/__mocks__/**", "**/test/**"] + "excludedFilePathPatterns": [ + "*.svg", + "**/__mocks__/**", + "**/test/**" + ] } ] }, @@ -2880,9 +3215,17 @@ "description": "The model used for fast chat completions. \n 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 recommed using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison ", "type": "string", "not": { - "enum": ["claude-2", "claude-instant-1"] + "enum": [ + "claude-2", + "claude-instant-1" + ] } }, + "azureUseDeprecatedCompletionsAPIForOldModels": { + "description": "Enables the use of the older completions API for select Azure OpenAI models.", + "type": "boolean", + "default": false + }, "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.", "type": "integer" @@ -2891,7 +3234,10 @@ "description": "The model used for chat completions. If using the default provider 'sourcegraph', a reasonable default model will be set.\n 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 recommed using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison ", "type": "string", "not": { - "enum": ["claude-2", "claude-instant-1"] + "enum": [ + "claude-2", + "claude-instant-1" + ] }, "errorMessage": "The substring 'cumber' is not allowed because it is a bad idea and may lead to unexpected issues." }, @@ -2903,7 +3249,10 @@ "description": "The model used for code completion. If using the default provider 'sourcegraph', a reasonable default model will be set.\n 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 recommed using a specific model identifier as specified here https://docs.anthropic.com/claude/docs/models-overview#model-comparison ", "type": "string", "not": { - "enum": ["claude-2", "claude-instant-1"] + "enum": [ + "claude-2", + "claude-instant-1" + ] } }, "completionModelMaxTokens": { @@ -2918,7 +3267,14 @@ "type": "string", "description": "The external completions provider. Defaults to 'sourcegraph'.", "default": "sourcegraph", - "enum": ["anthropic", "openai", "sourcegraph", "azure-openai", "aws-bedrock", "fireworks"] + "enum": [ + "anthropic", + "openai", + "sourcegraph", + "azure-openai", + "aws-bedrock", + "fireworks" + ] }, "endpoint": { "type": "string", @@ -3054,7 +3410,9 @@ "description": "Configures the builtin username-password authentication provider.", "type": "object", "additionalProperties": false, - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -3071,7 +3429,12 @@ "description": "Configures the OpenID Connect authentication provider for SSO.", "type": "object", "additionalProperties": false, - "required": ["type", "issuer", "clientID", "clientSecret"], + "required": [ + "type", + "issuer", + "clientID", + "clientSecret" + ], "properties": { "type": { "type": "string", @@ -3138,11 +3501,20 @@ "description": "Configures the SAML authentication provider for SSO.\n\nNote: if you are using IdP-initiated login, you must have *at most one* SAMLAuthProvider in the `auth.providers` array.", "type": "object", "additionalProperties": false, - "required": ["type"], + "required": [ + "type" + ], "dependencies": { - "serviceProviderCertificate": ["serviceProviderPrivateKey"], - "serviceProviderPrivateKey": ["serviceProviderCertificate"], - "signRequests": ["serviceProviderCertificate", "serviceProviderPrivateKey"] + "serviceProviderCertificate": [ + "serviceProviderPrivateKey" + ], + "serviceProviderPrivateKey": [ + "serviceProviderCertificate" + ], + "signRequests": [ + "serviceProviderCertificate", + "serviceProviderPrivateKey" + ] }, "properties": { "type": { @@ -3264,7 +3636,10 @@ "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": "object", "additionalProperties": false, - "required": ["type", "usernameHeader"], + "required": [ + "type", + "usernameHeader" + ], "properties": { "type": { "type": "string", @@ -3273,17 +3648,23 @@ "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.", "type": "string", - "examples": ["X-Forwarded-User"] + "examples": [ + "X-Forwarded-User" + ] }, "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:`.", "type": "string", - "examples": ["accounts.google.com:"] + "examples": [ + "accounts.google.com:" + ] }, "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.", "type": "string", - "examples": ["X-App-Email"] + "examples": [ + "X-App-Email" + ] } } }, @@ -3291,7 +3672,11 @@ "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": "object", "additionalProperties": false, - "required": ["type", "clientID", "clientSecret"], + "required": [ + "type", + "clientID", + "clientSecret" + ], "properties": { "type": { "type": "string", @@ -3354,8 +3739,13 @@ }, "examples": [ { - "orgName": ["team1"], - "anotherOrgName": ["team2", "team3"] + "orgName": [ + "team1" + ], + "anotherOrgName": [ + "team2", + "team3" + ] } ] }, @@ -3370,7 +3760,11 @@ "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": "object", "additionalProperties": false, - "required": ["type", "clientID", "clientSecret"], + "required": [ + "type", + "clientID", + "clientSecret" + ], "properties": { "type": { "type": "string", @@ -3416,7 +3810,10 @@ "type": "string", "description": "The OAuth API scope that should be used", "default": "api", - "enum": ["api", "read_api"] + "enum": [ + "api", + "read_api" + ] }, "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.", @@ -3434,7 +3831,13 @@ "type": "string", "minLength": 1 }, - "examples": [["group", "group/subgroup", "group/subgroup/subgroup"]] + "examples": [ + [ + "group", + "group/subgroup", + "group/subgroup/subgroup" + ] + ] }, "tokenRefreshWindowMinutes": { "description": "Time in minutes before token expiry when we should attempt to refresh it", @@ -3455,7 +3858,11 @@ "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": "object", "additionalProperties": false, - "required": ["type", "clientKey", "clientSecret"], + "required": [ + "type", + "clientKey", + "clientSecret" + ], "properties": { "type": { "type": "string", @@ -3496,7 +3903,11 @@ "type": "string", "description": "The OAuth API scope that should be used", "default": "account,email,repository", - "enum": ["account", "email", "repository"] + "enum": [ + "account", + "email", + "repository" + ] }, "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.", @@ -3509,7 +3920,10 @@ "description": "Gerrit auth provider", "type": "object", "additionalProperties": false, - "required": ["type", "url"], + "required": [ + "type", + "url" + ], "properties": { "type": { "type": "string", @@ -3541,7 +3955,11 @@ "description": "Azure auth provider for dev.azure.com", "type": "object", "additionalProperties": false, - "required": ["type", "clientID", "clientSecret"], + "required": [ + "type", + "clientID", + "clientSecret" + ], "properties": { "type": { "type": "string", @@ -3634,7 +4052,9 @@ "NotifierSlack": { "description": "Slack notifier", "type": "object", - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -3665,7 +4085,10 @@ "NotifierPagerduty": { "description": "PagerDuty notifier", "type": "object", - "required": ["type", "integrationKey"], + "required": [ + "type", + "integrationKey" + ], "properties": { "type": { "type": "string", @@ -3687,7 +4110,10 @@ "NotifierWebhook": { "description": "Webhook notifier", "type": "object", - "required": ["type", "url"], + "required": [ + "type", + "url" + ], "properties": { "type": { "type": "string", @@ -3710,7 +4136,10 @@ "NotifierEmail": { "description": "Email notifier", "type": "object", - "required": ["type", "address"], + "required": [ + "type", + "address" + ], "properties": { "type": { "type": "string", @@ -3725,7 +4154,9 @@ "NotifierOpsGenie": { "description": "OpsGenie notifier", "type": "object", - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -3753,7 +4184,12 @@ "properties": { "type": { "type": "string", - "enum": ["team", "user", "escalation", "schedule"] + "enum": [ + "team", + "user", + "escalation", + "schedule" + ] }, "id": { "type": "string" @@ -3767,13 +4203,22 @@ }, "oneOf": [ { - "required": ["type", "id"] + "required": [ + "type", + "id" + ] }, { - "required": ["type", "name"] + "required": [ + "type", + "name" + ] }, { - "required": ["type", "username"] + "required": [ + "type", + "username" + ] } ] } @@ -3783,11 +4228,18 @@ "EncryptionKey": { "description": "Config for a key", "type": "object", - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "type": "string", - "enum": ["cloudkms", "awskms", "mounted", "noop"] + "enum": [ + "cloudkms", + "awskms", + "mounted", + "noop" + ] } }, "oneOf": [ @@ -3811,7 +4263,10 @@ "CloudKMSEncryptionKey": { "description": "Google Cloud KMS Encryption Key, used to encrypt data in Google Cloud environments", "type": "object", - "required": ["type", "keyname"], + "required": [ + "type", + "keyname" + ], "properties": { "type": { "type": "string", @@ -3828,7 +4283,10 @@ "AWSKMSEncryptionKey": { "description": "AWS KMS Encryption Key, used to encrypt data in AWS environments", "type": "object", - "required": ["type", "keyId"], + "required": [ + "type", + "keyId" + ], "properties": { "type": { "type": "string", @@ -3848,7 +4306,10 @@ "MountedEncryptionKey": { "description": "This encryption key is mounted from a given file path or an environment variable.", "type": "object", - "required": ["type", "keyname"], + "required": [ + "type", + "keyname" + ], "properties": { "type": { "type": "string", @@ -3871,7 +4332,9 @@ "NoOpEncryptionKey": { "description": "This encryption key is a no op, leaving your data in plaintext (not recommended).", "type": "object", - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -3881,7 +4344,10 @@ }, "EmailTemplate": { "type": "object", - "required": ["subject", "html"], + "required": [ + "subject", + "html" + ], "properties": { "subject": { "description": "Template for email subject header",