Skip to content

feat: add github device flow for authentication #8232

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 17 commits into from
Jun 29, 2023
Merged
Prev Previous commit
Next Next commit
Fix imports
  • Loading branch information
kylecarbs committed Jun 28, 2023
commit 189d7fc2a0e0d2be965e9fb50524e204beb58a1c
7 changes: 0 additions & 7 deletions coderd/gitauth/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,6 @@ func TestConvertYAML(t *testing.T) {
Type: string(codersdk.GitProviderGitHub),
}},
Error: "client_id must be provided",
}, {
Name: "NoClientSecret",
Input: []codersdk.GitAuthConfig{{
Type: string(codersdk.GitProviderGitHub),
ClientID: "example",
}},
Error: "client_secret must be provided",
}, {
Name: "DuplicateType",
Input: []codersdk.GitAuthConfig{{
Expand Down
16 changes: 10 additions & 6 deletions coderd/gitauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ func TestGitAuthByID(t *testing.T) {
AvatarURL: github.String("https://avatars.githubusercontent.com/u/12345678?v=4"),
})
case "/installs":
httpapi.Write(r.Context(), w, http.StatusOK, []github.Installation{{
ID: github.Int64(12345678),
Account: &github.User{
Login: github.String("coder"),
},
}})
httpapi.Write(r.Context(), w, http.StatusOK, struct {
Installations []github.Installation `json:"installations"`
}{
Installations: []github.Installation{{
ID: github.Int64(12345678),
Account: &github.User{
Login: github.String("coder"),
},
}},
})
}
}))
defer srv.Close()
Expand Down