[Python-modules-commits] [python-django-x509] 01/02: importing python-django-x509_0.3.2.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Thu Dec 14 14:29:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch debian/master
in repository python-django-x509.
commit ea64881902db371a49700ceac60fc39688c877e3
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Wed Dec 13 19:41:08 2017 +0100
importing python-django-x509_0.3.2.orig.tar.gz
---
CHANGES.rst | 87 ++++
LICENSE | 27 ++
MANIFEST.in | 10 +
PKG-INFO | 453 +++++++++++++++++++
README.rst | 430 ++++++++++++++++++
django_x509.egg-info/PKG-INFO | 453 +++++++++++++++++++
django_x509.egg-info/SOURCES.txt | 34 ++
django_x509.egg-info/dependency_links.txt | 1 +
django_x509.egg-info/not-zip-safe | 1 +
django_x509.egg-info/requires.txt | 6 +
django_x509.egg-info/top_level.txt | 1 +
django_x509/__init__.py | 17 +
django_x509/admin.py | 7 +
django_x509/apps.py | 7 +
django_x509/base/__init__.py | 0
django_x509/base/admin.py | 116 +++++
django_x509/base/models.py | 452 +++++++++++++++++++
django_x509/base/views.py | 18 +
django_x509/migrations/0001_initial.py | 85 ++++
django_x509/migrations/0002_certificate.py | 66 +++
.../migrations/0003_rename_organization_field.py | 25 ++
django_x509/migrations/__init__.py | 0
django_x509/models.py | 17 +
django_x509/settings.py | 13 +
django_x509/static/django-x509/css/admin.css | 22 +
.../templates/admin/django_x509/change_form.html | 25 ++
django_x509/tests/__init__.py | 45 ++
django_x509/tests/test_ca.py | 488 +++++++++++++++++++++
django_x509/tests/test_cert.py | 399 +++++++++++++++++
django_x509/urls.py | 7 +
django_x509/utils.py | 12 +
django_x509/views.py | 4 +
requirements.txt | 6 +
setup.cfg | 12 +
setup.py | 65 +++
35 files changed, 3411 insertions(+)
diff --git a/CHANGES.rst b/CHANGES.rst
new file mode 100644
index 0000000..0380437
--- /dev/null
+++ b/CHANGES.rst
@@ -0,0 +1,87 @@
+Changelog
+=========
+
+Version 0.3.2 [2017-12-06]
+--------------------------
+
+* [requirements] upgraded pyopenssl to 17.5.0 and cryptography to 2.2.0
+* [models] Fixed uncaught exception when imported
+ PEM `certificate` or `private_key` is invalid
+
+Version 0.3.1 [2017-12-01]
+--------------------------
+
+* temporarily downgraded cryptography and pyopenssl versions
+ to avoid segmentation faults
+
+Version 0.3.0 [2017-11-03]
+--------------------------
+
+* [models] Avoided possible double insertion in ``Base.save``
+* [requirements] pyopenssl>=17.1.0,<17.4.0
+* [admin] Fixed preformatted look of certificate and private-key fields
+* [models] Allow importing certs with invalid country codes
+* [models] Allow importing certificate with empty common name
+* [tests] Updated data for import test to fix pyOpenSSL issue
+* [models] Renamed ``organization`` field to ``organization_name``
+
+Version 0.2.4 [2017-07-04]
+--------------------------
+
+* [models] added ``digest`` argument to ``CRL.export``
+* [requirements] pyopenssl>=17.1.0,<17.2.0
+
+Version 0.2.3 [2017-05-15]
+--------------------------
+
+* [migrations] Updated ``validity_start`` on ``Cert`` model
+
+Version 0.2.2 [2017-05-11]
+--------------------------
+
+* [models] Set ``validity_start`` to 1 day before the current date (at 00:00)
+
+Version 0.2.1 [2017-05-02]
+--------------------------
+
+* [django] added support for django 1.11
+
+Version 0.2.0 [2017-01-11]
+--------------------------
+
+* [models] improved reusability by providing abstract models
+* [admin] improved reusability by providing abstract admin classes
+* [views] provided a base view that can be reused by third party apps
+* [docs] documented how to extend models and admin
+* [docs] documented hard dependencies
+
+Version 0.1.3 [2016-09-22]
+--------------------------
+
+* [model] avoid import error if any imported field is ``NULL``
+* [admin] added ``serial_number`` to ``list_display`` in ``Cert`` admin
+* [model] avoid exception if x509 subject attributes are empty
+
+Version 0.1.2 [2016-09-08]
+--------------------------
+
+* improved general ``verbose_name`` of the app
+* added official compatibility with django 1.10
+* [admin] show link to CA in cert admin
+* [admin] added ``key_length`` and ``digest`` to available filters
+
+Version 0.1.1 [2016-08-03]
+--------------------------
+
+* fixed x509 certificate version
+* renamed ``public_key`` field to more appropiate ``certificate``
+* show x509 text dump in admin when editing objects
+
+Version 0.1 [2016-07-18]
+------------------------
+
+* CA and end entity certificate generation
+* import existing certificates
+* x509 extensions
+* revocation
+* CRL
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..ca8395e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2015, Federico Capoano
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of django-x509, openwisp nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..58c6a90
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,10 @@
+include LICENSE
+include README.rst
+include CHANGES.rst
+include requirements.txt
+recursive-include django_x509 *
+recursive-exclude * *.pyc
+recursive-exclude * *.swp
+recursive-exclude * __pycache__
+recursive-exclude * *.db
+recursive-exclude * local_settings.py
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..58acda0
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,453 @@
+Metadata-Version: 1.1
+Name: django-x509
+Version: 0.3.2
+Summary: Reusable django app to generate and manage x509 certificates
+Home-page: https://github.com/openwisp/django-x509
+Author: Federico Capoano
+Author-email: f.capoano at cineca.it
+License: BSD
+Download-URL: https://github.com/openwisp/django-x509/releases
+Description-Content-Type: UNKNOWN
+Description: django-x509
+ ===========
+
+ .. image:: https://travis-ci.org/openwisp/django-x509.svg
+ :target: https://travis-ci.org/openwisp/django-x509
+
+ .. image:: https://coveralls.io/repos/openwisp/django-x509/badge.svg
+ :target: https://coveralls.io/r/openwisp/django-x509
+
+ .. image:: https://requires.io/github/openwisp/django-x509/requirements.svg?branch=master
+ :target: https://requires.io/github/openwisp/django-x509/requirements/?branch=master
+ :alt: Requirements Status
+
+ .. image:: https://badge.fury.io/py/django-x509.svg
+ :target: http://badge.fury.io/py/django-x509
+
+ ------------
+
+ Simple reusable django app implementing x509 PKI certificates management.
+
+ ------------
+
+ .. contents:: **Table of Contents**:
+ :backlinks: none
+ :depth: 3
+
+ ------------
+
+ Current features
+ ----------------
+
+ * CA generation
+ * Import existing CAs
+ * End entity certificate generation
+ * Import existing certificates
+ * Certificate revocation
+ * CRL view (public or protected)
+ * Possibility to specify x509 extensions on each certificate
+
+ Project goals
+ -------------
+
+ * provide a simple and reusable x509 PKI management django app
+ * provide abstract models that can be imported and extended in larger django projects
+
+ Dependencies
+ ------------
+
+ * Python 2.7 or Python >= 3.4
+ * OpenSSL
+
+ Install stable version from pypi
+ --------------------------------
+
+ Install from pypi:
+
+ .. code-block:: shell
+
+ pip install django-x509
+
+ Install development version
+ ---------------------------
+
+ Install tarball:
+
+ .. code-block:: shell
+
+ pip install https://github.com/openwisp/django-x509/tarball/master
+
+ Alternatively you can install via pip using git:
+
+ .. code-block:: shell
+
+ pip install -e git+git://github.com/openwisp/django-x509#egg=django-x509
+
+ If you want to contribute, install your cloned fork:
+
+ .. code-block:: shell
+
+ git clone git at github.com:<your_fork>/django-x509.git
+ cd django-x509
+ python setup.py develop
+
+ Setup (integrate in an existing django project)
+ -----------------------------------------------
+
+ Add ``django_x509`` to ``INSTALLED_APPS``:
+
+ .. code-block:: python
+
+ INSTALLED_APPS = [
+ # other apps
+ 'django_x509',
+ ]
+
+ Add the URLs to your main ``urls.py``:
+
+ .. code-block:: python
+
+ urlpatterns = [
+ # ... other urls in your project ...
+
+ # django-x509 urls
+ # keep the namespace argument unchanged
+ url(r'^', include('django_x509.urls', namespace='x509')),
+ ]
+
+ Then run:
+
+ .. code-block:: shell
+
+ ./manage.py migrate
+
+ Installing for development
+ --------------------------
+
+ Install sqlite:
+
+ .. code-block:: shell
+
+ sudo apt-get install sqlite3 libsqlite3-dev
+
+ Install your forked repo:
+
+ .. code-block:: shell
+
+ git clone git://github.com/<your_fork>/django-x509
+ cd django-x509/
+ python setup.py develop
+
+ Install test requirements:
+
+ .. code-block:: shell
+
+ pip install -r requirements-test.txt
+
+ Create database:
+
+ .. code-block:: shell
+
+ cd tests/
+ ./manage.py migrate
+ ./manage.py createsuperuser
+
+ Launch development server:
+
+ .. code-block:: shell
+
+ ./manage.py runserver
+
+ You can access the admin interface at http://127.0.0.1:8000/admin/.
+
+ Run tests with:
+
+ .. code-block:: shell
+
+ ./runtests.py
+
+ Install and run on docker
+ --------------------------
+ Build from docker file:
+
+ .. code-block:: shell
+
+ sudo docker build -t openwisp/djangox509 .
+
+ Run the docker container:
+
+ .. code-block:: shell
+
+ sudo docker run -it -p 8000:8000 batuhan/django509
+
+ Settings
+ --------
+ ``DJANGO_X509_DEFAULT_CERT_VALIDITY``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+-------------+
+ | **type**: | ``int`` |
+ +--------------+-------------+
+ | **default**: | ``365`` |
+ +--------------+-------------+
+
+ Default validity period (in days) when creating new x509 certificates.
+
+
+ ``DJANGO_X509_DEFAULT_CA_VALIDITY``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+-------------+
+ | **type**: | ``int`` |
+ +--------------+-------------+
+ | **default**: | ``3650`` |
+ +--------------+-------------+
+
+ Default validity period (in days) when creating new Certification Authorities.
+
+ ``DJANGO_X509_DEFAULT_KEY_LENGTH``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+-------------+
+ | **type**: | ``int`` |
+ +--------------+-------------+
+ | **default**: | ``2048`` |
+ +--------------+-------------+
+
+ Default key length for new CAs and new certificates.
+
+ Must be one of the following values:
+
+ * ``512``
+ * ``1024``
+ * ``2048``
+ * ``4096``
+
+ ``DJANGO_X509_DEFAULT_DIGEST_ALGORITHM``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+-------------+
+ | **type**: | ``str`` |
+ +--------------+-------------+
+ | **default**: | ``sha256`` |
+ +--------------+-------------+
+
+ Default digest algorithm for new CAs and new certificates.
+
+ Must be one of the following values:
+
+ * ``sha1``
+ * ``sha224``
+ * ``sha256``
+ * ``sha384``
+ * ``sha512``
+
+ ``DJANGO_X509_CA_BASIC_CONSTRAINTS_CRITICAL``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+-----------+
+ | **type**: | ``bool`` |
+ +--------------+-----------+
+ | **default**: | ``True`` |
+ +--------------+-----------+
+
+ Whether the ``basicConstraint`` x509 extension must be flagged as critical when creating new CAs.
+
+ ``DJANGO_X509_CA_BASIC_CONSTRAINTS_PATHLEN``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+---------------------+
+ | **type**: | ``int`` or ``None`` |
+ +--------------+---------------------+
+ | **default**: | ``0`` |
+ +--------------+---------------------+
+
+ Value of the ``pathLenConstraint`` of ``basicConstraint`` x509 extension used when creating new CAs.
+
+ When this value is a positive ``int`` it represents the maximum number of non-self-issued
+ intermediate certificates that may follow the generated certificate in a valid certification path.
+
+ Set this value to ``None`` to avoid imposing any limit.
+
+ ``DJANGO_X509_CA_KEYUSAGE_CRITICAL``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+--------------------------+
+ | **type**: | ``bool`` |
+ +--------------+--------------------------+
+ | **default**: | ``True`` |
+ +--------------+--------------------------+
+
+ Whether the ``keyUsage`` x509 extension should be flagged as "critical" for new CAs.
+
+ ``DJANGO_X509_CA_KEYUSAGE_VALUE``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+--------------------------+
+ | **type**: | ``str`` |
+ +--------------+--------------------------+
+ | **default**: | ``cRLSign, keyCertSign`` |
+ +--------------+--------------------------+
+
+ Value of the ``keyUsage`` x509 extension for new CAs.
+
+ ``DJANGO_X509_CERT_KEYUSAGE_CRITICAL``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+--------------------------+
+ | **type**: | ``bool`` |
+ +--------------+--------------------------+
+ | **default**: | ``False`` |
+ +--------------+--------------------------+
+
+ Whether the ``keyUsage`` x509 extension should be flagged as "critical" for new
+ end-entity certificates.
+
+ ``DJANGO_X509_CERT_KEYUSAGE_VALUE``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+---------------------------------------+
+ | **type**: | ``str`` |
+ +--------------+---------------------------------------+
+ | **default**: | ``digitalSignature, keyEncipherment`` |
+ +--------------+---------------------------------------+
+
+ Value of the ``keyUsage`` x509 extension for new end-entity certificates.
+
+ ``DJANGO_X509_CRL_PROTECTED``
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +--------------+-----------+
+ | **type**: | ``bool`` |
+ +--------------+-----------+
+ | **default**: | ``False`` |
+ +--------------+-----------+
+
+ Whether the view for downloading Certificate Revocation Lists should
+ be protected with authentication or not.
+
+ Extending django-x509
+ ---------------------
+
+ *django-x509* provides a set of models and admin classes which can be imported,
+ extended and reused by third party apps.
+
+ To extend *django-x509*, **you MUST NOT** add it to ``settings.INSTALLED_APPS``,
+ but you must create your own app (which goes into ``settings.INSTALLED_APPS``), import the
+ base classes from django-x509 and add your customizations.
+
+ Extending models
+ ~~~~~~~~~~~~~~~~
+
+ This example provides an example of how to extend the base models of
+ *django-x509* by adding a relation to another django model named `Organization`.
+
+ .. code-block:: python
+
+ # models.py of your app
+ from django.db import models
+ from django_x509.base.models import AbstractCa, AbstractCert
+
+ # the model ``organizations.Organization`` is omitted for brevity
+ # if you are curious to see a real implementation, check out django-organizations
+
+
+ class OrganizationMixin(models.Model):
+ organization = models.ForeignKey('organizations.Organization')
+
+ class Meta:
+ abstract = True
+
+
+ class Ca(OrganizationMixin, AbstractCa):
+ class Meta(AbstractCa.Meta):
+ abstract = False
+
+ def clean(self):
+ # your own validation logic here...
+ pass
+
+
+ class Cert(OrganizationMixin, AbstractCert):
+ ca = models.ForeignKey(Ca)
+
+ class Meta(AbstractCert.Meta):
+ abstract = False
+
+ def clean(self):
+ # your own validation logic here...
+ pass
+
+ Extending the admin
+ ~~~~~~~~~~~~~~~~~~~
+
+ Following the previous `Organization` example, you can avoid duplicating the admin
+ code by importing the base admin classes and registering your models with.
+
+ .. code-block:: python
+
+ # admin.py of your app
+ from django.contrib import admin
+
+ from django_x509.base.admin import CaAdmin as BaseCaAdmin
+ from django_x509.base.admin import CertAdmin as BaseCertAdmin
+
+ from .models import Ca, Cert
+
+
+ class CaAdmin(BaseCaAdmin):
+ # extend/modify the default behaviour here
+ pass
+
+
+ class CertAdmin(BaseCertAdmin):
+ # extend/modify the default behaviour here
+ pass
+
+
+ admin.site.register(Ca, CaAdmin)
+ admin.site.register(Cert, CertAdmin)
+
+
+ Contributing
+ ------------
+
+ 1. Announce your intentions in the `OpenWISP Mailing List <https://groups.google.com/d/forum/openwisp>`_
+ 2. Fork this repo and install it
+ 3. Follow `PEP8, Style Guide for Python Code`_
+ 4. Write code
+ 5. Write tests for your code
+ 6. Ensure all tests pass
+ 7. Ensure test coverage does not decrease
+ 8. Document your changes
+ 9. Send pull request
+
+ .. _PEP8, Style Guide for Python Code: http://www.python.org/dev/peps/pep-0008/
+
+ Changelog
+ ---------
+
+ See `CHANGES <https://github.com/openwisp/django-x509/blob/master/CHANGES.rst>`_.
+
+ License
+ -------
+
+ See `LICENSE <https://github.com/openwisp/django-x509/blob/master/LICENSE>`_.
+
+ Support
+ -------
+
+ See `OpenWISP Support Channels <http://openwisp.org/support.html>`_.
+
+Keywords: django,x509,pki,PEM,openwisp
+Platform: Platform Indipendent
+Classifier: Development Status :: 3 - Alpha
+Classifier: Environment :: Web Environment
+Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Operating System :: OS Independent
+Classifier: Framework :: Django
+Classifier: Topic :: Security :: Cryptography
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.4
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..992e9ef
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,430 @@
+django-x509
+===========
+
+.. image:: https://travis-ci.org/openwisp/django-x509.svg
+ :target: https://travis-ci.org/openwisp/django-x509
+
+.. image:: https://coveralls.io/repos/openwisp/django-x509/badge.svg
+ :target: https://coveralls.io/r/openwisp/django-x509
+
+.. image:: https://requires.io/github/openwisp/django-x509/requirements.svg?branch=master
+ :target: https://requires.io/github/openwisp/django-x509/requirements/?branch=master
+ :alt: Requirements Status
+
+.. image:: https://badge.fury.io/py/django-x509.svg
+ :target: http://badge.fury.io/py/django-x509
+
+------------
+
+Simple reusable django app implementing x509 PKI certificates management.
+
+------------
+
+.. contents:: **Table of Contents**:
+ :backlinks: none
+ :depth: 3
+
+------------
+
+Current features
+----------------
+
+* CA generation
+* Import existing CAs
+* End entity certificate generation
+* Import existing certificates
+* Certificate revocation
+* CRL view (public or protected)
+* Possibility to specify x509 extensions on each certificate
+
+Project goals
+-------------
+
+* provide a simple and reusable x509 PKI management django app
+* provide abstract models that can be imported and extended in larger django projects
+
+Dependencies
+------------
+
+* Python 2.7 or Python >= 3.4
+* OpenSSL
+
+Install stable version from pypi
+--------------------------------
+
+Install from pypi:
+
+.. code-block:: shell
+
+ pip install django-x509
+
+Install development version
+---------------------------
+
+Install tarball:
+
+.. code-block:: shell
+
+ pip install https://github.com/openwisp/django-x509/tarball/master
+
+Alternatively you can install via pip using git:
+
+.. code-block:: shell
+
+ pip install -e git+git://github.com/openwisp/django-x509#egg=django-x509
+
+If you want to contribute, install your cloned fork:
+
+.. code-block:: shell
+
+ git clone git at github.com:<your_fork>/django-x509.git
+ cd django-x509
+ python setup.py develop
+
+Setup (integrate in an existing django project)
+-----------------------------------------------
+
+Add ``django_x509`` to ``INSTALLED_APPS``:
+
+.. code-block:: python
+
+ INSTALLED_APPS = [
+ # other apps
+ 'django_x509',
+ ]
+
+Add the URLs to your main ``urls.py``:
+
+.. code-block:: python
+
+ urlpatterns = [
+ # ... other urls in your project ...
+
+ # django-x509 urls
+ # keep the namespace argument unchanged
+ url(r'^', include('django_x509.urls', namespace='x509')),
+ ]
+
+Then run:
+
+.. code-block:: shell
+
+ ./manage.py migrate
+
+Installing for development
+--------------------------
+
+Install sqlite:
+
+.. code-block:: shell
+
+ sudo apt-get install sqlite3 libsqlite3-dev
+
+Install your forked repo:
+
+.. code-block:: shell
+
+ git clone git://github.com/<your_fork>/django-x509
+ cd django-x509/
+ python setup.py develop
+
+Install test requirements:
+
+.. code-block:: shell
+
+ pip install -r requirements-test.txt
+
+Create database:
+
+.. code-block:: shell
+
+ cd tests/
+ ./manage.py migrate
+ ./manage.py createsuperuser
+
+Launch development server:
+
+.. code-block:: shell
+
+ ./manage.py runserver
+
+You can access the admin interface at http://127.0.0.1:8000/admin/.
+
+Run tests with:
+
+.. code-block:: shell
+
+ ./runtests.py
+
+Install and run on docker
+--------------------------
+Build from docker file:
+
+.. code-block:: shell
+
+ sudo docker build -t openwisp/djangox509 .
+
+Run the docker container:
+
+.. code-block:: shell
+
+ sudo docker run -it -p 8000:8000 batuhan/django509
+
+Settings
+--------
+``DJANGO_X509_DEFAULT_CERT_VALIDITY``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+-------------+
+| **type**: | ``int`` |
++--------------+-------------+
+| **default**: | ``365`` |
++--------------+-------------+
+
+Default validity period (in days) when creating new x509 certificates.
+
+
+``DJANGO_X509_DEFAULT_CA_VALIDITY``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+-------------+
+| **type**: | ``int`` |
++--------------+-------------+
+| **default**: | ``3650`` |
++--------------+-------------+
+
+Default validity period (in days) when creating new Certification Authorities.
+
+``DJANGO_X509_DEFAULT_KEY_LENGTH``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+-------------+
+| **type**: | ``int`` |
++--------------+-------------+
+| **default**: | ``2048`` |
++--------------+-------------+
+
+Default key length for new CAs and new certificates.
+
+Must be one of the following values:
+
+* ``512``
+* ``1024``
+* ``2048``
+* ``4096``
+
+``DJANGO_X509_DEFAULT_DIGEST_ALGORITHM``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+-------------+
+| **type**: | ``str`` |
++--------------+-------------+
+| **default**: | ``sha256`` |
++--------------+-------------+
+
+Default digest algorithm for new CAs and new certificates.
+
+Must be one of the following values:
+
+* ``sha1``
+* ``sha224``
+* ``sha256``
+* ``sha384``
+* ``sha512``
+
+``DJANGO_X509_CA_BASIC_CONSTRAINTS_CRITICAL``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+-----------+
+| **type**: | ``bool`` |
++--------------+-----------+
+| **default**: | ``True`` |
++--------------+-----------+
+
+Whether the ``basicConstraint`` x509 extension must be flagged as critical when creating new CAs.
+
+``DJANGO_X509_CA_BASIC_CONSTRAINTS_PATHLEN``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+---------------------+
+| **type**: | ``int`` or ``None`` |
++--------------+---------------------+
+| **default**: | ``0`` |
++--------------+---------------------+
+
+Value of the ``pathLenConstraint`` of ``basicConstraint`` x509 extension used when creating new CAs.
+
+When this value is a positive ``int`` it represents the maximum number of non-self-issued
+intermediate certificates that may follow the generated certificate in a valid certification path.
+
+Set this value to ``None`` to avoid imposing any limit.
+
+``DJANGO_X509_CA_KEYUSAGE_CRITICAL``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+--------------------------+
+| **type**: | ``bool`` |
++--------------+--------------------------+
+| **default**: | ``True`` |
++--------------+--------------------------+
+
+Whether the ``keyUsage`` x509 extension should be flagged as "critical" for new CAs.
+
+``DJANGO_X509_CA_KEYUSAGE_VALUE``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+--------------------------+
+| **type**: | ``str`` |
++--------------+--------------------------+
+| **default**: | ``cRLSign, keyCertSign`` |
++--------------+--------------------------+
+
+Value of the ``keyUsage`` x509 extension for new CAs.
+
+``DJANGO_X509_CERT_KEYUSAGE_CRITICAL``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+--------------------------+
+| **type**: | ``bool`` |
++--------------+--------------------------+
+| **default**: | ``False`` |
++--------------+--------------------------+
+
+Whether the ``keyUsage`` x509 extension should be flagged as "critical" for new
+end-entity certificates.
+
+``DJANGO_X509_CERT_KEYUSAGE_VALUE``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+---------------------------------------+
+| **type**: | ``str`` |
++--------------+---------------------------------------+
+| **default**: | ``digitalSignature, keyEncipherment`` |
++--------------+---------------------------------------+
+
+Value of the ``keyUsage`` x509 extension for new end-entity certificates.
+
+``DJANGO_X509_CRL_PROTECTED``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
++--------------+-----------+
+| **type**: | ``bool`` |
++--------------+-----------+
+| **default**: | ``False`` |
++--------------+-----------+
+
+Whether the view for downloading Certificate Revocation Lists should
+be protected with authentication or not.
+
+Extending django-x509
+---------------------
+
+*django-x509* provides a set of models and admin classes which can be imported,
+extended and reused by third party apps.
+
+To extend *django-x509*, **you MUST NOT** add it to ``settings.INSTALLED_APPS``,
+but you must create your own app (which goes into ``settings.INSTALLED_APPS``), import the
+base classes from django-x509 and add your customizations.
+
+Extending models
+~~~~~~~~~~~~~~~~
+
+This example provides an example of how to extend the base models of
+*django-x509* by adding a relation to another django model named `Organization`.
+
+.. code-block:: python
+
+ # models.py of your app
+ from django.db import models
+ from django_x509.base.models import AbstractCa, AbstractCert
+
+ # the model ``organizations.Organization`` is omitted for brevity
+ # if you are curious to see a real implementation, check out django-organizations
+
+
+ class OrganizationMixin(models.Model):
+ organization = models.ForeignKey('organizations.Organization')
+
+ class Meta:
+ abstract = True
+
... 2659 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django-x509.git
More information about the Python-modules-commits
mailing list