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

[WIP] upgrade flask #5508

Merged
merged 2 commits into from
Jul 31, 2023
Merged

[WIP] upgrade flask #5508

merged 2 commits into from
Jul 31, 2023

Conversation

tmpayton
Copy link
Contributor

@tmpayton tmpayton commented Jul 20, 2023

Summary (required)

This PR upgrades flask. This is a continuation of the previous PR.

The only unreviewed changes are in utils.py

Required reviewers 2-3 Devs

Impacted areas of the application

  • webservices/Schemas
  • webservices/Resources
  • webservices/args
  • automated tests

Related PRs

Related PRs against other branches:

branch PR
Marshmallow pagination PR

How to test

  1. Checkout this branch
  2. pip install -r requirements.txt
  3. snyk test --file=requirements.txt --package-manager=pip
  4. pytest
  5. flask run
  6. Test all endpoints

)
if env.get_credential("PRODUCTION"):
if env.get_credential("PRODUCTION") or env.get_credential("STAGE"):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to have api_key field in Stage as well?

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #5508 (0abff3d) into develop (4b821f6) will increase coverage by 0.08%.
Report is 6 commits behind head on develop.
The diff coverage is 86.47%.

@@             Coverage Diff             @@
##           develop    #5508      +/-   ##
===========================================
+ Coverage    85.50%   85.58%   +0.08%     
===========================================
  Files           81       81              
  Lines         8173     8227      +54     
===========================================
+ Hits          6988     7041      +53     
- Misses        1185     1186       +1     
Files Changed Coverage Δ
webservices/resources/dates.py 100.00% <ø> (ø)
webservices/spec.py 94.73% <ø> (ø)
webservices/schemas.py 89.11% <83.45%> (+0.70%) ⬆️
webservices/args.py 97.56% <100.00%> (+0.17%) ⬆️
webservices/common/models/dates.py 100.00% <100.00%> (ø)
webservices/common/models/filings.py 92.53% <100.00%> (ø)
webservices/common/models/itemized.py 99.04% <100.00%> (ø)
webservices/exceptions.py 100.00% <100.00%> (ø)
webservices/resources/reports.py 93.87% <100.00%> (ø)
webservices/resources/totals.py 92.80% <100.00%> (ø)
... and 3 more

@@ -44,9 +44,9 @@ class Resource(six.with_metaclass(MethodResourceMeta, restful.Resource)):


API_KEY_ARG = fields.Str(
required=True, missing="DEMO_KEY", description=docs.API_KEY_DESCRIPTION,
missing="DEMO_KEY", description=docs.API_KEY_DESCRIPTION,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

required = True caused an error when pushing to PROD. I was not able to reproduce this locally. But I tested using just missing and it worked on Stage.

I think the error is due to a change in webargs where multiple calls to use_kwargs causes a bug when one of them is required. Here is a comment mentioning this. Our situation is not exactly the same, but I think it's the same error.

Copy link
Member

@cnlucas cnlucas left a comment

Choose a reason for hiding this comment

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

Great job! Thanks @tmpayton

Copy link
Contributor

@pkfec pkfec left a comment

Choose a reason for hiding this comment

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

Great work! @tmpayton

@tmpayton tmpayton mentioned this pull request Jul 31, 2023
@pkfec pkfec merged commit 2ff0502 into develop Jul 31, 2023
3 checks passed
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.

[Snyk:High] flask Information Exposure (due by 06/09/2023)
3 participants