Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
31f82a7
feat: initial patching of packages to support sd-jwt format
martines3000 Jan 28, 2025
4d4b916
Merge branch 'develop' into feat/sd-jwt-support
martines3000 Feb 2, 2025
c740ff5
chore: fix
martines3000 Feb 2, 2025
4eec685
Merge branch 'develop' into feat/sd-jwt-support
martines3000 Mar 14, 2025
b27de80
chore: update uploadthing dep
martines3000 Mar 18, 2025
dcdba97
chore: `selectedPdf` null and undefined checks
martines3000 Mar 18, 2025
7e41a7a
chore: change caching parameters
martines3000 Mar 19, 2025
babc3d2
chore: increase text size
martines3000 Mar 20, 2025
2379298
feat: update code for vc issuance tracking and coupon claim tracking
martines3000 Mar 27, 2025
8eb9e02
fix: credentials display page
martines3000 Mar 28, 2025
4d2d23a
fix: change incorrect locale string
martines3000 Mar 28, 2025
7a7f463
chore: visual fixes for credentials page
martines3000 Mar 31, 2025
5d37a42
chore: remove `display` property as it is optional
martines3000 Apr 9, 2025
773aff3
chore: remove basePath from interop testing frontend
martines3000 Apr 10, 2025
1656dc8
fix: improve dockerfile syntax
martines3000 Apr 10, 2025
747ac7b
chore: remove legacy docker syntax
martines3000 Apr 10, 2025
7f0da79
fix: use correct credential cache
pseudobun Apr 24, 2025
452f096
chore: prepare for further development
pseudobun Apr 24, 2025
a818070
feat: change from 'vc+sd-jwt' to 'sd-jwt' typing format
pegi4 Jul 26, 2025
cdb3f35
feat: add sd-jwt credential format support
pegi4 Jul 27, 2025
86369c3
chore: small changes
martines3000 Sep 1, 2025
87f38c0
Merge branch 'develop' into feat/sd-jwt-support
martines3000 Sep 1, 2025
5dc1cc3
chore: change how provider is used
martines3000 Sep 1, 2025
320226f
chore: small improvement
martines3000 Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 108 additions & 37 deletions apps/authorization-service/src/plugins/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { util as didKeyUtil } from '@cef-ebsi/key-did-resolver';
import { util as didEbsiUtil } from '@cef-ebsi/ebsi-did-resolver';
import type { PresentationDefinitionV2 } from '@sphereon/pex-models';
import {
COUPON_DEMO_PRESENTATION_DEFINITION,
INTEROP_TEST_PRESENTATION_DEFINITION,
VERIFIER_TEST_PRESENTATION_DEFINITION,
} from '../utils/presentationDefinitions.js';
Expand All @@ -22,43 +21,113 @@ declare module 'fastify' {
}
}

const CONFORMANCE_TEST_SUPPORTED_CREDENTIALS: string[][] = [
[
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSameAuthorisedInTime',
],
[
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSameAuthorisedDeferred',
],
[
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSamePreAuthorisedInTime',
],
[
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSamePreAuthorisedDeferred',
],
['VerifiableCredential', 'VerifiableAttestation', 'InTimeIssuance'],
['VerifiableCredential', 'VerifiableAttestation', 'DefferedIssuance'],
['VerifiableCredential', 'VerifiableAttestation', 'PreAuthIssuance'],
const CONFORMANCE_TEST_SUPPORTED_CREDENTIALS: {
format: string;
types: string[];
}[] = [
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSameAuthorisedInTime',
],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSameAuthorisedDeferred',
],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSamePreAuthorisedInTime',
],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'CTWalletSamePreAuthorisedDeferred',
],
},
{
format: 'jwt_vc_json',
types: ['VerifiableCredential', 'VerifiableAttestation', 'InTimeIssuance'],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'DefferedIssuance',
],
},
{
format: 'jwt_vc_json',
types: ['VerifiableCredential', 'VerifiableAttestation', 'PreAuthIssuance'],
},
];

const SUPPORTED_CREDENTIALS: string[][] = [
['VerifiableCredential', 'VerifiableAttestation', 'EducationCredential'],
['VerifiableCredential', 'VerifiableAttestation', 'EventTicketCredential'],
['VerifiableCredential', 'VerifiableAttestation', 'CouponCredential'],
[
'VerifiableCredential',
'VerifiableAttestation',
'EuropeanDigitalCredential',
],
['VerifiableCredential', 'VerifiableAttestation', 'EHIC'],
['VerifiableCredential', 'VerifiableAttestation', 'DiplomaCredential'],
const SUPPORTED_CREDENTIALS: { format: string; types: string[] }[] = [
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'EducationCredential',
],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'EventTicketCredential',
],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'CouponCredential',
],
},
{
format: 'sd-jwt',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'CouponCredential',
],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'EuropeanDigitalCredential',
],
},
{
format: 'jwt_vc_json',
types: ['VerifiableCredential', 'VerifiableAttestation', 'EHIC'],
},
{
format: 'jwt_vc_json',
types: [
'VerifiableCredential',
'VerifiableAttestation',
'DiplomaCredential',
],
},
];

export default fp(async (fastify, _) => {
Expand Down Expand Up @@ -163,7 +232,9 @@ export default fp(async (fastify, _) => {
return presentationDefinition;
}
},
credentialTypesSupported: credentialTypesSupported,
credentialTypesSupported: credentialTypesSupported.map(
(credentialTypesSupported) => credentialTypesSupported.types,
),
});

fastify.decorate('auth', auth);
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "pnpm clean && next build",
"clean": "rimraf .next",
"postbuild": "next-sitemap --config=next-sitemap.config.js",
"dev": "next dev",
"dev": "USE_TEST_PROVIDER=true next dev",
"docker:build": "docker build . -t blockchain-lab-um/eductx-platform-dashboard",
"start": "next start"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/api/issue-oidc/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function POST(req: NextRequest) {
}

const basicEmailHtml = await renderBasicEmail({
qrCodeUrl: uploadResponse.data.url,
qrCodeUrl: uploadResponse.data.ufsUrl,
});

let attachments: Mail.Attachment[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Schema, SchemaNode } from '../schemaTypes';
export const CouponCredential = {
$id: '#couponCredential',
type: 'object',
format: 'jwt_vc_json',
properties: {
credentialSubject: {
type: 'object',
Expand All @@ -26,6 +27,36 @@ export const CouponCredential = {
export const CouponCredentialSchema = {
title: 'Coupon Credential',
type: '#couponCredential',
format: 'jwt_vc_json',
fields: [
{
title: 'Credential Subject',
type: 'object',
propertyName: 'credentialSubject',
fields: [
{
title: 'Coupon ID',
propertyName: 'couponId',
type: 'string',
required: true,
} as SchemaNode,
{
title: 'Coupon Name',
propertyName: 'couponName',
type: 'string',
required: true,
} as SchemaNode,
],
required: true,
},
],
required: true,
} as Schema;

export const CouponCredentialSdJwtSchema = {
title: 'Coupon Credential (SD-JWT)',
type: '#couponCredential',
format: 'sd-jwt',
fields: [
{
title: 'Credential Subject',
Expand Down
8 changes: 3 additions & 5 deletions apps/dashboard/src/components/IssueView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useToastStore } from '@/stores';
import { CredentialForm } from './CredentialForm';
import {
CouponCredentialSchema,
CouponCredentialSdJwtSchema,
EducationalCredentialSchema,
EducationalCredentialSchemaNOO,
EuropeanDigitalCredentialSchema,
Expand All @@ -29,6 +30,7 @@ const SCHEMAS: Schema[] = [
EducationalCredentialSchema,
EducationalCredentialSchemaNOO,
CouponCredentialSchema,
CouponCredentialSdJwtSchema,
EuropeanDigitalCredentialSchema,
DiplomaCredentialSchema,
EHICCredentialSchema,
Expand Down Expand Up @@ -71,7 +73,6 @@ export const IssueView = () => {
const [next, setNext] = useState(false);
const [inputs, setInputs] = useState<any>({});
const [_, setIsFilled] = useState(false);
const [credentialIssued, setCredentialIssued] = useState(false);
const [isIssuing, setIsIssuing] = useState(false);
const [email, setEmail] = useState('');

Expand Down Expand Up @@ -114,7 +115,6 @@ export const IssueView = () => {
};

const goBack = () => {
setCredentialIssued(false);
setNext(false);
};

Expand All @@ -130,7 +130,6 @@ export const IssueView = () => {
});

if (response.ok) {
setCredentialIssued(true);
useToastStore.setState({
open: true,
title: 'Credential Issued',
Expand Down Expand Up @@ -168,14 +167,13 @@ export const IssueView = () => {
getCredentialType(selectedSchema!.type),
],
flow: 'pre-authorized_code',
format: 'jwt_vc_json',
format: selectedSchema!.format,
credential_subject: inputs.credentialSubject,
},
}),
});

if (response.ok) {
setCredentialIssued(true);
useToastStore.setState({
open: true,
title: 'Credential Issued',
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/src/components/IssueView/schemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export interface SchemaObject {
export interface Schema {
title: string;
type?: string;
format?: string;
fields: SchemaNode[] | SchemaObject[];
}
17 changes: 17 additions & 0 deletions apps/dashboard/src/lib/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { NextAuthOptions } from 'next-auth';
import AzureADProvider from 'next-auth/providers/azure-ad';
import CredentialsProvider from 'next-auth/providers/credentials';

export const authOptions: NextAuthOptions = {
secret: process.env.NEXTAUTH_SECRET,
Expand All @@ -10,5 +11,21 @@ export const authOptions: NextAuthOptions = {
clientSecret: process.env.AZURE_AD_CLIENT_SECRET!,
tenantId: process.env.AZURE_AD_TENANT_ID!,
}),
...(process.env.USE_TEST_PROVIDER
? [
CredentialsProvider({
name: 'Credentials',
credentials: {},
async authorize() {
// Always return a successful authentication
return {
id: '1',
name: 'Test User',
email: '[email protected]',
};
},
}),
]
: []),
],
};
3 changes: 3 additions & 0 deletions apps/issuer-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"@fastify/sensible": "^6.0.1",
"@fastify/type-provider-json-schema-to-ts": "^4.0.0",
"@noble/curves": "1.6.0",
"@sd-jwt/crypto-nodejs": "0.14.0",
"@sd-jwt/sd-jwt-vc": "0.14.0",
"@sd-jwt/types": "0.14.0",
"cache-manager": "6.1.2",
"cacheable": "1.8.2",
"close-with-grace": "^1.3.0",
Expand Down
Loading