diff --git a/changelog/unreleased/remove-unused-user-agent-filter.md b/changelog/unreleased/remove-unused-user-agent-filter.md new file mode 100644 index 0000000000..25be839bed --- /dev/null +++ b/changelog/unreleased/remove-unused-user-agent-filter.md @@ -0,0 +1,5 @@ +Change: We removed the unused `allowed_user_agents` config option + +It was not used anywhere in the code, but three places had the config option. Dropping it before it spreads further. + +https://github.com/cs3org/reva/pull/2338 diff --git a/internal/grpc/services/gateway/gateway.go b/internal/grpc/services/gateway/gateway.go index 6c7fe52f13..446169339f 100644 --- a/internal/grpc/services/gateway/gateway.go +++ b/internal/grpc/services/gateway/gateway.go @@ -70,7 +70,6 @@ type config struct { HomeMapping string `mapstructure:"home_mapping"` TokenManagers map[string]map[string]interface{} `mapstructure:"token_managers"` EtagCacheTTL int `mapstructure:"etag_cache_ttl"` - AllowedUserAgents map[string][]string `mapstructure:"allowed_user_agents"` // map[path][]user-agent CreateHomeCacheTTL int `mapstructure:"create_home_cache_ttl"` ProviderCacheTTL int `mapstructure:"provider_cache_ttl"` StatCacheTTL int `mapstructure:"stat_cache_ttl"` diff --git a/pkg/storage/registry/spaces/Readme.md b/pkg/storage/registry/spaces/Readme.md index 9f1bd88f6e..2baeec8d53 100644 --- a/pkg/storage/registry/spaces/Readme.md +++ b/pkg/storage/registry/spaces/Readme.md @@ -24,7 +24,6 @@ A rule has several properties: * `address` The ip address of the CS3 storage provider * `path_template` TODO -> rename to space\_path or space\_mount\_point * `aliases` unused? -* `allowed_user_agents` unused? FIXME this seems to be used to route requests based on user agent It also carries filters that are sent with a ListStorageSpaces call to a storage provider diff --git a/pkg/storage/registry/spaces/spaces.go b/pkg/storage/registry/spaces/spaces.go index a73277c01a..3b10cf4f75 100644 --- a/pkg/storage/registry/spaces/spaces.go +++ b/pkg/storage/registry/spaces/spaces.go @@ -53,12 +53,11 @@ func init() { } type provider struct { - Mapping string `mapstructure:"mapping"` - MountPath string `mapstructure:"mount_path"` - Aliases map[string]string `mapstructure:"aliases"` - AllowedUserAgents []string `mapstructure:"allowed_user_agents"` - PathTemplate string `mapstructure:"path_template"` - template *template.Template + Mapping string `mapstructure:"mapping"` + MountPath string `mapstructure:"mount_path"` + Aliases map[string]string `mapstructure:"aliases"` + PathTemplate string `mapstructure:"path_template"` + template *template.Template // filters SpaceType string `mapstructure:"space_type"` SpaceOwnerSelf bool `mapstructure:"space_owner_self"` diff --git a/pkg/storage/registry/static/static.go b/pkg/storage/registry/static/static.go index 2e254d01ec..f49423645b 100644 --- a/pkg/storage/registry/static/static.go +++ b/pkg/storage/registry/static/static.go @@ -44,12 +44,11 @@ func init() { var bracketRegex = regexp.MustCompile(`\[(.*?)\]`) type rule struct { - Mapping string `mapstructure:"mapping"` - Address string `mapstructure:"address"` - ProviderID string `mapstructure:"provider_id"` - ProviderPath string `mapstructure:"provider_path"` - Aliases map[string]string `mapstructure:"aliases"` - AllowedUserAgents []string `mapstructure:"allowed_user_agents"` + Mapping string `mapstructure:"mapping"` + Address string `mapstructure:"address"` + ProviderID string `mapstructure:"provider_id"` + ProviderPath string `mapstructure:"provider_path"` + Aliases map[string]string `mapstructure:"aliases"` } type config struct {