Skip to content

Commit

Permalink
remove unused user agent filter
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Dec 8, 2021
1 parent f1a4927 commit 40dad81
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
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/2315
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/spaces/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
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

0 comments on commit 40dad81

Please sign in to comment.