MCPcopy Index your code
hub / github.com/coder/coder / gitHubDefaults

Function gitHubDefaults

coderd/externalauth/externalauth.go:1061–1081  ·  view source on GitHub ↗

gitHubDefaults returns default config values for GitHub. The only dynamic value is the revocation URL which depends on client ID.

(config *codersdk.ExternalAuthConfig)

Source from the content-addressed store, hash-verified

1059// gitHubDefaults returns default config values for GitHub.
1060// The only dynamic value is the revocation URL which depends on client ID.
1061func gitHubDefaults(config *codersdk.ExternalAuthConfig) codersdk.ExternalAuthConfig {
1062 defaults := codersdk.ExternalAuthConfig{
1063 AuthURL: xgithub.Endpoint.AuthURL,
1064 TokenURL: xgithub.Endpoint.TokenURL,
1065 ValidateURL: "https://api.github.com/user",
1066 DisplayName: "GitHub",
1067 DisplayIcon: "/icon/github.svg",
1068 Regex: `^(https?://)?github\.com(/.*)?$`,
1069 // "workflow" is required for managing GitHub Actions in a repository.
1070 Scopes: []string{"repo", "workflow"},
1071 DeviceCodeURL: "https://github.com/login/device/code",
1072 AppInstallationsURL: "https://api.github.com/user/installations",
1073 CodeChallengeMethodsSupported: []string{string(promoauth.PKCEChallengeMethodSha256)},
1074 }
1075
1076 if config.RevokeURL == "" && config.ClientID != "" {
1077 defaults.RevokeURL = fmt.Sprintf("https://api.github.com/applications/%s/grant", config.ClientID)
1078 }
1079
1080 return defaults
1081}
1082
1083func bitbucketServerDefaults(config *codersdk.ExternalAuthConfig) codersdk.ExternalAuthConfig {
1084 defaults := codersdk.ExternalAuthConfig{

Callers 1

applyDefaultsToConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected