Skip to content

Commit

Permalink
Add postman collection for access rule management.
Browse files Browse the repository at this point in the history
Adjust default wildcard types
  • Loading branch information
tunacicek committed Feb 22, 2024
1 parent e778924 commit 8a4aeb6
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/registry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ registry:
idpClientId: default-client
tenantId: default-tenant
externalSubjectIdWildcardPrefix: PUBLIC_READABLE
externalSubjectIdWildcardAllowedTypes: manufacturerPartId,assetLifecyclePhase
externalSubjectIdWildcardAllowedTypes: manufacturerPartId,digitalTwinType
useGranularAccessControl: "false"
service:
port: 8080
Expand Down
4 changes: 4 additions & 0 deletions docs/development/postman/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# DTR Postman Collection

## Postman
### DTR Postman Collection:
The postman collection can be used to call all provided APIs of the DTR.

### Access rule management Postman Collection:
The postman collection can be used to call all provided APIs of the access rule management.

### Setup Postman

To install postman, download the newest version:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"info": {
"_postman_id": "47f1eefc-bd84-4c6b-9c30-2ff696b1dde0",
"name": "tractusx-dtr-access-rule-management-api-v1.0 Copy",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "get Rules",
"request": {
"method": "GET",
"header": [],
"url": "{{baseUrl}}/api/v3.0/access-controls/rules"
},
"response": []
},
{
"name": "create Rule",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"validFrom\": \"2020-01-02T03:04:05Z\",\n \"validTo\": \"4999-01-02T03:04:05Z\",\n \"description\": \"ACME policy within set validity period\",\n \"policyType\": \"AAS\",\n \"policy\": {\n \"accessRules\": [\n {\n \"attribute\": \"bpn\",\n \"operator\": \"eq\",\n \"value\": \"BPNL00000000000A\"\n },\n {\n \"attribute\": \"mandatorySpecificAssetIds\",\n \"operator\": \"includes\",\n \"values\": [\n {\n \"attribute\": \"manufacturerPartId\",\n \"operator\": \"eq\",\n \"value\": \"99991\"\n },\n {\n \"attribute\": \"customerPartId\",\n \"operator\": \"eq\",\n \"value\": \"ACME001\"\n }\n ]\n },\n {\n \"attribute\": \"visibleSpecificAssetIdNames\",\n \"operator\": \"includes\",\n \"values\": [\n {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"manufacturerPartId\"\n },\n {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"customerPartId\"\n },\n {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"partInstanceId\"\n }\n ]\n },\n {\n \"attribute\": \"visibleSemanticIds\",\n \"operator\": \"includes\",\n \"values\": [\n {\n \"attribute\": \"modelUrn\",\n \"operator\": \"eq\",\n \"value\": \"urn:samm:net.catenax.vehicle.submodel_external1:1.0.0#Pcf\"\n }\n ]\n }\n ]\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{baseUrl}}/api/v3.0/access-controls/rules"
},
"response": []
},
{
"name": "get Rule by ruleId",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/api/v3.0/access-controls/rules/:ruleId",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v3.0",
"access-controls",
"rules",
":ruleId"
],
"variable": [
{
"key": "ruleId",
"value": ""
}
]
}
},
"response": []
},
{
"name": "update Rule by ruleId",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"id\": 1,\n \"tid\": \"00000000-1111-2222-3333-444444444444\",\n \"policyType\": \"AAS\",\n \"policy\": {\n \"accessRules\": [\n {\n \"attribute\": \"bpn\",\n \"operator\": \"eq\",\n \"value\": \"BPNL00000000000A\"\n },\n {\n \"attribute\": \"mandatorySpecificAssetIds\",\n \"operator\": \"includes\",\n \"values\": [\n {\n \"attribute\": \"manufacturerPartId\",\n \"operator\": \"eq\",\n \"value\": \"99991\"\n },\n {\n \"attribute\": \"customerPartId\",\n \"operator\": \"eq\",\n \"value\": \"ACME001\"\n }\n ]\n },\n {\n \"attribute\": \"visibleSpecificAssetIdNames\",\n \"operator\": \"includes\",\n \"values\": [\n {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"manufacturerPartId\"\n },\n {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"customerPartId\"\n },\n {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"partInstanceId\"\n }\n ]\n },\n {\n \"attribute\": \"visibleSemanticIds\",\n \"operator\": \"includes\",\n \"values\": [\n {\n \"attribute\": \"modelUrn\",\n \"operator\": \"eq\",\n \"value\": \"Traceabilityv1.1.0\"\n },\n {\n \"attribute\": \"modelUrn\",\n \"operator\": \"eq\",\n \"value\": \"ProductCarbonFootprintv1.1.0\"\n }\n ]\n }\n ]\n },\n \"description\": \"Access rule description.\",\n \"validFrom\": \"2024-01-02T03:04:05Z\",\n \"validTo\": \"2024-06-07T08:09:10Z\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/api/v3.0/access-controls/rules/:ruleId",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v3.0",
"access-controls",
"rules",
":ruleId"
],
"variable": [
{
"key": "ruleId",
"value": ""
}
]
}
},
"response": []
},
{
"name": "delete rule by ruleId",
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "{{baseUrl}}/api/v3.0/access-controls/rules/:ruleId",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v3.0",
"access-controls",
"rules",
":ruleId"
],
"variable": [
{
"key": "ruleId",
"value": ""
}
]
}
},
"response": []
}
],
"auth": {
"type": "oauth2",
"oauth2": {
"clientSecret": "",
"clientId": "",
"accessTokenUrl": "",
"challengeAlgorithm": "S256",
"scope": "openid",
"redirect_uri": "",
"grant_type": "client_credentials",
"authUrl": "",
"addTokenTo": "header",
"client_authentication": "header"
}
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "baseUrl",
"value": "<baseUrl of digital Twin Registry>",
"type": "default"
}
]
}

0 comments on commit 8a4aeb6

Please sign in to comment.