Formatting changes.
This commit is contained in:
parent
7a580e6036
commit
0097daebc2
3 changed files with 10 additions and 2 deletions
|
@ -192,10 +192,12 @@ class DatabaseAuthorizationProvider(AuthorizationProvider):
|
|||
|
||||
return self._make_response(headers={'Location': url}, status_code=302)
|
||||
|
||||
|
||||
def create_application(org, name, application_uri, redirect_uri, **kwargs):
|
||||
return OAuthApplication.create(organization=org, name=name, application_uri=application_uri,
|
||||
redirect_uri=redirect_uri, **kwargs)
|
||||
|
||||
|
||||
def validate_access_token(access_token):
|
||||
try:
|
||||
found = (OAuthAccessToken
|
||||
|
@ -207,17 +209,20 @@ def validate_access_token(access_token):
|
|||
except OAuthAccessToken.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
||||
def get_application_for_client_id(client_id):
|
||||
try:
|
||||
return OAuthApplication.get(client_id=client_id)
|
||||
except OAuthApplication.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
||||
def reset_client_secret(application):
|
||||
application.client_secret = random_string_generator(length=40)()
|
||||
application.save()
|
||||
return application
|
||||
|
||||
|
||||
def lookup_application(org, client_id):
|
||||
try:
|
||||
return OAuthApplication.get(organization = org, client_id=client_id)
|
||||
|
|
Reference in a new issue