dfinity / wg-identity-authentication

Repository of the Identity and Wallet Standards Working Group
https://wiki.internetcomputer.org/wiki/Identity_%26_Authentication
Apache License 2.0
26 stars 8 forks source link

Update icrc25_supported_standards response with more detail #183

Closed dostro closed 1 month ago

dostro commented 1 month ago

Problem

After a user selects a signer, Identity Kit doesn't know whether to display the signer's UI or not. For example:

Additionally, there are some standards that contain multiple methods whose interactivity would need to be more fully detailed.

Solution

The proposal is to add an "interactive" label and boolean value for the icrc25_supported_standards response and store this configuration in Identity Kit memory, and add a "methods" key with array of objects.

Request:

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "icrc25_supported_standards"
}

Response:

// Sample response from NFID Wallet
{
   "origin":"https://dev.identity-kit.nfid.one/",
   "jsonrpc":"2.0",
   "id":"8ed50aa2-7e21-46d8-8a4b-80a3520cceb2",
   "result":{
      "supportedStandards":[
         {
            "name":"ICRC-25",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-25/ICRC-25.md",
            "methods":[
               {
                  "name":"icrc25_request_permissions",
                  "isInteractive":false
               },
               {
                  "name":"icrc25_revoke_permissions",
                  "isInteractive":false
               },
               {
                  "name":"icrc25_granted_permissions",
                  "isInteractive":false
               },
               {
                  "name":"icrc25_supported_standards",
                  "isInteractive":false
               }
            ]
         },
         {
            "name":"ICRC-27",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-27/ICRC-27.md",
            "methods":[
               {
                  "name":"icrc27_get_accounts",
                  "isInteractive":true
               }
            ]
         },
         {
            "name":"ICRC-28",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-28/ICRC-28.md",
            "methods":[
            ]
         },
         {
            "name":"ICRC-29",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-29/ICRC-29.md",
            "methods":[
               {
                  "name":"icrc29_status",
                  "isInteractive":false
               }
            ]
         },
         {
            "name":"ICRC-34",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-34/ICRC-34.md",
            "methods":[
               {
                  "name":"icrc34_get_delegation",
                  "isInteractive":true
               }
            ]
         }
      ]
   }
}

// Sample response from Oisy
{
   "origin":"https://dev.identity-kit.nfid.one/",
   "jsonrpc":"2.0",
   "id":"8ed50aa2-7e21-46d8-8a4b-80a3520cceb2",
   "result":{
      "supportedStandards":[
         {
            "name":"ICRC-25",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-25/ICRC-25.md",
            "methods":[
               {
                  "name":"icrc25_request_permissions",
                  "isInteractive":true
               },
               {
                  "name":"icrc25_revoke_permissions",
                  "isInteractive":false
               },
               {
                  "name":"icrc25_granted_permissions",
                  "isInteractive":false
               },
               {
                  "name":"icrc25_supported_standards",
                  "isInteractive":false
               }
            ]
         },
         {
            "name":"ICRC-27",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-27/ICRC-27.md",
            "methods":[
               {
                  "name":"icrc27_get_accounts",
                  "isInteractive":false
               }
            ]
         },
         {
            "name":"ICRC-29",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-29/ICRC-29.md",
            "methods":[
               {
                  "name":"icrc29_status",
                  "isInteractive":false
               }
            ]
         },
         {
            "name":"ICRC-34",
            "url":"https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-34/ICRC-34.md",
            "methods":[
               {
                  "name":"icrc34_get_delegation",
                  "isInteractive":false
               }
            ]
         }
      ]
   }
}