Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused user agent filter #2338

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/remove-unused-user-agent-filter.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion internal/grpc/services/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 0 additions & 1 deletion pkg/storage/registry/spaces/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 5 additions & 6 deletions pkg/storage/registry/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down