|
|
Created:
4 years, 4 months ago by robwu Modified:
4 years, 2 months ago Reviewers:
Sergey Ulanov, Devlin CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionEnsure/document that the first parameter to the native messaging host is the origin
This reflects the current implementation, and allows native messaging
hosts to verify their caller when they have authorized multiple
(extension) origins to invoke the native messaging host.
On Windows, the first argument was --parent-window=integer,
but to make the use of the origin parameter easier, the origin parameter
is first, just like other platforms (Linux/OS X).
BUG=651496
R=sergeyu@chromium.org
Committed: https://crrev.com/f048ff5342719462f88ff146b8ac01346f320da8
Cr-Commit-Position: refs/heads/master@{#423169}
Patch Set 1 #Patch Set 2 : Assert that first parameter is the origin #Patch Set 3 : Make sure that the origin is really the first arg #
Total comments: 4
Patch Set 4 : Reword docs, thanks Devlin #
Total comments: 2
Patch Set 5 : Clarify parameters on Windows #
Created: 4 years, 2 months ago
Messages
Total messages: 33 (17 generated)
Hi Sergey, I still had to submit this documentation fix following our conversation on the 11th of May.
lgtm
The CQ bit was checked by sergeyu@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
rob@robwu.nl changed reviewers: + rdevlin.cronin@chromium.org
OWNER stamp please :)
Do we already test this? I didn't immediately see anything in the native messaging tests from a quick skim.
On 2016/09/07 15:01:34, Devlin wrote: > Do we already test this? I didn't immediately see anything in the native > messaging tests from a quick skim. The test verifies that the is parameter specified here: https://codesearch.chromium.org/chromium/src/chrome/test/data/native_messagin... Currently it just verifies that the parameter is there, but not that the value is correct.
On 2016/09/07 19:47:39, Sergey Ulanov wrote: > On 2016/09/07 15:01:34, Devlin wrote: > > Do we already test this? I didn't immediately see anything in the native > > messaging tests from a quick skim. > > The test verifies that the is parameter specified here: > https://codesearch.chromium.org/chromium/src/chrome/test/data/native_messagin... > Currently it just verifies that the parameter is there, but not that the value > is correct. Seems like an easy enough fix, so I'd like to do that in this CL as well.
On 2016/09/07 20:08:50, Devlin (OOO until sep 26) wrote: > On 2016/09/07 19:47:39, Sergey Ulanov wrote: > > On 2016/09/07 15:01:34, Devlin wrote: > > > Do we already test this? I didn't immediately see anything in the native > > > messaging tests from a quick skim. > > > > The test verifies that the is parameter specified here: > > > https://codesearch.chromium.org/chromium/src/chrome/test/data/native_messagin... > > Currently it just verifies that the parameter is there, but not that the value > > is correct. > > Seems like an easy enough fix, so I'd like to do that in this CL as well. The value is also verified: https://chromium.googlesource.com/chromium/src/+/0906cac26ecd6cfd5c98ee5ab296... However a later change weakened the test to the extent that it's not guaranteed that the first argument is the origin: https://chromium.googlesource.com/chromium/src/+/4c69465afd402fc6db73ac8fcfb5... I have updated the CL to make a stronger assertion that the first parameter is the origin.
The CQ bit was checked by rob@robwu.nl to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by rob@robwu.nl to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
Awesome, thanks Rob! lgtm with nits https://codereview.chromium.org/2271143002/diff/40001/chrome/common/extension... File chrome/common/extensions/docs/templates/articles/nativeMessaging.html (right): https://codereview.chromium.org/2271143002/diff/40001/chrome/common/extension... chrome/common/extensions/docs/templates/articles/nativeMessaging.html:133: usually <code>chrome-extension://[extension ID of whitelisted extension]</code>. nit: s/extension ID of whitelisted extension/ID of the whitelisted extension https://codereview.chromium.org/2271143002/diff/40001/chrome/common/extension... chrome/common/extensions/docs/templates/articles/nativeMessaging.html:137: <a href="#native-messaging-host-manifest">native messaging host manifest</a>. This sentence reads a little funny. Maybe "This allows native messaging hosts to identify the source of the message when multiple extensions are specified in the <code>allowed_origins</code> key in the <a href="#native-messaging-host-manifest">host manifest</a>." WDYT?
Description was changed from ========== Document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. R=sergeyu@chromium.org ========== to ========== Document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). R=sergeyu@chromium.org ==========
Devlin - do note that I did not only change the documentation, but also the behavior on Windows (as described in the updated commit message). If you were aware of this and agree, please tick the commit box. https://codereview.chromium.org/2271143002/diff/40001/chrome/common/extension... File chrome/common/extensions/docs/templates/articles/nativeMessaging.html (right): https://codereview.chromium.org/2271143002/diff/40001/chrome/common/extension... chrome/common/extensions/docs/templates/articles/nativeMessaging.html:133: usually <code>chrome-extension://[extension ID of whitelisted extension]</code>. On 2016/09/26 15:53:59, Devlin (OOO until Thursday) wrote: > nit: s/extension ID of whitelisted extension/ID of the whitelisted extension Done. https://codereview.chromium.org/2271143002/diff/40001/chrome/common/extension... chrome/common/extensions/docs/templates/articles/nativeMessaging.html:137: <a href="#native-messaging-host-manifest">native messaging host manifest</a>. On 2016/09/26 15:53:59, Devlin (OOO until Thursday) wrote: > This sentence reads a little funny. Maybe > > "This allows native messaging hosts to identify the source of the message when > multiple extensions are specified in the <code>allowed_origins</code> key in the > <a href="#native-messaging-host-manifest">host manifest</a>." > > WDYT? SGTM. I used "native messaging host manifest" instead of "host manifest" to emphasize that it is not manifest.json but the manifest of the NMH.
On 2016/09/28 09:07:09, robwu wrote: > Devlin - do note that I did not only change the documentation, but also the > behavior on Windows (as described in the updated commit message). > > If you were aware of this and agree, please tick the commit box. Thanks for drawing my attention to this; I didn't notice it at first. Given that a) the order of arguments is currently undocumented and b) this is providing parity between windows and linux/mac, I think this is fine. But let's: - File an associated bug ("origin argument of native messaging is inconsistent on different platforms" or similar) for future discussions, if any, and link it here. - Send an FYI email to chromium-extensions@chromium.org notifying that this change is happening and linking to the bug. - Refrain from merging this back and just let it go through normal release cycles so that developers have plenty of time to update, if they are relying on it (even though it's undocumented). https://codereview.chromium.org/2271143002/diff/60001/chrome/common/extension... File chrome/common/extensions/docs/templates/articles/nativeMessaging.html (right): https://codereview.chromium.org/2271143002/diff/60001/chrome/common/extension... chrome/common/extensions/docs/templates/articles/nativeMessaging.html:150: On Windows, the native messaging host gets passed a command line argument with nit: let's "s/gets/is also" to make it clear that this is in addition to the origin.
Description was changed from ========== Document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). R=sergeyu@chromium.org ========== to ========== Ensure/document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). BUG=651496 R=sergeyu@chromium.org ==========
On 2016/09/29 15:14:51, Devlin (catching up) wrote: > On 2016/09/28 09:07:09, robwu wrote: > > Devlin - do note that I did not only change the documentation, but also the > > behavior on Windows (as described in the updated commit message). > > > > If you were aware of this and agree, please tick the commit box. > > Thanks for drawing my attention to this; I didn't notice it at first. > > Given that a) the order of arguments is currently undocumented and b) this is > providing parity between windows and linux/mac, I think this is fine. But > let's: > - File an associated bug ("origin argument of native messaging is inconsistent > on different platforms" or similar) for future discussions, if any, and link it > here. > - Send an FYI email to mailto:chromium-extensions@chromium.org notifying that this > change is happening and linking to the bug. > - Refrain from merging this back and just let it go through normal release > cycles so that developers have plenty of time to update, if they are relying on > it (even though it's undocumented). Done, see bug in description for the link to the announcement. https://codereview.chromium.org/2271143002/diff/60001/chrome/common/extension... File chrome/common/extensions/docs/templates/articles/nativeMessaging.html (right): https://codereview.chromium.org/2271143002/diff/60001/chrome/common/extension... chrome/common/extensions/docs/templates/articles/nativeMessaging.html:150: On Windows, the native messaging host gets passed a command line argument with On 2016/09/29 15:14:51, Devlin (catching up) wrote: > nit: let's "s/gets/is also" to make it clear that this is in addition to the > origin. Done. Also added an extra line in the docs to mention the change in order on Windows.
The CQ bit was checked by rob@robwu.nl
The patchset sent to the CQ was uploaded after l-g-t-m from sergeyu@chromium.org, rdevlin.cronin@chromium.org Link to the patchset: https://codereview.chromium.org/2271143002/#ps80001 (title: "Clarify parameters on Windows")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Ensure/document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). BUG=651496 R=sergeyu@chromium.org ========== to ========== Ensure/document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). BUG=651496 R=sergeyu@chromium.org ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== Ensure/document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). BUG=651496 R=sergeyu@chromium.org ========== to ========== Ensure/document that the first parameter to the native messaging host is the origin This reflects the current implementation, and allows native messaging hosts to verify their caller when they have authorized multiple (extension) origins to invoke the native messaging host. On Windows, the first argument was --parent-window=integer, but to make the use of the origin parameter easier, the origin parameter is first, just like other platforms (Linux/OS X). BUG=651496 R=sergeyu@chromium.org Committed: https://crrev.com/f048ff5342719462f88ff146b8ac01346f320da8 Cr-Commit-Position: refs/heads/master@{#423169} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/f048ff5342719462f88ff146b8ac01346f320da8 Cr-Commit-Position: refs/heads/master@{#423169} |