devicehub-django/dpp/models.py

33 lines
1.3 KiB
Python
Raw Normal View History

2024-11-15 17:56:11 +00:00
from django.db import models
from user.models import User, Institution
from utils.constants import STR_EXTEND_SIZE
# Create your models here.
class Proof(models.Model):
## The signature can be a phid or dpp depending of type of Proof
2024-11-15 17:56:11 +00:00
timestamp = models.IntegerField()
uuid = models.UUIDField()
signature = models.CharField(max_length=STR_EXTEND_SIZE)
type = models.CharField(max_length=STR_EXTEND_SIZE)
issuer = models.ForeignKey(Institution, on_delete=models.CASCADE)
2024-11-15 17:56:11 +00:00
user = models.ForeignKey(
User, on_delete=models.SET_NULL, null=True, blank=True)
2024-11-19 20:17:48 +00:00
class MemberFederated(models.Model):
dlt_id_provider = models.IntegerField(primary_key=True)
domain = models.CharField(max_length=STR_EXTEND_SIZE)
# This client_id and client_secret is used for connected to this domain as
# a client and this domain then is the server of auth
2024-11-20 09:52:22 +00:00
client_id = models.CharField(max_length=STR_EXTEND_SIZE, null=True)
2024-11-19 20:17:48 +00:00
client_secret = models.CharField(max_length=STR_EXTEND_SIZE, null=True)
institution = models.ForeignKey(
Institution, on_delete=models.SET_NULL, null=True, blank=True)
class UserDpp(models.Model):
roles_dlt = models.TextField()
api_keys_dlt = models.TextField()
user = models.ForeignKey(User, on_delete=models.CASCADE)