-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Merge with https://github.com/wiliamsouza/django-oauth-toolkit
- Loading branch information
afabiani
committed
Jul 26, 2019
1 parent
1fe832d
commit f32211e
Showing
74 changed files
with
1,610 additions
and
730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
openapi: "3.0.0" | ||
info: | ||
title: songs | ||
version: v1 | ||
components: | ||
securitySchemes: | ||
song_auth: | ||
type: oauth2 | ||
flows: | ||
implicit: | ||
authorizationUrl: http://localhost:8000/o/authorize | ||
scopes: | ||
read: read about a song | ||
create: create a new song | ||
update: update an existing song | ||
delete: delete a song | ||
post: create a new song | ||
widget: widget scope | ||
scope2: scope too | ||
scope3: another scope | ||
paths: | ||
/songs: | ||
get: | ||
security: | ||
- song_auth: [read] | ||
responses: | ||
'200': | ||
description: A list of songs. | ||
post: | ||
security: | ||
- song_auth: [create] | ||
- song_auth: [post, widget] | ||
responses: | ||
'201': | ||
description: new song added | ||
put: | ||
security: | ||
- song_auth: [update] | ||
- song_auth: [put, widget] | ||
responses: | ||
'204': | ||
description: song updated | ||
delete: | ||
security: | ||
- song_auth: [delete] | ||
- song_auth: [scope2, scope3] | ||
responses: | ||
'200': | ||
description: song deleted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,4 @@ | ||
""" | ||
The `compat` module provides support for backwards compatibility with older | ||
versions of django and python. | ||
versions of Django and Python. | ||
""" | ||
# flake8: noqa | ||
from __future__ import unicode_literals | ||
|
||
|
||
# urlparse in python3 has been renamed to urllib.parse | ||
try: | ||
from urlparse import parse_qs, parse_qsl, urlparse, urlsplit, urlunparse, urlunsplit | ||
except ImportError: | ||
from urllib.parse import parse_qs, parse_qsl, urlparse, urlsplit, urlunsplit, urlunparse | ||
|
||
try: | ||
from urllib import urlencode, quote_plus, unquote_plus | ||
except ImportError: | ||
from urllib.parse import urlencode, quote_plus, unquote_plus | ||
|
||
# bastb Django 1.10 has updated Middleware. This code imports the Mixin required to get old-style | ||
# middleware working again | ||
# More? | ||
# https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware | ||
try: | ||
from django.utils.deprecation import MiddlewareMixin | ||
except ImportError: | ||
MiddlewareMixin = object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# flake8: noqa | ||
from .authentication import OAuth2Authentication | ||
from .permissions import TokenHasScope, TokenHasReadWriteScope, TokenHasResourceScope | ||
from .permissions import IsAuthenticatedOrTokenHasScope | ||
from .permissions import ( | ||
TokenHasScope, TokenHasReadWriteScope, TokenMatchesOASRequirements, | ||
TokenHasResourceScope, IsAuthenticatedOrTokenHasScope | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.