hello-world-service/docs/postman/Smartgears4 helloword.postm...

380 lines
6.9 KiB
JSON

{
"info": {
"_postman_id": "57ac2a18-0102-4843-afaf-72c05aa24207",
"name": "Smartgears4 helloword",
"description": "An example collection that can be used for communicating with gcube services\n\nget TOKEN and at UMA_TOKEN from url: [https://next.dev.d4science.org/group/gcube/home](https://next.dev.d4science.org/group/gcube/home)\n\nupdate the collection's variables gcube_token and uma_token",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "32856827"
},
"item": [
{
"name": "[UAT] Obtain CONTEXT id token for a user",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);",
"pm.collectionVariables.set(\"access_token\", jsonData.access_token);",
"pm.collectionVariables.set(\"refresh_token\", jsonData.refresh_token);",
""
],
"type": "text/javascript",
"packages": {}
}
},
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
},
{
"key": "X-D4Science-Context",
"value": "{{url-encoded-context}}",
"type": "text"
},
{
"key": "",
"value": "",
"type": "text",
"disabled": true
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "client_id",
"value": "{{client-id-user}}",
"type": "text"
},
{
"key": "username",
"value": "{{username}}",
"type": "text"
},
{
"key": "password",
"value": "{{password}}",
"type": "text"
},
{
"key": "grant_type",
"value": "password",
"type": "text"
}
]
},
"url": {
"raw": "{{keycloak_url}}/realms/{{realm}}/protocol/openid-connect/token",
"host": [
"{{keycloak_url}}"
],
"path": [
"realms",
"{{realm}}",
"protocol",
"openid-connect",
"token"
]
},
"description": "Obtain UAT = user access token from a user in realm"
},
"response": []
},
{
"name": "[UAT] refresh CONTEXT token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = JSON.parse(responseBody);",
"",
"pm.collectionVariables.set(\"access_token\", jsonData.access_token);",
"pm.collectionVariables.set(\"refresh_token\", jsonData.refresh_token);",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "X-D4Science-Context",
"value": "{{url-encoded-context}}",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "refresh_token",
"type": "text"
},
{
"key": "client_id",
"value": "{{client-id-user}}",
"type": "text"
},
{
"key": "refresh_token",
"value": "{{refresh_token}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{service_client_secret}}",
"type": "text",
"disabled": true
}
]
},
"url": {
"raw": "{{keycloak_url}}/realms/{{realm}}/protocol/openid-connect/token",
"host": [
"{{keycloak_url}}"
],
"path": [
"realms",
"{{realm}}",
"protocol",
"openid-connect",
"token"
]
}
},
"response": []
},
{
"name": "hello",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/{{application}}/hello",
"host": [
"{{base_url}}"
],
"path": [
"{{application}}",
"hello"
]
}
},
"response": []
},
{
"name": "details",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/{{application}}/details",
"host": [
"{{base_url}}"
],
"path": [
"{{application}}",
"details"
]
}
},
"response": []
},
{
"name": "auth org member",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/{{application}}/auth/org_member",
"host": [
"{{base_url}}"
],
"path": [
"{{application}}",
"auth",
"org_member"
]
}
},
"response": []
},
{
"name": "guest",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/{{application}}/guest",
"host": [
"{{base_url}}"
],
"path": [
"{{application}}",
"guest"
]
}
},
"response": []
},
{
"name": "auth member",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/{{application}}/auth/member",
"host": [
"{{base_url}}"
],
"path": [
"{{application}}",
"auth",
"member"
]
}
},
"response": []
},
{
"name": "test keycloak",
"request": {
"method": "GET",
"header": [
{
"key": "gcube-token",
"value": "{{gcube_token}}",
"type": "text",
"disabled": true
}
],
"url": {
"raw": "{{base_url}}/{{application}}/keycloak",
"host": [
"{{base_url}}"
],
"path": [
"{{application}}",
"keycloak"
],
"query": [
{
"key": "client_id",
"value": "{{current_client-id}}",
"disabled": true
}
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access_token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "base_url",
"value": "http://localhost:8081",
"type": "string"
},
{
"key": "keycloak_url",
"value": "https://accounts.dev.d4science.org/auth",
"type": "string"
},
{
"key": "url-encoded-context",
"value": "%2Fgcube%2Fdevsec%2FdevVRE",
"type": "string"
},
{
"key": "realm",
"value": "d4science",
"type": "string"
},
{
"key": "client-id-user",
"value": "next.d4science.org",
"type": "string"
},
{
"key": "application",
"value": "helloworld",
"type": "string"
},
{
"key": "username",
"value": "",
"type": "string"
},
{
"key": "password",
"value": "",
"type": "string"
},
{
"key": "access_token",
"value": ""
},
{
"key": "refresh_token",
"value": ""
}
]
}