Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMA Portal changes for names, VPs and compliance filtering #45

Open
wants to merge 38 commits into
base: development
Choose a base branch
from

Conversation

nklomp
Copy link

@nklomp nklomp commented Mar 17, 2023

Hi, these are the changes we made to the portal. To add the organizational name functionality, Verifiable Presentation support, and GX compliant filtering.

Below a summary of the main changes:

SD Support:

SDs are verified in the raw format only. If an URL is passed in, the SD is fetched and then verified

/src/utils/metadata.ts lines 154 - 159

export function isString(value: unknown): boolean {
  return (
    typeof value === 'string' ||
    Object.prototype.toString.call(value) === '[object String]'
  )
}

/src/utils/metadata.ts lines 171 - 178

if (!body) return { verified: false };
if (!raw) {
  if (!isString(body)) {
    Logger.error(`Expected a string url but received: ${body}`);
    return { verified: false };
  }
  body = (await axios.get(body)).data;
}

SDs as VPs and json object containing the credentials are supported

/src/utils/metadata.ts lines 180 - 189

let baseUrl;
if (
  body.type &&
  Array.isArray(body.type) &&
  (body.type as string[]).indexOf("VerifiablePresentation") !== -1
) {
  baseUrl = `${complianceUri}/2210vp/compliance`;
} else {
  baseUrl = `${complianceUri}/participant/verify/raw`;
}

VPs are already signed and won't get signed again. If the input is the original SD structure the flow remains untouched

/src/components/molecules/FormFields/ServiceSelfDescription.tsx lines 43 - 57

let signedServiceSelfDescription;
if (
  parsedServiceSelfDescription.type &&
  Array.isArray(parsedServiceSelfDescription.type) &&
  (parsedServiceSelfDescription.type as string[]).indexOf(
    "VerifiablePresentation"
  ) !== -1
) {
  signedServiceSelfDescription = parsedServiceSelfDescription;
} else {
  signedServiceSelfDescription =
    parsedServiceSelfDescription?.complianceCredential
      ? parsedServiceSelfDescription
      : await signServiceSelfDescription(parsedServiceSelfDescription);
}

Compliance filter:

A variable was added to additionalInformation in metadata to store the results of the SD verification, so we are be able to filter the compliant SDs without verifying the whole list when accessing the catalogue

Asset

{
  "@context": "https://w3id.org/did/v1",
  "id": "did:op:28e84f7DAE397dE9960fE10921e410B7E1F7FF29",
  "created": "2023-03-13T11:51:42Z",
  "dataToken": "0x28e84f7DAE397dE9960fE10921e410B7E1F7FF29",
  "publicKey": [
    {
      "id": "did:op:28e84f7DAE397dE9960fE10921e410B7E1F7FF29",
      "type": "EthereumECDSAKey",
      "owner": "0xDa4fc9E82Ac4E44207a1f74137493D3437D80761"
    }
  ],
  "authentication": [
    {
      "type": "RsaSignatureAuthentication2018",
      "publicKey": "did:op:28e84f7DAE397dE9960fE10921e410B7E1F7FF29"
    }
  ],
  "service": [
    {
      "type": "metadata",
      "attributes": {
        "status": {
          "isListed": true,
          "isRetired": false,
          "isOrderDisabled": false
        },
        "main": {
          "type": "dataset",
          "name": "Sphereon Test Dataset Domain 13-13-2023",
          "dateCreated": "2023-03-13T11:51:15Z",
          "author": "Future Mobility Data Marketplace",
          "license": "https://market.oceanprotocol.com/terms",
          "files": [
            {
              "contentLength": "904",
              "contentType": "application/json",
              "index": 0
            }
          ],
          "datePublished": "2023-03-13T11:51:47Z"
        },
        "additionalInformation": {
          "description": "This data service offering consists of traffic data (only pictures, for video see MOVE-1) for object detection and annotation algorithms to identify \ntraffic objects, measure traffic density and to train ML/AI models on traffic data in a sample set of videos and images. The algorithm uses features \nlearned by a deep convolutional neural network to detect an object.\\n\\nThis data service can be translated to many other use cases, i.e. traffic \ndetection, smart mobility, smart city etc. \\n\\n\n\n## About the use case\\n\\n\n\nThis use case demonstrates how algorithm and data providers can train and monetize their machine learning scripts by making them available in Gaia-X. \nAt the same time consumers in Gaia-X can use existing and well-trained models for classification, analysis and forecasting without the need to share \ntheir data and/or acquire personnel or expensive services. The product can be used directly from the Gaia-X market.\\n\\nObject detection is considered \nto be one of the most challenging tasks in the computer vision field. The algorithm YOLOv5 is a Convolutional Neural Network (CNN) for performing \nobject detection in real-time. CNNs are classifier-based systems that can process input images as structured arrays of data and identify patterns \nbetween them (view image below). YOLO has the advantage of being much faster than other networks and still maintains accuracy.\\n\\nData providers \napprove AI algorithms to run on their data and then Compute-to-Data orchestrates remote computation and execution on data to train AI models while \npreserving the privacy of the data.\\n\\nCompute-to-Data (CtD) allows for privacy-preserving data-sharing, remote computation and data monetization and \nis a core feature and strong advantage of Ocean Protocol. CtD keeps the data on-premises and allows data consumers to run remote compute jobs on the \ndata. Data owners keep full control as the data never leaves their premises and is only ever accessed by algorithms. CtD resolves the tradeoff \nbetween using private data and the risks of exposing it. Newly monetized data creates new revenue streams for data publishers. CtD is directly \nintegrated into the Minimal Viable Gaia-X and third-party portals, where data providers can opt to restrict the access type to “compute only”. Once \ndata is made accessible, the compute job is brought to the data and executed on-premise. This is especially suitable to train AI models, calculate \nstatistics or build business analytics use cases on private data without revealing them.\\n\\n\n\n## Preview of the Results\\n\\n\n\nThese images show the results of the real-time object detection algorithm applied to images and videos.\\n\\n\n![](https://github.com/deltaDAO/files/raw/main/move1_sample_001.jpg)\\n\n![](https://github.com/deltaDAO/files/raw/main/move1_sample_002.jpg)\\n\n![](https://github.com/deltaDAO/files/raw/main/move1_sample_003.jpg)\\n\\n\n\n## About DBC\\n\\n\n\nThe Dutch Blockchain Coalition (DBC) is a non-profit triple helix organization that facilitates exploration and implementation of blockchain \ntechnology in the Netherlands. Our mission is to increase both knowledge and use of blockchain in the Netherlands, thereby speeding up the \ndecentralisation of digital infrastructure.\\n\\nThe Dutch Blockchain Coalition (DBC) is working with the Ministry of Infrastructure and Water \nManagement (IenW) and market parties on an exploration of the possibilities blockchain and decentralised technologies can offer in the mobility \nsector. The aim is to create a high-quality, safe, fair and sustainable digital mobility infrastructure for the future.\\n\\n\n\n## Use cases for bringing life to the Dutch mobility system:\\n\\n\n* Open Mobility Trust Network\\n\n* Ownership of personal data & Mobility\\n\n* Parking for shared cars\\n\n* Vehicle passports and EU supply chain legislation\\n\n* Seamless EV charging and Local Green Energy\\n\\n\n\n## About deltaDAO\\n\\n\nIf you would like to know more about the Minimal Viable Gaia-X Demonstrator and the data service offerings listed here please contact us via \[email protected] or visit our website [deltaDAO AG](https://delta-dao.com)",
          "tags": ["sphereon-test"],
          "links": [
            {
              "contentLength": "904",
              "contentType": "application/json",
              "url": "https://gx.sphereon.com/.well-known/did.json"
            }
          ],
          "serviceSelfDescription": {
            "raw": {
              "id": "urn:uuid:2062a3f1-d084-4ad4-9e6a-1a190abbf122",
              "type": ["VerifiablePresentation"],
              "@context": ["https://www.w3.org/2018/credentials/v1"],
              "verifiableCredential": [
                {
                  "@context": ["https://www.w3.org/2018/credentials/v1"],
                  "issuer": "did:web:gx.sphereon.com",
                  "id": "urn:uuid:1f755251-05b8-4f30-9c3c-e6f442503f68",
                  "credentialSubject": {
                    "@context": {
                      "cc": "http://creativecommons.org/ns#",
                      "schema": "http://schema.org/",
                      "cred": "https://www.w3.org/2018/credentials#",
                      "void": "http://rdfs.org/ns/void#",
                      "owl": "http://www.w3.org/2002/07/owl#",
                      "xsd": "http://www.w3.org/2001/XMLSchema#",
                      "gax-validation": "http://w3id.org/gaia-x/validation#",
                      "skos": "http://www.w3.org/2004/02/skos/core#",
                      "voaf": "http://purl.org/vocommons/voaf#",
                      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                      "vcard": "http://www.w3.org/2006/vcard/ns#",
                      "gax-core": "http://w3id.org/gaia-x/core#",
                      "dct": "http://purl.org/dc/terms/",
                      "sh": "http://www.w3.org/ns/shacl#",
                      "gax-trust-framework": "http://w3id.org/gaia-x/gax-trust-framework#",
                      "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                      "ids": "https://w3id.org/idsa/core/",
                      "dcat": "http://www.w3.org/ns/dcat#",
                      "vann": "http://purl.org/vocab/vann/",
                      "foaf": "http://xmlns.com/foaf/0.1/",
                      "did": "https://www.w3.org/TR/did-core/#",
                      "adms": "http://www.w3.org/ns/adms#"
                    },
                    "@graph": [
                      {
                        "@id": "_:N2a4f48da451d4602880c4d1cd8fd52b6",
                        "@type": "vcard:Address",
                        "vcard:country-name": "Sweden",
                        "vcard:locality": "Stockholm",
                        "vcard:postal-code": "11436",
                        "vcard:street-address": "Stureg. 14"
                      },
                      {
                        "@id": "https://gx.sphereon.com/datasets/dcat#ds1",
                        "@type": "dcat:Dataset",
                        "adms:contactPoint": {
                          "@id": "https://gx.sphereon.com/contacts/n1"
                        },
                        "dcat:distribution": {
                          "@id": "https://gx.sphereon.com/datasets/dcat#dist1"
                        },
                        "dcat:keyword": ["Nobel prize", "science", "prize"],
                        "dcat:landingPage": {
                          "@id": "https://gx.sphereon.com"
                        },
                        "dcat:theme": {
                          "@id": "http://eurovoc.europa.eu/100142"
                        },
                        "dct:accrualPeriodicity": {
                          "@id": "http://purl.org/cld/freq/daily"
                        },
                        "dct:conformsTo": {
                          "@id": "http://www.nobelprize.org/nobel_organizations/nobelmedia/nobelprize_org/developer/manual-linkeddata/terms.html"
                        },
                        "dct:description": "This dataset contains Nobel prizes, Nobel laureates and information about related media resources. ",
                        "dct:issued": "2014-01-15",
                        "dct:language": {
                          "@id": "http://publications.europa.eu/resource/authority/language/ENG"
                        },
                        "dct:modified": "2014-08-27",
                        "dct:publisher": {
                          "@id": "https://gx.sphereon.com/publisher/n2"
                        },
                        "dct:spatial": {
                          "@id": "http://sws.geonames.org/2673730"
                        },
                        "dct:temporal": {
                          "@id": "http://data.nobelprize.org/period"
                        },
                        "dct:title": {
                          "@language": "en",
                          "@value": "Linked Nobel prizes"
                        }
                      },
                      {
                        "@id": "https://gx.sphereon.com/publisher/n2",
                        "@type": "foaf:Agent",
                        "dct:type": {
                          "@id": "_:Ne69579d666ed410a9c307f188d9ffd21"
                        },
                        "foaf:name": "Nobel Media AB"
                      },
                      {
                        "@id": "https://gx.sphereon.com/publisher/n0",
                        "@type": "foaf:Agent",
                        "dct:type": {
                          "@id": "http://purl.org/adms/publishertype/Company"
                        },
                        "foaf:name": "Nobel Media AB"
                      },
                      {
                        "@id": "_:N43230c0d821748bd881b4a5178ee0e39",
                        "@type": ["vcard:Work", "vcard:Voice"],
                        "vcard:hasValue": {
                          "@id": "tel:086631722"
                        }
                      },
                      {
                        "@id": "_:Ne69579d666ed410a9c307f188d9ffd21",
                        "dcat:keyword": "http://purl.org/adms/publishertype/Company"
                      },
                      {
                        "@id": "http://data.nobelprize.org/period",
                        "@type": "dct:PeriodOfTime",
                        "schema:endDate": {
                          "@type": "xsd:date",
                          "@value": "2024-01-05"
                        },
                        "schema:startDate": {
                          "@type": "xsd:date",
                          "@value": "2022-03-01"
                        }
                      },
                      {
                        "@id": "https://gx.sphereon.com/contacts/n1",
                        "@type": "vcard:VCard",
                        "vcard:fn": "Nobel Media AB",
                        "vcard:hasAddress": {
                          "@id": "_:N2a4f48da451d4602880c4d1cd8fd52b6"
                        },
                        "vcard:hasEmail": {
                          "@id": "mailto:[email protected]"
                        },
                        "vcard:hasTelephone": {
                          "@id": "_:N43230c0d821748bd881b4a5178ee0e39"
                        }
                      },
                      {
                        "@id": "http://sws.geonames.org/2673730",
                        "@type": "dct:Location",
                        "rdfs:label": "Stockholm"
                      }
                    ],
                    "id": "did:web:gx.sphereon.com"
                  },
                  "type": ["VerifiableCredential"],
                  "issuanceDate": "2023-03-13T10:31:11.240Z",
                  "proof": {
                    "type": "JsonWebSignature2020",
                    "created": "2023-03-13T10:31:11Z",
                    "verificationMethod": "did:web:gx.sphereon.com#JWK2020-RSA",
                    "proofPurpose": "assertionMethod",
                    "jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..LberR4v-Bb5xFFEnHLRBkhbm1YYBGTarDiajLGw-0U6VUUSWZ_gH4P8wHTnnqPW0bjrrL3JNoCirLRHwdmDui0IX4_QSpTcMNp-S_ptgr-jKV_Q9EaTimKUS80yA5Io1Lkfg0tzfRFtO627QNNiHXzWLYbBMLCh8KNrjKn6OfONMsmAIch9r0tFbtRjo391cfLl5fm-fjaR5F8RGGwG25p3AjpLOBjcqjXd_g6-FnFFUqIWmnhXzw7-LsI3j8RtxRjkzCAXqlCjibf1GbYdGMQCqPT33jM8ZA3hVjAIuSwRhugsDVDo37XVl1lCfFntNj27YSi2QNdZl5nQVu9MLUA"
                  }
                },
                {
                  "@context": [
                    "https://www.w3.org/2018/credentials/v1",
                    "https://sphereon-opensource.github.io/vc-contexts/fma/gaia-x.jsonld"
                  ],
                  "type": ["VerifiableCredential", "ParticipantCredential"],
                  "id": "https://catalogue.gaia-x.eu/credentials/ParticipantCredential/1678460337962",
                  "issuer": "did:web:cs.gx.test.sphereon.com",
                  "issuanceDate": "2023-03-10T14:58:57.963Z",
                  "credentialSubject": {
                    "id": "did:web:gx.sphereon.com",
                    "hash": "ff28d0d3d53d2d82310b891b58028d8d52e9033771c4bf78cce53e03dd5d3b6c"
                  },
                  "proof": {
                    "type": "JsonWebSignature2020",
                    "created": "2023-03-10T14:58:58.303Z",
                    "proofPurpose": "assertionMethod",
                    "jws": "eyJhbGciOiJQUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..UhJjrgsAD9V56Pa79tVrP3bSB2oZTBBe2Jqqrlw_zwGAlrNvLxlzIsWVZ9lzTxEIMAqUbwiNb5i3QD7RvfzOHt2bPSdbgXNzydIFDWuOxzmzjtRAmfDgccgoF26lHEPUjMkRQzQBVLqGSmZ4UfEfd5maY9SxPW8CE1F1pjOyv97mvs1m_anuYvfau5XgGiq9keXnFI6LNA99K-uqZmvCi-9Cbimw5NLKl4Dp74R0DRswX351FWxH9pTjZIkysw8i_vj0GQmYGpAgP0vMLqp6NuoQNik_SuBlUb2XykiQBD9oSj8W8ffiN9VIynyau1rurFG0QLze8N80Ad5XtwAfDw",
                    "verificationMethod": "did:web:cs.gx.test.sphereon.com#JWK2020-RSA"
                  }
                },
                {
                  "@context": ["https://www.w3.org/2018/credentials/v1"],
                  "issuer": "did:web:gx.sphereon.com",
                  "id": "urn:uuid:bb764704-b019-4694-8554-9665b6c326bb",
                  "credentialSubject": {
                    "@context": {
                      "cc": "http://creativecommons.org/ns#",
                      "schema": "http://schema.org/",
                      "cred": "https://www.w3.org/2018/credentials#",
                      "void": "http://rdfs.org/ns/void#",
                      "owl": "http://www.w3.org/2002/07/owl#",
                      "xsd": "http://www.w3.org/2001/XMLSchema#",
                      "gax-validation": "http://w3id.org/gaia-x/validation#",
                      "skos": "http://www.w3.org/2004/02/skos/core#",
                      "voaf": "http://purl.org/vocommons/voaf#",
                      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
                      "vcard": "http://www.w3.org/2006/vcard/ns#",
                      "gax-core": "http://w3id.org/gaia-x/core#",
                      "dct": "http://purl.org/dc/terms/",
                      "sh": "http://www.w3.org/ns/shacl#",
                      "gax-trust-framework": "http://w3id.org/gaia-x/gax-trust-framework#",
                      "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                      "ids": "https://w3id.org/idsa/core/",
                      "dcat": "http://www.w3.org/ns/dcat#",
                      "vann": "http://purl.org/vocab/vann/",
                      "foaf": "http://xmlns.com/foaf/0.1/",
                      "did": "https://www.w3.org/TR/did-core/#"
                    },
                    "id": "did:web:gx.sphereon.com",
                    "@type": "gax-trust-framework:LegalPerson",
                    "gax-trust-framework:legalName": {
                      "@value": "Sphereon BV",
                      "@type": "xsd:string"
                    },
                    "gax-trust-framework:legalForm": "LLC",
                    "gax-trust-framework:registrationNumber": {
                      "@value": "3232323",
                      "@type": "xsd:string"
                    },
                    "gax-trust-framework:legalAddress": {
                      "@type": "vcard:Address",
                      "vcard:country-name": {
                        "@value": "NL",
                        "@type": "xsd:string"
                      },
                      "vcard:gps": {
                        "@value": "52.1352365,5.0280565",
                        "@type": "xsd:string"
                      },
                      "vcard:street-address": {
                        "@value": "Bisonspoor",
                        "@type": "xsd:string"
                      },
                      "vcard:postal-code": {
                        "@value": "3605LB",
                        "@type": "xsd:string"
                      },
                      "vcard:locality": {
                        "@value": "Maarssen",
                        "@type": "xsd:string"
                      }
                    },
                    "gax-trust-framework:headquarterAddress": {
                      "@type": "vcard:Address",
                      "vcard:country-name": {
                        "@value": "NL",
                        "@type": "xsd:string"
                      },
                      "vcard:gps": {
                        "@value": "52.1352365,5.0280565",
                        "@type": "xsd:string"
                      },
                      "vcard:street-address": {
                        "@value": "Bisonspoor",
                        "@type": "xsd:string"
                      },
                      "vcard:postal-code": {
                        "@value": "3605LB",
                        "@type": "xsd:string"
                      },
                      "vcard:locality": {
                        "@value": "Maarssen",
                        "@type": "xsd:string"
                      }
                    }
                  },
                  "type": ["VerifiableCredential"],
                  "issuanceDate": "2023-03-10T14:58:56.175Z",
                  "proof": {
                    "type": "JsonWebSignature2020",
                    "created": "2023-03-10T14:58:56Z",
                    "verificationMethod": "did:web:gx.sphereon.com#JWK2020-RSA",
                    "proofPurpose": "assertionMethod",
                    "jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MbPBu8IszqDqRX8FU5fiPFiiq6pPa4pwr3RnpfMBTmoflaP-JEM3YbbhzX-jvrcnAia7smaEK5P5vgYgs-u7B1gVMn-Ce8c0m0QMOlQvBzuEuk9BAe9gjlsNat6rG09MpAJWA1duCynFwgB_JPKhutcx2b7IgESsVeLcPqOdi-XVdpgNOovDY0tt745q5bMVMbN-d2W3koVE0igbLw5AW8rLRA7DqoAzpNsB08khfxOjOx_-WTdJZZAv2J0ulLp37x3NTOEN2N789j61Q-Qm3Ft4-YEh0kHx441DNjPPFdPqMvDeZCjG--0a7jzOo2xonPfYYF09iMs5tolZ44Rhvw"
                  }
                }
              ],
              "holder": "did:web:gx.sphereon.com",
              "proof": {
                "type": "JsonWebSignature2020",
                "created": "2023-03-13T10:38:50Z",
                "verificationMethod": "did:web:gx.sphereon.com#JWK2020-RSA",
                "proofPurpose": "authentication",
                "challenge": "2023-03-13",
                "domain": "https://cs.gx.test.sphereon.com",
                "jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..C39sI2p1Oh0aE6IhV5QWpAwwmBERDr3izcGdH8sJ0PK4IInsjaZPl9gn2kLhdHeABa1FHWdVp58JSWCgC8zbYPyYg_3yoeZYTAGb2UtzL0w3304MXoc6Mw5xj6FgIOpLP8Tecad5YM66WXPeD1kbH_3s0QrMoJrBUprR5_j8G34g2eT0oJtFJ2_f8aenOSu3aVKE-n8F2JjfZZ7l7IEdsp-y0QP1Yg80JrHrcqEurKkmGaHwsheFHkB0q5WMf0NzUewzKlqoDagInr9ZKy2uGzYBFuBHGC9ChgvkO67zk8HuN0DmQ5rCVcqX--TDLWahxW6ABx6bwHnEdj-sflrCSg"
              }
            }
          },
          "termsAndConditions": false,
          "consent": {
            "noPersonalData": true
          },
          "compliance": {
            "gx": true
          }
        },
        "encryptedFiles": "0x043bc27bc125bde0c0afc031dd5138f4932543be4b8ab468cbf2b3e8a2dd0fe6bb9463897cfa1b326114fc7e620c8843cd74fbfa5324907a3196189d83b759d68fd24e32426061f585717107fa2358279c943c3c9597730d93971aa608c370a98dfc7270a9dc01083946d23a1c1640a397a473134dc8a19df9bbeb095875bad4c0cce0b9ee6a54b3cd6b90e48fd0ccbfa60311e65152b88715d08272d17dddf3d2c9e67345bc395c5ac714066fa392e346ee4c2653a286a8f24e6f9ddb1677d0c998fb8469697b89c94a9a4ee2afa1c2",
        "curation": {
          "rating": 0,
          "numVotes": 0,
          "isListed": true
        }
      },
      "index": 0
    },
    {
      "type": "access",
      "index": 1,
      "serviceEndpoint": "https://provider.genx.delta-dao.com",
      "attributes": {
        "main": {
          "creator": "0xDa4fc9E82Ac4E44207a1f74137493D3437D80761",
          "datePublished": "2023-03-13T11:51:15Z",
          "cost": "1",
          "name": "dataAssetAccess"
        }
      }
    }
  ],
  "proof": {
    "created": "2023-03-13T11:51:31Z",
    "creator": "0xDa4fc9E82Ac4E44207a1f74137493D3437D80761",
    "type": "AddressHash",
    "signatureValue": "0xdece1b95a6de485384d860e3bb8f5d32105996825bdd3b06a5ba42a3466253de"
  },
  "dataTokenInfo": {
    "address": "0x28e84f7DAE397dE9960fE10921e410B7E1F7FF29",
    "name": "Petulant Narwhal Token",
    "symbol": "PETNAR-29",
    "decimals": 18,
    "cap": 1000
  },
  "updated": "2023-03-13T11:51:42Z",
  "accessWhiteList": [],
  "event": {
    "txid": "0x1f95d9eaafc90c9ed68bdb841b7a19da0ed1875728fc073d89a2b5372de9bd8b",
    "blockNo": 4704841,
    "from": "0xDa4fc9E82Ac4E44207a1f74137493D3437D80761",
    "contract": "0xfA89407778041EF51B9e1aA16Ff85bDf908D17e6",
    "update": false
  },
  "isInPurgatory": "false",
  "chainId": 100
}

This variable was added:

"compliance": {
	"gx": true
}

Due to the changes below, transformPublishFormToMetadata and transformPublishAlgorithmFormToMetadata are now async and the code where the methods are called was updated as well

/src/utils/metadata.ts lines 345 - 350 and 473 - 478

compliance: {
        gx: await verifySelfDescription({
          url: transformedServiceSelfDescription.url,
          rawSD: transformedServiceSelfDescription.raw
        })
      }

/src/components/Page/Publish/index.tsx line 167

const metadata = await transformPublishAlgorithmFormToMetadata(values)

/src/components/Page/Publish/index.tsx line 118

const metadata = await transformPublishFormToMetadata(values)

/src/components/organisms/AssetActions/Edit/DebugEditMetadata.tsx lines 16 - 27

transformPublishFormToMetadata(values, ddo).then((data) =>
      setNewDdo({
        '@context': 'https://w3id.org/did/v1',
        service: [
          {
            index: 0,
            type: 'metadata',
            attributes: { ...data }
          }
        ]
      })
    )

/src/components/pages/Publish/Debug.tsx lines 14 -34

 transformPublishFormToMetadata(values).then((data) =>
      setDdo({
        '@context': 'https://w3id.org/did/v1',
        dataTokenInfo: {
          ...values.dataTokenOptions
        },
        service: [
          {
            index: 0,
            type: 'metadata',
            attributes: { ...data }
          },
          {
            index: 1,
            type: values.access,
            serviceEndpoint: values.providerUri,
            attributes: {}
          }
        ]
      })
    )

Legal Name:

We are using the legal name (comes from the VP) instead of the eth addresses in the catalogue and profile;

/src/utils/metadata.ts lines 485 - 497

export function getLegalName(ddo: DDO): string {
  const { attributes } = ddo.findServiceByType(
    "metadata"
  ) as ServiceMetadataMarket;
  const sd = attributes.additionalInformation?.serviceSelfDescription;
  if (sd?.raw) {
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    return (sd.raw as IVerifiablePresentation).verifiableCredential[2]
      .credentialSubject["gax-trust-framework:legalName"]["@value"];
  }
  return ddo?.publicKey[0].owner;
}

/src/components/organisms/AssetContent/MetaFull.tsx lines 22 - 29

<Publisher
            account={ddo?.publicKey[0].owner}
            verifiedServiceProviderName={
              isServiceSelfDescriptionVerified
                ? legalName
                : `${legalName} (unverified)`
            }
          />

/src/components/organisms/AssetContent/MetaMain.tsx lines 66 - 73

<Publisher
  account={owner}
  verifiedServiceProviderName={
    isServiceSelfDescriptionVerified ? legalName : `${legalName} (unverified)`
  }
/>

/src/components/molecules/AssetTeaser.tsx lines 50 -57

<Publisher
  account={owner}
  verifiedServiceProviderName={
    isCompliant ? legalName : `${legalName} (unverified)`
  }
  minimal
  className={styles.publisher}
/>

/src/components/pages/Profile/Header/Account.tsx lines 19 - 26

const [legalName, setLegalName] = useState('')

  useEffect(() => {
    if (assets) {
      const ddo = assets.find((ddo) => getLegalName(ddo))
      setLegalName(getLegalName(ddo))
    }
  }, [assets])

zoemaas and others added 30 commits January 17, 2023 14:16
…h results in the Federated Catalog

   Added SD compliance filter;
…h results in the Federated Catalog

   - Refactored of the filter;
   - Added button to UI;
   - Added author/owner switch at asset list level;
   - Added author/owner switch at asset level;
…h results in the Federated Catalog

   - Changed the filter button text;
   - Added ellipsis to the name if greater than 25 chars;
…tal-rws into feature/FMA-26/owner_author_switch
   - Fixed docker image issues;
   - Created deployment configuration;
   - Changed isInCompliance to compliance.gx;
   - Changed undefined to verifiedServiceProviderName;
   - Fixed the total amount issue;
   - Added maxLength to nameTruncate function;
   - Changed raw to rawSD in verifySelfDescription function;
…itch' into feature/Sphereon_changes

# Conflicts:
#	app.config.js
…orrect URLs used to access acquarius and CS. Added name resolution for non GX datasets, adding (unverified)
…portal

   - Fixed infinite loop in publish page;
   - Fixed the provider service request;
   - Fixed undefined when checking whether the vp is compliant;
…-rws into feature/FMA-47/vp-support

# Conflicts:
#	app.config.js
#	k8s/gx-portal-deployment.yaml
#	src/components/molecules/AssetTeaser.tsx
#	src/components/molecules/FormFields/ServiceSelfDescription.tsx
#	src/utils/metadata.ts
#	src/utils/subgraph.ts
…portal

   - Fixed the bug handling Vps during SO creation;
…portal

   - Fixed the bug filtering compliant VPs in profile;
…portal

   - Fixed bug with compliance verification of raw sd;
zoemaas and others added 8 commits March 7, 2023 16:23
…portal

   - Added configuration of multiple wallets;
   - Fixed the profile filter;
   - Fixed label problems;
…portal

   - Refactored legal name retrieval code;
   - Moved the Self-Description to the bottom of the page;
   - Made the Self-Description expandable;
   - Added the legal name to the profile page;
   - Made the show always show up instead of eth address;
   - Added the legal name to the profile page;
   - Made the show always show up instead of eth address;
…portal

   - Removed Kubernetes deployment files;
@netlify
Copy link

netlify bot commented Mar 17, 2023

Deploy Preview for portal-rws-deltadao ready!

Name Link
🔨 Latest commit 2d91438
🔍 Latest deploy log https://app.netlify.com/sites/portal-rws-deltadao/deploys/64149c2a496f7300082d5be5
😎 Deploy Preview https://deploy-preview-45--portal-rws-deltadao.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants