remove unused GRAPH_SPACES_INSECURE
This commit is contained in:
8 files changed
+5
-31
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
Bugfix: Fix unused config option `GRAPH_SPACES_INSECURE`
|
||||||
|
|
||||||
|
We've removed the unused config option `GRAPH_SPACES_INSECURE` from the GRAPH service.
|
||||||
|
|
||||||
|
https://github.com/owncloud/ocis/pull/55555
|
||||||
@@ -32,7 +32,6 @@ type Spaces struct {
|
|||||||
WebDavBase string `yaml:"webdav_base" env:"OCIS_URL;GRAPH_SPACES_WEBDAV_BASE" desc:"The public facing URL of WebDAV."`
|
WebDavBase string `yaml:"webdav_base" env:"OCIS_URL;GRAPH_SPACES_WEBDAV_BASE" desc:"The public facing URL of WebDAV."`
|
||||||
WebDavPath string `yaml:"webdav_path" env:"GRAPH_SPACES_WEBDAV_PATH" desc:"The WebDAV subpath for spaces."`
|
WebDavPath string `yaml:"webdav_path" env:"GRAPH_SPACES_WEBDAV_PATH" desc:"The WebDAV subpath for spaces."`
|
||||||
DefaultQuota string `yaml:"default_quota" env:"GRAPH_SPACES_DEFAULT_QUOTA" desc:"The default quota in bytes."`
|
DefaultQuota string `yaml:"default_quota" env:"GRAPH_SPACES_DEFAULT_QUOTA" desc:"The default quota in bytes."`
|
||||||
Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;GRAPH_SPACES_INSECURE" desc:"Allow insecure connetctions to the spaces."`
|
|
||||||
ExtendedSpacePropertiesCacheTTL int `yaml:"extended_space_properties_cache_ttl" env:"GRAPH_SPACES_EXTENDED_SPACE_PROPERTIES_CACHE_TTL" desc:"Max TTL for the spaces property cache."`
|
ExtendedSpacePropertiesCacheTTL int `yaml:"extended_space_properties_cache_ttl" env:"GRAPH_SPACES_EXTENDED_SPACE_PROPERTIES_CACHE_TTL" desc:"Max TTL for the spaces property cache."`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ func DefaultConfig() *config.Config {
|
|||||||
WebDavBase: "https://localhost:9200",
|
WebDavBase: "https://localhost:9200",
|
||||||
WebDavPath: "/dav/spaces/",
|
WebDavPath: "/dav/spaces/",
|
||||||
DefaultQuota: "1000000000",
|
DefaultQuota: "1000000000",
|
||||||
Insecure: false,
|
|
||||||
},
|
},
|
||||||
Identity: config.Identity{
|
Identity: config.Identity{
|
||||||
Backend: "ldap",
|
Backend: "ldap",
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ type Graph struct {
|
|||||||
logger *log.Logger
|
logger *log.Logger
|
||||||
identityBackend identity.Backend
|
identityBackend identity.Backend
|
||||||
gatewayClient GatewayClient
|
gatewayClient GatewayClient
|
||||||
httpClient HTTPClient
|
|
||||||
roleService settingssvc.RoleService
|
roleService settingssvc.RoleService
|
||||||
spacePropertiesCache *ttlcache.Cache
|
spacePropertiesCache *ttlcache.Cache
|
||||||
eventsPublisher events.Publisher
|
eventsPublisher events.Publisher
|
||||||
@@ -91,11 +90,6 @@ func (g Graph) GetGatewayClient() GatewayClient {
|
|||||||
return g.gatewayClient
|
return g.gatewayClient
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetClient returns a gateway client to talk to reva
|
|
||||||
func (g Graph) GetHTTPClient() HTTPClient {
|
|
||||||
return g.httpClient
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g Graph) publishEvent(ev interface{}) {
|
func (g Graph) publishEvent(ev interface{}) {
|
||||||
if err := events.Publish(g.eventsPublisher, ev); err != nil {
|
if err := events.Publish(g.eventsPublisher, ev); err != nil {
|
||||||
g.logger.Error().
|
g.logger.Error().
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ var _ = Describe("Graph", func() {
|
|||||||
var (
|
var (
|
||||||
svc service.Service
|
svc service.Service
|
||||||
gatewayClient *mocks.GatewayClient
|
gatewayClient *mocks.GatewayClient
|
||||||
httpClient *mocks.HTTPClient
|
|
||||||
eventsPublisher mocks.Publisher
|
eventsPublisher mocks.Publisher
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
cfg *config.Config
|
cfg *config.Config
|
||||||
@@ -42,12 +41,10 @@ var _ = Describe("Graph", func() {
|
|||||||
cfg.TokenManager.JWTSecret = "loremipsum"
|
cfg.TokenManager.JWTSecret = "loremipsum"
|
||||||
|
|
||||||
gatewayClient = &mocks.GatewayClient{}
|
gatewayClient = &mocks.GatewayClient{}
|
||||||
httpClient = &mocks.HTTPClient{}
|
|
||||||
eventsPublisher = mocks.Publisher{}
|
eventsPublisher = mocks.Publisher{}
|
||||||
svc = service.NewService(
|
svc = service.NewService(
|
||||||
service.Config(cfg),
|
service.Config(cfg),
|
||||||
service.WithGatewayClient(gatewayClient),
|
service.WithGatewayClient(gatewayClient),
|
||||||
service.WithHTTPClient(httpClient),
|
|
||||||
service.EventsPublisher(&eventsPublisher),
|
service.EventsPublisher(&eventsPublisher),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ type Options struct {
|
|||||||
Middleware []func(http.Handler) http.Handler
|
Middleware []func(http.Handler) http.Handler
|
||||||
GatewayClient GatewayClient
|
GatewayClient GatewayClient
|
||||||
IdentityBackend identity.Backend
|
IdentityBackend identity.Backend
|
||||||
HTTPClient HTTPClient
|
|
||||||
RoleService settingssvc.RoleService
|
RoleService settingssvc.RoleService
|
||||||
RoleManager *roles.Manager
|
RoleManager *roles.Manager
|
||||||
EventsPublisher events.Publisher
|
EventsPublisher events.Publisher
|
||||||
@@ -73,13 +72,6 @@ func WithIdentityBackend(val identity.Backend) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithHTTPClient provides a function to set the http client option.
|
|
||||||
func WithHTTPClient(val HTTPClient) Option {
|
|
||||||
return func(o *Options) {
|
|
||||||
o.HTTPClient = val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// RoleService provides a function to set the RoleService option.
|
// RoleService provides a function to set the RoleService option.
|
||||||
func RoleService(val settingssvc.RoleService) Option {
|
func RoleService(val settingssvc.RoleService) Option {
|
||||||
return func(o *Options) {
|
return func(o *Options) {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ var _ = Describe("Users changing their own password", func() {
|
|||||||
var (
|
var (
|
||||||
svc service.Service
|
svc service.Service
|
||||||
gatewayClient *mocks.GatewayClient
|
gatewayClient *mocks.GatewayClient
|
||||||
httpClient *mocks.HTTPClient
|
|
||||||
ldapClient *mocks.Client
|
ldapClient *mocks.Client
|
||||||
ldapConfig config.LDAP
|
ldapConfig config.LDAP
|
||||||
identityBackend identity.Backend
|
identityBackend identity.Backend
|
||||||
@@ -70,13 +69,11 @@ var _ = Describe("Users changing their own password", func() {
|
|||||||
identityBackend, err = identity.NewLDAPBackend(ldapClient, ldapConfig, &loggger)
|
identityBackend, err = identity.NewLDAPBackend(ldapClient, ldapConfig, &loggger)
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
|
|
||||||
httpClient = &mocks.HTTPClient{}
|
|
||||||
eventsPublisher = mocks.Publisher{}
|
eventsPublisher = mocks.Publisher{}
|
||||||
svc = service.NewService(
|
svc = service.NewService(
|
||||||
service.Config(cfg),
|
service.Config(cfg),
|
||||||
service.WithGatewayClient(gatewayClient),
|
service.WithGatewayClient(gatewayClient),
|
||||||
service.WithIdentityBackend(identityBackend),
|
service.WithIdentityBackend(identityBackend),
|
||||||
service.WithHTTPClient(httpClient),
|
|
||||||
service.EventsPublisher(&eventsPublisher),
|
service.EventsPublisher(&eventsPublisher),
|
||||||
)
|
)
|
||||||
user = &userv1beta1.User{
|
user = &userv1beta1.User{
|
||||||
|
|||||||
@@ -136,15 +136,6 @@ func NewService(opts ...Option) Service {
|
|||||||
svc.identityBackend = options.IdentityBackend
|
svc.identityBackend = options.IdentityBackend
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.HTTPClient == nil {
|
|
||||||
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{
|
|
||||||
InsecureSkipVerify: options.Config.Spaces.Insecure, //nolint:gosec
|
|
||||||
}
|
|
||||||
svc.httpClient = &http.Client{}
|
|
||||||
} else {
|
|
||||||
svc.httpClient = options.HTTPClient
|
|
||||||
}
|
|
||||||
|
|
||||||
if options.RoleService == nil {
|
if options.RoleService == nil {
|
||||||
svc.roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient)
|
svc.roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user