From 1b74f5647af1f30fd83457aeb6929435e47ae700 Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 6 Mar 2024 17:27:57 +0100 Subject: [PATCH 1/5] autotest-pair: add DOMAIN column --- examples/organizations__instance_autotest-pair.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/organizations__instance_autotest-pair.csv b/examples/organizations__instance_autotest-pair.csv index a083186..23a4533 100644 --- a/examples/organizations__instance_autotest-pair.csv +++ b/examples/organizations__instance_autotest-pair.csv @@ -1,2 +1,2 @@ -"autotest idhub1";"https://idhub1-autotest.demo.pangea.org/oidc4vp/" -"autotest idhub2";"https://idhub2-autotest.demo.pangea.org/oidc4vp/" +"autotest idhub1";"https://idhub1-autotest.demo.pangea.org/oidc4vp/";"idhub1-autotest.demo.pangea.org" +"autotest idhub2";"https://idhub2-autotest.demo.pangea.org/oidc4vp/";"idhub2-autotest.demo.pangea.org" From f4a536d23bb683b7c3bea1bb8d8568c84c5b240c Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 6 Mar 2024 17:28:22 +0100 Subject: [PATCH 2/5] nightly pair: add csv --- examples/organizations__instance_nightly-pair.csv | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 examples/organizations__instance_nightly-pair.csv diff --git a/examples/organizations__instance_nightly-pair.csv b/examples/organizations__instance_nightly-pair.csv new file mode 100644 index 0000000..aa95637 --- /dev/null +++ b/examples/organizations__instance_nightly-pair.csv @@ -0,0 +1,2 @@ +"nightly idhub1";"https://idhub1-nightly.demo.pangea.org/oidc4vp/";"idhub1-nightly.demo.pangea.org" +"nightly idhub2";"https://idhub2-nightly.demo.pangea.org/oidc4vp/";"idhub2-nightly.demo.pangea.org" From 16c671452c0fd961b79a3540ca61674bf604531f Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 6 Mar 2024 17:50:31 +0100 Subject: [PATCH 3/5] bugfix wrong allow_code URI on OIDC_REDIRECT case with cayo in worksession --- trustchain_idhub/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index ed19a4c..525fb66 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -207,7 +207,7 @@ AUTH_USER_MODEL = 'idhub_auth.User' OIDC_REDIRECT = config('OIDC_REDIRECT', default=False, cast=bool) ALLOW_CODE_URI = config( 'ALLOW_CODE_URI', - default=f"https://{DOMAIN}/allow_code" + default=f"https://{DOMAIN}/oidc4vp/allow_code" ) SUPPORTED_CREDENTIALS = config( From 548ee0aa6eb0ef75823031d988b3974446f63d16 Mon Sep 17 00:00:00 2001 From: pedro Date: Wed, 6 Mar 2024 18:23:27 +0100 Subject: [PATCH 4/5] settings: always print DOMAIN var --- trustchain_idhub/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index 525fb66..c3a9438 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -34,6 +34,8 @@ DEBUG = config('DEBUG', default=False, cast=bool) DOMAIN = config("DOMAIN") assert DOMAIN not in [None, ''], "DOMAIN var is MANDATORY" +# this var is very important, we print it +print("DOMAIN: " + DOMAIN) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=DOMAIN, cast=Csv()) assert DOMAIN in ALLOWED_HOSTS, "DOMAIN is not ALLOWED_HOST" From f04a0ed86efb34f017835d81a847725ef67bb2d7 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 20 Feb 2024 19:20:49 +0100 Subject: [PATCH 5/5] add commit and date in footer --- idhub/mixins.py | 3 ++- idhub/templates/auth/login_base.html | 17 +++++++++++++++++ idhub/templates/idhub/base.html | 23 +++++++++++++++++++++++ idhub/templates/idhub/base_admin.html | 23 +++++++++++++++++++++++ idhub/views.py | 1 + trustchain_idhub/settings.py | 1 + 6 files changed, 67 insertions(+), 1 deletion(-) diff --git a/idhub/mixins.py b/idhub/mixins.py index b43f6e8..a32e7f7 100644 --- a/idhub/mixins.py +++ b/idhub/mixins.py @@ -75,7 +75,8 @@ class UserView(LoginRequiredMixin): 'path': resolve(self.request.path).url_name, 'user': self.request.user, 'wallet': self.wallet, - 'admin_validated': True if self.admin_validated else False + 'admin_validated': True if self.admin_validated else False, + 'commit_id': settings.COMMIT, }) return context diff --git a/idhub/templates/auth/login_base.html b/idhub/templates/auth/login_base.html index c7c5db1..3e08f19 100644 --- a/idhub/templates/auth/login_base.html +++ b/idhub/templates/auth/login_base.html @@ -82,6 +82,16 @@ +
+
+
+
+
+
+
+
+
+
+ +
+
+ {{ commit_id }} +
+
+ diff --git a/idhub/templates/idhub/base.html b/idhub/templates/idhub/base.html index 46dee02..51dd639 100644 --- a/idhub/templates/idhub/base.html +++ b/idhub/templates/idhub/base.html @@ -33,6 +33,22 @@ font-size: 3.5rem; } } + html, body { + height: 100%; + } + + body { + display: flex; + flex-direction: column; + } + + .main-content { + flex-grow: 1; + } + + footer { + width: 100%; + } @@ -150,6 +166,13 @@ + +
+
+ {{ commit_id }} +
+
+ {% block script %} diff --git a/idhub/templates/idhub/base_admin.html b/idhub/templates/idhub/base_admin.html index 271d6d5..db8354e 100644 --- a/idhub/templates/idhub/base_admin.html +++ b/idhub/templates/idhub/base_admin.html @@ -33,6 +33,22 @@ font-size: 3.5rem; } } + html, body { + height: 100%; + } + + body { + display: flex; + flex-direction: column; + } + + .main-content { + flex-grow: 1; + } + + footer { + width: 100%; + } @@ -180,6 +196,13 @@ + +
+
+ {{ commit_id }} +
+
+ {% block script %} diff --git a/idhub/views.py b/idhub/views.py index d3da1b4..6a848e3 100644 --- a/idhub/views.py +++ b/idhub/views.py @@ -27,6 +27,7 @@ class LoginView(auth_views.LoginView): extra_context = { 'title': _('Login'), 'success_url': reverse_lazy('idhub:user_dashboard'), + 'commit_id': settings.COMMIT, } def get(self, request, *args, **kwargs): diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index c3a9438..53e0f86 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -235,4 +235,5 @@ OIDC_ORGS = config('OIDC_ORGS', '') ENABLE_EMAIL = config('ENABLE_EMAIL', default=True, cast=bool) CREATE_TEST_USERS = config('CREATE_TEST_USERS', default=False, cast=bool) ENABLE_2FACTOR_AUTH = config('ENABLE_2FACTOR_AUTH', default=True, cast=bool) +COMMIT = config('COMMIT', default='')