Skip to content

Commit

Permalink
fix(ci_wk): credential_configurations_supported is a dictionary and c…
Browse files Browse the repository at this point in the history
…orrect url with uri (#176)

* fix(ci_wk): credential_configurations_supported is a dictionary and correct url with uri

* chore: bump ncr from 1.39.5 to 1.39.6

* test: checkout the relative mobile_zencode branch
  • Loading branch information
matteo-cristino authored Oct 30, 2024
1 parent aa6cdb8 commit 530b151
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions public/authz_server/authorize
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 6 additions & 5 deletions scripts/wk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
Expand All @@ -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
Expand Down

0 comments on commit 530b151

Please sign in to comment.