Support for Django4.0+ JSONField
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
## 2.7.0 (Dev)
|
## 2.8.0
|
||||||
|
* Support For Django 4.0+ JSONField
|
||||||
|
* Removed jsonfield package from requirements
|
||||||
|
|
||||||
|
## 2.7.0
|
||||||
* Fixed #70
|
* Fixed #70
|
||||||
* Add QR Code for trusted device link
|
* Add QR Code for trusted device link
|
||||||
* Better formatting for trusted device start page.
|
* Better formatting for trusted device start page.
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -22,7 +22,9 @@ For FIDO2, the following are supported
|
|||||||
* **android-safetynet** (Chrome 70+, Firefox 68+)
|
* **android-safetynet** (Chrome 70+, Firefox 68+)
|
||||||
* **NFC devices using PCSC** (Not Tested, but as supported in fido2)
|
* **NFC devices using PCSC** (Not Tested, but as supported in fido2)
|
||||||
* **Soft Tokens**
|
* **Soft Tokens**
|
||||||
* [krypt.co](https://krypt.co/): Login by a notification on your phone.
|
* ~~[krypt.co](https://krypt.co/): Login by a notification on your phone.~~
|
||||||
|
|
||||||
|
**Update**: Dec 2022, krypt.co has been killed by Google for Passkeys.
|
||||||
|
|
||||||
In English :), It allows you to verify the user by security keys on PC, Laptops or Mobiles, Windows Hello (Fingerprint, PIN) on Windows 10 Build 1903+ (May 2019 Update) Touch/Face ID on Macbooks (Chrome, Safari), Touch/Face ID on iPhone and iPad and Fingerprint/Face/Iris/PIN on Android Phones.
|
In English :), It allows you to verify the user by security keys on PC, Laptops or Mobiles, Windows Hello (Fingerprint, PIN) on Windows 10 Build 1903+ (May 2019 Update) Touch/Face ID on Macbooks (Chrome, Safari), Touch/Face ID on iPhone and iPad and Fingerprint/Face/Iris/PIN on Android Phones.
|
||||||
|
|
||||||
@@ -43,8 +45,12 @@ Depends on
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
1. using pip
|
1. using pip
|
||||||
|
* For Django >= 4.0
|
||||||
|
|
||||||
`pip install django-mfa2`
|
`pip install django-mfa2`
|
||||||
|
* For Django < 4.0
|
||||||
|
|
||||||
|
`pip install django-mfa2 jsonfield`
|
||||||
2. Using Conda forge
|
2. Using Conda forge
|
||||||
|
|
||||||
`conda config --add channels conda-forge`
|
`conda config --add channels conda-forge`
|
||||||
|
|||||||
@@ -2,7 +2,14 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
import jsonfield.fields
|
try:
|
||||||
|
from django.db.models import JSONField
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
from jsonfield.fields import JSONField
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("Can't find a JSONField implementation, please install jsonfield if django < 4.0")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def modify_json(apps, schema_editor):
|
def modify_json(apps, schema_editor):
|
||||||
@@ -24,7 +31,7 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user_keys',
|
model_name='user_keys',
|
||||||
name='properties',
|
name='properties',
|
||||||
field=jsonfield.fields.JSONField(null=True),
|
field=JSONField(null=True),
|
||||||
),
|
),
|
||||||
migrations.RunPython(modify_json)
|
migrations.RunPython(modify_json)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from jsonfield import JSONField
|
try:
|
||||||
|
from django.db.models import JSONField
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
try:
|
||||||
|
from jsonfield import JSONField
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
raise ModuleNotFoundError("Can't find a JSONField implementation, please install jsonfield if django < 4.0")
|
||||||
|
|
||||||
from jose import jwt
|
from jose import jwt
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
#from jsonLookup import shasLookup, hasLookup
|
#from jsonLookup import shasLookup, hasLookup
|
||||||
|
|||||||
10
setup.py
10
setup.py
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-mfa2',
|
name='django-mfa2',
|
||||||
version='2.7.0RC1',
|
version='2.8.0',
|
||||||
description='Allows user to add 2FA to their accounts',
|
description='Allows user to add 2FA to their accounts',
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -17,7 +17,6 @@ setup(
|
|||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django >= 2.0',
|
'django >= 2.0',
|
||||||
'jsonfield',
|
|
||||||
'simplejson',
|
'simplejson',
|
||||||
'pyotp',
|
'pyotp',
|
||||||
'python-u2flib-server',
|
'python-u2flib-server',
|
||||||
@@ -25,14 +24,13 @@ setup(
|
|||||||
'user-agents',
|
'user-agents',
|
||||||
'python-jose',
|
'python-jose',
|
||||||
'fido2 == 1.0.0',
|
'fido2 == 1.0.0',
|
||||||
'jsonLookup'
|
|
||||||
],
|
],
|
||||||
python_requires=">=3.5",
|
python_requires=">=3.5",
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False, # because we're including static files
|
zip_safe=False, # because we're including static files
|
||||||
classifiers=[
|
classifiers=[
|
||||||
# "Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Development Status :: 4 - Beta",
|
#"Development Status :: 4 - Beta",
|
||||||
"Environment :: Web Environment",
|
"Environment :: Web Environment",
|
||||||
"Framework :: Django",
|
"Framework :: Django",
|
||||||
"Framework :: Django :: 2.0",
|
"Framework :: Django :: 2.0",
|
||||||
@@ -42,6 +40,7 @@ setup(
|
|||||||
"Framework :: Django :: 3.1",
|
"Framework :: Django :: 3.1",
|
||||||
"Framework :: Django :: 3.2",
|
"Framework :: Django :: 3.2",
|
||||||
"Framework :: Django :: 4.0",
|
"Framework :: Django :: 4.0",
|
||||||
|
"Framework :: Django :: 4.1",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
@@ -52,6 +51,7 @@ setup(
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user