Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"signify-ts": "^0.3.0-rc1",
"styled-components": "^6.1.8",
"styled-system": "^5.1.5",
"vlei-verifier-workflows": "^0.0.5",
"vlei-verifier-workflows": "^0.0.5-sbe",
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
Expand Down
21 changes: 19 additions & 2 deletions src/components/credentialCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ export function CredentialCard({
<>
<Flex flexDirection="row" justifyContent="space-between">
<Text fontSize={1} fontWeight="bold" $color="heading">
{credential.schema.title}
{credential.sad?.a?.engagementContextRole ??
credential.schema.title}
</Text>
<CredentialIcon size={6} />
</Flex>
<Box marginBottom={1} fontSize={0}>
<Text $color="text">{credential.schema.credentialType}</Text>
<Text $color="text">
{credential.sad?.a?.engagementContextRole
? credential.schema.title
: credential.schema.credentialType}
</Text>
</Box>
<Box marginBottom={1} fontSize={0}>
<Text $color="text">{credential.schema.description}</Text>
Expand All @@ -46,6 +51,18 @@ export function CredentialCard({
</Text>
</Box>
) : null}
{credential.sad?.a?.personLegalName ? (
<Box marginBottom={1}>
<Text fontSize={0} fontWeight="bold" $color="heading">
<>
Legal Name: {" "}
<Subtext fontWeight="normal" $color="text">
{credential.sad?.a?.personLegalName}
</Subtext>
</>
</Text>
</Box>
) : null}
<Flex
flexDirection="row-reverse"
justifyContent="space-between"
Expand Down
68 changes: 68 additions & 0 deletions src/config-workflow/configuration-singlesig-single-user-light.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"secrets": {
"gleif1": "D_PbQb01zuzQgK-kDWjq5",
"qvi1": "BTaqgh1eeOjXO5iQJp6m5",
"le1": "Akv4TFoiYeHNqzj3N8gE5"
},
"credentials": {
"gleif_to_qvi_vlei_cred": {
"type": "direct",
"schema": "QVI_SCHEMA_SAID",
"privacy": false,
"attributes": {}
},
"qvi_to_le_vlei_cred": {
"credSource": {
"type": "qvi"
},
"type": "direct",
"schema": "LE_SCHEMA_SAID",
"rules": "LE_RULES",
"privacy": false,
"attributes": {}
}
},
"agents": {
"gleif-agent-1": {
"secret": "gleif1"
},
"qvi-agent-1": {
"secret": "qvi1"
},
"le-agent-1": {
"secret": "le1"
}
},
"identifiers": {
"gleif-aid-1": {
"agent": "gleif-agent-1",
"name": "gleif-aid-1"
},
"qvi-aid-1": {
"delegator": "gleif-aid-1",
"agent": "qvi-agent-1",
"name": "qvi-aid-1"
},
"le-aid-1": {
"agent": "le-agent-1",
"name": "le-aid-1"
}
},
"users": [
{
"type": "GLEIF",
"alias": "gleif-user-1",
"identifiers": ["gleif-aid-1"]
},
{
"type": "QVI",
"alias": "qvi-user-1",
"identifiers": ["qvi-aid-1"]
},
{
"type": "LE",
"alias": "le-user-1",
"identifiers": ["le-aid-1"]
}
]
}
89 changes: 89 additions & 0 deletions src/config-workflow/workflow-singlesig-single-user-light.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"workflow": {
"steps": {
"gleif_client": {
"id": "gleif_client",
"type": "create_client",
"agent_name": "gleif-agent-1",
"description": "Creating client for gleif-agent-1"
},
"qvi_client": {
"id": "qvi_client",
"type": "create_client",
"agent_name": "qvi-agent-1",
"description": "Creating client for qvi-agent-1"
},
"le_client": {
"id": "le_client",
"type": "create_client",
"agent_name": "le-agent-1",
"description": "Creating client for le-agent-1"
},
"gleif_aid": {
"id": "gleif_aid",
"type": "create_aid",
"aid": "gleif-aid-1",
"description": "Creating AID: gleif-aid-1"
},
"qvi_aid": {
"id": "qvi_aid",
"type": "create_aid",
"aid": "qvi-aid-1",
"description": "Creating AID: qvi-aid-1"
},
"le_aid": {
"id": "le_aid",
"type": "create_aid",
"aid": "le-aid-1",
"description": "Creating AID: le-aid-1"
},
"gleif_registry": {
"id": "gleif_registry",
"type": "create_registry",
"aid": "gleif-aid-1",
"description": "Creating registry for gleif-aid-1"
},
"qvi_registry": {
"id": "qvi_registry",
"type": "create_registry",
"aid": "qvi-aid-1",
"description": "Creating registry for qvi-aid-1"
},
"le_registry": {
"id": "le_registry",
"type": "create_registry",
"aid": "le-aid-1",
"description": "Creating registry for le-aid-1"
},
"qvi_cred": {
"id": "qvi_cred",
"type": "issue_credential",
"attributes": {
"LEI": "254900OPPU84GM83MG36"
},
"issuer_aid": "gleif-aid-1",
"issuee_aid": "qvi-aid-1",
"description": "GLEIF issues QVI vLEI credential",
"credential": "gleif_to_qvi_vlei_cred"
},
"le_cred": {
"id": "le_cred",
"type": "issue_credential",
"attributes": {
"LEI": "875500ELOZEL05BVXV37"
},
"issuer_aid": "qvi-aid-1",
"issuee_aid": "le-aid-1",
"description": "QVI issues LE vLEI credential",
"credential": "qvi_to_le_vlei_cred",
"credential_source": "qvi_cred"
},
"add_root_of_trust": {
"id": "add_root_of_trust",
"type": "add_root_of_trust",
"rot_aid": "gleif-aid-1",
"description": "Adding Root of Trust"
}
}
}
}
2 changes: 2 additions & 0 deletions src/config/event-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const EVENT_TYPE = {
action_icon: "action-icon",
authentication: "authentication",
create_resource: "create-resource",
config_workflow: "config-workflow",
delete_resource: "delete-resource",
fetch_resource: "fetch-resource",
update_resource: "update-resource",
Expand All @@ -25,6 +26,7 @@ export const CS_EVENTS = {
fetch_resource_credential: `${CS}-${EVENT_TYPE.fetch_resource}-credential`,

create_resource_data_attestation_credential: `${CS}-${EVENT_TYPE.create_resource}-data-attestation-credential`,
config_workflow_issue_credential: `${CS}-${EVENT_TYPE.config_workflow}-issue-credential`,

vendor_info_get_vendor_data: `${CS}-${EVENT_TYPE.vendor_info}-get-vendor-data`,
vendor_info_provide_config_url: `${CS}-${EVENT_TYPE.vendor_info}-provide-config-url`,
Expand Down
2 changes: 1 addition & 1 deletion src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface ICredential {
issueeName: string;
ancatc: string[];
chains?: ICredential[];
sad: { a: { i: string }; d: string };
sad: { a: { i: string, personLegalName?: string, engagementContextRole?: string }; d: string };
schema: {
title: string;
credentialType: string;
Expand Down
5 changes: 5 additions & 0 deletions src/pages/background/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
handleUpdateAutoSignin,
handleCreateAttestationCredential,
handleFetchCredential,
handleConfigWorkflowIssueCredential,
} from "./resource";
import { handleGetVendorData, handleAttemptSetVendorData } from "./vendorInfo";
import {
Expand Down Expand Up @@ -90,6 +91,10 @@ export function initCSHandler() {
CS_EVENTS.create_resource_data_attestation_credential,
handleCreateAttestationCredential,
);
handler.set(
CS_EVENTS.config_workflow_issue_credential,
handleConfigWorkflowIssueCredential,
);

handler.set(CS_EVENTS.vendor_info_get_vendor_data, handleGetVendorData);
handler.set(
Expand Down
19 changes: 19 additions & 0 deletions src/pages/background/handlers/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,25 @@ export async function handleCreateSignin({ sendResponse, data }: IHandler) {
}
}

export async function handleConfigWorkflowIssueCredential({
sendResponse,
url,
tabId,
data,
}: IHandler) {
try {
const resp = await signifyService.configWorkflowToIssueCredential(data.metadata);
sendResponse({
data: { ...resp },
});
} catch (error: any) {
console.error("Error running workflow with handleConfigWorkflowIssueCredential method:", error);
sendResponse({
error: { code: 503, message: error },
});
}
}

export async function handleCreateAttestationCredential({
sendResponse,
url,
Expand Down
Loading