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

[breaking] Remove url and checksum attributes from ToolPayload endpoint #817

Closed
wants to merge 3 commits into from

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Aug 28, 2023

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • Tests for the changes have been added (for bug fixes / features)
  • What kind of change does this PR introduce?

change in the ToolPayload endpoint

  • What is the current behavior?

url and checksum can be used to install tools:

$ curl -X POST --header 'Content-Type: application/json' --d
ata '{"name": "dummy","version": "dummy","packager": "dumm
y", "url": "https://dl.espressif.com/dl/esptool-2.3.1-linu
x.tar.gz","checksum": "SHA-256:cff30841dad80ed5d7d2d58a318
43b63afa57528979a9c839806568167691d8e"}' 127.0.0.1:8991/v2
/pkgs/tools/installed
{"status":"ok"}
  • What is the new behavior?

We have removed the attributes, tools can be only installed using the package_index

$ curl -X POST --header 'Content-Type: application/json' --d
ata '{"name": "dummy","version": "dummy","packager": "dumm
y", "url": "https://dl.espressif.com/dl/esptool-2.3.1-linu
x.tar.gz","checksum": "SHA-256:cff30841dad80ed5d7d2d58a318
43b63afa57528979a9c839806568167691d8e"}' 127.0.0.1:8991/v2
/pkgs/tools/installed
{"name":"not_found","id":"73A55CXq","message":"tool not found with packager 'dummy', name 'dummy', version 'dummy'","temporary":false,"timeout":false,"fault":false}
  • Does this PR introduce a breaking change?

yes

  • Other information:

@umbynos umbynos added type: enhancement Proposed improvement topic: security Related to the protection of user data labels Aug 28, 2023
@umbynos umbynos self-assigned this Aug 28, 2023
@umbynos umbynos marked this pull request as draft September 4, 2023 12:56
@per1234 per1234 added the topic: code Related to content of the project itself label Sep 5, 2023
@umbynos
Copy link
Contributor Author

umbynos commented Sep 5, 2023

Needs more work since the endpoint works a bit different to what I originally expected: If not index is added using 127.0.0.1:8991/v2/pkgs/indexes/add endpoint, the result of the usage of the endpoint is always "tool not found with packager 'arduino', name 'bossac', version '1.7.0'". The arduino package index should be added by default.

@umbynos
Copy link
Contributor Author

umbynos commented Sep 7, 2023

Closing, since it's superseded by #826
Couple of notes:

  • The arguments we wanted to remove are actually used by the Web Editor
  • Removing completely url and checksum arguments causes any tool install to fail since the default index is not loaded by default, this requires a little refactoring (to load the default index without using the v2/pkgs/indexes/add endpoint).

@umbynos umbynos closed this Sep 7, 2023
@umbynos umbynos added the conclusion: declined Will not be worked on label Sep 7, 2023
@umbynos umbynos deleted the goa-endpoint-mod branch September 8, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: declined Will not be worked on topic: code Related to content of the project itself topic: security Related to the protection of user data type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants