The following features are only available in LAB environment. Eventually, these features will be available in PROD environment.

User roles and quotas

User roles are used to determine who can create new users. Quotas are used to limit the use of TrustOS by the users and are reset to the initial value yearly. The amount of credits available in the quota diminish as the user request changes in the state of the Blockchain. These operations are:

  • Create a certificate
  • Revoke a certificate
  • Register a certificate in another Blockchain
  • Qualify sign a certificate
  • Create an asset
  • Update an asset
  • Deploy token
  • Mint token
  • Transfer token
  • Burn token

The available user roles are:

  • Manager: Can create standard users. Has his own quota.
  • Standard: Cannot create users. His quota is shared with the manager who created him.

User creation

In order to create a new user, the following endpoint is available:

  curl -X 'POST' \
    'http://lab.trustos.telefonicatech.com/id/v2/users' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer <token>' \
    -H 'Content-Type: application/json' \
    -d '{
    "email": "john@john.com",
    "password": "password"
  }'

The parameters are:

  • email: The email of the user to be created.
  • password: The password of the user to be created.

A successful call to this endpoint will return the following response:

  {
    "statusCode": 201,
    "message": "User created",
    "data": {
      "username": "did:user:<id>",
      "address": "0x5C8213601a23a99FD6D2349d0104Eb13aAB1696E"
    }
  }

The fields are:

  • statusCode: Request status code.
  • message: Message returned by the request.
  • data: Data returned by the request.
    • username: The user’s did.
    • address: The Ethereum address of the user.