outposts/proxy: add X-authentik-meta-version

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-01 20:41:55 +01:00
parent f2023a7af2
commit d0ceafe79e
4 changed files with 8 additions and 1 deletions

View file

@ -40,7 +40,6 @@ COPY --from=website-builder /work/website/help/ /work/website/help/
COPY ./cmd /work/cmd COPY ./cmd /work/cmd
COPY ./web/static.go /work/web/static.go COPY ./web/static.go /work/web/static.go
COPY ./website/static.go /work/website/static.go
COPY ./internal /work/internal COPY ./internal /work/internal
COPY ./go.mod /work/go.mod COPY ./go.mod /work/go.mod
COPY ./go.sum /work/go.sum COPY ./go.sum /work/go.sum

View file

@ -5,6 +5,8 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"strings" "strings"
"goauthentik.io/internal/constants"
) )
func (a *Application) addHeaders(headers http.Header, c *Claims) { func (a *Application) addHeaders(headers http.Header, c *Claims) {
@ -28,6 +30,7 @@ func (a *Application) addHeaders(headers http.Header, c *Claims) {
headers.Set("X-authentik-meta-outpost", a.outpostName) headers.Set("X-authentik-meta-outpost", a.outpostName)
headers.Set("X-authentik-meta-provider", a.proxyConfig.Name) headers.Set("X-authentik-meta-provider", a.proxyConfig.Name)
headers.Set("X-authentik-meta-app", a.proxyConfig.AssignedApplicationSlug) headers.Set("X-authentik-meta-app", a.proxyConfig.AssignedApplicationSlug)
headers.Set("X-authentik-meta-version", constants.OutpostUserAgent())
userAttributes := c.Proxy.UserAttributes userAttributes := c.Proxy.UserAttributes
// Attempt to set basic auth based on user's attributes // Attempt to set basic auth based on user's attributes

View file

@ -13,6 +13,7 @@ import (
func (ws *WebServer) configureStatic() { func (ws *WebServer) configureStatic() {
statRouter := ws.lh.NewRoute().Subrouter() statRouter := ws.lh.NewRoute().Subrouter()
statRouter.Use(ws.staticHeaderMiddleware)
indexLessRouter := statRouter.NewRoute().Subrouter() indexLessRouter := statRouter.NewRoute().Subrouter()
indexLessRouter.Use(web.DisableIndex) indexLessRouter.Use(web.DisableIndex)
// Media files, always local // Media files, always local

View file

@ -42,6 +42,10 @@ Besides these user-specific headers, some application specific headers are also
The authentik application's slug. The authentik application's slug.
- X-authentik-meta-version: `authentik-outpost@1.2.3 (build=tagged)`
The authentik outpost's version.
# HTTPS # HTTPS
The outpost listens on both 9000 for HTTP and 9443 for HTTPS. The outpost listens on both 9000 for HTTP and 9443 for HTTPS.