From a5353490482802882e8d236cc33c6e46e8eaa33c Mon Sep 17 00:00:00 2001 From: Lalith Kota Date: Mon, 1 Apr 2024 18:48:54 +0530 Subject: [PATCH 1/4] Github Test: Added pip pyjq build packages Signed-off-by: Lalith Kota --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e6e90e..2bd331d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,6 +78,8 @@ jobs: ports: - 5432:5432 steps: + # TODO: Think of caching dependency install. + - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq --no-install-recommends build-essential autoconf autotools-dev automake libtool - uses: actions/checkout@v3 with: persist-credentials: false From ac2e846aae3d3a32e438b206b1e4d0048e03a6da Mon Sep 17 00:00:00 2001 From: Lalith Kota Date: Mon, 1 Apr 2024 20:05:32 +0530 Subject: [PATCH 2/4] Fixed list argument in 15.0 Signed-off-by: Lalith Kota --- g2p_openid_vci/models/vci_issuer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g2p_openid_vci/models/vci_issuer.py b/g2p_openid_vci/models/vci_issuer.py index 648fb8b..37b179b 100644 --- a/g2p_openid_vci/models/vci_issuer.py +++ b/g2p_openid_vci/models/vci_issuer.py @@ -252,8 +252,8 @@ def get_all_contexts_json(self): def get_auth_jwks( self, auth_issuer: str, - auth_allowed_issuers: list[str], - auth_allowed_jwks_urls: list[str], + auth_allowed_issuers: list, + auth_allowed_jwks_urls: list, ): self.ensure_one() jwk_url = None From 07c1bd49063a4f3b2f8b56293091a7ba55f032ec Mon Sep 17 00:00:00 2001 From: Lalith Kota Date: Mon, 1 Apr 2024 20:30:41 +0530 Subject: [PATCH 3/4] VCI Tests: Removed python3.9 functions Signed-off-by: Lalith Kota --- g2p_openid_vci/tests/test_openid_vc_issuer.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/g2p_openid_vci/tests/test_openid_vc_issuer.py b/g2p_openid_vci/tests/test_openid_vc_issuer.py index 25c5cba..f70e804 100644 --- a/g2p_openid_vci/tests/test_openid_vc_issuer.py +++ b/g2p_openid_vci/tests/test_openid_vc_issuer.py @@ -221,14 +221,10 @@ def test_get_issuer_metadata(self): # change issuer metadatas to dict self.issuer.issuer_metadata_text = ( - "{(.credential_type):" - + self.issuer.issuer_metadata_text.strip().removeprefix("[").removesuffix("]") - + "}" + "{(.credential_type):" + self.issuer.issuer_metadata_text.strip()[1:-1] + "}" ) self.issuer_2.issuer_metadata_text = ( - "{(.credential_type):" - + self.issuer_2.issuer_metadata_text.strip().removeprefix("[").removesuffix("]") - + "}" + "{(.credential_type):" + self.issuer_2.issuer_metadata_text.strip()[1:-1] + "}" ) res = self.env["g2p.openid.vci.issuers"].get_issuer_metadata_by_name() From 67a1d50128afc99428a7b88904c8f6fbc8f74877 Mon Sep 17 00:00:00 2001 From: Lalith Kota Date: Mon, 1 Apr 2024 20:35:29 +0530 Subject: [PATCH 4/4] VCI Tests: Removed more python3.9 functions Signed-off-by: Lalith Kota --- g2p_openid_vci_rest_api/services/vci_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g2p_openid_vci_rest_api/services/vci_service.py b/g2p_openid_vci_rest_api/services/vci_service.py index cdddb93..09085f4 100644 --- a/g2p_openid_vci_rest_api/services/vci_service.py +++ b/g2p_openid_vci_rest_api/services/vci_service.py @@ -42,7 +42,7 @@ class OpenIdVCIRestService(Component): output_param=PydanticModel(CredentialBaseResponse), ) def post_credential(self, credential_request: CredentialRequest): - token = request.httprequest.headers.get("Authorization", "").removeprefix("Bearer") + token = request.httprequest.headers.get("Authorization", "").replace("Bearer", "", 1) if not token: raise Unauthorized("Invalid Bearer Token received.") try: