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

feature(graphql): add create tenant admin api #2921

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5f4d0b5
refactor(backend): update rate caching (#2891)
mkurapov Aug 26, 2024
3bc368a
chore(localenv): fix startup migration (#2897)
mkurapov Aug 27, 2024
b9be601
feat(backend): add trace to outgoing payment lifecycle (#2884)
njlie Aug 27, 2024
5dfa6c4
Add migration files
sanducb Aug 27, 2024
413c904
Update migration files
sanducb Aug 27, 2024
11720c8
Fix file name for migrations
sanducb Aug 27, 2024
51ad9b9
feat(tenant): basic tenant admin api schema and service
golobitch Aug 27, 2024
b3096c4
Remove cascade deletion
sanducb Aug 27, 2024
9ae95e4
Merge remote-tracking branch 'origin/2894-multi-tenant-rafiki-update-…
golobitch Aug 27, 2024
02eaff9
feat(auth): create basic tenant service and model plus graphql schema
golobitch Aug 27, 2024
1d7dc81
feat(graphql): generated data
golobitch Aug 27, 2024
c37bbb1
feat(graphql): add create tenant resolver and call service and update…
golobitch Aug 28, 2024
87270c4
feat(auth): add basic tenant schema and appropriate resources like mo…
golobitch Aug 28, 2024
f195278
feat(generated): graphql schema
golobitch Aug 28, 2024
81a8e6b
feat(auth): add tenant id to create tenant input
golobitch Aug 28, 2024
d0b9f0f
feat(auth): rename tenant id and add basic logic for calling create t…
golobitch Aug 28, 2024
9488bbc
feat(auth): add basic create tenant functionality in service
golobitch Aug 28, 2024
7bfd9f0
Add tenant model in backend
sanducb Aug 28, 2024
1269111
feat(backend): add apollo client do dependencies
golobitch Aug 28, 2024
14ef039
feat(auth): add delete tenant mutation to the schema
golobitch Aug 28, 2024
27fede4
feat(auth): delete tenant
golobitch Aug 28, 2024
9ca2940
Add tenantId field on resources models, update migration
sanducb Aug 28, 2024
19a822a
chore(auth): format
golobitch Aug 28, 2024
35b93ec
feat(backend): create tenant service implementation
golobitch Aug 28, 2024
e03e7ec
feat(auth): codegen for putting generated files to backend
golobitch Aug 28, 2024
c52a342
feat(packages): make multi tenant work wip
golobitch Aug 28, 2024
660d36e
feat(mock-lib): add tenants to the seeding step
golobitch Aug 29, 2024
7dbb74a
feat(backend): update resolvers with tenant id and finish the tenant …
golobitch Aug 29, 2024
5d3c42f
feat(localenv): update seed and docker compose
golobitch Aug 29, 2024
ebba66f
feat(generated): graphql schema
golobitch Aug 29, 2024
ae075fa
feat(bruno): admin auth create tenant mutation
golobitch Aug 29, 2024
26a8c9b
feat(backend): small changes to schema + mapping of tenant to graphql…
golobitch Aug 29, 2024
3243c59
feat(everything): move endpoints to separate service, update bruno an…
golobitch Aug 29, 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
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
Loading