Skip to content

Commit

Permalink
Merge #128
Browse files Browse the repository at this point in the history
128: Drop support for end-users r=unleashed a=davidor

Support for end-users was deprecated some releases ago.
Now, the product team has confirmed that we can drop support for the feature.

@unleashed The diff of this PR is quite big. End-users were present in many parts of the codebase. Here's how I organized it:
- Internal API
- Code
- Oauth code: dropping support in oauth tokens was not as straightforward as in the rest of the code so I decided to separate it.
- One commit for each of the test types.
- Update of active docs

Co-authored-by: David Ortiz <[email protected]>
  • Loading branch information
bors[bot] and davidor authored Sep 25, 2019
2 parents 0114c08 + 1bfa703 commit d902251
Show file tree
Hide file tree
Showing 66 changed files with 178 additions and 3,183 deletions.
1 change: 0 additions & 1 deletion app/api/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_relative 'internal/applications'
require_relative 'internal/metrics'
require_relative 'internal/usagelimits'
require_relative 'internal/users'
require_relative 'internal/events'
require_relative 'internal/alert_limits'
require_relative 'internal/application_keys'
Expand Down
32 changes: 12 additions & 20 deletions app/api/internal/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,23 @@ module API
end

post '/' do
begin
svc_attrs = api_params Service
service = Service.save!(svc_attrs)
[201, headers, {service: service.to_hash, status: :created}.to_json]
rescue ServiceRequiresDefaultUserPlan => e
respond_with_400 e
end
svc_attrs = api_params Service
service = Service.save!(svc_attrs)
[201, headers, {service: service.to_hash, status: :created}.to_json]
end

put '/:id' do
begin
svc_attrs = api_params Service
service = Service.load_by_id(params[:id])
if service
svc_attrs.each do |attr, value|
service.send "#{attr}=", value
end
service.save!
else
service = Service.save!(svc_attrs)
svc_attrs = api_params Service
service = Service.load_by_id(params[:id])
if service
svc_attrs.each do |attr, value|
service.send "#{attr}=", value
end
{service: service.to_hash, status: :ok}.to_json
rescue ServiceRequiresDefaultUserPlan => e
respond_with_400 e
service.save!
else
service = Service.save!(svc_attrs)
end
{service: service.to_hash, status: :ok}.to_json
end

put '/change_provider_key/:key' do
Expand Down
60 changes: 0 additions & 60 deletions app/api/internal/users.rb

This file was deleted.

57 changes: 0 additions & 57 deletions docs/active_docs/Service Management API (on-premises).json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -128,12 +122,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -220,12 +208,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Used only when the application is rate limiting end users and the specified token is not associated to a user. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -312,12 +294,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -399,12 +375,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -504,12 +474,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Used only when the application is rate limiting end users and the specified token is not associated to a user. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -607,13 +571,6 @@
"description": "App Id (identifier of the application if the auth. pattern is App Id)",
"description_inline": true
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans.",
"description_inline": true
},
{
"name": "timestamp",
"dataType": "string",
Expand Down Expand Up @@ -707,13 +664,6 @@
"description": "User Key (identifier and shared secret of the application if the auth. pattern is Api Key)",
"description_inline": true
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans.",
"description_inline": true
},
{
"name": "timestamp",
"dataType": "string",
Expand Down Expand Up @@ -807,13 +757,6 @@
"description": "Client Id (identifier of the application if the auth. pattern is OAuth, note that client_id == app_id)",
"description_inline": true
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans.",
"description_inline": true
},
{
"name": "timestamp",
"dataType": "string",
Expand Down
57 changes: 0 additions & 57 deletions docs/active_docs/Service Management API.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -128,12 +122,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -220,12 +208,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Used only when the application is rate limiting end users and the specified token is not associated to a user. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -312,12 +294,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -399,12 +375,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -504,12 +474,6 @@
"paramType": "query",
"description": "Referrer IP Address or Domain. Required only if referrer filtering is enabled. If special value '*' (wildcard) is passed, the referrer check is bypassed."
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Used only when the application is rate limiting end users and the specified token is not associated to a user. The End User plans feature is not available in all 3scale plans."
},
{
"name": "usage",
"dataType": "hash",
Expand Down Expand Up @@ -607,13 +571,6 @@
"description": "App Id (identifier of the application if the auth. pattern is App Id)",
"description_inline": true
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans.",
"description_inline": true
},
{
"name": "timestamp",
"dataType": "string",
Expand Down Expand Up @@ -707,13 +664,6 @@
"description": "User Key (identifier and shared secret of the application if the auth. pattern is Api Key)",
"description_inline": true
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans.",
"description_inline": true
},
{
"name": "timestamp",
"dataType": "string",
Expand Down Expand Up @@ -807,13 +757,6 @@
"description": "Client Id (identifier of the application if the auth. pattern is OAuth, note that client_id == app_id)",
"description_inline": true
},
{
"name": "user_id",
"dataType": "string",
"paramType": "query",
"description": "User id. String identifying an end user. Required only when the application is rate limiting end users. The End User plans feature is not available in all 3scale plans.",
"description_inline": true
},
{
"name": "timestamp",
"dataType": "string",
Expand Down
Loading

0 comments on commit d902251

Please sign in to comment.