Git Product home page Git Product logo

Comments (1)

loneil avatar loneil commented on June 1, 2024

From @usingtechnology on JIRA

A Tenant may need a public DID for connections, and in our case, needs it for issuance.

Tenant UI will have to coordinate a series of calls, the logic in acapy exists in the routes, not in services, so API must be called.

Basic flow is:

create local did for wallet
oob register the did on the ledger
create public did
Step 2 is a custom endpoint in innkeeper plugin.

Example
POST /wallet/did/create

curl -X 'POST' \
  'http://localhost:8032/wallet/did/create' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3YWxsZXRfaWQiOiI1MGY5NmI2MS00MzE5LTQ1ZTgtOGVlYS03MmI4NGQ4MWRjYmIiLCJpYXQiOjE2NzM2NDA5MTcsImV4cCI6MTY3MzcyNzMxN30.LSmonQOh-oaQP9lxPwqSRGqmto2fLfLOaYn4OwJriIs' \
  -H 'Content-Type: application/json' \
  -d '{
  "method": "sov",
  "options": {
    "key_type": "ed25519"
  }
}'
{
  "result": {
    "did": "4M6nhNokXJDKxQTeFZvd1R",
    "verkey": "2pnssLSL1rzFGS5YTcbMCJ34UDTot9HTnVswANNxN3RQ",
    "posture": "wallet_only",
    "key_type": "ed25519",
    "method": "sov"
  }
}

will need the did and verkey.

POST /tenant/register-public-did
alias is agent name/wallet name (optional).
this is a custom endpoint to do out of band registration

curl -X 'POST' \
  'http://localhost:8032/tenant/register-public-did?did=4M6nhNokXJDKxQTeFZvd1R&verkey=2pnssLSL1rzFGS5YTcbMCJ34UDTot9HTnVswANNxN3RQ&alias=abcd123' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3YWxsZXRfaWQiOiI1MGY5NmI2MS00MzE5LTQ1ZTgtOGVlYS03MmI4NGQ4MWRjYmIiLCJpYXQiOjE2NzM2NDA5MTcsImV4cCI6MTY3MzcyNzMxN30.LSmonQOh-oaQP9lxPwqSRGqmto2fLfLOaYn4OwJriIs' \
  -d ''

POST /wallet/did/public

{
  "txn": {
    "connection_id": "15ce5a4c-da3c-4379-8f41-05d611d6c949",
    "messages_attach": [
      {
        "@id": "5526cc62-ea8c-44a7-bbe2-264e10e5d4e9",
        "mime-type": "application/json",
        "data": {
          "json": {
            "endorser": "SVfHGCEEvEFmpBPcxgNqRR",
            "identifier": "4M6nhNokXJDKxQTeFZvd1R",
            "operation": {
              "dest": "4M6nhNokXJDKxQTeFZvd1R",
              "raw": "{\"endpoint\":{\"endpoint\":\"https://d076-207-6-152-178.ngrok.io\",\"routingKeys\":[]}}",
              "type": "100"
            },
            "protocolVersion": 2,
            "reqId": 1673641428388431400,
            "signature": "2Zsd6Na9zz36b1Dhy19YRu6QbcT5fYikc4u9sjEtjnDJvgWSGdRngSDveC13gutRFo32rfUxsvJ8QrZQa8Ad2YFq"
          }
        }
      }
    ],
    "timing": {
      "expires_time": null
    },
    "created_at": "2023-01-13T20:23:48.415321Z",
    "signature_response": [],
    "meta_data": {
      "context": {},
      "processing": {}
    },
    "_type": "http://didcomm.org/sign-attachment/%VER/signature-request",
    "state": "request_sent",
    "signature_request": [
      {
        "context": "did:sov",
        "method": "add-signature",
        "signature_type": "<requested signature type>",
        "signer_goal_code": "aries.transaction.endorse",
        "author_goal_code": "aries.transaction.ledger.write"
      }
    ],
    "formats": [
      {
        "attach_id": "5526cc62-ea8c-44a7-bbe2-264e10e5d4e9",
        "format": "dif/endorse-transaction/[email protected]"
      }
    ],
    "transaction_id": "0171f076-764c-4cfe-baa8-9f9498b26b06",
    "trace": false,
    "updated_at": "2023-01-13T20:23:48.425043Z"
  }
}

GET /wallet/did/public

curl -X 'GET' \
  'http://localhost:8032/wallet/did/public' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3YWxsZXRfaWQiOiI1MGY5NmI2MS00MzE5LTQ1ZTgtOGVlYS03MmI4NGQ4MWRjYmIiLCJpYXQiOjE2NzM2NDA5MTcsImV4cCI6MTY3MzcyNzMxN30.LSmonQOh-oaQP9lxPwqSRGqmto2fLfLOaYn4OwJriIs'
{
  "result": {
    "did": "4M6nhNokXJDKxQTeFZvd1R",
    "verkey": "2pnssLSL1rzFGS5YTcbMCJ34UDTot9HTnVswANNxN3RQ",
    "posture": "posted",
    "key_type": "ed25519",
    "method": "sov"
  }
}

from traction.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.