mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-18 03:27:16 +02:00
internal/frontend: resolve authN helper url (#1521)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
847860ba32
commit
5cc65adc48
3 changed files with 7 additions and 3 deletions
|
@ -64,6 +64,9 @@ func (a *Authorize) deniedResponse(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Authorize) htmlDeniedResponse(code int32, reason string, headers map[string]string) *envoy_service_auth_v2.CheckResponse {
|
func (a *Authorize) htmlDeniedResponse(code int32, reason string, headers map[string]string) *envoy_service_auth_v2.CheckResponse {
|
||||||
|
opts := a.currentOptions.Load()
|
||||||
|
debugEndpoint := opts.GetAuthenticateURL().ResolveReference(&url.URL{Path: "/.pomerium/"})
|
||||||
|
|
||||||
var details string
|
var details string
|
||||||
switch code {
|
switch code {
|
||||||
case httputil.StatusInvalidClientCertificate:
|
case httputil.StatusInvalidClientCertificate:
|
||||||
|
@ -83,6 +86,7 @@ func (a *Authorize) htmlDeniedResponse(code int32, reason string, headers map[st
|
||||||
"Status": code,
|
"Status": code,
|
||||||
"StatusText": reason,
|
"StatusText": reason,
|
||||||
"CanDebug": code/100 == 4,
|
"CanDebug": code/100 == 4,
|
||||||
|
"DebugURL": debugEndpoint,
|
||||||
"Error": details,
|
"Error": details,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
<div class="message">
|
<div class="message">
|
||||||
<div class="text-monospace">{{.Error}}</div>
|
<div class="text-monospace">{{.Error}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{if .CanDebug}}
|
{{if and .CanDebug .DebugURL }}
|
||||||
<div class="message">
|
<div class="message">
|
||||||
If you should have access, contact your administrator and provide
|
If you should have access, contact your administrator and provide
|
||||||
them with your
|
them with your
|
||||||
<a href="/.pomerium/">request details</a>.
|
<a href="{{.DebugURL}}">request details</a>.
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</section>
|
</section>
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue