Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ script:post-response {
} else {
bru.setEnvVar("receiverOpenPaymentsAuthHost", body?.authServer);
}

const resourceUrl = url.parse(body?.resourceServer)
if (
resourceUrl.hostname.includes('cloud-nine-wallet') ||
resourceUrl.hostname.includes('happy-life-bank')
){
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? 3000 : 4000
bru.setEnvVar("receiverOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
} else {
bru.setEnvVar("receiverOpenPaymentsHost", body?.resourceServer);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ script:post-response {
} else {
bru.setEnvVar("senderOpenPaymentsAuthHost", body?.authServer);
}

const resourceUrl = url.parse(body?.resourceServer)
if (resourceUrl.hostname.includes('cloud-nine-wallet') || resourceUrl.hostname.includes('happy-life-bank')) {
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? bru.getEnvVar('senderOpenPaymentsPort') : bru.getEnvVar('receiverOpenPaymentsPort')
bru.setEnvVar("senderOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
} else {
bru.setEnvVar("senderOpenPaymentsHost", body?.resourceServer);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ script:pre-request {

script:post-response {
const body = res.getBody();

if (body?.id) {
bru.setEnvVar("outgoingPaymentId", body.id.split("/").pop());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ script:post-response {
} else {
bru.setEnvVar("receiverOpenPaymentsAuthHost", body?.authServer);
}

const resourceUrl = url.parse(body?.resourceServer)
if (
resourceUrl.hostname.includes('cloud-nine-wallet') ||
resourceUrl.hostname.includes('happy-life-bank')
){
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? 3000 : 4000
bru.setEnvVar("receiverOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
} else {
bru.setEnvVar("receiverOpenPaymentsHost", body?.resourceServer);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ script:post-response {
} else {
bru.setEnvVar("senderOpenPaymentsAuthHost", body?.authServer);
}

const resourceUrl = url.parse(body?.resourceServer)
if (resourceUrl.hostname.includes('cloud-nine-wallet') || resourceUrl.hostname.includes('happy-life-bank')) {
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? bru.getEnvVar('senderOpenPaymentsPort') : bru.getEnvVar('receiverOpenPaymentsPort')
bru.setEnvVar("senderOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
} else {
bru.setEnvVar("senderOpenPaymentsHost", body?.resourceServer);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ script:post-response {
} else {
bru.setEnvVar("receiverOpenPaymentsAuthHost", body?.authServer);
}

const resourceUrl = url.parse(body?.resourceServer)
if (
resourceUrl.hostname.includes('cloud-nine-wallet') ||
resourceUrl.hostname.includes('happy-life-bank')
){
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? 3000 : 4000
bru.setEnvVar("receiverOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
} else {
bru.setEnvVar("receiverOpenPaymentsHost", body?.resourceServer);
}


}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ script:post-response {
} else {
bru.setEnvVar("senderOpenPaymentsAuthHost", body?.authServer);
}

const resourceUrl = url.parse(body?.resourceServer)
if (resourceUrl.hostname.includes('cloud-nine-wallet') || resourceUrl.hostname.includes('happy-life-bank')) {
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? bru.getEnvVar('senderOpenPaymentsPort') : bru.getEnvVar('receiverOpenPaymentsPort')
bru.setEnvVar("senderOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
} else {
bru.setEnvVar("senderOpenPaymentsHost", body?.resourceServer);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ headers {

body:json {
{
"walletAddress": {{senderWalletAddress}},
"walletAddress": "{{senderWalletAddress}}",
"quoteId": "{{senderOpenPaymentsHost}}/quotes/{{quoteId}}",
"metadata": {
"description": "yolo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ body:graphql:vars {
script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
scripts.addApiSignatureHeader('backend', 'receiver');
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ body:graphql:vars {
script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
scripts.addApiSignatureHeader('backend', 'receiver');
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ body:graphql:vars {
}
}
}

script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ body:graphql:vars {
},
"incomingAmount": null,
"walletAddressId": "{{walletAddressId}}"
},
"tenantId": "{{tenantId}}"
}
}
}

Expand Down
18 changes: 12 additions & 6 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ script:pre-request {
const randomInt = Math.floor(Math.random() * (1001));

const initialRequest = bru.getEnvVar("initialWalletAddressRequest");

const postRequest = {
method: 'post',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
const postRequestBody = {
query: initialRequest.body.query,
variables: {
"input": {
Expand All @@ -71,7 +67,17 @@ script:pre-request {
"publicName": "Simon"
}
}
})
}

const signature = scripts.generateBackendApiSignature(postRequestBody)
const postRequest = {
method: 'post',
headers: {
'Content-Type': 'application/json',
'tenant-id': bru.getEnvVar('senderTenantId'),
'signature': signature
},
body: JSON.stringify(postRequestBody)
};

const response = await fetch(`${initialRequest.url}`, postRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ headers {
}

body:graphql {
mutation CreateTenantSettings($input: [CreateTenantSettingsInput!]!) {
mutation CreateTenantSettings($input: CreateTenantSettingsInput!) {
createTenantSettings(input:$input) {
settings {
key
Expand All @@ -27,12 +27,14 @@ body:graphql {

body:graphql:vars {
{
"input": [
{
"key": "MY_KEY",
"value": "MY_VALUE"
}
]
"input": {
"settings": [
{
"key": "MY_KEY",
"value": "MY_VALUE"
}
]
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:graphql {
id
walletAddress {
id
url
address
asset {
id
code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
address: {{RafikiGraphqlHost}}/graphql
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}
Expand Down Expand Up @@ -40,7 +40,7 @@ body:graphql:vars {
{
"input": {
"assetId": "{{assetId}}",
"url": "https://{{senderOpenPaymentsHost}}/timon/{{randomId}}",
"address": "https://cloud-nine-wallet-backend/timon/{{randomId}}",
"publicName": "Timon",
"additionalProperties": [
{"key" : "iban", "value": "NL93 8601 1117 947", "visibleInOpenPayments": true},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{RafikiGraphqlHost}}/{{tenantId}}/graphql
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}
Expand Down
43 changes: 0 additions & 43 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Get Tenant Settings.bru

This file was deleted.

32 changes: 12 additions & 20 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Get Tenants.bru
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,21 @@ post {
}

body:graphql {
mutation UpdateTenant($input: UpdateTenantInput!) {
updateTenant(input:$input) {
tenant {
id
email
apiSecret
idpConsentUrl
idpSecret
query GetTenants {
tenants {
edges {
cursor
node {
id
email
apiSecret
idpConsentUrl
idpSecret
}
}
}
}
}

body:graphql:vars {
{
"input": {
"id": "{{tenantId}}",
"email": "[email protected]",
"apiSecret": "updated-test-secret",
"idpConsentUrl": "https://example.com/consent-updated",
"idpSecret": "updated-test-idp-secret"
}
}

}

script:pre-request {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ body:graphql {
}
}
}

script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ body:graphql:vars {
"input": {
"id": "{{tenantId}}",
"email": "[email protected]",
"apiSecret": "updated-test-secret",
"idpConsentUrl": "https://example.com/consent-updated",
"idpSecret": "updated-test-idp-secret"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ body:graphql {
withdrawalThreshold
createdAt
}
url
address
publicName
createdAt
status
Expand Down
3 changes: 3 additions & 0 deletions bruno/collections/Rafiki/environments/Local Playground.bru
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ vars {
assetScale: 2
senderTenantId: 438fa74a-fa7d-4317-9ced-dde32ece1787
RafikiGraphqlHostTenantId: 438fa74a-fa7d-4317-9ced-dde32ece1787
senderOpenPaymentsPort: 3000
receiverOpenPaymentsPort: 4000
receiverTenantId: cf5fd7d3-1eb1-4041-8e43-ba45747e9e5d
}
Loading
Loading