Skip to content

Commit aa40a06

Browse files
committed
chore: merge branch 'main' of https://github.com/interledger/rafiki into feature/encrypted-data-exchange
2 parents 683096a + f5a1f0f commit aa40a06

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3716
-2326
lines changed
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
**Description of changes**
22

33

4+
**Checklist**
45

5-
**Required**
6-
7-
- [ ] Used LinkOut component on external links
8-
- [ ] Reviewed Vale errors and made changes where appropriate
9-
- [ ] Ran Prettier
10-
- [ ] Previewed updates in Netlify
11-
- [ ] Received SME and/or peer approval if updates are significant
12-
- [ ] Included a "fixes #" comment
13-
14-
**Conditional**
15-
16-
- [ ] Ensured sequence diagrams follow our style guide
17-
- [ ] Included code samples where appropriate
18-
- [ ] Updated related READMEs
6+
- PR title is prefixed with `docs:`
7+
- PR title or description includes a `fixes #`
8+
- You've run `pnpm format` and `pnpm lint`
9+
- You've reviewed Vale errors and made changes where appropriate

.github/workflows/create_monthly_sync.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,23 @@ name: Create Monthly Sync discussion
33
# First Wednesday of every month at 12AM UTC
44
on:
55
schedule:
6-
- cron: "0 0 1-7 * 3"
6+
- cron: "0 0 * * 3"
77

88
jobs:
99
create-discussion:
1010
permissions:
1111
discussions: write
1212
runs-on: ubuntu-22.04
1313
steps:
14+
- name: Check if first Wednesday
15+
id: check
16+
run: |
17+
DOM=$(date +%d)
18+
if [ "$DOM" -gt 7 ]; then
19+
echo "Not the first Wednesday of the month, skipping"
20+
exit 0
21+
fi
22+
1423
- name: Get repository information
1524
id: get-repository-info
1625
uses: octokit/graphql-action@v2.x
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
meta {
2+
name: Continuation Request
3+
type: http
4+
seq: 8
5+
}
6+
7+
post {
8+
url: {{senderOpenPaymentsContinuationUri}}
9+
body: json
10+
auth: none
11+
}
12+
13+
headers {
14+
Authorization: GNAP {{continueToken}}
15+
}
16+
17+
script:pre-request {
18+
const scripts = require('./scripts');
19+
20+
await scripts.addSignatureHeaders();
21+
}
22+
23+
script:post-response {
24+
const scripts = require('./scripts');
25+
26+
scripts.storeTokenDetails();
27+
}
28+
29+
tests {
30+
test("Status code is 200", function() {
31+
expect(res.getStatus()).to.equal(200);
32+
});
33+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
meta {
2+
name: Create Incoming Payment
3+
type: http
4+
seq: 4
5+
}
6+
7+
post {
8+
url: {{receiverOpenPaymentsHost}}/incoming-payments
9+
body: json
10+
auth: none
11+
}
12+
13+
headers {
14+
Authorization: GNAP {{accessToken}}
15+
}
16+
17+
body:json {
18+
{
19+
"walletAddress": "{{receiverWalletAddress}}",
20+
"incomingAmount": {
21+
"value": "100",
22+
"assetCode": "{{receiverAssetCode}}",
23+
"assetScale": {{receiverAssetScale}}
24+
},
25+
"expiresAt": "{{tomorrow}}",
26+
"metadata": {
27+
"description": "Free Money!"
28+
}
29+
}
30+
}
31+
32+
script:pre-request {
33+
const scripts = require('./scripts');
34+
35+
bru.setEnvVar("tomorrow", (new Date(new Date().setDate(new Date().getDate() + 1))).toISOString());
36+
37+
scripts.addHostHeader();
38+
39+
await scripts.addDirectedIdentitySignatureHeaders();
40+
}
41+
42+
script:post-response {
43+
const body = res.getBody();
44+
45+
if (body?.id) {
46+
bru.setEnvVar("incomingPaymentId", body.id.split("/").pop());
47+
}
48+
49+
}
50+
51+
tests {
52+
test("Status code is 201", function() {
53+
expect(res.getStatus()).to.equal(201);
54+
});
55+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
meta {
2+
name: Create Outgoing Payment
3+
type: http
4+
seq: 9
5+
}
6+
7+
post {
8+
url: {{senderOpenPaymentsHost}}/outgoing-payments
9+
body: json
10+
auth: none
11+
}
12+
13+
headers {
14+
Authorization: GNAP {{accessToken}}
15+
}
16+
17+
body:json {
18+
{
19+
"walletAddress": "{{senderWalletAddress}}",
20+
"quoteId": "{{senderWalletAddress}}/quotes/{{quoteId}}",
21+
"metadata": {
22+
"description": "Free Money!"
23+
}
24+
}
25+
}
26+
27+
script:pre-request {
28+
const scripts = require('./scripts');
29+
30+
scripts.addHostHeader();
31+
32+
await scripts.addSignatureHeaders();
33+
}
34+
35+
script:post-response {
36+
const body = res.getBody();
37+
38+
if (body?.id) {
39+
bru.setEnvVar("outgoingPaymentId", body.id.split("/").pop());
40+
}
41+
42+
}
43+
44+
tests {
45+
test("Status code is 201", function() {
46+
expect(res.getStatus()).to.equal(201);
47+
});
48+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
meta {
2+
name: Create Quote
3+
type: http
4+
seq: 6
5+
}
6+
7+
post {
8+
url: {{senderOpenPaymentsHost}}/quotes
9+
body: json
10+
auth: none
11+
}
12+
13+
headers {
14+
Authorization: GNAP {{accessToken}}
15+
}
16+
17+
body:json {
18+
{
19+
"walletAddress": "{{senderWalletAddress}}",
20+
"receiver": "{{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}",
21+
"method": "ilp"
22+
}
23+
}
24+
25+
script:pre-request {
26+
const scripts = require('./scripts');
27+
28+
scripts.addHostHeader();
29+
30+
await scripts.addDirectedIdentitySignatureHeaders();
31+
}
32+
33+
script:post-response {
34+
const body = res.getBody();
35+
if (body?.id) {
36+
bru.setEnvVar("quoteId", body.id.split("/").pop());
37+
bru.setEnvVar("quoteDebitAmount", JSON.stringify(body.debitAmount))
38+
bru.setEnvVar("quoteReceiveAmount", JSON.stringify(body.receiveAmount))
39+
}
40+
41+
}
42+
43+
tests {
44+
test("Status code is 201", function() {
45+
expect(res.getStatus()).to.equal(201);
46+
});
47+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
meta {
2+
name: Get Outgoing Payment
3+
type: http
4+
seq: 10
5+
}
6+
7+
get {
8+
url: {{senderOpenPaymentsHost}}/outgoing-payments/{{outgoingPaymentId}}
9+
body: none
10+
auth: none
11+
}
12+
13+
headers {
14+
Authorization: GNAP {{accessToken}}
15+
}
16+
17+
script:pre-request {
18+
const scripts = require('./scripts');
19+
20+
scripts.addHostHeader();
21+
22+
await scripts.addSignatureHeaders();
23+
}
24+
25+
tests {
26+
test("Status code is 200", function() {
27+
expect(res.getStatus()).to.equal(200);
28+
});
29+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
meta {
2+
name: Get receiver wallet address
3+
type: http
4+
seq: 2
5+
}
6+
7+
get {
8+
url: {{receiverWalletAddress}}
9+
body: none
10+
auth: none
11+
}
12+
13+
headers {
14+
Accept: application/json
15+
}
16+
17+
script:pre-request {
18+
const scripts = require('./scripts');
19+
20+
scripts.addHostHeader("receiverOpenPaymentsHost");
21+
}
22+
23+
script:post-response {
24+
const url = require('url')
25+
26+
if (res.getStatus() !== 200) {
27+
return
28+
}
29+
30+
const body = res.getBody()
31+
bru.setEnvVar("receiverAssetCode", body?.assetCode)
32+
bru.setEnvVar("receiverAssetScale", body?.assetScale)
33+
34+
const authUrl = url.parse(body?.authServer)
35+
if (
36+
authUrl.hostname.includes('cloud-nine-wallet') ||
37+
authUrl.hostname.includes('happy-life-bank')
38+
){
39+
const port = authUrl.hostname.includes('cloud-nine-wallet')? authUrl.port: Number(authUrl.port) + 1000
40+
bru.setEnvVar("receiverOpenPaymentsAuthHost", authUrl.protocol + '//localhost:' + port + authUrl.path);
41+
} else {
42+
bru.setEnvVar("receiverOpenPaymentsAuthHost", body?.authServer);
43+
}
44+
45+
const resourceUrl = url.parse(body?.resourceServer)
46+
if (
47+
resourceUrl.hostname.includes('cloud-nine-wallet') ||
48+
resourceUrl.hostname.includes('happy-life-bank')
49+
){
50+
const port = resourceUrl.hostname.includes('cloud-nine-wallet') ? bru.getEnvVar('cloudNineOpenPaymentsPort') : bru.getEnvVar('happyLifeOpenPaymentsPort')
51+
bru.setEnvVar("receiverOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
52+
} else {
53+
bru.setEnvVar("receiverOpenPaymentsHost", body?.resourceServer);
54+
}
55+
}
56+
57+
tests {
58+
test("Status code is 200", function() {
59+
expect(res.getStatus()).to.equal(200);
60+
});
61+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
meta {
2+
name: Get sender wallet address
3+
type: http
4+
seq: 1
5+
}
6+
7+
get {
8+
url: {{senderWalletAddress}}
9+
body: none
10+
auth: none
11+
}
12+
13+
headers {
14+
Accept: application/json
15+
}
16+
17+
script:pre-request {
18+
const scripts = require('./scripts');
19+
20+
scripts.addHostHeader("senderOpenPaymentsHost");
21+
}
22+
23+
script:post-response {
24+
const url = require('url')
25+
26+
if (res.getStatus() !== 200) {
27+
return
28+
}
29+
30+
const body = res.getBody()
31+
bru.setEnvVar("senderAssetCode", body?.assetCode)
32+
bru.setEnvVar("senderAssetScale", body?.assetScale)
33+
34+
const authUrl = url.parse(body?.authServer)
35+
if (
36+
authUrl.hostname.includes('cloud-nine-wallet') ||
37+
authUrl.hostname.includes('happy-life-bank')
38+
){
39+
const port = authUrl.hostname.includes('cloud-nine-wallet')? authUrl.port: Number(authUrl.port) + 1000
40+
bru.setEnvVar("senderOpenPaymentsAuthHost", authUrl.protocol + '//localhost:' + port + authUrl.path);
41+
} else {
42+
bru.setEnvVar("senderOpenPaymentsAuthHost", body?.authServer);
43+
}
44+
45+
const resourceUrl = url.parse(body?.resourceServer)
46+
if (resourceUrl.hostname.includes('cloud-nine-wallet') || resourceUrl.hostname.includes('happy-life-bank')) {
47+
const port = resourceUrl.hostname.includes('happy-life-bank') ? bru.getEnvVar('happyLifeOpenPaymentsPort') : bru.getEnvVar('cloudNineOpenPaymentsPort')
48+
bru.setEnvVar("senderOpenPaymentsHost", 'http://localhost:' + port + resourceUrl.path);
49+
} else {
50+
bru.setEnvVar("senderOpenPaymentsHost", body?.resourceServer);
51+
}
52+
}
53+
54+
tests {
55+
test("Status code is 200", function() {
56+
expect(res.getStatus()).to.equal(200);
57+
});
58+
}

0 commit comments

Comments
 (0)