From 2ce540fb3fde011113d5939750ac4db92a7b237a Mon Sep 17 00:00:00 2001 From: Elijah Date: Wed, 31 Jan 2024 10:55:09 +0100 Subject: [PATCH 01/39] Updated pipeline to run testing job on pull requests against main and release --- .gitea/workflows/ci-pipeline.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index a39158c..f7d4633 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -6,6 +6,10 @@ on: - main - release - testing-pipeline + pull_request: + branches: + - main + - release jobs: test: From fb41f1b2fe6f011288a3e94651b02e702d97b0f1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 1 Feb 2024 13:32:28 +0100 Subject: [PATCH 02/39] add 3 checkbox for terms and conditions --- idhub/admin/views.py | 2 +- idhub/templates/idhub/user/profile.html | 7 +++- .../idhub/user/terms_conditions.html | 38 +++++++------------ idhub/user/forms.py | 38 +++++++++++++++++-- idhub/user/views.py | 16 +++++++- 5 files changed, 70 insertions(+), 31 deletions(-) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index 3773cab..77c83b4 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -62,7 +62,7 @@ class TermsAndConditionsView(AdminView, FormView): template_name = "idhub/admin/terms_conditions.html" title = _("GDPR") section = "" - subtitle = _('Accept Terms and Conditions') + subtitle = _('Terms and Conditions') icon = 'bi bi-file-earmark-medical' form_class = TermsConditionsForm success_url = reverse_lazy('idhub:admin_dashboard') diff --git a/idhub/templates/idhub/user/profile.html b/idhub/templates/idhub/user/profile.html index 6efdc48..cfbc4b9 100644 --- a/idhub/templates/idhub/user/profile.html +++ b/idhub/templates/idhub/user/profile.html @@ -11,7 +11,12 @@ diff --git a/idhub/templates/idhub/user/terms_conditions.html b/idhub/templates/idhub/user/terms_conditions.html index 8a02175..f021b4d 100644 --- a/idhub/templates/idhub/user/terms_conditions.html +++ b/idhub/templates/idhub/user/terms_conditions.html @@ -20,38 +20,28 @@ {% endif %} -
+
- You must read the terms and conditions of this service and accept the - Read GDPR + {{ form.accept_privacy }} + {{ form.privacy_label|safe }}
-
-
- {% bootstrap_form form %} +
+
+ {{ form.accept_legal }} + {{ form.legal_label|safe }}
-
+
+
+ {{ form.accept_cookies }} + {{ form.cookies_label|safe }} +
+
+ - - {% endblock %} diff --git a/idhub/user/forms.py b/idhub/user/forms.py index bad06be..0c16171 100644 --- a/idhub/user/forms.py +++ b/idhub/user/forms.py @@ -15,8 +15,16 @@ class ProfileForm(forms.ModelForm): class TermsConditionsForm(forms.Form): - accept = forms.BooleanField( - label=_("Accept terms and conditions of the service"), + accept_privacy = forms.BooleanField( + widget=forms.CheckboxInput(attrs={'class': 'form-check-input'}), + required=False + ) + accept_legal = forms.BooleanField( + widget=forms.CheckboxInput(attrs={'class': 'form-check-input'}), + required=False + ) + accept_cookies = forms.BooleanField( + widget=forms.CheckboxInput(attrs={'class': 'form-check-input'}), required=False ) @@ -24,9 +32,33 @@ class TermsConditionsForm(forms.Form): self.user = kwargs.pop('user', None) super().__init__(*args, **kwargs) + def get_label(self, url, read): + label = _('You must read the terms and conditions of this service and accept the') + label += f' {read}' + return label + + def privacy_label(self): + url = "https://laweb.pangea.org/politica-de-privacitat/" + read = _("Read privacy policy") + return self.get_label(url, read) + + def legal_label(self): + url = "https://laweb.pangea.org/avis-legal/" + read = _("Read legal policy") + return self.get_label(url, read) + + def cookies_label(self): + url = "https://laweb.pangea.org/politica-de-cookies-2/" + read = _("Read cookies policy") + return self.get_label(url, read) + def clean(self): data = self.cleaned_data - if data.get("accept"): + privacy = data.get("accept_privacy") + legal = data.get("accept_legal") + cookies = data.get("accept_cookies") + if privacy and legal and cookies: self.user.accept_gdpr = True else: self.user.accept_gdpr = False diff --git a/idhub/user/views.py b/idhub/user/views.py index 82c5337..fcd622d 100644 --- a/idhub/user/views.py +++ b/idhub/user/views.py @@ -100,6 +100,13 @@ class ProfileView(MyProfile, UpdateView, SingleTableView): def form_valid(self, form): return super().form_valid(form) + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context.update({ + 'lang': self.request.LANGUAGE_CODE, + }) + return context class RolesView(MyProfile, SingleTableView): @@ -137,7 +144,7 @@ class TermsAndConditionsView(UserView, FormView): template_name = "idhub/user/terms_conditions.html" title = _("GDPR") section = "" - subtitle = _('Accept Terms and Conditions') + subtitle = _('Terms and Conditions') icon = 'bi bi-file-earmark-medical' form_class = TermsConditionsForm success_url = reverse_lazy('idhub:user_dashboard') @@ -145,7 +152,12 @@ class TermsAndConditionsView(UserView, FormView): def get_form_kwargs(self): kwargs = super().get_form_kwargs() kwargs['user'] = self.request.user - kwargs['initial'] = {"accept": self.request.user.accept_gdpr} + if self.request.user.accept_gdpr: + kwargs['initial'] = { + "accept_privacy": True, + "accept_legal": True, + "accept_cookies": True + } return kwargs def form_valid(self, form): From 1026762190f8118405537648978c08b2c7a2c101 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 1 Feb 2024 21:04:08 +0100 Subject: [PATCH 03/39] Test calling build script from passing pipeline --- .gitea/workflows/ci-pipeline.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index f7d4633..6154ab1 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -69,3 +69,17 @@ jobs: source venv/bin/activate python manage.py test + + deploy: + needs: test + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Trigger Remote Script + run: | + response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://your-server-ip:5000/trigger-script -H "Authorization: SecretToken") + if [ "$response" -ne 200 ]; then + echo "Script execution failed with HTTP status $response" + exit 1 + fi + if: success() && github.ref == 'refs/heads/main' From 186d7e33a660e7c0540e48ec302cb57a15674cfa Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 1 Feb 2024 21:05:28 +0100 Subject: [PATCH 04/39] Fix script step --- .gitea/workflows/ci-pipeline.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 6154ab1..ef60af2 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -77,9 +77,9 @@ jobs: - uses: actions/checkout@v4 - name: Trigger Remote Script run: | - response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://your-server-ip:5000/trigger-script -H "Authorization: SecretToken") - if [ "$response" -ne 200 ]; then + response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://your-server-ip:5000/trigger-script -H "Authorization: SecretToken") + if [ "$response" -ne 200 ]; then echo "Script execution failed with HTTP status $response" exit 1 - fi - if: success() && github.ref == 'refs/heads/main' + fi + if: success() && github.ref == 'refs/heads/main' From 2c720e80ab62625d374deaf708418d21d9e93a76 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 1 Feb 2024 21:21:10 +0100 Subject: [PATCH 05/39] Fix deploy job exit codes and webhook ip --- .gitea/workflows/ci-pipeline.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index ef60af2..4cf964f 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -77,9 +77,12 @@ jobs: - uses: actions/checkout@v4 - name: Trigger Remote Script run: | - response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://your-server-ip:5000/trigger-script -H "Authorization: SecretToken") + response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://45.150.187.54:5000/trigger-script -H "Authorization: SecretToken") if [ "$response" -ne 200 ]; then echo "Script execution failed with HTTP status $response" exit 1 + else + echo "Script execution successful" + exit 0 fi if: success() && github.ref == 'refs/heads/main' From 9a90d87d69b9a333a560474286775651f31606a5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 2 Feb 2024 09:18:15 +0100 Subject: [PATCH 06/39] fix setem fluw --- oidc4vp/views.py | 3 +-- promotion/forms.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/oidc4vp/views.py b/oidc4vp/views.py index d6eec81..7161aed 100644 --- a/oidc4vp/views.py +++ b/oidc4vp/views.py @@ -137,8 +137,7 @@ class VerifyView(View): vp_token.verifing() response = vp_token.get_response_verify() vp_token.save() - if not vp_token.authorization.promotions.exists(): - response["response"] = "Validation Code {}".format(code) + response["response"] = "Validation Code {}".format(code) return JsonResponse(response) diff --git a/promotion/forms.py b/promotion/forms.py index 5b96423..30dce87 100644 --- a/promotion/forms.py +++ b/promotion/forms.py @@ -14,7 +14,10 @@ from promotion.models import Promotion class WalletForm(forms.Form): - organization = forms.ChoiceField(choices=[]) + organization = forms.ChoiceField( + choices=[], + widget=forms.Select(attrs={'class': 'form-select'}) + ) def __init__(self, *args, **kwargs): self.presentation_definition = kwargs.pop('presentation_definition', []) From 3d7741f3dffed5827f6f9d856c5c6548a17443e7 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 2 Feb 2024 09:21:19 +0100 Subject: [PATCH 07/39] Print git refs to check if the deploy job is entering the if statement --- .gitea/workflows/ci-pipeline.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 4cf964f..3b62690 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -75,6 +75,13 @@ jobs: runs-on: self-hosted steps: - uses: actions/checkout@v4 + + - name: Check refs + run: | + echo $GITHUB_REF_NAME + echo $GITHUB_REF + echo $GITHUB_REF_TYPE + - name: Trigger Remote Script run: | response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://45.150.187.54:5000/trigger-script -H "Authorization: SecretToken") From 8c21ae3b1eda93719ae7a69da8bfda2f34ebea8e Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 2 Feb 2024 09:25:44 +0100 Subject: [PATCH 08/39] Add dummy if statement to ensure it works --- .gitea/workflows/ci-pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 3b62690..f69fe5f 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -81,6 +81,7 @@ jobs: echo $GITHUB_REF_NAME echo $GITHUB_REF echo $GITHUB_REF_TYPE + if: success() && github.ref == 'refs/heads/testing-pipeline' - name: Trigger Remote Script run: | From bc46ca851efd17e71ad079db1212244dcff2c413 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 2 Feb 2024 09:36:04 +0100 Subject: [PATCH 09/39] Remove main branch check to test webhook --- .gitea/workflows/ci-pipeline.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index f69fe5f..844c50f 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -76,13 +76,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Check refs - run: | - echo $GITHUB_REF_NAME - echo $GITHUB_REF - echo $GITHUB_REF_TYPE - if: success() && github.ref == 'refs/heads/testing-pipeline' - - name: Trigger Remote Script run: | response=$(curl -s -o /dev/null -w "%{http_code}" -X POST http://45.150.187.54:5000/trigger-script -H "Authorization: SecretToken") @@ -93,4 +86,4 @@ jobs: echo "Script execution successful" exit 0 fi - if: success() && github.ref == 'refs/heads/main' + #if: success() && github.ref == 'refs/heads/main' From fe82e261e92bb4dd04d2e53d97496013d6ad0f32 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 2 Feb 2024 10:11:25 +0100 Subject: [PATCH 10/39] change color select setem --- promotion/templates/select_wallet_setem.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promotion/templates/select_wallet_setem.html b/promotion/templates/select_wallet_setem.html index 5861f15..5b4104e 100644 --- a/promotion/templates/select_wallet_setem.html +++ b/promotion/templates/select_wallet_setem.html @@ -36,7 +36,7 @@ -
{% endif %} -
+ +
- You must read the terms and conditions of this service and accept the - Read GDPR + {{ form.accept_privacy }} + {{ form.privacy_label|safe }}
-
-
- {% bootstrap_form form %} +
+
+ {{ form.accept_legal }} + {{ form.legal_label|safe }}
-
- {% translate "Cancel" %} - +
+
+ {{ form.accept_cookies }} + {{ form.cookies_label|safe }} +
+
+ - + +{% endblock %} + +{% block extrascript %} + {% endblock %} diff --git a/idhub/templates/idhub/base.html b/idhub/templates/idhub/base.html index e579a81..c2524ad 100644 --- a/idhub/templates/idhub/base.html +++ b/idhub/templates/idhub/base.html @@ -88,7 +88,7 @@ @@ -150,9 +150,12 @@
+ {% block script %} + - + {% block extrascript %}{% endblock %} + {% endblock %} diff --git a/idhub/templates/idhub/user/terms_conditions.html b/idhub/templates/idhub/user/terms_conditions.html index f021b4d..4175a60 100644 --- a/idhub/templates/idhub/user/terms_conditions.html +++ b/idhub/templates/idhub/user/terms_conditions.html @@ -39,9 +39,49 @@
+ + {% endblock %} + +{% block extrascript %} + +{% endblock %} diff --git a/idhub/user/forms.py b/idhub/user/forms.py index 0c16171..79e3d17 100644 --- a/idhub/user/forms.py +++ b/idhub/user/forms.py @@ -33,7 +33,7 @@ class TermsConditionsForm(forms.Form): super().__init__(*args, **kwargs) def get_label(self, url, read): - label = _('You must read the terms and conditions of this service and accept the') + label = _('I read and accepted the') label += f' {read}' return label diff --git a/idhub/user/views.py b/idhub/user/views.py index fcd622d..27c8f77 100644 --- a/idhub/user/views.py +++ b/idhub/user/views.py @@ -123,7 +123,7 @@ class RolesView(MyProfile, SingleTableView): class GDPRView(MyProfile, TemplateView): template_name = "idhub/user/gdpr.html" - subtitle = _('GDPR info') + subtitle = _('Data protection') icon = 'bi bi-file-earmark-medical' @@ -142,7 +142,7 @@ class CredentialsView(MyWallet, SingleTableView): class TermsAndConditionsView(UserView, FormView): template_name = "idhub/user/terms_conditions.html" - title = _("GDPR") + title = _("Data Protection") section = "" subtitle = _('Terms and Conditions') icon = 'bi bi-file-earmark-medical' From 0018932999ae58923aa170686f7202d8c7ac1a64 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 5 Feb 2024 12:27:45 +0100 Subject: [PATCH 16/39] change issues #104 --- idhub/admin/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index f680698..6cc4c74 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -978,7 +978,7 @@ class SchemasImportAddView(SchemasMix): class ImportView(ImportExport, SingleTableView): template_name = "idhub/admin/import.html" table_class = DataTable - subtitle = _('Import data') + subtitle = _('Imported data') icon = '' model = File_datas From 7d4a3d3e60d0a00d5cc6b85a0d4071b3af966dfd Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 5 Feb 2024 14:58:54 +0100 Subject: [PATCH 17/39] change read privacy for Privacy --- idhub/admin/forms.py | 6 +++--- idhub/user/forms.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index 1895195..59d0eb3 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -76,17 +76,17 @@ class TermsConditionsForm(forms.Form): def privacy_label(self): url = "https://laweb.pangea.org/politica-de-privacitat/" - read = _("Read privacy policy") + read = _("Privacy policy") return self.get_label(url, read) def legal_label(self): url = "https://laweb.pangea.org/avis-legal/" - read = _("Read legal policy") + read = _("Legal policy") return self.get_label(url, read) def cookies_label(self): url = "https://laweb.pangea.org/politica-de-cookies-2/" - read = _("Read cookies policy") + read = _("Cookies policy") return self.get_label(url, read) def clean(self): diff --git a/idhub/user/forms.py b/idhub/user/forms.py index 79e3d17..9561eb7 100644 --- a/idhub/user/forms.py +++ b/idhub/user/forms.py @@ -40,17 +40,17 @@ class TermsConditionsForm(forms.Form): def privacy_label(self): url = "https://laweb.pangea.org/politica-de-privacitat/" - read = _("Read privacy policy") + read = _("Privacy policy") return self.get_label(url, read) def legal_label(self): url = "https://laweb.pangea.org/avis-legal/" - read = _("Read legal policy") + read = _("Legal policy") return self.get_label(url, read) def cookies_label(self): url = "https://laweb.pangea.org/politica-de-cookies-2/" - read = _("Read cookies policy") + read = _("Cookies policy") return self.get_label(url, read) def clean(self): From 0e0bad18fba34007d0d75fd6146e9eeef2485259 Mon Sep 17 00:00:00 2001 From: Elijah Date: Tue, 6 Feb 2024 11:10:13 +0100 Subject: [PATCH 18/39] Added main check to only deploy on the main branch --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 844c50f..13fbcaf 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -86,4 +86,4 @@ jobs: echo "Script execution successful" exit 0 fi - #if: success() && github.ref == 'refs/heads/main' + if: success() && github.ref == 'refs/heads/main' From e6fddbf956b4b2c908ca427d408f4a338f645313 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 6 Feb 2024 18:12:20 +0100 Subject: [PATCH 19/39] add 5 users for test --- idhub/management/commands/initial_datas.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/idhub/management/commands/initial_datas.py b/idhub/management/commands/initial_datas.py index 69c1ef5..00224d9 100644 --- a/idhub/management/commands/initial_datas.py +++ b/idhub/management/commands/initial_datas.py @@ -23,11 +23,12 @@ class Command(BaseCommand): def handle(self, *args, **kwargs): ADMIN_EMAIL = config('ADMIN_EMAIL', 'admin@example.org') ADMIN_PASSWORD = config('ADMIN_PASSWORD', '1234') - USER_EMAIL = config('USER_EMAIL', 'user1@example.org') - USER_PASSWORD = config('USER_PASSWORD', '1234') self.create_admin_users(ADMIN_EMAIL, ADMIN_PASSWORD) - self.create_users(USER_EMAIL, USER_PASSWORD) + if settings.CREATE_TEST_USERS: + for u in range(1, 6): + user = 'user{}@example.org'.format(u) + self.create_users(user, '1234') BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent ORGANIZATION = os.path.join(BASE_DIR, settings.ORG_FILE) From d15fc0726de49437d27d2c7a0b762011ae050be8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 6 Feb 2024 18:12:45 +0100 Subject: [PATCH 20/39] change gdpr for endpoint terms and conditions --- idhub/templates/idhub/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idhub/templates/idhub/base.html b/idhub/templates/idhub/base.html index c2524ad..46dee02 100644 --- a/idhub/templates/idhub/base.html +++ b/idhub/templates/idhub/base.html @@ -87,7 +87,7 @@ From 98ffdd0e3f0ac54fe4417b3ebd130490394a07e9 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 6 Feb 2024 18:13:57 +0100 Subject: [PATCH 21/39] fix bug: admnin see all dids --- idhub/admin/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index 6cc4c74..25ac28d 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -707,12 +707,13 @@ class DidsView(Credentials, SingleTableView): def get_context_data(self, **kwargs): queryset = kwargs.pop('object_list', None) + dids = DID.objects.filter(user=self.request.user) if queryset is None: - self.object_list = self.model.objects.all() + self.object_list = dids.all() context = super().get_context_data(**kwargs) context.update({ - 'dids': DID.objects.filter(user=self.request.user), + 'dids': dids }) return context From ddd25d0655a11a20f65ba71176c38fd0dc11efbd Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 6 Feb 2024 18:14:25 +0100 Subject: [PATCH 22/39] add new vars of 2factor and send emails --- idhub/email/views.py | 9 +++++---- idhub/views.py | 2 +- trustchain_idhub/settings.py | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/idhub/email/views.py b/idhub/email/views.py index f14e2a5..caa9370 100644 --- a/idhub/email/views.py +++ b/idhub/email/views.py @@ -57,12 +57,13 @@ class NotifyActivateUserByEmail: html_email = loader.render_to_string(self.html_email_template_name, context) email_message.attach_alternative(html_email, 'text/html') try: - if settings.DEVELOPMENT: - logger.warning(to_email) - logger.warning(body) + if settings.ENABLE_EMAIL: + email_message.send() return - email_message.send() + logger.warning(to_email) + logger.warning(body) + except Exception as err: logger.error(err) return diff --git a/idhub/views.py b/idhub/views.py index b161633..9adf9f4 100644 --- a/idhub/views.py +++ b/idhub/views.py @@ -56,7 +56,7 @@ class LoginView(auth_views.LoginView): # ) # cache.set("KEY_DIDS", encryption_key, None) cache.set("KEY_DIDS", sensitive_data_encryption_key, None) - if not settings.DEVELOPMENT: + if settings.AUTH2FACTOR: self.request.session["2fauth"] = str(uuid.uuid4()) return redirect(reverse_lazy('idhub:confirm_send_2f')) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index 6ab3b83..d243e55 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -31,7 +31,6 @@ SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', default=False, cast=bool) -DEVELOPMENT = config('DEVELOPMENT', default=False, cast=bool) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='', cast=Csv()) CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default='', cast=Csv()) @@ -226,3 +225,7 @@ LOGGING = { ORGANIZATION = config('ORGANIZATION', 'Pangea') SYNC_ORG_DEV = config('SYNC_ORG_DEV', 'y') ORG_FILE = config('ORG_FILE', 'examples/organizations.csv') +ENABLE_EMAIL = config('ENABLE_EMAIL', default=True, cast=bool) +CREATE_TEST_USERS = config('CREATE_TEST_USERS', default=False, cast=bool) +AUTH2FACTOR = config('AUTH2FACTOR', default=True, cast=bool) + From 1433949c4a7302b1c2cebdca9292078b2f697e07 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 6 Feb 2024 18:25:50 +0100 Subject: [PATCH 23/39] change AUTH2FACTOR -> ENABLE_2FACTOR_AUTH --- idhub/views.py | 2 +- trustchain_idhub/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/idhub/views.py b/idhub/views.py index 9adf9f4..06aeed0 100644 --- a/idhub/views.py +++ b/idhub/views.py @@ -56,7 +56,7 @@ class LoginView(auth_views.LoginView): # ) # cache.set("KEY_DIDS", encryption_key, None) cache.set("KEY_DIDS", sensitive_data_encryption_key, None) - if settings.AUTH2FACTOR: + if settings.ENABLE_2FACTOR_AUTH: self.request.session["2fauth"] = str(uuid.uuid4()) return redirect(reverse_lazy('idhub:confirm_send_2f')) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index d243e55..043054d 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -227,5 +227,5 @@ SYNC_ORG_DEV = config('SYNC_ORG_DEV', 'y') ORG_FILE = config('ORG_FILE', 'examples/organizations.csv') ENABLE_EMAIL = config('ENABLE_EMAIL', default=True, cast=bool) CREATE_TEST_USERS = config('CREATE_TEST_USERS', default=False, cast=bool) -AUTH2FACTOR = config('AUTH2FACTOR', default=True, cast=bool) +ENABLE_2FACTOR_AUTH = config('ENABLE_2FACTOR_AUTH', default=True, cast=bool) From 25c7d9eee0789ff07f35359672df725e2cbec5e4 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 7 Feb 2024 10:32:28 +0100 Subject: [PATCH 24/39] add email as required --- schemas/course-credential.json | 7 ++++++- schemas/federation-membership.json | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/schemas/course-credential.json b/schemas/course-credential.json index eae8f21..94cc700 100644 --- a/schemas/course-credential.json +++ b/schemas/course-credential.json @@ -1,5 +1,5 @@ { - "$id": "https://idhub.pangea.org/vc_schemas/courseCredential", + "$id": "https://idhub.pangea.org/vc_schemas/course-credential", "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "NGO Course Credential Schema", "description": "A NGO Course Credential Schema awarded by a NGO federation and their NGO members, as proposed by Lafede.cat", @@ -40,6 +40,10 @@ "type": "string", "description": "The family name of the student" }, + "email": { + "type": "string", + "format": "email" + }, "personalIdentifier": { "type": "string", "description": "The personal identifier of the student, such as ID number" @@ -116,6 +120,7 @@ "id", "firstName", "lastName", + "email", "personalIdentifier", "issuedDate", "modeOfInstruction", diff --git a/schemas/federation-membership.json b/schemas/federation-membership.json index b1f5a9d..d1e999e 100644 --- a/schemas/federation-membership.json +++ b/schemas/federation-membership.json @@ -1,5 +1,5 @@ { - "$id": "https://idhub.pangea.org/vc_schemas/federationMembership.json", + "$id": "https://idhub.pangea.org/vc_schemas/federation-membership.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Federation membership", "description": "The federation membership specifies participation of a NGO into a NGO federation, as proposed by Lafede.cat", @@ -113,6 +113,7 @@ "membershipStatus", "federation", "membershipSince", + "email", "certificationDate" ] } From c8e802c9586f470fea3e80e3d1c9c7e280f08045 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 7 Feb 2024 11:45:44 +0100 Subject: [PATCH 25/39] fix firstname --- idhub/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/idhub/models.py b/idhub/models.py index fea0156..c1feadd 100644 --- a/idhub/models.py +++ b/idhub/models.py @@ -674,7 +674,6 @@ class VerificableCredential(models.Model): 'organisation': settings.ORGANIZATION or '', } context.update(d) - context['firstName'] = "" return context def render(self, domain): From 8561ab08969f167517ef0df4b098baf78993f62a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 7 Feb 2024 11:46:08 +0100 Subject: [PATCH 26/39] fix form --- promotion/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/promotion/views.py b/promotion/views.py index 996314f..87f2a5e 100644 --- a/promotion/views.py +++ b/promotion/views.py @@ -68,9 +68,9 @@ class ContractView(FormView): return kwargs self.vp_token.get_user_info() - kwargs['initial']["nif"] = self.vp_token.user_info.get("nif", '') - kwargs['initial']["name"] = self.vp_token.user_info.get("name", '') - kwargs['initial']["first_last_name"] = self.vp_token.user_info.get("first_last_name", '') + kwargs['initial']["nif"] = self.vp_token.user_info.get("identityNumber", '') + kwargs['initial']["name"] = self.vp_token.user_info.get("firstName", '') + kwargs['initial']["first_last_name"] = self.vp_token.user_info.get("lastName", '') kwargs['initial']["second_last_name"] = self.vp_token.user_info.get("second_last_name", '') kwargs['initial']["email"] = self.vp_token.user_info.get("email", '') kwargs['initial']["email_repeat"] = self.vp_token.user_info.get("email", '') From 5a55a6c104831b0b794df263210a19cb83fb7419 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 7 Feb 2024 12:21:49 +0100 Subject: [PATCH 27/39] example of financial vulnerability --- examples/financial-vulnerability.xlsx | Bin 0 -> 8012 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 examples/financial-vulnerability.xlsx diff --git a/examples/financial-vulnerability.xlsx b/examples/financial-vulnerability.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..eb016f3f39058675d8626b647bd91cdd95dc3006 GIT binary patch literal 8012 zcmaKR1ys~+6EEEz0!nvxOLupsF(jg!%-3?MpOG`+Dgcp3@`^o3M zpR;H8JbTX0{P+1y&!{QF!r?(7At6CoY0K(CJtEZm^GgSiwIdtr!)IB1yGkcJTF9Yi z1mgwIq8L(kL6eeP69qSE8@27T+VI@2z~gf%TpYCM>dqK@AKyEZ{3Rt@<|TGoMWb-- z7vV51v_S8|uE9HdcQ)SP9G@O+epwB$B%{L{RfW@`Rq=s5Pp4P~lEtF%-9ngF7iHxQz{)4t6G|2*b@dLG0#E zp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?0EnJ zp?r+aE?N295iw&`B*lIoZGtaJ-5*LFtVe2F1XRWx?oiu;4~HuFm|D5H6^o%PjqDdf zxR45_>IoRx{k<+#S6)F~sqQeazPU2KWrl;ZKqY$O353tiXR9f2>r0#r6?;sU z$c^XPgdh!T=K1ud0Y4`zZQ$pxM3tZSj3kQ5*0+DTw!u~Pa^$@pRS_R_2@Qh>^?Sef zc%}8Q-}`TRwC($o@$tszVdM3i=*I;t!<6$ko!rCp?{oh)^ZZlbVH`U*Ny}#Ih^+A7fKTg&UMe=VN#QDYjze?sm1wGCu z54rs}89sRwYyWSi|C9Z3*nWsIzX|pp-2a4X;D1ukp8_5Su>Xbu@>syXvHnl)$1d~V fkH@(;_Ww`FQ&WV$??IuU(C=S*_r=cAFYx{kGkl(d literal 0 HcmV?d00001 From 7a2c48248b8d6a3f5a57cb13458bc36b85f66dca Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 8 Feb 2024 10:37:31 +0100 Subject: [PATCH 28/39] fix templates --- .../credentials/course-credential.json | 21 ++----------------- .../credentials/e-operator-claim.json | 12 +++-------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/idhub/templates/credentials/course-credential.json b/idhub/templates/credentials/course-credential.json index f3c299b..d4a97cb 100644 --- a/idhub/templates/credentials/course-credential.json +++ b/idhub/templates/credentials/course-credential.json @@ -2,25 +2,7 @@ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://idhub.pangea.org/credentials/base/v1", - { - "firstName": "https://idhub.pangea.org/context/#firstName", - "lastName": "https://idhub.pangea.org/context/#lastName", - "personalIdentifier": "https://idhub.pangea.org/context/#personalIdentifier", - "issuedDate": "https://idhub.pangea.org/context/#issuedDate", - "modeOfInstruction": "https://idhub.pangea.org/context/#modeOfInstruction", - "courseDuration": "https://idhub.pangea.org/context/#courseDuration", - "courseDays": "https://idhub.pangea.org/context/#courseDays", - "courseName": "https://idhub.pangea.org/context/#courseName", - "courseDescription": "https://idhub.pangea.org/context/#courseDescription", - "gradingScheme": "https://idhub.pangea.org/context/#gradingScheme", - "scoreAwarded": "https://idhub.pangea.org/context/#scoreAwarded", - "qualificationAwarded": "https://idhub.pangea.org/context/#qualificationAwarded", - "courseLevel": "https://idhub.pangea.org/context/#courseLevel", - "courseFramework": "https://idhub.pangea.org/context/#courseFramework", - "courseCredits": "https://idhub.pangea.org/context/#courseCredits", - "dateOfAssessment": "https://idhub.pangea.org/context/#dateOfAssessment", - "evidenceAssessment": "https://idhub.pangea.org/context/#evidenceAssessment" - } + "https://idhub.pangea.org/credentials/course-credential/v1" ], "id": "{{ vc_id }}", "type": [ @@ -59,6 +41,7 @@ "id": "{{ subject_did }}", "firstName": "{{ firstName }}", "lastName": "{{ lastName }}", + "email": "{{ email }}", "personalIdentifier": "{{ personalIdentifier }}", "issuedDate": "{{ issuedDate }}", "modeOfInstruction": "{{ modeOfInstruction }}", diff --git a/idhub/templates/credentials/e-operator-claim.json b/idhub/templates/credentials/e-operator-claim.json index 959472c..1b85bbe 100644 --- a/idhub/templates/credentials/e-operator-claim.json +++ b/idhub/templates/credentials/e-operator-claim.json @@ -2,14 +2,7 @@ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://idhub.pangea.org/credentials/base/v1", - { - "legalName": "https://idhub.pangea.org/context/#legalName", - "accreditedBy": "https://idhub.pangea.org/context/#accreditedBy", - "operatorNumber": "https://idhub.pangea.org/context/#operatorNumber", - "limitJurisdiction": "https://idhub.pangea.org/context/#limitJurisdiction", - "accreditedFor": "https://idhub.pangea.org/context/#accreditedFor", - "role": "https://idhub.pangea.org/context/#role" - } + "https://idhub.pangea.org/credentials/e-operator-claim/v1" ], "id": "{{ vc_id }}", "type": [ @@ -59,7 +52,8 @@ "operatorNumber": "{{ operatorNumber }}", "limitJurisdiction": "{{ limitJurisdiction }}", "accreditedFor": "{{ accreditedFor }}", - "role": "{{ role }}" + "role": "{{ role }}", + "email": "{{ email }}" }, "credentialSchema": { "id": "https://idhub.pangea.org/vc_schemas/federation-membership.json", From 3d3d8443955a7e2d0f65404efcc48e9dbff04f60 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 9 Feb 2024 08:55:40 +0100 Subject: [PATCH 29/39] change templates promotion --- promotion/templates/select_wallet.html | 1203 ++-------------- promotion/templates/somconnexio_contract.html | 1255 ++-------------- .../templates/somconnexio_tarifes_mobil.html | 1272 +---------------- 3 files changed, 237 insertions(+), 3493 deletions(-) diff --git a/promotion/templates/select_wallet.html b/promotion/templates/select_wallet.html index ba813ee..9199d1d 100644 --- a/promotion/templates/select_wallet.html +++ b/promotion/templates/select_wallet.html @@ -1,1126 +1,93 @@ - - - - - - - - - - - - +{% load i18n static %} + + + + + + + + + + {% block title %}{% if title %}{{ title }} – {% endif %}Pangea{% endblock %} + + + + + + + - - Escull la teva tarifa mòbil - Som Connexió - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
- - Tarifes
- -
-
-
- Persones sòcies 9.257 - Contractes 22.303 -
- -
- Blog  |  - Contacte -
- - - Vols que et truquem? -
-
-skip to Main Content
-
- - - - - - -
- -
- - -
- - -
- - - -
- - -{% load i18n %} -{% load django_bootstrap5 %} -
-{% csrf_token %} -{% if form.errors %} - -{% endif %} -
-
- {% bootstrap_form form %} -
-
- - -
-
- -
- - -
- - -
- - - -
- - - - - - - - - - -
- - -
- - - - -Back To Top - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -