Attributes
Attribute, specifically its type, is used to control different behaviour of the content and values in the platform. Some attributes define the data that are exchanged between technologies, some of them may represent read-only information, and some of them may contain additional attributes that are grouped together or work as a wizard.
Attribute properties
The following is a list of properties that can be used to define the behaviour of the Attribute and extends properties of the BaseAttribute:
| Property | Type | Required |
|---|---|---|
contentType | AttributeContentType | Yes |
constraints | list of BaseAttributeConstraint | No |
properties | AttributeProperties | Yes |
attributeCallback | AttributeCallback | No |
Attribute Types
Based on the usage and specific behaviour you want to provide, Attribute can be one of the following defined types in AttributeType:
AttributeType | Class v2 | Class v3 | Short description |
|---|---|---|---|
DATA | DataAttributeV2 | DataAttributeV3 | Full fledged data carriers used in the platform for information exchange |
INFO | InfoAttributeV2 | InfoAttributeV3 | Information carriers whose primary responsibility is to provide additional helper information. The content of this attribute is not sent back to the platform, it is just informative |
GROUP | GroupAttributeV2 | GroupAttributeV3 | Advanced type of attribute that can group multiple attributes. Main use is when the attributes are dependent on the content selected from other attributes |
META | MetadataAttributeV2 | MetadataAttributeV3 | Metadata representation that can be exchanged between the platform and connectors |
CUSTOM | CustomAttributeV2 | CustomAttributeV3 | User defined attributes for storing additional information about the objects supported in the platform |
Attribute properties and types
The following matrix shows which Attribute properties are supported for each Attribute type (here, the version is omitted for simplicity, but the same applies for both v2 and v3):
| Property name / Attribute type | DataAttribute | InfoAttribute | GroupAttribute | MetadataAttribute | CustomAttribute |
|---|---|---|---|---|---|
contentType | |||||
constraints | |||||
properties | |||||
attributeCallback |
- - the property is required
- - the property is optional
- - the property is not applicable
Attribute structure samples
V2 attributes are deprecated. New connector implementations should use V3. V2 samples are provided for reference when maintaining existing connectors.
The following samples show how the Attribute can be defined in the platform for different types:
- DATA v2
- DATA v3
- INFO v2
- INFO v3
- GROUP v2
- GROUP v3
- META v2
- META v3
- CUSTOM v2
- CUSTOM v3
- RESOURCE OBJECT (v3)
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "certificateTemplate",
"type": "data",
"version": 2,
"contentType": "string",
"content": [
{
"reference": "Template 1",
"data": "template1"
},
{
"reference": "Template 2",
"data": "template2"
},
{
"reference": "Template 3",
"data": "template3"
}
],
"properties": {
"label": "Certificate Template",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": true,
"group": "Certificate Configuration"
},
"description": "Available certificate templates that can be selected for the certificate request",
"constraints": [
{
"description": "Certificate Template Regex",
"errorMessage": "Certificate Template must be a valid string",
"type": "regexp",
"data": "^[a-z\\s]{0,255}"
}
]
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "certificateTemplate",
"type": "data",
"version": 3,
"schemaVersion": "v3",
"contentType": "string",
"content": [
{
"reference": "Template 1",
"data": "template1",
"contentType": "string"
},
{
"reference": "Template 2",
"data": "template2",
"contentType": "string"
},
{
"reference": "Template 3",
"data": "template3",
"contentType": "string"
}
],
"properties": {
"label": "Certificate Template",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": true,
"group": "Certificate Configuration"
},
"description": "Available certificate templates that can be selected for the certificate request",
"constraints": [
{
"description": "Certificate Template Regex",
"errorMessage": "Certificate Template must be a valid string",
"type": "regexp",
"data": "^[a-z\\s]{0,255}"
}
]
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "certificateTemplate",
"type": "info",
"version": 2,
"contentType": "string",
"content": [
{
"reference": "Template 1",
"data": "template1"
}
],
"properties": {
"label": "Certificate Template",
"readOnly": false,
"visible": true,
"group": "Certificate Configuration"
},
"description": "Available certificate templates that can be selected for the certificate request"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "certificateTemplate",
"type": "info",
"version": 3,
"schemaVersion": "v3",
"contentType": "string",
"content": [
{
"reference": "Template 1",
"data": "template1",
"contentType": "string"
}
],
"properties": {
"label": "Certificate Template",
"readOnly": false,
"visible": true,
"group": "Certificate Configuration"
},
"description": "Available certificate templates that can be selected for the certificate request"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "group1",
"type": "group",
"version": 2,
"content": [
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "certificateTemplate",
"type": "data",
"version": 2,
"contentType": "string",
"content": [
{
"reference": "Template 1",
"data": "template1"
},
{
"reference": "Template 2",
"data": "template2"
},
{
"reference": "Template 3",
"data": "template3"
}
],
"properties": {
"label": "Certificate Template",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": true,
"group": "Certificate Configuration"
},
"description": "Available certificate templates that can be selected for the certificate request",
"constraints": [
{
"description": "Certificate Template Regex",
"errorMessage": "Certificate Template must be a valid string",
"type": "regexp",
"data": "^[a-z\\s]{0,255}"
}
]
}
],
"description": "Available certificate templates that can be selected for the certificate request"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "group1",
"type": "group",
"version": 3,
"schemaVersion": "v3",
"content": [
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "certificateTemplate",
"type": "data",
"version": 3,
"schemaVersion": "v3",
"contentType": "string",
"content": [
{
"reference": "Template 1",
"data": "template1",
"contentType": "string"
},
{
"reference": "Template 2",
"data": "template2",
"contentType": "string"
},
{
"reference": "Template 3",
"data": "template3",
"contentType": "string"
}
],
"properties": {
"label": "Certificate Template",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": true,
"group": "Certificate Configuration"
},
"description": "Available certificate templates that can be selected for the certificate request",
"constraints": [
{
"description": "Certificate Template Regex",
"errorMessage": "Certificate Template must be a valid string",
"type": "regexp",
"data": "^[a-z\\s]{0,255}"
}
]
}
],
"description": "Available certificate templates that can be selected for the certificate request"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "discoverySource",
"type": "meta",
"version": 2,
"contentType": "string",
"content": [
{
"reference": "Internet",
"data": "internet.com"
}
],
"properties": {
"label": "Discovery Source",
"readOnly": false,
"visible": true,
"global": true,
"group": "Discovery"
},
"description": "Source from where the certificate is discovered"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "discoverySource",
"type": "meta",
"version": 3,
"schemaVersion": "v3",
"contentType": "string",
"content": [
{
"reference": "Internet",
"data": "internet.com",
"contentType": "string"
}
],
"properties": {
"label": "Discovery Source",
"readOnly": false,
"visible": true,
"global": true,
"group": "Discovery"
},
"description": "Source from where the certificate is discovered"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "purpose",
"type": "custom",
"version": 2,
"contentType": "string",
"content": [
{
"reference": "",
"data": "Created to test the custom attribute"
}
],
"properties": {
"label": "Purpose",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": true,
"group": "Certificate Configuration"
},
"description": "Sample description for the custom attribute"
}
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "purpose",
"type": "custom",
"version": 3,
"schemaVersion": "v3",
"contentType": "string",
"content": [
{
"reference": "",
"data": "Created to test the custom attribute",
"contentType": "string"
}
],
"properties": {
"label": "Purpose",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": true,
"group": "Certificate Configuration"
},
"description": "Sample description for the custom attribute"
}
RESOURCE OBJECT is available only in V3 attributes. It replaces the V2-only SECRET and CREDENTIAL content types.
{
"uuid": "c7a8f8f0-f8f8-4f8f-8f8f-f8f8f8f8f8f8",
"name": "credentialAttribute",
"type": "data",
"version": 3,
"schemaVersion": "v3",
"contentType": "resource",
"content": [
{
"reference": "My Credential",
"data": {
"uuid": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"name": "My Credential",
"resource": "credentials"
},
"contentType": "resource"
}
],
"properties": {
"label": "Credential",
"required": true,
"readOnly": false,
"visible": true,
"list": true,
"multiSelect": false,
"group": "Authentication",
"resource": "credentials"
},
"description": "Select a credential to use"
}
The following diagram represents the Attribute model inherited from the AbstractBaseAttribute. Details can be found in the CZERTAINLY Interfaces repository.