Skip to content

Conversation

@skh
Copy link
Contributor

@skh skh commented Oct 6, 2020

Summary

Restricts the direct package upload feature to Enterprise license, as discussed in #70582 (comment)

How to test this

  • Start elasticsearch locally with yarn es snapshot --license basic OTHER_OPTIONS (or find any other way to run with a basic license).
  • Start kibana locally.
  • export KIBANA_HOME=/path/to/your/kibana/project/directory
  • curl -X POST -u elastic:changeme http://localhost:5601/api/ingest_manager/epm/packages --data-binary @$KIBANA_HOME/x-pack/test/ingest_manager_api_integration/apis/fixtures/direct_upload_packages/apache_0.1.4.zip -H 'kbn-xsrf: xyz' -H 'Content-Type: application/zip'

This should result in the response {"statusCode":403,"error":"Forbidden","message":"Requires Enterprise license"}.

Do the same with a trial license. The installation should work.

@skh skh self-assigned this Oct 6, 2020
@skh skh added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 6, 2020
@skh skh marked this pull request as ready for review October 6, 2020 13:24
@skh skh requested a review from a team October 6, 2020 13:24
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@skh skh added release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0 Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project labels Oct 6, 2020
@neptunian
Copy link
Contributor

would be good to get an api integration test when the feature is public, but looks good otherwise.

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

I think checking in the service layer is preferable, but 👍 to ship this

@skh
Copy link
Contributor Author

skh commented Oct 6, 2020

I think checking in the service layer is preferable

I'm happy to move it around in a follow-up PR, but I'd prefer if we could stay consistent and there's also https://github.com/elastic/kibana/blob/master/x-pack/plugins/ingest_manager/server/routes/agent/handlers.ts#L288-L293

@jfsiii
Copy link
Contributor

jfsiii commented Oct 6, 2020

@skh Sure, like I said I'm fine shipping this.

As for consistency / precedent, the initial example was

const customUrl = appContextService.getConfig()?.registryUrl;
const isEnterprise = licenseService.isEnterprise();
if (customUrl && isEnterprise) {
return customUrl;
}

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@skh skh merged commit 4d58a00 into elastic:master Oct 6, 2020
skh added a commit to skh/kibana that referenced this pull request Oct 6, 2020
@skh skh deleted the 70582-restrict-package-upload-enterprise branch October 6, 2020 16:21
gmmorris added a commit that referenced this pull request Oct 8, 2020
…into feature/task_manager_429

* 'feature/task_manager_429' of github.com:elastic/kibana: (158 commits)
  Add license check to direct package upload handler. (#79653)
  [Ingest Manager] Rename API /api/ingest_manager => /api/fleet (#79193)
  [Security Solution][Resolver] Simplify CopyableField styling and add comments (#79594)
  Fine-tunes ML related text on Metrics UI (#79425)
  [ML] DF Analytics creation wizard: ensure job creation possible when model memory lower than estimate (#79229)
  Add new "Add Data" tutorials (#77237)
  Update APM telemetry docs (#79583)
  Revert "Add support for runtime field types to mappings editor. (#77420)" (#79611)
  Kibana request headers (#79218)
  ensure missing indexPattern error is bubbled up to error callout (#79378)
  Missing space fix (#79585)
  remove duplicate tab states (#79501)
  [data.ui] Lazy load UI components in data plugin. (#78889)
  Add generic type params to search dependency. (#79608)
  [Ingest Manager] Internal action for policy reassign (#78493)
  [ILM] Add index_codec to forcemerge action in hot and warm phases (#78175)
  [Ingest Manager] Update open API spec and add condition to agent upgrade endpoint (#79579)
  [ML] Hide Data Grid column options when histogram charts are enabled. (#79459)
  [Telemetry] Synchronous `setup` and `start` methods (#79457)
  [Observability] Persist time range across apps (#79258)
  ...
juliaElastic added a commit that referenced this pull request Jun 8, 2023
…59280)

## Summary

The package upload API was made GA, and it had a leftover enterprise
license requirement from the time it was only intended for devs. See
#79653
This pr removes that requirement.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 8, 2023
…astic#159280)

## Summary

The package upload API was made GA, and it had a leftover enterprise
license requirement from the time it was only intended for devs. See
elastic#79653
This pr removes that requirement.

(cherry picked from commit b8619ec)
kibanamachine added a commit that referenced this pull request Jun 8, 2023
…nt (#159280) (#159321)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Fleet] removed package upload API enterprise license requirement
(#159280)](#159280)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-08T14:51:54Z","message":"[Fleet]
removed package upload API enterprise license requirement
(#159280)\n\n## Summary\r\n\r\nThe package upload API was made GA, and
it had a leftover enterprise\r\nlicense requirement from the time it was
only intended for devs.
See\r\nhttps://github.com//pull/79653\r\nThis pr removes
that
requirement.","sha":"b8619ec216bebbcfdd27f34c6ef632e5fc2456be","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.8.0","v8.9.0"],"number":159280,"url":"https://github.com/elastic/kibana/pull/159280","mergeCommit":{"message":"[Fleet]
removed package upload API enterprise license requirement
(#159280)\n\n## Summary\r\n\r\nThe package upload API was made GA, and
it had a leftover enterprise\r\nlicense requirement from the time it was
only intended for devs.
See\r\nhttps://github.com//pull/79653\r\nThis pr removes
that
requirement.","sha":"b8619ec216bebbcfdd27f34c6ef632e5fc2456be"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159280","number":159280,"mergeCommit":{"message":"[Fleet]
removed package upload API enterprise license requirement
(#159280)\n\n## Summary\r\n\r\nThe package upload API was made GA, and
it had a leftover enterprise\r\nlicense requirement from the time it was
only intended for devs.
See\r\nhttps://github.com//pull/79653\r\nThis pr removes
that requirement.","sha":"b8619ec216bebbcfdd27f34c6ef632e5fc2456be"}}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:EPM Fleet team's Elastic Package Manager (aka Integrations) project release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants