1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-08 22:46:33 +02:00

Allow users to choose detailed error messages on error pages

This commit is contained in:
Joel Speed
2021-02-10 19:34:19 +00:00
committed by Joel Speed
parent a63ed0225c
commit 6ecbc7bc4e
5 changed files with 111 additions and 17 deletions

View File

@ -22,6 +22,12 @@ type Templates struct {
// password form if a static passwords file (htpasswd file) has been
// configured.
DisplayLoginForm bool `flag:"display-htpasswd-form" cfg:"display_htpasswd_form"`
// Debug renders detailed errors when an error page is shown.
// It is not advised to use this in production as errors may contain sensitive
// information.
// Use only for diagnosing backend errors.
Debug bool `flag:"show-debug-on-error" cfg:"show-debug-on-error"`
}
func templatesFlagSet() *pflag.FlagSet {
@ -31,6 +37,7 @@ func templatesFlagSet() *pflag.FlagSet {
flagSet.String("banner", "", "custom banner string. Use \"-\" to disable default banner.")
flagSet.String("footer", "", "custom footer string. Use \"-\" to disable default footer.")
flagSet.Bool("display-htpasswd-form", true, "display username / password login form if an htpasswd file is provided")
flagSet.Bool("show-debug-on-error", false, "show detailed error information on error pages (WARNING: this may contain sensitive information - do not use in production)")
return flagSet
}