mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-08 13:19:58 -06:00
move TokenManager back to extension config
This commit is contained in:
@@ -19,7 +19,7 @@ type Config struct {
|
||||
HTTP HTTP `yaml:"http,omitempty"`
|
||||
GRPC GRPC `yaml:"grpc,omitempty"`
|
||||
|
||||
TokenManager *shared.TokenManager `yaml:"token_manager,omitempty"`
|
||||
TokenManager *TokenManager `yaml:"token_manager,omitempty"`
|
||||
|
||||
Asset Asset `yaml:"asset,omitempty"`
|
||||
Repo Repo `yaml:"repo,omitempty"`
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/owncloud/ocis/extensions/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
@@ -101,11 +100,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{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
6
extensions/accounts/pkg/config/reva.go
Normal file
6
extensions/accounts/pkg/config/reva.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET"`
|
||||
}
|
||||
@@ -13,7 +13,10 @@ type Config struct {
|
||||
HTTP HTTPConfig `yaml:"http"`
|
||||
|
||||
// JWTSecret used to verify reva access token
|
||||
JWTSecret string `yaml:"jwt_secret"`
|
||||
|
||||
TransferSecret string `yaml:"transfer_secret" env:"STORAGE_TRANSFER_SECRET"`
|
||||
|
||||
JWTSecret string `yaml:"jwt_secret"`
|
||||
GatewayEndpoint string
|
||||
SkipUserGroupsInToken bool
|
||||
|
||||
@@ -22,8 +25,8 @@ type Config struct {
|
||||
UploadMaxChunkSize int `yaml:"upload_max_chunk_size"`
|
||||
UploadHTTPMethodOverride string `yaml:"upload_http_method_override"`
|
||||
DefaultUploadProtocol string `yaml:"default_upload_protocol"`
|
||||
TransferSecret string `yaml:"transfer_secret" env:"STORAGE_TRANSFER_SECRET"`
|
||||
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL"`
|
||||
|
||||
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL"`
|
||||
|
||||
Archiver Archiver
|
||||
AppProvider AppProvider
|
||||
|
||||
@@ -18,8 +18,8 @@ type Config struct {
|
||||
|
||||
HTTP HTTP `yaml:"http,omitempty"`
|
||||
|
||||
Reva Reva `yaml:"reva,omitempty"`
|
||||
TokenManager *shared.TokenManager `yaml:"token_manager,omitempty"`
|
||||
Reva Reva `yaml:"reva,omitempty"`
|
||||
TokenManager *TokenManager `yaml:"token_manager,omitempty"`
|
||||
|
||||
Spaces Spaces `yaml:"spaces,omitempty"`
|
||||
Identity Identity `yaml:"identity,omitempty"`
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/graph/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
func DefaultConfig() *config.Config {
|
||||
@@ -89,11 +88,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{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;GRAPH_JWT_SECRET"`
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -23,8 +23,8 @@ type Config struct {
|
||||
DataPath string `yaml:"data_path,omitempty" env:"SETTINGS_DATA_PATH"`
|
||||
Metadata Metadata `yaml:"metadata_config,omitempty"`
|
||||
|
||||
Asset Asset `yaml:"asset,omitempty"`
|
||||
TokenManager *shared.TokenManager `yaml:"token_manager,omitempty"`
|
||||
Asset Asset `yaml:"asset,omitempty"`
|
||||
TokenManager *TokenManager `yaml:"token_manager,omitempty"`
|
||||
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/owncloud/ocis/extensions/settings/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
@@ -87,11 +86,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.Metadata.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package generators_test
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
_ "github.com/onsi/ginkgo/v2"
|
||||
_ "github.com/onsi/gomega"
|
||||
|
||||
. "github.com/owncloud/ocis/ocis-pkg/generators"
|
||||
_ "github.com/owncloud/ocis/ocis-pkg/generators"
|
||||
)
|
||||
|
||||
var _ = Describe("Generators", func() {
|
||||
|
||||
Reference in New Issue
Block a user