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

Update turbinia-api-client and turbinia-client #1357

Merged
merged 5 commits into from Oct 5, 2023

Conversation

jleaniz
Copy link
Collaborator

@jleaniz jleaniz commented Oct 5, 2023

Description of the change

This PR updates turbinia-api-lib and turbinia-client

The Python API library was generated using openapi-generator (latest release v7.0.1). The requirements in this version align with fastapi < 0.99.0 because newer versions produce OpenAPI 3.1 specs which the generator does not yet fully support. For this reason, I am locking fastapi to <0.99.0 temporarily to be consistent with the requirements in turbinia-api-lib for pydantic and urllib3

Once support for OpenAPI 3.1 is fully implemented in the openapi-generator, we can loosen the FastAPI version.

Additionally, we should not be using urrlib3[secure] extra because it'll be deprecated (see urllib3/urllib3#2680) -- so i adjusted the requirement.

Applicable issues

Additional information

  • The ApiResponse object exposes downloaded data in a raw_data attribute. The read_chunks method is no longer available to the client.
  • Small change to the way the cli tool calls the upload_evidence method. The API library now handles file reading for the client, so we just pass a list of file paths instead.

Checklist

  • All tests were successful.
  • Unit tests added.
  • Documentation updated.

Locking fastapi to <= 0.98.0 until openapi-generator supports OpenAPI
3.1.0 specs
@jleaniz jleaniz self-assigned this Oct 5, 2023
@jleaniz jleaniz marked this pull request as ready for review October 5, 2023 19:18
@jleaniz jleaniz requested a review from aarontp October 5, 2023 19:18
Copy link
Member

@aarontp aarontp left a comment

Choose a reason for hiding this comment

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

LGTM

The API library handles reading the file data and setting the content
type.
@aarontp
Copy link
Member

aarontp commented Oct 5, 2023

New changes, LGTM too

@aarontp aarontp merged commit 51347ef into google:master Oct 5, 2023
5 checks passed
aarontp pushed a commit that referenced this pull request Oct 5, 2023
* Update turbinia-api-client and turbinia-client

Locking fastapi to <= 0.98.0 until openapi-generator supports OpenAPI
3.1.0 specs

* Update turbinia-api-lib

* Update

* Updates to requirements

* Updates to upload_evidence parameters

The API library handles reading the file data and setting the content
type.
@spacether
Copy link

@jleaniz if you want openapi v3.1.0 support, have you considered using openapi-json-schema-generator?

  • It is where the python client generator that you use is continuing its development
  • Openapi v3.1.0 support was added in v3.1.0 of openapi-json-schema-generator and is tested using the json schema test suite

@jleaniz
Copy link
Collaborator Author

jleaniz commented Oct 20, 2023

@spacether thanks for pointing that out. I wasn't aware of openapi-json-schema-generator, I'll check it out. Is the python generator from openapi-generator no longer going to be supported? Hopefully the APi methods we're calling from the generated client won't change too much.

@spacether
Copy link

spacether commented Oct 20, 2023

openapi-generator has a different python generator that was created by William, the main maintainer of that project. It uses pyantic v2.

  • it does not ensure that all json schema validations are run like the old python generator / openapi-json-schema-generator does
  • in my opinion openapi-generator is not taking steps to support openapi v3.1.0. I was the main one pushing feature additions there. No one else was contributing on them. When I met with the core team about it, the message that I received was that building out those features was not something that they cared about in Sept 2022. The issue tracking 3.1.0 in their project is here In the more than a year since then, there has not been any progress posted in that issue or in their 3.1.0 project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error in turbinia-client result task
3 participants