move TokenManager back to extension config
This commit is contained in:
@@ -18,8 +18,8 @@ type Config struct {
|
||||
|
||||
HTTP HTTP `yaml:"http,omitempty"`
|
||||
|
||||
TokenManager *shared.TokenManager `yaml:"token_manager,omitempty"`
|
||||
Reva Reva `yaml:"reva,omitempty"`
|
||||
TokenManager *TokenManager `yaml:"token_manager,omitempty"`
|
||||
Reva Reva `yaml:"reva,omitempty"`
|
||||
|
||||
IdentityManagement IdentityManagement `yaml:"identity_management,omitempty"`
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/ocs/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
@@ -76,11 +75,11 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
}
|
||||
|
||||
if cfg.TokenManager == nil && cfg.Commons != nil && cfg.Commons.TokenManager != nil {
|
||||
cfg.TokenManager = &shared.TokenManager{
|
||||
cfg.TokenManager = &config.TokenManager{
|
||||
JWTSecret: cfg.Commons.TokenManager.JWTSecret,
|
||||
}
|
||||
} else {
|
||||
cfg.TokenManager = &shared.TokenManager{}
|
||||
cfg.TokenManager = &config.TokenManager{}
|
||||
}
|
||||
|
||||
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
|
||||
@@ -4,3 +4,8 @@ package config
|
||||
type Reva struct {
|
||||
Address string `yaml:"address" env:"REVA_GATEWAY"`
|
||||
}
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET"`
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import (
|
||||
ssvc "github.com/owncloud/ocis/extensions/settings/pkg/service/v0"
|
||||
ocisLog "github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/ocis-pkg/service/grpc"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
accountsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/accounts/v0"
|
||||
settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v0"
|
||||
accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v0"
|
||||
@@ -724,7 +723,7 @@ func getService() svc.Service {
|
||||
Root: "/",
|
||||
Addr: "localhost:9110",
|
||||
},
|
||||
TokenManager: &shared.TokenManager{
|
||||
TokenManager: &config.TokenManager{
|
||||
JWTSecret: jwtSecret,
|
||||
},
|
||||
Log: &config.Log{
|
||||
|
||||
Reference in New Issue
Block a user