Skip to content

Commit 6432b0d

Browse files
committed
fix comments
1 parent e7cfb46 commit 6432b0d

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

coderd/cryptokeys/cache.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,13 @@ func (c *cache) VerifyingKey(ctx context.Context, id string) (interface{}, error
198198
if err != nil {
199199
return nil, xerrors.Errorf("parse id: %w", err)
200200
}
201-
201+
//nolint:gocritic // cache can only read crypto keys.
202+
ctx = dbauthz.AsKeyReader(ctx)
202203
_, secret, err := c.cryptoKey(ctx, int32(seq))
203204
if err != nil {
204205
return nil, xerrors.Errorf("crypto key: %w", err)
205206
}
206207

207-
//nolint:gocritic // cache can only read crypto keys.
208-
ctx = dbauthz.AsKeyReader(ctx)
209208
return secret, nil
210209
}
211210

coderd/userauth.go

-4
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ func (api *API) postConvertLoginType(rw http.ResponseWriter, r *http.Request) {
167167
ToLoginType: req.ToType,
168168
}
169169

170-
//nolint:gocritic // We need to read the system signing key
171-
// in order to sign the token.
172170
token, err := jwtutils.Sign(ctx, api.OIDCConvertKeyCache, claims)
173171
if err != nil {
174172
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
@@ -1679,8 +1677,6 @@ func (api *API) convertUserToOauth(ctx context.Context, r *http.Request, db data
16791677
}
16801678
var claims OAuthConvertStateClaims
16811679

1682-
//nolint:gocritic // We need to read the system signing key
1683-
// in order to verify the token.
16841680
err = jwtutils.Verify(ctx, api.OIDCConvertKeyCache, jwtCookie.Value, &claims)
16851681
if xerrors.Is(err, cryptokeys.ErrKeyNotFound) || xerrors.Is(err, cryptokeys.ErrKeyInvalid) || xerrors.Is(err, jose.ErrCryptoFailure) {
16861682
// These errors are probably because the user is mixing 2 coder deployments.

enterprise/wsproxy/wsproxy_test.go

-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"net/http"
99
"net/http/httptest"
1010
"net/url"
11-
"runtime/debug"
1211
"testing"
1312
"time"
1413

@@ -322,11 +321,6 @@ resourceLoop:
322321

323322
func TestDERPEndToEnd(t *testing.T) {
324323
t.Parallel()
325-
defer func() {
326-
if r := recover(); r != nil {
327-
debug.PrintStack()
328-
}
329-
}()
330324

331325
deploymentValues := coderdtest.DeploymentValues(t)
332326
deploymentValues.Experiments = []string{

0 commit comments

Comments
 (0)