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

This commit is contained in:
Alex Unger authored and GitHub committed 2020-07-13 16:24:13 +02:00
commit 57d1b53eed
5 files changed
+9 -6

No files matched your search

@@ -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
+1 -3
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": {
+1 -3
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": {
+1
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)
+1
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
}