Skip to content

feat: RequestContextMiddleware and config in hooks #8480

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

Open
wants to merge 7 commits into
base: alpha
Choose a base branch
from

Conversation

Moumouls
Copy link
Member

Pull Request

Issue

Closes: #8479 8479

Approach

Add a middleware option and add config to hooks

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: requestContextMiddleware and config in hooks feat: RequestContextMiddleware and config in hooks Mar 12, 2023
@parse-github-assistant
Copy link

Thanks for opening this pull request!

@Moumouls Moumouls changed the title feat: RequestContextMiddleware and config in hooks feat: requestContextMiddleware and config in hooks Mar 12, 2023
@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: requestContextMiddleware and config in hooks feat: RequestContextMiddleware and config in hooks Mar 12, 2023
@codecov
Copy link

codecov bot commented Mar 12, 2023

Codecov Report

Patch coverage: 81.81% and project coverage change: -0.18 ⚠️

Comparison is base (65e5879) 94.33% compared to head (415e417) 94.15%.

❗ Current head 415e417 differs from pull request most recent head 748f68f. Consider uploading reports for the commit 748f68f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8480      +/-   ##
==========================================
- Coverage   94.33%   94.15%   -0.18%     
==========================================
  Files         183      183              
  Lines       14515    14526      +11     
==========================================
- Hits        13692    13677      -15     
- Misses        823      849      +26     
Impacted Files Coverage Δ
src/Options/Definitions.js 100.00% <ø> (ø)
src/Options/index.js 100.00% <ø> (ø)
src/Routers/FunctionsRouter.js 94.20% <ø> (ø)
src/cloud-code/Parse.Cloud.js 99.29% <ø> (ø)
src/triggers.js 95.35% <ø> (ø)
src/GraphQL/ParseGraphQLServer.js 92.59% <80.00%> (-1.29%) ⬇️
src/ParseServer.js 92.37% <80.00%> (-0.27%) ⬇️
src/Controllers/HooksController.js 94.78% <100.00%> (+0.04%) ⬆️

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Moumouls
Copy link
Member Author

Moumouls commented Apr 8, 2023

@mtrezza @dblythy any feedback on this one ? I can fix the little fail after a first review.

@mtrezza
Copy link
Member

mtrezza commented Mar 24, 2024

@Moumouls Any suggestion what we should do with this PR? Does this require more development? If so; I'd change this to draft, otherwise maybe we can get this merged?

@Moumouls
Copy link
Member Author

Hi @mtrezza we don't need more development here. This PR is to allow developers to mutate the config using a provided middleware.

It's super useful, when you need to inject globally on each request (after the Parse middleware) some providers, for monitoring, feature flags, based on the current user/ parse config. Then the injected prop will be available in each hooks, GQL API

@mtrezza
Copy link
Member

mtrezza commented May 31, 2024

And no breaking change, right?

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.

feat: add config to request standard object and dependency middleware implementation
2 participants