panther 5.0.0b2__py3-none-any.whl → 5.0.0b3__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.
panther/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from panther.main import Panther # noqa: F401
2
2
 
3
- __version__ = '5.0.0beta2'
3
+ __version__ = '5.0.0beta3'
4
4
 
5
5
 
6
6
  def version():
panther/panel/views.py CHANGED
@@ -2,7 +2,6 @@ import logging
2
2
 
3
3
  from panther import status
4
4
  from panther.app import API, GenericAPI
5
- from panther.authentications import JWTAuthentication, CookieJWTAuthentication
6
5
  from panther.configs import config
7
6
  from panther.db.models import BaseUser
8
7
  from panther.exceptions import RedirectAPIError, AuthenticationAPIError
@@ -18,6 +17,8 @@ logger = logging.getLogger('panther')
18
17
  class AdminPanelPermission(BasePermission):
19
18
  @classmethod
20
19
  async def authorization(cls, request: Request) -> bool:
20
+ from panther.authentications import CookieJWTAuthentication
21
+
21
22
  try: # We don't want to set AUTHENTICATION class, so we have to use permission classes
22
23
  await CookieJWTAuthentication.authentication(request=request)
23
24
  return True
@@ -32,6 +33,8 @@ class LoginView(GenericAPI):
32
33
  return TemplateResponse(name='login.html')
33
34
 
34
35
  async def post(self, request: Request):
36
+ from panther.authentications import JWTAuthentication
37
+
35
38
  user: BaseUser = await config.USER_MODEL.find_one({config.USER_MODEL.USERNAME_FIELD: request.data['username']})
36
39
  if user is None:
37
40
  logger.debug('User not found.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: panther
3
- Version: 5.0.0b2
3
+ Version: 5.0.0b3
4
4
  Summary: Fast & Friendly, Web Framework For Building Async APIs
5
5
  Home-page: https://github.com/alirn76/panther
6
6
  Author: Ali RajabNezhad
@@ -1,4 +1,4 @@
1
- panther/__init__.py,sha256=EN8vI-Orve2wCHyNc_rtgpC7s2UUCP2lWlN3nc3w3Oc,115
1
+ panther/__init__.py,sha256=la_y7QiSYvUdOTeTmsqJ3e0xamVirhHq_r7NhnuAqqY,115
2
2
  panther/_load_configs.py,sha256=1mMZeULMIgCxuPIXjNCdMPpqpjBm_rf4IgiD7Zk5MWs,10964
3
3
  panther/_utils.py,sha256=nJK4QdTB9SmcVoRKy3hRvcdvceVGlBQ-MQG38j1BLc8,4130
4
4
  panther/app.py,sha256=x8UsN3Ct2LfnvyXHkX_yIimBV73W19sL5xxF3RSRaMw,11074
@@ -56,7 +56,7 @@ panther/panel/apis.py,sha256=COsbwKZyTgyHvHYbpDfusifAH9ojMS3z1KhZCt9M-Ms,2428
56
56
  panther/panel/middlewares.py,sha256=xOYpIsy-fqc8OuieePLviUxmR6Tsu-kg3UtgerUKyHo,379
57
57
  panther/panel/urls.py,sha256=xLEy1qA4MWOLApkecyz1FxDefNthOUCqYft5XsctKys,387
58
58
  panther/panel/utils.py,sha256=UFDPmST-c5T-pa5bg4wBIzZMgQIgAqervL4ojOeofq8,4219
59
- panther/panel/views.py,sha256=VnmKwkiuBgbIIFsqAqcqfOn8S5N837Y1TUH_2U6PkXs,5148
59
+ panther/panel/views.py,sha256=OYCjqVZr1o3MVXtybmsaipUsLE9FwUxc3t1kX-_KlsA,5201
60
60
  panther/panel/templates/base.html,sha256=kHDzfmlIf14eLrZHymIHdywr36W7cJXKtqFpVhw-x34,327
61
61
  panther/panel/templates/create.html,sha256=2cKjWpNElv390PPYzoI7MGqVjgy9692x3vpxwAJE7GE,581
62
62
  panther/panel/templates/create.js,sha256=zO_GfaHnjVI25zx4wGhUPA7aEkCukKMpabJfuiOib7c,40180
@@ -67,9 +67,9 @@ panther/panel/templates/login.html,sha256=W6V1rgHAno7yTbP6Il38ZvJp4LdlJ8BjM4UuyP
67
67
  panther/panel/templates/sidebar.html,sha256=XikovZsJrth0nvKogvZoh3Eb2Bq7xdeGTlsdlyud450,618
68
68
  panther/panel/templates/table.html,sha256=fWdaIHEHAuwuPaAfOtXkD-3yvSocyDmtys00_D2yRh8,2176
69
69
  panther/panel/templates/table.js,sha256=MTdf77571Gtmg4l8HkY-5fM-utIL3lc0O8hv6vLBCYk,10414
70
- panther-5.0.0b2.dist-info/licenses/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
71
- panther-5.0.0b2.dist-info/METADATA,sha256=2vCEzF7CRa35QMey3KB_c1tV5edvWU3oOwq2sa6b3hw,7026
72
- panther-5.0.0b2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- panther-5.0.0b2.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
74
- panther-5.0.0b2.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
75
- panther-5.0.0b2.dist-info/RECORD,,
70
+ panther-5.0.0b3.dist-info/licenses/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
71
+ panther-5.0.0b3.dist-info/METADATA,sha256=UYetTvZEU_dVXjP_3Vz4FY6vgiX20nJZl9lZSUvxLyM,7026
72
+ panther-5.0.0b3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ panther-5.0.0b3.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
74
+ panther-5.0.0b3.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
75
+ panther-5.0.0b3.dist-info/RECORD,,