Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postman collection for access rule management. #339

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sources:
- https://github.com/eclipse-tractusx/sldt-digital-twin-registry

type: application
version: 0.4.6
version: 0.4.7
appVersion: 0.3.23

dependencies:
Expand Down
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",
"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"
}
]
}
Loading