plain.oauth 0.8.1__py3-none-any.whl → 0.9.0__py3-none-any.whl

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.
plain/oauth/models.py CHANGED
@@ -18,6 +18,7 @@ if TYPE_CHECKING:
18
18
  # TODO preflight check for deploy that ensures all provider keys in db are also in settings?
19
19
 
20
20
 
21
+ @models.register_model
21
22
  class OAuthConnection(models.Model):
22
23
  created_at = models.DateTimeField(auto_now_add=True)
23
24
  updated_at = models.DateTimeField(auto_now=True)
plain/oauth/providers.py CHANGED
@@ -95,7 +95,7 @@ class OAuthProvider:
95
95
  return self.scope
96
96
 
97
97
  def get_callback_url(self, *, request: HttpRequest) -> str:
98
- url = reverse("oauth:callback", kwargs={"provider": self.provider_key})
98
+ url = reverse("oauth:callback", provider=self.provider_key)
99
99
  return request.build_absolute_uri(url)
100
100
 
101
101
  def generate_state(self) -> str:
plain/oauth/urls.py CHANGED
@@ -1,13 +1,14 @@
1
- from plain.urls import include, path
1
+ from plain.urls import RouterBase, include, path, register_router
2
2
 
3
3
  from . import views
4
4
 
5
- default_namespace = "oauth"
6
5
 
7
- urlpatterns = [
8
- path(
9
- "<str:provider>/",
6
+ @register_router
7
+ class Router(RouterBase):
8
+ namespace = "oauth"
9
+ urls = [
10
10
  include(
11
+ "<str:provider>/",
11
12
  [
12
13
  # Login and Signup are both handled here, because the intent is the same
13
14
  path("login/", views.OAuthLoginView, name="login"),
@@ -18,7 +19,6 @@ urlpatterns = [
18
19
  name="disconnect",
19
20
  ),
20
21
  path("callback/", views.OAuthCallbackView, name="callback"),
21
- ]
22
+ ],
22
23
  ),
23
- ),
24
- ]
24
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.oauth
3
- Version: 0.8.1
3
+ Version: 0.9.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
@@ -4,9 +4,9 @@ plain/oauth/admin.py,sha256=rqrGRRUVxOlG9wiuXtndIyQxd1VT67cvFy6qWo7LF-Q,1278
4
4
  plain/oauth/config.py,sha256=jk5l59taT_3Kh7EFrJuuubtrCHLfNBVkD2sWQ_M5_JQ,160
5
5
  plain/oauth/default_settings.py,sha256=dlN1J9vSOjjxPNLp-0qe-cLTqwM4E69ZAx_8lpxMhaM,28
6
6
  plain/oauth/exceptions.py,sha256=TMGtIGkK3_J4rsEy1oPCmia7BnRSK8N8RMZm4_pNelA,189
7
- plain/oauth/models.py,sha256=JKST_orOFzywvtoQbrTO9cn7lKLJgjaBUJTN9RqXw7c,6843
8
- plain/oauth/providers.py,sha256=CqZg5pkB7yLK2Fkbc3dpY9ioYeh5tVoEuiJf1qn1qDM,7150
9
- plain/oauth/urls.py,sha256=NyP_yDKayJYrCdw4oNVHUmtjbLNfzdnpdWc-eOsMlDM,676
7
+ plain/oauth/models.py,sha256=wWmxjQaaDAsLoZyNardKr0V27VbGB4L7zAUIFZQRCi4,6866
8
+ plain/oauth/providers.py,sha256=WMLr9g3S84lfIRFslO0VBCmthMBDQ3GCDLSIquTA_Y0,7138
9
+ plain/oauth/urls.py,sha256=OBnn73lu0c9cUMunW9AtkgeSExrksI33MoSuFpBuIlc,733
10
10
  plain/oauth/views.py,sha256=G6icfdKkOOOKB00JVN4SCeZmBcGOGUvAgueyvOd9bLI,3042
11
11
  plain/oauth/migrations/0001_initial.py,sha256=8-JR2McXDUNRhMRUrrZPqzRNpdROfCsIo5Qkndkn-pg,1756
12
12
  plain/oauth/migrations/0002_alter_oauthconnection_options_and_more.py,sha256=3Mb0IU9KDRQfog0PjVbzuNv_AxCs7UVHnA0F263AKNo,581
@@ -15,7 +15,7 @@ plain/oauth/migrations/0004_alter_oauthconnection_access_token_and_more.py,sha25
15
15
  plain/oauth/migrations/0005_alter_oauthconnection_unique_together_and_more.py,sha256=3hmuSvIZhn-haEKOGN3lQzcXD7b_Hy0P8Wa7LOAvJ1k,576
16
16
  plain/oauth/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  plain/oauth/templates/oauth/error.html,sha256=xkkWw57sZ3fz4dDfH30SVtq3okJNnJmrSRPfGxrxjh8,108
18
- plain_oauth-0.8.1.dist-info/METADATA,sha256=XlvCzLWntjvnH5gvvM6TjmmD2L3bt2NQWgUBeQvjIg8,10304
19
- plain_oauth-0.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
- plain_oauth-0.8.1.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
21
- plain_oauth-0.8.1.dist-info/RECORD,,
18
+ plain_oauth-0.9.0.dist-info/METADATA,sha256=uRhh9qZZyhe712Dn_BW1DswApKAjoCjZeoFbhxzFkhQ,10304
19
+ plain_oauth-0.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
+ plain_oauth-0.9.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
21
+ plain_oauth-0.9.0.dist-info/RECORD,,