Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit e100408

Browse files
authored
Remove externalServiceUserMode configuration (#57445)
Those services are no longer supported, just removing some more leftovers of that.
1 parent 539a5e2 commit e100408

File tree

9 files changed

+0
-52
lines changed

9 files changed

+0
-52
lines changed

client/branded/src/search-ui/input/SearchBox.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ export interface SearchBoxProps
4646
/** Don't show search help button */
4747
hideHelpButton?: boolean
4848

49-
/** Set in JSContext only available to the web app. */
50-
isExternalServicesUserModeAll?: boolean
51-
5249
/** Called with the underlying editor instance on creation. */
5350
onEditorCreated?: (editor: IEditor) => void
5451

client/jetbrains/webview/src/search/input/JetBrainsSearchBox.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ export interface JetBrainsSearchBoxProps
4646
/** Don't show search help button */
4747
hideHelpButton?: boolean
4848

49-
/** Set in JSContext only available to the web app. */
50-
isExternalServicesUserModeAll?: boolean
51-
5249
/** Called with the underlying editor instance on creation. */
5350
onEditorCreated?: (editor: IEditor) => void
5451
}

client/web/dev/utils/create-js-context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const createJsContext = ({ sourcegraphBaseUrl }: { sourcegraphBaseUrl: st
3737
codeIntelAutoIndexingEnabled: false,
3838
codeIntelAutoIndexingAllowGlobalPolicies: false,
3939
codeInsightsEnabled: true,
40-
externalServicesUserMode: 'public',
4140
productResearchPageEnabled: true,
4241
assetsRoot: '/.assets',
4342
deployType: 'dev',

client/web/src/integration/jscontext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const createJsContext = ({ sourcegraphBaseUrl }: { sourcegraphBaseUrl: st
3232
extsvcConfigFileExists: false,
3333
codeIntelAutoIndexingEnabled: true,
3434
codeIntelAutoIndexingAllowGlobalPolicies: true,
35-
externalServicesUserMode: 'disabled',
3635
productResearchPageEnabled: true,
3736
assetsRoot: new URL('/.assets', sourcegraphBaseUrl).href,
3837
deployType: 'dev',

client/web/src/jscontext.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ export interface SourcegraphContext extends Pick<Required<SiteConfiguration>, 'e
206206
*/
207207
srcServeGitUrl: string
208208

209-
/** Whether users are allowed to add their own code and at what permission level. */
210-
externalServicesUserMode: 'disabled' | 'public' | 'all' | 'unknown'
211-
212209
/** Authentication provider instances in site config. */
213210
authProviders: AuthProvider[]
214211

client/web/src/search/input/SearchNavbarItem.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ export const SearchNavbarItem: React.FunctionComponent<React.PropsWithChildren<P
139139
onSubmit={onSubmit}
140140
submitSearchOnToggle={submitSearchOnChange}
141141
submitSearchOnSearchContextChange={submitSearchOnChange}
142-
isExternalServicesUserModeAll={window.context.externalServicesUserMode === 'all'}
143142
structuralSearchDisabled={window.context?.experimentalFeatures?.structuralSearch === 'disabled'}
144143
hideHelpButton={false}
145144
showSearchHistory={true}

client/web/src/storm/pages/SearchPage/SearchPageInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ export const SearchPageInput: FC<SearchPageInputProps> = props => {
183183
onChange={setQueryState}
184184
onSubmit={onSubmit}
185185
autoFocus={!isTouchOnlyDevice}
186-
isExternalServicesUserModeAll={window.context.externalServicesUserMode === 'all'}
187186
structuralSearchDisabled={window.context?.experimentalFeatures?.structuralSearch === 'disabled'}
188187
showSearchHistory={true}
189188
recentSearches={recentSearches}

cmd/frontend/internal/app/jscontext/jscontext.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ type JSContext struct {
161161

162162
ResetPasswordEnabled bool `json:"resetPasswordEnabled"`
163163

164-
ExternalServicesUserMode string `json:"externalServicesUserMode"`
165-
166164
AuthMinPasswordLength int `json:"authMinPasswordLength"`
167165
AuthPasswordPolicy authPasswordPolicy `json:"authPasswordPolicy"`
168166

@@ -357,8 +355,6 @@ func NewJSContextFromRequest(req *http.Request, db database.DB) JSContext {
357355

358356
ResetPasswordEnabled: userpasswd.ResetPasswordEnabled(),
359357

360-
ExternalServicesUserMode: conf.ExternalServiceUserMode().String(),
361-
362358
AllowSignup: conf.AuthAllowSignup(),
363359

364360
AuthMinPasswordLength: conf.AuthMinPasswordLength(),

internal/conf/computed.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -497,41 +497,6 @@ func AuthLockout() *schema.AuthLockout {
497497
return val
498498
}
499499

500-
type ExternalServiceMode int
501-
502-
const (
503-
ExternalServiceModeDisabled ExternalServiceMode = 0
504-
ExternalServiceModePublic ExternalServiceMode = 1
505-
ExternalServiceModeAll ExternalServiceMode = 2
506-
)
507-
508-
func (e ExternalServiceMode) String() string {
509-
switch e {
510-
case ExternalServiceModeDisabled:
511-
return "disabled"
512-
case ExternalServiceModePublic:
513-
return "public"
514-
case ExternalServiceModeAll:
515-
return "all"
516-
default:
517-
return "unknown"
518-
}
519-
}
520-
521-
// ExternalServiceUserMode returns the site level mode describing if users are
522-
// allowed to add external services for public and private repositories. It does
523-
// NOT take into account permissions granted to the current user.
524-
func ExternalServiceUserMode() ExternalServiceMode {
525-
switch Get().ExternalServiceUserMode {
526-
case "public":
527-
return ExternalServiceModePublic
528-
case "all":
529-
return ExternalServiceModeAll
530-
default:
531-
return ExternalServiceModeDisabled
532-
}
533-
}
534-
535500
const defaultGitLongCommandTimeout = time.Hour
536501

537502
// GitLongCommandTimeout returns the maximum amount of time in seconds that a

0 commit comments

Comments
 (0)