mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-29 03:33:10 -04:00
feat!: Make the url signing secret a mandatory config option
This is required for allowing the web office to download images to insert into documents. The secret is generated by `opencloud init` and the server refuses to start now without a secret being set. (Breaking Change) Also the setting is now moved to the shared options as all involved services need the same secret to work properly. Related: https://github.com/opencloud-eu/web/issues/704
This commit is contained in:
committed by
Ralf Haferkamp
parent
589cee4ab3
commit
37609e52df
@@ -311,15 +311,11 @@ func loadMiddlewares(logger log.Logger, cfg *config.Config,
|
||||
RevaGatewaySelector: gatewaySelector,
|
||||
})
|
||||
|
||||
var signURLVerifier signedurl.Verifier
|
||||
|
||||
if cfg.PreSignedURL.JWTSigningSharedSecret != "" {
|
||||
var err error
|
||||
signURLVerifier, err = signedurl.NewJWTSignedURL(signedurl.WithSecret(cfg.PreSignedURL.JWTSigningSharedSecret))
|
||||
if err != nil {
|
||||
logger.Fatal().Err(err).Msg("Failed to initialize signed URL configuration.")
|
||||
}
|
||||
signURLVerifier, err := signedurl.NewJWTSignedURL(signedurl.WithSecret(cfg.Commons.URLSigningSecret))
|
||||
if err != nil {
|
||||
logger.Fatal().Err(err).Msg("Failed to initialize signed URL configuration.")
|
||||
}
|
||||
|
||||
authenticators = append(authenticators, middleware.SignedURLAuthenticator{
|
||||
Logger: logger,
|
||||
PreSignedURLConfig: cfg.PreSignedURL,
|
||||
|
||||
Reference in New Issue
Block a user