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

Issue 1858763003: Change origin trial token format (Closed)

Created:
4 years, 8 months ago by iclelland
Modified:
4 years, 8 months ago
CC:
blink-reviews, chasej+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change origin trial token format This CL introduces a new format for origin trial tokens. The tokens are JSON-encoded data, wrapped in a base64-encoded signed binary structure. The token format is documented at https://docs.google.com/document/d/1v5fi0EUV_QHckVHVF2K4P72iNywnrJtNhNZ6i2NPt0M Additionally, this CL changes the order of operations when processing tokens. Now signature verification is always performed as part of parsing, and the token's applicability can be checked after it has been verified and parsed. BUG=601090 Committed: https://crrev.com/0709f4ee3881c0c97c7e765ba824b20d5464771f Cr-Commit-Position: refs/heads/master@{#387333}

Patch Set 1 #

Patch Set 2 : Fix broken sample token markup #

Patch Set 3 : Update parser unit tests, improve error detection #

Total comments: 22

Patch Set 4 : Clean up API, clarify difference between token text and payload, clean up tests, and fix use of pub… #

Total comments: 6

Patch Set 5 : Addressing comments from PS#3/4 #

Patch Set 6 : Bump version number #

Total comments: 31

Patch Set 7 : Rebase, incorporate scoped_ptr deprecation #

Patch Set 8 : Addressing review comments from PS#6 #

Patch Set 9 : Update test tokens for version 2 #

Total comments: 4

Patch Set 10 : Rebase; fix param name #

Total comments: 6

Patch Set 11 : Nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -238 lines) Patch
M content/common/origin_trials/trial_token.h View 1 2 3 4 5 6 7 8 9 2 chunks +25 lines, -44 lines 0 comments Download
M content/common/origin_trials/trial_token.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +102 lines, -69 lines 0 comments Download
M content/common/origin_trials/trial_token_unittest.cc View 1 2 3 4 5 6 7 6 chunks +155 lines, -100 lines 0 comments Download
M content/common/origin_trials/trial_token_validator.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/common/origin_trials/trial_token_validator.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -6 lines 0 comments Download
M content/common/origin_trials/trial_token_validator_unittest.cc View 1 2 3 4 5 6 2 chunks +17 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-expired.html View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens.html View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-stolen.html View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M tools/origin_trials/generate_token.py View 1 2 3 4 5 6 7 5 chunks +17 lines, -5 lines 0 comments Download

Messages

Total messages: 30 (8 generated)
palmer
Might have more comments later; zooming to a meeting. https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.h File content/common/origin_trials/trial_token.h (right): https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.h#newcode39 content/common/origin_trials/trial_token.h:39: ...
4 years, 8 months ago (2016-04-07 00:03:53 UTC) #4
iclelland
https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.h File content/common/origin_trials/trial_token.h (right): https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.h#newcode39 content/common/origin_trials/trial_token.h:39: static scoped_ptr<TrialToken> From(const std::string& token_text, On 2016/04/07 00:03:53, palmer ...
4 years, 8 months ago (2016-04-07 14:55:13 UTC) #5
chasej
https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.cc#newcode36 content/common/origin_trials/trial_token.cc:36: const size_t kVersionOffset = 0; Nit: The version offset ...
4 years, 8 months ago (2016-04-07 15:52:31 UTC) #6
iclelland
https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/40001/content/common/origin_trials/trial_token.cc#newcode36 content/common/origin_trials/trial_token.cc:36: const size_t kVersionOffset = 0; On 2016/04/07 15:52:30, chasej ...
4 years, 8 months ago (2016-04-07 20:26:45 UTC) #7
chasej
lgtm
4 years, 8 months ago (2016-04-08 03:23:08 UTC) #8
iclelland
estark - Does this CL address the concerns you had with the previous string parsing ...
4 years, 8 months ago (2016-04-08 15:22:48 UTC) #9
estark
On 2016/04/08 15:22:48, iclelland wrote: > estark - Does this CL address the concerns you ...
4 years, 8 months ago (2016-04-08 17:23:37 UTC) #10
iclelland
On 2016/04/08 17:23:37, estark wrote: > On 2016/04/08 15:22:48, iclelland wrote: > > estark - ...
4 years, 8 months ago (2016-04-08 17:30:46 UTC) #11
iclelland
palmer -- ping -- did you manage to take a closer look? +r avi for ...
4 years, 8 months ago (2016-04-08 20:51:17 UTC) #13
Marijn Kruisselbrink
tools looks good, but have several comments about the rest of the code https://codereview.chromium.org/1858763003/diff/100001/content/common/origin_trials/trial_token.cc File ...
4 years, 8 months ago (2016-04-08 21:19:30 UTC) #14
Marijn Kruisselbrink
On 2016/04/08 at 21:19:30, Marijn Kruisselbrink wrote: > tools looks good, but have several comments ...
4 years, 8 months ago (2016-04-08 21:20:09 UTC) #15
Avi (use Gerrit)
This looks reasonable, and with the other reviewer's comments addressed, and with properly delimited sentences, ...
4 years, 8 months ago (2016-04-08 21:34:24 UTC) #16
iclelland
https://codereview.chromium.org/1858763003/diff/100001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/100001/content/common/origin_trials/trial_token.cc#newcode24 content/common/origin_trials/trial_token.cc:24: // Version is a 1-byte field at offset 0 ...
4 years, 8 months ago (2016-04-11 16:59:38 UTC) #17
palmer
https://codereview.chromium.org/1858763003/diff/160001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/160001/content/common/origin_trials/trial_token.cc#newcode121 content/common/origin_trials/trial_token.cc:121: std::unique_ptr<TrialToken> TrialToken::Parse(const std::string& token_json) { What you call |token_json| ...
4 years, 8 months ago (2016-04-11 20:25:58 UTC) #18
iclelland
https://codereview.chromium.org/1858763003/diff/160001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/160001/content/common/origin_trials/trial_token.cc#newcode121 content/common/origin_trials/trial_token.cc:121: std::unique_ptr<TrialToken> TrialToken::Parse(const std::string& token_json) { On 2016/04/11 20:25:57, palmer ...
4 years, 8 months ago (2016-04-12 04:09:32 UTC) #19
palmer
> This predates the proposal to allow the use of std::vector::data() though, which > may ...
4 years, 8 months ago (2016-04-12 17:48:31 UTC) #20
iclelland
On 2016/04/08 21:20:09, Marijn Kruisselbrink wrote: > On 2016/04/08 at 21:19:30, Marijn Kruisselbrink wrote: > ...
4 years, 8 months ago (2016-04-13 17:18:21 UTC) #21
Marijn Kruisselbrink
Sorry for the delayed response, lgtm with some minor nits. https://codereview.chromium.org/1858763003/diff/180001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/180001/content/common/origin_trials/trial_token.cc#newcode46 ...
4 years, 8 months ago (2016-04-13 23:07:38 UTC) #22
iclelland
https://codereview.chromium.org/1858763003/diff/180001/content/common/origin_trials/trial_token.cc File content/common/origin_trials/trial_token.cc (right): https://codereview.chromium.org/1858763003/diff/180001/content/common/origin_trials/trial_token.cc#newcode46 content/common/origin_trials/trial_token.cc:46: // Static On 2016/04/13 23:07:37, Marijn Kruisselbrink wrote: > ...
4 years, 8 months ago (2016-04-14 16:15:22 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1858763003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1858763003/200001
4 years, 8 months ago (2016-04-14 16:15:45 UTC) #26
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 8 months ago (2016-04-14 16:21:31 UTC) #28
commit-bot: I haz the power
4 years, 8 months ago (2016-04-14 16:22:54 UTC) #30
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/0709f4ee3881c0c97c7e765ba824b20d5464771f
Cr-Commit-Position: refs/heads/master@{#387333}

Powered by Google App Engine
This is Rietveld 408576698