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

Issue 1521063003: Add API Key parsing for experimental APIs (Closed)

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

Description

Add API Key parsing for experimental APIs This adds the experimental framework API key parsing mechanism to Chromium. This code deals with origins, API names, and dates. The validation currently checks for general well-formedness, and can determine, given an origin and API name, whether a given key is appropriate for use. (This is parsing only; actual signature validation is a separate CL) BUG=543146 Committed: https://crrev.com/672676d8ae5f598f56714bb81b45498476952e9f Cr-Commit-Position: refs/heads/master@{#367893}

Patch Set 1 #

Patch Set 2 : Fix date handling; more thorough tests #

Patch Set 3 : Rebase #

Total comments: 19

Patch Set 4 : Addressing review comments #

Patch Set 5 : Update tests #

Patch Set 6 : Remove forward declaration to wrong namespace #

Total comments: 12

Patch Set 7 : Addressing feedback from PS#6 #

Total comments: 15

Patch Set 8 : Merge blink and chromium code; fixing issues from review #

Total comments: 12

Patch Set 9 : Addressing feedback from PS#8 #

Total comments: 4

Patch Set 10 : Nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -0 lines) Patch
A content/common/experiments/api_key.h View 1 2 3 4 5 6 7 8 1 chunk +89 lines, -0 lines 0 comments Download
A content/common/experiments/api_key.cc View 1 2 3 4 5 6 7 8 1 chunk +98 lines, -0 lines 0 comments Download
A content/common/experiments/api_key_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +129 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 38 (13 generated)
iclelland
+r chasej -- PTAL, thanks!
5 years ago (2015-12-14 15:00:29 UTC) #3
chasej
https://codereview.chromium.org/1521063003/diff/40001/content/browser/experiments/api_key.cc File content/browser/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/40001/content/browser/experiments/api_key.cc#newcode47 content/browser/experiments/api_key.cc:47: new ApiKey(signature, data, GURL(origin), apiName, expiry_int)); There is no ...
5 years ago (2015-12-15 19:43:41 UTC) #4
iclelland
https://codereview.chromium.org/1521063003/diff/40001/content/browser/experiments/api_key.cc File content/browser/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/40001/content/browser/experiments/api_key.cc#newcode47 content/browser/experiments/api_key.cc:47: new ApiKey(signature, data, GURL(origin), apiName, expiry_int)); On 2015/12/15 19:43:41, ...
5 years ago (2015-12-15 21:22:24 UTC) #5
chasej
https://codereview.chromium.org/1521063003/diff/40001/content/browser/experiments/api_key.cc File content/browser/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/40001/content/browser/experiments/api_key.cc#newcode47 content/browser/experiments/api_key.cc:47: new ApiKey(signature, data, GURL(origin), apiName, expiry_int)); On 2015/12/15 21:22:24, ...
5 years ago (2015-12-16 15:41:17 UTC) #6
iclelland
Tests updates; chasej, can you PTAL again? +r rbyers, can you check the WebKit side? ...
5 years ago (2015-12-16 17:04:37 UTC) #9
chasej
LGTM. I'm fine with adding character-set validation in another CL.
5 years ago (2015-12-16 18:29:52 UTC) #10
davidben
lgtm with style nits. https://codereview.chromium.org/1521063003/diff/100001/content/browser/experiments/api_key.cc File content/browser/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/100001/content/browser/experiments/api_key.cc#newcode20 content/browser/experiments/api_key.cc:20: scoped_ptr<ApiKey> ApiKey::Parse(const std::string& keyText) { ...
5 years ago (2015-12-18 19:48:36 UTC) #11
davidben
Oh, one comment: Do you all think it's worth sticking a "v1|" at the front ...
5 years ago (2015-12-18 19:51:45 UTC) #12
iclelland
On 2015/12/18 19:51:45, davidben wrote: > Oh, one comment: Do you all think it's worth ...
5 years ago (2015-12-18 20:25:18 UTC) #13
iclelland
https://codereview.chromium.org/1521063003/diff/100001/content/browser/experiments/api_key.cc File content/browser/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/100001/content/browser/experiments/api_key.cc#newcode20 content/browser/experiments/api_key.cc:20: scoped_ptr<ApiKey> ApiKey::Parse(const std::string& keyText) { On 2015/12/18 19:48:36, davidben ...
5 years ago (2015-12-18 21:10:22 UTC) #14
Rick Byers
Sorry for the delay (been swamped with perf sheriff and reviews). The WebKit side looks ...
5 years ago (2015-12-18 21:52:42 UTC) #15
Marijn Kruisselbrink
Drive-by-review: Why the code duplication between chromium and blink? Can't you just put all the ...
5 years ago (2015-12-18 22:03:01 UTC) #17
iclelland
On 2015/12/18 21:52:42, Rick Byers wrote: > Sorry for the delay (been swamped with perf ...
5 years ago (2015-12-20 05:10:51 UTC) #18
Marijn Kruisselbrink
On 2015/12/20 at 05:10:51, iclelland wrote: > On 2015/12/18 21:52:42, Rick Byers wrote: > > ...
5 years ago (2015-12-20 20:02:37 UTC) #19
iclelland
I've removed the Blink code from this CL (after the comments in crrev.com/1528613003/), and moved ...
5 years ago (2015-12-21 19:17:17 UTC) #20
Rick Byers
On 2015/12/21 19:17:17, iclelland wrote: > I've removed the Blink code from this CL (after ...
5 years ago (2015-12-21 19:21:15 UTC) #21
iclelland
chasej, mek -- can you take one more look before I commit this?
5 years ago (2015-12-21 19:25:41 UTC) #23
chasej
https://codereview.chromium.org/1521063003/diff/140001/content/common/experiments/api_key.cc File content/common/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/140001/content/common/experiments/api_key.cc#newcode83 content/common/experiments/api_key.cc:83: return api_name == api_name_; I think the API name ...
5 years ago (2015-12-21 20:09:10 UTC) #24
Marijn Kruisselbrink
sorry for the delay https://codereview.chromium.org/1521063003/diff/140001/content/common/experiments/api_key.cc File content/common/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/140001/content/common/experiments/api_key.cc#newcode50 content/common/experiments/api_key.cc:50: const std::string& data = key_text.substr(key_text.find('|') ...
4 years, 11 months ago (2016-01-05 00:59:14 UTC) #25
iclelland
https://codereview.chromium.org/1521063003/diff/140001/content/common/experiments/api_key.cc File content/common/experiments/api_key.cc (right): https://codereview.chromium.org/1521063003/diff/140001/content/common/experiments/api_key.cc#newcode50 content/common/experiments/api_key.cc:50: const std::string& data = key_text.substr(key_text.find('|') + 1); On 2016/01/05 ...
4 years, 11 months ago (2016-01-05 20:26:31 UTC) #26
Marijn Kruisselbrink
lgtm with some nits https://codereview.chromium.org/1521063003/diff/160001/content/common/experiments/api_key_unittest.cc File content/common/experiments/api_key_unittest.cc (right): https://codereview.chromium.org/1521063003/diff/160001/content/common/experiments/api_key_unittest.cc#newcode67 content/common/experiments/api_key_unittest.cc:67: return api_key->ValidateOrigin(std::string(origin)); no need to ...
4 years, 11 months ago (2016-01-06 18:52:30 UTC) #27
iclelland
https://codereview.chromium.org/1521063003/diff/160001/content/common/experiments/api_key_unittest.cc File content/common/experiments/api_key_unittest.cc (right): https://codereview.chromium.org/1521063003/diff/160001/content/common/experiments/api_key_unittest.cc#newcode67 content/common/experiments/api_key_unittest.cc:67: return api_key->ValidateOrigin(std::string(origin)); On 2016/01/06 18:52:30, Marijn Kruisselbrink wrote: > ...
4 years, 11 months ago (2016-01-06 19:15:55 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1521063003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1521063003/180001
4 years, 11 months ago (2016-01-06 19:21:57 UTC) #34
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 11 months ago (2016-01-06 20:36:02 UTC) #36
commit-bot: I haz the power
4 years, 11 months ago (2016-01-06 20:37:10 UTC) #38
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/672676d8ae5f598f56714bb81b45498476952e9f
Cr-Commit-Position: refs/heads/master@{#367893}

Powered by Google App Engine
This is Rietveld 408576698