Skip to content

Commit

Permalink
feature(graphql): add create tenant admin api (#2921)
Browse files Browse the repository at this point in the history
* refactor(backend): update rate caching (#2891)

* chore(localenv): fix startup migration (#2897)

* feat(backend): add trace to outgoing payment lifecycle (#2884)

* feat(backend): add trace to outgoing payment lifecycle

* feat(backend): encapsulate query lookup in trace

* chore(localenv): remove traces from default localenv

---------

Co-authored-by: Max Kurapov <max@interledger.org>

* Add migration files

* Update migration files

* Fix file name for migrations

* feat(tenant): basic tenant admin api schema and service

* Remove cascade deletion

* feat(auth): create basic tenant service and model plus graphql schema

* feat(graphql): generated data

* feat(graphql): add create tenant resolver and call service and update graphql schema

* feat(auth): add basic tenant schema and appropriate resources like model and service

* feat(generated): graphql schema

* feat(auth): add tenant id to create tenant input

* feat(auth): rename tenant id and add basic logic for calling create tenant service

* feat(auth): add basic create tenant functionality in service

* Add tenant model in backend

* feat(backend): add apollo client do dependencies

* feat(auth): add delete tenant mutation to the schema

* feat(auth): delete tenant

* Add tenantId field on resources models, update migration

* chore(auth): format

* feat(backend): create tenant service implementation

* feat(auth): codegen for putting generated files to backend

* feat(packages): make multi tenant work wip

* feat(mock-lib): add tenants to the seeding step

* feat(backend): update resolvers with tenant id and finish the tenant creation

* feat(localenv): update seed and docker compose

* feat(generated): graphql schema

* feat(bruno): admin auth create tenant mutation

* feat(backend): small changes to schema + mapping of tenant to graphql + bruno

* feat(everything): move endpoints to separate service, update bruno and schema do pagination and stuff

---------

Co-authored-by: Max Kurapov <max@interledger.org>
Co-authored-by: Nathan Lie <lie4nathan@gmail.com>
Co-authored-by: bsanduc <bogdan.sandu@breakpointit.eu>
  • Loading branch information
4 people authored Sep 2, 2024
1 parent f15f6de commit 4a3b3c9
Show file tree
Hide file tree
Showing 69 changed files with 3,782 additions and 127 deletions.
40 changes: 40 additions & 0 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Tenant.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
meta {
name: Create Tenant
type: graphql
seq: 50
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation CreateTenant($input: CreateTenantInput!) {
createTenant(input: $input) {
tenant {
id
}
}
}
}

body:graphql:vars {
{
"input": {
"idpConsentEndpoint": "https://interledger.org/consent",
"idpSecret": "myVerySecureSecret",
"endpoints": [
{
"type": "RatesUrl",
"value": "https://interledger.org/rates"
},
{
"type": "WebhookBaseUrl",
"value": "https://interledger.org/webhooks"
}
]
}
}
}
36 changes: 36 additions & 0 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Get Tenant.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: Get Tenant
type: graphql
seq: 51
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
query GetTenant($id: ID!) {
tenant(id:$id) {
id
kratosIdentityId
createdAt
updatedAt
endpoints {
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
}
}
}
}

body:graphql:vars {
{
"id": "7a0c75bd-6c09-4d38-b013-af89ab91557a"
}
}
11 changes: 11 additions & 0 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Get Tenants.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Get Tenants
type: graphql
seq: 52
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: none
auth: none
}
11 changes: 11 additions & 0 deletions bruno/collections/Rafiki/Rafiki Admin Auth APIs/Create Tenant.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Create Tenant
type: graphql
seq: 4
}

post {
url: {{RafikiAuthGraphqlHost}}/graphql
body: none
auth: none
}
4 changes: 4 additions & 0 deletions localenv/cloud-nine-wallet/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ ALTER DATABASE cloud_nine_wallet_auth OWNER TO cloud_nine_wallet_auth;
CREATE USER happy_life_bank_backend WITH PASSWORD 'happy_life_bank_backend';
CREATE DATABASE happy_life_bank_backend;
ALTER DATABASE happy_life_bank_backend OWNER TO happy_life_bank_backend;

CREATE USER happy_life_bank_auth WITH PASSWORD 'happy_life_bank_auth';
CREATE DATABASE happy_life_bank_auth;
ALTER DATABASE happy_life_bank_auth OWNER TO happy_life_bank_auth;
2 changes: 2 additions & 0 deletions localenv/cloud-nine-wallet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ services:
REDIS_URL: redis://shared-redis:6379/0
WALLET_ADDRESS_URL: ${CLOUD_NINE_WALLET_ADDRESS_URL:-https://cloud-nine-wallet-backend/.well-known/pay}
ILP_CONNECTOR_URL: ${CLOUD_NINE_CONNECTOR_URL:-http://cloud-nine-wallet-backend:3002}
AUTH_ADMIN_URL: http://cloud-nine-wallet-auth:3003/graphql
ENABLE_TELEMETRY: true
KEY_ID: 7097F83B-CB84-469E-96C6-2141C72E22C0
AUTH_ADMIN_API_SECRET: rPoZpe9tVyBNCigm05QDco7WLcYa0xMao7lO5KG1XG4=
depends_on:
- shared-database
- shared-redis
Expand Down
14 changes: 14 additions & 0 deletions localenv/cloud-nine-wallet/seed.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
tenants:
- name: PrimaryTenant
idpConsentUrl: https://interledger.org/consent
idpSecret: myVerySecureSecret
endpoints: [
{
"type": "RatesUrl",
"value": "https://interledger.org/rates"
},
{
"type": "WebhookBaseUrl",
"value": "https://interledger.org/webhooks"
}
]
assets:
- code: USD
scale: 2
Expand Down
1 change: 1 addition & 0 deletions localenv/happy-life-bank/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ services:
WALLET_ADDRESS_URL: ${HAPPY_LIFE_BANK_WALLET_ADDRESS_URL:-https://happy-life-bank-backend/.well-known/pay}
ENABLE_TELEMETRY: true
KEY_ID: 53f2d913-e98a-40b9-b270-372d0547f23d
AUTH_ADMIN_URL: http://happy-life-bank-auth:4003
depends_on:
- cloud-nine-backend
happy-life-auth:
Expand Down
Loading

0 comments on commit 4a3b3c9

Please sign in to comment.