Module Expr Str ImportFrom alias alias ImportFrom alias alias alias alias alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults vararg kwarg body Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Call NameLoad keyword Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword SubscriptLoad NameLoad Index Str keyword AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Call NameLoad keyword NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword Call AttributeLoad NameLoad attr Str NameLoad keyword SubscriptLoad NameLoad Index Str keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad body Return NameLoad Return NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args defaults vararg kwarg body If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call NameLoad Str keyword NameLoad keyword NameLoad orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Return CompareEq NameLoad Str decorator_list Call NameLoad Str ListLoad Str Str keyword Call NameLoad AttributeLoad NameLoad attr FunctionDef arguments args defaults body Pass decorator_list Call NameLoad Str AttributeLoad NameLoad attr FunctionDef arguments args defaults body Pass decorator_list Call NameLoad Str AttributeLoad NameLoad attr FunctionDef arguments args defaults body Return Dict Str Str AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list Call NameLoad Str keyword Call NameLoad FunctionDef arguments args defaults body Return Call NameLoad Str AttributeLoad NameLoad attr decorator_list Call NameLoad Str keyword Str Assign SubscriptStore AttributeLoad Call NameLoad attr Index Str Str
N/A N/A 
Bottle app for the OAuth2 authorization and token endpoints.

This is where all of the pieces of the OAuth provider puzzle get put together.
We instantiate an OAuth2Provider, which is a generalized class that handles all
the OAuth 2.0 authorization flows, encapsulating them in a few simple function
decorators.

The xxx[getter|setter] decorators register callbacks which the OAuth2Provider
uses to get and set the necessary objects from our model.

The xxx_handler decorators wrap Bottle view functions to process the standard
OAuth 2.0 requests to our endpoints. In some cases, such as the 'token' endpoint,
the decorator handles all of the logic completely. In the case of the 'authorize'
endpoint, we have to implement some additional logic to generate our personalized
view and process our own form fields.

Note that the 'authorize' endpoint also uses our AuthenticatedPlugin, which
ensures that the user is signed in before allowing them to authorize a request.

The 'errors' endpoint is simply the default redirect destination when the
OAuth2Provider encounters an error during authorization, and it displays the
contents of the default query parameters 'error' and 'error_description'.
 datetime datetime timedelta bottle request template local route post get default_app codalab.objects.oauth2 OAuth2AuthCode OAuth2Token codalab.server.authenticated_plugin AuthenticatedPlugin codalab.server.oauth2_provider oauth2_provider get_client N/A N/A client_id N/A N/A N/A N/A N/A N/A local model get_oauth2_client client_id N/A N/A oauth2_provider clientgetter get_grant N/A N/A client_id code N/A N/A N/A N/A N/A N/A local model get_oauth2_auth_code client_id code N/A N/A oauth2_provider grantgetter set_grant N/A N/A client_id code _request N/A args kwargs N/A N/A expires N/A N/A N/A datetime utcnow N/A timedelta seconds 100 N/A grant N/A OAuth2AuthCode N/A local model client_id client_id code N/A code N/A code redirect_uri N/A _request redirect_uri scopes N/A N/A , join N/A _request scopes user_id N/A N/A request user user_id expires expires N/A N/A N/A N/A local model save_oauth2_auth_code grant N/A N/A oauth2_provider grantsetter get_token N/A N/A access_token refresh_token N/A None None N/A N/A N/A N/A N/A local model get_oauth2_token access_token refresh_token N/A N/A oauth2_provider tokengetter set_token N/A N/A token _request N/A args kwargs N/A N/A user N/A N/A _request user N/A request user N/A N/A N/A N/A local model clear_oauth2_tokens N/A N/A _request client client_id N/A user user_id N/A expires_in N/A N/A token get expires_in N/A expires N/A N/A N/A datetime utcnow N/A timedelta seconds expires_in N/A token N/A OAuth2Token N/A local model access_token N/A token N/A access_token refresh_token N/A N/A token get refresh_token None scopes N/A token N/A scope expires expires client_id N/A N/A _request client client_id user_id N/A user user_id N/A N/A N/A N/A local model save_oauth2_token token N/A N/A oauth2_provider tokensetter get_user N/A N/A username password N/A args kwargs N/A N/A user N/A N/A N/A local model get_user username username N/A N/A N/A user None N/A N/A user check_password password N/A N/A user N/A None N/A N/A oauth2_provider usergetter authorize N/A N/A N/A args kwargs N/A N/A N/A N/A request method GET N/A N/A client_id N/A N/A kwargs get client_id N/A redirect_uri N/A N/A kwargs get redirect_uri N/A client N/A N/A N/A local model get_oauth2_client client_id N/A N/A template oauth2_authorize client client redirect_uri redirect_uri N/A N/A N/A N/A request method POST N/A N/A confirm N/A N/A N/A request forms get confirm no N/A N/A confirm yes N/A N/A route /oauth2/authorize N/A GET POST apply N/A AuthenticatedPlugin N/A oauth2_provider authorize_handler handle_token N/A N/A N/A N/A N/A N/A N/A post /oauth2/token N/A oauth2_provider token_handler revoke_token N/A N/A N/A N/A N/A N/A N/A post /oauth2/revoke N/A oauth2_provider revoke_handler validate N/A N/A N/A N/A N/A N/A user_name user_id N/A N/A request user user_name N/A N/A request user user_id N/A N/A get /oauth2/validate apply N/A AuthenticatedPlugin show_errors N/A N/A N/A N/A N/A N/A template oauth2_errors N/A request query N/A N/A get /oauth2/errors name oauth2_errors N/A N/A N/A N/A default_app config N/A OAUTH2_PROVIDER_ERROR_ENDPOINT oauth2_errors