Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that we don't detect files as maven coordinate when installing a plugin #28163

Merged
merged 3 commits into from
Jan 10, 2018

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Jan 10, 2018

This change makes sure that we don't detect a file path containing a ':' as
a maven coordinate (e.g.: file:C:\path\to\zip)

@jimczi jimczi added >bug :Core/Infra/Plugins Plugin API and infrastructure v7.0.0 v6.2.0 labels Jan 10, 2018
@jimczi jimczi requested a review from rjernst January 10, 2018 00:35
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I have one ask.

// has two colons, so it appears similar to maven coordinates
FileNotFoundException e = expectThrows(FileNotFoundException.class, () -> installPlugin("file:C:\\plugin.zip", env.v1()));
assertTrue(e.getMessage(), e.getMessage().startsWith("C:\\plugin.zip"));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use a filename that is a lot more explicit and unlikely to "accidentally" exist if on a windows box? And please run this test on windows (I'm a little worried we won't always get FileNotFoundException, for example getting an AccessDeniedException on some systems instead).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I randomized the directory name to test and changed the assertion to check the message of the exception only (I tested on windows server and got a FileNotFoundException consistently so I can put it back if you want):
0779d60

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…ing a plugin

This change makes sure that we don't detect a file path containing a ':' as
a maven coordinate (e.g.: `file:C:\path\to\zip`)
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@jimczi jimczi merged commit fcf4114 into elastic:master Jan 10, 2018
@jimczi jimczi deleted the plugins_file_not_maven branch January 10, 2018 13:59
jimczi added a commit that referenced this pull request Jan 10, 2018
…ing a plugin (#28163)

* This change makes sure that we don't detect a file path containing a ':' as
a maven coordinate (e.g.: `file:C:\path\to\zip`)

* restore test muted on master
jasontedor added a commit that referenced this pull request Jan 11, 2018
* master: (43 commits)
  Rename core module to server (#28180)
  upgraded jna from 4.4.0-1 to 4.5.1 (#28183)
  [TEST] Do not call RandomizedTest.scaledRandomIntBetween from multiple threads
  Primary send safe commit in file-based recovery (#28038)
  [Docs] Correct response json in rank-eval.asciidoc
  Add scroll parameter to _reindex API (#28041)
  Include all sentences smaller than fragment_size in the unified highlighter (#28132)
  Modifies the JavaAPI docs related to AggregationBuilder
  [Docs] Improvements in script-fields.asciidoc (#28174)
  [Docs] Remove Kerberos/SPNEGO Shield plugin (#28019)
  Ignore null value for range field (#27845) (#28116)
  Fix environment variable substitutions in list setting (#28106)
  docs: Replaces indexed script java api docs with stored script api docs
  test: ensure we endup with a single segment
  Make sure that we don't detect files as maven coordinate when installing a plugin (#28163)
  [Tests] temporary disable meta plugin rest tests #28163
  meta-plugin should install bin and config at the top level (#28162)
  Painless: Add public member read/write access test. (#28156)
  Docs: Clarify password protection support with keystore (#28157)
  [Docs] fix plugin properties inclusion for plugins authors
  ...
jasontedor added a commit that referenced this pull request Jan 11, 2018
* 6.x: (41 commits)
  Rename core module to server (#28190)
  [Test] Remove superfluous lines
  [Test] Add skip test for index range field with null values
  upgraded jna from 4.4.0-1 to 4.5.1 (#28183)
  [TEST] Do not call RandomizedTest.scaledRandomIntBetween from multiple threads
  [Docs] Correct response json in rank-eval.asciidoc
  Fix environment variable substitutions in list setting (#28106)
  Add scroll parameter to _reindex API (#28041)
  Include all sentences smaller than fragment_size in the unified highlighter (#28132)
  [Docs] Improvements in script-fields.asciidoc (#28174)
  [Docs] Remove Kerberos/SPNEGO Shield plugin (#28019)
  Ignore null value for range field (#27845) (#28116)
  docs: Replaces indexed script java api docs with stored script api docs
  test: ensure we endup with a single segment
  Make sure that we don't detect files as maven coordinate when installing a plugin (#28163)
  [Tests] temporary disable meta plugin rest tests #28163
  meta-plugin should install bin and config at the top level (#28162)
  Painless: Add public member read/write access test. (#28156)
  Docs: Clarify password protection support with keystore (#28157)
  [Docs] fix plugin properties inclusion for plugins authors
  ...
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants