From c9933a0ab6ccd0d3cf28e05aa709dab3bc5e3ee1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 8 Mar 2024 22:37:26 +0100 Subject: [PATCH 1/3] add send email with verify presentation --- oidc4vp/templates/email/verify_email.html | 10 ++++++++++ oidc4vp/templates/email/verify_email.txt | 6 ++++++ oidc4vp/templates/email/verify_subject.txt | 1 + 3 files changed, 17 insertions(+) create mode 100644 oidc4vp/templates/email/verify_email.html create mode 100644 oidc4vp/templates/email/verify_email.txt create mode 100644 oidc4vp/templates/email/verify_subject.txt diff --git a/oidc4vp/templates/email/verify_email.html b/oidc4vp/templates/email/verify_email.html new file mode 100644 index 0000000..6a5b3b2 --- /dev/null +++ b/oidc4vp/templates/email/verify_email.html @@ -0,0 +1,10 @@ +Hola, hay una nueva verificación en el servicio de verificación Idhub {{ domain }} +
+El código asociado a esta verificación es: {{ code }} +
+estos son los datos de la verificación: +
+{{ verification|safe }} + +
+Muchas gracias diff --git a/oidc4vp/templates/email/verify_email.txt b/oidc4vp/templates/email/verify_email.txt new file mode 100644 index 0000000..b20596c --- /dev/null +++ b/oidc4vp/templates/email/verify_email.txt @@ -0,0 +1,6 @@ +Hola, hay una nueva verificación en el servicio de verificación Idhub {{ domain }} +El código asociado a esta verificación es: {{ code }} +estos son los datos de la verificación: +{{ verification|safe }} + +Muchas gracias diff --git a/oidc4vp/templates/email/verify_subject.txt b/oidc4vp/templates/email/verify_subject.txt new file mode 100644 index 0000000..c7a2a02 --- /dev/null +++ b/oidc4vp/templates/email/verify_subject.txt @@ -0,0 +1 @@ +Nueva verificacion en {{ dominio }} From 9f641c9252a7cc0e554aa3edd8e9f4de80258ebd Mon Sep 17 00:00:00 2001 From: pedro Date: Sat, 9 Mar 2024 20:28:32 +0100 Subject: [PATCH 2/3] add org csv for localhost pair --- examples/organizations__instance_localhost-pair.csv | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 examples/organizations__instance_localhost-pair.csv diff --git a/examples/organizations__instance_localhost-pair.csv b/examples/organizations__instance_localhost-pair.csv new file mode 100644 index 0000000..9f283d2 --- /dev/null +++ b/examples/organizations__instance_localhost-pair.csv @@ -0,0 +1,2 @@ +"localhost idhub1";"http://localhost/oidc4vp/";"localhost" +"localhost idhub2";"http://idhub2/oidc4vp/";"idhub2" From 29b3677da26bd012bd1ce49dfe578d9adc37d389 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 11 Mar 2024 11:21:30 +0100 Subject: [PATCH 3/3] response presentation without promotion --- oidc4vp/templates/received_code.html | 72 ++++++++++++++++++++++++++++ oidc4vp/urls.py | 2 + oidc4vp/views.py | 12 ++++- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 oidc4vp/templates/received_code.html diff --git a/oidc4vp/templates/received_code.html b/oidc4vp/templates/received_code.html new file mode 100644 index 0000000..dc03976 --- /dev/null +++ b/oidc4vp/templates/received_code.html @@ -0,0 +1,72 @@ + +{% load i18n static %} + + + + + + + + + + {% block title %}{% if title %}{{ title }} – {% endif %}Pangea{% endblock %} + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+ {% trans 'Thank you, we are received your presentation correctly.' %} +
+
+
+
+ +
+
+ +
+
+
+ + diff --git a/oidc4vp/urls.py b/oidc4vp/urls.py index d7b79be..ccef7af 100644 --- a/oidc4vp/urls.py +++ b/oidc4vp/urls.py @@ -13,4 +13,6 @@ urlpatterns = [ name="authorize"), path('allow_code', views.AllowCodeView.as_view(), name="allow_code"), + path('received_code', views.ReceivedCodeView.as_view(), + name="received_code"), ] diff --git a/oidc4vp/views.py b/oidc4vp/views.py index 359a638..851c652 100644 --- a/oidc4vp/views.py +++ b/oidc4vp/views.py @@ -235,7 +235,17 @@ class AllowCodeView(View): promotion = self.authorization.promotions.first() if not promotion: - raise Http404("Page not Found!") + return redirect(reverse_lazy('oidc4vp:received_code')) return redirect(promotion.get_url(code)) + +class ReceivedCodeView(View): + template_name = "received_code.html" + + def get(self, request, *args, **kwargs): + self.context = {} + template = loader.get_template( + self.template_name, + ).render() + return HttpResponse(template)