Skip to content

Commit

Permalink
Merge branch 'main' into web3-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperBatata authored Dec 26, 2024
2 parents 097a765 + 0f29e08 commit a042913
Show file tree
Hide file tree
Showing 71 changed files with 8,019 additions and 5,052 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ plugins {

kotlin("plugin.serialization") version kotlinVersion apply false

id("com.android.library") version "8.7.2" apply false
id("com.android.application") version "8.7.2" apply false
id("com.android.library") version "8.7.3" apply false
id("com.android.application") version "8.7.3" apply false

id("com.github.ben-manes.versions") version "0.51.0" apply false
}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ MSSQL_DB_PORT=1433

#sqlite | postgres | mssql
DATABASE_ENGINE=postgres
VERSION_TAG=0.9.0
VERSION_TAG=0.10.0
COMPOSE_PROFILES=$DATABASE_ENGINE
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ val modules = listOf(
* "$libraries:crypto".group(
"waltid-crypto",
"waltid-crypto-oci",
"waltid-crypto-aws",
"waltid-crypto-android" whenEnabled enableAndroidBuild,
"waltid-crypto-ios" whenEnabled enableIosBuild,
"waltid-target-ios" whenEnabled enableIosBuild,
Expand Down Expand Up @@ -90,7 +91,7 @@ pluginManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}

rootProject.name = "waltid-identity"
2 changes: 1 addition & 1 deletion waltid-applications/waltid-web-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"axios": "^1.7.2",
"eslint": "9.5.0",
"eslint-config-next": "14.2.4",
"next": "14.2.10",
"next": "14.2.15",
"postcss": "8.4.38",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const getOfferUrl = async (
vpProfile?: string
) => {
const data = await fetch(
`${NEXT_PUBLIC_ISSUER}/.well-known/openid-credential-issuer`
`${NEXT_PUBLIC_ISSUER}/draft13/.well-known/openid-credential-issuer`
).then((data) => {
return data.json();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@heroicons/vue": "^2.1.5",
"@julr/unocss-preset-forms": "^0.1.0",
"@pinia/nuxt": "^0.5.4",
"jsonpath-plus": "^10.0.0",
"jsonpath-plus": "^10.0.7",
"pinia": "^2.2.2",
"qr-scanner": "^1.4.2",
"qrcode.vue": "^3.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@heroicons/vue": "^2.1.5",
"@julr/unocss-preset-forms": "^0.1.0",
"@pinia/nuxt": "^0.5.5",
"jsonpath-plus": "^10.0.0",
"jsonpath-plus": "^10.0.7",
"pinia": "^2.2.4",
"qr-scanner": "^1.4.2",
"qrcode.vue": "^3.5.0",
Expand Down
36 changes: 29 additions & 7 deletions waltid-applications/waltid-web-wallet/libs/composables/issuance.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useLazyAsyncData, createError, navigateTo } from "nuxt/app";
import { useCurrentWallet } from "./accountWallet.ts";
import { decodeRequest } from "./siop-requests.ts";
import { type Ref, ref, watch } from "vue";
import { groupBy } from "./groupings.ts";
import {createError, navigateTo, useLazyAsyncData} from "nuxt/app";
import {useCurrentWallet} from "./accountWallet.ts";
import {decodeRequest} from "./siop-requests.ts";
import {type Ref, ref, watch} from "vue";
import {groupBy} from "./groupings.ts";

export async function useIssuance(query: any) {
const currentWallet = useCurrentWallet()
Expand All @@ -19,6 +19,7 @@ export async function useIssuance(query: any) {
const response: {
credential_issuer: string;
credential_configuration_ids: string[];
credentials: string[];
} = await $fetch(`/wallet-api/wallet/${currentWallet.value}/exchange/resolveCredentialOffer`, {
method: "POST",
body: request
Expand Down Expand Up @@ -47,12 +48,33 @@ export async function useIssuance(query: any) {
issuerHost = issuer;
}

const credential_issuer: { credential_configurations_supported: Array<{ types: Array<String>; }>; } = await $fetch(`/wallet-api/wallet/${currentWallet.value}/exchange/resolveIssuerOpenIDMetadata?issuer=${issuer}`)
const credentialList = credentialOffer.credential_configuration_ids.map((id) => credential_issuer.credential_configurations_supported[id]);
const credential_issuer: {
credential_configurations_supported: Array<{ types: Array<String>; }>; // Draft13
credentials_supported?: Array<{ id: string; types: Array<String> }>; // Draft11
} = await $fetch(`/wallet-api/wallet/${currentWallet.value}/exchange/resolveIssuerOpenIDMetadata?issuer=${issuer}`)


const credentialList = credentialOffer.credential_configuration_ids
// Draft13
? credentialOffer.credential_configuration_ids.map((id) => credential_issuer.credential_configurations_supported[id])

// Draft11
: credentialOffer.credentials.map((id) => {
return credential_issuer.credentials_supported?.find(
(credential_supported) => credential_supported.id === id
);
}).filter(Boolean);


let credentialTypes: String[] = [];
for (let credentialListElement of credentialList) {

if (typeof credentialListElement["types"] !== 'undefined') {
const typeList = credentialListElement["types"] as Array<String>;
const lastType = typeList[typeList.length - 1] as String;
credentialTypes.push(lastType);
}

if (typeof credentialListElement["credential_definition"] !== 'undefined') {
const typeList = credentialListElement["credential_definition"]["type"] as Array<String>;
const lastType = typeList[typeList.length - 1] as String;
Expand Down
Loading

0 comments on commit a042913

Please sign in to comment.