decentralized-identity / wallet-rendering

Specifications for rendering DID and Credential-centric data in wallet applications
https://identity.foundation/wallet-rendering
Apache License 2.0
8 stars 2 forks source link

Display Mapping Object - Schema Type for Images #7

Closed sudeshrshetty closed 2 years ago

sudeshrshetty commented 2 years ago

I noticed that Schema types in Display Mapping Object are missing image formats which can potentially be part of a given verifiable credential.

For Example: image of card holder in Citizenship Vocabulary which can also contain ImageObject.

I would like to introduce binaries as one of the schema formats which can help an application previewing credential to handle them differently.

We can support generic binary data with formats containing MIME types or just image MIME types Registration at IANA.

Example:

Credential Display object

"schema": {
          "type": "string",
          "format": "image/png"
        }

sample credential containing png image binary

.
.
"credentialSubject": {
    "id": "did:example:b34ca6cd37bbf23",
    "type": [
      "PermanentResident",
      "Person"
    ],
    "givenName": "JOHN",
    "familyName": "SMITH",
    "gender": "Male",
    "image": "data:image/png;base64,iVBORw0KG...................................",
    "residentSince": "2015-01-01",
    "lprCategory": "C09",
    "lprNumber": "999-999-999",
    "commuterClassification": "C1",
    "birthCountry": "Bahamas",
    "birthDate": "1958-07-17"
  }
  .
  .
sudeshrshetty commented 2 years ago

or I am open to introduce new schema type called binary or data with support for various MIME types

JaceHensley commented 2 years ago

Hey! This actually came up in the previous WG call. There was also an ask to be able to display PDFs

sudeshrshetty commented 2 years ago

@JaceHensley that's great, let me know if someone else working on the same or if I can create a pull request to update the list of schema types and formats in the spec.

JaceHensley commented 2 years ago

Actually I think this issue should be moved over to the Wallet Rendering spec (originally a part of the CM spec here), transferring it over now :)

bumblefudge commented 2 years ago

Discussed on today's call. A third option would be to lean on JSON Schema's non-JSON data handling, which puts the whole binary blob into the value and describes the type on the schema level (see examples)

bumblefudge commented 2 years ago

^ This doesn't have to exclude a URI-based possibility; after WR has a stable version published, we can return to this with a concrete PR

JaceHensley commented 2 years ago

We talk about this in the "DIF CC Credential Manifest + Presentation Exchange Weekly (C&C WG)" every Thursday at 10:00am PT on the DIF Calendar

sudeshrshetty commented 2 years ago

thanks @JaceHensley