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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove legacy notify
  • Loading branch information
kylecarbs committed Jun 28, 2023
commit 18022ba60b51f76c8bea27d3fc5fe9fb3bac5791
3 changes: 1 addition & 2 deletions cli/cliui/gitauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cliui_test

import (
"context"
"net/url"
"sync/atomic"
"testing"
"time"
Expand Down Expand Up @@ -33,7 +32,7 @@ func TestGitAuth(t *testing.T) {
ID: "github",
Type: codersdk.GitProviderGitHub,
Authenticated: fetched.Load(),
AuthenticateURL: "https://example.com/gitauth/github?redirect=" + url.QueryEscape("/gitauth?notify"),
AuthenticateURL: "https://example.com/gitauth/github",
}}, nil
},
FetchInterval: time.Millisecond,
Expand Down
8 changes: 0 additions & 8 deletions coderd/templateversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,6 @@ func (api *API) templateVersionGitAuth(rw http.ResponseWriter, r *http.Request)
})
return
}
query := redirectURL.Query()
// The frontend uses a BroadcastChannel to notify listening pages for
// Git auth updates if the "notify" query parameter is set.
//
// It's important we do this in the backend, because the same endpoint
// is used for CLI authentication.
query.Add("redirect", "/gitauth?notify")
redirectURL.RawQuery = query.Encode()

provider := codersdk.TemplateVersionGitAuth{
ID: config.ID,
Expand Down