Metadata-Version: 2.4
Name: django-eds-auth
Version: 0.1.0
Summary: Django EDS authentication package
License: MIT
License-File: LICENSE
Author: admin
Author-email: admin@example.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: Django (>=4.2)
Requires-Dist: cryptography (>=41.0.0)
Description-Content-Type: text/markdown

# django-eds-auth

A secure Django authentication backend for EDS (Electronic Digital Signature) based authentication.
Uses X.509 certificates and nonce-based challenge-response for cryptographically secure authentication.

## Overview

**django-eds-auth** is a Django authentication backend that implements EDS (Electronic Digital Signature) 
based login using X.509 certificates. It provides:

- ✅ Challenge-response authentication with single-use nonces
- ✅ RSA, ECDSA, and DSA signature verification support
- ✅ X.509 certificate chain validation
- ✅ Replay attack prevention
- ✅ Comprehensive audit logging
- ✅ No private keys stored on server

## Project Structure

- `src/django_eds_auth/` - Main package code
- `example_project/` - Example Django project for testing
- `tests/` - Unit and integration tests (56 tests total)
- `docs/` - Documentation and guides

## Quick Start

### Installation

```bash
# Install the package with development dependencies
pip install -e ".[dev]"

# Or install using pip directly
pip install django-eds-auth
```

### Configuration

1. Add to `INSTALLED_APPS` in Django settings:
```python
INSTALLED_APPS = [
    # ...
    'django_eds_auth',
]
```

2. Add authentication backend:
```python
AUTHENTICATION_BACKENDS = [
    'django.contrib.auth.backends.ModelBackend',
    'django_eds_auth.backends.EDSAuthBackend',
]
```

3. Include URLs:
```python
urlpatterns = [
    # ...
    path('auth/eds/', include('django_eds_auth.urls')),
]
```

4. Run migrations:
```bash
python manage.py migrate
```

5. Start the development server:
```bash
cd example_project
python manage.py runserver
```

## Testing

Running the full test suite:

```bash
# Run all tests with verbose output
pytest tests/ -v

# Run with coverage report
pytest tests/ --cov=django_eds_auth --cov-report=term-missing

# Run only security tests
pytest tests/test_security_and_coverage.py -v

# Run with timing information
pytest tests/ -v --durations=10
```

Current test results: **56 tests PASSED** ✅
- Coverage: **60%** (improved from 46%)
- Security module (signature_verification.py): **85%** (critical coverage)

## Documentation

- [COVERAGE_REPORT.md](COVERAGE_REPORT.md) - Detailed test coverage analysis
- [VERIFICATION.md](VERIFICATION.md) - Requirement verification and compliance
- [IMPLEMENTATION_GUIDE.md](IMPLEMENTATION_GUIDE.md) - Detailed implementation guide

## License

MIT License

