Fish Trophy

Minh Le Hoang got a fish trophy!

[OAuth2Provider][WIP] Enabling OAuth2 authorization on Web API

Review Request #7997 - Created Feb. 25, 2016 and discarded

Minh Le Hoang
Djblets
master
7941, 7996
7996
djblets
brennie, chipx86

Prior to this commit, there is no mechanism to authorize resources using OAuth2
protocol. In this commit, OAuth2 authorization mechanism is added to
the current authorization mechanism for web API resources.
Services now can follow OAuth2 protocol, send a request with appropriate
authorization header to work with Djblet's resources. External services can
request a token with specify scope through OAuth2 protocol. When using Djblet's
API resource, the scope of a token is checked to make sure that the
external service has the right permission the resource.

This commit also adding unit tests for all current backend authentication:
the base authentication class, the basic authentication via username and
password, the api_token authentication, and the newly added oauth2
authentication backend.

Add test_base_auth_backend to test WebAPIAuthBackend
Add test_basic_auth_backend to test WebAPIBasicAuthBackend
Add test_api_auth_backend to test WebAPITokenAuthBackend
Add test_oauth2_auth_backend to test OAuth2TokenAuthBackend

There should be one more for ResourceOAuth2TokenMixin

  • 25
  • 26
  • 4
  • 55
Description From Last Updated
This needs to have Args and Returns sections. Christian Hammond Christian Hammond
I don't see how this code works. resources_policy should be a list of strings, which shouldn't have .get(). Christian Hammond Christian Hammond
I don't know about this. The unit tests are supposed to be testing the new auth backend, but they're really ... Christian Hammond Christian Hammond
Col: 80 E501 line too long (83 > 79 characters) Review Bot Review Bot
'BaseWebAPIToken' imported but unused Review Bot Review Bot
Col: 17 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 19 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 18 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 20 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 17 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 19 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 18 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 20 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 63 E231 missing whitespace after ',' Review Bot Review Bot
Col: 80 E501 line too long (80 > 79 characters) Review Bot Review Bot
Col: 80 E501 line too long (81 > 79 characters) Review Bot Review Bot
'BaseWebAPIToken' imported but unused Review Bot Review Bot
Col: 17 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 19 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 18 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 20 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 17 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 19 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 18 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Col: 20 E251 unexpected spaces around keyword / parameter equals Review Bot Review Bot
Review Bot
Minh Le Hoang
Minh Le Hoang
Review Bot
Minh Le Hoang
Review Bot
Christian Hammond
Minh Le Hoang
Review Bot
Barret Rennie
Review request changed

Status: Discarded

Loading...