add code of oidc4vp in dashboard
This commit is contained in:
parent
7fdf0dfe0b
commit
d9ccc8bbb3
|
@ -54,6 +54,7 @@ class Event(models.Model):
|
||||||
EV_USR_DEACTIVATED_BY_ADMIN = 30, "User deactivated"
|
EV_USR_DEACTIVATED_BY_ADMIN = 30, "User deactivated"
|
||||||
EV_USR_ACTIVATED_BY_ADMIN = 31, "User activated"
|
EV_USR_ACTIVATED_BY_ADMIN = 31, "User activated"
|
||||||
EV_USR_SEND_VP = 32, "User send Verificable Presentation"
|
EV_USR_SEND_VP = 32, "User send Verificable Presentation"
|
||||||
|
EV_USR_SEND_CREDENTIAL = 33, "User send credential"
|
||||||
|
|
||||||
created = models.DateTimeField(_("Date"), auto_now=True)
|
created = models.DateTimeField(_("Date"), auto_now=True)
|
||||||
message = models.CharField(_("Description"), max_length=350)
|
message = models.CharField(_("Description"), max_length=350)
|
||||||
|
@ -417,6 +418,13 @@ class Event(models.Model):
|
||||||
user=user
|
user=user
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def set_EV_USR_SEND_CREDENTIAL(cls, msg):
|
||||||
|
cls.objects.create(
|
||||||
|
type=cls.Types.EV_USR_SEND_CREDENTIAL,
|
||||||
|
message=msg,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DID(models.Model):
|
class DID(models.Model):
|
||||||
class Types(models.IntegerChoices):
|
class Types(models.IntegerChoices):
|
||||||
|
|
|
@ -80,6 +80,7 @@ class DashboardView(UserView, SingleTableView):
|
||||||
Event.Types.EV_CREDENTIAL_PRESENTED, # Credential presented
|
Event.Types.EV_CREDENTIAL_PRESENTED, # Credential presented
|
||||||
Event.Types.EV_CREDENTIAL_CAN_BE_REQUESTED, # Credential available
|
Event.Types.EV_CREDENTIAL_CAN_BE_REQUESTED, # Credential available
|
||||||
Event.Types.EV_CREDENTIAL_REVOKED, # Credential revoked
|
Event.Types.EV_CREDENTIAL_REVOKED, # Credential revoked
|
||||||
|
Event.Types.EV_USR_SEND_VP, # User send verificable presentation
|
||||||
]
|
]
|
||||||
return events_for_users
|
return events_for_users
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ class AuthorizeView(UserView, FormView):
|
||||||
elif authorization.get('response'):
|
elif authorization.get('response'):
|
||||||
txt = authorization.get('response')
|
txt = authorization.get('response')
|
||||||
messages.success(self.request, txt)
|
messages.success(self.request, txt)
|
||||||
|
Event.set_EV_USR_SEND_CREDENTIAL(txt)
|
||||||
txt2 = f"Verifier {verifier} send: " + txt
|
txt2 = f"Verifier {verifier} send: " + txt
|
||||||
Event.set_EV_USR_SEND_VP(txt2, self.request.user)
|
Event.set_EV_USR_SEND_VP(txt2, self.request.user)
|
||||||
url = reverse_lazy('idhub:user_dashboard')
|
url = reverse_lazy('idhub:user_dashboard')
|
||||||
|
|
Loading…
Reference in New Issue