(meta metadata.ConnectionAuthPendingMetadata)
| 141 | } |
| 142 | |
| 143 | func (p *gitHubProvider) createFlow(meta metadata.ConnectionAuthPendingMetadata) ( |
| 144 | gitHubFlow, |
| 145 | error, |
| 146 | ) { |
| 147 | logger := p.logger.WithLabel("connectionID", meta.ConnectionID).WithLabel("username", meta.Username) |
| 148 | |
| 149 | client, err := http.NewClient(p.wwwClientConfig, logger) |
| 150 | if err != nil { |
| 151 | return gitHubFlow{}, message.WrapUser( |
| 152 | err, |
| 153 | message.EAuthGitHubHTTPClientCreateFailed, |
| 154 | "Authentication currently unavailable.", |
| 155 | "Cannot create GitHub device flow authenticator because the HTTP urlEncodedClient configuration failed.", |
| 156 | ) |
| 157 | } |
| 158 | |
| 159 | jsonClient, err := http.NewClient(p.jsonWWWClientConfig, logger) |
| 160 | if err != nil { |
| 161 | return gitHubFlow{}, message.WrapUser( |
| 162 | err, |
| 163 | message.EAuthGitHubHTTPClientCreateFailed, |
| 164 | "Authentication currently unavailable.", |
| 165 | "Cannot create GitHub device flow authenticator because the HTTP urlEncodedClient configuration failed.", |
| 166 | ) |
| 167 | } |
| 168 | |
| 169 | flow := gitHubFlow{ |
| 170 | provider: p, |
| 171 | clientID: p.clientID, |
| 172 | clientSecret: p.clientSecret, |
| 173 | logger: logger, |
| 174 | client: client, |
| 175 | jsonClient: jsonClient, |
| 176 | apiClientConfig: p.apiClientConfig, |
| 177 | } |
| 178 | return flow, nil |
| 179 | } |
| 180 | |
| 181 | func (p *gitHubProvider) getScope() string { |
| 182 | scopes := p.scopes |
no test coverage detected