Profiles
Profiles serve as blueprints for wallets, determining the "type" of wallet to be created. They specify the DID method of the identifier associated with the wallet, as well as the templates for the credentials that should be included in the wallet.
Create
To create a profile, the following endpoint can be used:
POST: {{host}}/profiles
DATA:
{
"name": "<string - name of the profile>",
"version": "<string (number:number:number) - version of the profile>",
"tags": "<array - tags to be added to the profile. Tags are used to define the type of the profile and also for filtering or searching for profiles>",
"templateIds": "<array - an array of template IDs (UUID) - defines what credentials a wallet should contains>",
"identifierMethod": "<string - did method of the wallet identifier>",
"displayConfig": "<object - configuration for the display of the wallet>",
}
- The tuple
name
andversion
is unique and can be used at a later point to retrieve a profile. displayConfig
defines the the cofiguration to display the credentials of a wallet in a UI - it is currently only supported for dpp wallets.
For profiles, tags a more important role than for the templates: in addition to filtering and searching for profiles, they also define the type of the wallet to be created. There are special tags that can be added to the profile:
“organization”
: when a profile is marked with this tag, the created wallet will then be defined as organization wallet. Only one organization wallet is allowed per organization. The organization wallet profile has to contain the type of the organization as well:“oem”
,“supplier”
,“issuer”
. An organization wallet can be used to issue, request and present credentials.“dpp”
: represents a DPP, containing all the credentials tied to a product and a DID to identify it. An organization can have multiple DPP wallets. A DPP wallet cannot issue or request credentials and can only receive and store credentials from the organization wallet. The DPP handles incoming verification request automatically.
Overview of the relationships between all the components
Update
To update a profiles, the following endpoint can be used:
PUT: {{host}}/profiles/{{tprofiles_id}}
DATA: {{same as the create entpoint - all request attributes are optional}}
DisplayConfig
The customized DPP UI supports different UI Components which can be used to be displayed by the UI. These are defined on profile level profile.displayConfig
. To use these components, you need to associate the display
value to the specific template. Additionally, a few components require the credential values in a specific format and also require specific credential keys to be created.
Tabs
Tabs are groupings for sections. They appear at the top of the page:
Tabs are defined as array in profile.displayConfig
:
{
"displayConfig": {
"tabs": [
{
"title": "General Information",
"sections": [ ... ]
}
}
Sections
Sections are a grouping of datapoints displayed according to a certain type: tiles, tables, pie-charts etc. They are defined under tabs:
"sections": [
{
"title": "Basic Information",
"template": "catena-x-battery-dpp",
"display": "tiles",
"properties": [
{
"path": "$.batteryIdentification.batteryIDDMCCode",
"displayName": "Battery ID/DMC Code",
"unit": ""
},
]
}
]
- Title: title of the section
- Template: template of the credential from which the data in the section comes from
- Display: section display types are explained in the following sections
- Properties: an array of properties that defines every element in the section
Tiles
A sections with the tiles
display component is a basic component which displays the values of the credentials according to the following config:
{
"title": "Basic Information",
"template": "catena-x-battery-dpp",
"display": "tiles",
"properties": [
{
"path": "$.batteryIdentification.batteryIDDMCCode",
"displayName": "Battery ID/DMC Code",
"unit": ""
},
}
Each tile will represent an Attribute
of the template which will be rendered according to the following properties:
- displayName: as the tile header
- path: json path to find the value in the credentialSubject
- (optional) unit which will be put after the credential value
Table
A sections with the table
display type is a component is used to display an array of json objects as table:
{
"title": "Component Suppliers",
"template": "catena-x-battery-dpp",
"display": "table",
"properties": [
{
"path": "$.composition.components.componentsSupplier[*].componentsSupplierName",
"displayName": "Supplier Name"
},
{
"path": "$.composition.components.componentsSupplier[*].componentsSupplierType",
"displayName": "Supplier type"
},
]
}
Every Element in the properties
array represents a column
- displayName: is the column name
- path: is the json path to the value inside the array ****in the credential - the referenced value SHOULD be in a json array
Pie-chart
A sections with the pie-chart
component will display the credential attached values as a rendered pie chart where you can define the categories and percentages.
{
"title": "Electrolyte Composition",
"template": "catena-x-battery-dpp",
"display": "pie-chart",
"properties": [
{
"percentage": "$.cellChemistry.electrolyteComposition[*].materialPercentageMassFraction",
"name": "$.cellChemistry.electrolyteComposition[*].materialName"
}
]
}
Every Element in the properties
array represents a chart.
- percentage: json path to find the value in the credentialSubject representing a percentage - should reference an array
- name: json path to find the value in the credentialSubject representing the name to which the percentage value refers to - should reference an array
List
A sections with the list
display is like the tiles display but displays the values of the credential as a list like component
{
"title": "Electrochemical Properties",
"template": "catena-x-battery-dpp",
"display": "list",
"properties": [
{
"path": "$.electrochemicalProperties.ratedCapacity",
"displayName": "Rated Capacity",
"unit": "Ah"
},
{
"path": "$.electrochemicalProperties.batteryEnergy.energyRoundtripEfficiencyChange",
"displayName": "Energy Roundtrip Efficiency Change",
"unit": "%"
},
]
}
Each tile will represent an Attribute
of the template which will be rendered according to the following properties:
- displayName: as the key
- path: json path to find the value in the credentialSubject
- (optional) unit which will be put after the credential value
Files
A sections with the files
display component can display a list of file download links. You can create multiple credentials of the same template, each credential will be rendered as a list of download links
{
"title": "Battery materials",
"display": "file",
"template": "battery-dpp",
"properties": [
{
"date": "$.materialFiles[*].uploadDate",
"link": "$.materialFiles[*].fileUrl",
"size": "$.materialFiles[*].fileSize",
"title": "$.materialFiles[*].fileName"
}
]
}
Each tile will represent an Attribute
of the template which will be rendered according to the following properties - the designated attributes can be an array of files or a single file:
- date: upload dat
- link: file location
- size: file size
- title: file title
Rating
The rating data component is a very specific component which can display greenhouse gas score, due diligence score and the esg score as 3 major tile components with a “scoring” indicator
The headers of the tiles will be used as the attribute displayNames. To display that component your template and credential MUST have the following attributes:
- greenhouseGasScore
- dueDiligenceScore
- esgScore
The credential values will look like the following:
{
"greenhouseGasScore": "1806.87",
"dueDiligenceScore": "62",
"esgScore": "83"
}
To use the rating-data
component for the credential attach the following structure to the sections
array