all repos — homestead @ ecdd4e3a3999d49bbca1744487d7c04939dcf173

Code for my website

move OIDC configuration to own table

Alan Pearce
commit

ecdd4e3a3999d49bbca1744487d7c04939dcf173

parent

addcc7231a363b9a72d446d57d860b51b47655dd

2 files changed, 11 insertions(+), 7 deletions(-)

changed files
M domain/identity/oidc/service.godomain/identity/oidc/service.go
@@ -18,9 +18,9 @@ resource digit.Resource
} func New(cfg *config.Config, logger *log.Logger) *Service { - acctResource := "acct:" + cfg.OIDCEmail + acctResource := "acct:" + cfg.OIDC.Email resource := digit.NewResource(acctResource). - Link("http://openid.net/specs/connect/1.0/issuer", "", cfg.OIDCHost.String()) + Link("http://openid.net/specs/connect/1.0/issuer", "", cfg.OIDC.Host.String()) return &Service{ config: cfg,
@@ -33,7 +33,7 @@
func (s *Service) RegisterHandlers(mux *sharedhttp.ServeMux) { const oidcPath = "/.well-known/openid-configuration" mux.ServeMux.Handle(oidcPath, - sharedhttp.RedirectHandler(s.config.OIDCHost.JoinPath(oidcPath), http.StatusFound)) + sharedhttp.RedirectHandler(s.config.OIDC.Host.JoinPath(oidcPath), http.StatusFound)) } func (s *Service) GetResource() string {
M shared/config/config.goshared/config/config.go
@@ -37,6 +37,11 @@ Forge URL
Packages []string } +type OIDCConfig struct { + Email string + Host URL +} + type Config struct { Title string Email string
@@ -48,8 +53,7 @@ OriginalDomain string `toml:"original_domain"`
DomainStartDate string `toml:"domain_start_date"` GoatCounter URL `toml:"goatcounter"` - OIDCEmail string `toml:"oidc_email"` - OIDCHost URL `toml:"oidc_host"` + OIDC OIDCConfig Domains []string WildcardDomain string `toml:"wildcard_domain"`
@@ -106,8 +110,8 @@
if config.PublicEmail == "" { config.PublicEmail = config.Email } - if config.OIDCEmail == "" { - config.OIDCEmail = config.Email + if config.OIDC.Email == "" { + config.OIDC.Email = config.Email } return config, nil