diff --git a/Makefile b/Makefile index b0f0bbc..bcf6f9f 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ help: ## ๐Ÿ›Ÿ Show this help message ncr: deps ## ๐Ÿ“ฆ Install and setup the server @if [ ! -f ./ncr ]; then \ - wget -q --show-progress https://github.com/ForkbombEu/ncr/releases/download/v1.39.5/ncr; \ + wget -q --show-progress https://github.com/ForkbombEu/ncr/releases/download/v1.39.6/ncr; \ chmod +x ./ncr; \ fi @echo "๐Ÿ“ฆ Setup is done!" @@ -58,6 +58,7 @@ tests-deps: # ๐Ÿงช Check test dependencies tests/mobile_zencode: git clone https://github.com/forkbombeu/mobile_zencode tests/mobile_zencode + cd tests/mobile_zencode && git checkout fix/credential_configurations_supported mobile_zencode_up: ncr tests/mobile_zencode ./ncr -p 3003 -z ./tests/mobile_zencode/wallet & echo $$! > .test.mobile_zencode.pid diff --git a/public/authz_server/authorize b/public/authz_server/authorize index 7705322..080ba4a 100644 --- a/public/authz_server/authorize +++ b/public/authz_server/authorize @@ -99,19 +99,16 @@ fetch(`${issuerUrl}/.well-known/openid-credential-issuer`) .then((response) => response.json()) .then((wk) => { - const credentialInfo = wk.credential_configurations_supported.filter( - (c) => c.credential_definition.type[0] === type - )[0].display[0]; + const credentialInfo = wk.credential_configurations_supported[type].display[0]; $("#avatar").attr("name", credentialInfo?.name) $("#avatar").attr("alt", credentialInfo?.logo.alt_text) - $("#avatar").attr("src", credentialInfo?.logo.url) + $("#avatar").attr("src", credentialInfo?.logo.uri) $("#heading").text(credentialInfo?.name) $("#description").html(marked.parse(credentialInfo?.description || "")) if (credentialInfo?.text_color.length > 0) $("#description").addClass("text-[" + credentialInfo.text_color + "]") if (credentialInfo?.background_color.length > 0) $("#description").addClass("bg-[" + credentialInfo.background_color + "]") - const credConf = wk.credential_configurations_supported.find(config => config.credential_definition.type[0] === type).display[0]; const editor = new JSONEditor(document.getElementById('form'), { schema: schemas[type], compact: true, diff --git a/scripts/wk.sh b/scripts/wk.sh index 4e17173..3f95ae1 100755 --- a/scripts/wk.sh +++ b/scripts/wk.sh @@ -18,8 +18,8 @@ setup() { -e "s|{{ ci_name }}|DIDroom_Test_Issuer|g" \ public/credential_issuer/.well-known/openid-credential-issuer tmp=$(mktemp) - jq --indent 4 '.credential_configurations_supported = [ - { + jq --indent 4 '.credential_configurations_supported = { + "test_credential": { "format": "vc+sd-jwt", "cryptographic_binding_methods_supported": [ "jwk", @@ -40,9 +40,10 @@ setup() { "name": "Tested Credential", "locale": "en-US", "logo": { - "url": "https://www.connetweb.com/wp-content/uploads/2021/06/canstockphoto22402523-arcos-creator.com_-1024x1024-1.jpg", - "alt_text": "Test Logo" + "uri": "https://www.connetweb.com/wp-content/uploads/2021/06/canstockphoto22402523-arcos-creator.com_-1024x1024-1.jpg", + "alt_text": "Test Logo" }, + "description": "a description", "background_color": "#12107c", "text_color": "#FFFFFF" } @@ -64,7 +65,7 @@ setup() { } } } - ]' public/credential_issuer/.well-known/openid-credential-issuer > $tmp && mv $tmp public/credential_issuer/.well-known/openid-credential-issuer + }' public/credential_issuer/.well-known/openid-credential-issuer > $tmp && mv $tmp public/credential_issuer/.well-known/openid-credential-issuer jq --indent 4 '.authorization_servers = [ "http://localhost:3000/authz_server" ]' public/credential_issuer/.well-known/openid-credential-issuer > $tmp && mv $tmp public/credential_issuer/.well-known/openid-credential-issuer