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

Custom authorization/rate limit error messages #1412

Open
upcFrost opened this issue Dec 3, 2024 · 1 comment
Open

Custom authorization/rate limit error messages #1412

upcFrost opened this issue Dec 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@upcFrost
Copy link

upcFrost commented Dec 3, 2024

Component(s)

router

Is your feature request related to a problem? Please describe.

It would be great to be able to change the default authorization/rate limit error message set in the loader.

Main reason - it's a string of no fixed structure and no guarantees that it won't change it the upcoming release. I'd really love to be able to have something like UNAUTHORIZED instead of the Unauthorized request to Subgraph ....

The functions in question are Loader.renderAuthorizationRejectedErrors and Loader.renderRateLimitRejectedErrors.

Describe the solution you'd like

I'd be fine with any way of accessing these errors w/o copying/patching half of the router code. The simplest one would probably be the "override" similar to other error overrides.

Describe alternatives you've considered

No response

Additional context

In general it would be nice to have some access to the resolve.Context created in the GraphQLHandler.ServeHTTP. One option I was exploring was to find a way to set a LoaderHook as there is a call to it right after the auth error is merged. But to set these hooks i'll need to customize the handler, which implies customizing the mux, which implies customizing the startup procedure. Basically too much copy-pasting for a single line of text

@upcFrost upcFrost added the enhancement New feature or request label Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant