mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-11 22:08:14 +02:00
authenticate: redirect / to /.pomerium/ (#2770)
This commit is contained in:
parent
d90d4caf1a
commit
a5034aabae
3 changed files with 5 additions and 2 deletions
|
@ -67,6 +67,9 @@ func (a *Authenticate) Mount(r *mux.Router) {
|
||||||
)(h)
|
)(h)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// redirect / to /.pomerium/
|
||||||
|
r.Path("/").Handler(http.RedirectHandler("/.pomerium/", http.StatusFound))
|
||||||
|
|
||||||
r.Path("/robots.txt").HandlerFunc(a.RobotsTxt).Methods(http.MethodGet)
|
r.Path("/robots.txt").HandlerFunc(a.RobotsTxt).Methods(http.MethodGet)
|
||||||
// Identity Provider (IdP) endpoints
|
// Identity Provider (IdP) endpoints
|
||||||
r.Path("/oauth2/callback").Handler(httputil.HandlerFunc(a.OAuthCallback)).Methods(http.MethodGet)
|
r.Path("/oauth2/callback").Handler(httputil.HandlerFunc(a.OAuthCallback)).Methods(http.MethodGet)
|
||||||
|
|
|
@ -110,7 +110,7 @@ func (b *Builder) buildPomeriumHTTPRoutes(options *config.Options, domain string
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if config.IsAuthenticate(options.Services) && hostMatchesDomain(authenticateURL, domain) {
|
if config.IsAuthenticate(options.Services) && hostMatchesDomain(authenticateURL, domain) {
|
||||||
r, err := b.buildControlPlanePathRoute(options.AuthenticateCallbackPath, false)
|
r, err := b.buildControlPlanePrefixRoute("/", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ func Test_buildPomeriumHTTPRoutes(t *testing.T) {
|
||||||
`+routeString("path", "/.well-known/pomerium", false)+`,
|
`+routeString("path", "/.well-known/pomerium", false)+`,
|
||||||
`+routeString("prefix", "/.well-known/pomerium/", false)+`,
|
`+routeString("prefix", "/.well-known/pomerium/", false)+`,
|
||||||
`+routeString("path", "/robots.txt", false)+`,
|
`+routeString("path", "/robots.txt", false)+`,
|
||||||
`+routeString("path", "/oauth2/callback", false)+`
|
`+routeString("prefix", "/", false)+`
|
||||||
]`, routes)
|
]`, routes)
|
||||||
})
|
})
|
||||||
t.Run("proxy fronting authenticate", func(t *testing.T) {
|
t.Run("proxy fronting authenticate", func(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue