-
- Downloads
Initial attempt at refactoring API scope declarations.
- Declaring an endpoint's scopes in a `before` block has proved to be unreliable. For example, if we're accessing the `API::Users` endpoint - code in a `before` block in `API::API` wouldn't be able to see the scopes set in `API::Users` since the `API::API` `before` block runs first. - This commit moves these declarations to the class level, since they don't need to change once set.
Showing
- app/services/access_token_validation_service.rb 4 additions, 1 deletionapp/services/access_token_validation_service.rb
- lib/api/api.rb 2 additions, 1 deletionlib/api/api.rb
- lib/api/api_guard.rb 21 additions, 12 deletionslib/api/api_guard.rb
- lib/api/helpers.rb 4 additions, 2 deletionslib/api/helpers.rb
- lib/api/users.rb 3 additions, 1 deletionlib/api/users.rb
- lib/api/v3/users.rb 3 additions, 1 deletionlib/api/v3/users.rb
- spec/requests/api/users_spec.rb 22 additions, 0 deletionsspec/requests/api/users_spec.rb
- spec/support/api_helpers.rb 4 additions, 2 deletionsspec/support/api_helpers.rb
Please register or sign in to comment