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

Make care single source of truth for asset config on middleware #2000

Merged
merged 30 commits into from
Apr 14, 2024

Conversation

sainak
Copy link
Member

@sainak sainak commented Mar 21, 2024

Proposed Changes

  • add middleware level auth
  • cache middleware openid keys
  • cleanup middleware auth
  • add route to fetch asset configs for middlewares
  • add handlers to push config updates to middlewares
  • allow middleware asset to access related assetbeds
  • add a flag to indicate ocr log update status

Associated Issue

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@sainak sainak changed the title Add routes and authentcation to allow asset config fetching by middlewares Make care single source of truth for asset config on middleware Mar 21, 2024
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 60.62992% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 62.43%. Comparing base (51ce81e) to head (01dd94c).
Report is 41 commits behind head on develop.

❗ Current head 01dd94c differs from pull request most recent head 2044e57. Consider uploading reports for the commit 2044e57 to get more accurate results

Files Patch % Lines
care/utils/assetintegration/push_config.py 42.85% 17 Missing and 3 partials ⚠️
care/facility/api/serializers/asset.py 70.73% 10 Missing and 2 partials ⚠️
care/facility/api/viewsets/asset.py 61.53% 9 Missing and 1 partial ⚠️
care/facility/api/viewsets/patient_consultation.py 11.11% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2000      +/-   ##
===========================================
+ Coverage    62.20%   62.43%   +0.23%     
===========================================
  Files          221      222       +1     
  Lines        12204    12359     +155     
  Branches      1742     1764      +22     
===========================================
+ Hits          7591     7716     +125     
- Misses        4305     4320      +15     
- Partials       308      323      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sainak sainak requested a review from a team as a code owner April 5, 2024 04:54
Asset.objects.filter(
current_location__facility=current_location.facility
)
.annotate(
Copy link
Member

Choose a reason for hiding this comment

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

Refactor

Copy link
Member Author

Choose a reason for hiding this comment

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

Converting this to or was breaking the validation

care/facility/api/serializers/asset.py Outdated Show resolved Hide resolved
)
.annotate(
resolved_middleware_hostname=Coalesce(
NullIf(
Copy link
Member

Choose a reason for hiding this comment

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

See if you can use the or statement here

Copy link
Member Author

Choose a reason for hiding this comment

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

Converting this to or was returning assets from other hostnames as well

@sainak sainak requested a review from vigneshhari April 10, 2024 10:49
@vigneshhari vigneshhari merged commit 87cd40c into develop Apr 14, 2024
9 checks passed
@vigneshhari vigneshhari deleted the sainak/feat/middleware-config branch April 14, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants