mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
remove unused GRAPH_SPACES_INSECURE
This commit is contained in:
@@ -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."`
|
||||
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."`
|
||||
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."`
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ func DefaultConfig() *config.Config {
|
||||
WebDavBase: "https://localhost:9200",
|
||||
WebDavPath: "/dav/spaces/",
|
||||
DefaultQuota: "1000000000",
|
||||
Insecure: false,
|
||||
},
|
||||
Identity: config.Identity{
|
||||
Backend: "ldap",
|
||||
|
||||
@@ -75,7 +75,6 @@ type Graph struct {
|
||||
logger *log.Logger
|
||||
identityBackend identity.Backend
|
||||
gatewayClient GatewayClient
|
||||
httpClient HTTPClient
|
||||
roleService settingssvc.RoleService
|
||||
spacePropertiesCache *ttlcache.Cache
|
||||
eventsPublisher events.Publisher
|
||||
@@ -91,11 +90,6 @@ func (g Graph) GetGatewayClient() 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{}) {
|
||||
if err := events.Publish(g.eventsPublisher, ev); err != nil {
|
||||
g.logger.Error().
|
||||
|
||||
@@ -29,7 +29,6 @@ var _ = Describe("Graph", func() {
|
||||
var (
|
||||
svc service.Service
|
||||
gatewayClient *mocks.GatewayClient
|
||||
httpClient *mocks.HTTPClient
|
||||
eventsPublisher mocks.Publisher
|
||||
ctx context.Context
|
||||
cfg *config.Config
|
||||
@@ -42,12 +41,10 @@ var _ = Describe("Graph", func() {
|
||||
cfg.TokenManager.JWTSecret = "loremipsum"
|
||||
|
||||
gatewayClient = &mocks.GatewayClient{}
|
||||
httpClient = &mocks.HTTPClient{}
|
||||
eventsPublisher = mocks.Publisher{}
|
||||
svc = service.NewService(
|
||||
service.Config(cfg),
|
||||
service.WithGatewayClient(gatewayClient),
|
||||
service.WithHTTPClient(httpClient),
|
||||
service.EventsPublisher(&eventsPublisher),
|
||||
)
|
||||
})
|
||||
|
||||
@@ -21,7 +21,6 @@ type Options struct {
|
||||
Middleware []func(http.Handler) http.Handler
|
||||
GatewayClient GatewayClient
|
||||
IdentityBackend identity.Backend
|
||||
HTTPClient HTTPClient
|
||||
RoleService settingssvc.RoleService
|
||||
RoleManager *roles.Manager
|
||||
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.
|
||||
func RoleService(val settingssvc.RoleService) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
@@ -36,7 +36,6 @@ var _ = Describe("Users changing their own password", func() {
|
||||
var (
|
||||
svc service.Service
|
||||
gatewayClient *mocks.GatewayClient
|
||||
httpClient *mocks.HTTPClient
|
||||
ldapClient *mocks.Client
|
||||
ldapConfig config.LDAP
|
||||
identityBackend identity.Backend
|
||||
@@ -70,13 +69,11 @@ var _ = Describe("Users changing their own password", func() {
|
||||
identityBackend, err = identity.NewLDAPBackend(ldapClient, ldapConfig, &loggger)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
httpClient = &mocks.HTTPClient{}
|
||||
eventsPublisher = mocks.Publisher{}
|
||||
svc = service.NewService(
|
||||
service.Config(cfg),
|
||||
service.WithGatewayClient(gatewayClient),
|
||||
service.WithIdentityBackend(identityBackend),
|
||||
service.WithHTTPClient(httpClient),
|
||||
service.EventsPublisher(&eventsPublisher),
|
||||
)
|
||||
user = &userv1beta1.User{
|
||||
|
||||
@@ -136,15 +136,6 @@ func NewService(opts ...Option) Service {
|
||||
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 {
|
||||
svc.roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user