Skip to content

Commit

Permalink
fix: add prerequisite script to add Content-Type: application/json to…
Browse files Browse the repository at this point in the history
… POST and PUT requests
  • Loading branch information
nikschul committed Sep 27, 2024
1 parent fb32c8b commit a6c73bc
Showing 1 changed file with 27 additions and 96 deletions.
123 changes: 27 additions & 96 deletions deployment/postman/MVD.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,17 @@
{
"name": "Get Participant By ID",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"if(pm.request.method == \"POST\" || pm.request.method == \"PUT\"){",
" pm.request.headers.add(\"Content-Type: application/json\");",
"}"
]
}
},
{
"listen": "test",
"script": {
Expand Down Expand Up @@ -847,12 +858,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"roles\":[],\n \"serviceEndpoints\":[],\n \"active\": true,\n \"participantId\": \"{{NEW_PARTICIPANT_ID}}\",\n \"did\": \"{{NEW_PARTICIPANT_ID}}\",\n \"key\":{\n \"keyId\": \"key-1\",\n \"privateKeyAlias\": \"{{NEW_PARTICIPANT_ID}}-alias\",\n \"keyGeneratorParams\":{\n \"algorithm\": \"EdDSA\",\n \"curve\": \"Ed25519\"\n }\n }\n}",
Expand Down Expand Up @@ -904,12 +910,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"roles\":[],\n \"serviceEndpoints\":[],\n \"active\": true,\n \"participantId\": \"{{NEW_PARTICIPANT_ID}}\",\n \"did\": \"{{NEW_PARTICIPANT_ID}}\",\n \"key\":{\n \"keyId\": \"key-1\",\n \"privateKeyAlias\": \"{{NEW_PARTICIPANT_ID}}-alias\",\n \"publicKeyPem\":\"-----BEGIN PUBLIC KEY-----\\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1l0Lof0a1yBc8KXhesAnoBvxZw5r\\noYnkAXuqCYfNK3ex+hMWFuiXGUxHlzShAehR6wvwzV23bbC0tcFcVgW//A==\\n-----END PUBLIC KEY-----\"\n }\n}",
Expand Down Expand Up @@ -961,12 +962,7 @@
],
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "[\n \"role1\", \"role2\", \"admin\"\n]",
Expand Down Expand Up @@ -1019,12 +1015,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "",
Expand Down Expand Up @@ -1077,12 +1068,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"roles\":[],\n \"serviceEndpoints\":[],\n \"isActive\": true,\n \"participantId\": \"foobar\",\n \"did\": \"did:web:foobar\",\n \"key\":{\n \"keyId\": \"key1\",\n \"privateKeyAlias\": \"foobar-alias\",\n \"keyGeneratorParams\":{\n \"algorithm\": \"EC\",\n \"curve\": \"secp256r1\"\n }\n }\n}",
Expand Down Expand Up @@ -1141,12 +1127,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"roles\":[],\n \"serviceEndpoints\":[],\n \"isActive\": true,\n \"participantId\": \"foobar\",\n \"did\": \"did:web:foobar\",\n \"key\":{\n \"keyId\": \"key1\",\n \"privateKeyAlias\": \"foobar-alias\",\n \"keyGeneratorParams\":{\n \"algorithm\": \"EC\",\n \"curve\": \"secp256r1\"\n }\n }\n}",
Expand Down Expand Up @@ -1205,12 +1186,7 @@
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"roles\":[],\n \"serviceEndpoints\":[],\n \"isActive\": true,\n \"participantId\": \"foobar\",\n \"did\": \"did:web:foobar\",\n \"key\":{\n \"keyId\": \"key1\",\n \"privateKeyAlias\": \"foobar-alias\",\n \"keyGeneratorParams\":{\n \"algorithm\": \"EC\",\n \"curve\": \"secp256r1\"\n }\n }\n}",
Expand Down Expand Up @@ -1333,12 +1309,7 @@
],
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"keyId\": \"key6\",\n \"privateKeyAlias\": \"new-foobar-alias5\",\n \"keyGeneratorParams\": {\n \"algorithm\": \"EdDSA\",\n \"curve\": \"Ed25519\"\n }\n}",
Expand Down Expand Up @@ -1391,12 +1362,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"keyId\": \"key2\",\n \"privateKeyAlias\": \"new-foobar-alias\",\n \"keyGeneratorParams\": {\n \"algorithm\": \"EC\",\n \"curve\": \"secp256r1\"\n }\n}",
Expand Down Expand Up @@ -1451,12 +1417,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "",
Expand Down Expand Up @@ -1536,12 +1497,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \n}",
Expand Down Expand Up @@ -1649,12 +1605,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"did\": \"did:web:BPN0000001\"\n}",
Expand Down Expand Up @@ -1708,12 +1659,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"id\": \"some-other-id\",\n \"type\": \"CredentialService\",\n \"serviceEndpoint\": \"https://foobar.myconnector.com\"\n}",
Expand Down Expand Up @@ -1768,12 +1714,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"did\": \"did:web:alice-identityhub%3A7083:connector1\"\n}",
Expand Down Expand Up @@ -1827,12 +1768,7 @@
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"did\": \"did:web:alice-identityhub%3A7083:connector1\"\n}",
Expand Down Expand Up @@ -1885,12 +1821,7 @@
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"did\": \"did:web:BPN0000001\"\n}",
Expand Down

0 comments on commit a6c73bc

Please sign in to comment.