Skip to content

Commit 930e7dd

Browse files
committed
PR Feedback
1 parent 1c7e8b4 commit 930e7dd

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

coderd/coderdtest/oidctest/idp.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,18 @@ func (f *FakeIDP) authenticateBearerTokenRequest(t testing.TB, req *http.Request
376376
return token, nil
377377
}
378378

379-
// authenticateOIDClientRequest enforces the client_id and client_secret are valid.
380-
func (f *FakeIDP) authenticateOIDClientRequest(t testing.TB, req *http.Request) (url.Values, error) {
379+
// authenticateOIDCClientRequest enforces the client_id and client_secret are valid.
380+
func (f *FakeIDP) authenticateOIDCClientRequest(t testing.TB, req *http.Request) (url.Values, error) {
381381
t.Helper()
382382

383383
if f.hookAuthenticateClient != nil {
384384
return f.hookAuthenticateClient(t, req)
385385
}
386386

387-
data, _ := io.ReadAll(req.Body)
387+
data, err := io.ReadAll(req.Body)
388+
if !assert.NoError(t, err, "read token request body") {
389+
return nil, xerrors.Errorf("authenticate request, read body: %w", err)
390+
}
388391
values, err := url.ParseQuery(string(data))
389392
if !assert.NoError(t, err, "parse token request values") {
390393
return nil, xerrors.New("invalid token request")
@@ -491,7 +494,7 @@ func (f *FakeIDP) httpHandler(t testing.TB) http.Handler {
491494
}))
492495

493496
mux.Handle(tokenPath, http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
494-
values, err := f.authenticateOIDClientRequest(t, r)
497+
values, err := f.authenticateOIDCClientRequest(t, r)
495498
f.logger.Info(r.Context(), "HTTP Call Token",
496499
slog.Error(err),
497500
slog.F("values", values.Encode()),

enterprise/coderd/userauth_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestUserOIDC(t *testing.T) {
5757
// roles from an updated claim.
5858
t.Run("NewUserAndRemoveRolesOnRefresh", func(t *testing.T) {
5959
// TODO: Implement new feature to update roles/groups on OIDC
60-
// refresh tokens.
60+
// refresh tokens. https://github.com/coder/coder/issues/9312
6161
t.Skip("Refreshing tokens does not update roles :(")
6262
t.Parallel()
6363

@@ -224,7 +224,7 @@ func TestUserOIDC(t *testing.T) {
224224
t.Parallel()
225225

226226
// TODO: Implement new feature to update roles/groups on OIDC
227-
// refresh tokens.
227+
// refresh tokens. https://github.com/coder/coder/issues/9312
228228
t.Skip("Refreshing tokens does not update groups :(")
229229

230230
const groupClaim = "custom-groups"

0 commit comments

Comments
 (0)