(cfg *externalauth.Config)
| 417 | } |
| 418 | |
| 419 | func ExternalAuthConfig(cfg *externalauth.Config) codersdk.ExternalAuthLinkProvider { |
| 420 | return codersdk.ExternalAuthLinkProvider{ |
| 421 | ID: cfg.ID, |
| 422 | Type: cfg.Type, |
| 423 | Device: cfg.DeviceAuth != nil, |
| 424 | DisplayName: cfg.DisplayName, |
| 425 | DisplayIcon: cfg.DisplayIcon, |
| 426 | AllowRefresh: !cfg.NoRefresh, |
| 427 | AllowValidate: cfg.ValidateURL != "", |
| 428 | SupportsRevocation: cfg.RevokeURL != "", |
| 429 | CodeChallengeMethodsSupported: slice.ToStrings(cfg.CodeChallengeMethodsSupported), |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | func uriFromURL(u string) string { |
| 434 | uri, err := url.Parse(u) |
no test coverage detected