Skip to content

chore: add github.com user id association #14045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 2, 2024
Merged
Prev Previous commit
Next Next commit
Fix linting
  • Loading branch information
kylecarbs committed Aug 2, 2024
commit 8b5e8662939abb3b48b78efd854017d26ae26cf5
2 changes: 1 addition & 1 deletion coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -7985,7 +7985,7 @@ func (q *FakeQuerier) UpdateUserDeletedByID(_ context.Context, id uuid.UUID) err
return sql.ErrNoRows
}

func (q *FakeQuerier) UpdateUserGithubComUserID(ctx context.Context, arg database.UpdateUserGithubComUserIDParams) error {
func (q *FakeQuerier) UpdateUserGithubComUserID(_ context.Context, arg database.UpdateUserGithubComUserIDParams) error {
err := validateDatabaseType(arg)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions coderd/externalauth/externalauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,9 +968,9 @@ func (r roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
// IsGithubDotComURL returns true if the given URL is a github.com URL.
func IsGithubDotComURL(str string) bool {
str = strings.ToLower(str)
url, err := url.Parse(str)
ghUrl, err := url.Parse(str)
if err != nil {
return false
}
return url.Host == "github.com"
return ghUrl.Host == "github.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ WebAuthenticated.args = {
app_installable: false,
display_name: "BitBucket",
user: {
id: 0,
avatar_url: "https://avatars.githubusercontent.com/u/7122116?v=4",
login: "kylecarbs",
name: "Kyle Carberry",
Expand Down Expand Up @@ -104,6 +105,7 @@ DeviceAuthenticatedNotInstalled.args = {
app_install_url: "https://example.com",
app_installable: true,
user: {
id: 0,
avatar_url: "https://avatars.githubusercontent.com/u/7122116?v=4",
login: "kylecarbs",
name: "Kyle Carberry",
Expand All @@ -123,6 +125,7 @@ DeviceAuthenticatedInstalled.args = {
configure_url: "https://example.com",
id: 1,
account: {
id: 0,
avatar_url: "https://github.com/coder.png",
login: "coder",
name: "Coder",
Expand All @@ -133,6 +136,7 @@ DeviceAuthenticatedInstalled.args = {
app_install_url: "https://example.com",
app_installable: true,
user: {
id: 0,
avatar_url: "https://avatars.githubusercontent.com/u/7122116?v=4",
login: "kylecarbs",
name: "Kyle Carberry",
Expand Down