plain.oauth 0.18.0__tar.gz → 0.19.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/PKG-INFO +1 -1
  2. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/providers.py +9 -7
  3. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/pyproject.toml +1 -1
  4. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/.gitignore +0 -0
  5. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/LICENSE +0 -0
  6. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/README.md +0 -0
  7. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/README.md +0 -0
  8. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/__init__.py +0 -0
  9. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/admin.py +0 -0
  10. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/config.py +0 -0
  11. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/default_settings.py +0 -0
  12. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/exceptions.py +0 -0
  13. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0001_initial.py +0 -0
  14. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0002_alter_oauthconnection_options_and_more.py +0 -0
  15. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0003_alter_oauthconnection_access_token_and_more.py +0 -0
  16. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0004_alter_oauthconnection_access_token_and_more.py +0 -0
  17. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0005_alter_oauthconnection_unique_together_and_more.py +0 -0
  18. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0006_remove_oauthconnection_unique_oauth_provider_user_id_and_more.py +0 -0
  19. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/0007_alter_oauthconnection_provider_key_and_more.py +0 -0
  20. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/migrations/__init__.py +0 -0
  21. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/models.py +0 -0
  22. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/templates/oauth/error.html +0 -0
  23. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/urls.py +0 -0
  24. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/plain/oauth/views.py +0 -0
  25. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/provider_examples/__init__.py +0 -0
  26. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/provider_examples/bitbucket.py +0 -0
  27. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/provider_examples/github.py +0 -0
  28. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/provider_examples/gitlab.py +0 -0
  29. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/settings.py +0 -0
  30. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/templates/base.html +0 -0
  31. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/templates/index.html +0 -0
  32. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/templates/login.html +0 -0
  33. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/urls.py +0 -0
  34. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/users/migrations/0001_initial.py +0 -0
  35. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/users/migrations/__init__.py +0 -0
  36. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/app/users/models.py +0 -0
  37. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/provider_tests/__init__.py +0 -0
  38. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/provider_tests/test_github.py +0 -0
  39. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/providers/__init__.py +0 -0
  40. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/providers/bitbucket.py +0 -0
  41. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/providers/github.py +0 -0
  42. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/providers/gitlab.py +0 -0
  43. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/test_backends.py +0 -0
  44. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/test_checks.py +0 -0
  45. {plain_oauth-0.18.0 → plain_oauth-0.19.0}/tests/test_providers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.oauth
3
- Version: 0.18.0
3
+ Version: 0.19.0
4
4
  Summary: OAuth login and API access for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -102,10 +102,10 @@ class OAuthProvider:
102
102
  return get_random_string(length=32)
103
103
 
104
104
  def check_request_state(self, *, request: HttpRequest) -> None:
105
- if error := request.GET.get("error"):
105
+ if error := request.query_params.get("error"):
106
106
  raise OAuthError(error)
107
107
 
108
- state = request.GET["state"]
108
+ state = request.query_params["state"]
109
109
  expected_state = request.session.pop(SESSION_STATE_KEY)
110
110
  request.session.save() # Make sure the pop is saved (won't save on an exception)
111
111
  if not secrets.compare_digest(state, expected_state):
@@ -124,8 +124,8 @@ class OAuthProvider:
124
124
  # Store next url in session so we can get it on the callback request
125
125
  if redirect_to:
126
126
  request.session[SESSION_NEXT_KEY] = redirect_to
127
- elif "next" in request.POST:
128
- request.session[SESSION_NEXT_KEY] = request.POST["next"]
127
+ elif "next" in request.data:
128
+ request.session[SESSION_NEXT_KEY] = request.data["next"]
129
129
 
130
130
  # Sort authorization params for consistency
131
131
  sorted_authorization_params = sorted(authorization_params.items())
@@ -138,7 +138,7 @@ class OAuthProvider:
138
138
  return self.handle_login_request(request=request, redirect_to=redirect_to)
139
139
 
140
140
  def handle_disconnect_request(self, *, request: HttpRequest) -> Response:
141
- provider_user_id = request.POST["provider_user_id"]
141
+ provider_user_id = request.data["provider_user_id"]
142
142
  connection = OAuthConnection.objects.get(
143
143
  provider_key=self.provider_key, provider_user_id=provider_user_id
144
144
  )
@@ -149,7 +149,9 @@ class OAuthProvider:
149
149
  def handle_callback_request(self, *, request: HttpRequest) -> Response:
150
150
  self.check_request_state(request=request)
151
151
 
152
- oauth_token = self.get_oauth_token(code=request.GET["code"], request=request)
152
+ oauth_token = self.get_oauth_token(
153
+ code=request.query_params["code"], request=request
154
+ )
153
155
  oauth_user = self.get_oauth_user(oauth_token=oauth_token)
154
156
 
155
157
  if request.user:
@@ -181,7 +183,7 @@ class OAuthProvider:
181
183
  return request.session.pop(SESSION_NEXT_KEY, "/")
182
184
 
183
185
  def get_disconnect_redirect_url(self, *, request: HttpRequest) -> str:
184
- return request.POST.get("next", "/")
186
+ return request.data.get("next", "/")
185
187
 
186
188
 
187
189
  def get_oauth_provider_instance(*, provider_key: str) -> OAuthProvider:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.oauth"
3
- version = "0.18.0"
3
+ version = "0.19.0"
4
4
  description = "OAuth login and API access for Plain."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  license = "BSD-3-Clause"
File without changes
File without changes
File without changes