From 7c0d52e3d354f3115aac951dbb7cd9448c9b4965 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:48:23 +0100 Subject: [PATCH 1/6] chore(deps-dev): bump unplugin-icons from 0.19.2 to 0.21.0 (#432) Bumps [unplugin-icons](https://github.com/unplugin/unplugin-icons) from 0.19.2 to 0.21.0. - [Release notes](https://github.com/unplugin/unplugin-icons/releases) - [Commits](https://github.com/unplugin/unplugin-icons/compare/v0.19.2...v0.21.0) --- updated-dependencies: - dependency-name: unplugin-icons dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pnpm-lock.yaml | 234 ++++++++++++++++----------------------------- unime/package.json | 2 +- 2 files changed, 85 insertions(+), 151 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b9d7e1bc..f7becc4b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -147,8 +147,8 @@ importers: specifier: ^8.12.0 version: 8.12.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) unplugin-icons: - specifier: ^0.19.1 - version: 0.19.2 + specifier: ^0.21.0 + version: 0.21.0(svelte@4.2.19) vite: specifier: ^5.4.10 version: 5.4.10(@types/node@22.5.0) @@ -169,12 +169,12 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@antfu/install-pkg@0.3.5': - resolution: {integrity: sha512-HwIACY0IzrM7FGafMbWZOqEDBSfCwPcylu+GacaRcxJm4Yvvuh3Dy2vZwqdJAzXponc6aLO9FaH4l75pq8/ZSA==} - '@antfu/install-pkg@0.4.0': resolution: {integrity: sha512-vI73C0pFA9L+5v+djh0WSLXb8qYQGH5fX8nczaFe1OTI/8Fh03JS1Mov1V7urb6P3A2cBlBqZNjJIKv54+zVRw==} + '@antfu/install-pkg@0.5.0': + resolution: {integrity: sha512-dKnk2xlAyC7rvTkpkHmu+Qy/2Zc3Vm/l8PtNyIOGDBtXPY3kThfU4ORNEp3V7SXw5XSOb+tOJaUYpfquPzL/Tg==} + '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} @@ -205,10 +205,6 @@ packages: resolution: {integrity: sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.5': - resolution: {integrity: sha512-abd43wyLfbWoxC6ahM8xTkqLpGB2iWBVyuKC9/srhFunCd1SDNrV1s72bBpK4hLj8KLzHBBcOblvLQZBNw9r3w==} - engines: {node: '>=6.9.0'} - '@babel/generator@7.26.2': resolution: {integrity: sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==} engines: {node: '>=6.9.0'} @@ -273,18 +269,10 @@ packages: resolution: {integrity: sha512-DSgLeL/FNcpXuzav5wfYvHCGvynXkJbn3Zvc3823AEe9nPwW9IK4UoCSS5yGymmQzN0pCPvivtgS6/8U2kkm1w==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.0': - resolution: {integrity: sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==} - engines: {node: '>=6.9.0'} - '@babel/template@7.25.9': resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.4': - resolution: {integrity: sha512-VJ4XsrD+nOvlXyLzmLzUs/0qjFS4sK30te5yEFlvbbUNEgKaVb2BHZUpAL+ttLPQAHNrsI3zZisbfha5Cvr8vg==} - engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.9': resolution: {integrity: sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==} engines: {node: '>=6.9.0'} @@ -499,8 +487,8 @@ packages: '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} - '@iconify/utils@2.1.31': - resolution: {integrity: sha512-WCu65iVaFRXyGU+op12XVbDZgIov0vzMIlUokZ1WR42cU2wwYMks/pZY8v0tE72W8ShXVaprO79Jv6EjYm3Sjw==} + '@iconify/utils@2.1.33': + resolution: {integrity: sha512-jP9h6v/g0BIZx0p7XGJJVtkVnydtbgTgt9mVNcGDYwaa7UhdHdI9dvoq+gKj9sijMSJKxUPEG2JyjsgXjxL7Kw==} '@internationalized/date@3.5.5': resolution: {integrity: sha512-H+CfYvOZ0LTJeeLOqm19E3uj/4YjrmOFtBufDHPfvtI80hFAMqtrp7oCACpe4Cil5l8S0Qu/9dYfZc/5lY8WQQ==} @@ -531,10 +519,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@jsdevtools/ez-spawn@3.0.4': - resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} - engines: {node: '>=10'} - '@lit-labs/ssr-dom-shim@1.2.1': resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} @@ -950,6 +934,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -1060,9 +1049,6 @@ packages: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} - call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1132,8 +1118,8 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - confbox@0.1.7: - resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} @@ -1759,11 +1745,6 @@ packages: canvas: optional: true - jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - jsesc@3.0.2: resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} engines: {node: '>=6'} @@ -1823,8 +1804,8 @@ packages: lit@2.8.0: resolution: {integrity: sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==} - local-pkg@0.5.0: - resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} + local-pkg@0.5.1: + resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} engines: {node: '>=14'} locate-character@3.0.0: @@ -1934,8 +1915,8 @@ packages: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true - mlly@1.7.1: - resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + mlly@1.7.3: + resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} @@ -2058,6 +2039,9 @@ packages: package-manager-detector@0.1.2: resolution: {integrity: sha512-iePyefLTOm2gEzbaZKSW+eBMjg+UYsQvUKxmvGXAQ987K16efBg10MxIjZs08iyX+DY2/owKY9DIdu193kX33w==} + package-manager-detector@0.2.7: + resolution: {integrity: sha512-g4+387DXDKlZzHkP+9FLt8yKj8+/3tOkPv7DVTJGGRm00RkEWgqbFstX1mXJ4M0VDYhUqsTOiISqNOJnhAu3PQ==} + pako@2.1.0: resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} @@ -2115,8 +2099,8 @@ packages: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} - pkg-types@1.2.0: - resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + pkg-types@1.2.1: + resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} pngjs@5.0.0: resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} @@ -2441,10 +2425,6 @@ packages: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} - string-argv@0.3.2: - resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} - engines: {node: '>=0.6.19'} - string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -2644,10 +2624,6 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - type-detect@4.1.0: - resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} - engines: {node: '>=4'} - typesafe-i18n@5.26.2: resolution: {integrity: sha512-2QAriFmiY5JwUAJtG7yufoE/XZ1aFBY++wj7YFS2yo89a3jLBfKoWSdq5JfQYk1V2BS7V2c/u+KEcaCQoE65hw==} hasBin: true @@ -2681,12 +2657,13 @@ packages: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} - unplugin-icons@0.19.2: - resolution: {integrity: sha512-QkQJ/Iz3PFr/EoiOvFUQYvqbbJZ7Vs3hObKAFHh5eywTU1PQagSNeXKGRD+JpzXSTnUNLtG0u/xEA5Ec2OeANQ==} + unplugin-icons@0.21.0: + resolution: {integrity: sha512-sRic+yj7cCbpDFwrRj+m55ogOZi6PQRDc/WUEmjHLAnc90v0g5UVxE0cVAZgBOsAPCieizZJui/sgrCYrVx8mQ==} peerDependencies: '@svgr/core': '>=7.0.0' '@svgx/core': ^1.0.1 '@vue/compiler-sfc': ^3.0.2 || ^2.7.0 + svelte: ^3.0.0 || ^4.0.0 || ^5.0.0 vue-template-compiler: ^2.6.12 vue-template-es2015-compiler: ^1.9.0 peerDependenciesMeta: @@ -2696,13 +2673,15 @@ packages: optional: true '@vue/compiler-sfc': optional: true + svelte: + optional: true vue-template-compiler: optional: true vue-template-es2015-compiler: optional: true - unplugin@1.12.2: - resolution: {integrity: sha512-bEqQxeC7rxtxPZ3M5V4Djcc4lQqKPgGe3mAWZvxcSmX5jhGxll19NliaRzQSQPrk4xJZSGniK3puLWpRuZN7VQ==} + unplugin@1.16.0: + resolution: {integrity: sha512-5liCNPuJW8dqh3+DM6uNM2EI3MLLpCKp/KY+9pB5M2S2SR2qvvDHhKgBOaTWEbZTAws3CXfB0rKTIolWKL05VQ==} engines: {node: '>=14.0.0'} update-browserslist-db@1.1.0: @@ -2797,10 +2776,6 @@ packages: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} - webpack-sources@3.2.3: - resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} - engines: {node: '>=10.13.0'} - webpack-virtual-modules@0.6.2: resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} @@ -2916,15 +2891,16 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@antfu/install-pkg@0.3.5': - dependencies: - '@jsdevtools/ez-spawn': 3.0.4 - '@antfu/install-pkg@0.4.0': dependencies: package-manager-detector: 0.1.2 tinyexec: 0.2.0 + '@antfu/install-pkg@0.5.0': + dependencies: + package-manager-detector: 0.2.7 + tinyexec: 0.3.1 + '@antfu/utils@0.7.10': {} '@aws-crypto/sha256-js@5.2.0': @@ -2961,15 +2937,15 @@ snapshots: '@babel/core@7.25.2': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.5 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.2 '@babel/helper-compilation-targets': 7.25.2 '@babel/helper-module-transforms': 7.25.2(@babel/core@7.25.2) '@babel/helpers': 7.25.0 - '@babel/parser': 7.25.4 - '@babel/template': 7.25.0 - '@babel/traverse': 7.25.4 - '@babel/types': 7.25.4 + '@babel/parser': 7.26.2 + '@babel/template': 7.25.9 + '@babel/traverse': 7.25.9 + '@babel/types': 7.26.0 convert-source-map: 2.0.0 debug: 4.3.7 gensync: 1.0.0-beta.2 @@ -2979,14 +2955,6 @@ snapshots: - supports-color optional: true - '@babel/generator@7.25.5': - dependencies: - '@babel/types': 7.25.4 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - optional: true - '@babel/generator@7.26.2': dependencies: '@babel/parser': 7.26.2 @@ -3006,8 +2974,8 @@ snapshots: '@babel/helper-module-imports@7.24.7': dependencies: - '@babel/traverse': 7.25.4 - '@babel/types': 7.25.4 + '@babel/traverse': 7.25.9 + '@babel/types': 7.26.0 transitivePeerDependencies: - supports-color optional: true @@ -3017,16 +2985,16 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-module-imports': 7.24.7 '@babel/helper-simple-access': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.4 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.25.9 transitivePeerDependencies: - supports-color optional: true '@babel/helper-simple-access@7.24.7': dependencies: - '@babel/traverse': 7.25.4 - '@babel/types': 7.25.4 + '@babel/traverse': 7.25.9 + '@babel/types': 7.26.0 transitivePeerDependencies: - supports-color optional: true @@ -3044,8 +3012,8 @@ snapshots: '@babel/helpers@7.25.0': dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.4 + '@babel/template': 7.25.9 + '@babel/types': 7.26.0 optional: true '@babel/highlight@7.24.7': @@ -3067,32 +3035,12 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.25.0': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/parser': 7.25.4 - '@babel/types': 7.25.4 - optional: true - '@babel/template@7.25.9': dependencies: '@babel/code-frame': 7.26.2 '@babel/parser': 7.26.2 '@babel/types': 7.26.0 - '@babel/traverse@7.25.4': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.5 - '@babel/parser': 7.25.4 - '@babel/template': 7.25.0 - '@babel/types': 7.25.4 - debug: 4.3.7 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - optional: true - '@babel/traverse@7.25.9': dependencies: '@babel/code-frame': 7.26.2 @@ -3100,7 +3048,7 @@ snapshots: '@babel/parser': 7.26.2 '@babel/template': 7.25.9 '@babel/types': 7.26.0 - debug: 4.3.6 + debug: 4.3.7 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -3197,7 +3145,7 @@ snapshots: '@eslint/config-array@0.17.1': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.3.6 + debug: 4.3.7 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -3205,7 +3153,7 @@ snapshots: '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.6 + debug: 4.3.7 espree: 10.1.0 globals: 14.0.0 ignore: 5.3.2 @@ -3256,15 +3204,15 @@ snapshots: '@iconify/types@2.0.0': {} - '@iconify/utils@2.1.31': + '@iconify/utils@2.1.33': dependencies: '@antfu/install-pkg': 0.4.0 '@antfu/utils': 0.7.10 '@iconify/types': 2.0.0 - debug: 4.3.6 + debug: 4.3.7 kolorist: 1.8.0 - local-pkg: 0.5.0 - mlly: 1.7.1 + local-pkg: 0.5.1 + mlly: 1.7.3 transitivePeerDependencies: - supports-color @@ -3300,13 +3248,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@jsdevtools/ez-spawn@3.0.4': - dependencies: - call-me-maybe: 1.0.2 - cross-spawn: 7.0.3 - string-argv: 0.3.2 - type-detect: 4.1.0 - '@lit-labs/ssr-dom-shim@1.2.1': {} '@lit/reactive-element@1.6.3': @@ -3446,7 +3387,7 @@ snapshots: '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.5.0)))(svelte@4.2.19)(vite@5.4.10(@types/node@22.5.0))': dependencies: '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@22.5.0)) - debug: 4.3.6 + debug: 4.3.7 svelte: 4.2.19 vite: 5.4.10(@types/node@22.5.0) transitivePeerDependencies: @@ -3751,6 +3692,8 @@ snapshots: acorn@8.12.1: {} + acorn@8.14.0: {} + agent-base@6.0.2: dependencies: debug: 4.3.7 @@ -3860,8 +3803,6 @@ snapshots: get-intrinsic: 1.2.4 set-function-length: 1.2.2 - call-me-maybe@1.0.2: {} - callsites@3.1.0: {} camelcase-css@2.0.1: {} @@ -3942,7 +3883,7 @@ snapshots: concat-map@0.0.1: {} - confbox@0.1.7: {} + confbox@0.1.8: {} convert-source-map@2.0.0: optional: true @@ -4406,14 +4347,14 @@ snapshots: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.6 + debug: 4.3.7 transitivePeerDependencies: - supports-color https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.6 + debug: 4.3.7 transitivePeerDependencies: - supports-color @@ -4564,7 +4505,7 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.6 + debug: 4.3.7 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -4618,9 +4559,6 @@ snapshots: - supports-color - utf-8-validate - jsesc@2.5.2: - optional: true - jsesc@3.0.2: {} json-buffer@3.0.1: {} @@ -4673,10 +4611,10 @@ snapshots: lit-element: 3.3.3 lit-html: 2.8.0 - local-pkg@0.5.0: + local-pkg@0.5.1: dependencies: - mlly: 1.7.1 - pkg-types: 1.2.0 + mlly: 1.7.3 + pkg-types: 1.2.1 locate-character@3.0.0: {} @@ -4775,11 +4713,11 @@ snapshots: dependencies: minimist: 1.2.8 - mlly@1.7.1: + mlly@1.7.3: dependencies: - acorn: 8.12.1 + acorn: 8.14.0 pathe: 1.1.2 - pkg-types: 1.2.0 + pkg-types: 1.2.1 ufo: 1.5.4 mri@1.2.0: {} @@ -4883,6 +4821,8 @@ snapshots: package-manager-detector@0.1.2: {} + package-manager-detector@0.2.7: {} + pako@2.1.0: {} parent-module@1.0.1: @@ -4926,10 +4866,10 @@ snapshots: pirates@4.0.6: {} - pkg-types@1.2.0: + pkg-types@1.2.1: dependencies: - confbox: 0.1.7 - mlly: 1.7.1 + confbox: 0.1.8 + mlly: 1.7.3 pathe: 1.1.2 pngjs@5.0.0: {} @@ -5193,8 +5133,6 @@ snapshots: dependencies: internal-slot: 1.0.7 - string-argv@0.3.2: {} - string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -5410,8 +5348,6 @@ snapshots: dependencies: prelude-ls: 1.2.1 - type-detect@4.1.0: {} - typesafe-i18n@5.26.2(typescript@5.5.4): dependencies: typescript: 5.5.4 @@ -5437,23 +5373,23 @@ snapshots: universalify@0.2.0: {} - unplugin-icons@0.19.2: + unplugin-icons@0.21.0(svelte@4.2.19): dependencies: - '@antfu/install-pkg': 0.3.5 + '@antfu/install-pkg': 0.5.0 '@antfu/utils': 0.7.10 - '@iconify/utils': 2.1.31 - debug: 4.3.6 + '@iconify/utils': 2.1.33 + debug: 4.3.7 kolorist: 1.8.0 - local-pkg: 0.5.0 - unplugin: 1.12.2 + local-pkg: 0.5.1 + unplugin: 1.16.0 + optionalDependencies: + svelte: 4.2.19 transitivePeerDependencies: - supports-color - unplugin@1.12.2: + unplugin@1.16.0: dependencies: - acorn: 8.12.1 - chokidar: 3.6.0 - webpack-sources: 3.2.3 + acorn: 8.14.0 webpack-virtual-modules: 0.6.2 update-browserslist-db@1.1.0(browserslist@4.23.3): @@ -5546,8 +5482,6 @@ snapshots: webidl-conversions@7.0.0: {} - webpack-sources@3.2.3: {} - webpack-virtual-modules@0.6.2: {} whatwg-encoding@2.0.0: diff --git a/unime/package.json b/unime/package.json index de5d4579..29c8c9a0 100644 --- a/unime/package.json +++ b/unime/package.json @@ -57,7 +57,7 @@ "typesafe-i18n": "^5.26.2", "typescript": "^5.2.0", "typescript-eslint": "^8.12.0", - "unplugin-icons": "^0.19.1", + "unplugin-icons": "^0.21.0", "vite": "^5.4.10", "vitest": "^2.1.8" }, From 1b7b24022cf04ed495f7c123940a36f005fcec35 Mon Sep 17 00:00:00 2001 From: Oran Dan <53859531+Oran-Dan@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:10:48 +0100 Subject: [PATCH 2/6] feat: display Alignment & Criteria for Open Badges 3.0 (#419) * fix: render Alignment items --------- Co-authored-by: Daniel Mader --- unime/src/i18n/de-DE/index.ts | 7 ++-- unime/src/i18n/en/index.ts | 5 ++- unime/src/i18n/i18n-types.ts | 36 ++++++++++++------- unime/src/i18n/nl-NL/index.ts | 5 ++- .../credentials/[id]/OpenBadgeRenderer.svelte | 21 +++++++++-- 5 files changed, 56 insertions(+), 18 deletions(-) diff --git a/unime/src/i18n/de-DE/index.ts b/unime/src/i18n/de-DE/index.ts index a69c0e0a..56cbe146 100644 --- a/unime/src/i18n/de-DE/index.ts +++ b/unime/src/i18n/de-DE/index.ts @@ -267,9 +267,12 @@ const de = { NAVBAR_TITLE: 'Credential Informationen', DETAILS: { VALID: 'Gültig', - ISSUED_BY: 'Ausgestellt von', + ISSUED_BY: 'Ausgestellt durch', DESCRIPTION: 'Beschreibung', - CONTENTS: 'Inhalt', + OPEN_BADGES: { + ALIGNMENT: 'Ausrichtung', + CRITERIA: 'Kriterien', + }, }, ACTIONS: { DELETE: { diff --git a/unime/src/i18n/en/index.ts b/unime/src/i18n/en/index.ts index f664c8f2..bd27593e 100644 --- a/unime/src/i18n/en/index.ts +++ b/unime/src/i18n/en/index.ts @@ -268,7 +268,10 @@ const en = { VALID: 'Valid', ISSUED_BY: 'Issued by', DESCRIPTION: 'Description', - CONTENTS: 'Contents', + OPEN_BADGES: { + ALIGNMENT: 'Alignment', + CRITERIA: 'Criteria', + }, }, ACTIONS: { DELETE: { diff --git a/unime/src/i18n/i18n-types.ts b/unime/src/i18n/i18n-types.ts index 94bd02a6..3b8dc039 100644 --- a/unime/src/i18n/i18n-types.ts +++ b/unime/src/i18n/i18n-types.ts @@ -747,10 +747,16 @@ type RootTranslation = { * D​e​s​c​r​i​p​t​i​o​n */ DESCRIPTION: string - /** - * C​o​n​t​e​n​t​s - */ - CONTENTS: string + OPEN_BADGES: { + /** + * A​l​i​g​n​m​e​n​t + */ + ALIGNMENT: string + /** + * C​r​i​t​e​r​i​a + */ + CRITERIA: string + } } ACTIONS: { DELETE: { @@ -763,7 +769,7 @@ type RootTranslation = { */ TITLE: string /** - * A​r​e​ ​y​o​u​ ​s​u​r​e​ ​y​o​u​ ​w​a​n​t​ ​t​o​ ​r​e​m​o​v​e​ ​t​h​i​s​ ​c​r​e​d​e​n​t​i​a​l​ ​f​r​o​m​ ​y​o​u​r​ ​w​a​l​l​e​t​?​ ​T​h​i​s​ ​a​c​t​i​o​n​ ​c​a​n​n​o​t​ ​b​e​ ​u​n​d​o​n​e​. + * A​r​e​ ​y​o​u​ ​s​u​r​e​ ​y​o​u​ ​w​a​n​t​ ​t​o​ ​d​e​l​e​t​e​ ​t​h​i​s​ ​c​r​e​d​e​n​t​i​a​l​ ​f​r​o​m​ ​y​o​u​r​ ​w​a​l​l​e​t​?​ ​T​h​i​s​ ​a​c​t​i​o​n​ ​c​a​n​n​o​t​ ​b​e​ ​u​n​d​o​n​e​. */ DESCRIPTION: string /** @@ -821,7 +827,7 @@ type RootTranslation = { } DOMAIN_LINKAGE: { /** - * V​e​r​i​f​i​e​d + * V​e​r​i​f​i​e​d​ ​w​e​b​s​i​t​e */ TITLE: string /** @@ -1604,10 +1610,16 @@ export type TranslationFunctions = { * Description */ DESCRIPTION: () => LocalizedString - /** - * Contents - */ - CONTENTS: () => LocalizedString + OPEN_BADGES: { + /** + * Alignment + */ + ALIGNMENT: () => LocalizedString + /** + * Criteria + */ + CRITERIA: () => LocalizedString + } } ACTIONS: { DELETE: { @@ -1620,7 +1632,7 @@ export type TranslationFunctions = { */ TITLE: () => LocalizedString /** - * Are you sure you want to remove this credential from your wallet? This action cannot be undone. + * Are you sure you want to delete this credential from your wallet? This action cannot be undone. */ DESCRIPTION: () => LocalizedString /** @@ -1678,7 +1690,7 @@ export type TranslationFunctions = { } DOMAIN_LINKAGE: { /** - * Verified + * Verified website */ TITLE: () => LocalizedString /** diff --git a/unime/src/i18n/nl-NL/index.ts b/unime/src/i18n/nl-NL/index.ts index ee49897b..2c15e10b 100644 --- a/unime/src/i18n/nl-NL/index.ts +++ b/unime/src/i18n/nl-NL/index.ts @@ -268,7 +268,10 @@ const nl = { VALID: 'Geldig', ISSUED_BY: 'Uitgegeven door', DESCRIPTION: 'Beschrijving', - CONTENTS: 'Inhoud', + OPEN_BADGES: { + ALIGNMENT: 'Afstemming', + CRITERIA: 'Criteria', + }, }, ACTIONS: { DELETE: { diff --git a/unime/src/routes/credentials/[id]/OpenBadgeRenderer.svelte b/unime/src/routes/credentials/[id]/OpenBadgeRenderer.svelte index b046e35a..e6d5ae3b 100644 --- a/unime/src/routes/credentials/[id]/OpenBadgeRenderer.svelte +++ b/unime/src/routes/credentials/[id]/OpenBadgeRenderer.svelte @@ -24,14 +24,31 @@ {#if credential.data.credentialSubject?.achievement?.criteria?.narrative}
-

{$LL.CREDENTIAL.DETAILS.CONTENTS()}

+

{$LL.CREDENTIAL.DETAILS.OPEN_BADGES.CRITERIA()}

{@html md.render(credential.data.credentialSubject.achievement.criteria.narrative)}
{/if} - + {#if credential.data.credentialSubject?.achievement?.alignment?.length > 0} +
+

{$LL.CREDENTIAL.DETAILS.OPEN_BADGES.ALIGNMENT()}

+ {#each credential.data.credentialSubject.achievement.alignment as alignmentItem} +

{alignmentItem.targetName}

+ + + {@html md.render(alignmentItem.targetDescription)} + {/each} +
+ {/if} + + {#if credential.data.credentialSubject?.achievement?.achievementType} + + {/if} {#if credential.data.validFrom} From c07c2089a8c8cbb878f151eb06f28a90fd588c2b Mon Sep 17 00:00:00 2001 From: Nander Stabel Date: Fri, 6 Dec 2024 10:03:45 +0100 Subject: [PATCH 3/6] fix: enable deserialization of trusted entries from both maps and arrays (#435) * fix: allow deserializing from maps and arrays * test: add deserialization tests --- identity-wallet/src/state/trust_list/mod.rs | 70 +++++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/identity-wallet/src/state/trust_list/mod.rs b/identity-wallet/src/state/trust_list/mod.rs index 1229cd63..a5b6e57b 100644 --- a/identity-wallet/src/state/trust_list/mod.rs +++ b/identity-wallet/src/state/trust_list/mod.rs @@ -64,17 +64,27 @@ pub struct TrustList { /// Custom true: TrustList's can be created in dev mode at any time. #[serde(default)] pub custom: bool, - #[serde(deserialize_with = "deserialize_domains")] + #[serde(deserialize_with = "deserialize_entries")] #[ts(type = "Record")] pub entries: HashMap, } -fn deserialize_domains<'de, D>(deserializer: D) -> Result, D::Error> +fn deserialize_entries<'de, D>(deserializer: D) -> Result, D::Error> where D: serde::Deserializer<'de>, { - let domains: Vec = Vec::deserialize(deserializer)?; - Ok(domains.into_iter().map(|domain| (domain, true)).collect()) + #[derive(Deserialize)] + #[serde(untagged)] + enum Entries { + Array(Vec), + Map(HashMap), + } + + let entries = Entries::deserialize(deserializer)?; + match entries { + Entries::Array(array) => Ok(array.into_iter().map(|url| (url, true)).collect()), + Entries::Map(map) => Ok(map), + } } impl Default for TrustList { @@ -117,3 +127,55 @@ impl TrustList { self.entries.iter() } } + +#[cfg(test)] +mod tests { + use super::*; + use identity_iota::core::FromJson; + + #[test] + fn trust_list_successfully_deserializes_from_entries_map() { + assert_eq!( + TrustList { + id: "b01f4a74-3005-4749-a030-c5444bc4dab5".to_string(), + display_name: "Test List".to_string(), + custom: false, + entries: HashMap::from_json_value(serde_json::json!({ + "https://example.org": true, + })) + .unwrap() + }, + serde_json::from_value(serde_json::json!({ + "id": "b01f4a74-3005-4749-a030-c5444bc4dab5", + "display_name": "Test List", + "entries": { + "https://example.org": true, + }, + })) + .unwrap() + ); + } + + #[test] + fn trust_list_successfully_deserializes_from_entries_array() { + assert_eq!( + TrustList { + id: "b01f4a74-3005-4749-a030-c5444bc4dab5".to_string(), + display_name: "Test List".to_string(), + custom: false, + entries: HashMap::from_json_value(serde_json::json!({ + "https://example.org": true, + })) + .unwrap() + }, + serde_json::from_value(serde_json::json!({ + "id": "b01f4a74-3005-4749-a030-c5444bc4dab5", + "display_name": "Test List", + "entries": [ + "https://example.org", + ], + })) + .unwrap() + ); + } +} From 8eb57e77e35091962db3bb9a3a0d88a2405d2723 Mon Sep 17 00:00:00 2001 From: Daniel Mader Date: Fri, 6 Dec 2024 12:39:21 +0100 Subject: [PATCH 4/6] fix: use hash-based image identifier to prevent caching, use colored background for icon fallback (#433) * fix: use colored background when icon fallback is displayed * fix: use hash-based image identifier to prevent caching * docs: add comments * refactor: follow review comments --- .../reducers/send_credential_request.rs | 119 ++++++++++-------- .../qr_code/reducers/read_credential_offer.rs | 8 +- unime/src/lib/components/ListItemCard.svelte | 15 ++- unime/src/lib/components/image/Image.svelte | 4 + .../credentials/[id]/CredentialHeader.svelte | 6 +- .../prompt/credential-offer/+page.svelte | 4 +- 6 files changed, 84 insertions(+), 72 deletions(-) diff --git a/identity-wallet/src/state/credentials/reducers/send_credential_request.rs b/identity-wallet/src/state/credentials/reducers/send_credential_request.rs index e7261464..6ceb5331 100644 --- a/identity-wallet/src/state/credentials/reducers/send_credential_request.rs +++ b/identity-wallet/src/state/credentials/reducers/send_credential_request.rs @@ -135,60 +135,70 @@ pub async fn send_credential_request(state: AppState, action: Action) -> Result< credential_configuration_ids.contains(credential_configuration_id) }); - let credentials: Vec<(String, serde_json::Value)> = match credential_configuration_ids.len() { - 0 => vec![], - 1 => { - let credential_configuration_id = credential_configuration_ids[0].clone(); - - let credential_configuration = credential_configurations_supported - .get(&credential_configuration_id) - .ok_or(UnknownCredentialConfigurationIdError( - credential_configuration_id.clone(), - ))?; - - // Get the credential. - let credential_response = wallet - .get_credential(credential_issuer_metadata, &token_response, credential_configuration) - .await - .map_err(GetCredentialError)?; - - let credential = match credential_response.credential { - CredentialResponseType::Immediate { credential, .. } => credential, - _ => panic!("Credential was not a jwt_vc_json."), - }; - - vec![(credential_configuration_id, credential)] - } - _batch => { - let (credential_configuration_ids, credential_configurations): (Vec<_>, Vec<_>) = - credential_configurations_supported.clone().into_iter().unzip(); - - let batch_credential_response = wallet - .get_batch_credential(credential_issuer_metadata, &token_response, &credential_configurations) - .await - .map_err(GetBatchCredentialError)?; - - credential_configuration_ids - .into_iter() - .zip(batch_credential_response.credential_responses.into_iter()) - .filter_map( - |(credential_configuration_id, credential_response)| match credential_response { - CredentialResponseType::Immediate { credential, .. } => { - Some((credential_configuration_id, credential)) - } - // TODO: add support for deffered credentials. - CredentialResponseType::Deferred { .. } => None, - }, - ) - .collect() - } - }; + let credentials: Vec<(String, serde_json::Value, Vec)> = + match credential_configuration_ids.len() { + 0 => vec![], + 1 => { + let credential_configuration_id = credential_configuration_ids[0].clone(); + + let credential_configuration = credential_configurations_supported + .get(&credential_configuration_id) + .ok_or(UnknownCredentialConfigurationIdError( + credential_configuration_id.clone(), + ))?; + + // Get the credential. + let credential_response = wallet + .get_credential(credential_issuer_metadata, &token_response, credential_configuration) + .await + .map_err(GetCredentialError)?; + + let credential = match credential_response.credential { + CredentialResponseType::Immediate { credential, .. } => credential, + _ => panic!("Credential was not a jwt_vc_json."), + }; + + vec![( + credential_configuration_id, + credential, + credential_configuration.display.clone(), + )] + } + _batch => { + let (credential_configuration_ids, credential_configurations): (Vec<_>, Vec<_>) = + credential_configurations_supported.clone().into_iter().unzip(); + + let batch_credential_response = wallet + .get_batch_credential(credential_issuer_metadata, &token_response, &credential_configurations) + .await + .map_err(GetBatchCredentialError)?; + + credential_configuration_ids + .into_iter() + .zip(batch_credential_response.credential_responses.into_iter()) + .zip(credential_configurations.into_iter()) + .filter_map( + |((credential_configuration_id, credential_response), credential_configuration)| { + match credential_response { + CredentialResponseType::Immediate { credential, .. } => Some(( + credential_configuration_id, + credential, + credential_configuration.display, + )), + // TODO: add support for deferred credentials. + CredentialResponseType::Deferred { .. } => None, + } + }, + ) + .collect() + } + }; info!("credentials: {:?}", credentials); let mut history_credentials = vec![]; - for (credential_configuration_id, credential) in credentials.into_iter() { + for (credential_configuration_id, credential, display) in credentials.into_iter() { let mut verifiable_credential_record: VerifiableCredentialRecord = credential.try_into()?; verifiable_credential_record .display_credential @@ -211,11 +221,12 @@ pub async fn send_credential_request(state: AppState, action: Action) -> Result< info!("generated hash-key: {:?}", key); - persist_asset( - format!("credential_{credential_configuration_id}").as_str(), - key.to_string().as_str(), - ) - .ok(); + display + .first() + .and_then(|display| display.get("logo")) + .and_then(|logo| logo.get("uri").or_else(|| logo.get("url"))) + .and_then(|uri| uri.as_str()) + .and_then(|uri| persist_asset(&hash(uri), key.to_string().as_str()).ok()); // Remove the old credential from the stronghold if it exists. stronghold_manager.remove(key).map_err(StrongholdDeletionError)?; diff --git a/identity-wallet/src/state/qr_code/reducers/read_credential_offer.rs b/identity-wallet/src/state/qr_code/reducers/read_credential_offer.rs index e15f1708..062193cb 100644 --- a/identity-wallet/src/state/qr_code/reducers/read_credential_offer.rs +++ b/identity-wallet/src/state/qr_code/reducers/read_credential_offer.rs @@ -144,7 +144,7 @@ pub async fn read_credential_offer(state: AppState, action: Action) -> Result, ) { - for (credential_configuration_id, credential_configuration) in credential_configurations.iter() { + for credential_configuration in credential_configurations.values() { let credential_logo_uri = credential_configuration .display .first() @@ -158,11 +158,7 @@ async fn download_credential_logos( format!("Downloading credential logo from URI: {}", credential_logo_uri) ); if let Ok(credential_logo_uri) = credential_logo_uri.parse::() { - let _ = download_asset( - credential_logo_uri, - format!("credential_{}", credential_configuration_id).as_str(), - ) - .await; + let _ = download_asset(credential_logo_uri.clone(), &hash(credential_logo_uri.as_str())).await; } else { debug!("Failed to parse credential logo URI: {}", credential_logo_uri); } diff --git a/unime/src/lib/components/ListItemCard.svelte b/unime/src/lib/components/ListItemCard.svelte index d7f00052..0354d496 100644 --- a/unime/src/lib/components/ListItemCard.svelte +++ b/unime/src/lib/components/ListItemCard.svelte @@ -10,6 +10,8 @@ export let description: string | undefined = undefined; export let type: 'data' | 'badge' = 'data'; export let isTempAsset = false; + + let useFallback = false; - -
- +
+ +
diff --git a/unime/src/lib/components/image/Image.svelte b/unime/src/lib/components/image/Image.svelte index 902cd70d..464c5520 100644 --- a/unime/src/lib/components/image/Image.svelte +++ b/unime/src/lib/components/image/Image.svelte @@ -20,6 +20,10 @@ export let isTempAsset = false; let assetUrl: string | null = null; + // useFallback is reactive since the assetUrl is updated onMount when the image is loaded from the backend + export let useFallback: boolean = false; + $: useFallback = assetUrl === null; + async function loadImage() { getImageAsset(id, isTempAsset).then((url) => { assetUrl = url; diff --git a/unime/src/routes/credentials/[id]/CredentialHeader.svelte b/unime/src/routes/credentials/[id]/CredentialHeader.svelte index 52362d94..96f9ab41 100644 --- a/unime/src/routes/credentials/[id]/CredentialHeader.svelte +++ b/unime/src/routes/credentials/[id]/CredentialHeader.svelte @@ -4,7 +4,7 @@ import type { DisplayCredential } from '@bindings/credentials/DisplayCredential'; import { dispatch } from '$lib/dispatcher'; - import { CertificateLightIcon, HeartStraightFillIcon, HeartStraightRegularIcon } from '$lib/icons'; + import { CertificateLightIcon, HeartStraightFillIcon, HeartStraightRegularIcon, UserLightIcon } from '$lib/icons'; import { getImageAsset } from '$lib/utils'; import CredentialHeaderMenu from './CredentialHeaderMenu.svelte'; @@ -26,8 +26,10 @@ {#if credentialLogoUrl} Credential logo - {:else} + {:else if credential.data.type.includes('OpenBadgeCredential')} + {:else} + {/if}
diff --git a/unime/src/routes/prompt/credential-offer/+page.svelte b/unime/src/routes/prompt/credential-offer/+page.svelte index ffcfebbd..21552d70 100644 --- a/unime/src/routes/prompt/credential-offer/+page.svelte +++ b/unime/src/routes/prompt/credential-offer/+page.svelte @@ -67,10 +67,10 @@
- {#each Object.entries(credential_configurations) as [credential_configuration_id, credential_configuration]} + {#each Object.values(credential_configurations) as credential_configuration} Date: Mon, 9 Dec 2024 12:42:15 +0100 Subject: [PATCH 5/6] ci: adjust installed Ubuntu packages (#437) --- .github/workflows/format-lint-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format-lint-test.yaml b/.github/workflows/format-lint-test.yaml index a5f71987..788d7fe9 100644 --- a/.github/workflows/format-lint-test.yaml +++ b/.github/workflows/format-lint-test.yaml @@ -53,7 +53,7 @@ jobs: working-directory: ./unime/src-tauri run: | sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libsoup-3.0 javascriptcoregtk-4.1 webkit2gtk-4.1 + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - name: Format working-directory: ./unime/src-tauri @@ -101,7 +101,7 @@ jobs: working-directory: ./identity-wallet run: | sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libsoup-3.0 javascriptcoregtk-4.1 webkit2gtk-4.1 + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - name: Format working-directory: ./identity-wallet From 41b5519b65647c7c1c4b21f1f9f7a35788fd747a Mon Sep 17 00:00:00 2001 From: Oran Dan <53859531+Oran-Dan@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:58:43 +0100 Subject: [PATCH 6/6] fix: support `StatusList2021Entry` credentials, fetch logo from `.well-known/openid-credential-issuer` (#414) * WIP * Add Thuiswinkel verification checkmark * fix: fix logo_url binding, renameto thuiswinkel_validation * Rename `thuiswinkel_waarborg_verification` to `thuiswinkel_verification` in frontend * feat: add `issuance_date` to `ValidationResult` * Change label for domain verification * fix: fix `issuance_date` * Add issuance date and change logo position * chore(deps-dev): bump prettier-plugin-tailwindcss from 0.6.1 to 0.6.5 (#259) Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.6.1 to 0.6.5. - [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.6.1...v0.6.5) --- updated-dependencies: - dependency-name: prettier-plugin-tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @ianvs/prettier-plugin-sort-imports (#260) Bumps [@ianvs/prettier-plugin-sort-imports](https://github.com/ianvs/prettier-plugin-sort-imports) from 4.2.1 to 4.3.0. - [Release notes](https://github.com/ianvs/prettier-plugin-sort-imports/releases) - [Changelog](https://github.com/IanVS/prettier-plugin-sort-imports/blob/main/CHANGELOG.md) - [Commits](https://github.com/ianvs/prettier-plugin-sort-imports/compare/v4.2.1...v4.3.0) --- updated-dependencies: - dependency-name: "@ianvs/prettier-plugin-sort-imports" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump prettier-plugin-svelte from 3.2.3 to 3.2.5 (#262) Bumps [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte) from 3.2.3 to 3.2.5. - [Changelog](https://github.com/sveltejs/prettier-plugin-svelte/blob/master/CHANGELOG.md) - [Commits](https://github.com/sveltejs/prettier-plugin-svelte/compare/v3.2.3...v3.2.5) --- updated-dependencies: - dependency-name: prettier-plugin-svelte dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nander Stabel * chore(deps-dev): bump prettier from 3.3.0 to 3.3.2 (#261) Bumps [prettier](https://github.com/prettier/prettier) from 3.3.0 to 3.3.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.3.0...3.3.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Make `imageId` reactive * fix: fix lint errors * add: backend actions-reducers for editable trust list * cargo fmt * add: testing * feat: trusted domains list (first version) (#352) * ci: release version 0.6.8 (#346) * fix: bindings * feat: add default_trust_list.json * test: add testing, not final * feat: enable multiple trust lists * chore: remove comment * refactore: rename actions and reducers * feat: add TrustList level actions * refactor: trustlist owned bool, name to id, reset to default * chore: fix domain name * feat: add trust list management frontend * refactor: implement lists view & domain list * refactor: Wire up Tauri listeners in `onMount` of root layout (#322) * Wire up Tauri state-changed listener in `onMount` of root layout * Wire up Tauri error listener in root layout * Update comments * build: Replace `npm` with `pnpm` (#348) * Swap out `npm` for `pnpm` Fixes #347 * Address review comments * chore: cargo fmt and fix binding naming * feat: prevent edits on imported lists * refactor: remove unused reset functionality * feat: add placeholder when no lists * refactor: trustlist actions * refactor: remove trustlist default impl * refactor: use updated Action names * fix: rename broken bindings * refactor: remove `Default` trait * refactor: show `display_name` instead of `id` * feat: update default trusted domains --------- Co-authored-by: Daniel Mader Co-authored-by: Thilo Maier * feat: add `validate_linked_verifiable_presentations` * refactor: apply clippy suggestions * feat: use `ServiceEndpoint::from` * refactor: remove unused variables * refactor: replace icon imports * feat: add alignment & criteria display * chore: pnpm format * chore: eslint failed * feat: filter linked VPs based on trust list * feat: display trusted domains as trusted issuers * chore: try to fix git workflow build fail * chore: try to fix git workflow build fail * chore: add comment to ubuntu version fix * chore: update serde_json dependency, make error messages static for consistency between version updates * chore: cargo fmt * chore: cargo clippy * chore: fix tests * chore: cargo fmt * feat: add achievementType to badge overview display * ci: release version 0.6.13 * fix: disable prerender trust-list * WIP * WIP * WIP * ci: release version 0.6.14 * chore: rename variable * chore: fix log message * chore: fix trusted domain validation * feat: add default trust lists to all profiles at creation * feat: add did:web url validation against trust_list, format * chore: cargo clippy: * feat: add fetching logo from well known endpoint * chore: fix fallback icon, add comments * chore: add credenco to trusted issuers * ci: release version 0.6.15 * fix: set SD-JWT format check back to `VcSdJwt` (#394) * feat: display `alignment` & `criteria` for Open Badges 3.0 (#386) * ci: release version 0.6.12 (#370) * chore(deps-dev): bump globals from 15.9.0 to 15.11.0 (#389) Bumps [globals](https://github.com/sindresorhus/globals) from 15.9.0 to 15.11.0. - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](https://github.com/sindresorhus/globals/compare/v15.9.0...v15.11.0) --- updated-dependencies: - dependency-name: globals dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump typescript-eslint from 8.2.0 to 8.12.0 (#391) Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.2.0 to 8.12.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump prettier-plugin-svelte from 3.2.6 to 3.2.7 (#382) Bumps [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte) from 3.2.6 to 3.2.7. - [Changelog](https://github.com/sveltejs/prettier-plugin-svelte/blob/master/CHANGELOG.md) - [Commits](https://github.com/sveltejs/prettier-plugin-svelte/compare/v3.2.6...v3.2.7) --- updated-dependencies: - dependency-name: prettier-plugin-svelte dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump postcss from 8.4.45 to 8.4.47 (#375) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.45 to 8.4.47. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.45...8.4.47) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: resolve PR comments * chore: resole PR comment * chore: resolve PR comment --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Mader Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: use hash-based image identifier to prevent caching, use colored background for icon fallback (#396) * fix: use colored background when icon fallback is displayed * fix: use hash-based image identifier to prevent caching * ci: release version 0.7.0 * fix: trusted issuer domain url validation (#397) * fix: url validation for trusted issuers * chore: replace expect() with ok() * Make it more clear how scrolling is done * Define prop `class` for `TopNavBar` to make it more explicit * Remove unneded class * Fix `/me/settings` * Fix `/me/settings/app` * Fix `/me/settings/about` * Fix `/me/settings/app/did` * Fix `/me/settings/app/keys` * Fix `/me/settings/app/language` * Fix `/me/settings/app/theme` * Fix `/me/settings/app/trust-list` * Fix `/me/settings/profile` * Fix `/prompt/accept-connection` * Fix `/prompt/credential-offer` * Fix `/prompt/share-credentials` * fix: adjust UniMe text color in dark mode * feat: add terms & conditions * fix: checkbox tick color in dark mode * feat: update app icon * ci: release version 0.7.1 * feat: update app icon * feat: fix app icon * fix: higher resolution app icon * refactor: remove `Beta` from `productName` * ci: release version 0.7.2 * refactor: update camera usage description * refactor: update camera usage description * Fix layout issues by creating a new stacking context (#410) * ci: release version 0.7.3 * fix: support StatusList2021Entry, add logo fetching from well-known/openid-credential-issuer Credential Configurations Supported * chore: refactor fn get_logo_uri * chore: add domain to default trust list * chore: cargo clippy * chore: merge dev unime/ folder into branch * chore: checkout dev identity-wallet/src/state/trustlist/ * chore: checkout dev into identity-wallet/ files * chore: remove outdated files * chore: remove outdated unime/ files * chore: fix tests * chore: remove outdated domain * chore: add TODO in comment * chore: fix PascalCasing * chore: clarify log message * chore: add spec in comment to alternative property name * chore: remove workaround which should be fixed in frontend, add comments * chore: fix comments * chore: fix default trust list entries check in linked vp flow * chore: fix PR comments * chore : improve log messages * chore: update tests to include logo fetching through wiremock --------- Signed-off-by: dependabot[bot] Co-authored-by: Nander Stabel Co-authored-by: Thilo Maier Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Mader --- .../resources/default_trust_list.json | 8 +- .../src/state/did/validate_domain_linkage.rs | 19 +- ...alidate_linked_verifiable_presentations.rs | 196 ++++++++++++++---- .../reducers/read_authorization_request.rs | 12 +- .../fixtures/states/accept_connection.json | 2 +- 5 files changed, 189 insertions(+), 48 deletions(-) diff --git a/identity-wallet/resources/default_trust_list.json b/identity-wallet/resources/default_trust_list.json index c841c80f..ba646f77 100644 --- a/identity-wallet/resources/default_trust_list.json +++ b/identity-wallet/resources/default_trust_list.json @@ -1,5 +1,11 @@ { "id": "b01f4a74-3005-4749-a030-c5444bc4dab5", "display_name": "Impierce Demos", - "entries": ["https://ngdil.com", "https://selv.iota.org", "https://thuiswinkel-agent.dev.impierce.com"] + "entries": [ + "https://ngdil.com", + "https://selv.iota.org", + "https://thuiswinkel-agent.dev.impierce.com", + "https://mijnkvk.acc.credenco.com", + "https://agent.wallet.bd.demo.sphereon.com" + ] } diff --git a/identity-wallet/src/state/did/validate_domain_linkage.rs b/identity-wallet/src/state/did/validate_domain_linkage.rs index aea20441..226eea7b 100644 --- a/identity-wallet/src/state/did/validate_domain_linkage.rs +++ b/identity-wallet/src/state/did/validate_domain_linkage.rs @@ -83,7 +83,7 @@ pub async fn validate_domain_linkage(url: url::Url, did: &str) -> ValidationResu Err(e) => { return ValidationResult { status: ValidationStatus::Unknown, - message: Some(e.to_string()), + message: Some(format!("Error while fetching configuration: {}", e)), ..Default::default() }; } @@ -142,10 +142,15 @@ async fn fetch_configuration(mut url: url::Url) -> Result().await.map_err(|e| e.to_string())?; + let mut json = response + .json::() + .await + .map_err(|_| "failed to parse response into JSON value".to_string())?; // 4. Remove all non-string values from `linked_dids` (JSON-LD) if let serde_json::Value::Object(ref mut root) = json { @@ -156,7 +161,8 @@ async fn fetch_configuration(mut url: url::Url) -> Result( &linked_verifiable_credential, &issuer_document, - &Default::default(), + &options, FailFast::FirstError, ) { info!("Validated linked verifiable credential: {linked_verifiable_credential:#?}"); @@ -208,19 +223,23 @@ async fn get_validated_linked_credential_data( OneOrMany::Many(subjects) => subjects.first(), }; - OptionFuture::from(credential_subject.map(|credential_subject| async { + if let Some(credential_subject) = credential_subject { let name = get_name(credential_subject); - let logo_uri = get_logo_uri(credential_subject).await; + let logo_uri = get_logo_uri(credential_subject, &linked_verifiable_credential, &validated_linked_domains).await; let issuance_date = linked_verifiable_credential.credential.issuance_date.to_rfc3339(); - LinkedVerifiableCredentialData { + info!("LinkedVerifiableCredentialData: name: {name:?}, logo_uri: {logo_uri:?}, issuance_date: {issuance_date}"); + Some(LinkedVerifiableCredentialData { name, logo_uri, issuance_date, issuer_linked_domains: validated_linked_domains, - } - })) - .await + }) + } + else { + warn!("Failed to get credential_subject from linked_verifiable_credential: {linked_verifiable_credential:#?}"); + None + } } else { warn!("Failed to validate linked verifiable credential: {linked_verifiable_credential:#?}"); // TODO: Should we add more fine-grained error handling? `None` here means that the linked verifiable credential is invalid. @@ -319,30 +338,117 @@ fn get_name(credential_subject: &Subject) -> Option { .properties .get("name") .or_else(|| credential_subject.properties.get("naam")) // TODO: "naam" is expected to be used in Dutch credentials + .or_else(|| credential_subject.properties.get("legal_person_name")) // This is another valid property name according to the following spec: + // EWC RFC005: Issue Legal Person Identification Data (LPID) - v1.0 + // https://github.com/EWC-consortium/eudi-wallet-rfcs/blob/49faa8b0ba5e5e79836e247fd07cc0447c1ae98b/ewc-rfc005-issue-legal-person-identification-data.md#51031-lpid-attributes-specification .and_then(Value::as_str) .map(ToString::to_string) } -async fn get_logo_uri(credential_subject: &Subject) -> Option { - OptionFuture::from( - credential_subject - .properties - .get("image") - .and_then(Value::as_str) - .map(|image| async { - let _ = download_asset( - image - .parse() - .inspect_err(|err| warn!("Failed to parse logo URI: {:#?}", err)) - .ok()?, - &hash(image), - ) - .await; - Some(image.to_string()) - }), - ) - .await - .flatten() +/// First, try to get the logo URI from the credential subject. +/// If this doesn't succeed, iterate through the validated linked domains and try to fetch it from the well-known/openid-credential-issuer endpoint. +/// In this endpoint, first we look inside the Display field, at the root. +/// If we can't find a logo there, we look inside the Credential Configurations Supported field at the root. +/// We try to match keys inside the Credential Configurations Supported object against the credential `type` array of the linked verifiable credential, in reverse order. +/// At first success the loop breaks and we download the image. +/// Otherwise, we use a fallback icon. +async fn get_logo_uri( + credential_subject: &Subject, + linked_verifiable_credential: &DecodedJwtCredential, + validated_linked_domains: &[Url], +) -> Option { + let mut logo_uri = credential_subject + .properties + .get("image") + .and_then(Value::as_str) + .map(ToString::to_string); + + // Check if logo URI was retrieved, if not then attempt to retrieve from a well-known endpoint + if logo_uri.is_none() { + for domain in validated_linked_domains.iter() { + let well_known_endpoint = format!("{}.well-known/openid-credential-issuer", domain); + info!("Trying to fetch image from {well_known_endpoint} endpoint"); + if let Ok(response) = reqwest::Client::new().get(&well_known_endpoint).send().await { + if let Ok(metadata) = response.json::().await { + logo_uri = metadata.display.as_deref().and_then(extract_logo_uri_from_display); + + if logo_uri.is_some() { + break; + } + } + } + // TODO: Due to mixing 2 specs here, the oid4vci and linked verifiable presentation spec, we lose the Credential Issuer Identifier (CII) during the linked vp flow. + // The CII tells us where exactly we can add "/.well-known/openid-credential-issuer" to fetch the Credential Issuer Metadata, in which we might find the logo. + // For now we assume it's the same domain as the linked domain. + // But this is no guarantee and the code below is one such workaround. + let well_known_endpoint = format!("{}oid4vci/.well-known/openid-credential-issuer", domain); + info!("Trying to fetch image from {well_known_endpoint} endpoint"); + if let Ok(response) = reqwest::Client::new().get(&well_known_endpoint).send().await { + if let Ok(metadata) = response.json::().await { + logo_uri = linked_verifiable_credential.credential.types.iter().find_map(|type_| { + info!("Trying to fetch from Credential Configuration Supported: {}", type_); + metadata + .credential_configurations_supported + .get(type_) + .map(|credential_configuration| credential_configuration.display.as_ref()) + .and_then(extract_logo_uri_from_display) + }); + + if logo_uri.is_some() { + break; + } + } + } + } + } + + if let Some(ref logo_uri_str) = logo_uri { + info!("Logo URI: {:?}", logo_uri_str); + + // Parse the logo URI + match logo_uri_str.parse() { + Ok(parsed_url) => { + // Download the asset if parsing succeeded + if download_asset(parsed_url, &hash(logo_uri_str)).await.is_err() { + warn!("Failed to download logo URI"); + return None; + } + logo_uri + } + Err(parse_err) => { + // Log parse error if the URI is invalid + warn!("Failed to parse logo URI: {:#?}, {}", logo_uri_str, parse_err); + None + } + } + } else { + warn!("Failed to extract logo URI from well-known endpoints nor credential subject"); + None + } +} + +fn extract_logo_uri_from_display(display: &[Value]) -> Option { + display + .first() + .and_then(|display| display.get("logo")) + .and_then(|logo| logo.get("uri").or(logo.get("url"))) + .and_then(|url| url.as_str()) + .map(ToString::to_string) +} + +fn extract_url_from_did_web(did_web: &str) -> Option { + if let Some(did) = did_web.strip_prefix("did:web:") { + let url_str = if let Some(index_colon) = did.find(':') { + &did[..index_colon] + } else { + did + }; + + if let Ok(url) = Url::parse(&format!("https://{}", url_str)) { + return Some(url); + } + } + None } #[cfg(test)] @@ -574,6 +680,17 @@ mod tests { Jwt::from(message) } + + async fn add_logo_endpoint(&self) { + Mock::given(method("GET")) + .and(path("logo.png")) + .respond_with(ResponseTemplate::new(200).set_body_raw( + include_bytes!("../../../resources/images/impierce_white.png"), + "image/png", + )) + .mount(&self.mock_server) + .await; + } } #[tokio::test] @@ -581,6 +698,7 @@ mod tests { let mut holder = TestEntity::new().await; let mut issuer_a = TestEntity::new().await; + issuer_a.add_logo_endpoint().await; // Add the `/did_configuration.json` and `/did.json` endpoints to the issuer A mock server. issuer_a @@ -589,6 +707,7 @@ mod tests { issuer_a.add_well_known_did_json().await; let mut issuer_b = TestEntity::new().await; + issuer_b.add_logo_endpoint().await; // Add the `/did_configuration.json` and `/did.json` endpoints to the issuer B mock server. issuer_b @@ -596,11 +715,13 @@ mod tests { .await; issuer_b.add_well_known_did_json().await; + let logo_uri_a: String = format!("{}logo.png", issuer_a.domain.clone()); + let verifiable_credential_jwt = issuer_a .issue_credential( holder.did_document.id().to_string().as_str(), "Webshop", - "https://webshop.com/logo.jpg".parse().unwrap(), + logo_uri_a.parse().unwrap(), ) .await; @@ -618,11 +739,13 @@ mod tests { ) .await; + let logo_uri_b: String = format!("{}logo.png", issuer_b.domain.clone()); + let verifiable_credential_jwt_2 = issuer_b .issue_credential( holder.did_document.id().to_string().as_str(), "Webshop", - "https://webshop.com/logo.jpg".parse().unwrap(), + logo_uri_b.parse().unwrap(), ) .await; @@ -647,13 +770,13 @@ mod tests { vec![ vec![LinkedVerifiableCredentialData { name: Some("Webshop".to_string()), - logo_uri: Some("https://webshop.com/logo.jpg".to_string()), + logo_uri: Some(logo_uri_a), issuer_linked_domains: vec![issuer_a.domain.clone()], ..Default::default() }], vec![LinkedVerifiableCredentialData { name: Some("Webshop".to_string()), - logo_uri: Some("https://webshop.com/logo.jpg".to_string()), + logo_uri: Some(logo_uri_b), issuer_linked_domains: vec![issuer_b.domain.clone()], ..Default::default() }] @@ -757,14 +880,17 @@ mod tests { .add_well_known_did_configuration_json("linked-domain", &[issuer.domain.clone().into()]) .await; issuer.add_well_known_did_json().await; + issuer.add_logo_endpoint().await; let mut holder = TestEntity::new().await; + let issuer_logo = format!("{}logo.png", issuer.domain.clone()); + let verifiable_credential_jwt = issuer .issue_credential( holder.did_document.id().to_string().as_str(), "Webshop", - "https://webshop.com/logo.jpg".parse().unwrap(), + issuer_logo.parse().unwrap(), ) .await; @@ -795,7 +921,7 @@ mod tests { validated_linked_presentation_data, Some(vec![LinkedVerifiableCredentialData { name: Some("Webshop".to_string()), - logo_uri: Some("https://webshop.com/logo.jpg".to_string()), + logo_uri: Some(issuer_logo), issuer_linked_domains: vec![issuer.domain.clone()], ..Default::default() }]) diff --git a/identity-wallet/src/state/qr_code/reducers/read_authorization_request.rs b/identity-wallet/src/state/qr_code/reducers/read_authorization_request.rs index a3b86109..29ae60f1 100644 --- a/identity-wallet/src/state/qr_code/reducers/read_authorization_request.rs +++ b/identity-wallet/src/state/qr_code/reducers/read_authorization_request.rs @@ -87,16 +87,16 @@ pub async fn read_authorization_request(state: AppState, action: Action) -> Resu let domain_validation = Box::new(validate_domain_linkage(url, did).await); - let trusted_domains: Vec = state + let trusted_domains: Vec = state .trust_lists .0 .iter() - .map(|trust_list| { + .flat_map(|trust_list| { trust_list .entries .iter() - .filter_map(|(domain, trusted)| trusted.then_some(domain.clone().to_string())) - .collect::() + .filter_map(|(domain, trusted)| trusted.then_some(domain.clone())) + .collect::>() }) .collect(); @@ -108,9 +108,9 @@ pub async fn read_authorization_request(state: AppState, action: Action) -> Resu .flatten() .filter(|linked_verifiable_credential| { linked_verifiable_credential.issuer_linked_domains.iter().any(|domain| { - info!("domain: {:?}", domain.to_string()); + info!("domain: `{}`", domain); - trusted_domains.contains(&domain.to_string()) + trusted_domains.contains(domain) }) }) .collect(); diff --git a/unime/src-tauri/tests/fixtures/states/accept_connection.json b/unime/src-tauri/tests/fixtures/states/accept_connection.json index ad93e2cc..f464bbc2 100644 --- a/unime/src-tauri/tests/fixtures/states/accept_connection.json +++ b/unime/src-tauri/tests/fixtures/states/accept_connection.json @@ -14,7 +14,7 @@ "previously_connected": false, "domain_validation": { "status": "Unknown", - "message": "error decoding response body: expected value at line 1 column 1" + "message": "Error while fetching configuration: failed to parse response into JSON value" }, "linked_verifiable_presentations": [] }