use yaml tag instead of ocisConfig

This commit is contained in:
Willy Kloucek
2022-03-29 15:06:58 +02:00
parent 58b3bdf570
commit e224ce03cf
84 changed files with 851 additions and 851 deletions
+14 -14
View File
@@ -8,31 +8,31 @@ import (
// Config combines all available configuration parts.
type Config struct {
*shared.Commons `ocisConfig:"-" yaml:"-"`
*shared.Commons `yaml:"-"`
Service Service `ocisConfig:"-" yaml:"-"`
Service Service `yaml:"-"`
Tracing *Tracing `ocisConfig:"tracing"`
Log *Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
Tracing *Tracing `yaml:"tracing"`
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`
HTTP HTTP `ocisConfig:"http"`
HTTP HTTP `yaml:"http"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Reva Reva `ocisConfig:"reva"`
TokenManager TokenManager `yaml:"token_manager"`
Reva Reva `yaml:"reva"`
IdentityManagement IdentityManagement `ocisConfig:"identity_management"`
IdentityManagement IdentityManagement `yaml:"identity_management"`
AccountBackend string `ocisConfig:"account_backend" env:"OCS_ACCOUNT_BACKEND_TYPE"`
StorageUsersDriver string `ocisConfig:"storage_users_driver" env:"STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER"`
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY"`
AccountBackend string `yaml:"account_backend" env:"OCS_ACCOUNT_BACKEND_TYPE"`
StorageUsersDriver string `yaml:"storage_users_driver" env:"STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER"`
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY"`
Context context.Context `ocisConfig:"-" yaml:"-"`
Context context.Context `yaml:"-"`
}
// IdentityManagement keeps track of the OIDC address. This is because Reva requisite of uniqueness for users
// is based in the combination of IDP hostname + UserID. For more information see:
// https://github.com/cs3org/reva/blob/4fd0229f13fae5bc9684556a82dbbd0eced65ef9/pkg/storage/utils/decomposedfs/node/node.go#L856-L865
type IdentityManagement struct {
Address string `ocisConfig:"address" env:"OCIS_URL;OCS_IDM_ADDRESS"`
Address string `yaml:"address" env:"OCIS_URL;OCS_IDM_ADDRESS"`
}
+4 -4
View File
@@ -2,8 +2,8 @@ package config
// Debug defines the available debug configuration.
type Debug struct {
Addr string `ocisConfig:"addr" env:"OCS_DEBUG_ADDR"`
Token string `ocisConfig:"token" env:"OCS_DEBUG_TOKEN"`
Pprof bool `ocisConfig:"pprof" env:"OCS_DEBUG_PPROF"`
Zpages bool `ocisConfig:"zpages" env:"OCS_DEBUG_ZPAGES"`
Addr string `yaml:"addr" env:"OCS_DEBUG_ADDR"`
Token string `yaml:"token" env:"OCS_DEBUG_TOKEN"`
Pprof bool `yaml:"pprof" env:"OCS_DEBUG_PPROF"`
Zpages bool `yaml:"zpages" env:"OCS_DEBUG_ZPAGES"`
}
+8 -8
View File
@@ -2,16 +2,16 @@ package config
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `ocisConfig:"addr" env:"OCS_HTTP_ADDR"`
Root string `ocisConfig:"root" env:"OCS_HTTP_ROOT"`
Namespace string `ocisConfig:"-" yaml:"-"`
CORS CORS `ocisConfig:"cors"`
Addr string `yaml:"addr" env:"OCS_HTTP_ADDR"`
Root string `yaml:"root" env:"OCS_HTTP_ROOT"`
Namespace string `yaml:"-"`
CORS CORS `yaml:"cors"`
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allowed_credentials"`
AllowedOrigins []string `yaml:"allowed_origins"`
AllowedMethods []string `yaml:"allowed_methods"`
AllowedHeaders []string `yaml:"allowed_headers"`
AllowCredentials bool `yaml:"allowed_credentials"`
}
+2 -2
View File
@@ -2,10 +2,10 @@ package config
// Reva defines all available REVA configuration.
type Reva struct {
Address string `ocisConfig:"address" env:"REVA_GATEWAY"`
Address string `yaml:"address" env:"REVA_GATEWAY"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET"`
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET"`
}
+1 -1
View File
@@ -2,5 +2,5 @@ package config
// Service defines the available service configuration.
type Service struct {
Name string `ocisConfig:"-" yaml:"-"`
Name string `yaml:"-"`
}
+4 -4
View File
@@ -2,8 +2,8 @@ package config
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;OCS_TRACING_ENABLED"`
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;OCS_TRACING_TYPE"`
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;OCS_TRACING_ENDPOINT"`
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;OCS_TRACING_COLLECTOR"`
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCS_TRACING_ENABLED"`
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;OCS_TRACING_TYPE"`
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;OCS_TRACING_ENDPOINT"`
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;OCS_TRACING_COLLECTOR"`
}