IdHub is a Django-based project designed to provide efficient identity management solutions.This README offers an overview of the project, setup instructions, and additional resources.
The idHub service facilitates organisations (acting as issuer or verifiers) and beneficiaries (acting as subjects and credential holders) to issue, exchange, and verify data in the form of verifiable credentials for credible and flexible access to benefits or services.
- **Admin Dashboard**: A user-friendly admin panel that enables administrator to manage users and roles, handle aspects such as the creation of organisational Decentralized Identifiers (DIDs), credentials issued by the organisation, and upload the information for issuance of credentials to users (including credential schemas and data).
- **User Dashboard**: A user-friendly user panel equips users to manage their personal information, create an identity (DID), request the issuance of a credential, and present these credentials to entities within our user communitity. This module operates as a user wallet.
The application's backend is responsible for issuing credentials upun user request through the user module. Meanwhile, the idHub can function as a credential verifier and engage in dialogues with other idHub instances that operate as user wallets by implementing a OIDC4VP based dialog. Consequently, the idHub is multifaceted, capable of functioning as an issuer, wallet or verifier.
- **OIDC4VP module**: Module where all oidc4vp flows reside for credential presentation.
Below you can find a sample .env file with the required variables and a descriptive comment.
If you wish to test the application, you can paste the text below into a `.env` file.
Note that these values are insecure and should not be used in a production environment.
```
# Django secret key.
# It is used for cryptographic signing, securing password reset tokens, CSRF protection, and cookie security, ensuring the integrity and confidentiality of critical security operations within a Django application.
# As the name implies, it's critical that this is kept secret in a production environment.
SECRET_KEY = 'Dummy-S3cr3t-K3y!#12#**3aaxd'
# Enables Django's debug mode, providing detailed error pages and diagnostic information for development purposes.
DEBUG=True
# Specifies a list of host/domain names that this Django site can serve, enhancing security by preventing HTTP Host header attacks.
ALLOWED_HOSTS=.localhost,127.0.0.1
# Defines a list of trusted origins for safe cross-site HTTP requests, aiding in the prevention of cross-site request forgery attacks.
# Designates the file system path where static files will be collected and stored, used for serving static files in a production environment.
STATIC_ROOT=/tmp/static/
# Sets the file system path for storing uploaded media files from users, such as images and documents.
MEDIA_ROOT=/tmp/media/
# Typically used for specifying the database connection info in a single environment variable, but Django itself uses database settings defined in its settings.py.
Access the application at `http://localhost:8000`.
### Running Tests
IdHub uses Django's built-in testing tools to ensure the reliability and performance of the application. Follow these steps to run the tests:
Execute the following command in your project directory to run all tests:
```
python manage.py test
```
This command will discover and run all tests in the `tests` directories of the application.
## Repository Structure
IdHub's repository is organized into several directories, each serving a specific purpose in the project:
- **examples**: Examples of different data files used in some functionalities.
- **idhub**: The core directory of the IdHub project (templates, forms, views, models, etc.). It includes the main functionality of this Django project.
- **idhub_auth**: This directory contains the module where the users and the data encryption/decryption system are defined.
- **locale**: Contains localization files for IdHub (po and mo files for translations), enabling support for multiple languages.
- **oidc4vp**: Module where all oidc4vp flows (implementation of the credential's presentation dialog) reside.
- **promotion**: Example module showing how to create a portal that initializes the oidc4vp flow.
- **schemas**: Contains verifiable credential schemas used within IdHub for a preload without having to go to the original source.
- **trustchain_idhub**: This folder includes settings and configurations for the Django project. It is the entry point of Django, where the global variables, the startup files and the file that defines the endpoints are defined.
- **utils**: A utility folder containing various helper scripts and tools developed by us but that are independent of idHub. Even so, IdHub uses them and needs them (examples of this are the validation system for the data that is loades by excel, or the system that manages the sskit)