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

Package registry as proxy of package-storage #915

Merged
merged 18 commits into from
Dec 5, 2022

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Nov 24, 2022

Fixes elastic/kibana#145582

This PR changes the behaviour of the requests performed against package-storage.elastic.co. Instead of being a http redirect (CODE 301), it has been changed to perform the actual request against package-storage and forward the contents/headers to the user.

Example of the request when this was applied to proxy mode:

 $ curl -o file.zip -v "http://localhost:8888/epr/elastic_package_registry/elastic_package_registry-0.0.1.zip"
*   Trying 127.0.0.1:8888...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to localhost (127.0.0.1) port 8888 (#0)
> GET /epr/elastic_package_registry/elastic_package_registry-0.0.1.zip HTTP/1.1
> Host: localhost:8888
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Cache-Control: max-age=600
< Cache-Control: public
< Content-Length: 655945
< Content-Type: application/zip
< Last-Modified: Tue, 26 Jul 2022 17:36:46 GMT
< Date: Thu, 24 Nov 2022 14:59:42 GMT
< 
{ [16384 bytes data]
100  640k  100  640k    0     0  1602k      0 --:--:-- --:--:-- --:--:-- 1605k
* Connection #0 to host localhost left intact

@mrodm mrodm self-assigned this Nov 24, 2022
@elasticmachine
Copy link

elasticmachine commented Nov 24, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-12-02T13:06:21.853+0000

  • Duration: 5 min 58 sec

Test stats 🧪

Test Results
Failed 0
Passed 242
Skipped 0
Total 242

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
proxymode/resolver.go Outdated Show resolved Hide resolved
@mrodm mrodm marked this pull request as ready for review December 1, 2022 12:51
@mrodm mrodm requested a review from jsoriano December 1, 2022 12:51
packages/resolver.go Outdated Show resolved Hide resolved
@mrodm mrodm requested a review from jsoriano December 2, 2022 15:24
@jsoriano jsoriano merged commit 1259eb8 into elastic:main Dec 5, 2022
@mrodm mrodm deleted the proxy_requests_to_storage branch December 12, 2022 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Upgrading Elastic-Stack breaks Fleet-Management if certain URLs to *.elastic.co are blocked
3 participants