|
|
|
|
@ -9,6 +9,7 @@ import (
|
|
|
|
|
"io/fs" |
|
|
|
|
"net/http" |
|
|
|
|
"net/url" |
|
|
|
|
"os" |
|
|
|
|
"path" |
|
|
|
|
"strconv" |
|
|
|
|
"strings" |
|
|
|
|
@ -41,6 +42,7 @@ import (
|
|
|
|
|
"github.com/dexidp/dex/connector/saml" |
|
|
|
|
"github.com/dexidp/dex/pkg/log" |
|
|
|
|
"github.com/dexidp/dex/storage" |
|
|
|
|
"github.com/dexidp/dex/web" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// LocalConnector is the local passwordDB connector which is an internal
|
|
|
|
|
@ -101,20 +103,20 @@ type Config struct {
|
|
|
|
|
|
|
|
|
|
// WebConfig holds the server's frontend templates and asset configuration.
|
|
|
|
|
type WebConfig struct { |
|
|
|
|
// A file path to web static. If set, WebFS will be ignored.
|
|
|
|
|
// A file path to static web assets.
|
|
|
|
|
//
|
|
|
|
|
// It is expected to contain the following directories:
|
|
|
|
|
//
|
|
|
|
|
// * static - Static static served at "( issuer URL )/static".
|
|
|
|
|
// * templates - HTML templates controlled by dex.
|
|
|
|
|
// * themes/(theme) - Static static served at "( issuer URL )/theme".
|
|
|
|
|
//
|
|
|
|
|
Dir string |
|
|
|
|
|
|
|
|
|
// Alternative way to configure web static filesystem. Dir overrides this.
|
|
|
|
|
// It's expected to contain the same files and directories as mentioned
|
|
|
|
|
// above in Dir doc.
|
|
|
|
|
// Alternative way to programatically configure static web assets.
|
|
|
|
|
// If Dir is specified, WebFS is ignored.
|
|
|
|
|
// It's expected to contain the same files and directories as mentioned above.
|
|
|
|
|
//
|
|
|
|
|
// Note: this is experimental. Might get removed without notice!
|
|
|
|
|
WebFS fs.FS |
|
|
|
|
|
|
|
|
|
// Defaults to "( issuer URL )/theme/logo.png"
|
|
|
|
|
@ -210,9 +212,15 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
|
|
|
|
|
supported[respType] = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
webFS := web.FS() |
|
|
|
|
if c.Web.Dir != "" { |
|
|
|
|
webFS = os.DirFS(c.Web.Dir) |
|
|
|
|
} else if c.Web.WebFS != nil { |
|
|
|
|
webFS = c.Web.WebFS |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
web := webConfig{ |
|
|
|
|
dir: c.Web.Dir, |
|
|
|
|
webFS: c.Web.WebFS, |
|
|
|
|
webFS: webFS, |
|
|
|
|
logoURL: c.Web.LogoURL, |
|
|
|
|
issuerURL: c.Issuer, |
|
|
|
|
issuer: c.Web.Issuer, |
|
|
|
|
|