Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Issue 2943403003: token-server: Fix panic when generating machine token for unrecognized machine. (Closed)

Created:
3 years, 6 months ago by Vadim Sh.
Modified:
3 years, 6 months ago
Reviewers:
iannucci, smut
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, maruel+w_chromium.org, tandrii+luci-go_chromium.org
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

token-server: Fix panic when generating machine token for unrecognized machine. In this case operation returns MintMachineTokenResponse{ErrorCode: ...} (since there's no way to return structured error responses via grpc.Error). BigQuery logging code attempted to log such response and paniced on nil dereference when attempting to examine the token. Fix this, add a test and a bunch of asserts. R=iannucci@chromium.org, smut@google.com BUG=732467 Review-Url: https://codereview.chromium.org/2943403003 Committed: https://github.com/luci/luci-go/commit/71aba0a6cd7d6264e0ecdd38afe5b69db8c8556f

Patch Set 1 #

Patch Set 2 : nit #

Patch Set 3 : flatten #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -8 lines) Patch
M tokenserver/appengine/impl/machinetoken/bigquery_log_test.go View 1 chunk +1 line, -1 line 1 comment Download
M tokenserver/appengine/impl/machinetoken/rpc_inspect_machine_token_test.go View 1 chunk +1 line, -1 line 0 comments Download
M tokenserver/appengine/impl/machinetoken/rpc_mint_machine_token.go View 1 2 1 chunk +12 lines, -1 line 1 comment Download
M tokenserver/appengine/impl/machinetoken/rpc_mint_machine_token_test.go View 3 chunks +38 lines, -2 lines 0 comments Download
M tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go View 1 chunk +2 lines, -3 lines 2 comments Download

Messages

Total messages: 16 (7 generated)
Vadim Sh.
PTAL Usually Nodir reviews this code, but he's OOO. https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/rpc_mint_machine_token.go File tokenserver/appengine/impl/machinetoken/rpc_mint_machine_token.go (right): https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/rpc_mint_machine_token.go#newcode148 tokenserver/appengine/impl/machinetoken/rpc_mint_machine_token.go:148: ...
3 years, 6 months ago (2017-06-20 03:49:50 UTC) #1
Vadim Sh.
On a related note, we should probably add a gRPC interceptor that converts panics into ...
3 years, 6 months ago (2017-06-20 03:52:33 UTC) #4
Vadim Sh.
On 2017/06/20 03:52:33, Vadim Sh. wrote: > On a related note, we should probably add ...
3 years, 6 months ago (2017-06-20 04:25:57 UTC) #7
smut
https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/bigquery_log_test.go File tokenserver/appengine/impl/machinetoken/bigquery_log_test.go (right): https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/bigquery_log_test.go#newcode22 tokenserver/appengine/impl/machinetoken/bigquery_log_test.go:22: ctx := testingContext(testingCA) Where is testingCA defined?
3 years, 6 months ago (2017-06-20 22:37:17 UTC) #8
iannucci
lgtm https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go File tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go (right): https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go#newcode97 tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go:97: var testingCA = certconfig.CA{ @smut: here's the definition ...
3 years, 6 months ago (2017-06-20 22:43:19 UTC) #9
Vadim Sh.
https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go File tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go (right): https://codereview.chromium.org/2943403003/diff/40001/tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go#newcode97 tokenserver/appengine/impl/machinetoken/rpc_mocks_test.go:97: var testingCA = certconfig.CA{ On 2017/06/20 22:43:19, iannucci wrote: ...
3 years, 6 months ago (2017-06-20 22:46:02 UTC) #10
smut
lgtm
3 years, 6 months ago (2017-06-20 22:51:58 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2943403003/40001
3 years, 6 months ago (2017-06-20 22:58:59 UTC) #13
commit-bot: I haz the power
3 years, 6 months ago (2017-06-20 23:04:14 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://github.com/luci/luci-go/commit/71aba0a6cd7d6264e0ecdd38afe5b69db8c8556f

Powered by Google App Engine
This is Rietveld 408576698