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

feat(proxy): error templates customization #10374

Merged
merged 4 commits into from Mar 3, 2023

Conversation

samugi
Copy link
Contributor

@samugi samugi commented Feb 25, 2023

Summary

Allow customizing error templates via kong.configuration parameters

Checklist

Full changelog

  • [Implement ...]

Issue reference

Fix #7093

KAG-723
KAG-751

kong/tools/utils.lua Outdated Show resolved Hide resolved
@samugi samugi marked this pull request as draft February 27, 2023 08:00
@samugi samugi force-pushed the feat/kag-751-custom-error-templates branch from 312f7a2 to e30d4ce Compare February 27, 2023 08:22
@samugi samugi marked this pull request as ready for review February 27, 2023 08:22
@samugi samugi force-pushed the feat/kag-751-custom-error-templates branch from e30d4ce to f751f85 Compare February 27, 2023 08:28
@samugi samugi force-pushed the feat/kag-751-custom-error-templates branch from 63066ad to 489f289 Compare February 28, 2023 18:09
@samugi samugi force-pushed the feat/kag-751-custom-error-templates branch from 489f289 to 99b48cb Compare February 28, 2023 18:13
@samugi samugi mentioned this pull request Feb 28, 2023
kong/pdk/response.lua Outdated Show resolved Hide resolved
kong/tools/utils.lua Outdated Show resolved Hide resolved
@samugi samugi force-pushed the feat/kag-751-custom-error-templates branch 2 times, most recently from 84d2544 to 28f236c Compare February 28, 2023 21:37
@samugi samugi force-pushed the feat/kag-751-custom-error-templates branch 2 times, most recently from efa79f4 to 6638e21 Compare March 1, 2023 15:15
kong/tools/utils.lua Outdated Show resolved Hide resolved
honor Accept header values based on their q-values weights
@hanshuebner hanshuebner merged commit e1f22ce into master Mar 3, 2023
22 checks passed
@hanshuebner hanshuebner deleted the feat/kag-751-custom-error-templates branch March 3, 2023 09:56
Comment on lines +581 to +584
error_template_html = { typ = "string" },
error_template_json = { typ = "string" },
error_template_xml = { typ = "string" },
error_template_plain = { typ = "string" },

Choose a reason for hiding this comment

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

@hanshuebner
What data gets passed to these templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@esatterwhite the templates are rendered by passing them the error message as a string, see here for example. We will provide proper documentation before this is released.

hanshuebner pushed a commit that referenced this pull request Mar 6, 2023
* feat(proxy): error templates customization

Allow customizing error templates via kong.configuration parameters

* tests(pdk): initialize kong global to fix failing tests

* chore(*): changelog

* fix(proxy): honor Accept values weights

honor Accept header values based on their q-values weights
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.

Improve error handling
4 participants