chore: replace interface with any

This commit is contained in:
Florian Schade
2026-04-23 09:31:11 +02:00
committed by Ralf Haferkamp
parent 8f26149743
commit 288e67cc39
138 changed files with 933 additions and 934 deletions
@@ -7,27 +7,27 @@ import (
)
// StorageSystemFromStruct will adapt an OpenCloud config struct into a reva mapstructure to start a reva service.
func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} {
func StorageSystemFromStruct(cfg *config.Config) map[string]any {
localEndpoint := pkgconfig.LocalEndpoint(cfg.GRPC.Protocol, cfg.GRPC.Addr)
rcfg := map[string]interface{}{
"shared": map[string]interface{}{
rcfg := map[string]any{
"shared": map[string]any{
"jwt_secret": cfg.TokenManager.JWTSecret,
"gatewaysvc": cfg.Reva.Address,
"skip_user_groups_in_token": cfg.SkipUserGroupsInToken,
"grpc_client_options": cfg.Reva.GetGRPCClientConfig(),
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
},
"grpc": map[string]interface{}{
"grpc": map[string]any{
"network": cfg.GRPC.Protocol,
"address": cfg.GRPC.Addr,
"tls_settings": map[string]interface{}{
"tls_settings": map[string]any{
"enabled": cfg.GRPC.TLS.Enabled,
"certificate": cfg.GRPC.TLS.Cert,
"key": cfg.GRPC.TLS.Key,
},
"services": map[string]interface{}{
"gateway": map[string]interface{}{
"services": map[string]any{
"gateway": map[string]any{
// registries are located on the gateway
"authregistrysvc": localEndpoint,
"storageregistrysvc": localEndpoint,
@@ -41,13 +41,13 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} {
"cache_store": "noop",
"cache_database": "system",
},
"userprovider": map[string]interface{}{
"userprovider": map[string]any{
"driver": "memory",
"drivers": map[string]interface{}{
"memory": map[string]interface{}{
"users": map[string]interface{}{
"serviceuser": map[string]interface{}{
"id": map[string]interface{}{
"drivers": map[string]any{
"memory": map[string]any{
"users": map[string]any{
"serviceuser": map[string]any{
"id": map[string]any{
"opaqueId": cfg.SystemUserID,
"idp": "internal",
"type": userpb.UserType_USER_TYPE_SERVICE,
@@ -59,77 +59,77 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} {
},
},
},
"authregistry": map[string]interface{}{
"authregistry": map[string]any{
"driver": "static",
"drivers": map[string]interface{}{
"static": map[string]interface{}{
"rules": map[string]interface{}{
"drivers": map[string]any{
"static": map[string]any{
"rules": map[string]any{
"machine": localEndpoint,
},
},
},
},
"authprovider": map[string]interface{}{
"authprovider": map[string]any{
"auth_manager": "machine",
"auth_managers": map[string]interface{}{
"machine": map[string]interface{}{
"auth_managers": map[string]any{
"machine": map[string]any{
"api_key": cfg.SystemUserAPIKey,
"gateway_addr": localEndpoint,
},
},
},
"permissions": map[string]interface{}{
"permissions": map[string]any{
"driver": "demo",
"drivers": map[string]interface{}{
"demo": map[string]interface{}{},
"drivers": map[string]any{
"demo": map[string]any{},
},
},
"storageregistry": map[string]interface{}{
"storageregistry": map[string]any{
"driver": "static",
"drivers": map[string]interface{}{
"static": map[string]interface{}{
"rules": map[string]interface{}{
"/": map[string]interface{}{
"drivers": map[string]any{
"static": map[string]any{
"rules": map[string]any{
"/": map[string]any{
"address": localEndpoint,
},
},
},
},
},
"storageprovider": map[string]interface{}{
"storageprovider": map[string]any{
"driver": cfg.Driver,
"drivers": metadataDrivers(localEndpoint, cfg),
"data_server_url": cfg.DataServerURL,
},
},
"interceptors": map[string]interface{}{
"prometheus": map[string]interface{}{
"interceptors": map[string]any{
"prometheus": map[string]any{
"namespace": "opencloud",
"subsystem": "storage_system",
},
},
},
"http": map[string]interface{}{
"http": map[string]any{
"network": cfg.HTTP.Protocol,
"address": cfg.HTTP.Addr,
// no datagateway needed as the metadata clients directly talk to the dataprovider with the simple protocol
"services": map[string]interface{}{
"dataprovider": map[string]interface{}{
"services": map[string]any{
"dataprovider": map[string]any{
"prefix": "data",
"driver": cfg.Driver,
"drivers": metadataDrivers(localEndpoint, cfg),
"data_txs": map[string]interface{}{
"simple": map[string]interface{}{
"data_txs": map[string]any{
"simple": map[string]any{
"cache_store": "noop",
"cache_database": "system",
"cache_table": "stat",
},
"spaces": map[string]interface{}{
"spaces": map[string]any{
"cache_store": "noop",
"cache_database": "system",
"cache_table": "stat",
},
"tus": map[string]interface{}{
"tus": map[string]any{
"cache_store": "noop",
"cache_database": "system",
"cache_table": "stat",
@@ -137,8 +137,8 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} {
},
},
},
"middlewares": map[string]interface{}{
"prometheus": map[string]interface{}{
"middlewares": map[string]any{
"prometheus": map[string]any{
"namespace": "opencloud",
"subsystem": "storage_system",
},
@@ -148,8 +148,8 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} {
return rcfg
}
func metadataDrivers(localEndpoint string, cfg *config.Config) map[string]interface{} {
m := map[string]interface{}{
func metadataDrivers(localEndpoint string, cfg *config.Config) map[string]any {
m := map[string]any{
"metadata_backend": "messagepack",
"root": cfg.Drivers.Decomposed.Root,
"user_layout": "{{.Id.OpaqueId}}",
@@ -160,11 +160,11 @@ func metadataDrivers(localEndpoint string, cfg *config.Config) map[string]interf
"lock_cycle_duration_factor": cfg.Drivers.Decomposed.LockCycleDurationFactor,
"multi_tenant_enabled": false, // storage-system doesn't use tenants, even if it's enabled for storage-users
"disable_versioning": true,
"statcache": map[string]interface{}{
"statcache": map[string]any{
"cache_store": "noop",
"cache_database": "system",
},
"filemetadatacache": map[string]interface{}{
"filemetadatacache": map[string]any{
"cache_store": cfg.FileMetadataCache.Store,
"cache_nodes": cfg.FileMetadataCache.Nodes,
"cache_database": cfg.FileMetadataCache.Database,
@@ -175,7 +175,7 @@ func metadataDrivers(localEndpoint string, cfg *config.Config) map[string]interf
},
}
return map[string]interface{}{
return map[string]any{
"ocis": m, // deprecated: use decomposed
"decomposed": m,
}