gitHubDefaults returns default config values for GitHub. The only dynamic value is the revocation URL which depends on client ID.
(config *codersdk.ExternalAuthConfig)
| 1059 | // gitHubDefaults returns default config values for GitHub. |
| 1060 | // The only dynamic value is the revocation URL which depends on client ID. |
| 1061 | func 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 | |
| 1083 | func bitbucketServerDefaults(config *codersdk.ExternalAuthConfig) codersdk.ExternalAuthConfig { |
| 1084 | defaults := codersdk.ExternalAuthConfig{ |
no outgoing calls
no test coverage detected