Remove ed25519, add pynacl, documentation updates and preparation for PyPI

This commit is contained in:
= 2019-09-14 02:38:56 -05:00
parent f000e564f9
commit fff2d3e244
Signed by: kiichan
GPG key ID: 619DFD67F0976616
24 changed files with 404 additions and 82 deletions

1
tests/__init__.py Normal file
View file

@ -0,0 +1 @@

95
tests/settings.py Normal file
View file

@ -0,0 +1,95 @@
# -*- coding: utf-8 -*-
"""
Bare ``settings.py`` for running tests for rest_framework_bulk
"""
import os
import django
DEBUG = True
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.dirname(django.__file__),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
INSTALLED_APPS = (
'sqrl',
'tests',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.staticfiles',
)
AUTHENTICATION_BACKENDS = (
'sqrl.backends.SQRLModelBackend',
)
SQRL_SERVER_FRIENDLY_NAME = 'Django SQRL Test Site'
STATIC_URL = '/static/'
SECRET_KEY = 'foo'
ROOT_URLCONF = 'tests.urls'
LOGIN_REDIRECT_URL = '/'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'sqrl': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
'django.request': {
'handlers': ['console'],
'level': 'ERROR',
'propagate': False,
},
},
}

4
tests/static/sqrl/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

50
tests/templates/base.html Normal file
View file

@ -0,0 +1,50 @@
<!doctype html>
<html lang="en">
<head>
<title>{% block title %}SQRL Test{% endblock %}</title>
</head>
<body>
<header>
{% block header %}
<div>SQRL Test Server</div>
<nav>
{% if user.is_authenticated %}
Logged in as {{ user.username }}
{% endif %}
<ul>
{% if user.is_authenticated %}
<li>
<a href="{% url 'logout' %}">Log out</a>
</li>
<li>
<a href="{% url 'sqrl:manage' %}">Manage SQRL</a>
</li>
{% else %}
<li>
<a href="{% url 'sqrl:login' %}">Log In</a>
</li>
{% endif %}
</ul>
</nav>
{% endblock %}
</header>
<div id="content">
{% block content %}
{% endblock content %}
</div>
<div id="footer">
{% block footer %}
SQRL Test server. Originally created by <a href="https://github.com/miki725">miki725</a>. Revised by <a href="https://gitlab.com/WolfgangAxel">WolfgangAxel</a>
{% endblock %}
</div>
{% block scripts %}
{% endblock %}
</body>
</html>

View file

@ -0,0 +1 @@
{% extends 'base.html' %}

17
tests/urls.py Normal file
View file

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from django.urls import path, include
from django.contrib import admin
from django.contrib.auth import urls as auth_urlpatterns
from django.contrib.auth.views import LogoutView
from django.views.generic import TemplateView
urlpatterns = [
path("", TemplateView.as_view(template_name='sqrl.html'), name='index'),
path("admin/", admin.site.urls),
path("sqrl/", include('sqrl.urls', namespace='sqrl')),
path("logout/", LogoutView.as_view(), {'next_page': 'sqrl:login'}, name='logout'),
# Doesn't this not work/break things?
path("", include(auth_urlpatterns)),
]