httputil : wrap handlers for additional context (#413)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2019-12-06 11:07:45 -08:00 committed by GitHub
parent 487fc655d6
commit b3d3159185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 495 additions and 463 deletions

View file

@ -10,21 +10,21 @@
<div id="main">
<div id="info-box">
<div class="card">
{{if .Session.Picture }}
<img class="icon" src="{{.Session.Picture}}" alt="user image" />
{{else}}
<img
class="icon"
src="/.pomerium/assets/img/account_circle-24px.svg"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
/>
{{end}}
<div class="card-header">
<h2>Current user</h2>
{{if .Session.Picture }}
<img class="icon" src="{{.Session.Picture}}" alt="user image" />
{{else}}
<img
class="icon"
src="/.pomerium/assets/img/account_circle-24px.svg"
xmlns="http://www.w3.org/2000/svg"
/>
{{end}}
</div>
<form method="POST" action="/.pomerium/sign_out">
<section>
<h2>Current user</h2>
<p class="message">Your current session details.</p>
<fieldset>
{{if .Session.Name}}
@ -189,11 +189,23 @@
<button class="button full" type="submit">Sign Out</button>
</div>
</form>
</div>
</div>
{{if .IsAdmin}}
<div id="info-box">
<div class="card">
<div class="card-header">
<h2>Sign-in-as</h2>
<img
class="icon"
src="/.pomerium/assets/img/supervised_user_circle-24px.svg"
xmlns="http://www.w3.org/2000/svg"
/>
</div>
{{if .IsAdmin}}
<form method="POST" action="/.pomerium/impersonate">
<section>
<h2>Sign-in-as</h2>
<p class="message">
Administrators can temporarily impersonate another user.
</p>
@ -235,7 +247,6 @@
{{ end }}
</div>
</div>
{{template "footer.html"}}
</div>
</body>
</html>

View file

@ -2,34 +2,57 @@
<!DOCTYPE html>
<html lang="en" charset="utf-8">
<head>
<title>{{.Code}} - {{.Title}}</title>
<title>{{.Status}} - {{.StatusText}}</title>
{{template "header.html"}}
</head>
<body>
<div id="main">
<div id="info-box">
<div class="card">
<img
class="icon"
src="/.pomerium/assets/img/error-24px.svg"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
/>
<h1 class="title">{{.Title}}</h1>
<div class="card-header">
<img
class="icon"
src="/.pomerium/assets/img/error-24px.svg"
xmlns="http://www.w3.org/2000/svg"
/>
<h2>{{.StatusText}}</h2>
<h2>{{.Status}}</h2>
</div>
<section>
<p class="message">
{{if .Message}}{{.Message}}{{end}} {{if .CanDebug}}Troubleshoot
your
<a href="/.pomerium/">session</a>.{{end}} {{if .RequestID}}
Request {{.RequestID}}{{end}}
</p>
<div class="message">
<div class="text-monospace">{{.Error}}</div>
</div>
{{if .CanDebug}}
<div class="message">
If you should have access, contact your administrator and provide
them with your
<a href="/.pomerium/">request details</a>.
</div>
{{end}} {{if.RetryURL}}
<div class="message">
If you believe the error is temporary, you can
<a href="{{.RetryURL}}">retry</a> the request.
</div>
{{end}}
</section>
<div class="card-footer">
<a href="https://www.pomerium.io">
<img
src="/.pomerium/assets/img/pomerium_circle_96.svg"
xmlns="http://www.w3.org/2000/svg"
class="icon"
/>
</a>
<div class="text-right text-muted small">
{{.RequestID}} <br />
Pomerium {{.Version}}
</div>
</div>
</div>
</div>
{{template "footer.html"}}
</div>
</body>
</html>
{{end}}

View file

@ -1,12 +0,0 @@
{{define "footer.html"}}
<footer>
<a href="https://www.pomerium.io">
<img
class="powered-by-pomerium"
src="/.pomerium/assets/img/pomerium.svg"
xmlns="http://www.w3.org/2000/svg"
height="25"
/>
</a>
</footer>
{{end}}

View file

@ -8,5 +8,4 @@
type="text/css"
href="/.pomerium/assets/style/main.css"
/>
{{end}}