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

Check valid and existing versions in webservices #517

Closed
jpmckinney opened this issue Jul 17, 2024 · 3 comments
Closed

Check valid and existing versions in webservices #517

jpmckinney opened this issue Jul 17, 2024 · 3 comments

Comments

@jpmckinney
Copy link
Contributor

jpmckinney commented Jul 17, 2024

From #421

version is already handled on eggstorage side, but we could also raise invalid request 400 HTTP code on invalid versions

We can do this using IEggStorage.get(). If (None, None) is returned, then no version matches. (That branch only runs if no version is provided.)

@jpmckinney
Copy link
Contributor Author

jpmckinney commented Jul 17, 2024

#500 has some relevant logic (project_version_exists) for checking whether the version is found, which is maybe more useful than just the validation.

@jpmckinney jpmckinney changed the title Check valid versions in webservices Check valid and existing versions in webservices Jul 18, 2024
@jpmckinney
Copy link
Contributor Author

jpmckinney commented Jul 18, 2024

Like with #117, I don't think we need to validate the version in the API.

I think it has never happened that a user configures an invalid version (e.g. containing "/", causing directory descent) or a colliding version (e.g. using the characters that eggstorage replaces with underscores).

As mentioned in #421, we can't change status codes without breaking backwards compatibility.

@jpmckinney
Copy link
Contributor Author

jpmckinney commented Jul 18, 2024

In terms of checking that the project and/or version exists:

  • schedule.json
  • listspiders.json
  • delversion.json
  • delproject.json

jpmckinney added a commit that referenced this issue Jul 22, 2024
…f egg not found" #517 by making similar changes to Schedule as LisSpiders in 94e87da
jpmckinney added a commit that referenced this issue Jul 23, 2024
…f egg not found" #517 by making similar changes to Schedule as LisSpiders in 94e87da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant