Merge pull request #69 from owncloud/fix/create-home-init

This commit is contained in:
Alex Unger
2020-07-13 16:24:13 +02:00
committed by GitHub
5 changed files with 9 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
Bugfix: Provide token configuration from config
Fixed a bug that causes the createHome middleware to crash if no configuration for the TokenManager is propagated.
https://github.com/owncloud/ocis-proxy/pull/69

View File

@@ -3,9 +3,7 @@
"Namespace": "com.owncloud"
},
"oidc": {
"endpoint": "https://localhost:9200",
"realm": "",
"signing_algs": ["RS256", "PS256"],
"issuer": "https://localhost:9200",
"insecure": true
},
"policy_selector": {

View File

@@ -3,9 +3,7 @@
"Namespace": "com.owncloud"
},
"oidc": {
"endpoint": "https://localhost:9200",
"realm": "",
"signing_algs": ["RS256", "PS256"],
"issuer": "https://localhost:9200",
"insecure": true
},
"policy_selector": {

View File

@@ -296,6 +296,7 @@ func loadMiddlewares(ctx context.Context, l log.Logger, cfg *config.Config) alic
middleware.Logger(l),
middleware.RevaGatewayClient(sc),
middleware.AccountsClient(accounts),
middleware.TokenManagerConfig(cfg.TokenManager),
)
return alice.New(middleware.RedirectToHTTPS, oidcMW, uuidMW, chMW)

View File

@@ -25,6 +25,7 @@ func CreateHome(opts ...Option) func(next http.Handler) http.Handler {
"secret": opt.TokenManagerConfig.JWTSecret,
})
if err != nil {
opt.Logger.Error().Err(err).Msg("error creating a token manager")
w.WriteHeader(http.StatusInternalServerError)
return
}