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

feat(backend): wallet address response with tenant id #2986

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
66f7217
feat(backend): create operator kratos identity on backend startup
njlie Aug 28, 2024
bc6f186
chore: formatting
njlie Aug 28, 2024
f1138cd
fix: handle new cases
njlie Aug 28, 2024
a462f0f
Add migration files
sanducb Aug 27, 2024
bb8d2a4
Update migration files
sanducb Aug 27, 2024
a9274a1
feat(tenant): basic tenant admin api schema and service
golobitch Aug 27, 2024
76818a2
Fix file name for migrations
sanducb Aug 27, 2024
3f65348
feat(auth): create basic tenant service and model plus graphql schema
golobitch Aug 27, 2024
cdd197c
feat(graphql): generated data
golobitch Aug 27, 2024
ef68ed9
feat(auth): add basic tenant schema and appropriate resources like mo…
golobitch Aug 28, 2024
452755a
feat(backend): add apollo client do dependencies
golobitch Aug 28, 2024
28d07cc
feat(auth): delete tenant
golobitch Aug 28, 2024
3096056
chore(auth): format
golobitch Aug 28, 2024
b998dd6
feat(backend): create tenant service implementation
golobitch Aug 28, 2024
d1bb78c
feat(packages): make multi tenant work wip
golobitch Aug 28, 2024
8d5e924
feat(backend): update resolvers with tenant id and finish the tenant …
golobitch Aug 29, 2024
03e2468
feat(backend): small changes to schema + mapping of tenant to graphql…
golobitch Aug 29, 2024
188f567
feat(backend,frontend): create kratos identity when tenants are creat…
njlie Aug 30, 2024
711a969
feat(wip): use tenantId in OP flow
njlie Sep 2, 2024
5a1af30
feat: quote grant requests with tenantId
njlie Sep 24, 2024
293a52d
feat: outgoing payment with tenantId
njlie Sep 24, 2024
d35a352
chore: formatting
njlie Sep 24, 2024
d7f2883
feat: bruno updates
njlie Sep 24, 2024
15ee234
chore: remove some dangling merge stuff
njlie Sep 24, 2024
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 @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsHost}}/incoming-payments
url: {{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsHost}}/outgoing-payments
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments
body: json
auth: none
}
Expand Down Expand Up @@ -35,7 +35,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 @@ -5,7 +5,7 @@ meta {
}

get {
url: {{senderOpenPaymentsHost}}/outgoing-payments/{{outgoingPaymentId}}
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments/{{outgoingPaymentId}}
body: none
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ script:post-response {
bru.setEnvVar("receiverAssetScale", body?.assetScale)

const authUrl = url.parse(body?.authServer)
const receiverTenantId = authUrl.pathname.split('/')[1]
bru.setEnvVar('receiverTenantId', receiverTenantId)
if (
authUrl.hostname.includes('cloud-nine-wallet') ||
authUrl.hostname.includes('happy-life-bank')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ script:post-response {
}

const body = res.getBody()

bru.setEnvVar("senderAssetCode", body?.assetCode)
bru.setEnvVar("senderAssetScale", body?.assetScale)

const authUrl = url.parse(body?.authServer)
const senderTenantId = authUrl.pathname.split('/')[1]
bru.setEnvVar('senderTenantId', senderTenantId)
if (
authUrl.hostname.includes('cloud-nine-wallet') ||
authUrl.hostname.includes('happy-life-bank')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsAuthHost}}/
url: {{receiverOpenPaymentsAuthHost}}/{{receiverTenantId}}
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsAuthHost}}/
url: {{senderOpenPaymentsAuthHost}}/{{senderTenantId}}
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ meta {
}

post {
url: {{receiverOpenPaymentsHost}}/incoming-payments
url: {{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments
body: json
auth: none
}

headers {
Authorization: GNAP {{accessToken}}
x-operator-secret: {{operatorApiSecret}}
}

body:json {
Expand Down Expand Up @@ -41,7 +42,7 @@ script:pre-request {

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

if (body?.id) {
bru.setEnvVar("incomingPaymentId", body.id.split("/").pop());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsHost}}/outgoing-payments
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments
body: json
auth: none
}
Expand Down 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 @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsHost}}/quotes
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/quotes
body: json
auth: none
}
Expand All @@ -17,7 +17,7 @@ headers {
body:json {
{
"walletAddress": "{{senderWalletAddress}}",
"receiver": "{{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}",
"receiver": "{{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments/{{incomingPaymentId}}",
"method": "ilp"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

get {
url: {{senderOpenPaymentsHost}}/outgoing-payments/{{outgoingPaymentId}}
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments/{{outgoingPaymentId}}
body: none
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ script:pre-request {

script:post-response {
const url = require('url')

if (res.getStatus() !== 200) {
return
}

const body = res.getBody()
bru.setEnvVar("receiverAssetCode", body?.assetCode)
bru.setEnvVar("receiverAssetScale", body?.assetScale)

const authUrl = url.parse(body?.authServer)
const receiverTenantId = authUrl.pathname.split('/')[1]
bru.setEnvVar("receiverTenantId", receiverTenantId)
if (
authUrl.hostname.includes('cloud-nine-wallet') ||
authUrl.hostname.includes('happy-life-bank')
){
const port = authUrl.hostname.includes('cloud-nine-wallet')? authUrl.port: Number(authUrl.port) + 1000
bru.setEnvVar("receiverOpenPaymentsAuthHost", authUrl.protocol + '//localhost:' + port );
bru.setEnvVar("receiverOpenPaymentsAuthHost", authUrl.protocol + '//localhost:' + port);
} else {
bru.setEnvVar("receiverOpenPaymentsAuthHost", body?.authServer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ script:post-response {
bru.setEnvVar("senderAssetScale", body?.assetScale)

const authUrl = url.parse(body?.authServer)
const senderTenantId = authUrl.pathname.split('/')[1]
bru.setEnvVar("senderTenantId", senderTenantId)
if (
authUrl.hostname.includes('cloud-nine-wallet') ||
authUrl.hostname.includes('happy-life-bank')
){
const port = authUrl.hostname.includes('cloud-nine-wallet')? authUrl.port: Number(authUrl.port) + 1000
bru.setEnvVar("senderOpenPaymentsAuthHost", authUrl.protocol + '//localhost:' + port );
bru.setEnvVar("senderOpenPaymentsAuthHost", authUrl.protocol + '//localhost:' + port);
} else {
bru.setEnvVar("senderOpenPaymentsAuthHost", body?.authServer);
}

}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsAuthHost}}/
url: {{receiverOpenPaymentsAuthHost}}/{{receiverTenantId}}
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsAuthHost}}/
url: {{senderOpenPaymentsAuthHost}}/{{senderTenantId}}
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ meta {
}

post {
url: {{senderOpenPaymentsAuthHost}}/
url: {{senderOpenPaymentsAuthHost}}/{{senderTenantId}}
body: json
auth: none
}

headers {
x-operator-secret: {{operatorApiSecret}}
}

body:json {
{
"access_token": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsHost}}/incoming-payments
url: {{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments
body: json
auth: none
}
Expand Down Expand Up @@ -36,7 +36,7 @@ script:pre-request {

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

if (body?.id) {
bru.setEnvVar("incomingPaymentId", body.id.split("/").pop());
bru.setEnvVar("quoteDebitAmount", JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsHost}}/outgoing-payments
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments
body: json
auth: none
}
Expand All @@ -17,7 +17,7 @@ headers {
body:json {
{
"walletAddress": "{{senderWalletAddress}}",
"incomingPayment": "{{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}",
"incomingPayment": "{{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments/{{incomingPaymentId}}",
"debitAmount": {
"value": "300",
"assetCode": "USD",
Expand All @@ -40,7 +40,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 @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsHost}}/outgoing-payments
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments
body: json
auth: none
}
Expand All @@ -17,7 +17,7 @@ headers {
body:json {
{
"walletAddress": "{{senderWalletAddress}}",
"incomingPayment": "{{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}",
"incomingPayment": "{{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments/{{incomingPaymentId}}",
"debitAmount": {
"value": "300",
"assetCode": "USD",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsHost}}/outgoing-payments
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments
body: json
auth: none
}
Expand All @@ -17,7 +17,7 @@ headers {
body:json {
{
"walletAddress": "{{senderWalletAddress}}",
"incomingPayment": "{{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}",
"incomingPayment": "{{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments/{{incomingPaymentId}}",
"debitAmount": {
"value": "300",
"assetCode": "USD",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

get {
url: {{senderOpenPaymentsHost}}/outgoing-payments/{{outgoingPaymentId}}
url: {{senderOpenPaymentsHost}}/{{senderTenantId}}/outgoing-payments/{{outgoingPaymentId}}
body: none
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ script:post-response {
}

const body = res.getBody()

bru.setEnvVar("receiverAssetCode", body?.assetCode)
bru.setEnvVar("receiverAssetScale", body?.assetScale)

const authUrl = url.parse(body?.authServer)
const receiverTenantId = authUrl.pathname.split('/')[1]
bru.setEnvVar('receiverTenantId', receiverTenantId)
if (
authUrl.hostname.includes('cloud-nine-wallet') ||
authUrl.hostname.includes('happy-life-bank')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ script:post-response {
bru.setEnvVar("senderAssetScale", body?.assetScale)

const authUrl = url.parse(body?.authServer)
const senderTenantId = authUrl.pathname.split('/')[1]
bru.setEnvVar('senderTenantId', senderTenantId)
if (
authUrl.hostname.includes('cloud-nine-wallet') ||
authUrl.hostname.includes('happy-life-bank')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsAuthHost}}/
url: {{receiverOpenPaymentsAuthHost}}/{{receiverTenantId}}
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{senderOpenPaymentsAuthHost}}/
url: {{senderOpenPaymentsAuthHost}}/{{senderTenantId}}
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}/complete
url: {{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments/{{incomingPaymentId}}/complete
body: json
auth: none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{receiverOpenPaymentsHost}}/incoming-payments
url: {{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments
body: json
auth: none
}
Expand Down Expand Up @@ -42,7 +42,7 @@ script:pre-request {

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

if (body?.id) {
bru.setEnvVar("incomingPaymentId", body.id.split("/").pop());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

get {
url: {{receiverOpenPaymentsHost}}/incoming-payments/{{incomingPaymentId}}
url: {{receiverOpenPaymentsHost}}/{{receiverTenantId}}/incoming-payments/{{incomingPaymentId}}
body: none
auth: none
}
Expand Down
Loading
Loading